Skip to content

Instantly share code, notes, and snippets.

@eggsurplus
eggsurplus / setFieldRequired
Created August 22, 2012 17:51
Make a field required/not required in edit view of SugarCRM
function setFieldRequired(fieldName, req, msgStr){
if(!msgStr){ msgStr = fieldName; }
for(var i = 0; i < validate["EditView"].length; i++){
if(validate["EditView"][i][nameIndex] == fieldName) {
validate["EditView"][i][msgIndex] = msgStr;
validate["EditView"][i][requiredIndex] = req;
break;
}
}
}
@eggsurplus
eggsurplus / manifest_copy-blank_copy_to_root.php
Created September 19, 2012 21:32
Dev Tips: Manifest Copy - Blank Copy to Root
'copy' => array (
array (
'from' => '<basepath>/files/',
'to' => '',
),
),
@eggsurplus
eggsurplus / manifest_copy-blank_copy_to_root-alt.php
Created September 19, 2012 21:34
Dev Tips: Manifest Copy - Blank Copy to Root - Alt
'copy' => array (
array (
'from' => '<basepath>/files/modules/MyAwesomeModule',
'to' => 'modules/MyAwesomeModule',
),
),
@eggsurplus
eggsurplus / manifest_copy-full_directory_copy.php
Created September 19, 2012 21:38
Dev Tips: Manifest Copy - Full Directory Copy
'copy' => array (
array (
'from' => '<basepath>/files/custom/modules/Accounts',
'to' => 'custom/modules/Accounts',
),
),
@eggsurplus
eggsurplus / manifest_copy-full_directory_copy-alt.php
Created September 19, 2012 21:41
Dev Tips: Manifest Copy - Full Directory Copy - Alt
'copy' => array (
array (
'from' => '<basepath>/files/custom/modules/Accounts/EmailAccount.php',
'to' => 'custom/modules/Accounts/EmailAccount.php',
),
array (
'from' => '<basepath>/files/custom/modules/Accounts/metadata/detailviewdefs.php',
'to' => 'custom/modules/Accounts/metadata/detailviewdefs.php',
),
),
@eggsurplus
eggsurplus / manifest_copy-core_file_copy.php
Created September 19, 2012 21:42
Dev Tips: Manifest Copy - Core File Copy
'copy' => array (
array (
'from' => '<basepath>/files/modules/Accounts/metadata/detailviewdefs.php',
'to' => 'modules/Accounts/metadata/detailviewdefs.php',
),
),
@eggsurplus
eggsurplus / manifest_copy-core_file_copy-alt.php
Created September 19, 2012 21:44
Dev Tips: Manifest Copy - Core File Copy - Alt
'copy' => array (
array (
'from' => '<basepath>/files/custom/modules/Accounts/metadata/detailviewdefs.php'
'to' => 'custom/modules/metadata/detailviewdefs.php',
),
),
@eggsurplus
eggsurplus / manifest_copy-custom_file_copy.php
Created September 19, 2012 21:45
Dev Tips: Manifest Copy - Custom File Copy
'copy' => array (
array (
'from' => '<basepath>/files/custom/modules/Accounts/views/view.edit.php',
'to' => 'custom/modules/Accounts/views/view.edit.php',
),
),
@eggsurplus
eggsurplus / blog_panel_insertion.php
Created September 24, 2012 15:46
SugarCRM: Insert a panel via javascript
/* BEGIN - SECURITY GROUPS */
//if popup select add panel if user is a member of multiple groups to metadataFile
global $sugar_config;
if(isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true
&& empty($this->bean->fetched_row['id']) && $this->bean->module_dir != "Users" && $this->bean->module_dir != "SugarFeed") {
//there are cases such as uploading an attachment to an email template where the request module may
//not be the same as the current bean module. If that happens we can just skip it
if(empty($_REQUEST['module']) || $_REQUEST['module'] != $this->bean->module_dir) return;
@eggsurplus
eggsurplus / manifest_organization.php
Created September 27, 2012 15:49
Organizing Files in a Module Zip
'copy' => array (
array (
'from' => '<basepath>/copy/custom/modules/Accounts/MyAwesome_logic_hook.php',
'to' => 'custom/modules/Accounts/MyAwesome_logic_hook.php',
),
array (
'from' => '<basepath>/copy/modules/MyAwesomeModule',
'to' => 'modules/MyAwesomeModule',
),
),