@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | |
4 | 4 | require_once('modules/SecurityGroups/SecurityGroupUserRelationship.php'); |
5 | 5 | |
@@ -10,29 +10,29 @@ discard block |
||
10 | 10 | |
11 | 11 | $focus->retrieve($_REQUEST['record']); |
12 | 12 | |
13 | -foreach($focus->column_fields as $field) |
|
13 | +foreach ($focus->column_fields as $field) |
|
14 | 14 | { |
15 | 15 | safe_map($field, $focus, true); |
16 | 16 | } |
17 | 17 | |
18 | -foreach($focus->additional_column_fields as $field) |
|
18 | +foreach ($focus->additional_column_fields as $field) |
|
19 | 19 | { |
20 | 20 | safe_map($field, $focus, true); |
21 | 21 | } |
22 | 22 | |
23 | 23 | // send them to the edit screen. |
24 | -if(isset($_REQUEST['record']) && $_REQUEST['record'] != "") |
|
24 | +if (isset($_REQUEST['record']) && $_REQUEST['record'] != "") |
|
25 | 25 | { |
26 | 26 | $recordID = $_REQUEST['record']; |
27 | 27 | } |
28 | 28 | |
29 | - if( isset($_POST['noninheritable']) && $_POST['noninheritable'] == '1') { |
|
29 | + if (isset($_POST['noninheritable']) && $_POST['noninheritable'] == '1') { |
|
30 | 30 | $focus->noninheritable = 1; |
31 | 31 | } else { |
32 | 32 | $focus->noninheritable = 0; |
33 | 33 | } |
34 | 34 | |
35 | - if( isset($_POST['primary_group']) && $_POST['primary_group'] == '1') { |
|
35 | + if (isset($_POST['primary_group']) && $_POST['primary_group'] == '1') { |
|
36 | 36 | $focus->primary_group = 1; |
37 | 37 | //unset all other primary groups for this user |
38 | 38 | global $db; |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | require_once('modules/SecurityGroups/SecurityGroupUserRelationship.php'); |
5 | 7 |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | require_once('XTemplate/xtpl.php'); |
5 | 7 | require_once('modules/SecurityGroups/SecurityGroupUserRelationship.php'); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | |
4 | 4 | require_once('XTemplate/xtpl.php'); |
5 | 5 | require_once('modules/SecurityGroups/SecurityGroupUserRelationship.php'); |
@@ -13,11 +13,11 @@ discard block |
||
13 | 13 | |
14 | 14 | $focus = new SecurityGroupUserRelationship(); |
15 | 15 | |
16 | -if(isset($_REQUEST['record'])) { |
|
16 | +if (isset($_REQUEST['record'])) { |
|
17 | 17 | $focus->retrieve($_REQUEST['record']); |
18 | 18 | } |
19 | 19 | |
20 | -if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { |
|
20 | +if (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { |
|
21 | 21 | $focus->id = ""; |
22 | 22 | } |
23 | 23 | |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | safe_map('primary_group', $focus); |
31 | 31 | |
32 | 32 | |
33 | -$theme_path="themes/".$theme."/"; |
|
34 | -$image_path=$theme_path."images/"; |
|
33 | +$theme_path = "themes/".$theme."/"; |
|
34 | +$image_path = $theme_path."images/"; |
|
35 | 35 | |
36 | 36 | $GLOBALS['log']->info("SecurityGroup User relationship"); |
37 | 37 | |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | $sqs_objects = array('user_name' => $qsd->getQSParent()); |
42 | 42 | $sqs_objects['user_name']['populate_list'] = array('user_name', 'user_id'); |
43 | 43 | $quicksearch_js = $qsd->getQSScripts(); |
44 | -$quicksearch_js .= '<script type="text/javascript" language="javascript">sqs_objects = ' . $json->encode($sqs_objects) . '</script>'; |
|
44 | +$quicksearch_js .= '<script type="text/javascript" language="javascript">sqs_objects = '.$json->encode($sqs_objects).'</script>'; |
|
45 | 45 | echo $quicksearch_js; |
46 | 46 | |
47 | -$xtpl=new XTemplate ('modules/SecurityGroups/SecurityGroupUserRelationshipEdit.html'); |
|
47 | +$xtpl = new XTemplate('modules/SecurityGroups/SecurityGroupUserRelationshipEdit.html'); |
|
48 | 48 | $xtpl->assign("MOD", $mod_strings); |
49 | 49 | $xtpl->assign("APP", $app_strings); |
50 | 50 | |
@@ -53,25 +53,25 @@ discard block |
||
53 | 53 | $xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']); |
54 | 54 | $xtpl->assign("RETURN_ID", $_REQUEST['return_id']); |
55 | 55 | $xtpl->assign("THEME", $theme); |
56 | -$xtpl->assign("IMAGE_PATH", $image_path);$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']); |
|
56 | +$xtpl->assign("IMAGE_PATH", $image_path); $xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']); |
|
57 | 57 | $xtpl->assign("ID", $focus->id); |
58 | -$xtpl->assign("SECURITYGROUP",$securityGroup = Array("NAME" => $focus->securitygroup_name, "ID" => $focus->securitygroup_id)); |
|
59 | -$xtpl->assign("USER",$user = Array("NAME" => $focus->user_name, "ID" => $focus->user_id)); |
|
58 | +$xtpl->assign("SECURITYGROUP", $securityGroup = Array("NAME" => $focus->securitygroup_name, "ID" => $focus->securitygroup_id)); |
|
59 | +$xtpl->assign("USER", $user = Array("NAME" => $focus->user_name, "ID" => $focus->user_id)); |
|
60 | 60 | |
61 | 61 | echo "\n<p>\n"; |
62 | -echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_SECURITYGROUP_USER_FORM_TITLE'].": ".$securityGroup['NAME'] . " - ". $user['NAME'], true); |
|
62 | +echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_SECURITYGROUP_USER_FORM_TITLE'].": ".$securityGroup['NAME']." - ".$user['NAME'], true); |
|
63 | 63 | echo "\n</p>\n"; |
64 | 64 | |
65 | 65 | // noninheritable |
66 | 66 | $noninheritable = ''; |
67 | -if(isset($focus->noninheritable) && $focus->noninheritable == true) { |
|
67 | +if (isset($focus->noninheritable) && $focus->noninheritable == true) { |
|
68 | 68 | $noninheritable = 'CHECKED'; |
69 | 69 | } |
70 | 70 | $xtpl->assign('noninheritable', $noninheritable); |
71 | 71 | |
72 | 72 | // primary_group |
73 | 73 | $primary_group = ''; |
74 | -if(isset($focus->primary_group) && $focus->primary_group == true) { |
|
74 | +if (isset($focus->primary_group) && $focus->primary_group == true) { |
|
75 | 75 | $primary_group = 'CHECKED'; |
76 | 76 | } |
77 | 77 | $xtpl->assign('primary_group', $primary_group); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $javascript = new javascript(); |
85 | 85 | $javascript->setFormName('EditView'); |
86 | 86 | $javascript->setSugarBean($focus); |
87 | -$javascript->addToValidateBinaryDependency('user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $mod_strings['LBL_USER_NAME'], 'false', '', 'user_id'); |
|
87 | +$javascript->addToValidateBinaryDependency('user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'].$mod_strings['LBL_USER_NAME'], 'false', '', 'user_id'); |
|
88 | 88 | echo $javascript->getScript(); |
89 | 89 | |
90 | 90 |
@@ -6,113 +6,113 @@ discard block |
||
6 | 6 | |
7 | 7 | function popup_select(&$bean, $event, $arguments) |
8 | 8 | { |
9 | - global $sugar_config; |
|
10 | - |
|
11 | - //only process if action is Save (meaning a user has triggered this event and not the portal or automated process) |
|
12 | - if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'Save' |
|
13 | - && isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true |
|
14 | - && empty($bean->fetched_row['id']) && $bean->module_dir != "Users" && $bean->module_dir != "SugarFeed") { |
|
15 | - //Upload an attachment to an Email Template and save. If user with multi groups - popup select option |
|
16 | - //it will redirect to notes instead of EmailTemplate and relationship will fail...check below to avoid |
|
17 | - if(!empty($_REQUEST['module']) && $_REQUEST['module'] != $bean->module_dir) return; |
|
18 | - |
|
19 | - if(!empty($_REQUEST['securitygroup_list'])) { |
|
20 | - require_once('modules/SecurityGroups/SecurityGroup.php'); |
|
21 | - $groupFocus = new SecurityGroup(); |
|
22 | - $security_modules = $groupFocus->getSecurityModules(); |
|
23 | - //sanity check |
|
24 | - if(in_array($bean->module_dir,array_keys($security_modules))) { |
|
25 | - //add each group in securitygroup_list to new record |
|
26 | - $rel_name = $groupFocus->getLinkName($bean->module_dir,"SecurityGroups"); |
|
27 | - |
|
28 | - $bean->load_relationship($rel_name); |
|
29 | - foreach($_REQUEST['securitygroup_list'] as $group_id) { |
|
30 | - $bean->$rel_name->add($group_id); |
|
31 | - } |
|
32 | - } |
|
33 | - } else if(!empty($_REQUEST['dup_checked'])) { |
|
34 | - //well...ShowDuplicates doesn't pass through request vars unless they are defined in the module vardefs |
|
35 | - //so we are screwed here... |
|
36 | - global $current_language; |
|
37 | - $ss_mod_strings = return_module_language($current_language, 'SecurityGroups'); |
|
38 | - unset($_SESSION['securitysuite_error']); //to be safe |
|
39 | - $_SESSION['securitysuite_error'] = $ss_mod_strings['LBL_ERROR_DUPLICATE']; |
|
40 | - } |
|
41 | - } |
|
9 | + global $sugar_config; |
|
10 | + |
|
11 | + //only process if action is Save (meaning a user has triggered this event and not the portal or automated process) |
|
12 | + if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'Save' |
|
13 | + && isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true |
|
14 | + && empty($bean->fetched_row['id']) && $bean->module_dir != "Users" && $bean->module_dir != "SugarFeed") { |
|
15 | + //Upload an attachment to an Email Template and save. If user with multi groups - popup select option |
|
16 | + //it will redirect to notes instead of EmailTemplate and relationship will fail...check below to avoid |
|
17 | + if(!empty($_REQUEST['module']) && $_REQUEST['module'] != $bean->module_dir) return; |
|
18 | + |
|
19 | + if(!empty($_REQUEST['securitygroup_list'])) { |
|
20 | + require_once('modules/SecurityGroups/SecurityGroup.php'); |
|
21 | + $groupFocus = new SecurityGroup(); |
|
22 | + $security_modules = $groupFocus->getSecurityModules(); |
|
23 | + //sanity check |
|
24 | + if(in_array($bean->module_dir,array_keys($security_modules))) { |
|
25 | + //add each group in securitygroup_list to new record |
|
26 | + $rel_name = $groupFocus->getLinkName($bean->module_dir,"SecurityGroups"); |
|
27 | + |
|
28 | + $bean->load_relationship($rel_name); |
|
29 | + foreach($_REQUEST['securitygroup_list'] as $group_id) { |
|
30 | + $bean->$rel_name->add($group_id); |
|
31 | + } |
|
32 | + } |
|
33 | + } else if(!empty($_REQUEST['dup_checked'])) { |
|
34 | + //well...ShowDuplicates doesn't pass through request vars unless they are defined in the module vardefs |
|
35 | + //so we are screwed here... |
|
36 | + global $current_language; |
|
37 | + $ss_mod_strings = return_module_language($current_language, 'SecurityGroups'); |
|
38 | + unset($_SESSION['securitysuite_error']); //to be safe |
|
39 | + $_SESSION['securitysuite_error'] = $ss_mod_strings['LBL_ERROR_DUPLICATE']; |
|
40 | + } |
|
41 | + } |
|
42 | 42 | |
43 | - else if(isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true |
|
44 | - && empty($bean->fetched_row['id']) && $bean->module_dir == "Users" |
|
45 | - && isset($_REQUEST['action']) && $_REQUEST['action'] != 'SaveSignature' ) { //Bug: 589 |
|
43 | + else if(isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true |
|
44 | + && empty($bean->fetched_row['id']) && $bean->module_dir == "Users" |
|
45 | + && isset($_REQUEST['action']) && $_REQUEST['action'] != 'SaveSignature' ) { //Bug: 589 |
|
46 | 46 | |
47 | - //$_REQUEST['return_module'] = $bean->module_dir; |
|
48 | - //$_REQUEST['return_action'] = "DetailView"; |
|
49 | - //$_REQUEST['return_id'] = $bean->id; |
|
47 | + //$_REQUEST['return_module'] = $bean->module_dir; |
|
48 | + //$_REQUEST['return_action'] = "DetailView"; |
|
49 | + //$_REQUEST['return_id'] = $bean->id; |
|
50 | 50 | |
51 | - //$_SESSION['securitygroups_popup_'.$bean->module_dir] = $bean->id; |
|
51 | + //$_SESSION['securitygroups_popup_'.$bean->module_dir] = $bean->id; |
|
52 | 52 | |
53 | - if(!isset($_SESSION['securitygroups_popup'])) { |
|
54 | - $_SESSION['securitygroups_popup'] = array(); |
|
55 | - } |
|
56 | - $_SESSION['securitygroups_popup'][] = array( |
|
57 | - 'module' => $bean->module_dir, |
|
58 | - 'id' => $bean->id |
|
59 | - ); |
|
60 | - } |
|
53 | + if(!isset($_SESSION['securitygroups_popup'])) { |
|
54 | + $_SESSION['securitygroups_popup'] = array(); |
|
55 | + } |
|
56 | + $_SESSION['securitygroups_popup'][] = array( |
|
57 | + 'module' => $bean->module_dir, |
|
58 | + 'id' => $bean->id |
|
59 | + ); |
|
60 | + } |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | 64 | function popup_onload($event, $arguments) |
65 | 65 | { |
66 | - if(!empty($_REQUEST['to_pdf']) || !empty($_REQUEST['sugar_body_only'])) return; |
|
66 | + if(!empty($_REQUEST['to_pdf']) || !empty($_REQUEST['sugar_body_only'])) return; |
|
67 | 67 | |
68 | 68 | /** //test user popup |
69 | 69 | //always have this loaded |
70 | 70 | echo '<script type="text/javascript" src="modules/SecurityGroups/javascript/popup_relate.js"></script>'; |
71 | 71 | */ |
72 | - global $sugar_config; |
|
72 | + global $sugar_config; |
|
73 | 73 | |
74 | - $module = $_REQUEST['module']; |
|
75 | - $action = $_REQUEST['action']; |
|
74 | + $module = $_REQUEST['module']; |
|
75 | + $action = $_REQUEST['action']; |
|
76 | 76 | |
77 | - if(isset($action) && ($action == "Save" || $action == "SetTimezone")) return; |
|
77 | + if(isset($action) && ($action == "Save" || $action == "SetTimezone")) return; |
|
78 | 78 | |
79 | - if( ( |
|
80 | - //(isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true) |
|
81 | - //|| |
|
82 | - ($module == "Users" && isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true) |
|
83 | - ) |
|
79 | + if( ( |
|
80 | + //(isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true) |
|
81 | + //|| |
|
82 | + ($module == "Users" && isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true) |
|
83 | + ) |
|
84 | 84 | |
85 | - //&& isset($_SESSION['securitygroups_popup_'.$module]) && !empty($_SESSION['securitygroups_popup_'.$module]) |
|
86 | - && !empty($_SESSION['securitygroups_popup']) |
|
87 | - ) { |
|
88 | - |
|
89 | - foreach($_SESSION['securitygroups_popup'] as $popup_index => $popup) { |
|
90 | - $record_id = $popup['id']; |
|
91 | - $module = $popup['module']; |
|
92 | - unset($_SESSION['securitygroups_popup'][$popup_index]); |
|
85 | + //&& isset($_SESSION['securitygroups_popup_'.$module]) && !empty($_SESSION['securitygroups_popup_'.$module]) |
|
86 | + && !empty($_SESSION['securitygroups_popup']) |
|
87 | + ) { |
|
88 | + |
|
89 | + foreach($_SESSION['securitygroups_popup'] as $popup_index => $popup) { |
|
90 | + $record_id = $popup['id']; |
|
91 | + $module = $popup['module']; |
|
92 | + unset($_SESSION['securitygroups_popup'][$popup_index]); |
|
93 | 93 | |
94 | - require_once('modules/SecurityGroups/SecurityGroup.php'); |
|
95 | - $groupFocus = new SecurityGroup(); |
|
96 | - if($module == 'Users') { |
|
97 | - $rel_name = "SecurityGroups"; |
|
98 | - } else { |
|
99 | - $rel_name = $groupFocus->getLinkName($module,"SecurityGroups"); |
|
100 | - } |
|
101 | - |
|
102 | - //this only works if on the detail view of the record actually saved... |
|
103 | - //so ajaxui breaks this as it stays on the parent |
|
104 | - $auto_popup = <<<EOQ |
|
94 | + require_once('modules/SecurityGroups/SecurityGroup.php'); |
|
95 | + $groupFocus = new SecurityGroup(); |
|
96 | + if($module == 'Users') { |
|
97 | + $rel_name = "SecurityGroups"; |
|
98 | + } else { |
|
99 | + $rel_name = $groupFocus->getLinkName($module,"SecurityGroups"); |
|
100 | + } |
|
101 | + |
|
102 | + //this only works if on the detail view of the record actually saved... |
|
103 | + //so ajaxui breaks this as it stays on the parent |
|
104 | + $auto_popup = <<<EOQ |
|
105 | 105 | <script type="text/javascript" language="javascript"> |
106 | 106 | open_popup("SecurityGroups",600,400,"",true,true,{"call_back_function":"securitysuite_set_return_and_save_background","form_name":"DetailView","field_to_name_array":{"id":"subpanel_id"},"passthru_data":{"module":"$module","record":"$record_id","child_field":"$rel_name","return_url":"","link_field_name":"$rel_name","module_name":"$rel_name","refresh_page":"1"}},"MultiSelect",true); |
107 | 107 | </script> |
108 | 108 | EOQ; |
109 | 109 | |
110 | - echo $auto_popup; |
|
110 | + echo $auto_popup; |
|
111 | 111 | |
112 | - } |
|
113 | - unset($_SESSION['securitygroups_popup']); |
|
112 | + } |
|
113 | + unset($_SESSION['securitygroups_popup']); |
|
114 | 114 | |
115 | - } |
|
115 | + } |
|
116 | 116 | |
117 | 117 | } |
118 | 118 | |
@@ -121,37 +121,37 @@ discard block |
||
121 | 121 | $action = $_REQUEST['action']; |
122 | 122 | $module = $_REQUEST['module']; |
123 | 123 | |
124 | - $no_mass_assign_list = array("Emails"=>"Emails","ACLRoles"=>"ACLRoles"); //,"Users"=>"Users"); |
|
124 | + $no_mass_assign_list = array("Emails"=>"Emails","ACLRoles"=>"ACLRoles"); //,"Users"=>"Users"); |
|
125 | 125 | //check if security suite enabled |
126 | 126 | $action = strtolower($action); |
127 | 127 | if(isset($module) && ($action == "list" || $action == "index" || $action == "listview") |
128 | - && (!isset($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] != true) |
|
129 | - && !array_key_exists($module,$no_mass_assign_list) |
|
130 | - ) { |
|
131 | - global $current_user; |
|
132 | - if(is_admin($current_user) || ACLAction::getUserAccessLevel($current_user->id,"SecurityGroups", 'access') == ACL_ALLOW_ENABLED) { |
|
128 | + && (!isset($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] != true) |
|
129 | + && !array_key_exists($module,$no_mass_assign_list) |
|
130 | + ) { |
|
131 | + global $current_user; |
|
132 | + if(is_admin($current_user) || ACLAction::getUserAccessLevel($current_user->id,"SecurityGroups", 'access') == ACL_ALLOW_ENABLED) { |
|
133 | 133 | |
134 | - require_once('modules/SecurityGroups/SecurityGroup.php'); |
|
135 | - $groupFocus = new SecurityGroup(); |
|
136 | - $security_modules = $groupFocus->getSecurityModules(); |
|
137 | - //if(in_array($module,$security_modules)) { |
|
138 | - if(in_array($module,array_keys($security_modules))) { |
|
134 | + require_once('modules/SecurityGroups/SecurityGroup.php'); |
|
135 | + $groupFocus = new SecurityGroup(); |
|
136 | + $security_modules = $groupFocus->getSecurityModules(); |
|
137 | + //if(in_array($module,$security_modules)) { |
|
138 | + if(in_array($module,array_keys($security_modules))) { |
|
139 | 139 | |
140 | - global $app_strings; |
|
140 | + global $app_strings; |
|
141 | 141 | |
142 | - global $current_language; |
|
143 | - $current_module_strings = return_module_language($current_language, 'SecurityGroups'); |
|
142 | + global $current_language; |
|
143 | + $current_module_strings = return_module_language($current_language, 'SecurityGroups'); |
|
144 | 144 | |
145 | - $form_header = get_form_header($current_module_strings['LBL_MASS_ASSIGN'], '', false); |
|
145 | + $form_header = get_form_header($current_module_strings['LBL_MASS_ASSIGN'], '', false); |
|
146 | 146 | |
147 | - $groups = $groupFocus->get_list("name","",0,-99,-99); |
|
148 | - $options = array(""=>""); |
|
149 | - foreach($groups['list'] as $group) { |
|
150 | - $options[$group->id] = $group->name; |
|
151 | - } |
|
152 | - $group_options = get_select_options_with_id($options, ""); |
|
147 | + $groups = $groupFocus->get_list("name","",0,-99,-99); |
|
148 | + $options = array(""=>""); |
|
149 | + foreach($groups['list'] as $group) { |
|
150 | + $options[$group->id] = $group->name; |
|
151 | + } |
|
152 | + $group_options = get_select_options_with_id($options, ""); |
|
153 | 153 | |
154 | - $mass_assign = <<<EOQ |
|
154 | + $mass_assign = <<<EOQ |
|
155 | 155 | |
156 | 156 | <script type="text/javascript" language="javascript"> |
157 | 157 | function confirm_massassign(del,start_string, end_string) { |
@@ -264,16 +264,16 @@ discard block |
||
264 | 264 | EOQ; |
265 | 265 | |
266 | 266 | |
267 | - echo $mass_assign; |
|
268 | - } |
|
269 | - } |
|
267 | + echo $mass_assign; |
|
268 | + } |
|
269 | + } |
|
270 | 270 | } |
271 | 271 | |
272 | - //if after a save... |
|
273 | - if(!empty($_SESSION['securitysuite_error'])) { |
|
274 | - $lbl_securitysuite_error = $_SESSION['securitysuite_error']; |
|
275 | - unset($_SESSION['securitysuite_error']); |
|
276 | - echo <<<EOQ |
|
272 | + //if after a save... |
|
273 | + if(!empty($_SESSION['securitysuite_error'])) { |
|
274 | + $lbl_securitysuite_error = $_SESSION['securitysuite_error']; |
|
275 | + unset($_SESSION['securitysuite_error']); |
|
276 | + echo <<<EOQ |
|
277 | 277 | <script> |
278 | 278 | |
279 | 279 | |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | document.body.insertBefore(oNewP, beforeMe); |
288 | 288 | </script> |
289 | 289 | EOQ; |
290 | - } |
|
290 | + } |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | |
4 | 4 | |
5 | 5 | class AssignGroups { |
@@ -9,28 +9,28 @@ discard block |
||
9 | 9 | global $sugar_config; |
10 | 10 | |
11 | 11 | //only process if action is Save (meaning a user has triggered this event and not the portal or automated process) |
12 | - if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'Save' |
|
12 | + if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'Save' |
|
13 | 13 | && isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true |
14 | 14 | && empty($bean->fetched_row['id']) && $bean->module_dir != "Users" && $bean->module_dir != "SugarFeed") { |
15 | 15 | //Upload an attachment to an Email Template and save. If user with multi groups - popup select option |
16 | 16 | //it will redirect to notes instead of EmailTemplate and relationship will fail...check below to avoid |
17 | - if(!empty($_REQUEST['module']) && $_REQUEST['module'] != $bean->module_dir) return; |
|
17 | + if (!empty($_REQUEST['module']) && $_REQUEST['module'] != $bean->module_dir) return; |
|
18 | 18 | |
19 | - if(!empty($_REQUEST['securitygroup_list'])) { |
|
19 | + if (!empty($_REQUEST['securitygroup_list'])) { |
|
20 | 20 | require_once('modules/SecurityGroups/SecurityGroup.php'); |
21 | 21 | $groupFocus = new SecurityGroup(); |
22 | 22 | $security_modules = $groupFocus->getSecurityModules(); |
23 | 23 | //sanity check |
24 | - if(in_array($bean->module_dir,array_keys($security_modules))) { |
|
24 | + if (in_array($bean->module_dir, array_keys($security_modules))) { |
|
25 | 25 | //add each group in securitygroup_list to new record |
26 | - $rel_name = $groupFocus->getLinkName($bean->module_dir,"SecurityGroups"); |
|
26 | + $rel_name = $groupFocus->getLinkName($bean->module_dir, "SecurityGroups"); |
|
27 | 27 | |
28 | 28 | $bean->load_relationship($rel_name); |
29 | - foreach($_REQUEST['securitygroup_list'] as $group_id) { |
|
29 | + foreach ($_REQUEST['securitygroup_list'] as $group_id) { |
|
30 | 30 | $bean->$rel_name->add($group_id); |
31 | 31 | } |
32 | 32 | } |
33 | - } else if(!empty($_REQUEST['dup_checked'])) { |
|
33 | + } else if (!empty($_REQUEST['dup_checked'])) { |
|
34 | 34 | //well...ShowDuplicates doesn't pass through request vars unless they are defined in the module vardefs |
35 | 35 | //so we are screwed here... |
36 | 36 | global $current_language; |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
43 | - else if(isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true |
|
43 | + else if (isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true |
|
44 | 44 | && empty($bean->fetched_row['id']) && $bean->module_dir == "Users" |
45 | - && isset($_REQUEST['action']) && $_REQUEST['action'] != 'SaveSignature' ) { //Bug: 589 |
|
45 | + && isset($_REQUEST['action']) && $_REQUEST['action'] != 'SaveSignature') { //Bug: 589 |
|
46 | 46 | |
47 | 47 | //$_REQUEST['return_module'] = $bean->module_dir; |
48 | 48 | //$_REQUEST['return_action'] = "DetailView"; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | //$_SESSION['securitygroups_popup_'.$bean->module_dir] = $bean->id; |
52 | 52 | |
53 | - if(!isset($_SESSION['securitygroups_popup'])) { |
|
53 | + if (!isset($_SESSION['securitygroups_popup'])) { |
|
54 | 54 | $_SESSION['securitygroups_popup'] = array(); |
55 | 55 | } |
56 | 56 | $_SESSION['securitygroups_popup'][] = array( |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | function popup_onload($event, $arguments) |
65 | 65 | { |
66 | - if(!empty($_REQUEST['to_pdf']) || !empty($_REQUEST['sugar_body_only'])) return; |
|
66 | + if (!empty($_REQUEST['to_pdf']) || !empty($_REQUEST['sugar_body_only'])) return; |
|
67 | 67 | |
68 | 68 | /** //test user popup |
69 | 69 | //always have this loaded |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | $module = $_REQUEST['module']; |
75 | 75 | $action = $_REQUEST['action']; |
76 | 76 | |
77 | - if(isset($action) && ($action == "Save" || $action == "SetTimezone")) return; |
|
77 | + if (isset($action) && ($action == "Save" || $action == "SetTimezone")) return; |
|
78 | 78 | |
79 | - if( ( |
|
79 | + if (( |
|
80 | 80 | //(isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true) |
81 | 81 | //|| |
82 | 82 | ($module == "Users" && isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true) |
@@ -86,17 +86,17 @@ discard block |
||
86 | 86 | && !empty($_SESSION['securitygroups_popup']) |
87 | 87 | ) { |
88 | 88 | |
89 | - foreach($_SESSION['securitygroups_popup'] as $popup_index => $popup) { |
|
89 | + foreach ($_SESSION['securitygroups_popup'] as $popup_index => $popup) { |
|
90 | 90 | $record_id = $popup['id']; |
91 | 91 | $module = $popup['module']; |
92 | 92 | unset($_SESSION['securitygroups_popup'][$popup_index]); |
93 | 93 | |
94 | 94 | require_once('modules/SecurityGroups/SecurityGroup.php'); |
95 | 95 | $groupFocus = new SecurityGroup(); |
96 | - if($module == 'Users') { |
|
96 | + if ($module == 'Users') { |
|
97 | 97 | $rel_name = "SecurityGroups"; |
98 | 98 | } else { |
99 | - $rel_name = $groupFocus->getLinkName($module,"SecurityGroups"); |
|
99 | + $rel_name = $groupFocus->getLinkName($module, "SecurityGroups"); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | //this only works if on the detail view of the record actually saved... |
@@ -121,21 +121,21 @@ discard block |
||
121 | 121 | $action = $_REQUEST['action']; |
122 | 122 | $module = $_REQUEST['module']; |
123 | 123 | |
124 | - $no_mass_assign_list = array("Emails"=>"Emails","ACLRoles"=>"ACLRoles"); //,"Users"=>"Users"); |
|
124 | + $no_mass_assign_list = array("Emails"=>"Emails", "ACLRoles"=>"ACLRoles"); //,"Users"=>"Users"); |
|
125 | 125 | //check if security suite enabled |
126 | 126 | $action = strtolower($action); |
127 | - if(isset($module) && ($action == "list" || $action == "index" || $action == "listview") |
|
127 | + if (isset($module) && ($action == "list" || $action == "index" || $action == "listview") |
|
128 | 128 | && (!isset($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] != true) |
129 | - && !array_key_exists($module,$no_mass_assign_list) |
|
129 | + && !array_key_exists($module, $no_mass_assign_list) |
|
130 | 130 | ) { |
131 | 131 | global $current_user; |
132 | - if(is_admin($current_user) || ACLAction::getUserAccessLevel($current_user->id,"SecurityGroups", 'access') == ACL_ALLOW_ENABLED) { |
|
132 | + if (is_admin($current_user) || ACLAction::getUserAccessLevel($current_user->id, "SecurityGroups", 'access') == ACL_ALLOW_ENABLED) { |
|
133 | 133 | |
134 | 134 | require_once('modules/SecurityGroups/SecurityGroup.php'); |
135 | 135 | $groupFocus = new SecurityGroup(); |
136 | 136 | $security_modules = $groupFocus->getSecurityModules(); |
137 | 137 | //if(in_array($module,$security_modules)) { |
138 | - if(in_array($module,array_keys($security_modules))) { |
|
138 | + if (in_array($module, array_keys($security_modules))) { |
|
139 | 139 | |
140 | 140 | global $app_strings; |
141 | 141 | |
@@ -144,12 +144,12 @@ discard block |
||
144 | 144 | |
145 | 145 | $form_header = get_form_header($current_module_strings['LBL_MASS_ASSIGN'], '', false); |
146 | 146 | |
147 | - $groups = $groupFocus->get_list("name","",0,-99,-99); |
|
147 | + $groups = $groupFocus->get_list("name", "", 0, -99, -99); |
|
148 | 148 | $options = array(""=>""); |
149 | - foreach($groups['list'] as $group) { |
|
149 | + foreach ($groups['list'] as $group) { |
|
150 | 150 | $options[$group->id] = $group->name; |
151 | 151 | } |
152 | - $group_options = get_select_options_with_id($options, ""); |
|
152 | + $group_options = get_select_options_with_id($options, ""); |
|
153 | 153 | |
154 | 154 | $mass_assign = <<<EOQ |
155 | 155 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | } |
271 | 271 | |
272 | 272 | //if after a save... |
273 | - if(!empty($_SESSION['securitysuite_error'])) { |
|
273 | + if (!empty($_SESSION['securitysuite_error'])) { |
|
274 | 274 | $lbl_securitysuite_error = $_SESSION['securitysuite_error']; |
275 | 275 | unset($_SESSION['securitysuite_error']); |
276 | 276 | echo <<<EOQ |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | |
5 | 7 | class AssignGroups { |
@@ -14,7 +16,9 @@ discard block |
||
14 | 16 | && empty($bean->fetched_row['id']) && $bean->module_dir != "Users" && $bean->module_dir != "SugarFeed") { |
15 | 17 | //Upload an attachment to an Email Template and save. If user with multi groups - popup select option |
16 | 18 | //it will redirect to notes instead of EmailTemplate and relationship will fail...check below to avoid |
17 | - if(!empty($_REQUEST['module']) && $_REQUEST['module'] != $bean->module_dir) return; |
|
19 | + if(!empty($_REQUEST['module']) && $_REQUEST['module'] != $bean->module_dir) { |
|
20 | + return; |
|
21 | + } |
|
18 | 22 | |
19 | 23 | if(!empty($_REQUEST['securitygroup_list'])) { |
20 | 24 | require_once('modules/SecurityGroups/SecurityGroup.php'); |
@@ -38,9 +42,7 @@ discard block |
||
38 | 42 | unset($_SESSION['securitysuite_error']); //to be safe |
39 | 43 | $_SESSION['securitysuite_error'] = $ss_mod_strings['LBL_ERROR_DUPLICATE']; |
40 | 44 | } |
41 | - } |
|
42 | - |
|
43 | - else if(isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true |
|
45 | + } else if(isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true |
|
44 | 46 | && empty($bean->fetched_row['id']) && $bean->module_dir == "Users" |
45 | 47 | && isset($_REQUEST['action']) && $_REQUEST['action'] != 'SaveSignature' ) { //Bug: 589 |
46 | 48 | |
@@ -63,7 +65,9 @@ discard block |
||
63 | 65 | |
64 | 66 | function popup_onload($event, $arguments) |
65 | 67 | { |
66 | - if(!empty($_REQUEST['to_pdf']) || !empty($_REQUEST['sugar_body_only'])) return; |
|
68 | + if(!empty($_REQUEST['to_pdf']) || !empty($_REQUEST['sugar_body_only'])) { |
|
69 | + return; |
|
70 | + } |
|
67 | 71 | |
68 | 72 | /** //test user popup |
69 | 73 | //always have this loaded |
@@ -74,7 +78,9 @@ discard block |
||
74 | 78 | $module = $_REQUEST['module']; |
75 | 79 | $action = $_REQUEST['action']; |
76 | 80 | |
77 | - if(isset($action) && ($action == "Save" || $action == "SetTimezone")) return; |
|
81 | + if(isset($action) && ($action == "Save" || $action == "SetTimezone")) { |
|
82 | + return; |
|
83 | + } |
|
78 | 84 | |
79 | 85 | if( ( |
80 | 86 | //(isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true) |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | $this->ss->assign("SALUTATION_OPTIONS", get_select_options_with_id($app_list_strings['salutation_dom'], '')); |
57 | 57 | |
58 | - if($this->viaAJAX) { // override for ajax call |
|
58 | + if ($this->viaAJAX) { // override for ajax call |
|
59 | 59 | $this->ss->assign('saveOnclick', "onclick='if(check_form(\"contactsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"contacts\"); else return false;'"); |
60 | 60 | $this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_contacts\")';"); |
61 | 61 | } |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -57,12 +57,12 @@ |
||
57 | 57 | |
58 | 58 | foreach($focus->column_fields as $field) |
59 | 59 | { |
60 | - safe_map($field, $focus, true); |
|
60 | + safe_map($field, $focus, true); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | foreach($focus->additional_column_fields as $field) |
64 | 64 | { |
65 | - safe_map($field, $focus, true); |
|
65 | + safe_map($field, $focus, true); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | // send them to the edit screen. |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -55,18 +55,18 @@ discard block |
||
55 | 55 | |
56 | 56 | $focus->retrieve($_REQUEST['record']); |
57 | 57 | |
58 | -foreach($focus->column_fields as $field) |
|
58 | +foreach ($focus->column_fields as $field) |
|
59 | 59 | { |
60 | 60 | safe_map($field, $focus, true); |
61 | 61 | } |
62 | 62 | |
63 | -foreach($focus->additional_column_fields as $field) |
|
63 | +foreach ($focus->additional_column_fields as $field) |
|
64 | 64 | { |
65 | 65 | safe_map($field, $focus, true); |
66 | 66 | } |
67 | 67 | |
68 | 68 | // send them to the edit screen. |
69 | -if(isset($_REQUEST['record']) && $_REQUEST['record'] != "") |
|
69 | +if (isset($_REQUEST['record']) && $_REQUEST['record'] != "") |
|
70 | 70 | { |
71 | 71 | $recordID = $_REQUEST['record']; |
72 | 72 | } |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @author Salesagility Ltd <[email protected]> |
23 | 23 | */ |
24 | -if(!defined('sugarEntry'))define('sugarEntry', true); |
|
24 | +if (!defined('sugarEntry'))define('sugarEntry', true); |
|
25 | 25 | require_once 'modules/AOP_Case_Updates/util.php'; |
26 | -if(!isAOPEnabled()){ |
|
26 | +if (!isAOPEnabled()) { |
|
27 | 27 | return; |
28 | 28 | } |
29 | 29 | global $sugar_config, $mod_strings; |
@@ -33,19 +33,19 @@ discard block |
||
33 | 33 | $bean = new Contact(); |
34 | 34 | $bean->retrieve($_REQUEST['record']); |
35 | 35 | |
36 | -if(array_key_exists("aop",$sugar_config) && array_key_exists("joomla_url",$sugar_config['aop'])){ |
|
36 | +if (array_key_exists("aop", $sugar_config) && array_key_exists("joomla_url", $sugar_config['aop'])) { |
|
37 | 37 | $portalURL = $sugar_config['aop']['joomla_url']; |
38 | 38 | $wbsv = file_get_contents($portalURL.'/index.php?option=com_advancedopenportal&task=disable_user&sug='.$_REQUEST['record'].'&uid='.$bean->joomla_account_id); |
39 | 39 | $res = json_decode($wbsv); |
40 | - if(!$res->success){ |
|
40 | + if (!$res->success) { |
|
41 | 41 | $msg = $res->error ? $res->error : $mod_strings['LBL_DISABLE_PORTAL_USER_FAILED']; |
42 | 42 | SugarApplication::appendErrorMessage($msg); |
43 | - }else{ |
|
43 | + } else { |
|
44 | 44 | $bean->portal_account_disabled = 1; |
45 | 45 | $bean->save(false); |
46 | 46 | SugarApplication::appendErrorMessage($mod_strings['LBL_DISABLE_PORTAL_USER_SUCCESS']); |
47 | 47 | } |
48 | -}else{ |
|
48 | +} else { |
|
49 | 49 | SugarApplication::appendErrorMessage($mod_strings['LBL_NO_JOOMLA_URL']); |
50 | 50 | } |
51 | 51 |
@@ -21,7 +21,9 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @author Salesagility Ltd <[email protected]> |
23 | 23 | */ |
24 | -if(!defined('sugarEntry'))define('sugarEntry', true); |
|
24 | +if(!defined('sugarEntry')) { |
|
25 | + define('sugarEntry', true); |
|
26 | +} |
|
25 | 27 | require_once 'modules/AOP_Case_Updates/util.php'; |
26 | 28 | if(!isAOPEnabled()){ |
27 | 29 | return; |
@@ -40,12 +42,12 @@ discard block |
||
40 | 42 | if(!$res->success){ |
41 | 43 | $msg = $res->error ? $res->error : $mod_strings['LBL_DISABLE_PORTAL_USER_FAILED']; |
42 | 44 | SugarApplication::appendErrorMessage($msg); |
43 | - }else{ |
|
45 | + } else{ |
|
44 | 46 | $bean->portal_account_disabled = 1; |
45 | 47 | $bean->save(false); |
46 | 48 | SugarApplication::appendErrorMessage($mod_strings['LBL_DISABLE_PORTAL_USER_SUCCESS']); |
47 | 49 | } |
48 | -}else{ |
|
50 | +} else{ |
|
49 | 51 | SugarApplication::appendErrorMessage($mod_strings['LBL_NO_JOOMLA_URL']); |
50 | 52 | } |
51 | 53 |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | |
41 | 41 | |
42 | 42 | function additionalDetailsContact($fields) { |
43 | - static $mod_strings; |
|
44 | - if(empty($mod_strings)) { |
|
45 | - global $current_language; |
|
46 | - $mod_strings = return_module_language($current_language, 'Contacts'); |
|
47 | - } |
|
43 | + static $mod_strings; |
|
44 | + if(empty($mod_strings)) { |
|
45 | + global $current_language; |
|
46 | + $mod_strings = return_module_language($current_language, 'Contacts'); |
|
47 | + } |
|
48 | 48 | |
49 | - $overlib_string = ''; |
|
49 | + $overlib_string = ''; |
|
50 | 50 | if(!empty($fields['ID'])) { |
51 | 51 | $overlib_string .= '<input type="hidden" value="'. $fields['ID']; |
52 | 52 | $overlib_string .= '">'; |
@@ -55,35 +55,35 @@ discard block |
||
55 | 55 | $overlib_string .= '<h2><img src="index.php?entryPoint=getImage&themeName=' . SugarThemeRegistry::current()->name .'&imageName=Contacts.gif"/> '.$mod_strings['LBL_CONTACT'].'</h2>'; |
56 | 56 | |
57 | 57 | if(!empty($fields['PRIMARY_ADDRESS_STREET']) || !empty($fields['PRIMARY_ADDRESS_CITY']) || |
58 | - !empty($fields['PRIMARY_ADDRESS_STATE']) || !empty($fields['PRIMARY_ADDRESS_POSTALCODE']) || |
|
59 | - !empty($fields['PRIMARY_ADDRESS_COUNTRY'])) |
|
60 | - $overlib_string .= '<b>' . $mod_strings['LBL_PRIMARY_ADDRESS'] . '</b><br>'; |
|
61 | - if(!empty($fields['PRIMARY_ADDRESS_STREET'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'] . '<br>'; |
|
62 | - if(!empty($fields['PRIMARY_ADDRESS_STREET_2'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_2'] . '<br>'; |
|
63 | - if(!empty($fields['PRIMARY_ADDRESS_STREET_3'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_3'] . '<br>'; |
|
64 | - if(!empty($fields['PRIMARY_ADDRESS_CITY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'] . ', '; |
|
65 | - if(!empty($fields['PRIMARY_ADDRESS_STATE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'] . ' '; |
|
66 | - if(!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'] . ' '; |
|
67 | - if(!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'] . '<br>'; |
|
68 | - if(strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) |
|
69 | - $overlib_string .= '<br>'; |
|
70 | - if(!empty($fields['PHONE_MOBILE'])) $overlib_string .= '<b>'. $mod_strings['LBL_MOBILE_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_MOBILE'] . '</span><br>'; |
|
71 | - if(!empty($fields['PHONE_HOME'])) $overlib_string .= '<b>'. $mod_strings['LBL_HOME_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_HOME'] . '</span><br>'; |
|
72 | - if(!empty($fields['PHONE_OTHER'])) $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_OTHER'] . '</span><br>'; |
|
58 | + !empty($fields['PRIMARY_ADDRESS_STATE']) || !empty($fields['PRIMARY_ADDRESS_POSTALCODE']) || |
|
59 | + !empty($fields['PRIMARY_ADDRESS_COUNTRY'])) |
|
60 | + $overlib_string .= '<b>' . $mod_strings['LBL_PRIMARY_ADDRESS'] . '</b><br>'; |
|
61 | + if(!empty($fields['PRIMARY_ADDRESS_STREET'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'] . '<br>'; |
|
62 | + if(!empty($fields['PRIMARY_ADDRESS_STREET_2'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_2'] . '<br>'; |
|
63 | + if(!empty($fields['PRIMARY_ADDRESS_STREET_3'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_3'] . '<br>'; |
|
64 | + if(!empty($fields['PRIMARY_ADDRESS_CITY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'] . ', '; |
|
65 | + if(!empty($fields['PRIMARY_ADDRESS_STATE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'] . ' '; |
|
66 | + if(!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'] . ' '; |
|
67 | + if(!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'] . '<br>'; |
|
68 | + if(strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) |
|
69 | + $overlib_string .= '<br>'; |
|
70 | + if(!empty($fields['PHONE_MOBILE'])) $overlib_string .= '<b>'. $mod_strings['LBL_MOBILE_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_MOBILE'] . '</span><br>'; |
|
71 | + if(!empty($fields['PHONE_HOME'])) $overlib_string .= '<b>'. $mod_strings['LBL_HOME_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_HOME'] . '</span><br>'; |
|
72 | + if(!empty($fields['PHONE_OTHER'])) $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_OTHER'] . '</span><br>'; |
|
73 | 73 | |
74 | - if(!empty($fields['DATE_MODIFIED'])) $overlib_string .= '<b>'. $mod_strings['LBL_DATE_MODIFIED'] . '</b> ' . $fields['DATE_MODIFIED'] . '<br>'; |
|
74 | + if(!empty($fields['DATE_MODIFIED'])) $overlib_string .= '<b>'. $mod_strings['LBL_DATE_MODIFIED'] . '</b> ' . $fields['DATE_MODIFIED'] . '<br>'; |
|
75 | 75 | |
76 | - if(!empty($fields['DESCRIPTION'])) { |
|
77 | - $overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300); |
|
78 | - if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...'; |
|
79 | - } |
|
76 | + if(!empty($fields['DESCRIPTION'])) { |
|
77 | + $overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300); |
|
78 | + if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...'; |
|
79 | + } |
|
80 | 80 | |
81 | - return array('fieldToAddTo' => 'NAME', |
|
82 | - 'string' => $overlib_string, |
|
83 | - 'editLink' => "index.php?action=EditView&module=Contacts&return_module=Contacts&record={$fields['ID']}", |
|
84 | - 'viewLink' => "index.php?action=DetailView&module=Contacts&return_module=Contacts&record={$fields['ID']}"); |
|
81 | + return array('fieldToAddTo' => 'NAME', |
|
82 | + 'string' => $overlib_string, |
|
83 | + 'editLink' => "index.php?action=EditView&module=Contacts&return_module=Contacts&record={$fields['ID']}", |
|
84 | + 'viewLink' => "index.php?action=DetailView&module=Contacts&return_module=Contacts&record={$fields['ID']}"); |
|
85 | 85 | } |
86 | 86 | |
87 | - ?> |
|
87 | + ?> |
|
88 | 88 | |
89 | 89 | |
90 | 90 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -41,41 +41,41 @@ discard block |
||
41 | 41 | |
42 | 42 | function additionalDetailsContact($fields) { |
43 | 43 | static $mod_strings; |
44 | - if(empty($mod_strings)) { |
|
44 | + if (empty($mod_strings)) { |
|
45 | 45 | global $current_language; |
46 | 46 | $mod_strings = return_module_language($current_language, 'Contacts'); |
47 | 47 | } |
48 | 48 | |
49 | 49 | $overlib_string = ''; |
50 | - if(!empty($fields['ID'])) { |
|
51 | - $overlib_string .= '<input type="hidden" value="'. $fields['ID']; |
|
50 | + if (!empty($fields['ID'])) { |
|
51 | + $overlib_string .= '<input type="hidden" value="'.$fields['ID']; |
|
52 | 52 | $overlib_string .= '">'; |
53 | 53 | } |
54 | 54 | |
55 | - $overlib_string .= '<h2><img src="index.php?entryPoint=getImage&themeName=' . SugarThemeRegistry::current()->name .'&imageName=Contacts.gif"/> '.$mod_strings['LBL_CONTACT'].'</h2>'; |
|
55 | + $overlib_string .= '<h2><img src="index.php?entryPoint=getImage&themeName='.SugarThemeRegistry::current()->name.'&imageName=Contacts.gif"/> '.$mod_strings['LBL_CONTACT'].'</h2>'; |
|
56 | 56 | |
57 | - if(!empty($fields['PRIMARY_ADDRESS_STREET']) || !empty($fields['PRIMARY_ADDRESS_CITY']) || |
|
57 | + if (!empty($fields['PRIMARY_ADDRESS_STREET']) || !empty($fields['PRIMARY_ADDRESS_CITY']) || |
|
58 | 58 | !empty($fields['PRIMARY_ADDRESS_STATE']) || !empty($fields['PRIMARY_ADDRESS_POSTALCODE']) || |
59 | 59 | !empty($fields['PRIMARY_ADDRESS_COUNTRY'])) |
60 | - $overlib_string .= '<b>' . $mod_strings['LBL_PRIMARY_ADDRESS'] . '</b><br>'; |
|
61 | - if(!empty($fields['PRIMARY_ADDRESS_STREET'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'] . '<br>'; |
|
62 | - if(!empty($fields['PRIMARY_ADDRESS_STREET_2'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_2'] . '<br>'; |
|
63 | - if(!empty($fields['PRIMARY_ADDRESS_STREET_3'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_3'] . '<br>'; |
|
64 | - if(!empty($fields['PRIMARY_ADDRESS_CITY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'] . ', '; |
|
65 | - if(!empty($fields['PRIMARY_ADDRESS_STATE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'] . ' '; |
|
66 | - if(!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'] . ' '; |
|
67 | - if(!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'] . '<br>'; |
|
68 | - if(strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) |
|
60 | + $overlib_string .= '<b>'.$mod_strings['LBL_PRIMARY_ADDRESS'].'</b><br>'; |
|
61 | + if (!empty($fields['PRIMARY_ADDRESS_STREET'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'].'<br>'; |
|
62 | + if (!empty($fields['PRIMARY_ADDRESS_STREET_2'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_2'].'<br>'; |
|
63 | + if (!empty($fields['PRIMARY_ADDRESS_STREET_3'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_3'].'<br>'; |
|
64 | + if (!empty($fields['PRIMARY_ADDRESS_CITY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'].', '; |
|
65 | + if (!empty($fields['PRIMARY_ADDRESS_STATE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'].' '; |
|
66 | + if (!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'].' '; |
|
67 | + if (!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'].'<br>'; |
|
68 | + if (strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) |
|
69 | 69 | $overlib_string .= '<br>'; |
70 | - if(!empty($fields['PHONE_MOBILE'])) $overlib_string .= '<b>'. $mod_strings['LBL_MOBILE_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_MOBILE'] . '</span><br>'; |
|
71 | - if(!empty($fields['PHONE_HOME'])) $overlib_string .= '<b>'. $mod_strings['LBL_HOME_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_HOME'] . '</span><br>'; |
|
72 | - if(!empty($fields['PHONE_OTHER'])) $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_OTHER'] . '</span><br>'; |
|
70 | + if (!empty($fields['PHONE_MOBILE'])) $overlib_string .= '<b>'.$mod_strings['LBL_MOBILE_PHONE'].'</b> <span class="phone">'.$fields['PHONE_MOBILE'].'</span><br>'; |
|
71 | + if (!empty($fields['PHONE_HOME'])) $overlib_string .= '<b>'.$mod_strings['LBL_HOME_PHONE'].'</b> <span class="phone">'.$fields['PHONE_HOME'].'</span><br>'; |
|
72 | + if (!empty($fields['PHONE_OTHER'])) $overlib_string .= '<b>'.$mod_strings['LBL_OTHER_PHONE'].'</b> <span class="phone">'.$fields['PHONE_OTHER'].'</span><br>'; |
|
73 | 73 | |
74 | - if(!empty($fields['DATE_MODIFIED'])) $overlib_string .= '<b>'. $mod_strings['LBL_DATE_MODIFIED'] . '</b> ' . $fields['DATE_MODIFIED'] . '<br>'; |
|
74 | + if (!empty($fields['DATE_MODIFIED'])) $overlib_string .= '<b>'.$mod_strings['LBL_DATE_MODIFIED'].'</b> '.$fields['DATE_MODIFIED'].'<br>'; |
|
75 | 75 | |
76 | - if(!empty($fields['DESCRIPTION'])) { |
|
77 | - $overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300); |
|
78 | - if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...'; |
|
76 | + if (!empty($fields['DESCRIPTION'])) { |
|
77 | + $overlib_string .= '<b>'.$mod_strings['LBL_DESCRIPTION'].'</b> '.substr($fields['DESCRIPTION'], 0, 300); |
|
78 | + if (strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...'; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | return array('fieldToAddTo' => 'NAME', |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -56,26 +58,52 @@ discard block |
||
56 | 58 | |
57 | 59 | if(!empty($fields['PRIMARY_ADDRESS_STREET']) || !empty($fields['PRIMARY_ADDRESS_CITY']) || |
58 | 60 | !empty($fields['PRIMARY_ADDRESS_STATE']) || !empty($fields['PRIMARY_ADDRESS_POSTALCODE']) || |
59 | - !empty($fields['PRIMARY_ADDRESS_COUNTRY'])) |
|
60 | - $overlib_string .= '<b>' . $mod_strings['LBL_PRIMARY_ADDRESS'] . '</b><br>'; |
|
61 | - if(!empty($fields['PRIMARY_ADDRESS_STREET'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'] . '<br>'; |
|
62 | - if(!empty($fields['PRIMARY_ADDRESS_STREET_2'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_2'] . '<br>'; |
|
63 | - if(!empty($fields['PRIMARY_ADDRESS_STREET_3'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_3'] . '<br>'; |
|
64 | - if(!empty($fields['PRIMARY_ADDRESS_CITY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'] . ', '; |
|
65 | - if(!empty($fields['PRIMARY_ADDRESS_STATE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'] . ' '; |
|
66 | - if(!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'] . ' '; |
|
67 | - if(!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'] . '<br>'; |
|
68 | - if(strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) |
|
69 | - $overlib_string .= '<br>'; |
|
70 | - if(!empty($fields['PHONE_MOBILE'])) $overlib_string .= '<b>'. $mod_strings['LBL_MOBILE_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_MOBILE'] . '</span><br>'; |
|
71 | - if(!empty($fields['PHONE_HOME'])) $overlib_string .= '<b>'. $mod_strings['LBL_HOME_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_HOME'] . '</span><br>'; |
|
72 | - if(!empty($fields['PHONE_OTHER'])) $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_OTHER'] . '</span><br>'; |
|
61 | + !empty($fields['PRIMARY_ADDRESS_COUNTRY'])) { |
|
62 | + $overlib_string .= '<b>' . $mod_strings['LBL_PRIMARY_ADDRESS'] . '</b><br>'; |
|
63 | + } |
|
64 | + if(!empty($fields['PRIMARY_ADDRESS_STREET'])) { |
|
65 | + $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'] . '<br>'; |
|
66 | + } |
|
67 | + if(!empty($fields['PRIMARY_ADDRESS_STREET_2'])) { |
|
68 | + $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_2'] . '<br>'; |
|
69 | + } |
|
70 | + if(!empty($fields['PRIMARY_ADDRESS_STREET_3'])) { |
|
71 | + $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_3'] . '<br>'; |
|
72 | + } |
|
73 | + if(!empty($fields['PRIMARY_ADDRESS_CITY'])) { |
|
74 | + $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'] . ', '; |
|
75 | + } |
|
76 | + if(!empty($fields['PRIMARY_ADDRESS_STATE'])) { |
|
77 | + $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'] . ' '; |
|
78 | + } |
|
79 | + if(!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) { |
|
80 | + $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'] . ' '; |
|
81 | + } |
|
82 | + if(!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) { |
|
83 | + $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'] . '<br>'; |
|
84 | + } |
|
85 | + if(strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) { |
|
86 | + $overlib_string .= '<br>'; |
|
87 | + } |
|
88 | + if(!empty($fields['PHONE_MOBILE'])) { |
|
89 | + $overlib_string .= '<b>'. $mod_strings['LBL_MOBILE_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_MOBILE'] . '</span><br>'; |
|
90 | + } |
|
91 | + if(!empty($fields['PHONE_HOME'])) { |
|
92 | + $overlib_string .= '<b>'. $mod_strings['LBL_HOME_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_HOME'] . '</span><br>'; |
|
93 | + } |
|
94 | + if(!empty($fields['PHONE_OTHER'])) { |
|
95 | + $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_OTHER'] . '</span><br>'; |
|
96 | + } |
|
73 | 97 | |
74 | - if(!empty($fields['DATE_MODIFIED'])) $overlib_string .= '<b>'. $mod_strings['LBL_DATE_MODIFIED'] . '</b> ' . $fields['DATE_MODIFIED'] . '<br>'; |
|
98 | + if(!empty($fields['DATE_MODIFIED'])) { |
|
99 | + $overlib_string .= '<b>'. $mod_strings['LBL_DATE_MODIFIED'] . '</b> ' . $fields['DATE_MODIFIED'] . '<br>'; |
|
100 | + } |
|
75 | 101 | |
76 | 102 | if(!empty($fields['DESCRIPTION'])) { |
77 | 103 | $overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300); |
78 | - if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...'; |
|
104 | + if(strlen($fields['DESCRIPTION']) > 300) { |
|
105 | + $overlib_string .= '...'; |
|
106 | + } |
|
79 | 107 | } |
80 | 108 | |
81 | 109 | return array('fieldToAddTo' => 'NAME', |
@@ -42,21 +42,21 @@ |
||
42 | 42 | global $mod_strings; |
43 | 43 | |
44 | 44 | $popupMeta = array('moduleMain' => 'Contact', |
45 | - 'varName' => 'CONTACT', |
|
46 | - 'orderBy' => 'contacts.first_name, contacts.last_name', |
|
47 | - 'whereClauses' => |
|
48 | - array('first_name' => 'contacts.first_name', |
|
49 | - 'last_name' => 'contacts.last_name', |
|
50 | - 'account_name' => 'accounts.name', |
|
51 | - 'account_id' => 'accounts.id'), |
|
52 | - 'searchInputs' => |
|
53 | - array('first_name', 'last_name', 'account_name'), |
|
54 | - 'create' => |
|
55 | - array('formBase' => 'ContactFormBase.php', |
|
56 | - 'formBaseClass' => 'ContactFormBase', |
|
57 | - 'getFormBodyParams' => array('','','ContactSave'), |
|
58 | - 'createButton' => 'LNK_NEW_CONTACT' |
|
59 | - ), |
|
60 | - 'templateForm' => 'modules/Contacts/Email_picker.html', |
|
61 | - ); |
|
45 | + 'varName' => 'CONTACT', |
|
46 | + 'orderBy' => 'contacts.first_name, contacts.last_name', |
|
47 | + 'whereClauses' => |
|
48 | + array('first_name' => 'contacts.first_name', |
|
49 | + 'last_name' => 'contacts.last_name', |
|
50 | + 'account_name' => 'accounts.name', |
|
51 | + 'account_id' => 'accounts.id'), |
|
52 | + 'searchInputs' => |
|
53 | + array('first_name', 'last_name', 'account_name'), |
|
54 | + 'create' => |
|
55 | + array('formBase' => 'ContactFormBase.php', |
|
56 | + 'formBaseClass' => 'ContactFormBase', |
|
57 | + 'getFormBodyParams' => array('','','ContactSave'), |
|
58 | + 'createButton' => 'LNK_NEW_CONTACT' |
|
59 | + ), |
|
60 | + 'templateForm' => 'modules/Contacts/Email_picker.html', |
|
61 | + ); |
|
62 | 62 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | 'create' => |
55 | 55 | array('formBase' => 'ContactFormBase.php', |
56 | 56 | 'formBaseClass' => 'ContactFormBase', |
57 | - 'getFormBodyParams' => array('','','ContactSave'), |
|
57 | + 'getFormBodyParams' => array('', '', 'ContactSave'), |
|
58 | 58 | 'createButton' => 'LNK_NEW_CONTACT' |
59 | 59 | ), |
60 | 60 | 'templateForm' => 'modules/Contacts/Email_picker.html', |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -39,193 +39,193 @@ |
||
39 | 39 | |
40 | 40 | $viewdefs ['Contacts'] = |
41 | 41 | array ( |
42 | - 'EditView' => |
|
43 | - array ( |
|
42 | + 'EditView' => |
|
43 | + array ( |
|
44 | 44 | 'templateMeta' => |
45 | 45 | array ( |
46 | - 'form' => |
|
47 | - array ( |
|
46 | + 'form' => |
|
47 | + array ( |
|
48 | 48 | 'hidden' => |
49 | 49 | array ( |
50 | - 0 => '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">', |
|
51 | - 1 => '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">', |
|
52 | - 2 => '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">', |
|
53 | - 3 => '<input type="hidden" name="email_id" value="{$smarty.request.email_id}">', |
|
54 | - 4 => '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">', |
|
50 | + 0 => '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">', |
|
51 | + 1 => '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">', |
|
52 | + 2 => '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">', |
|
53 | + 3 => '<input type="hidden" name="email_id" value="{$smarty.request.email_id}">', |
|
54 | + 4 => '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">', |
|
55 | + ), |
|
55 | 56 | ), |
56 | - ), |
|
57 | - 'maxColumns' => '2', |
|
58 | - 'widths' => |
|
59 | - array ( |
|
57 | + 'maxColumns' => '2', |
|
58 | + 'widths' => |
|
59 | + array ( |
|
60 | 60 | 0 => |
61 | 61 | array ( |
62 | - 'label' => '10', |
|
63 | - 'field' => '30', |
|
62 | + 'label' => '10', |
|
63 | + 'field' => '30', |
|
64 | 64 | ), |
65 | 65 | 1 => |
66 | 66 | array ( |
67 | - 'label' => '10', |
|
68 | - 'field' => '30', |
|
67 | + 'label' => '10', |
|
68 | + 'field' => '30', |
|
69 | + ), |
|
69 | 70 | ), |
70 | - ), |
|
71 | - 'useTabs' => false, |
|
72 | - 'tabDefs' => |
|
73 | - array ( |
|
71 | + 'useTabs' => false, |
|
72 | + 'tabDefs' => |
|
73 | + array ( |
|
74 | 74 | 'LBL_CONTACT_INFORMATION' => |
75 | 75 | array ( |
76 | - 'newTab' => false, |
|
77 | - 'panelDefault' => 'expanded', |
|
76 | + 'newTab' => false, |
|
77 | + 'panelDefault' => 'expanded', |
|
78 | 78 | ), |
79 | 79 | 'LBL_PANEL_ADVANCED' => |
80 | 80 | array ( |
81 | - 'newTab' => false, |
|
82 | - 'panelDefault' => 'expanded', |
|
81 | + 'newTab' => false, |
|
82 | + 'panelDefault' => 'expanded', |
|
83 | + ), |
|
83 | 84 | ), |
84 | - ), |
|
85 | 85 | ), |
86 | 86 | 'panels' => |
87 | 87 | array ( |
88 | - 'lbl_contact_information' => |
|
89 | - array ( |
|
88 | + 'lbl_contact_information' => |
|
89 | + array ( |
|
90 | 90 | 0 => |
91 | 91 | array ( |
92 | - 0 => |
|
93 | - array ( |
|
92 | + 0 => |
|
93 | + array ( |
|
94 | 94 | 'name' => 'first_name', |
95 | 95 | 'customCode' => '{html_options name="salutation" id="salutation" options=$fields.salutation.options selected=$fields.salutation.value} <input name="first_name" id="first_name" size="25" maxlength="25" type="text" value="{$fields.first_name.value}">', |
96 | - ), |
|
97 | - 1 => |
|
98 | - array ( |
|
96 | + ), |
|
97 | + 1 => |
|
98 | + array ( |
|
99 | 99 | 'name' => 'last_name', |
100 | - ), |
|
100 | + ), |
|
101 | 101 | ), |
102 | 102 | 1 => |
103 | 103 | array ( |
104 | - 0 => |
|
105 | - array ( |
|
104 | + 0 => |
|
105 | + array ( |
|
106 | 106 | 'name' => 'phone_work', |
107 | 107 | 'comment' => 'Work phone number of the contact', |
108 | 108 | 'label' => 'LBL_OFFICE_PHONE', |
109 | - ), |
|
110 | - 1 => |
|
111 | - array ( |
|
109 | + ), |
|
110 | + 1 => |
|
111 | + array ( |
|
112 | 112 | 'name' => 'phone_mobile', |
113 | 113 | 'comment' => 'Mobile phone number of the contact', |
114 | 114 | 'label' => 'LBL_MOBILE_PHONE', |
115 | - ), |
|
115 | + ), |
|
116 | 116 | ), |
117 | 117 | 2 => |
118 | 118 | array ( |
119 | - 0 => |
|
120 | - array ( |
|
119 | + 0 => |
|
120 | + array ( |
|
121 | 121 | 'name' => 'title', |
122 | 122 | 'comment' => 'The title of the contact', |
123 | 123 | 'label' => 'LBL_TITLE', |
124 | - ), |
|
125 | - 1 => 'department', |
|
124 | + ), |
|
125 | + 1 => 'department', |
|
126 | 126 | ), |
127 | 127 | 3 => |
128 | 128 | array ( |
129 | - 0 => |
|
130 | - array ( |
|
129 | + 0 => |
|
130 | + array ( |
|
131 | 131 | 'name' => 'account_name', |
132 | 132 | 'displayParams' => |
133 | 133 | array ( |
134 | - 'key' => 'billing', |
|
135 | - 'copy' => 'primary', |
|
136 | - 'billingKey' => 'primary', |
|
137 | - 'additionalFields' => |
|
138 | - array ( |
|
134 | + 'key' => 'billing', |
|
135 | + 'copy' => 'primary', |
|
136 | + 'billingKey' => 'primary', |
|
137 | + 'additionalFields' => |
|
138 | + array ( |
|
139 | 139 | 'phone_office' => 'phone_work', |
140 | - ), |
|
140 | + ), |
|
141 | 141 | ), |
142 | - ), |
|
143 | - 1 => |
|
144 | - array ( |
|
142 | + ), |
|
143 | + 1 => |
|
144 | + array ( |
|
145 | 145 | 'name' => 'phone_fax', |
146 | 146 | 'comment' => 'Contact fax number', |
147 | 147 | 'label' => 'LBL_FAX_PHONE', |
148 | - ), |
|
148 | + ), |
|
149 | 149 | ), |
150 | 150 | 4 => |
151 | 151 | array ( |
152 | - 0 => |
|
153 | - array ( |
|
152 | + 0 => |
|
153 | + array ( |
|
154 | 154 | 'name' => 'email1', |
155 | 155 | 'studio' => 'false', |
156 | 156 | 'label' => 'LBL_EMAIL_ADDRESS', |
157 | - ), |
|
157 | + ), |
|
158 | 158 | ), |
159 | 159 | 5 => |
160 | 160 | array ( |
161 | - 0 => |
|
162 | - array ( |
|
161 | + 0 => |
|
162 | + array ( |
|
163 | 163 | 'name' => 'primary_address_street', |
164 | 164 | 'hideLabel' => true, |
165 | 165 | 'type' => 'address', |
166 | 166 | 'displayParams' => |
167 | 167 | array ( |
168 | - 'key' => 'primary', |
|
169 | - 'rows' => 2, |
|
170 | - 'cols' => 30, |
|
171 | - 'maxlength' => 150, |
|
168 | + 'key' => 'primary', |
|
169 | + 'rows' => 2, |
|
170 | + 'cols' => 30, |
|
171 | + 'maxlength' => 150, |
|
172 | + ), |
|
172 | 173 | ), |
173 | - ), |
|
174 | - 1 => |
|
175 | - array ( |
|
174 | + 1 => |
|
175 | + array ( |
|
176 | 176 | 'name' => 'alt_address_street', |
177 | 177 | 'hideLabel' => true, |
178 | 178 | 'type' => 'address', |
179 | 179 | 'displayParams' => |
180 | 180 | array ( |
181 | - 'key' => 'alt', |
|
182 | - 'copy' => 'primary', |
|
183 | - 'rows' => 2, |
|
184 | - 'cols' => 30, |
|
185 | - 'maxlength' => 150, |
|
181 | + 'key' => 'alt', |
|
182 | + 'copy' => 'primary', |
|
183 | + 'rows' => 2, |
|
184 | + 'cols' => 30, |
|
185 | + 'maxlength' => 150, |
|
186 | + ), |
|
186 | 187 | ), |
187 | - ), |
|
188 | 188 | ), |
189 | 189 | 6 => |
190 | 190 | array ( |
191 | - 0 => |
|
192 | - array ( |
|
191 | + 0 => |
|
192 | + array ( |
|
193 | 193 | 'name' => 'description', |
194 | 194 | 'label' => 'LBL_DESCRIPTION', |
195 | - ), |
|
196 | - 1 => '', |
|
195 | + ), |
|
196 | + 1 => '', |
|
197 | 197 | ), |
198 | 198 | 7 => |
199 | 199 | array ( |
200 | - 0 => |
|
201 | - array ( |
|
200 | + 0 => |
|
201 | + array ( |
|
202 | 202 | 'name' => 'assigned_user_name', |
203 | 203 | 'label' => 'LBL_ASSIGNED_TO_NAME', |
204 | - ), |
|
204 | + ), |
|
205 | + ), |
|
205 | 206 | ), |
206 | - ), |
|
207 | - 'LBL_PANEL_ADVANCED' => |
|
208 | - array ( |
|
207 | + 'LBL_PANEL_ADVANCED' => |
|
208 | + array ( |
|
209 | 209 | 0 => |
210 | 210 | array ( |
211 | - 0 => |
|
212 | - array ( |
|
211 | + 0 => |
|
212 | + array ( |
|
213 | 213 | 'name' => 'lead_source', |
214 | 214 | 'comment' => 'How did the contact come about', |
215 | 215 | 'label' => 'LBL_LEAD_SOURCE', |
216 | - ), |
|
216 | + ), |
|
217 | 217 | ), |
218 | 218 | 1 => |
219 | 219 | array ( |
220 | - 0 => |
|
221 | - array ( |
|
220 | + 0 => |
|
221 | + array ( |
|
222 | 222 | 'name' => 'report_to_name', |
223 | 223 | 'label' => 'LBL_REPORTS_TO', |
224 | - ), |
|
225 | - 1 => 'campaign_name', |
|
224 | + ), |
|
225 | + 1 => 'campaign_name', |
|
226 | 226 | ), |
227 | - ), |
|
227 | + ), |
|
228 | + ), |
|
228 | 229 | ), |
229 | - ), |
|
230 | 230 | ); |
231 | 231 | ?> |
@@ -38,15 +38,15 @@ discard block |
||
38 | 38 | ********************************************************************************/ |
39 | 39 | |
40 | 40 | $viewdefs ['Contacts'] = |
41 | -array ( |
|
41 | +array( |
|
42 | 42 | 'EditView' => |
43 | - array ( |
|
43 | + array( |
|
44 | 44 | 'templateMeta' => |
45 | - array ( |
|
45 | + array( |
|
46 | 46 | 'form' => |
47 | - array ( |
|
47 | + array( |
|
48 | 48 | 'hidden' => |
49 | - array ( |
|
49 | + array( |
|
50 | 50 | 0 => '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">', |
51 | 51 | 1 => '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">', |
52 | 52 | 2 => '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">', |
@@ -56,68 +56,68 @@ discard block |
||
56 | 56 | ), |
57 | 57 | 'maxColumns' => '2', |
58 | 58 | 'widths' => |
59 | - array ( |
|
59 | + array( |
|
60 | 60 | 0 => |
61 | - array ( |
|
61 | + array( |
|
62 | 62 | 'label' => '10', |
63 | 63 | 'field' => '30', |
64 | 64 | ), |
65 | 65 | 1 => |
66 | - array ( |
|
66 | + array( |
|
67 | 67 | 'label' => '10', |
68 | 68 | 'field' => '30', |
69 | 69 | ), |
70 | 70 | ), |
71 | 71 | 'useTabs' => false, |
72 | 72 | 'tabDefs' => |
73 | - array ( |
|
73 | + array( |
|
74 | 74 | 'LBL_CONTACT_INFORMATION' => |
75 | - array ( |
|
75 | + array( |
|
76 | 76 | 'newTab' => false, |
77 | 77 | 'panelDefault' => 'expanded', |
78 | 78 | ), |
79 | 79 | 'LBL_PANEL_ADVANCED' => |
80 | - array ( |
|
80 | + array( |
|
81 | 81 | 'newTab' => false, |
82 | 82 | 'panelDefault' => 'expanded', |
83 | 83 | ), |
84 | 84 | ), |
85 | 85 | ), |
86 | 86 | 'panels' => |
87 | - array ( |
|
87 | + array( |
|
88 | 88 | 'lbl_contact_information' => |
89 | - array ( |
|
89 | + array( |
|
90 | 90 | 0 => |
91 | - array ( |
|
91 | + array( |
|
92 | 92 | 0 => |
93 | - array ( |
|
93 | + array( |
|
94 | 94 | 'name' => 'first_name', |
95 | 95 | 'customCode' => '{html_options name="salutation" id="salutation" options=$fields.salutation.options selected=$fields.salutation.value} <input name="first_name" id="first_name" size="25" maxlength="25" type="text" value="{$fields.first_name.value}">', |
96 | 96 | ), |
97 | 97 | 1 => |
98 | - array ( |
|
98 | + array( |
|
99 | 99 | 'name' => 'last_name', |
100 | 100 | ), |
101 | 101 | ), |
102 | 102 | 1 => |
103 | - array ( |
|
103 | + array( |
|
104 | 104 | 0 => |
105 | - array ( |
|
105 | + array( |
|
106 | 106 | 'name' => 'phone_work', |
107 | 107 | 'comment' => 'Work phone number of the contact', |
108 | 108 | 'label' => 'LBL_OFFICE_PHONE', |
109 | 109 | ), |
110 | 110 | 1 => |
111 | - array ( |
|
111 | + array( |
|
112 | 112 | 'name' => 'phone_mobile', |
113 | 113 | 'comment' => 'Mobile phone number of the contact', |
114 | 114 | 'label' => 'LBL_MOBILE_PHONE', |
115 | 115 | ), |
116 | 116 | ), |
117 | 117 | 2 => |
118 | - array ( |
|
118 | + array( |
|
119 | 119 | 0 => |
120 | - array ( |
|
120 | + array( |
|
121 | 121 | 'name' => 'title', |
122 | 122 | 'comment' => 'The title of the contact', |
123 | 123 | 'label' => 'LBL_TITLE', |
@@ -125,46 +125,46 @@ discard block |
||
125 | 125 | 1 => 'department', |
126 | 126 | ), |
127 | 127 | 3 => |
128 | - array ( |
|
128 | + array( |
|
129 | 129 | 0 => |
130 | - array ( |
|
130 | + array( |
|
131 | 131 | 'name' => 'account_name', |
132 | 132 | 'displayParams' => |
133 | - array ( |
|
133 | + array( |
|
134 | 134 | 'key' => 'billing', |
135 | 135 | 'copy' => 'primary', |
136 | 136 | 'billingKey' => 'primary', |
137 | 137 | 'additionalFields' => |
138 | - array ( |
|
138 | + array( |
|
139 | 139 | 'phone_office' => 'phone_work', |
140 | 140 | ), |
141 | 141 | ), |
142 | 142 | ), |
143 | 143 | 1 => |
144 | - array ( |
|
144 | + array( |
|
145 | 145 | 'name' => 'phone_fax', |
146 | 146 | 'comment' => 'Contact fax number', |
147 | 147 | 'label' => 'LBL_FAX_PHONE', |
148 | 148 | ), |
149 | 149 | ), |
150 | 150 | 4 => |
151 | - array ( |
|
151 | + array( |
|
152 | 152 | 0 => |
153 | - array ( |
|
153 | + array( |
|
154 | 154 | 'name' => 'email1', |
155 | 155 | 'studio' => 'false', |
156 | 156 | 'label' => 'LBL_EMAIL_ADDRESS', |
157 | 157 | ), |
158 | 158 | ), |
159 | 159 | 5 => |
160 | - array ( |
|
160 | + array( |
|
161 | 161 | 0 => |
162 | - array ( |
|
162 | + array( |
|
163 | 163 | 'name' => 'primary_address_street', |
164 | 164 | 'hideLabel' => true, |
165 | 165 | 'type' => 'address', |
166 | 166 | 'displayParams' => |
167 | - array ( |
|
167 | + array( |
|
168 | 168 | 'key' => 'primary', |
169 | 169 | 'rows' => 2, |
170 | 170 | 'cols' => 30, |
@@ -172,12 +172,12 @@ discard block |
||
172 | 172 | ), |
173 | 173 | ), |
174 | 174 | 1 => |
175 | - array ( |
|
175 | + array( |
|
176 | 176 | 'name' => 'alt_address_street', |
177 | 177 | 'hideLabel' => true, |
178 | 178 | 'type' => 'address', |
179 | 179 | 'displayParams' => |
180 | - array ( |
|
180 | + array( |
|
181 | 181 | 'key' => 'alt', |
182 | 182 | 'copy' => 'primary', |
183 | 183 | 'rows' => 2, |
@@ -187,38 +187,38 @@ discard block |
||
187 | 187 | ), |
188 | 188 | ), |
189 | 189 | 6 => |
190 | - array ( |
|
190 | + array( |
|
191 | 191 | 0 => |
192 | - array ( |
|
192 | + array( |
|
193 | 193 | 'name' => 'description', |
194 | 194 | 'label' => 'LBL_DESCRIPTION', |
195 | 195 | ), |
196 | 196 | 1 => '', |
197 | 197 | ), |
198 | 198 | 7 => |
199 | - array ( |
|
199 | + array( |
|
200 | 200 | 0 => |
201 | - array ( |
|
201 | + array( |
|
202 | 202 | 'name' => 'assigned_user_name', |
203 | 203 | 'label' => 'LBL_ASSIGNED_TO_NAME', |
204 | 204 | ), |
205 | 205 | ), |
206 | 206 | ), |
207 | 207 | 'LBL_PANEL_ADVANCED' => |
208 | - array ( |
|
208 | + array( |
|
209 | 209 | 0 => |
210 | - array ( |
|
210 | + array( |
|
211 | 211 | 0 => |
212 | - array ( |
|
212 | + array( |
|
213 | 213 | 'name' => 'lead_source', |
214 | 214 | 'comment' => 'How did the contact come about', |
215 | 215 | 'label' => 'LBL_LEAD_SOURCE', |
216 | 216 | ), |
217 | 217 | ), |
218 | 218 | 1 => |
219 | - array ( |
|
219 | + array( |
|
220 | 220 | 0 => |
221 | - array ( |
|
221 | + array( |
|
222 | 222 | 'name' => 'report_to_name', |
223 | 223 | 'label' => 'LBL_REPORTS_TO', |
224 | 224 | ), |