<?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; SugarCRM 6.x</title>
	<atom:link href="http://blog.joaomorais.com/tag/sugarcrm-6-x/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>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>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>
	</channel>
</rss>
