<?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>Redink Design &#187; SugarCRM</title>
	<atom:link href="http://redinkdesign.net/category/open-source/sugar-crm/feed/" rel="self" type="application/rss+xml" />
	<link>http://redinkdesign.net</link>
	<description>Good code is its own best documentation</description>
	<lastBuildDate>Fri, 06 Jan 2012 22:25:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adding a Link in a SugarCRM Dashlet</title>
		<link>http://redinkdesign.net/programming/adding-a-link-in-a-sugarcrm-dashlet/</link>
		<comments>http://redinkdesign.net/programming/adding-a-link-in-a-sugarcrm-dashlet/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 20:15:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SugarCRM]]></category>

		<guid isPermaLink="false">http://redinkdesign.net/?p=155</guid>
		<description><![CDATA[I&#8217;m going to use the Tasks Module as an example. I will link the &#8216;Contact&#8217; field to the contacts module detail view.
Open /modules/Tasks/Dashlets/MyTasksDashlet/MyTasksDashlet.data.php
Initially it looks like this:


'contact_name' =&#62; array(
 'width'   =&#62; '8',
 'label'   =&#62; 'LBL_LIST_CONTACT'
),

To make this field link to the contacts module:

'contact_name' =&#62; array(
 'width'   =&#62; '8',
 'label'   =&#62; 'LBL_LIST_CONTACT',
 ]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m going to use the Tasks Module as an example. I will link the &#8216;Contact&#8217; field to the contacts module detail view.</p>
<p>Open /modules/Tasks/Dashlets/MyTasksDashlet/MyTasksDashlet.data.php</p>
<p>Initially it looks like this:</p>
<pre class="brush: php;">

'contact_name' =&gt; array(
 'width'   =&gt; '8',
 'label'   =&gt; 'LBL_LIST_CONTACT'
),
</pre>
<p>To make this field link to the contacts module:</p>
<pre class="brush: php;">
'contact_name' =&gt; array(
 'width'   =&gt; '8',
 'label'   =&gt; 'LBL_LIST_CONTACT',
 'link' =&gt; true,
 'action' =&gt; 'DetailView',
 'module' =&gt; 'Contacts',
 'id' =&gt; 'CONTACT_ID',
 'related_fields' =&gt; array('contact_id')
 ),
</pre>
<p>The main fields are:<br />
link: True/False<br />
module: The name of the destination module<br />
action: DetailView or EditView<br />
id: The field that contains the ID for the related field. If it doesn&#8217;t work lower case, try it in uppercase<br />
related_fields: The field that contains the relation ID &#8211; This should be the same as &#8216;id&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://redinkdesign.net/programming/adding-a-link-in-a-sugarcrm-dashlet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove (Hide) a SugarCRM Subpanel</title>
		<link>http://redinkdesign.net/open-source/remove-hide-a-sugarcrm-subpanel/</link>
		<comments>http://redinkdesign.net/open-source/remove-hide-a-sugarcrm-subpanel/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 11:11:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[SugarCRM]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[You can hide a SubPanel in an upgrade safe way but unsetting the subpanel via PHP. 

Example:

You can hid the Leads SubPanel into Accounts module by customizing the custom/modules/Accounts/Ext/Layoutdefs/layoutdefs.ext.php, which is a upgrade safe customization. Add the following to the end of the file, before the closing PHP tag.

