@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | $GLOBALS['log']->info("EmailTemplate detail view"); |
75 | 75 | |
76 | 76 | if ($has_campaign || $inboundEmail) { |
77 | - $xtpl = new XTemplate ('modules/EmailTemplates/EditView.html'); |
|
77 | + $xtpl = new XTemplate('modules/EmailTemplates/EditView.html'); |
|
78 | 78 | } else { |
79 | - $xtpl = new XTemplate ('modules/EmailTemplates/EditViewMain.html'); |
|
79 | + $xtpl = new XTemplate('modules/EmailTemplates/EditViewMain.html'); |
|
80 | 80 | } // else |
81 | 81 | $xtpl->assign("MOD", $mod_strings); |
82 | 82 | $xtpl->assign("APP", $app_strings); |
@@ -128,13 +128,13 @@ discard block |
||
128 | 128 | require_once('include/QuickSearchDefaults.php'); |
129 | 129 | $qsd = QuickSearchDefaults::getQuickSearchDefaults(); |
130 | 130 | $sqs_objects = array('EditView_assigned_user_name' => $qsd->getQSUser()); |
131 | -$quicksearch_js = '<script type="text/javascript" language="javascript">sqs_objects = ' . $json->encode($sqs_objects) . '; enableQS();</script>'; |
|
131 | +$quicksearch_js = '<script type="text/javascript" language="javascript">sqs_objects = '.$json->encode($sqs_objects).'; enableQS();</script>'; |
|
132 | 132 | |
133 | 133 | $xtpl->assign("CANCEL_SCRIPT", $cancel_script); |
134 | -$xtpl->assign("PRINT_URL", "index.php?" . $GLOBALS['request_string']); |
|
135 | -$xtpl->assign("JAVASCRIPT", get_set_focus_js() . $quicksearch_js); |
|
134 | +$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']); |
|
135 | +$xtpl->assign("JAVASCRIPT", get_set_focus_js().$quicksearch_js); |
|
136 | 136 | |
137 | -if (!is_file(sugar_cached('jsLanguage/') . $GLOBALS['current_language'] . '.js')) { |
|
137 | +if (!is_file(sugar_cached('jsLanguage/').$GLOBALS['current_language'].'.js')) { |
|
138 | 138 | require_once('include/language/jsLanguage.php'); |
139 | 139 | jsLanguage::createAppStringsCache($GLOBALS['current_language']); |
140 | 140 | } |
@@ -183,18 +183,18 @@ discard block |
||
183 | 183 | $record = $_REQUEST['record']; |
184 | 184 | } |
185 | 185 | |
186 | - $xtpl->assign("ADMIN_EDIT", "<a href='index.php?action=index&module=DynamicLayout&from_action=" . $_REQUEST['action'] . "&from_module=" . $_REQUEST['module'] . "&record=" . $record . "'>" . SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDIT_LAYOUT']) . "</a>"); |
|
186 | + $xtpl->assign("ADMIN_EDIT", "<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action']."&from_module=".$_REQUEST['module']."&record=".$record."'>".SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDIT_LAYOUT'])."</a>"); |
|
187 | 187 | |
188 | 188 | } |
189 | 189 | if (isset($focus->parent_type) && $focus->parent_type != "") { |
190 | - $change_parent_button = "<input title='" . $app_strings['LBL_SELECT_BUTTON_TITLE'] . "' |
|
191 | -tabindex='3' type='button' class='button' value='" . $app_strings['LBL_SELECT_BUTTON_LABEL'] . "' name='button' LANGUAGE=javascript onclick='return |
|
190 | + $change_parent_button = "<input title='".$app_strings['LBL_SELECT_BUTTON_TITLE']."' |
|
191 | +tabindex='3' type='button' class='button' value='" . $app_strings['LBL_SELECT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='return |
|
192 | 192 | window.open(\"index.php?module=\"+ document.EditView.parent_type.value + |
193 | 193 | \"&action=Popup&html=Popup_picker&form=TasksEditView\",\"test\",\"width=600,height=400,resizable=1,scrollbars=1\");'>"; |
194 | 194 | $xtpl->assign("CHANGE_PARENT_BUTTON", $change_parent_button); |
195 | 195 | } |
196 | 196 | if ($focus->parent_type == "Account") { |
197 | - $xtpl->assign("DEFAULT_SEARCH", "&query=true&account_id=$focus->parent_id&account_name=" . urlencode($focus->parent_name)); |
|
197 | + $xtpl->assign("DEFAULT_SEARCH", "&query=true&account_id=$focus->parent_id&account_name=".urlencode($focus->parent_name)); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | $xtpl->assign("DESCRIPTION", $focus->description); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | // If it's campaign then hide the Account. |
252 | 252 | if ($has_campaign) { |
253 | 253 | $dropdown = "<option value='Contacts'> |
254 | - " . $lblContactAndOthers . " |
|
254 | + " . $lblContactAndOthers." |
|
255 | 255 | </option>"; |
256 | 256 | $xtpl->assign("DROPDOWN", $dropdown); |
257 | 257 | $xtpl->assign("DEFAULT_MODULE", 'Contacts'); |
@@ -285,13 +285,13 @@ discard block |
||
285 | 285 | if (empty($the_note->filename)) { |
286 | 286 | continue; |
287 | 287 | } |
288 | - $secureLink = 'index.php?entryPoint=download&id=' . $the_note->id . '&type=Notes'; |
|
289 | - $attachments .= '<input type="checkbox" name="remove_attachment[]" value="' . $the_note->id . '"> ' . $app_strings['LNK_REMOVE'] . ' '; |
|
290 | - $attachments .= '<a href="' . $secureLink . '" target="_blank">' . $the_note->filename . '</a><br>'; |
|
288 | + $secureLink = 'index.php?entryPoint=download&id='.$the_note->id.'&type=Notes'; |
|
289 | + $attachments .= '<input type="checkbox" name="remove_attachment[]" value="'.$the_note->id.'"> '.$app_strings['LNK_REMOVE'].' '; |
|
290 | + $attachments .= '<a href="'.$secureLink.'" target="_blank">'.$the_note->filename.'</a><br>'; |
|
291 | 291 | } |
292 | 292 | } |
293 | 293 | $attJs = '<script type="text/javascript">'; |
294 | - $attJs .= 'var lnk_remove = "' . $app_strings['LNK_REMOVE'] . '";'; |
|
294 | + $attJs .= 'var lnk_remove = "'.$app_strings['LNK_REMOVE'].'";'; |
|
295 | 295 | $attJs .= '</script>'; |
296 | 296 | $xtpl->assign('ATTACHMENTS', $attachments); |
297 | 297 | $xtpl->assign('ATTACHMENTS_JAVASCRIPT', $attJs); |
@@ -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 | require_once('modules/Campaigns/utils.php'); |
5 | 7 | |
@@ -26,7 +28,9 @@ discard block |
||
26 | 28 | |
27 | 29 | |
28 | 30 | //setting default flag value so due date and time not required |
29 | -if (!isset($focus->id)) $focus->date_due_flag = 1; |
|
31 | +if (!isset($focus->id)) { |
|
32 | + $focus->date_due_flag = 1; |
|
33 | +} |
|
30 | 34 | |
31 | 35 | //needed when creating a new case with default values passed in |
32 | 36 | if (isset($_REQUEST['contact_name']) && is_null($focus->contact_name)) { |
@@ -85,12 +89,16 @@ discard block |
||
85 | 89 | $xtpl->parse("main.variable_option"); |
86 | 90 | |
87 | 91 | $returnAction = 'index'; |
88 | -if (isset($_REQUEST['return_module'])) $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']); |
|
92 | +if (isset($_REQUEST['return_module'])) { |
|
93 | + $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']); |
|
94 | +} |
|
89 | 95 | if (isset($_REQUEST['return_action'])) { |
90 | 96 | $xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']); |
91 | 97 | $returnAction = $_REQUEST['return_action']; |
92 | 98 | } |
93 | -if (isset($_REQUEST['return_id'])) $xtpl->assign("RETURN_ID", $_REQUEST['return_id']); |
|
99 | +if (isset($_REQUEST['return_id'])) { |
|
100 | + $xtpl->assign("RETURN_ID", $_REQUEST['return_id']); |
|
101 | +} |
|
94 | 102 | // handle Create $module then Cancel |
95 | 103 | if (empty($_REQUEST['return_id'])) { |
96 | 104 | $xtpl->assign("RETURN_ACTION", 'index'); |
@@ -119,8 +127,9 @@ discard block |
||
119 | 127 | ); |
120 | 128 | $json = getJSONobj(); |
121 | 129 | $xtpl->assign('encoded_assigned_users_popup_request_data', $json->encode($popup_request_data)); |
122 | -if (!empty($focus->assigned_user_name)) |
|
130 | +if (!empty($focus->assigned_user_name)) { |
|
123 | 131 | $xtpl->assign("ASSIGNED_USER_NAME", $focus->assigned_user_name); |
132 | +} |
|
124 | 133 | |
125 | 134 | $xtpl->assign("assign_user_select", SugarThemeRegistry::current()->getImage('id-ff-select', '', null, null, '.png', $mod_strings['LBL_SELECT'])); |
126 | 135 | $xtpl->assign("assign_user_clear", SugarThemeRegistry::current()->getImage('id-ff-clear', '', null, null, '.gif', $mod_strings['LBL_ID_FF_CLEAR'])); |
@@ -142,24 +151,39 @@ discard block |
||
142 | 151 | $xtpl->assign("JSLANG", $jsLang); |
143 | 152 | |
144 | 153 | $xtpl->assign("ID", $focus->id); |
145 | -if (isset($focus->name)) $xtpl->assign("NAME", $focus->name); else $xtpl->assign("NAME", ""); |
|
154 | +if (isset($focus->name)) { |
|
155 | + $xtpl->assign("NAME", $focus->name); |
|
156 | +} else { |
|
157 | + $xtpl->assign("NAME", ""); |
|
158 | +} |
|
146 | 159 | |
147 | 160 | //Bug45632 |
148 | 161 | /* BEGIN - SECURITY GROUPS */ |
149 | 162 | /** |
150 | 163 | * if(isset($focus->assigned_user_id)) $xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id); else $xtpl->assign("ASSIGNED_USER_ID", ""); |
151 | 164 | */ |
152 | -if (isset($focus->assigned_user_id)) $xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id); |
|
153 | -else if (empty($focus->id) && empty($focus->assigned_user_id)) { |
|
165 | +if (isset($focus->assigned_user_id)) { |
|
166 | + $xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id); |
|
167 | +} else if (empty($focus->id) && empty($focus->assigned_user_id)) { |
|
154 | 168 | global $current_user; |
155 | 169 | $xtpl->assign("ASSIGNED_USER_ID", $current_user->id); |
156 | 170 | $xtpl->assign("ASSIGNED_USER_NAME", get_assigned_user_name($current_user->id)); |
157 | -} else $xtpl->assign("ASSIGNED_USER_ID", ""); |
|
171 | +} else { |
|
172 | + $xtpl->assign("ASSIGNED_USER_ID", ""); |
|
173 | +} |
|
158 | 174 | /* END - SECURITY GROUPS */ |
159 | 175 | //Bug45632 |
160 | 176 | |
161 | -if (isset($focus->description)) $xtpl->assign("DESCRIPTION", $focus->description); else $xtpl->assign("DESCRIPTION", ""); |
|
162 | -if (isset($focus->subject)) $xtpl->assign("SUBJECT", $focus->subject); else $xtpl->assign("SUBJECT", ""); |
|
177 | +if (isset($focus->description)) { |
|
178 | + $xtpl->assign("DESCRIPTION", $focus->description); |
|
179 | +} else { |
|
180 | + $xtpl->assign("DESCRIPTION", ""); |
|
181 | +} |
|
182 | +if (isset($focus->subject)) { |
|
183 | + $xtpl->assign("SUBJECT", $focus->subject); |
|
184 | +} else { |
|
185 | + $xtpl->assign("SUBJECT", ""); |
|
186 | +} |
|
163 | 187 | if ($focus->published == 'on') { |
164 | 188 | $xtpl->assign("PUBLISHED", "CHECKED"); |
165 | 189 | } |
@@ -201,8 +225,16 @@ discard block |
||
201 | 225 | $xtpl->assign("TYPE_OPTIONS", get_select_options_with_id($app_list_strings['record_type_display'], $focus->parent_type)); |
202 | 226 | //$xtpl->assign("DEFAULT_MODULE","Accounts"); |
203 | 227 | |
204 | -if (isset($focus->body)) $xtpl->assign("BODY", $focus->body); else $xtpl->assign("BODY", ""); |
|
205 | -if (isset($focus->body_html)) $xtpl->assign("BODY_HTML", $focus->body_html); else $xtpl->assign("BODY_HTML", ""); |
|
228 | +if (isset($focus->body)) { |
|
229 | + $xtpl->assign("BODY", $focus->body); |
|
230 | +} else { |
|
231 | + $xtpl->assign("BODY", ""); |
|
232 | +} |
|
233 | +if (isset($focus->body_html)) { |
|
234 | + $xtpl->assign("BODY_HTML", $focus->body_html); |
|
235 | +} else { |
|
236 | + $xtpl->assign("BODY_HTML", ""); |
|
237 | +} |
|
206 | 238 | |
207 | 239 | |
208 | 240 | if (true) { |
@@ -50,38 +50,38 @@ |
||
50 | 50 | |
51 | 51 | $focus = new EmailTemplate(); |
52 | 52 | if($_REQUEST['from'] == 'DetailView') { |
53 | - if(!isset($_REQUEST['record'])) |
|
54 | - sugar_die("A record number must be specified to delete the template."); |
|
55 | - $focus->retrieve($_REQUEST['record']); |
|
56 | - if(check_email_template_in_use($focus)) { |
|
57 | - echo 'true'; |
|
58 | - return; |
|
59 | - } |
|
60 | - echo 'false'; |
|
53 | + if(!isset($_REQUEST['record'])) |
|
54 | + sugar_die("A record number must be specified to delete the template."); |
|
55 | + $focus->retrieve($_REQUEST['record']); |
|
56 | + if(check_email_template_in_use($focus)) { |
|
57 | + echo 'true'; |
|
58 | + return; |
|
59 | + } |
|
60 | + echo 'false'; |
|
61 | 61 | } else if($_REQUEST['from'] == 'ListView') { |
62 | - $returnString = ''; |
|
63 | - $idArray = explode(',', $_REQUEST['records']); |
|
64 | - foreach($idArray as $key => $value) { |
|
65 | - if($focus->retrieve($value)) { |
|
66 | - if(check_email_template_in_use($focus)) { |
|
67 | - $returnString .= $focus->name . ','; |
|
68 | - } |
|
69 | - } |
|
70 | - } |
|
71 | - $returnString = substr($returnString, 0, -1); |
|
72 | - echo $returnString; |
|
62 | + $returnString = ''; |
|
63 | + $idArray = explode(',', $_REQUEST['records']); |
|
64 | + foreach($idArray as $key => $value) { |
|
65 | + if($focus->retrieve($value)) { |
|
66 | + if(check_email_template_in_use($focus)) { |
|
67 | + $returnString .= $focus->name . ','; |
|
68 | + } |
|
69 | + } |
|
70 | + } |
|
71 | + $returnString = substr($returnString, 0, -1); |
|
72 | + echo $returnString; |
|
73 | 73 | } else { |
74 | - echo ''; |
|
74 | + echo ''; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | function check_email_template_in_use($focus) |
78 | 78 | { |
79 | - if($focus->is_used_by_email_marketing()) { |
|
80 | - return true; |
|
81 | - } |
|
82 | - $system = $GLOBALS['sugar_config']['passwordsetting']; |
|
83 | - if($focus->id == $system['generatepasswordtmpl'] || $focus->id == $system['lostpasswordtmpl']) { |
|
84 | - return true; |
|
85 | - } |
|
79 | + if($focus->is_used_by_email_marketing()) { |
|
80 | + return true; |
|
81 | + } |
|
82 | + $system = $GLOBALS['sugar_config']['passwordsetting']; |
|
83 | + if($focus->id == $system['generatepasswordtmpl'] || $focus->id == $system['lostpasswordtmpl']) { |
|
84 | + return true; |
|
85 | + } |
|
86 | 86 | return false; |
87 | 87 | } |
@@ -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. |
@@ -49,22 +49,22 @@ discard block |
||
49 | 49 | require_once('modules/EmailTemplates/EmailTemplate.php'); |
50 | 50 | |
51 | 51 | $focus = new EmailTemplate(); |
52 | -if($_REQUEST['from'] == 'DetailView') { |
|
53 | - if(!isset($_REQUEST['record'])) |
|
52 | +if ($_REQUEST['from'] == 'DetailView') { |
|
53 | + if (!isset($_REQUEST['record'])) |
|
54 | 54 | sugar_die("A record number must be specified to delete the template."); |
55 | 55 | $focus->retrieve($_REQUEST['record']); |
56 | - if(check_email_template_in_use($focus)) { |
|
56 | + if (check_email_template_in_use($focus)) { |
|
57 | 57 | echo 'true'; |
58 | 58 | return; |
59 | 59 | } |
60 | 60 | echo 'false'; |
61 | -} else if($_REQUEST['from'] == 'ListView') { |
|
61 | +} else if ($_REQUEST['from'] == 'ListView') { |
|
62 | 62 | $returnString = ''; |
63 | 63 | $idArray = explode(',', $_REQUEST['records']); |
64 | - foreach($idArray as $key => $value) { |
|
65 | - if($focus->retrieve($value)) { |
|
66 | - if(check_email_template_in_use($focus)) { |
|
67 | - $returnString .= $focus->name . ','; |
|
64 | + foreach ($idArray as $key => $value) { |
|
65 | + if ($focus->retrieve($value)) { |
|
66 | + if (check_email_template_in_use($focus)) { |
|
67 | + $returnString .= $focus->name.','; |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 | } |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | |
77 | 77 | function check_email_template_in_use($focus) |
78 | 78 | { |
79 | - if($focus->is_used_by_email_marketing()) { |
|
79 | + if ($focus->is_used_by_email_marketing()) { |
|
80 | 80 | return true; |
81 | 81 | } |
82 | 82 | $system = $GLOBALS['sugar_config']['passwordsetting']; |
83 | - if($focus->id == $system['generatepasswordtmpl'] || $focus->id == $system['lostpasswordtmpl']) { |
|
83 | + if ($focus->id == $system['generatepasswordtmpl'] || $focus->id == $system['lostpasswordtmpl']) { |
|
84 | 84 | return true; |
85 | 85 | } |
86 | 86 | return false; |
@@ -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. |
@@ -50,8 +52,9 @@ discard block |
||
50 | 52 | |
51 | 53 | $focus = new EmailTemplate(); |
52 | 54 | if($_REQUEST['from'] == 'DetailView') { |
53 | - if(!isset($_REQUEST['record'])) |
|
54 | - sugar_die("A record number must be specified to delete the template."); |
|
55 | + if(!isset($_REQUEST['record'])) { |
|
56 | + sugar_die("A record number must be specified to delete the template."); |
|
57 | + } |
|
55 | 58 | $focus->retrieve($_REQUEST['record']); |
56 | 59 | if(check_email_template_in_use($focus)) { |
57 | 60 | echo 'true'; |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | require_once($beanFiles[$beanList[$key]]); |
47 | 47 | $focus = new $beanList[$key]; |
48 | 48 | $loopControl[$key][$key] = $focus; |
49 | - $prefixes[$key] = strtolower($focus->object_name) . '_'; |
|
50 | - if ($focus->object_name == 'Case') $prefixes[$key] = 'a' . strtolower($focus->object_name) . '_'; |
|
49 | + $prefixes[$key] = strtolower($focus->object_name).'_'; |
|
50 | + if ($focus->object_name == 'Case') $prefixes[$key] = 'a'.strtolower($focus->object_name).'_'; |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
@@ -125,16 +125,16 @@ discard block |
||
125 | 125 | if (isset($beanList[$key]) && isset($beanFiles[$beanList[$key]]) && !str_begin($key, 'AOW_') && !str_begin($key, 'zr2_')) { |
126 | 126 | |
127 | 127 | if ($key == 'Contacts') { |
128 | - $dropdown .= "<option value='" . $key . "'> |
|
129 | - " . $lblContactAndOthers . " |
|
128 | + $dropdown .= "<option value='".$key."'> |
|
129 | + " . $lblContactAndOthers." |
|
130 | 130 | </option>"; |
131 | 131 | } else if (isset($app_list_strings['moduleListSingular'][$key])) { |
132 | - $dropdown .= "<option value='" . $key . "'> |
|
133 | - " . $app_list_strings['moduleListSingular'][$key] . " |
|
132 | + $dropdown .= "<option value='".$key."'> |
|
133 | + " . $app_list_strings['moduleListSingular'][$key]." |
|
134 | 134 | </option>"; |
135 | 135 | } else { |
136 | - $dropdown .= "<option value='" . $key . "'> |
|
137 | - " . $app_list_strings['moduleList'][$key] . " |
|
136 | + $dropdown .= "<option value='".$key."'> |
|
137 | + " . $app_list_strings['moduleList'][$key]." |
|
138 | 138 | </option>"; |
139 | 139 | } |
140 | 140 | } |
@@ -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 | function generateFieldDefsJS2() |
@@ -47,7 +49,9 @@ discard block |
||
47 | 49 | $focus = new $beanList[$key]; |
48 | 50 | $loopControl[$key][$key] = $focus; |
49 | 51 | $prefixes[$key] = strtolower($focus->object_name) . '_'; |
50 | - if ($focus->object_name == 'Case') $prefixes[$key] = 'a' . strtolower($focus->object_name) . '_'; |
|
52 | + if ($focus->object_name == 'Case') { |
|
53 | + $prefixes[$key] = 'a' . strtolower($focus->object_name) . '_'; |
|
54 | + } |
|
51 | 55 | } |
52 | 56 | } |
53 | 57 | |
@@ -94,8 +98,9 @@ discard block |
||
94 | 98 | break; |
95 | 99 | } |
96 | 100 | } |
97 | - if ($dup) |
|
98 | - $collection[$collectionKey][] = array("name" => $optionKey, "value" => $optionLabel); |
|
101 | + if ($dup) { |
|
102 | + $collection[$collectionKey][] = array("name" => $optionKey, "value" => $optionLabel); |
|
103 | + } |
|
99 | 104 | } |
100 | 105 | } |
101 | 106 | } |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | } |
353 | 353 | if (!empty($tracker_url) && !empty($template_text) && !empty($matches[0][$i][0]) && !empty($tracked_urls[$matches[0][$i][0]])) { |
354 | 354 | $template_text = substr_replace($template_text, $tracker_url, $matches[0][$i][1], strlen($matches[0][$i][0])); |
355 | - $template_text = str_replace($sugar_config['site_url'] . '/' . $sugar_config['site_url'], $sugar_config['site_url'], $template_text); |
|
355 | + $template_text = str_replace($sugar_config['site_url'].'/'.$sugar_config['site_url'], $sugar_config['site_url'], $template_text); |
|
356 | 356 | } |
357 | 357 | } |
358 | 358 | } |
@@ -406,10 +406,10 @@ discard block |
||
406 | 406 | if ($beanList[$focus_name] == 'User') { |
407 | 407 | $pattern_prefix = '$contact_user_'; |
408 | 408 | } else { |
409 | - $pattern_prefix = '$' . strtolower($beanList[$focus_name]) . '_'; |
|
409 | + $pattern_prefix = '$'.strtolower($beanList[$focus_name]).'_'; |
|
410 | 410 | } |
411 | 411 | $pattern_prefix_length = strlen($pattern_prefix); |
412 | - $pattern = '/\\' . $pattern_prefix . '[A-Za-z_0-9]*/'; |
|
412 | + $pattern = '/\\'.$pattern_prefix.'[A-Za-z_0-9]*/'; |
|
413 | 413 | |
414 | 414 | foreach ($template_text_array as $key => $template_text) { |
415 | 415 | if (!isset($this->parsed_entities[$key])) { |
@@ -505,16 +505,16 @@ discard block |
||
505 | 505 | $translated = translate($field_def['options'], 'Users', $user->$field_def['name']); |
506 | 506 | |
507 | 507 | if (isset($translated) && !is_array($translated)) { |
508 | - $repl_arr["contact_user_" . $field_def['name']] = $translated; |
|
508 | + $repl_arr["contact_user_".$field_def['name']] = $translated; |
|
509 | 509 | } else { // unset enum field, make sure we have a match string to replace with "" |
510 | - $repl_arr["contact_user_" . $field_def['name']] = ''; |
|
510 | + $repl_arr["contact_user_".$field_def['name']] = ''; |
|
511 | 511 | } |
512 | 512 | } else { |
513 | 513 | if (isset($user->$field_def['name'])) { |
514 | 514 | // bug 47647 - allow for fields to translate before adding to template |
515 | - $repl_arr["contact_user_" . $field_def['name']] = self::_convertToType($field_def['type'], $user->$field_def['name']); |
|
515 | + $repl_arr["contact_user_".$field_def['name']] = self::_convertToType($field_def['type'], $user->$field_def['name']); |
|
516 | 516 | } else { |
517 | - $repl_arr["contact_user_" . $field_def['name']] = ""; |
|
517 | + $repl_arr["contact_user_".$field_def['name']] = ""; |
|
518 | 518 | } |
519 | 519 | } |
520 | 520 | } |
@@ -540,8 +540,8 @@ discard block |
||
540 | 540 | continue; |
541 | 541 | } |
542 | 542 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
543 | - 'contact_' . $field_def['name'] => '', |
|
544 | - 'contact_account_' . $field_def['name'] => '', |
|
543 | + 'contact_'.$field_def['name'] => '', |
|
544 | + 'contact_account_'.$field_def['name'] => '', |
|
545 | 545 | )); |
546 | 546 | } |
547 | 547 | foreach ($prospect->field_defs as $field_def) { |
@@ -549,8 +549,8 @@ discard block |
||
549 | 549 | continue; |
550 | 550 | } |
551 | 551 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
552 | - 'contact_' . $field_def['name'] => '', |
|
553 | - 'contact_account_' . $field_def['name'] => '', |
|
552 | + 'contact_'.$field_def['name'] => '', |
|
553 | + 'contact_account_'.$field_def['name'] => '', |
|
554 | 554 | )); |
555 | 555 | } |
556 | 556 | foreach ($contact->field_defs as $field_def) { |
@@ -558,8 +558,8 @@ discard block |
||
558 | 558 | continue; |
559 | 559 | } |
560 | 560 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
561 | - 'contact_' . $field_def['name'] => '', |
|
562 | - 'contact_account_' . $field_def['name'] => '', |
|
561 | + 'contact_'.$field_def['name'] => '', |
|
562 | + 'contact_account_'.$field_def['name'] => '', |
|
563 | 563 | )); |
564 | 564 | } |
565 | 565 | foreach ($acct->field_defs as $field_def) { |
@@ -567,8 +567,8 @@ discard block |
||
567 | 567 | continue; |
568 | 568 | } |
569 | 569 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
570 | - 'account_' . $field_def['name'] => '', |
|
571 | - 'account_contact_' . $field_def['name'] => '', |
|
570 | + 'account_'.$field_def['name'] => '', |
|
571 | + 'account_contact_'.$field_def['name'] => '', |
|
572 | 572 | )); |
573 | 573 | } |
574 | 574 | // cn: end bug 9277 fix |
@@ -592,21 +592,21 @@ discard block |
||
592 | 592 | |
593 | 593 | if (isset($translated) && !is_array($translated)) { |
594 | 594 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
595 | - 'account_' . $field_def['name'] => $translated, |
|
596 | - 'contact_account_' . $field_def['name'] => $translated, |
|
595 | + 'account_'.$field_def['name'] => $translated, |
|
596 | + 'contact_account_'.$field_def['name'] => $translated, |
|
597 | 597 | )); |
598 | 598 | } else { // unset enum field, make sure we have a match string to replace with "" |
599 | 599 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
600 | - 'account_' . $field_def['name'] => '', |
|
601 | - 'contact_account_' . $field_def['name'] => '', |
|
600 | + 'account_'.$field_def['name'] => '', |
|
601 | + 'contact_account_'.$field_def['name'] => '', |
|
602 | 602 | )); |
603 | 603 | } |
604 | 604 | } else { |
605 | 605 | // bug 47647 - allow for fields to translate before adding to template |
606 | 606 | $translated = self::_convertToType($field_def['type'], $acct->$field_def['name']); |
607 | 607 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
608 | - 'account_' . $field_def['name'] => $translated, |
|
609 | - 'contact_account_' . $field_def['name'] => $translated, |
|
608 | + 'account_'.$field_def['name'] => $translated, |
|
609 | + 'contact_account_'.$field_def['name'] => $translated, |
|
610 | 610 | )); |
611 | 611 | } |
612 | 612 | } |
@@ -636,13 +636,13 @@ discard block |
||
636 | 636 | |
637 | 637 | if (isset($translated) && !is_array($translated)) { |
638 | 638 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
639 | - 'contact_' . $field_def['name'] => $translated, |
|
640 | - 'contact_account_' . $field_def['name'] => $translated, |
|
639 | + 'contact_'.$field_def['name'] => $translated, |
|
640 | + 'contact_account_'.$field_def['name'] => $translated, |
|
641 | 641 | )); |
642 | 642 | } else { // unset enum field, make sure we have a match string to replace with "" |
643 | 643 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
644 | - 'contact_' . $field_def['name'] => '', |
|
645 | - 'contact_account_' . $field_def['name'] => '', |
|
644 | + 'contact_'.$field_def['name'] => '', |
|
645 | + 'contact_account_'.$field_def['name'] => '', |
|
646 | 646 | )); |
647 | 647 | } |
648 | 648 | } else { |
@@ -650,8 +650,8 @@ discard block |
||
650 | 650 | // bug 47647 - allow for fields to translate before adding to template |
651 | 651 | $translated = self::_convertToType($field_def['type'], $contact->$field_def['name']); |
652 | 652 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
653 | - 'contact_' . $field_def['name'] => $translated, |
|
654 | - 'contact_account_' . $field_def['name'] => $translated, |
|
653 | + 'contact_'.$field_def['name'] => $translated, |
|
654 | + 'contact_account_'.$field_def['name'] => $translated, |
|
655 | 655 | )); |
656 | 656 | } // if |
657 | 657 | } |
@@ -671,27 +671,27 @@ discard block |
||
671 | 671 | |
672 | 672 | if (isset($translated) && !is_array($translated)) { |
673 | 673 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
674 | - strtolower($beanList[$bean_name]) . "_" . $field_def['name'] => $translated, |
|
674 | + strtolower($beanList[$bean_name])."_".$field_def['name'] => $translated, |
|
675 | 675 | )); |
676 | 676 | } else { // unset enum field, make sure we have a match string to replace with "" |
677 | 677 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
678 | - strtolower($beanList[$bean_name]) . "_" . $field_def['name'] => '', |
|
678 | + strtolower($beanList[$bean_name])."_".$field_def['name'] => '', |
|
679 | 679 | )); |
680 | 680 | } |
681 | 681 | } else { |
682 | 682 | // bug 47647 - translate currencies to appropriate values |
683 | 683 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
684 | - strtolower($beanList[$bean_name]) . "_" . $field_def['name'] => self::_convertToType($field_def['type'], $focus->$field_def['name']), |
|
684 | + strtolower($beanList[$bean_name])."_".$field_def['name'] => self::_convertToType($field_def['type'], $focus->$field_def['name']), |
|
685 | 685 | )); |
686 | 686 | } |
687 | 687 | } else { |
688 | 688 | if ($field_def['name'] == 'full_name') { |
689 | 689 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
690 | - strtolower($beanList[$bean_name]) . '_full_name' => $focus->get_summary_text(), |
|
690 | + strtolower($beanList[$bean_name]).'_full_name' => $focus->get_summary_text(), |
|
691 | 691 | )); |
692 | 692 | } else { |
693 | 693 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
694 | - strtolower($beanList[$bean_name]) . "_" . $field_def['name'] => '', |
|
694 | + strtolower($beanList[$bean_name])."_".$field_def['name'] => '', |
|
695 | 695 | )); |
696 | 696 | } |
697 | 697 | } |
@@ -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. |
@@ -179,8 +181,9 @@ discard block |
||
179 | 181 | break; |
180 | 182 | } |
181 | 183 | } |
182 | - if ($dup) |
|
183 | - $collection[$collectionKey][] = array("name" => $optionKey, "value" => $optionLabel); |
|
184 | + if ($dup) { |
|
185 | + $collection[$collectionKey][] = array("name" => $optionKey, "value" => $optionLabel); |
|
186 | + } |
|
184 | 187 | } |
185 | 188 | } |
186 | 189 | } |
@@ -253,8 +256,9 @@ discard block |
||
253 | 256 | break; |
254 | 257 | } |
255 | 258 | } |
256 | - if ($dup) |
|
257 | - $collection[$collectionKey][] = array("name" => $optionKey, "value" => $optionLabel); |
|
259 | + if ($dup) { |
|
260 | + $collection[$collectionKey][] = array("name" => $optionKey, "value" => $optionLabel); |
|
261 | + } |
|
258 | 262 | } |
259 | 263 | } |
260 | 264 | } |
@@ -314,8 +318,9 @@ discard block |
||
314 | 318 | function parse_tracker_urls($template_text_array, $url_template, $tracked_urls, $removeme_url_template) |
315 | 319 | { |
316 | 320 | global $beanFiles, $beanList, $app_list_strings, $sugar_config; |
317 | - if (!isset($this->parsed_urls)) |
|
318 | - $this->parsed_urls = array(); |
|
321 | + if (!isset($this->parsed_urls)) { |
|
322 | + $this->parsed_urls = array(); |
|
323 | + } |
|
319 | 324 | |
320 | 325 | $return_array = $template_text_array; |
321 | 326 | if (count($tracked_urls) > 0) { |
@@ -398,8 +403,9 @@ discard block |
||
398 | 403 | $user->retrieve($focus->assigned_user_id); |
399 | 404 | } |
400 | 405 | |
401 | - if (!isset($this->parsed_entities)) |
|
402 | - $this->parsed_entities = array(); |
|
406 | + if (!isset($this->parsed_entities)) { |
|
407 | + $this->parsed_entities = array(); |
|
408 | + } |
|
403 | 409 | |
404 | 410 | //parse the template and find all the dynamic strings that need replacement. |
405 | 411 | // Bug #48111 It's strange why prefix for User module is contact_user (see self::generateFieldDefsJS method) |
@@ -775,8 +781,9 @@ discard block |
||
775 | 781 | $template = new EmailTemplate(); |
776 | 782 | $optionKey = $template->field_defs['type']['options']; |
777 | 783 | $options = $GLOBALS['app_list_strings'][$optionKey]; |
778 | - if (!is_admin($GLOBALS['current_user']) && isset($options['workflow'])) |
|
779 | - unset($options['workflow']); |
|
784 | + if (!is_admin($GLOBALS['current_user']) && isset($options['workflow'])) { |
|
785 | + unset($options['workflow']); |
|
786 | + } |
|
780 | 787 | |
781 | 788 | return $options; |
782 | 789 | } |
@@ -118,8 +118,6 @@ discard block |
||
118 | 118 | |
119 | 119 | /** |
120 | 120 | * Generates the extended field_defs for creating macros |
121 | - * @param object $bean SugarBean |
|
122 | - * @param string $prefix "contact_", "user_" etc. |
|
123 | 121 | * @return |
124 | 122 | */ |
125 | 123 | function generateFieldDefsJS() |
@@ -366,7 +364,7 @@ discard block |
||
366 | 364 | /** |
367 | 365 | * |
368 | 366 | * Method for replace "preg_match_all" in method "parse_tracker_urls" |
369 | - * @param $text string String in which we need to search all string that match the pattern {.} |
|
367 | + * @param string $text string String in which we need to search all string that match the pattern {.} |
|
370 | 368 | * @return array result of search |
371 | 369 | */ |
372 | 370 | private function _preg_match_tracker_url($text) |
@@ -7,7 +7,7 @@ |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | |
10 | -if( |
|
10 | +if ( |
|
11 | 11 | (isset($_SESSION['screen_height']) ? $_SESSION['screen_height'] : null) != (isset($_POST['height']) ? $_POST['height'] : null) || |
12 | 12 | (isset($_SESSION['screen_width']) ? $_SESSION['screen_width'] : null) != (isset($_POST['width']) ? $_POST['width'] : null)) { |
13 | 13 | $_SESSION['screen_height'] = $_POST['height']; |
@@ -1,29 +1,29 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
3 | 3 | |
4 | - global $db; |
|
4 | + global $db; |
|
5 | 5 | |
6 | - $even_id = $_GET['event']; |
|
7 | - $delegate_id = $_GET['delegate']; |
|
8 | - $type = $_GET['type']; |
|
9 | - $response = $_GET['response']; |
|
6 | + $even_id = $_GET['event']; |
|
7 | + $delegate_id = $_GET['delegate']; |
|
8 | + $type = $_GET['type']; |
|
9 | + $response = $_GET['response']; |
|
10 | 10 | |
11 | - //get event |
|
11 | + //get event |
|
12 | 12 | $event = new FP_events(); |
13 | 13 | $event->retrieve($even_id); |
14 | 14 | |
15 | 15 | if($type == 'c'){ |
16 | 16 | |
17 | - $event->load_relationship('fp_events_contacts'); // get related contacts |
|
17 | + $event->load_relationship('fp_events_contacts'); // get related contacts |
|
18 | 18 | |
19 | - if($response == 'accept'){ |
|
19 | + if($response == 'accept'){ |
|
20 | 20 | |
21 | 21 | //check to see if they have already responded to the email |
22 | 22 | $check_q = 'SELECT email_responded FROM fp_events_contacts_c WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'"'; |
23 | - $check = $db->getOne($check_q); |
|
24 | - //update contact to accepted |
|
25 | - $query = 'UPDATE fp_events_contacts_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'" AND email_responded="0"'; |
|
26 | - if($db->query($query) && $check != '1'){ |
|
23 | + $check = $db->getOne($check_q); |
|
24 | + //update contact to accepted |
|
25 | + $query = 'UPDATE fp_events_contacts_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'" AND email_responded="0"'; |
|
26 | + if($db->query($query) && $check != '1'){ |
|
27 | 27 | |
28 | 28 | if(!IsNullOrEmptyString($event->accept_redirect)){ |
29 | 29 | |
@@ -33,17 +33,17 @@ discard block |
||
33 | 33 | else{ |
34 | 34 | echo 'Thank you for accepting'; |
35 | 35 | } |
36 | - } |
|
37 | - else { |
|
38 | - echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.'; |
|
39 | - } |
|
40 | - } |
|
41 | - else if($response == 'decline'){ |
|
42 | - //check to see if they have already responded to the email |
|
36 | + } |
|
37 | + else { |
|
38 | + echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.'; |
|
39 | + } |
|
40 | + } |
|
41 | + else if($response == 'decline'){ |
|
42 | + //check to see if they have already responded to the email |
|
43 | 43 | $check_q = 'SELECT email_responded FROM fp_events_contacts_c WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'"'; |
44 | - $check = $db->getOne($check_q); |
|
44 | + $check = $db->getOne($check_q); |
|
45 | 45 | //update contact to accepted |
46 | - $query = 'UPDATE fp_events_contacts_c SET accept_status="Declined", email_responded="1" WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'" AND email_responded="0"'; |
|
46 | + $query = 'UPDATE fp_events_contacts_c SET accept_status="Declined", email_responded="1" WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'" AND email_responded="0"'; |
|
47 | 47 | |
48 | 48 | if($db->query($query) && $check != '1'){ |
49 | 49 | |
@@ -56,24 +56,24 @@ discard block |
||
56 | 56 | else{ |
57 | 57 | echo 'Thank you for declining'; |
58 | 58 | } |
59 | - } |
|
60 | - else { |
|
61 | - echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.'; |
|
62 | - } |
|
63 | - } |
|
59 | + } |
|
60 | + else { |
|
61 | + echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.'; |
|
62 | + } |
|
63 | + } |
|
64 | 64 | } |
65 | 65 | if($type == 't'){ |
66 | 66 | |
67 | - $event->load_relationship('fp_events_prospects_1'); //get related targets |
|
67 | + $event->load_relationship('fp_events_prospects_1'); //get related targets |
|
68 | 68 | |
69 | - if($response == 'accept'){ |
|
69 | + if($response == 'accept'){ |
|
70 | 70 | //check to see if they have already responded to the email |
71 | 71 | $check_q = 'SELECT email_responded FROM fp_events_prospects_1_c WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'"'; |
72 | - $check = $db->getOne($check_q); |
|
72 | + $check = $db->getOne($check_q); |
|
73 | 73 | |
74 | - //update contact to accepted |
|
75 | - $query = 'UPDATE fp_events_prospects_1_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'" AND email_responded="0"'; |
|
76 | - if($db->query($query) && $check != '1'){ |
|
74 | + //update contact to accepted |
|
75 | + $query = 'UPDATE fp_events_prospects_1_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'" AND email_responded="0"'; |
|
76 | + if($db->query($query) && $check != '1'){ |
|
77 | 77 | |
78 | 78 | if(!IsNullOrEmptyString($event->accept_redirect)){ |
79 | 79 | |
@@ -87,14 +87,14 @@ discard block |
||
87 | 87 | else { |
88 | 88 | echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.'; |
89 | 89 | } |
90 | - } |
|
91 | - else if($response == 'decline'){ |
|
90 | + } |
|
91 | + else if($response == 'decline'){ |
|
92 | 92 | //check to see if they have already responded to the email |
93 | 93 | $check_q = 'SELECT email_responded FROM fp_events_prospects_1_c WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'"'; |
94 | - $check = $db->getOne($check_q); |
|
95 | - //update contact to accepted |
|
96 | - $query = 'UPDATE fp_events_prospects_1_c SET accept_status="Declined", email_responded="1" WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'" AND email_responded="0"'; |
|
97 | - if($db->query($query) && $check != '1'){ |
|
94 | + $check = $db->getOne($check_q); |
|
95 | + //update contact to accepted |
|
96 | + $query = 'UPDATE fp_events_prospects_1_c SET accept_status="Declined", email_responded="1" WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'" AND email_responded="0"'; |
|
97 | + if($db->query($query) && $check != '1'){ |
|
98 | 98 | |
99 | 99 | if(!IsNullOrEmptyString($event->decline_redirect)){ |
100 | 100 | |
@@ -109,19 +109,19 @@ discard block |
||
109 | 109 | else { |
110 | 110 | echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.'; |
111 | 111 | } |
112 | - } |
|
112 | + } |
|
113 | 113 | } |
114 | 114 | if($type == 'l'){ |
115 | 115 | |
116 | - $event->load_relationship('fp_events_leads_1'); //get related leads |
|
116 | + $event->load_relationship('fp_events_leads_1'); //get related leads |
|
117 | 117 | |
118 | - if($response == 'accept'){ |
|
118 | + if($response == 'accept'){ |
|
119 | 119 | //check to see if they have already responded to the email |
120 | 120 | $check_q = 'SELECT email_responded FROM fp_events_leads_1_c WHERE ffp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'"'; |
121 | - $check = $db->getOne($check_q); |
|
122 | - //update contact to accepted |
|
123 | - $query = 'UPDATE fp_events_leads_1_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'" AND email_responded="0"'; |
|
124 | - if($db->query($query) && $check != '1'){ |
|
121 | + $check = $db->getOne($check_q); |
|
122 | + //update contact to accepted |
|
123 | + $query = 'UPDATE fp_events_leads_1_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'" AND email_responded="0"'; |
|
124 | + if($db->query($query) && $check != '1'){ |
|
125 | 125 | |
126 | 126 | if(!IsNullOrEmptyString($event->accept_redirect)){ |
127 | 127 | |
@@ -135,15 +135,15 @@ discard block |
||
135 | 135 | else { |
136 | 136 | echo 'There was a problem with the link please contact the sender of the invite'; |
137 | 137 | } |
138 | - } |
|
139 | - else if($response == 'decline'){ |
|
140 | - //check to see if they have already responded to the email |
|
138 | + } |
|
139 | + else if($response == 'decline'){ |
|
140 | + //check to see if they have already responded to the email |
|
141 | 141 | $check_q = 'SELECT email_responded FROM fp_events_leads_1_c WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'"'; |
142 | - $check = $db->getOne($check_q); |
|
142 | + $check = $db->getOne($check_q); |
|
143 | 143 | //update contact to accepted |
144 | - $query = 'UPDATE fp_events_leads_1_c SET accept_status="Declined", email_responded="1" WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'" AND email_responded="0"'; |
|
144 | + $query = 'UPDATE fp_events_leads_1_c SET accept_status="Declined", email_responded="1" WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'" AND email_responded="0"'; |
|
145 | 145 | |
146 | - if($db->query($query) && $check != '1'){ |
|
146 | + if($db->query($query) && $check != '1'){ |
|
147 | 147 | |
148 | 148 | if(!IsNullOrEmptyString($event->decline_redirect)){ |
149 | 149 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | else { |
159 | 159 | echo 'There was a problem with the link please contact the sender of the invite'; |
160 | 160 | } |
161 | - } |
|
161 | + } |
|
162 | 162 | } |
163 | 163 | // Function for basic field validation (present and neither empty nor only white space nor just 'http://') |
164 | 164 | function IsNullOrEmptyString($question){ |
@@ -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 | global $db; |
5 | 5 | |
@@ -12,25 +12,25 @@ discard block |
||
12 | 12 | $event = new FP_events(); |
13 | 13 | $event->retrieve($even_id); |
14 | 14 | |
15 | - if($type == 'c'){ |
|
15 | + if ($type == 'c') { |
|
16 | 16 | |
17 | 17 | $event->load_relationship('fp_events_contacts'); // get related contacts |
18 | 18 | |
19 | - if($response == 'accept'){ |
|
19 | + if ($response == 'accept') { |
|
20 | 20 | |
21 | 21 | //check to see if they have already responded to the email |
22 | 22 | $check_q = 'SELECT email_responded FROM fp_events_contacts_c WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'"'; |
23 | 23 | $check = $db->getOne($check_q); |
24 | 24 | //update contact to accepted |
25 | 25 | $query = 'UPDATE fp_events_contacts_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'" AND email_responded="0"'; |
26 | - if($db->query($query) && $check != '1'){ |
|
26 | + if ($db->query($query) && $check != '1') { |
|
27 | 27 | |
28 | - if(!IsNullOrEmptyString($event->accept_redirect)){ |
|
28 | + if (!IsNullOrEmptyString($event->accept_redirect)) { |
|
29 | 29 | |
30 | 30 | $url = $event->accept_redirect; |
31 | - header('Location: ' . $url); |
|
31 | + header('Location: '.$url); |
|
32 | 32 | } |
33 | - else{ |
|
33 | + else { |
|
34 | 34 | echo 'Thank you for accepting'; |
35 | 35 | } |
36 | 36 | } |
@@ -38,22 +38,22 @@ discard block |
||
38 | 38 | echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.'; |
39 | 39 | } |
40 | 40 | } |
41 | - else if($response == 'decline'){ |
|
41 | + else if ($response == 'decline') { |
|
42 | 42 | //check to see if they have already responded to the email |
43 | 43 | $check_q = 'SELECT email_responded FROM fp_events_contacts_c WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'"'; |
44 | 44 | $check = $db->getOne($check_q); |
45 | 45 | //update contact to accepted |
46 | 46 | $query = 'UPDATE fp_events_contacts_c SET accept_status="Declined", email_responded="1" WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'" AND email_responded="0"'; |
47 | 47 | |
48 | - if($db->query($query) && $check != '1'){ |
|
48 | + if ($db->query($query) && $check != '1') { |
|
49 | 49 | |
50 | - if(!IsNullOrEmptyString($event->decline_redirect)){ |
|
50 | + if (!IsNullOrEmptyString($event->decline_redirect)) { |
|
51 | 51 | |
52 | 52 | $url = $event->decline_redirect; |
53 | - header('Location: ' . $url); |
|
53 | + header('Location: '.$url); |
|
54 | 54 | |
55 | 55 | } |
56 | - else{ |
|
56 | + else { |
|
57 | 57 | echo 'Thank you for declining'; |
58 | 58 | } |
59 | 59 | } |
@@ -62,25 +62,25 @@ discard block |
||
62 | 62 | } |
63 | 63 | } |
64 | 64 | } |
65 | - if($type == 't'){ |
|
65 | + if ($type == 't') { |
|
66 | 66 | |
67 | 67 | $event->load_relationship('fp_events_prospects_1'); //get related targets |
68 | 68 | |
69 | - if($response == 'accept'){ |
|
69 | + if ($response == 'accept') { |
|
70 | 70 | //check to see if they have already responded to the email |
71 | 71 | $check_q = 'SELECT email_responded FROM fp_events_prospects_1_c WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'"'; |
72 | 72 | $check = $db->getOne($check_q); |
73 | 73 | |
74 | 74 | //update contact to accepted |
75 | 75 | $query = 'UPDATE fp_events_prospects_1_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'" AND email_responded="0"'; |
76 | - if($db->query($query) && $check != '1'){ |
|
76 | + if ($db->query($query) && $check != '1') { |
|
77 | 77 | |
78 | - if(!IsNullOrEmptyString($event->accept_redirect)){ |
|
78 | + if (!IsNullOrEmptyString($event->accept_redirect)) { |
|
79 | 79 | |
80 | 80 | $url = $event->accept_redirect; |
81 | - header('Location: ' . $url); |
|
81 | + header('Location: '.$url); |
|
82 | 82 | } |
83 | - else{ |
|
83 | + else { |
|
84 | 84 | echo 'Thank you for accepting'; |
85 | 85 | } |
86 | 86 | } |
@@ -88,21 +88,21 @@ discard block |
||
88 | 88 | echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.'; |
89 | 89 | } |
90 | 90 | } |
91 | - else if($response == 'decline'){ |
|
91 | + else if ($response == 'decline') { |
|
92 | 92 | //check to see if they have already responded to the email |
93 | 93 | $check_q = 'SELECT email_responded FROM fp_events_prospects_1_c WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'"'; |
94 | 94 | $check = $db->getOne($check_q); |
95 | 95 | //update contact to accepted |
96 | 96 | $query = 'UPDATE fp_events_prospects_1_c SET accept_status="Declined", email_responded="1" WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'" AND email_responded="0"'; |
97 | - if($db->query($query) && $check != '1'){ |
|
97 | + if ($db->query($query) && $check != '1') { |
|
98 | 98 | |
99 | - if(!IsNullOrEmptyString($event->decline_redirect)){ |
|
99 | + if (!IsNullOrEmptyString($event->decline_redirect)) { |
|
100 | 100 | |
101 | 101 | $url = $event->decline_redirect; |
102 | - header('Location: ' . $url); |
|
102 | + header('Location: '.$url); |
|
103 | 103 | |
104 | 104 | } |
105 | - else{ |
|
105 | + else { |
|
106 | 106 | echo 'Thank you for declining'; |
107 | 107 | } |
108 | 108 | } |
@@ -111,24 +111,24 @@ discard block |
||
111 | 111 | } |
112 | 112 | } |
113 | 113 | } |
114 | - if($type == 'l'){ |
|
114 | + if ($type == 'l') { |
|
115 | 115 | |
116 | 116 | $event->load_relationship('fp_events_leads_1'); //get related leads |
117 | 117 | |
118 | - if($response == 'accept'){ |
|
118 | + if ($response == 'accept') { |
|
119 | 119 | //check to see if they have already responded to the email |
120 | 120 | $check_q = 'SELECT email_responded FROM fp_events_leads_1_c WHERE ffp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'"'; |
121 | 121 | $check = $db->getOne($check_q); |
122 | 122 | //update contact to accepted |
123 | 123 | $query = 'UPDATE fp_events_leads_1_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'" AND email_responded="0"'; |
124 | - if($db->query($query) && $check != '1'){ |
|
124 | + if ($db->query($query) && $check != '1') { |
|
125 | 125 | |
126 | - if(!IsNullOrEmptyString($event->accept_redirect)){ |
|
126 | + if (!IsNullOrEmptyString($event->accept_redirect)) { |
|
127 | 127 | |
128 | 128 | $url = $event->accept_redirect; |
129 | - header('Location: ' . $url); |
|
129 | + header('Location: '.$url); |
|
130 | 130 | } |
131 | - else{ |
|
131 | + else { |
|
132 | 132 | echo 'Thank you for accepting'; |
133 | 133 | } |
134 | 134 | } |
@@ -136,22 +136,22 @@ discard block |
||
136 | 136 | echo 'There was a problem with the link please contact the sender of the invite'; |
137 | 137 | } |
138 | 138 | } |
139 | - else if($response == 'decline'){ |
|
139 | + else if ($response == 'decline') { |
|
140 | 140 | //check to see if they have already responded to the email |
141 | 141 | $check_q = 'SELECT email_responded FROM fp_events_leads_1_c WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'"'; |
142 | 142 | $check = $db->getOne($check_q); |
143 | 143 | //update contact to accepted |
144 | 144 | $query = 'UPDATE fp_events_leads_1_c SET accept_status="Declined", email_responded="1" WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'" AND email_responded="0"'; |
145 | 145 | |
146 | - if($db->query($query) && $check != '1'){ |
|
146 | + if ($db->query($query) && $check != '1') { |
|
147 | 147 | |
148 | - if(!IsNullOrEmptyString($event->decline_redirect)){ |
|
148 | + if (!IsNullOrEmptyString($event->decline_redirect)) { |
|
149 | 149 | |
150 | 150 | $url = $event->decline_redirect; |
151 | - header('Location: ' . $url); |
|
151 | + header('Location: '.$url); |
|
152 | 152 | |
153 | 153 | } |
154 | - else{ |
|
154 | + else { |
|
155 | 155 | echo 'Thank you for declining'; |
156 | 156 | } |
157 | 157 | } |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | } |
162 | 162 | } |
163 | 163 | // Function for basic field validation (present and neither empty nor only white space nor just 'http://') |
164 | - function IsNullOrEmptyString($question){ |
|
165 | - return (!isset($question) || trim($question)==='' || $question =='http://'); |
|
164 | + function IsNullOrEmptyString($question) { |
|
165 | + return (!isset($question) || trim($question) === '' || $question == 'http://'); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | ?> |
@@ -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 | global $db; |
5 | 7 | |
@@ -29,16 +31,13 @@ discard block |
||
29 | 31 | |
30 | 32 | $url = $event->accept_redirect; |
31 | 33 | header('Location: ' . $url); |
32 | - } |
|
33 | - else{ |
|
34 | + } else{ |
|
34 | 35 | echo 'Thank you for accepting'; |
35 | 36 | } |
36 | - } |
|
37 | - else { |
|
37 | + } else { |
|
38 | 38 | echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.'; |
39 | 39 | } |
40 | - } |
|
41 | - else if($response == 'decline'){ |
|
40 | + } else if($response == 'decline'){ |
|
42 | 41 | //check to see if they have already responded to the email |
43 | 42 | $check_q = 'SELECT email_responded FROM fp_events_contacts_c WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'"'; |
44 | 43 | $check = $db->getOne($check_q); |
@@ -52,12 +51,10 @@ discard block |
||
52 | 51 | $url = $event->decline_redirect; |
53 | 52 | header('Location: ' . $url); |
54 | 53 | |
55 | - } |
|
56 | - else{ |
|
54 | + } else{ |
|
57 | 55 | echo 'Thank you for declining'; |
58 | 56 | } |
59 | - } |
|
60 | - else { |
|
57 | + } else { |
|
61 | 58 | echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.'; |
62 | 59 | } |
63 | 60 | } |
@@ -79,16 +76,13 @@ discard block |
||
79 | 76 | |
80 | 77 | $url = $event->accept_redirect; |
81 | 78 | header('Location: ' . $url); |
82 | - } |
|
83 | - else{ |
|
79 | + } else{ |
|
84 | 80 | echo 'Thank you for accepting'; |
85 | 81 | } |
86 | - } |
|
87 | - else { |
|
82 | + } else { |
|
88 | 83 | echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.'; |
89 | 84 | } |
90 | - } |
|
91 | - else if($response == 'decline'){ |
|
85 | + } else if($response == 'decline'){ |
|
92 | 86 | //check to see if they have already responded to the email |
93 | 87 | $check_q = 'SELECT email_responded FROM fp_events_prospects_1_c WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'"'; |
94 | 88 | $check = $db->getOne($check_q); |
@@ -101,12 +95,10 @@ discard block |
||
101 | 95 | $url = $event->decline_redirect; |
102 | 96 | header('Location: ' . $url); |
103 | 97 | |
104 | - } |
|
105 | - else{ |
|
98 | + } else{ |
|
106 | 99 | echo 'Thank you for declining'; |
107 | 100 | } |
108 | - } |
|
109 | - else { |
|
101 | + } else { |
|
110 | 102 | echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.'; |
111 | 103 | } |
112 | 104 | } |
@@ -127,16 +119,13 @@ discard block |
||
127 | 119 | |
128 | 120 | $url = $event->accept_redirect; |
129 | 121 | header('Location: ' . $url); |
130 | - } |
|
131 | - else{ |
|
122 | + } else{ |
|
132 | 123 | echo 'Thank you for accepting'; |
133 | 124 | } |
134 | - } |
|
135 | - else { |
|
125 | + } else { |
|
136 | 126 | echo 'There was a problem with the link please contact the sender of the invite'; |
137 | 127 | } |
138 | - } |
|
139 | - else if($response == 'decline'){ |
|
128 | + } else if($response == 'decline'){ |
|
140 | 129 | //check to see if they have already responded to the email |
141 | 130 | $check_q = 'SELECT email_responded FROM fp_events_leads_1_c WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'"'; |
142 | 131 | $check = $db->getOne($check_q); |
@@ -150,12 +139,10 @@ discard block |
||
150 | 139 | $url = $event->decline_redirect; |
151 | 140 | header('Location: ' . $url); |
152 | 141 | |
153 | - } |
|
154 | - else{ |
|
142 | + } else{ |
|
155 | 143 | echo 'Thank you for declining'; |
156 | 144 | } |
157 | - } |
|
158 | - else { |
|
145 | + } else { |
|
159 | 146 | echo 'There was a problem with the link please contact the sender of the invite'; |
160 | 147 | } |
161 | 148 | } |
@@ -70,7 +70,7 @@ |
||
70 | 70 | } |
71 | 71 | }else{ |
72 | 72 | if(isset($row['id']) || $meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'],'Meetings')){ |
73 | - SugarApplication::redirect($meetingBean->join_url); |
|
73 | + SugarApplication::redirect($meetingBean->join_url); |
|
74 | 74 | }else{ |
75 | 75 | //if the user is not invited or the owner of the meeting or an admin then they cannot join the meeting. |
76 | 76 | $tplFile = 'modules/Meetings/tpls/extMeetingNotInvited.tpl'; |
@@ -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. |
@@ -47,40 +47,40 @@ discard block |
||
47 | 47 | |
48 | 48 | global $db, $current_user, $mod_strings, $app_strings, $app_list_strings; |
49 | 49 | |
50 | -$ret = $db->query("SELECT id FROM meetings_users WHERE meeting_id = '".$db->quote($_REQUEST['meeting_id'])."' AND user_id = '".$current_user->id."' AND deleted = 0",true); |
|
50 | +$ret = $db->query("SELECT id FROM meetings_users WHERE meeting_id = '".$db->quote($_REQUEST['meeting_id'])."' AND user_id = '".$current_user->id."' AND deleted = 0", true); |
|
51 | 51 | $row = $db->fetchByAssoc($ret); |
52 | 52 | |
53 | 53 | $meetingBean = loadBean('Meetings'); |
54 | 54 | $meetingBean->retrieve($_REQUEST['meeting_id']); |
55 | 55 | |
56 | -if ( $_REQUEST['host_meeting'] == '1' ) { |
|
57 | - if($meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'],'Meetings')){ |
|
56 | +if ($_REQUEST['host_meeting'] == '1') { |
|
57 | + if ($meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'], 'Meetings')) { |
|
58 | 58 | SugarApplication::redirect($meetingBean->host_url); |
59 | - }else{ |
|
59 | + } else { |
|
60 | 60 | //since they are now the owner of the meeting nor an Admin they cannot start the meeting. |
61 | 61 | $tplFile = 'modules/Meetings/tpls/extMeetingNoStart.tpl'; |
62 | - if ( file_exists('custom/'.$tplFile) ) { |
|
62 | + if (file_exists('custom/'.$tplFile)) { |
|
63 | 63 | $tplFile = 'custom/'.$tplFile; |
64 | 64 | } |
65 | 65 | |
66 | 66 | $ss = new Sugar_Smarty(); |
67 | - $ss->assign('current_user',$current_user); |
|
68 | - $ss->assign('bean',$meetingBean->toArray()); |
|
67 | + $ss->assign('current_user', $current_user); |
|
68 | + $ss->assign('bean', $meetingBean->toArray()); |
|
69 | 69 | $ss->display($tplFile); |
70 | 70 | } |
71 | -}else{ |
|
72 | - if(isset($row['id']) || $meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'],'Meetings')){ |
|
71 | +} else { |
|
72 | + if (isset($row['id']) || $meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'], 'Meetings')) { |
|
73 | 73 | SugarApplication::redirect($meetingBean->join_url); |
74 | - }else{ |
|
74 | + } else { |
|
75 | 75 | //if the user is not invited or the owner of the meeting or an admin then they cannot join the meeting. |
76 | 76 | $tplFile = 'modules/Meetings/tpls/extMeetingNotInvited.tpl'; |
77 | - if ( file_exists('custom/'.$tplFile) ) { |
|
77 | + if (file_exists('custom/'.$tplFile)) { |
|
78 | 78 | $tplFile = 'custom/'.$tplFile; |
79 | 79 | } |
80 | 80 | |
81 | 81 | $ss = new Sugar_Smarty(); |
82 | - $ss->assign('current_user',$current_user); |
|
83 | - $ss->assign('bean',$meetingBean->toArray()); |
|
82 | + $ss->assign('current_user', $current_user); |
|
83 | + $ss->assign('bean', $meetingBean->toArray()); |
|
84 | 84 | $ss->display($tplFile); |
85 | 85 | } |
86 | 86 | } |
87 | 87 | \ No newline at end of file |
@@ -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,7 +58,7 @@ discard block |
||
56 | 58 | if ( $_REQUEST['host_meeting'] == '1' ) { |
57 | 59 | if($meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'],'Meetings')){ |
58 | 60 | SugarApplication::redirect($meetingBean->host_url); |
59 | - }else{ |
|
61 | + } else{ |
|
60 | 62 | //since they are now the owner of the meeting nor an Admin they cannot start the meeting. |
61 | 63 | $tplFile = 'modules/Meetings/tpls/extMeetingNoStart.tpl'; |
62 | 64 | if ( file_exists('custom/'.$tplFile) ) { |
@@ -68,10 +70,10 @@ discard block |
||
68 | 70 | $ss->assign('bean',$meetingBean->toArray()); |
69 | 71 | $ss->display($tplFile); |
70 | 72 | } |
71 | -}else{ |
|
73 | +} else{ |
|
72 | 74 | if(isset($row['id']) || $meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'],'Meetings')){ |
73 | 75 | SugarApplication::redirect($meetingBean->join_url); |
74 | - }else{ |
|
76 | + } else{ |
|
75 | 77 | //if the user is not invited or the owner of the meeting or an admin then they cannot join the meeting. |
76 | 78 | $tplFile = 'modules/Meetings/tpls/extMeetingNotInvited.tpl'; |
77 | 79 | if ( file_exists('custom/'.$tplFile) ) { |
@@ -47,75 +47,75 @@ discard block |
||
47 | 47 | ********************************************************************************/ |
48 | 48 | |
49 | 49 | $mod_strings = array ( |
50 | - 'ERR_DELETE_RECORD' => 'A record number must be specified to delete the meeting.', |
|
50 | + 'ERR_DELETE_RECORD' => 'A record number must be specified to delete the meeting.', |
|
51 | 51 | |
52 | - 'LBL_ACCEPT_THIS'=>'Accept?', |
|
53 | - 'LBL_ADD_BUTTON'=> 'Add', |
|
54 | - 'LBL_ADD_INVITEE' => 'Add Invitees', |
|
55 | - 'LBL_COLON' => ':', |
|
56 | - 'LBL_CONTACT_NAME' => 'Contact:', |
|
57 | - 'LBL_CONTACTS_SUBPANEL_TITLE' => 'Contacts', |
|
58 | - 'LBL_CREATED_BY'=>'Created by', |
|
59 | - 'LBL_DATE_END'=>'End Date', |
|
60 | - 'LBL_DATE_TIME' => 'Start Date & Time:', |
|
61 | - 'LBL_DATE' => 'Start Date:', |
|
62 | - 'LBL_DEFAULT_SUBPANEL_TITLE' => 'Meetings', |
|
63 | - 'LBL_DEL'=> 'Del', |
|
64 | - 'LBL_DESCRIPTION_INFORMATION' => 'Description Information', |
|
65 | - 'LBL_DESCRIPTION' => 'Description:', |
|
52 | + 'LBL_ACCEPT_THIS'=>'Accept?', |
|
53 | + 'LBL_ADD_BUTTON'=> 'Add', |
|
54 | + 'LBL_ADD_INVITEE' => 'Add Invitees', |
|
55 | + 'LBL_COLON' => ':', |
|
56 | + 'LBL_CONTACT_NAME' => 'Contact:', |
|
57 | + 'LBL_CONTACTS_SUBPANEL_TITLE' => 'Contacts', |
|
58 | + 'LBL_CREATED_BY'=>'Created by', |
|
59 | + 'LBL_DATE_END'=>'End Date', |
|
60 | + 'LBL_DATE_TIME' => 'Start Date & Time:', |
|
61 | + 'LBL_DATE' => 'Start Date:', |
|
62 | + 'LBL_DEFAULT_SUBPANEL_TITLE' => 'Meetings', |
|
63 | + 'LBL_DEL'=> 'Del', |
|
64 | + 'LBL_DESCRIPTION_INFORMATION' => 'Description Information', |
|
65 | + 'LBL_DESCRIPTION' => 'Description:', |
|
66 | 66 | 'LBL_DIRECTION' => 'Direction:', |
67 | - 'LBL_DURATION_HOURS' => 'Duration Hours:', |
|
68 | - 'LBL_DURATION_MINUTES' => 'Duration Minutes:', |
|
69 | - 'LBL_DURATION' => 'Duration:', |
|
70 | - 'LBL_EMAIL' => 'Email', |
|
71 | - 'LBL_FIRST_NAME' => 'First Name', |
|
72 | - 'LBL_HISTORY_SUBPANEL_TITLE' => 'Notes', |
|
73 | - 'LBL_HOURS_ABBREV' => 'h', |
|
74 | - 'LBL_HOURS_MINS' => '(hours/minutes)', |
|
75 | - 'LBL_INVITEE' => 'Invitees', |
|
76 | - 'LBL_LAST_NAME' => 'Last Name', |
|
77 | - 'LBL_ASSIGNED_TO_NAME'=>'Assigned to:', |
|
78 | - 'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User', |
|
79 | - 'LBL_LIST_CLOSE' => 'Close', |
|
80 | - 'LBL_LIST_CONTACT' => 'Contact', |
|
81 | - 'LBL_LIST_DATE_MODIFIED'=>'Date Modified', |
|
82 | - 'LBL_LIST_DATE' => 'Start Date', |
|
83 | - 'LBL_LIST_DIRECTION' => 'Direction', |
|
84 | - 'LBL_LIST_DUE_DATE'=>'Due Date', |
|
85 | - 'LBL_LIST_FORM_TITLE' => 'Meeting List', |
|
86 | - 'LBL_LIST_MY_MEETINGS' => 'My Meetings', |
|
87 | - 'LBL_LIST_RELATED_TO' => 'Related to', |
|
88 | - 'LBL_LIST_STATUS'=>'Status', |
|
89 | - 'LBL_LIST_SUBJECT' => 'Subject', |
|
90 | - 'LBL_LIST_TIME' => 'Start Time', |
|
91 | - 'LBL_LEADS_SUBPANEL_TITLE' => 'Leads', |
|
92 | - 'LBL_LOCATION' => 'Location:', |
|
93 | - 'LBL_MEETING' => 'Meeting:', |
|
94 | - 'LBL_MINSS_ABBREV' => 'm', |
|
95 | - 'LBL_MODIFIED_BY'=>'Modified by', |
|
96 | - 'LBL_MODULE_NAME' => 'Meetings', |
|
97 | - 'LBL_MODULE_TITLE' => 'Meetings: Home', |
|
98 | - 'LBL_NAME' => 'Name', |
|
99 | - 'LBL_NEW_FORM_TITLE' => 'Create Appointment', |
|
100 | - 'LBL_OUTLOOK_ID' => 'Outlook ID', |
|
101 | - 'LBL_SEQUENCE' => 'Meeting update sequence', |
|
102 | - 'LBL_PHONE' => 'Phone Office:', |
|
103 | - 'LBL_REMINDER_TIME'=>'Reminder Time', |
|
67 | + 'LBL_DURATION_HOURS' => 'Duration Hours:', |
|
68 | + 'LBL_DURATION_MINUTES' => 'Duration Minutes:', |
|
69 | + 'LBL_DURATION' => 'Duration:', |
|
70 | + 'LBL_EMAIL' => 'Email', |
|
71 | + 'LBL_FIRST_NAME' => 'First Name', |
|
72 | + 'LBL_HISTORY_SUBPANEL_TITLE' => 'Notes', |
|
73 | + 'LBL_HOURS_ABBREV' => 'h', |
|
74 | + 'LBL_HOURS_MINS' => '(hours/minutes)', |
|
75 | + 'LBL_INVITEE' => 'Invitees', |
|
76 | + 'LBL_LAST_NAME' => 'Last Name', |
|
77 | + 'LBL_ASSIGNED_TO_NAME'=>'Assigned to:', |
|
78 | + 'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User', |
|
79 | + 'LBL_LIST_CLOSE' => 'Close', |
|
80 | + 'LBL_LIST_CONTACT' => 'Contact', |
|
81 | + 'LBL_LIST_DATE_MODIFIED'=>'Date Modified', |
|
82 | + 'LBL_LIST_DATE' => 'Start Date', |
|
83 | + 'LBL_LIST_DIRECTION' => 'Direction', |
|
84 | + 'LBL_LIST_DUE_DATE'=>'Due Date', |
|
85 | + 'LBL_LIST_FORM_TITLE' => 'Meeting List', |
|
86 | + 'LBL_LIST_MY_MEETINGS' => 'My Meetings', |
|
87 | + 'LBL_LIST_RELATED_TO' => 'Related to', |
|
88 | + 'LBL_LIST_STATUS'=>'Status', |
|
89 | + 'LBL_LIST_SUBJECT' => 'Subject', |
|
90 | + 'LBL_LIST_TIME' => 'Start Time', |
|
91 | + 'LBL_LEADS_SUBPANEL_TITLE' => 'Leads', |
|
92 | + 'LBL_LOCATION' => 'Location:', |
|
93 | + 'LBL_MEETING' => 'Meeting:', |
|
94 | + 'LBL_MINSS_ABBREV' => 'm', |
|
95 | + 'LBL_MODIFIED_BY'=>'Modified by', |
|
96 | + 'LBL_MODULE_NAME' => 'Meetings', |
|
97 | + 'LBL_MODULE_TITLE' => 'Meetings: Home', |
|
98 | + 'LBL_NAME' => 'Name', |
|
99 | + 'LBL_NEW_FORM_TITLE' => 'Create Appointment', |
|
100 | + 'LBL_OUTLOOK_ID' => 'Outlook ID', |
|
101 | + 'LBL_SEQUENCE' => 'Meeting update sequence', |
|
102 | + 'LBL_PHONE' => 'Phone Office:', |
|
103 | + 'LBL_REMINDER_TIME'=>'Reminder Time', |
|
104 | 104 | 'LBL_EMAIL_REMINDER_SENT' => 'Email reminder sent', |
105 | - 'LBL_REMINDER' => 'Reminders:', |
|
106 | - 'LBL_REMINDER_POPUP' => 'Popup', |
|
107 | - 'LBL_REMINDER_EMAIL' => 'Email', |
|
105 | + 'LBL_REMINDER' => 'Reminders:', |
|
106 | + 'LBL_REMINDER_POPUP' => 'Popup', |
|
107 | + 'LBL_REMINDER_EMAIL' => 'Email', |
|
108 | 108 | 'LBL_REMINDER_EMAIL_ALL_INVITEES' => 'Email all invitees', |
109 | 109 | 'LBL_EMAIL_REMINDER' => 'Email Reminder', |
110 | 110 | 'LBL_EMAIL_REMINDER_TIME' => 'Email Reminder Time', |
111 | 111 | 'LBL_REMOVE' => 'rem', |
112 | - 'LBL_SCHEDULING_FORM_TITLE' => 'Scheduling', |
|
113 | - 'LBL_SEARCH_BUTTON'=> 'Search', |
|
114 | - 'LBL_SEARCH_FORM_TITLE' => 'Meeting Search', |
|
115 | - 'LBL_SEND_BUTTON_KEY'=>'I', |
|
116 | - 'LBL_SEND_BUTTON_LABEL'=>'Save & Send Invites', |
|
117 | - 'LBL_SEND_BUTTON_TITLE'=>'Save & Send Invites', |
|
118 | - 'LBL_STATUS' => 'Status:', |
|
112 | + 'LBL_SCHEDULING_FORM_TITLE' => 'Scheduling', |
|
113 | + 'LBL_SEARCH_BUTTON'=> 'Search', |
|
114 | + 'LBL_SEARCH_FORM_TITLE' => 'Meeting Search', |
|
115 | + 'LBL_SEND_BUTTON_KEY'=>'I', |
|
116 | + 'LBL_SEND_BUTTON_LABEL'=>'Save & Send Invites', |
|
117 | + 'LBL_SEND_BUTTON_TITLE'=>'Save & Send Invites', |
|
118 | + 'LBL_STATUS' => 'Status:', |
|
119 | 119 | 'LBL_TYPE' => 'Meeting Type', |
120 | 120 | 'LBL_PASSWORD' => 'Meeting Password', |
121 | 121 | 'LBL_URL' => 'Start/Join Meeting', |
@@ -123,25 +123,25 @@ discard block |
||
123 | 123 | 'LBL_DISPLAYED_URL' => 'Display URL', |
124 | 124 | 'LBL_CREATOR' => 'Meeting Creator', |
125 | 125 | 'LBL_EXTERNALID' => 'External App ID', |
126 | - 'LBL_SUBJECT' => 'Subject:', |
|
127 | - 'LBL_TIME' => 'Start Time:', |
|
128 | - 'LBL_USERS_SUBPANEL_TITLE' => 'Users', |
|
129 | - 'LBL_ACTIVITIES_REPORTS' => 'Activities Report', |
|
126 | + 'LBL_SUBJECT' => 'Subject:', |
|
127 | + 'LBL_TIME' => 'Start Time:', |
|
128 | + 'LBL_USERS_SUBPANEL_TITLE' => 'Users', |
|
129 | + 'LBL_ACTIVITIES_REPORTS' => 'Activities Report', |
|
130 | 130 | 'LBL_PARENT_TYPE' => 'Parent Type', |
131 | 131 | 'LBL_PARENT_ID' => 'Parent ID', |
132 | - 'LNK_MEETING_LIST'=>'View Meetings', |
|
133 | - 'LNK_NEW_APPOINTMENT' => 'Create Appointment', |
|
134 | - 'LNK_NEW_MEETING'=>'Schedule Meeting', |
|
135 | - 'LNK_IMPORT_MEETINGS' => 'Import Meetings', |
|
132 | + 'LNK_MEETING_LIST'=>'View Meetings', |
|
133 | + 'LNK_NEW_APPOINTMENT' => 'Create Appointment', |
|
134 | + 'LNK_NEW_MEETING'=>'Schedule Meeting', |
|
135 | + 'LNK_IMPORT_MEETINGS' => 'Import Meetings', |
|
136 | 136 | |
137 | - 'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this invitee from the meeting?', |
|
137 | + 'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this invitee from the meeting?', |
|
138 | 138 | 'LBL_CREATED_USER' => 'Created User', |
139 | 139 | 'LBL_MODIFIED_USER' => 'Modified User', |
140 | 140 | 'NOTICE_DURATION_TIME' => 'Duration time must be greater than 0', |
141 | 141 | 'LBL_MEETING_INFORMATION' => 'Overview', |
142 | - 'LBL_LIST_JOIN_MEETING' => 'Join Meeting', |
|
143 | - 'LBL_JOIN_EXT_MEETING' => 'Join Meeting', |
|
144 | - 'LBL_HOST_EXT_MEETING' => 'Start Meeting', |
|
142 | + 'LBL_LIST_JOIN_MEETING' => 'Join Meeting', |
|
143 | + 'LBL_JOIN_EXT_MEETING' => 'Join Meeting', |
|
144 | + 'LBL_HOST_EXT_MEETING' => 'Start Meeting', |
|
145 | 145 | 'LBL_ACCEPT_STATUS' => 'Accept Status', |
146 | 146 | 'LBL_ACCEPT_LINK' => 'Accept Link', |
147 | 147 | // You are not invited to the meeting messages |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | 'LBL_EXTNOSTART_HEADER' => 'Error: Cannot Start Meeting', |
155 | 155 | 'LBL_EXTNOSTART_MAIN' => 'You cannot start this meeting because you are not an Administrator or the owner of the meeting.', |
156 | 156 | |
157 | - //For export labels |
|
157 | + //For export labels |
|
158 | 158 | 'LBL_EXPORT_JOIN_URL' => 'Join Url', |
159 | 159 | 'LBL_EXPORT_HOST_URL' => 'Host Url', |
160 | 160 | 'LBL_EXPORT_DISPLAYED_URL' => 'Displayed Url', |
@@ -190,14 +190,14 @@ discard block |
||
190 | 190 | 'LBL_SYNCED_RECURRING_MSG' => 'This meeting originated in another system and was synced to SuiteCRM. To make changes, go to the original meeting within the other system. Changes made in the other system can be synced to this record.', |
191 | 191 | 'LBL_RELATED_TO' => 'Related to:', |
192 | 192 | |
193 | - // for reminders |
|
194 | - 'LBL_REMINDERS' => 'Reminders', |
|
195 | - 'LBL_REMINDERS_ACTIONS' => 'Actions:', |
|
196 | - 'LBL_REMINDERS_POPUP' => 'Popup', |
|
197 | - 'LBL_REMINDERS_EMAIL' => 'Email invitees', |
|
198 | - 'LBL_REMINDERS_WHEN' => 'When:', |
|
199 | - 'LBL_REMINDERS_REMOVE_REMINDER' => 'Remove reminder', |
|
200 | - 'LBL_REMINDERS_ADD_ALL_INVITEES' => 'Add All Invitees', |
|
201 | - 'LBL_REMINDERS_ADD_REMINDER' => 'Add reminder', |
|
193 | + // for reminders |
|
194 | + 'LBL_REMINDERS' => 'Reminders', |
|
195 | + 'LBL_REMINDERS_ACTIONS' => 'Actions:', |
|
196 | + 'LBL_REMINDERS_POPUP' => 'Popup', |
|
197 | + 'LBL_REMINDERS_EMAIL' => 'Email invitees', |
|
198 | + 'LBL_REMINDERS_WHEN' => 'When:', |
|
199 | + 'LBL_REMINDERS_REMOVE_REMINDER' => 'Remove reminder', |
|
200 | + 'LBL_REMINDERS_ADD_ALL_INVITEES' => 'Add All Invitees', |
|
201 | + 'LBL_REMINDERS_ADD_REMINDER' => 'Add reminder', |
|
202 | 202 | ); |
203 | 203 | ?> |
@@ -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. |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
39 | 39 | ********************************************************************************/ |
40 | 40 | |
41 | -$mod_strings = array ( |
|
41 | +$mod_strings = array( |
|
42 | 42 | 'LBL_MODULE_NAME' => 'Roles', |
43 | 43 | 'LBL_MODULE_TITLE' => 'Roles: Home', |
44 | 44 | 'LBL_ROLE'=>'Role', |
@@ -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. |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | parent::process(); |
55 | 55 | |
56 | 56 | $this->ss->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['meeting_status_dom'], $app_list_strings['meeting_status_default'])); |
57 | - $this->ss->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format()); |
|
58 | - $this->ss->assign("TIME_FORMAT", '('. $timedate->get_user_time_format().')'); |
|
59 | - $this->ss->assign("USER_DATEFORMAT", '('. $timedate->get_user_date_format().')'); |
|
57 | + $this->ss->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format()); |
|
58 | + $this->ss->assign("TIME_FORMAT", '('. $timedate->get_user_time_format().')'); |
|
59 | + $this->ss->assign("USER_DATEFORMAT", '('. $timedate->get_user_date_format().')'); |
|
60 | 60 | |
61 | 61 | |
62 | 62 | |
@@ -75,52 +75,52 @@ discard block |
||
75 | 75 | $this->javascript->setSugarBean($focus); |
76 | 76 | $this->javascript->addAllFields(''); |
77 | 77 | |
78 | - if (is_null($focus->date_start)) |
|
79 | - $focus->date_start = $timedate->to_display_date(TimeDate::getInstance()->nowDb()); |
|
80 | - if (is_null($focus->time_start)) |
|
81 | - $focus->time_start = $timedate->to_display_time(TimeDate::getInstance()->nowDb(), true); |
|
82 | - if (!isset ($focus->duration_hours)) |
|
83 | - $focus->duration_hours = "1"; |
|
78 | + if (is_null($focus->date_start)) |
|
79 | + $focus->date_start = $timedate->to_display_date(TimeDate::getInstance()->nowDb()); |
|
80 | + if (is_null($focus->time_start)) |
|
81 | + $focus->time_start = $timedate->to_display_time(TimeDate::getInstance()->nowDb(), true); |
|
82 | + if (!isset ($focus->duration_hours)) |
|
83 | + $focus->duration_hours = "1"; |
|
84 | 84 | |
85 | 85 | |
86 | 86 | $date_start_array=explode(" ",trim($focus->date_start)); |
87 | 87 | if (count($date_start_array)==2) { |
88 | - $focus->time_start = $timedate->to_db_time($date_start_array[1], false); |
|
89 | - //$focus->date_start = $date_start_array[0]; |
|
88 | + $focus->time_start = $timedate->to_db_time($date_start_array[1], false); |
|
89 | + //$focus->date_start = $date_start_array[0]; |
|
90 | 90 | } |
91 | 91 | |
92 | - $this->ss->assign("DATE_START", $focus->date_start); |
|
93 | - $this->ss->assign("TIME_START", substr($focus->time_start,0,5)); |
|
94 | - $time_start_hour = intval(substr($focus->time_start, 0, 2)); |
|
95 | - $time_start_minutes = substr($focus->time_start, 3, 5); |
|
92 | + $this->ss->assign("DATE_START", $focus->date_start); |
|
93 | + $this->ss->assign("TIME_START", substr($focus->time_start,0,5)); |
|
94 | + $time_start_hour = intval(substr($focus->time_start, 0, 2)); |
|
95 | + $time_start_minutes = substr($focus->time_start, 3, 5); |
|
96 | 96 | |
97 | - if ($time_start_minutes > 0 && $time_start_minutes < 15) { |
|
98 | - $time_start_minutes = "15"; |
|
99 | - } else |
|
100 | - if ($time_start_minutes > 15 && $time_start_minutes < 30) { |
|
101 | - $time_start_minutes = "30"; |
|
102 | - } else |
|
103 | - if ($time_start_minutes > 30 && $time_start_minutes < 45) { |
|
104 | - $time_start_minutes = "45"; |
|
105 | - } else |
|
106 | - if ($time_start_minutes > 45) { |
|
107 | - $time_start_hour += 1; |
|
108 | - $time_start_minutes = "00"; |
|
109 | - } |
|
97 | + if ($time_start_minutes > 0 && $time_start_minutes < 15) { |
|
98 | + $time_start_minutes = "15"; |
|
99 | + } else |
|
100 | + if ($time_start_minutes > 15 && $time_start_minutes < 30) { |
|
101 | + $time_start_minutes = "30"; |
|
102 | + } else |
|
103 | + if ($time_start_minutes > 30 && $time_start_minutes < 45) { |
|
104 | + $time_start_minutes = "45"; |
|
105 | + } else |
|
106 | + if ($time_start_minutes > 45) { |
|
107 | + $time_start_hour += 1; |
|
108 | + $time_start_minutes = "00"; |
|
109 | + } |
|
110 | 110 | |
111 | 111 | |
112 | - // We default the to assume that the time preference is set to 11:00 (i.e. without meridiem) |
|
113 | - $hours_arr = array (); |
|
114 | - $num_of_hours = 24; |
|
115 | - $start_at = 0; |
|
112 | + // We default the to assume that the time preference is set to 11:00 (i.e. without meridiem) |
|
113 | + $hours_arr = array (); |
|
114 | + $num_of_hours = 24; |
|
115 | + $start_at = 0; |
|
116 | 116 | |
117 | - $time_pref = $timedate->get_time_format(); |
|
118 | - if(strpos($time_pref, 'a') || strpos($time_pref, 'A')) { |
|
119 | - $num_of_hours = 13; |
|
120 | - $start_at = 1; |
|
121 | - } |
|
117 | + $time_pref = $timedate->get_time_format(); |
|
118 | + if(strpos($time_pref, 'a') || strpos($time_pref, 'A')) { |
|
119 | + $num_of_hours = 13; |
|
120 | + $start_at = 1; |
|
121 | + } |
|
122 | 122 | |
123 | - /* |
|
123 | + /* |
|
124 | 124 | // Seems to be problematic... $time_meridiem is always empty |
125 | 125 | if (empty ($time_meridiem)) { |
126 | 126 | $num_of_hours = 24; |
@@ -128,37 +128,37 @@ discard block |
||
128 | 128 | } |
129 | 129 | */ |
130 | 130 | |
131 | - for ($i = $start_at; $i < $num_of_hours; $i ++) { |
|
132 | - $i = $i.""; |
|
133 | - if (strlen($i) == 1) { |
|
134 | - $i = "0".$i; |
|
135 | - } |
|
136 | - $hours_arr[$i] = $i; |
|
137 | - } |
|
131 | + for ($i = $start_at; $i < $num_of_hours; $i ++) { |
|
132 | + $i = $i.""; |
|
133 | + if (strlen($i) == 1) { |
|
134 | + $i = "0".$i; |
|
135 | + } |
|
136 | + $hours_arr[$i] = $i; |
|
137 | + } |
|
138 | 138 | |
139 | 139 | $this->ss->assign("TIME_START_HOUR_OPTIONS", get_select_options_with_id($hours_arr, $time_start_hour)); |
140 | - $this->ss->assign("TIME_START_MINUTE_OPTIONS", get_select_options_with_id($focus->minutes_values, $time_start_minutes)); |
|
141 | - $this->ss->assign("DURATION_HOURS", $focus->duration_hours); |
|
142 | - $this->ss->assign("DURATION_MINUTES_OPTIONS", get_select_options_with_id($focus->minutes_values, $focus->duration_minutes)); |
|
140 | + $this->ss->assign("TIME_START_MINUTE_OPTIONS", get_select_options_with_id($focus->minutes_values, $time_start_minutes)); |
|
141 | + $this->ss->assign("DURATION_HOURS", $focus->duration_hours); |
|
142 | + $this->ss->assign("DURATION_MINUTES_OPTIONS", get_select_options_with_id($focus->minutes_values, $focus->duration_minutes)); |
|
143 | 143 | // Test to see if time format is 11:00am; otherwise it's 11:00AM |
144 | 144 | if($num_of_hours == 13) { |
145 | 145 | |
146 | - if (strpos($time_pref, 'a')) { |
|
146 | + if (strpos($time_pref, 'a')) { |
|
147 | 147 | |
148 | - if(!isset($focus->meridiem_am_values)) { |
|
149 | - $focus->meridiem_am_values = array('am'=>'am', 'pm'=>'pm'); |
|
150 | - } |
|
148 | + if(!isset($focus->meridiem_am_values)) { |
|
149 | + $focus->meridiem_am_values = array('am'=>'am', 'pm'=>'pm'); |
|
150 | + } |
|
151 | 151 | |
152 | - $this->ss->assign("TIME_MERIDIEM", get_select_options_with_id($focus->meridiem_am_values, $time_start_hour < 12 ? 'am' : 'pm')); |
|
152 | + $this->ss->assign("TIME_MERIDIEM", get_select_options_with_id($focus->meridiem_am_values, $time_start_hour < 12 ? 'am' : 'pm')); |
|
153 | 153 | |
154 | - } else { |
|
155 | - if(!isset($focus->meridiem_AM_values)) { |
|
156 | - $focus->meridiem_AM_values = array('AM'=>'AM', 'PM'=>'PM'); |
|
157 | - } |
|
154 | + } else { |
|
155 | + if(!isset($focus->meridiem_AM_values)) { |
|
156 | + $focus->meridiem_AM_values = array('AM'=>'AM', 'PM'=>'PM'); |
|
157 | + } |
|
158 | 158 | |
159 | - $this->ss->assign("TIME_MERIDIEM", get_select_options_with_id($focus->meridiem_AM_values, $time_start_hour < 12 ? 'AM' : 'PM')); |
|
159 | + $this->ss->assign("TIME_MERIDIEM", get_select_options_with_id($focus->meridiem_AM_values, $time_start_hour < 12 ? 'AM' : 'PM')); |
|
160 | 160 | |
161 | - } //if-else |
|
161 | + } //if-else |
|
162 | 162 | |
163 | 163 | } |
164 | 164 |
@@ -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,13 +55,13 @@ discard block |
||
55 | 55 | |
56 | 56 | $this->ss->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['meeting_status_dom'], $app_list_strings['meeting_status_default'])); |
57 | 57 | $this->ss->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format()); |
58 | - $this->ss->assign("TIME_FORMAT", '('. $timedate->get_user_time_format().')'); |
|
59 | - $this->ss->assign("USER_DATEFORMAT", '('. $timedate->get_user_date_format().')'); |
|
58 | + $this->ss->assign("TIME_FORMAT", '('.$timedate->get_user_time_format().')'); |
|
59 | + $this->ss->assign("USER_DATEFORMAT", '('.$timedate->get_user_date_format().')'); |
|
60 | 60 | |
61 | 61 | |
62 | 62 | |
63 | 63 | |
64 | - if($this->viaAJAX) { // override for ajax call |
|
64 | + if ($this->viaAJAX) { // override for ajax call |
|
65 | 65 | $this->ss->assign('saveOnclick', "onclick='if(check_form(\"meetingsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"activities\"); else return false;'"); |
66 | 66 | $this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_activities\")';"); |
67 | 67 | } |
@@ -83,14 +83,14 @@ discard block |
||
83 | 83 | $focus->duration_hours = "1"; |
84 | 84 | |
85 | 85 | |
86 | - $date_start_array=explode(" ",trim($focus->date_start)); |
|
87 | - if (count($date_start_array)==2) { |
|
86 | + $date_start_array = explode(" ", trim($focus->date_start)); |
|
87 | + if (count($date_start_array) == 2) { |
|
88 | 88 | $focus->time_start = $timedate->to_db_time($date_start_array[1], false); |
89 | 89 | //$focus->date_start = $date_start_array[0]; |
90 | 90 | } |
91 | 91 | |
92 | 92 | $this->ss->assign("DATE_START", $focus->date_start); |
93 | - $this->ss->assign("TIME_START", substr($focus->time_start,0,5)); |
|
93 | + $this->ss->assign("TIME_START", substr($focus->time_start, 0, 5)); |
|
94 | 94 | $time_start_hour = intval(substr($focus->time_start, 0, 2)); |
95 | 95 | $time_start_minutes = substr($focus->time_start, 3, 5); |
96 | 96 | |
@@ -110,12 +110,12 @@ discard block |
||
110 | 110 | |
111 | 111 | |
112 | 112 | // We default the to assume that the time preference is set to 11:00 (i.e. without meridiem) |
113 | - $hours_arr = array (); |
|
113 | + $hours_arr = array(); |
|
114 | 114 | $num_of_hours = 24; |
115 | 115 | $start_at = 0; |
116 | 116 | |
117 | 117 | $time_pref = $timedate->get_time_format(); |
118 | - if(strpos($time_pref, 'a') || strpos($time_pref, 'A')) { |
|
118 | + if (strpos($time_pref, 'a') || strpos($time_pref, 'A')) { |
|
119 | 119 | $num_of_hours = 13; |
120 | 120 | $start_at = 1; |
121 | 121 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | */ |
130 | 130 | |
131 | - for ($i = $start_at; $i < $num_of_hours; $i ++) { |
|
131 | + for ($i = $start_at; $i < $num_of_hours; $i++) { |
|
132 | 132 | $i = $i.""; |
133 | 133 | if (strlen($i) == 1) { |
134 | 134 | $i = "0".$i; |
@@ -141,18 +141,18 @@ discard block |
||
141 | 141 | $this->ss->assign("DURATION_HOURS", $focus->duration_hours); |
142 | 142 | $this->ss->assign("DURATION_MINUTES_OPTIONS", get_select_options_with_id($focus->minutes_values, $focus->duration_minutes)); |
143 | 143 | // Test to see if time format is 11:00am; otherwise it's 11:00AM |
144 | - if($num_of_hours == 13) { |
|
144 | + if ($num_of_hours == 13) { |
|
145 | 145 | |
146 | 146 | if (strpos($time_pref, 'a')) { |
147 | 147 | |
148 | - if(!isset($focus->meridiem_am_values)) { |
|
148 | + if (!isset($focus->meridiem_am_values)) { |
|
149 | 149 | $focus->meridiem_am_values = array('am'=>'am', 'pm'=>'pm'); |
150 | 150 | } |
151 | 151 | |
152 | 152 | $this->ss->assign("TIME_MERIDIEM", get_select_options_with_id($focus->meridiem_am_values, $time_start_hour < 12 ? 'am' : 'pm')); |
153 | 153 | |
154 | 154 | } else { |
155 | - if(!isset($focus->meridiem_AM_values)) { |
|
155 | + if (!isset($focus->meridiem_AM_values)) { |
|
156 | 156 | $focus->meridiem_AM_values = array('AM'=>'AM', 'PM'=>'PM'); |
157 | 157 | } |
158 | 158 |
@@ -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. |
@@ -75,12 +77,15 @@ discard block |
||
75 | 77 | $this->javascript->setSugarBean($focus); |
76 | 78 | $this->javascript->addAllFields(''); |
77 | 79 | |
78 | - if (is_null($focus->date_start)) |
|
79 | - $focus->date_start = $timedate->to_display_date(TimeDate::getInstance()->nowDb()); |
|
80 | - if (is_null($focus->time_start)) |
|
81 | - $focus->time_start = $timedate->to_display_time(TimeDate::getInstance()->nowDb(), true); |
|
82 | - if (!isset ($focus->duration_hours)) |
|
83 | - $focus->duration_hours = "1"; |
|
80 | + if (is_null($focus->date_start)) { |
|
81 | + $focus->date_start = $timedate->to_display_date(TimeDate::getInstance()->nowDb()); |
|
82 | + } |
|
83 | + if (is_null($focus->time_start)) { |
|
84 | + $focus->time_start = $timedate->to_display_time(TimeDate::getInstance()->nowDb(), true); |
|
85 | + } |
|
86 | + if (!isset ($focus->duration_hours)) { |
|
87 | + $focus->duration_hours = "1"; |
|
88 | + } |
|
84 | 89 | |
85 | 90 | |
86 | 91 | $date_start_array=explode(" ",trim($focus->date_start)); |