<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>blog.joaomorais.com &#187; João Morais</title>
	<atom:link href="http://blog.joaomorais.com/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.joaomorais.com</link>
	<description>Blog about software development, personal projects and development tools.</description>
	<lastBuildDate>Mon, 10 Apr 2017 02:26:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>SugarCon 2014 &#8211; the power of i</title>
		<link>http://blog.joaomorais.com/sugarcon-2014/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sugarcon-2014</link>
		<comments>http://blog.joaomorais.com/sugarcon-2014/#comments</comments>
		<pubDate>Wed, 23 Apr 2014 16:00:13 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[SugarCRM]]></category>

		<guid isPermaLink="false">http://blog.joaomorais.com/?p=1170</guid>
		<description><![CDATA[For the first time, not only I&#8217;ll be attending as I&#8217;ll also be part of SugarCon &#8211; the biggest event about CRM &#8211; this year uniquely focused on the individual. If you&#8217;re attending as well, feel free to stop by and say hello.]]></description>
				<content:encoded><![CDATA[<p style="text-align: left;">For the first time, not only I&#8217;ll be attending as I&#8217;ll also be part of <a title="SugarCon 2014" href="http://sugarcon.sugarcrm.com/" target="_blank">SugarCon</a> &#8211; the biggest event about CRM &#8211; this year uniquely focused on the <strong>i</strong>ndividual.</p>
<p style="text-align: center;"><a href="http://sugarcon.sugarcrm.com/"><img class=" wp-image-1190 aligncenter" title="SugarCon 2014" alt="SugarCon 2014" src="http://blog.joaomorais.com/wp-content/uploads/2014/04/SugarCon2014-RegistrationBannerImage.jpg" width="750" height="217" /></a></p>
<p style="text-align: left;">If you&#8217;re attending as well, feel free to stop by and say hello.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/sugarcon-2014/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Exchange Rates library 0.1.0 is out!</title>
		<link>http://blog.joaomorais.com/open-exchange-rates-library-0-1-0-is-out/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=open-exchange-rates-library-0-1-0-is-out</link>
		<comments>http://blog.joaomorais.com/open-exchange-rates-library-0-1-0-is-out/#comments</comments>
		<pubDate>Sun, 27 Jan 2013 20:21:20 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Currencies]]></category>
		<category><![CDATA[Exchange Rates]]></category>

		<guid isPermaLink="false">http://blog.joaomorais.com/?p=1121</guid>
		<description><![CDATA[That&#8217;s right, a new version of Open Exchange Rates library is out. The previous version was released in past October when I released my first two SugarCRM packages who also make use of it. Since then, the Open Exchange Rates API has been continuously improved, which led to a perfect excuse to not only make an update but also to make an overall [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">That&#8217;s right, a new version of <a title="Open Exchange Rates library" href="http://github.com/jcsmorais/open-exchange-rates-lib" target="_blank">Open Exchange Rates library</a> is out. The previous version was released in past October when I released my first two <a title="http://blog.joaomorais.com/sugarcrm-currencies-exchange-rate-updater/" href="http://blog.joaomorais.com/sugarcrm-currencies-exchange-rate-updater/" target="_blank">SugarCRM packages</a> who also make use of it.</p>
<p style="text-align: justify;">Since then, the <a title="Open Exchange Rates API" href="http://openexchangerates.org/documentation" target="_blank">Open Exchange Rates API</a> has been continuously improved, which led to a perfect excuse to not only make an update but also to make an overall review of the library.</p>
<p style="text-align: justify;"><span id="more-1121"></span>Going straight to the point let&#8217;s see the newly supported features in detail.</p>
<p style="text-align: justify;">Concerning the rates services, previously, one could only fetch the full list &#8211; now there&#8217;s also the ability to fetch rates against a specific set of ISO 4217 values, thus retrieving only the exchange rates according to the latter. Furthermore, and as you probably know, the retrieved rates were calculated with USD as base rate, this has also changed, and at the moment one can also supply a specific ISO 4217 value to be used as a base rate.</p>
<p style="text-align: justify;">Bellow follow a list of usage examples, who explain in detail how these new features work:</p>
<ul style="text-align: justify;">
<li><a href="https://github.com/jcsmorais/open-exchange-rates-lib/wiki/Usage#wiki-how-to-retrieve-latest-exchange-rates-for-specific-iso4217-values">How to retrieve latest exchange rates for specific Iso4217 values?</a></li>
<li><a href="https://github.com/jcsmorais/open-exchange-rates-lib/wiki/Usage#wiki-how-to-retrieve-exchange-rates-for-a-specific-date-and-iso4217-values">How to retrieve exchange rates for a specific date and Iso4217 values?</a></li>
<li><a href="https://github.com/jcsmorais/open-exchange-rates-lib/wiki/Usage#wiki-how-to-retrieve-latest-exchange-rates-with-a-base-rate-different-than-usd">How to retrieve latest exchange rates with a base rate different than USD?</a></li>
<li><a href="https://github.com/jcsmorais/open-exchange-rates-lib/wiki/Usage#wiki-how-to-retrieve-latest-exchange-rates-for-specific-iso4217-values-with-a-base-rate-different-than-usd">How to retrieve latest exchange rates for specific Iso4217 values with a base rate different than USD?</a></li>
</ul>
<p style="text-align: justify;">As previously mentioned, an overall review of the library was also made, resulting in what I believe to be a very significant improvement, not only in terms of source code quality where the hand-written autoloader got replaced by the one supplied by Composer, PSR-0 compliant, but also with the cleanup made in order to also comply with PSR-2.</p>
<p style="text-align: justify;">Concerning the library as a whole, there were also significant improvements, specially with the addition of unit tests, who are currently doing a code-coverage of 91.67%, and the setup of <a title="Travis CI: Open Exchange Rates library" href="https://travis-ci.org/jcsmorais/open-exchange-rates-lib" target="_blank">Travis CI</a>, a hosted continuous integration service who makes sure  everything is working as supposed against PHP 5.3 and 5.4 versions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/open-exchange-rates-library-0-1-0-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SugarCRM: Currencies Exchange Rate Updater</title>
		<link>http://blog.joaomorais.com/sugarcrm-currencies-exchange-rate-updater/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sugarcrm-currencies-exchange-rate-updater</link>
		<comments>http://blog.joaomorais.com/sugarcrm-currencies-exchange-rate-updater/#comments</comments>
		<pubDate>Tue, 30 Oct 2012 03:18:36 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Currencies]]></category>
		<category><![CDATA[Exchange Rates]]></category>
		<category><![CDATA[SugarCRM]]></category>
		<category><![CDATA[SugarCRM 6.x]]></category>

		<guid isPermaLink="false">http://blog.joaomorais.com/?p=1099</guid>
		<description><![CDATA[Not long ago, I wrote a post about the need of a free service that provided a variety of information related to currencies who led me to Open Exchange Rates: Real-time exchange rates for developers! At that time I also mentioned how I had a couple of projects in mind related with the library I wrote then, curiously, one [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">Not long ago, I wrote a <a title="Open Exchange Rates: Real-time exchange rates for developers" href="http://blog.joaomorais.com/open-exchange-rates-real-time-exchange-rates-for-developers/" target="_blank">post</a> about the need of a free service that provided a variety of information related to currencies who led me to <a title="Open Exchange Rates: Real-time exchange rates for developers" href="http://openexchangerates.org" target="_blank">Open Exchange Rates: Real-time exchange rates for developers</a>!</p>
<p style="text-align: justify;">At that time I also mentioned how I had a couple of projects in mind related with the library I wrote then, curiously, one of these projects also matched a <a title="SugarOutfitters: Currency automatic updater" href="http://www.sugaroutfitters.com/wanted/view/6" target="_blank">need felt by others</a>: improving/automating the way how exchange rate updates are made in SugarCRM projects.</p>
<p style="text-align: justify;">Two months later, more or less, I&#8217;m back with news regarding these projects: a few minutes ago I&#8217;ve released publicly, and more important, freely, my two first SugarCRM packages.</p>
<p style="text-align: justify;"><span id="more-1099"></span>The first one, is <a href="http://blog.joaomorais.com/wp-content/uploads/2015/03/OpenExchangeRates-0.0.1.zip" target="_blank">Open Exchange Rates library for SugarCRM</a>,  a package built to ease the pain of integrating the <a title="Open Exchange Rates library" href="http://github.com/jcsmorais/open-exchange-rates-lib" target="_blank">Open Exchange Rates library</a>, in SugarCRM projects. The second one, actually depends on the first, is <a href="http://blog.joaomorais.com/wp-content/uploads/2015/03/CurrenciesExchangeRateUpdater-0.0.1.zip" target="_blank">Currencies Exchange Rate Updater</a>, a SugarCRM package designed to ease the process of updating active currencies exchange rates with the help of external data sources.</p>
<p><iframe src="http://www.youtube.com/embed/s9R3dIlWNO4" height="315" width="420" frameborder="0"></iframe></p>
<p style="text-align: justify;">The <a title="SugarCRM: Currencies Exchange Rate Updater" href="http://goo.gl/z8Z5p" target="_blank">video</a> above, illustrates not only the installation process of these packages, but also the two different workflows supported by the latter, who enable an easy management of active currencies exchange rates updates. Either manually by filling latest rates values by hand or by importing these values from an external data source, or automatically, by defining a scheduler job who becomes responsible for performing this updates on a regular basis.</p>
<p style="text-align: justify;">Both packages can be downloaded on SugarForge (<a title="Open Exchange Rates library for SugarCRM" href="http://www.sugarforge.org/projects/oer/" target="_blank">here</a> and <a title="SugarCRM: Currencies Exchange Rate Updater" href="http://www.sugarforge.org/projects/ceru/" target="_blank">here</a>) and on GitHub (<a title="Open Exchange Rates library for SugarCRM" href="http://github.com/jcsmorais/open-exchange-rates-lib-for-sugarcrm" target="_blank">here</a> and <a title="SugarCRM: Currencies Exchange Rate Updater" href="http://github.com/jcsmorais/currencies-exchange-rate-updater" target="_blank">here</a>) respectively.</p>
<p style="text-align: justify;">Keep in mind that both packages are still beta, feel free to get in touch if you find some strange behavior, need any help or if you want to somehow contribute to any of these packages.</p>
<p style="text-align: justify;">To finish, I would like to thank <a title="Joss Crowcroft" href="http://twitter.com/josscrowcroft" target="_blank">Joss Crowcroft</a> for supporting the  <a title="Open Exchange Rates library" href="http://github.com/jcsmorais/open-exchange-rates-lib" target="_blank">Open Exchange Rates library</a> developments by lending me a paid account in order to test paid services and <a title="Filipe Guerra" href="http://twitter.com/alias_mac" target="_blank">Filipe Guerra</a> for his feedback and help on testing both packages.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/sugarcrm-currencies-exchange-rate-updater/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Codebits VI</title>
		<link>http://blog.joaomorais.com/codebits-vi/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=codebits-vi</link>
		<comments>http://blog.joaomorais.com/codebits-vi/#comments</comments>
		<pubDate>Fri, 05 Oct 2012 14:36:46 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Codebits]]></category>
		<category><![CDATA[Codebits 2012]]></category>
		<category><![CDATA[Codebits VI]]></category>
		<category><![CDATA[Sapo]]></category>

		<guid isPermaLink="false">http://blog.joaomorais.com/?p=1088</guid>
		<description><![CDATA[For the 3rd year in a row, I will be attending the biggest and geekiest event in Portugal!]]></description>
				<content:encoded><![CDATA[<p>For the 3rd year in a row, I will be attending the biggest and geekiest event in Portugal!<a href="http://codebits.eu"><img class="aligncenter size-full wp-image-1093" title="Codebits VI" src="http://blog.joaomorais.com/wp-content/uploads/2012/10/SAPO-Codebits-2012.jpg" alt="" width="607" height="146" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/codebits-vi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Exchange Rates: Real-time exchange rates for developers</title>
		<link>http://blog.joaomorais.com/open-exchange-rates-real-time-exchange-rates-for-developers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=open-exchange-rates-real-time-exchange-rates-for-developers</link>
		<comments>http://blog.joaomorais.com/open-exchange-rates-real-time-exchange-rates-for-developers/#comments</comments>
		<pubDate>Mon, 20 Aug 2012 20:43:53 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Currencies]]></category>
		<category><![CDATA[Exchange Rates]]></category>

		<guid isPermaLink="false">http://blog.joaomorais.com/?p=1063</guid>
		<description><![CDATA[Last week I was surfing the web looking for a free service that provided a variety of information related to currencies, namely: a list of currencies, their Iso4217 values and their exchange rates. After a while I&#8217;ve found Open Exchange Rates, which seemed to answer all my needs. It&#8217;s services are available in three flavours: [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">Last week I was surfing the web looking for a free service that provided a variety of information related to currencies, namely: a list of currencies, their Iso4217 values and their exchange rates.</p>
<p style="text-align: justify;"><span id="more-1063"></span>After a while I&#8217;ve found <a title="Open Exchange Rates: real-time exchange rates for developers " href="http://openexchangerates.org/" target="_blank">Open Exchange Rates</a>, which seemed to answer all my needs.</p>
<p style="text-align: justify;">It&#8217;s services are available in three flavours: one free for personal use, with a few restrictions and two other versions, which are paid but have support for a whole new set of features.</p>
<p style="text-align: justify;">&#8216;Cause I&#8217;ve a couple of projects in mind that would benefit of such data sources I decided to write <a title="Open Exchange Rates Library" href="http://github.com/jcsmorais/open-exchange-rates-lib" target="_blank">a library</a> to interact with such services, besides that, and because someone else might be looking for something similar I&#8217;ve also shared it on <a title="Open Exchange Rates Library" href="http://github.com/jcsmorais/open-exchange-rates-lib" target="_blank">github</a>.</p>
<p style="text-align: justify;">Besides the documentation delivered with the code you can also take a look at the <a title="Open Exchange Rates Library: Usage" href="http://github.com/jcsmorais/open-exchange-rates-lib/wiki/Usage" target="_blank">usage examples</a> I&#8217;ve created in the project wiki.</p>
<p style="text-align: justify;">Feel free to get in touch if you need any help or if you want to contribute to the library.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/open-exchange-rates-real-time-exchange-rates-for-developers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to force a view to load other modules languages into SUGAR.language?</title>
		<link>http://blog.joaomorais.com/how-to-force-a-view-to-load-other-modules-languages-into-sugar-language/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-force-a-view-to-load-other-modules-languages-into-sugar-language</link>
		<comments>http://blog.joaomorais.com/how-to-force-a-view-to-load-other-modules-languages-into-sugar-language/#comments</comments>
		<pubDate>Sat, 26 May 2012 18:27:33 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Papers]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[SugarCRM]]></category>
		<category><![CDATA[SugarCRM 6.x]]></category>
		<category><![CDATA[Views]]></category>

		<guid isPermaLink="false">http://blog.joaomorais.com/?p=1030</guid>
		<description><![CDATA[As you should know each SugarCRM view extends SugarView class which has a nifty method called _displayJavascript()  who is responsible for including all needed JavaScript files. When it comes to labels, by default, this function only loads current module labels into SUGAR.language. These labels are acessible through the following command: SUGAR.language.get('&#60;ModuleName&#62;', 'LBL_&#60;LabelName&#62;'); In order to add [...]]]></description>
				<content:encoded><![CDATA[<p><img class="alignright  wp-image-1026" title="SugarCRM" alt="SugarCRM" src="http://blog.joaomorais.com/wp-content/uploads/2012/05/sugarCRM-logo.jpg" width="229" height="110" />As you should know each <a title="SugarCRM" href="http://www.sugarcrm.com/" target="_blank">SugarCRM</a> view extends SugarView class which has a nifty method called _displayJavascript()  who is responsible for including all needed JavaScript files.</p>
<p>When it comes to labels, by default, this function only loads current module labels into SUGAR.language.</p>
<p><span id="more-1030"></span>These labels are acessible through the following command:</p>
<pre class="brush:js">SUGAR.language.get('&lt;ModuleName&gt;', 'LBL_&lt;LabelName&gt;');</pre>
<p>In order to add support to other module labels to be included, you should override _displayJavascript() method in your modules view, and specify which other modules labels should be included.</p>
<pre class="brush:php">// modules/&lt;ModuleName&gt;/views/view.edit.php

require_once 'include/MVC/View/views/view.edit.php';

class &lt;ModuleName&gt;ViewEdit extends ViewEdit
{
    protected function _displayJavascript()
    {
        parent::_displayJavascript();

        if (!$this-&gt;_getOption('show_javascript')) {
            return;
        }

        $modules = array(
            '&lt;Module1Name&gt;',
            '&lt;Module2Name&gt;',
        );

        foreach ($modules as $module) {
            if (!is_file($GLOBALS['sugar_config']['cache_dir'] . 'jsLanguage/' . $module . '/' . $GLOBALS['current_language'] . '.js')) {
                require_once 'include/language/jsLanguage.php';
                jsLanguage::createModuleStringsCache($module, $GLOBALS['current_language']);
            }
            echo '&lt;script type="text/javascript" src="' . $GLOBALS['sugar_config']['cache_dir'] . 'jsLanguage/' . $module . '/' . $GLOBALS['current_language'] . '.js?s=' . $GLOBALS['js_version_key'] . '&amp;c=' . $GLOBALS['sugar_config']['js_custom_version'] . '&amp;j=' . $GLOBALS['sugar_config']['js_lang_version'] . '"&gt;&lt;/script&gt;';
        }
    }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/how-to-force-a-view-to-load-other-modules-languages-into-sugar-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to reset field values on bean duplication?</title>
		<link>http://blog.joaomorais.com/how-to-reset-field-values-on-bean-duplication/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-reset-field-values-on-bean-duplication</link>
		<comments>http://blog.joaomorais.com/how-to-reset-field-values-on-bean-duplication/#comments</comments>
		<pubDate>Sat, 26 May 2012 17:58:14 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Papers]]></category>
		<category><![CDATA[Bean]]></category>
		<category><![CDATA[SugarCRM]]></category>
		<category><![CDATA[SugarCRM 6.x]]></category>
		<category><![CDATA[Views]]></category>

		<guid isPermaLink="false">http://blog.joaomorais.com/?p=1008</guid>
		<description><![CDATA[What you need to do is inject some logic to clear selected field values before the view is displayed. Like all other stuff made in SugarCRM, this process also depends on what type of module you&#8217;re hacking, in other words, the place where you&#8217;re going to write the logic depends if you&#8217;re hacking a custom [...]]]></description>
				<content:encoded><![CDATA[<p><img class="alignright  wp-image-1026" title="SugarCRM" alt="SugarCRM" src="http://blog.joaomorais.com/wp-content/uploads/2012/05/sugarCRM-logo.jpg" width="229" height="110" />What you need to do is inject some logic to clear selected field values before the view is displayed.</p>
<p>Like all other stuff made in <a title="SugarCRM" href="http://www.sugarcrm.com/" target="_blank">SugarCRM</a>, this process also depends on what type of module you&#8217;re hacking, in other words, the place where you&#8217;re going to write the logic depends if you&#8217;re hacking a custom module or a core one.</p>
<p><span id="more-1008"></span>Before you perform view customizations on core modules you should check first if the view is already implemented, in this case, you should check if the following file exists:</p>
<pre class="brush:shell">modules/&lt;ModuleName&gt;/views/view.edit.php</pre>
<p>If so, you should create a new file on:</p>
<pre class="brush:shell">custom/modules/&lt;ModuleName&gt;/views/view.edit.php</pre>
<p>and add further customizations.</p>
<p>Beware that on latest <a title="SugarCRM" href="http://www.sugarcrm.com/" target="_blank">SugarCRM</a> versions, you&#8217;re able to create custom views without having to copy all the logic from the core ones, and by that I mean that now you&#8217;re able to &#8220;truly&#8221; extend the custom views from the latter.</p>
<p>In order to achieve this the view name should be prefixed with &#8216;Custom&#8217;:</p>
<div>
<pre class="brush:php">// custom/modules/&lt;ModuleName&gt;/views/view.edit.php

require_once 'modules/&lt;ModuleName&gt;/views/view.edit.php

class Custom&lt;ModuleName&gt;ViewEdit extends &lt;ModuleName&gt;ViewEdit {
    /** 
     * ...
     */
}</pre>
</div>
<p>If by instance you&#8217;re hacking a core module that doesn&#8217;t have the view defined, you should create it like the example above but with a few differences:</p>
<pre class="brush:php">// custom/modules/&lt;ModuleName&gt;/views/view.edit.php

require_once 'include/MVC/View/views/view.edit.php';

class Custom&lt;ModuleName&gt;ViewEdit extends ViewEdit {
    /** 
     * ...
     */
}</pre>
<p>One thing to keep in mind is that if you&#8217;re hacking a custom module, you are able to choose which directory suits you best. As opposite to the examples above, on the example below, the logic is written directly on the module main folder.</p>
<pre class="brush:php">// modules/&lt;ModuleName&gt;/views/view.edit.php

require_once 'include/MVC/View/views/view.edit.php';

class &lt;ModuleName&gt;ViewEdit extends ViewEdit
{
    public function display()
    {
        $this-&gt;_processDuplicate();
        parent::display();
    }

    /**
     * How bean will act on edit view when it's being duplicated.
     */
    protected function _processDuplicate()
    {
        if ($this-&gt;ev-&gt;isDuplicate) {
            $this-&gt;bean-&gt;&lt;FieldName&gt; = '';
        }
    }
}</pre>
<p>Thanks to Jeff Bickart of <a title="Nepo Systems" href="http://www.neposystems.com/" target="_blank">Nepo Systems</a> and Matthew Poer of <a title="Profiling Solutions" href="http://www.profilingsolutions.com" target="_blank">Profiling Solutions</a> for pointing the &#8220;truly&#8221; Custom views feature out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/how-to-reset-field-values-on-bean-duplication/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Date conversions with strtotime</title>
		<link>http://blog.joaomorais.com/date-conversions-with-strtotime/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=date-conversions-with-strtotime</link>
		<comments>http://blog.joaomorais.com/date-conversions-with-strtotime/#comments</comments>
		<pubDate>Sat, 19 May 2012 08:52:52 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Papers]]></category>

		<guid isPermaLink="false">http://blog.joaomorais.com/?p=988</guid>
		<description><![CDATA[At times, while developing custom features in projects there&#8217;s a need to make date conversions. Usually people tend to use strotime() indiscriminately, without being aware of its limitations. Although it is an awesome function, it needs to be used with care, otherwise it may lead to unexpected behaviors. Below there&#8217;s a list of notes, also available in the [...]]]></description>
				<content:encoded><![CDATA[<p><a href="www.php.net"><img class="size-thumbnail wp-image-1004 alignright" title="PHP" src="http://blog.joaomorais.com/wp-content/uploads/2012/05/php-logo-150x150.jpg" alt="PHP" width="150" height="150" /></a>At times, while developing custom features in projects there&#8217;s a need to make date conversions.</p>
<p style="text-align: justify;">Usually people tend to use <a title="strtotime() on PHP Manual" href="http://www.php.net/strtotime" target="_blank">strotime()</a> indiscriminately, without being aware of its limitations. Although it is an awesome function, it needs to be used with care, otherwise it may lead to unexpected behaviors.</p>
<p style="text-align: justify;"><span id="more-988"></span>Below there&#8217;s a list of notes, also available in the <a title="strtotime() on PHP Manual" href="http://www.php.net/strtotime" target="_blank">PHP documentation</a>, that everyone should keep in mind before using this function:</p>
<p style="text-align: justify;">If the number of the <strong>year is specified in a two digit format</strong>, the<strong> values between 00-69 are mapped to 2000-2069 and 70-99 to 1970-1999</strong>. See the notes below for <strong>possible differences on 32bit systems</strong> (possible dates might end on 2038-01-19 03:14:07).</p>
<p style="text-align: justify;">The <strong>valid range of a timestamp</strong> is typically from <strong>Fri, 13 Dec 1901 20:45:54 UTC to Tue, 19 Jan 2038 03:14:07 UTC</strong>. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer.) Additionally, not all platforms support negative timestamps, therefore your date range may be limited to no earlier than the Unix epoch. This means that e.g. dates prior to Jan 1, 1970 will not work on Windows, some Linux distributions, and a few other operating systems. PHP 5.1.0 and newer versions overcome this limitation though. <strong>For 64-bit versions of PHP, the valid range of a timestamp is effectively infinite</strong>, as 64 bits can represent approximately 293 billion years in either direction.</p>
<p style="text-align: justify;"><strong>Dates in the m/d/y or d-m-y formats</strong> are disambiguated by looking at the separator between the various components: <strong>if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.)</strong>, then the European d-m-y format is assumed. To avoid potential ambiguity, <strong>it&#8217;s best to use ISO 8601 (YYYY-MM-DD) dates or</strong> <a title="DateTime::createFromFormat() on PHP Manual" href="http://www.php.net/manual/en/datetime.createfromformat.php" target="_blank">DateTime::createFromFormat()</a> when possible.</p>
<p style="text-align: justify;">Using this function <strong>for mathematical operations is not advisable</strong>. It is better to use <a title="DateTime::add() on PHP Manual" href="http://www.php.net/manual/en/datetime.add.php" target="_blank">DateTime::add()</a> and <a title="DateTime::sub() on PHP Manual" href="http://www.php.net/manual/en/datetime.sub.php" target="_blank">DateTime::sub()</a> <strong>in PHP 5.3</strong> and later, or <a title="DateTime::modify() on PHP Manual" href="http://www.php.net/manual/en/datetime.modify.php" target="_blank">DateTime::modify()</a> <strong>in PHP 5.2</strong>.</p>
<p style="text-align: justify;">Returns a <strong>timestamp on success, FALSE otherwise. Previous to PHP 5.1.0</strong>, this function <strong>would return -1 on failure</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/date-conversions-with-strtotime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codebits V</title>
		<link>http://blog.joaomorais.com/codebits-v/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=codebits-v</link>
		<comments>http://blog.joaomorais.com/codebits-v/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 00:00:36 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Codebits]]></category>
		<category><![CDATA[Codebits 2011]]></category>
		<category><![CDATA[Codebits V]]></category>
		<category><![CDATA[Sapo]]></category>

		<guid isPermaLink="false">http://blog.joaomorais.com/?p=898</guid>
		<description><![CDATA[As last year, this year I will also participate in the event!]]></description>
				<content:encoded><![CDATA[<p>As last year, this year I will also participate in the event!<a href="http://www.codebits.eu"><img class="size-full wp-image-899 alignleft" title="Codebits V" src="http://blog.joaomorais.com/wp-content/uploads/2012/02/codebits2011.png" alt="" width="541" height="147" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/codebits-v/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SugarCRM Code Sprint: München 2011</title>
		<link>http://blog.joaomorais.com/sugarcrm-code-sprint-munchen-2011/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sugarcrm-code-sprint-munchen-2011</link>
		<comments>http://blog.joaomorais.com/sugarcrm-code-sprint-munchen-2011/#comments</comments>
		<pubDate>Sat, 01 Oct 2011 00:00:57 +0000</pubDate>
		<dc:creator>João Morais</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Code Sprint]]></category>
		<category><![CDATA[DRI]]></category>
		<category><![CDATA[München]]></category>
		<category><![CDATA[Munich]]></category>
		<category><![CDATA[SugarCRM]]></category>

		<guid isPermaLink="false">http://blog.joaomorais.com/?p=892</guid>
		<description><![CDATA[Thanks to DRI, this year I&#8217;m attending the event!]]></description>
				<content:encoded><![CDATA[<p>Thanks to <a title="DRI: Open Solutions for Open Minds" href="http://www.dri-global.com" target="_blank">DRI</a>, this year I&#8217;m attending the event!<a href="http://www.amiando.com/codesprint.html"><img class="aligncenter  wp-image-893" title="SugarCRM Code Sprint: München 2011" src="http://blog.joaomorais.com/wp-content/uploads/2012/02/sugarcrm-codesprint-munich.png" alt="" width="950" height="400" /></a></p>
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://blog.joaomorais.com/sugarcrm-code-sprint-munchen-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