<code>
unset($layout_defs['Accounts']['subpanel_setup']['leads']);
</code]]></description>
			<content:encoded><![CDATA[<p>You can hide a SubPanel in an upgrade safe way but unsetting the subpanel via PHP.</p>
<p>Example:</p>
<p>You can hid the Leads SubPanel into Accounts module by customizing the custom/modules/Accounts/Ext/Layoutdefs/layoutdefs.ext.php, which is a upgrade safe customization. Add the following to the end of the file, before the closing PHP tag.</p>
<pre class="brush: php;">
unset($layout_defs['Accounts']['subpanel_setup']['leads']);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://redinkdesign.net/open-source/remove-hide-a-sugarcrm-subpanel/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Remove SugarCRM Custom Relationship</title>
		<link>http://redinkdesign.net/open-source/remove-sugarcrm-custom-relationship/</link>
		<comments>http://redinkdesign.net/open-source/remove-sugarcrm-custom-relationship/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 11:01:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[SugarCRM]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[After searching for a while, I finally found out how to manually delete or remove a sugar crm relationship that was created in studio.  I tested this on Sugar 5.2 Professional and it seems to work just fine. Use at your own risk.

When you create a new relationship through Admin -&#62; Studio -&#62;  -&#62; Relationships, Sugar create several files at custom folders:

Left Side Hand Relationship (module from which you created the relationship):
custom/Extension/modules//Ext/Vardefs/.php
]]></description>
			<content:encoded><![CDATA[<p>After searching for a while, I finally found out how to manually delete or remove a sugar crm relationship that was created in studio.  I tested this on Sugar 5.2 Professional and it seems to work just fine. Use at your own risk.</p>
<p>When you create a new relationship through Admin -&gt; Studio -&gt;  -&gt; Relationships, Sugar create several files at custom folders:<br />
<strong><br />
Left Side Hand Relationship (module from which you created the relationship):</strong><br />
custom/Extension/modules/{moduleName}/Ext/Vardefs/{relationshipName}.php<br />
custom/Extension/modules/{moduleName}/Ext/Layoutdefs/{relationshipName}.php<br />
custom/Extension/modules/{moduleName}/Ext/Language/{relationshipName}.php</p>
<p><strong>Right Side Hand Relationship:</strong><br />
custom/Extension/modules/{moduleName}/Ext/Vardefs/{relationshipName}.php<br />
custom/Extension/modules/{moduleName}/Ext/Language/{relationshipName}.php</p>
<p><strong>Relationship itself:</strong><br />
custom/metadata/{relationshipName}Meta.php</p>
<p><strong>Table Dictionary:</strong><br />
custom/Extension/application/Ext/TableDictionary/{relationshipName}.php</p>
<p><strong>Edit</strong> custom/application/Ext/TableDictionary/tabledictionary.ext.php file and delete include(&#8216;custom/metadata/{relationshipName}.php&#8217;);</p>
<p>To remove the relationship, you need to delete these files. After removing all these files you should need to go to <strong>Admin -&gt; Repair -&gt; Quick Repair and Rebuild</strong></p>
<p>Original post:</p>
<p>http://www.sugarcrm.com/forums/showthread.php?t=37781</p>
]]></content:encoded>
			<wfw:commentRss>http://redinkdesign.net/open-source/remove-sugarcrm-custom-relationship/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>vBulletin Social Group Icons in Postbit</title>
		<link>http://redinkdesign.net/open-source/vbulletin/vbulletin-social-group-icons-in-postbit/</link>
		<comments>http://redinkdesign.net/open-source/vbulletin/vbulletin-social-group-icons-in-postbit/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 12:54:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[SugarCRM]]></category>
		<category><![CDATA[vBulletin]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Here's a quick plugin I wrote for vBulletin to display social group icons on the postbit. The social group icon for each public social group the user belongs to will be displayed. Please see attachment.

To install, just import the plugin via the admin panel.

This plugin was only tested on vBulletin 3.8 on http://www.b15u.com. Please use at your own risk]]></description>
			<content:encoded><![CDATA[<p>This code has been updated for vBulletin 4.0. It&#8217;s no longer supported for vBulletin 3.x.</p>
<p>For the latest version, go here</p>
<p><a href="https://github.com/redinkdesign/Social-Group-Icons-in-Postbit">https://github.com/redinkdesign/Social-Group-Icons-in-Postbit</a></p>
<p><a href="http://redinkdesign.net/files/2009/12/icons.jpg"><img class="alignnone size-full wp-image-82" title="icons" src="http://redinkdesign.net/files/2009/12/icons.jpg" alt="" width="108" height="352" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://redinkdesign.net/open-source/vbulletin/vbulletin-social-group-icons-in-postbit/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Sugar CRM &#8211; Entry Point Registry</title>
		<link>http://redinkdesign.net/open-source/sugar-crm-entry-point-registry/</link>
		<comments>http://redinkdesign.net/open-source/sugar-crm-entry-point-registry/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 11:57:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[SugarCRM]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[To register new custom entry points for Sugar CRM, do the following you have to create the file custom/include/MVC/Controller/entry_point_registry.php

Contents should be the following: 

<code>

$entry_point_registry['entry_point_name'] = array('file' =&#62; 'path/to/custom/code.php', 'auth' =&#62; true);

</code>

]]></description>
			<content:encoded><![CDATA[<p>To register new custom entry points for Sugar CRM, do the following you have to create the file custom/include/MVC/Controller/entry_point_registry.php</p>
<p>Contents should be the following: </p>
<pre class="brush: php;">
$entry_point_registry['entry_point_name'] = array('file' =&gt; 'path/to/custom/code.php', 'auth' =&gt; true);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://redinkdesign.net/open-source/sugar-crm-entry-point-registry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple SugarCRM E-mail Wrapper</title>
		<link>http://redinkdesign.net/open-source/simple-sugarcrm-e-mail-wrapper/</link>
		<comments>http://redinkdesign.net/open-source/simple-sugarcrm-e-mail-wrapper/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 10:53:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[SugarCRM]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[This is a little helper function I wrote to send an email using Sugar CRM's built in mail class. 

<code>
/**
	 * A wrapper for sugar's mail class
	 * Sends emails to everyon in $tos array.
	 * $tos['user name'] = 'username@domain.com';
	 *
	 * @example : 	$tos['Some User'] = 'SomeUser@somewhere.com';
	 * 				$tos['Some User 2'] = 'SomeUser2@somewhere.com';
	 * 				sendSugarPHPMail($tos, 'hi', 'hello fellas');
	 *
	 * @param associative array
	 * @param string $subject
	 * @param string $body
	 * @return boolean
	 */
]]></description>
			<content:encoded><![CDATA[<p>This is a little helper function I wrote to send an email using Sugar CRM&#8217;s built in mail class. </p>
<pre class="brush: php;">
/**
	 * A wrapper for sugar's mail class
	 * Sends emails to everyon in $tos array.
	 * $tos['user name'] = 'username@domain.com';
	 *
	 * @example : 	$tos['Some User'] = 'SomeUser@somewhere.com';
	 * 				$tos['Some User 2'] = 'SomeUser2@somewhere.com';
	 * 				sendSugarPHPMail($tos, 'hi', 'hello fellas');
	 *
	 * @param associative array
	 * @param string $subject
	 * @param string $body
	 * @return boolean
	 */
	function sendSugarPHPMail($tos, $subject, $body){

		require_once('include/SugarPHPMailer.php');
		require_once('modules/Administration/Administration.php');

		$mail = new SugarPHPMailer();
		$admin = new Administration();
		$admin-&gt;retrieveSettings();

		if ($admin-&gt;settings['mail_sendtype'] == &quot;SMTP&quot;) {
			$mail-&gt;Host = $admin-&gt;settings['mail_smtpserver'];
			$mail-&gt;Port = $admin-&gt;settings['mail_smtpport'];

			if ($admin-&gt;settings['mail_smtpauth_req']) {
				$mail-&gt;SMTPAuth = TRUE;
				$mail-&gt;Username = $admin-&gt;settings['mail_smtpuser'];
				$mail-&gt;Password = $admin-&gt;settings['mail_smtppass'];
			}

			$mail-&gt;Mailer   = &quot;smtp&quot;;
			$mail-&gt;SMTPKeepAlive = true;

		}else{
			$mail-&gt;mailer = 'sendmail';
		}

		$mail-&gt;From     = $admin-&gt;settings['notify_fromaddress'];
		$mail-&gt;FromName = $admin-&gt;settings['notify_fromname'];
		$mail-&gt;ContentType = &quot;text/html&quot;; //&quot;text/plain&quot;

		$mail-&gt;Subject = $subject;
		$mail-&gt;Body = $body;

		foreach ($tos as $name =&gt; $address){
			$mail-&gt;AddAddress(&quot;{$address}&quot;, &quot;{$name}&quot;);
		}

		if (!$mail-&gt;send()) {
			$GLOBALS['log']-&gt;info(&quot;sendSugarPHPMail - Mailer error: &quot; . $mail-&gt;ErrorInfo);
			return false;
 		}else{
 			return true;
 		}
	}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://redinkdesign.net/open-source/simple-sugarcrm-e-mail-wrapper/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Creating Logic Hooks for SugarCRM 5</title>
		<link>http://redinkdesign.net/open-source/creating-logic-hooks-for-sugarcrm-5/</link>
		<comments>http://redinkdesign.net/open-source/creating-logic-hooks-for-sugarcrm-5/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 11:21:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[SugarCRM]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[There's not much information out there about Sugar CRM, so here's a quick example on creating a custom logic hook.

This example uses a custom helper function called 'sendSugarPHPMail' which can be found here http://www.redinkdesign.net/sugar_email_wrapper.

In this example, we're going to email someone when a Case's status is set to 'Closed'.

To make this upgrade friendly we're going to create two files in 'custom/modules/Cases'.
First file: logic_hooks.php - Loaded automatically by Sugar.
Second: case_closed.php - Our custom code.

The contents of logic_hooks.php are: 
]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s not much information out there about Sugar CRM, so here&#8217;s a quick example on creating a custom logic hook.</p>
<p><span style="color: #ff0000"><strong>This example uses a custom helper function called &#8217;sendSugarPHPMail&#8217; which can be found here http://redinkdesign.net/open-source/simple-sugarcrm-e-mail-wrapper.</strong></span></p>
<p>In this example, we&#8217;re going to email someone when a Case&#8217;s status is set to &#8216;Closed&#8217;.</p>
<p>To make this upgrade friendly we&#8217;re going to create two files in &#8216;custom/modules/Cases&#8217;.<br />
First file: logic_hooks.php &#8211; Loaded automatically by Sugar.<br />
Second: case_closed.php &#8211; Our custom code.</p>
<p>The contents of logic_hooks.php are:</p>
<pre class="brush: php;">
&lt;?php

	if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

	$hook_array = array();

	$hook_array['before_save'] = array();

	// array(hook execute order, 'hook name', 'hook code location', 'hook code class name', 'hook code function to execute')
	$hook_array['before_save'][] = array(1, 'case_closed', 'custom/modules/Cases/case_closed.php', 'case_closed', 'case_closed');

?&gt;
</pre>
<p>Our array parameters must be the following:</p>
<p>1. hook execute order<br />
2. hook name<br />
3. hook code location<br />
4. hook code class name<br />
5. hook code function to execute</p>
<pre class="brush: php;">
$hook_array['before_save'][] = array(1, 'case_closed', 'custom/modules/Cases/case_closed.php', 'case_closed', 'case_closed');
</pre>
<p>The contents of case_closed.php are:</p>
<pre class="brush: php;">&lt;?php

	if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

	class case_closed{

		function case_closed(&amp;$bean, $event, $arguments){

			// make sure the status was actually changed to closed
			// $bean-&gt;fetched_row['status'] is the stored status of the case
			// $bean-&gt;status is the status it was changed to
			if ($bean-&gt;fetched_row['status'] !== 'Closed' &amp;&amp; $bean-&gt;status === 'Closed'){

				$subject = &quot;Closed: Case {$bean-&gt;case_number} - {$bean-&gt;name}&quot;;
				$body = &quot;Assigned to: {$bean-&gt;assigned_user_name}&lt;br /&gt;&quot;;
				$body .= 'Description: ' . (empty($bean-&gt;description)? ' n/a ' : $bean-&gt;description);

				$to['Mr. Bean'] = 'mrbean@whatevs.com';

				if (!sendSugarPHPMail($to, $subject, $body)){
					$GLOBALS['log']-&gt;info(&quot;Could not send case closed notification:  &quot; . $mail-&gt;ErrorInfo);
				}
			}
		}
	}

?&gt;
</pre>
<p><strong>Application hooks</strong></p>
<p>These hooks do not make use of the $bean argument.<br />
<strong>after_ui_frame</strong><br />
Fired after the frame has been invoked and before the footer has been invoked<br />
Available in version 4.5.0 and later<br />
<strong>after_ui_footer</strong><br />
Fired after the footer has been invoked<br />
Available in version 4.5.0 and later<br />
<strong>server_round_trip</strong><br />
Fired at the end of every SugarCRM page<br />
Available in version 4.5.0 and later</p>
<p><strong>Module hooks</strong></p>
<p><strong>before_delete</strong><br />
Fired before a record is deleted<br />
Available in version 4.5.0 and later</p>
<p><strong>after_delete</strong><br />
Fired after a record is deleted<br />
Available in version 4.5.0 and later</p>
<p><strong>before_restore</strong><br />
Fired before a record is undeleted<br />
Available in version 4.5.0 and later</p>
<p><strong>after_restore</strong><br />
Fired after a record is undeleted<br />
Available in version 4.5.0 and later</p>
<p><strong>after_retrieve</strong><br />
Fired after a record has been retrieved from the database. This hook does not fire when you create a new record.<br />
Available in version 4.5.0 and later</p>
<p><strong>before_save</strong><br />
Fired before a record is saved.<br />
Note: With certain modules, like Cases and Bugs, the human-readable ID of the record (like the case_number field in the Case module), is not available within a before_save call. This is because this business logic simply hasn&#8217;t been executed yet.<br />
Available in version 4.5.0 and later</p>
<p><strong>after_save</strong><br />
Fired after a record is saved.<br />
Note: With certain modules, like Cases and Bugs, the human-readable ID of the record (like the case_number field in the Case module), is not available within a before_save call. This is because this business logic simply hasn&#8217;t been executed yet.<br />
Available in version 4.5.0 and later</p>
<p><strong>process_record</strong><br />
Fired immediately prior to the database query resulting in a record being made current. This gives developers an opportunity to examine and tailor the underlying queries. This is also a perfect place to set values in a record’s fields prior to display in the DetailView or ListView. This event is not fired in the EditView.<br />
Available in version 4.5.0 and later</p>
<p><strong>Hooks for Users module</strong></p>
<p><strong>before_logout</strong><br />
Fired before a user logs out of the system<br />
Available in version 4.5.0 and later</p>
<p><strong>after_logout</strong><br />
Fired after a user logs out of the system<br />
Available in version 4.5.0 and later</p>
<p><strong>after_login</strong><br />
Fired after a user logs into the system.<br />
Available in version 4.5.0 and later</p>
<p><strong>after_logout</strong><br />
Fired after a user logs out of the system.<br />
Available in version 4.5.0 and later</p>
<p><strong>before_logout</strong><br />
Fired before a user logs out of the system.<br />
Available in version 4.5.0 and later</p>
<p><strong>login_failed</strong><br />
Fired on a failed login attempt<br />
Available in version 4.5.0 and later</p>
<p><strong>Here&#8217;s a list of all available logic hooks&#8230;</strong></p>
<p><a href="http://developers.sugarcrm.com/docs/OS/5.1/-docs-Developer_Guides-Developer_Guide_5.1-DevGuide.1.101.html">http://developers.sugarcrm.com/docs/OS/5.1/-docs-Developer_Guides-Developer_Guide_5.1-DevGuide.1.101.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://redinkdesign.net/open-source/creating-logic-hooks-for-sugarcrm-5/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
	</channel>
</rss>

