This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$hook_version = 1; | |
$hook_array = array(); | |
$hook_array['before_save'] = array(); | |
$hook_array['before_save'][] = array( | |
1, | |
'Create Sugar Notification on any new post or comment', | |
'custom/modules/ActivityStream/Activities/customLogicHook.php', | |
'SugarNotifyUser', | |
'notify_user_on_post_comment' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Desc: Before save logic hook to create Sugar Notification if new post or comment in Activity Stream | |
* Written by: Hatim Alam | |
* Dated: 21st Feb 2016 | |
*/ | |
class SugarNotifyUser { | |
function notify_user_on_post_comment($bean, $event, $arguments) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); | |
class TestContactAPi extends SugarApi | |
{ | |
public function registerApiRest() | |
{ | |
return array( | |
'testContactUpdate' => array( | |
//request type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$hook_version = 1; | |
$hook_array = array(); | |
$hook_array['before_save'] = array(); | |
$hook_array['before_save'][] = array( | |
1, | |
'Check discount percentage on opp save', | |
'custom/modules/Opportunities/customLogicHooks.php', | |
'CheckOppDiscount', | |
'check_opp_discount' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); | |
class CheckOppDiscount { | |
function check_opp_discount($bean, $event, $arguments) { | |
//check if discount percentage is >25% | |
if($bean->opp_discount_c > 25) { | |
//get assigned user bean | |
$assigned_user_bean = BeanFactory::getBean("Users", $bean->assigned_user_id); | |
//fetch assigned user's manager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** custom filter file to add new field to module list view search **/ | |
//push your new field to quicksearch_field array | |
$viewdefs['Accounts']['base']['filter']['default']['quicksearch_field'][] = 'account_number_c'; | |
//give priority > 0 | |
$viewdefs['Accounts']['base']['filter']['default']['quicksearch_priority'] = 2; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Overriding PC bean to enable ACL | |
* custom/modules/ProductTemplates/ProductTemplate.php | |
*/ | |
require_once("modules/ProductTemplates/ProductTemplate.php"); | |
class CustomProductTemplate extends ProductTemplate | |
{ | |
public function __construct() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Overriding PC bean to enable ACL | |
* custom/Extension/application/Ext/Include/custom_pc_bean_registry.php | |
*/ | |
$objectList['ProductTemplates'] = 'ProductTemplate'; | |
$beanList['ProductTemplates'] = 'CustomProductTemplate'; | |
$beanFiles['CustomProductTemplate'] = 'custom/modules/ProductTemplates/ProductTemplate.php'; | |
$moduleList[] = 'ProductTemplates'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Overriding PC bean to enable ACL | |
* custom/Extension/modules/ProductTemplates/Ext/Vardefs/enable_acl_vardef.php | |
*/ | |
$dictionary['ProductTemplate']['acls'] = array('SugarACLLockedFields' => true, 'SugarACLStatic' => true); |