@@ -18,7 +18,7 @@ |
||
18 | 18 | $PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح.'; |
19 | 19 | $PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.'; |
20 | 20 | $PHPMAILER_LANG['provide_address'] = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.'; |
21 | -$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية ' . |
|
21 | +$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية '. |
|
22 | 22 | 'فشل في الارسال لكل من : '; |
23 | 23 | $PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: '; |
24 | 24 | $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() غير ممكن.'; |
@@ -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,9 +54,9 @@ discard block |
||
54 | 54 | */ |
55 | 55 | function checkRequired($prefix, $required) |
56 | 56 | { |
57 | - foreach($required as $key) |
|
57 | + foreach ($required as $key) |
|
58 | 58 | { |
59 | - if(!isset($_POST[$prefix.$key]) || number_empty($_POST[$prefix.$key])) |
|
59 | + if (!isset($_POST[$prefix.$key]) || number_empty($_POST[$prefix.$key])) |
|
60 | 60 | { |
61 | 61 | return false; |
62 | 62 | } |
@@ -77,15 +77,15 @@ discard block |
||
77 | 77 | { |
78 | 78 | global $current_user; |
79 | 79 | |
80 | - if(!empty($_REQUEST[$prefix.'record']) && !$skipRetrieve) |
|
80 | + if (!empty($_REQUEST[$prefix.'record']) && !$skipRetrieve) |
|
81 | 81 | $focus->retrieve($_REQUEST[$prefix.'record']); |
82 | 82 | |
83 | - if(!empty($_POST['assigned_user_id']) && |
|
83 | + if (!empty($_POST['assigned_user_id']) && |
|
84 | 84 | ($focus->assigned_user_id != $_POST['assigned_user_id']) && |
85 | 85 | ($_POST['assigned_user_id'] != $current_user->id)) { |
86 | 86 | $GLOBALS['check_notify'] = true; |
87 | 87 | } |
88 | - if(isset($_POST['dup_checked']) && $_POST['dup_checked'] && isset($_POST['id']) && $_POST['id'] != '' ){ |
|
88 | + if (isset($_POST['dup_checked']) && $_POST['dup_checked'] && isset($_POST['id']) && $_POST['id'] != '') { |
|
89 | 89 | $focus->new_with_id = true; |
90 | 90 | } |
91 | 91 | require_once('include/SugarFields/SugarFieldHandler.php'); |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | $relatedFields[$def['id_name']] = $field; |
107 | 107 | } |
108 | 108 | |
109 | - foreach($focus->field_defs as $field=>$def) { |
|
110 | - if ( $field == 'id' && !empty($focus->id) ) { |
|
109 | + foreach ($focus->field_defs as $field=>$def) { |
|
110 | + if ($field == 'id' && !empty($focus->id)) { |
|
111 | 111 | // Don't try and overwrite the ID |
112 | 112 | continue; |
113 | 113 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | $type = !empty($def['custom_type']) ? $def['custom_type'] : $def['type']; |
117 | 117 | $sf = $sfh->getSugarField($type); |
118 | - if($sf != null){ |
|
118 | + if ($sf != null) { |
|
119 | 119 | $sf->save($focus, $_POST, $field, $def, $prefix); |
120 | 120 | } else { |
121 | 121 | $GLOBALS['log']->fatal("Field '$field' does not have a SugarField handler"); |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | */ |
155 | 155 | } |
156 | 156 | |
157 | - foreach($focus->additional_column_fields as $field) { |
|
158 | - if(isset($_POST[$prefix.$field])) { |
|
157 | + foreach ($focus->additional_column_fields as $field) { |
|
158 | + if (isset($_POST[$prefix.$field])) { |
|
159 | 159 | $value = $_POST[$prefix.$field]; |
160 | 160 | $focus->$field = $value; |
161 | 161 | } |
@@ -180,18 +180,18 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | |
183 | -function getPostToForm($ignore='', $isRegularExpression=false) |
|
183 | +function getPostToForm($ignore = '', $isRegularExpression = false) |
|
184 | 184 | { |
185 | 185 | $fields = ''; |
186 | - if(!empty($ignore) && $isRegularExpression) { |
|
187 | - foreach ($_POST as $key=>$value){ |
|
188 | - if(!preg_match($ignore, $key)) { |
|
186 | + if (!empty($ignore) && $isRegularExpression) { |
|
187 | + foreach ($_POST as $key=>$value) { |
|
188 | + if (!preg_match($ignore, $key)) { |
|
189 | 189 | $fields .= add_hidden_elements($key, $value); |
190 | 190 | } |
191 | 191 | } |
192 | 192 | } else { |
193 | - foreach ($_POST as $key=>$value){ |
|
194 | - if($key != $ignore) { |
|
193 | + foreach ($_POST as $key=>$value) { |
|
194 | + if ($key != $ignore) { |
|
195 | 195 | $fields .= add_hidden_elements($key, $value); |
196 | 196 | } |
197 | 197 | } |
@@ -199,21 +199,21 @@ discard block |
||
199 | 199 | return $fields; |
200 | 200 | } |
201 | 201 | |
202 | -function getGetToForm($ignore='', $usePostAsAuthority = false) |
|
202 | +function getGetToForm($ignore = '', $usePostAsAuthority = false) |
|
203 | 203 | { |
204 | 204 | $fields = ''; |
205 | 205 | foreach ($_GET as $key=>$value) |
206 | 206 | { |
207 | - if($key != $ignore){ |
|
208 | - if(!$usePostAsAuthority || !isset($_POST[$key])){ |
|
209 | - $fields.= "<input type='hidden' name='$key' value='$value'>"; |
|
207 | + if ($key != $ignore) { |
|
208 | + if (!$usePostAsAuthority || !isset($_POST[$key])) { |
|
209 | + $fields .= "<input type='hidden' name='$key' value='$value'>"; |
|
210 | 210 | } |
211 | 211 | } |
212 | 212 | } |
213 | 213 | return $fields; |
214 | 214 | |
215 | 215 | } |
216 | -function getAnyToForm($ignore='', $usePostAsAuthority = false) |
|
216 | +function getAnyToForm($ignore = '', $usePostAsAuthority = false) |
|
217 | 217 | { |
218 | 218 | $fields = getPostToForm($ignore); |
219 | 219 | $fields .= getGetToForm($ignore, $usePostAsAuthority); |
@@ -221,11 +221,11 @@ discard block |
||
221 | 221 | |
222 | 222 | } |
223 | 223 | |
224 | -function handleRedirect($return_id='', $return_module='', $additionalFlags = false) |
|
224 | +function handleRedirect($return_id = '', $return_module = '', $additionalFlags = false) |
|
225 | 225 | { |
226 | - if(isset($_REQUEST['return_url']) && $_REQUEST['return_url'] != "") |
|
226 | + if (isset($_REQUEST['return_url']) && $_REQUEST['return_url'] != "") |
|
227 | 227 | { |
228 | - header("Location: ". $_REQUEST['return_url']); |
|
228 | + header("Location: ".$_REQUEST['return_url']); |
|
229 | 229 | exit; |
230 | 230 | } |
231 | 231 | |
@@ -235,9 +235,9 @@ discard block |
||
235 | 235 | } |
236 | 236 | |
237 | 237 | //eggsurplus: abstract to simplify unit testing |
238 | -function buildRedirectURL($return_id='', $return_module='') |
|
238 | +function buildRedirectURL($return_id = '', $return_module = '') |
|
239 | 239 | { |
240 | - if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "") |
|
240 | + if (isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "") |
|
241 | 241 | { |
242 | 242 | $return_module = $_REQUEST['return_module']; |
243 | 243 | } |
@@ -245,24 +245,24 @@ discard block |
||
245 | 245 | { |
246 | 246 | $return_module = $return_module; |
247 | 247 | } |
248 | - if(isset($_REQUEST['return_action']) && $_REQUEST['return_action'] != "") |
|
248 | + if (isset($_REQUEST['return_action']) && $_REQUEST['return_action'] != "") |
|
249 | 249 | { |
250 | 250 | |
251 | 251 | //if we are doing a "Close and Create New" |
252 | - if(isCloseAndCreateNewPressed()) |
|
252 | + if (isCloseAndCreateNewPressed()) |
|
253 | 253 | { |
254 | 254 | $return_action = "EditView"; |
255 | 255 | $isDuplicate = "true"; |
256 | 256 | $status = ""; |
257 | 257 | |
258 | 258 | // Meeting Integration |
259 | - if(isset($_REQUEST['meetingIntegrationFlag']) && $_REQUEST['meetingIntegrationFlag'] == 1) { |
|
259 | + if (isset($_REQUEST['meetingIntegrationFlag']) && $_REQUEST['meetingIntegrationFlag'] == 1) { |
|
260 | 260 | $additionalFlags = array('meetingIntegrationShowForm' => '1'); |
261 | 261 | } |
262 | 262 | // END Meeting Integration |
263 | 263 | } |
264 | 264 | // if we create a new record "Save", we want to redirect to the DetailView |
265 | - else if(isset($_REQUEST['action']) && $_REQUEST['action'] == "Save" |
|
265 | + else if (isset($_REQUEST['action']) && $_REQUEST['action'] == "Save" |
|
266 | 266 | && $_REQUEST['return_module'] != 'Activities' |
267 | 267 | && $_REQUEST['return_module'] != 'Home' |
268 | 268 | && $_REQUEST['return_module'] != 'Forecasts' |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | ) |
272 | 272 | { |
273 | 273 | $return_action = 'DetailView'; |
274 | - } elseif($_REQUEST['return_module'] == 'Activities' || $_REQUEST['return_module'] == 'Calendar') { |
|
274 | + } elseif ($_REQUEST['return_module'] == 'Activities' || $_REQUEST['return_module'] == 'Calendar') { |
|
275 | 275 | $return_module = $_REQUEST['module']; |
276 | 276 | $return_action = $_REQUEST['return_action']; |
277 | 277 | // wp: return action needs to be set for one-click close in task list |
@@ -287,25 +287,25 @@ discard block |
||
287 | 287 | $return_action = "DetailView"; |
288 | 288 | } |
289 | 289 | |
290 | - if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") |
|
290 | + if (isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") |
|
291 | 291 | { |
292 | 292 | $return_id = $_REQUEST['return_id']; |
293 | 293 | } |
294 | 294 | |
295 | 295 | $add = ""; |
296 | - if(isset($additionalFlags) && !empty($additionalFlags)) { |
|
297 | - foreach($additionalFlags as $k => $v) { |
|
296 | + if (isset($additionalFlags) && !empty($additionalFlags)) { |
|
297 | + foreach ($additionalFlags as $k => $v) { |
|
298 | 298 | $add .= "&{$k}={$v}"; |
299 | 299 | } |
300 | 300 | } |
301 | 301 | |
302 | 302 | if (!isset($isDuplicate) || !$isDuplicate) |
303 | 303 | { |
304 | - $url="index.php?action=$return_action&module=$return_module&record=$return_id&return_module=$return_module&return_action=$return_action{$add}"; |
|
305 | - if(isset($_REQUEST['offset']) && empty($_REQUEST['duplicateSave'])) { |
|
304 | + $url = "index.php?action=$return_action&module=$return_module&record=$return_id&return_module=$return_module&return_action=$return_action{$add}"; |
|
305 | + if (isset($_REQUEST['offset']) && empty($_REQUEST['duplicateSave'])) { |
|
306 | 306 | $url .= "&offset=".$_REQUEST['offset']; |
307 | 307 | } |
308 | - if(!empty($_REQUEST['ajax_load'])) |
|
308 | + if (!empty($_REQUEST['ajax_load'])) |
|
309 | 309 | { |
310 | 310 | $ajax_ret = array( |
311 | 311 | 'content' => "<script>SUGAR.ajaxUI.loadContent('$url');</script>\n", |
@@ -321,8 +321,8 @@ discard block |
||
321 | 321 | } |
322 | 322 | } else { |
323 | 323 | $standard = "action=$return_action&module=$return_module&record=$return_id&isDuplicate=true&return_module=$return_module&return_action=$return_action&status=$status"; |
324 | - $url="index.php?{$standard}{$add}"; |
|
325 | - if(!empty($_REQUEST['ajax_load'])) |
|
324 | + $url = "index.php?{$standard}{$add}"; |
|
325 | + if (!empty($_REQUEST['ajax_load'])) |
|
326 | 326 | { |
327 | 327 | $ajax_ret = array( |
328 | 328 | 'content' => "<script>SUGAR.ajaxUI.loadContent('$url');</script>\n", |
@@ -339,20 +339,20 @@ discard block |
||
339 | 339 | } |
340 | 340 | } |
341 | 341 | |
342 | -function getLikeForEachWord($fieldname, $value, $minsize=4) |
|
342 | +function getLikeForEachWord($fieldname, $value, $minsize = 4) |
|
343 | 343 | { |
344 | 344 | $value = trim($value); |
345 | - $values = explode(' ',$value); |
|
345 | + $values = explode(' ', $value); |
|
346 | 346 | $ret = ''; |
347 | - foreach($values as $val) |
|
347 | + foreach ($values as $val) |
|
348 | 348 | { |
349 | - if(strlen($val) >= $minsize) |
|
349 | + if (strlen($val) >= $minsize) |
|
350 | 350 | { |
351 | - if(!empty($ret)) |
|
351 | + if (!empty($ret)) |
|
352 | 352 | { |
353 | 353 | $ret .= ' or'; |
354 | 354 | } |
355 | - $ret .= ' '. $fieldname . ' LIKE %'.$val.'%'; |
|
355 | + $ret .= ' '.$fieldname.' LIKE %'.$val.'%'; |
|
356 | 356 | } |
357 | 357 | |
358 | 358 | } |
@@ -373,36 +373,36 @@ discard block |
||
373 | 373 | * @see include/generic/Save2.php |
374 | 374 | */ |
375 | 375 | |
376 | -function add_prospects_to_prospect_list($parent_id,$child_id) |
|
376 | +function add_prospects_to_prospect_list($parent_id, $child_id) |
|
377 | 377 | { |
378 | - $focus=BeanFactory::getBean('Prospects'); |
|
379 | - if(is_array($child_id)){ |
|
378 | + $focus = BeanFactory::getBean('Prospects'); |
|
379 | + if (is_array($child_id)) { |
|
380 | 380 | $uids = $child_id; |
381 | 381 | } |
382 | - else{ |
|
382 | + else { |
|
383 | 383 | $uids = array($child_id); |
384 | 384 | } |
385 | 385 | |
386 | 386 | $relationship = ''; |
387 | - foreach($focus->get_linked_fields() as $field => $def) { |
|
387 | + foreach ($focus->get_linked_fields() as $field => $def) { |
|
388 | 388 | if ($focus->load_relationship($field)) { |
389 | - if ( $focus->$field->getRelatedModuleName() == 'ProspectLists' ) { |
|
389 | + if ($focus->$field->getRelatedModuleName() == 'ProspectLists') { |
|
390 | 390 | $relationship = $field; |
391 | 391 | break; |
392 | 392 | } |
393 | 393 | } |
394 | 394 | } |
395 | 395 | |
396 | - if ( $relationship != '' ) { |
|
397 | - foreach ( $uids as $id) { |
|
396 | + if ($relationship != '') { |
|
397 | + foreach ($uids as $id) { |
|
398 | 398 | $focus->retrieve($id); |
399 | 399 | $focus->load_relationship($relationship); |
400 | - $focus->prospect_lists->add( $parent_id ); |
|
400 | + $focus->prospect_lists->add($parent_id); |
|
401 | 401 | } |
402 | 402 | } |
403 | 403 | } |
404 | 404 | |
405 | -function add_to_prospect_list($query_panel,$parent_module,$parent_type,$parent_id,$child_id,$link_attribute,$link_type,$parent) |
|
405 | +function add_to_prospect_list($query_panel, $parent_module, $parent_type, $parent_id, $child_id, $link_attribute, $link_type, $parent) |
|
406 | 406 | { |
407 | 407 | $GLOBALS['log']->debug('add_prospects_to_prospect_list:parameters:'.$query_panel); |
408 | 408 | $GLOBALS['log']->debug('add_prospects_to_prospect_list:parameters:'.$parent_module); |
@@ -419,21 +419,21 @@ discard block |
||
419 | 419 | } |
420 | 420 | $focus = new $parent_type(); |
421 | 421 | $focus->retrieve($parent_id); |
422 | - if(empty($focus->id)) { |
|
422 | + if (empty($focus->id)) { |
|
423 | 423 | return false; |
424 | 424 | } |
425 | - if(empty($parent)) { |
|
425 | + if (empty($parent)) { |
|
426 | 426 | return false; |
427 | 427 | } |
428 | 428 | |
429 | 429 | //if link_type is default then load relationship once and add all the child ids. |
430 | - $relationship_attribute=$link_attribute; |
|
430 | + $relationship_attribute = $link_attribute; |
|
431 | 431 | |
432 | 432 | //find all prospects based on the query |
433 | 433 | |
434 | 434 | $subpanel = new SubPanelTiles($parent, $parent->module_dir); |
435 | - $thisPanel=$subpanel->subpanel_definitions->load_subpanel($query_panel); |
|
436 | - if(empty($thisPanel)) { |
|
435 | + $thisPanel = $subpanel->subpanel_definitions->load_subpanel($query_panel); |
|
436 | + if (empty($thisPanel)) { |
|
437 | 437 | return false; |
438 | 438 | } |
439 | 439 | |
@@ -443,12 +443,12 @@ discard block |
||
443 | 443 | $thisPanel->_instance_properties['function_parameters']['EMAIL_MARKETING_ID_VALUE'] = $_REQUEST['marketing_id']; |
444 | 444 | } |
445 | 445 | |
446 | - $result = SugarBean::get_union_related_list($parent, '', '', '', 0, -99,-99,'', $thisPanel); |
|
446 | + $result = SugarBean::get_union_related_list($parent, '', '', '', 0, -99, -99, '', $thisPanel); |
|
447 | 447 | |
448 | - if(!empty($result['list'])) { |
|
449 | - foreach($result['list'] as $object) { |
|
448 | + if (!empty($result['list'])) { |
|
449 | + foreach ($result['list'] as $object) { |
|
450 | 450 | if ($link_type != 'default') { |
451 | - $relationship_attribute=strtolower($object->$link_attribute); |
|
451 | + $relationship_attribute = strtolower($object->$link_attribute); |
|
452 | 452 | } |
453 | 453 | $GLOBALS['log']->debug('add_prospects_to_prospect_list:relationship_attribute:'.$relationship_attribute); |
454 | 454 | // load relationship for the first time or on change of relationship atribute. |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | } |
463 | 463 | |
464 | 464 | //Link rows returned by a report to parent record. |
465 | -function save_from_report($report_id,$parent_id, $module_name, $relationship_attr_name) { |
|
465 | +function save_from_report($report_id, $parent_id, $module_name, $relationship_attr_name) { |
|
466 | 466 | global $beanFiles; |
467 | 467 | global $beanList; |
468 | 468 | |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | $GLOBALS['log']->debug("Save2:Module Name=".$module_name); |
473 | 473 | $GLOBALS['log']->debug("Save2:Relationship Attribute Name=".$relationship_attr_name); |
474 | 474 | |
475 | - $GLOBALS['log']->debug("Save2:Bean Name=" . $module_name); |
|
475 | + $GLOBALS['log']->debug("Save2:Bean Name=".$module_name); |
|
476 | 476 | $focus = BeanFactory::newBean($module_name); |
477 | 477 | |
478 | 478 | $focus->retrieve($parent_id); |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | //fetch report definition. |
482 | 482 | global $current_language, $report_modules, $modules_report; |
483 | 483 | |
484 | - $mod_strings = return_module_language($current_language,"Reports"); |
|
484 | + $mod_strings = return_module_language($current_language, "Reports"); |
|
485 | 485 | |
486 | 486 | |
487 | 487 | $saved = new SavedReport(); |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | $result = $report->db->query($sql); |
499 | 499 | |
500 | 500 | $reportBean = BeanFactory::newBean($saved->module); |
501 | - while($row = $report->db->fetchByAssoc($result)) |
|
501 | + while ($row = $report->db->fetchByAssoc($result)) |
|
502 | 502 | { |
503 | 503 | $reportBean->id = $row['primaryid']; |
504 | 504 | $focus->$relationship_attr_name->add($reportBean); |
@@ -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. |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | EOQ; |
63 | 63 | |
64 | 64 | $cacheDir = create_cache_directory('jsLanguage/'); |
65 | - if($fh = @sugar_fopen($cacheDir . $lang . '.js', "w")){ |
|
65 | + if ($fh = @sugar_fopen($cacheDir.$lang.'.js', "w")) { |
|
66 | 66 | fputs($fh, $str); |
67 | 67 | fclose($fh); |
68 | 68 | } |
@@ -74,16 +74,16 @@ discard block |
||
74 | 74 | // cn: bug 8242 - non-US langpack chokes |
75 | 75 | $mod_strings = return_module_language($lang, $moduleDir); |
76 | 76 | $mod_strings_encoded = $json->encode($mod_strings); |
77 | - $str = "SUGAR.language.setLanguage('" . $moduleDir . "', " . $mod_strings_encoded . ");"; |
|
77 | + $str = "SUGAR.language.setLanguage('".$moduleDir."', ".$mod_strings_encoded.");"; |
|
78 | 78 | |
79 | - $cacheDir = create_cache_directory('jsLanguage/' . $moduleDir . '/'); |
|
79 | + $cacheDir = create_cache_directory('jsLanguage/'.$moduleDir.'/'); |
|
80 | 80 | |
81 | - if($fh = @fopen($cacheDir . $lang . '.js', "w")){ |
|
81 | + if ($fh = @fopen($cacheDir.$lang.'.js', "w")) { |
|
82 | 82 | fputs($fh, $str); |
83 | 83 | fclose($fh); |
84 | 84 | } |
85 | 85 | |
86 | - if($return) { |
|
86 | + if ($return) { |
|
87 | 87 | return $str; |
88 | 88 | } |
89 | 89 | } |
@@ -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,18 +38,18 @@ discard block |
||
38 | 38 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
39 | 39 | ********************************************************************************/ |
40 | 40 | |
41 | -ini_set('display_errors',1); |
|
41 | +ini_set('display_errors', 1); |
|
42 | 42 | |
43 | 43 | global $beanList; |
44 | 44 | global $beanFiles; |
45 | 45 | |
46 | 46 | |
47 | -if(empty($_REQUEST['module'])) |
|
47 | +if (empty($_REQUEST['module'])) |
|
48 | 48 | { |
49 | 49 | die("'module' was not defined"); |
50 | 50 | } |
51 | 51 | |
52 | -if(!isset($beanList[$_REQUEST['module']])) |
|
52 | +if (!isset($beanList[$_REQUEST['module']])) |
|
53 | 53 | { |
54 | 54 | die("'".$_REQUEST['module']."' is not defined in \$beanList"); |
55 | 55 | } |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | |
67 | 67 | include('include/SubPanel/SubPanel.php'); |
68 | 68 | $layout_def_key = ''; |
69 | -if(!empty($_REQUEST['layout_def_key'])){ |
|
69 | +if (!empty($_REQUEST['layout_def_key'])) { |
|
70 | 70 | $layout_def_key = $_REQUEST['layout_def_key']; |
71 | 71 | } |
72 | 72 | |
73 | -$subpanel_object = new CustomSubPanel($module, $record, $subpanel,null, $layout_def_key, $collection); |
|
73 | +$subpanel_object = new CustomSubPanel($module, $record, $subpanel, null, $layout_def_key, $collection); |
|
74 | 74 | |
75 | 75 | echo $subpanel_object->getSearchForm(); |
76 | 76 |
@@ -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,27 +55,27 @@ discard block |
||
55 | 55 | //if the contract has been executed or selected_revision is same as latest revision |
56 | 56 | //then hide the latest button. |
57 | 57 | //if the contract state is executed or document is not a template hide this action. |
58 | - if ((!empty($layout_def['fields']['CONTRACT_STATUS']) && $layout_def['fields']['CONTRACT_STATUS']=='executed') or |
|
59 | - $layout_def['fields']['SELECTED_REVISION_ID']== $layout_def['fields']['LATEST_REVISION_ID']) { |
|
58 | + if ((!empty($layout_def['fields']['CONTRACT_STATUS']) && $layout_def['fields']['CONTRACT_STATUS'] == 'executed') or |
|
59 | + $layout_def['fields']['SELECTED_REVISION_ID'] == $layout_def['fields']['LATEST_REVISION_ID']) { |
|
60 | 60 | return ""; |
61 | 61 | } |
62 | 62 | |
63 | 63 | global $app_strings; |
64 | 64 | |
65 | 65 | |
66 | - $href = 'index.php?module=' . $layout_def['module'] |
|
67 | - . '&action=' . 'GetLatestRevision' |
|
68 | - . '&record=' . $layout_def['fields']['ID'] |
|
69 | - . '&return_module=' . $_REQUEST['module'] |
|
70 | - . '&return_action=' . 'DetailView' |
|
71 | - . '&return_id=' . $_REQUEST['record'] |
|
72 | - . '&get_latest_for_id=' . $layout_def['fields']['LINKED_ID']; |
|
66 | + $href = 'index.php?module='.$layout_def['module'] |
|
67 | + . '&action='.'GetLatestRevision' |
|
68 | + . '&record='.$layout_def['fields']['ID'] |
|
69 | + . '&return_module='.$_REQUEST['module'] |
|
70 | + . '&return_action='.'DetailView' |
|
71 | + . '&return_id='.$_REQUEST['record'] |
|
72 | + . '&get_latest_for_id='.$layout_def['fields']['LINKED_ID']; |
|
73 | 73 | |
74 | - $edit_icon_html = SugarThemeRegistry::current()->getImage( 'getLatestDocument','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LNK_GET_LATEST']); |
|
75 | - if($layout_def['EditView']){ |
|
76 | - return '<a href="' . $href . '"' . "title ='". $app_strings['LNK_GET_LATEST_TOOLTIP'] ."'" |
|
77 | - . 'class="listViewTdToolsS1">' . $edit_icon_html . ' ' . $app_strings['LNK_GET_LATEST'] .'</a> '; |
|
78 | - }else{ |
|
74 | + $edit_icon_html = SugarThemeRegistry::current()->getImage('getLatestDocument', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_GET_LATEST']); |
|
75 | + if ($layout_def['EditView']) { |
|
76 | + return '<a href="'.$href.'"'."title ='".$app_strings['LNK_GET_LATEST_TOOLTIP']."'" |
|
77 | + . 'class="listViewTdToolsS1">'.$edit_icon_html.' '.$app_strings['LNK_GET_LATEST'].'</a> '; |
|
78 | + } else { |
|
79 | 79 | return ''; |
80 | 80 | } |
81 | 81 | } |
@@ -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. |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | //$accesskey = $app_strings['LBL_NEW_BUTTON_KEY']; |
61 | 61 | $value = $app_strings['LBL_NEW_BUTTON_LABEL']; |
62 | 62 | $this->module = 'Leads'; |
63 | - if( ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)){ |
|
63 | + if (ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)) { |
|
64 | 64 | $button = "<input title='$title'class='button' type='button' name='button' value=' $value ' disabled/>\n"; |
65 | 65 | return $button; |
66 | 66 | } |
@@ -69,52 +69,52 @@ discard block |
||
69 | 69 | |
70 | 70 | //from accounts |
71 | 71 | if ($defines['focus']->object_name == 'Account') { |
72 | - if(isset($defines['focus']->billing_address_street)) |
|
72 | + if (isset($defines['focus']->billing_address_street)) |
|
73 | 73 | $additionalFormFields['primary_address_street'] = $defines['focus']->billing_address_street; |
74 | - if(isset($defines['focus']->billing_address_city)) |
|
74 | + if (isset($defines['focus']->billing_address_city)) |
|
75 | 75 | $additionalFormFields['primary_address_city'] = $defines['focus']->billing_address_city; |
76 | - if(isset($defines['focus']->billing_address_state)) |
|
76 | + if (isset($defines['focus']->billing_address_state)) |
|
77 | 77 | $additionalFormFields['primary_address_state'] = $defines['focus']->billing_address_state; |
78 | - if(isset($defines['focus']->billing_address_country)) |
|
78 | + if (isset($defines['focus']->billing_address_country)) |
|
79 | 79 | $additionalFormFields['primary_address_country'] = $defines['focus']->billing_address_country; |
80 | - if(isset($defines['focus']->billing_address_postalcode)) |
|
80 | + if (isset($defines['focus']->billing_address_postalcode)) |
|
81 | 81 | $additionalFormFields['primary_address_postalcode'] = $defines['focus']->billing_address_postalcode; |
82 | - if(isset($defines['focus']->phone_office)) |
|
82 | + if (isset($defines['focus']->phone_office)) |
|
83 | 83 | $additionalFormFields['phone_work'] = $defines['focus']->phone_office; |
84 | - if(isset($defines['focus']->id)) |
|
84 | + if (isset($defines['focus']->id)) |
|
85 | 85 | $additionalFormFields['account_id'] = $defines['focus']->id; |
86 | 86 | } |
87 | 87 | //from contacts |
88 | 88 | if ($defines['focus']->object_name == 'Contact') { |
89 | - if(isset($defines['focus']->salutation)) |
|
89 | + if (isset($defines['focus']->salutation)) |
|
90 | 90 | $additionalFormFields['salutation'] = $defines['focus']->salutation; |
91 | - if(isset($defines['focus']->first_name)) |
|
91 | + if (isset($defines['focus']->first_name)) |
|
92 | 92 | $additionalFormFields['first_name'] = $defines['focus']->first_name; |
93 | - if(isset($defines['focus']->last_name)) |
|
93 | + if (isset($defines['focus']->last_name)) |
|
94 | 94 | $additionalFormFields['last_name'] = $defines['focus']->last_name; |
95 | - if(isset($defines['focus']->primary_address_street)) |
|
95 | + if (isset($defines['focus']->primary_address_street)) |
|
96 | 96 | $additionalFormFields['primary_address_street'] = $defines['focus']->primary_address_street; |
97 | - if(isset($defines['focus']->primary_address_city)) |
|
97 | + if (isset($defines['focus']->primary_address_city)) |
|
98 | 98 | $additionalFormFields['primary_address_city'] = $defines['focus']->primary_address_city; |
99 | - if(isset($defines['focus']->primary_address_state)) |
|
99 | + if (isset($defines['focus']->primary_address_state)) |
|
100 | 100 | $additionalFormFields['primary_address_state'] = $defines['focus']->primary_address_state; |
101 | - if(isset($defines['focus']->primary_address_country)) |
|
101 | + if (isset($defines['focus']->primary_address_country)) |
|
102 | 102 | $additionalFormFields['primary_address_country'] = $defines['focus']->primary_address_country; |
103 | - if(isset($defines['focus']->primary_address_postalcode)) |
|
103 | + if (isset($defines['focus']->primary_address_postalcode)) |
|
104 | 104 | $additionalFormFields['primary_address_postalcode'] = $defines['focus']->primary_address_postalcode; |
105 | - if(isset($defines['focus']->phone_work)) |
|
105 | + if (isset($defines['focus']->phone_work)) |
|
106 | 106 | $additionalFormFields['phone_work'] = $defines['focus']->phone_work; |
107 | - if(isset($defines['focus']->id)) |
|
107 | + if (isset($defines['focus']->id)) |
|
108 | 108 | $additionalFormFields['contact_id'] = $defines['focus']->id; |
109 | 109 | } |
110 | 110 | |
111 | 111 | //from opportunities |
112 | 112 | if ($defines['focus']->object_name == 'Opportunity') { |
113 | - if(isset($defines['focus']->id)) |
|
113 | + if (isset($defines['focus']->id)) |
|
114 | 114 | $additionalFormFields['opportunity_id'] = $defines['focus']->id; |
115 | - if(isset($defines['focus']->account_name)) |
|
115 | + if (isset($defines['focus']->account_name)) |
|
116 | 116 | $additionalFormFields['account_name'] = $defines['focus']->account_name; |
117 | - if(isset($defines['focus']->account_id)) |
|
117 | + if (isset($defines['focus']->account_id)) |
|
118 | 118 | $additionalFormFields['account_id'] = $defines['focus']->account_id; |
119 | 119 | } |
120 | 120 |
@@ -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. |
@@ -58,18 +58,18 @@ discard block |
||
58 | 58 | { |
59 | 59 | $values[] = $layout_def['input_name0']; |
60 | 60 | } |
61 | - $html = '<select name="' . $layout_def['name'] . '[]" multiple="true">'; |
|
61 | + $html = '<select name="'.$layout_def['name'].'[]" multiple="true">'; |
|
62 | 62 | |
63 | 63 | $query = $this->displayInputQuery($layout_def); |
64 | 64 | $result = $this->reporter->db->query($query); |
65 | 65 | while ($row = $this->reporter->db->fetchByAssoc($result)) |
66 | 66 | { |
67 | - $html .= '<option value="' . $row['id'] . '"'; |
|
67 | + $html .= '<option value="'.$row['id'].'"'; |
|
68 | 68 | if (in_array($row['id'], $values)) |
69 | 69 | { |
70 | 70 | $html .= ' selected="selected"'; |
71 | 71 | } |
72 | - $html .= '>' . htmlspecialchars($row['title']) . '</option>'; |
|
72 | + $html .= '>'.htmlspecialchars($row['title']).'</option>'; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | $html .= '</select>'; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $ids[] = $row['id']; |
135 | 135 | } |
136 | 136 | $layout_def['name'] = 'id'; |
137 | - return $this->_get_column_select($layout_def) . " IN ('" . implode("', '", $ids) . "')"; |
|
137 | + return $this->_get_column_select($layout_def)." IN ('".implode("', '", $ids)."')"; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $module = isset($layout_def['custom_module']) ? $layout_def['custom_module'] : $layout_def['module']; |
155 | 155 | $seed = BeanFactory::getBean($module); |
156 | 156 | |
157 | - foreach($layout_def['input_name0'] as $beanId) |
|
157 | + foreach ($layout_def['input_name0'] as $beanId) |
|
158 | 158 | { |
159 | 159 | if (!empty($relation->lhs_module) && !empty($relation->rhs_module) |
160 | 160 | && $relation->lhs_module == $relation->rhs_module) { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | $ids = array_unique($ids); |
173 | 173 | $layout_def['name'] = 'id'; |
174 | - return $this->_get_column_select($layout_def) . " IN ('" . implode("', '", $ids) . "')"; |
|
174 | + return $this->_get_column_select($layout_def)." IN ('".implode("', '", $ids)."')"; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | //for to_pdf/to_csv |
@@ -180,14 +180,14 @@ discard block |
||
180 | 180 | $field_def = $reporter->all_fields[$layout_def['column_key']]; |
181 | 181 | $display = strtoupper($field_def['secondary_table'].'_name'); |
182 | 182 | //#31797 , we should get the table alias in a global registered array:selected_loaded_custom_links |
183 | - if(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table']])){ |
|
183 | + if (!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table']])) { |
|
184 | 184 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table']]['join_table_alias'].'_name'); |
185 | 185 | } |
186 | - elseif(isset($field_def['rep_rel_name']) && isset($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']])) |
|
186 | + elseif (isset($field_def['rep_rel_name']) && isset($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']])) |
|
187 | 187 | { |
188 | 188 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']]['join_table_alias'].'_name'); |
189 | 189 | } |
190 | - elseif(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']])){ |
|
190 | + elseif (!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']])) { |
|
191 | 191 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']]['join_table_alias'].'_name'); |
192 | 192 | } |
193 | 193 | $cell = $layout_def['fields'][$display]; |
@@ -200,14 +200,14 @@ discard block |
||
200 | 200 | $display = strtoupper($field_def['secondary_table'].'_name'); |
201 | 201 | |
202 | 202 | //#31797 , we should get the table alias in a global registered array:selected_loaded_custom_links |
203 | - if(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table']])){ |
|
203 | + if (!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table']])) { |
|
204 | 204 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table']]['join_table_alias'].'_name'); |
205 | 205 | } |
206 | - elseif(isset($field_def['rep_rel_name']) && isset($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']])) |
|
206 | + elseif (isset($field_def['rep_rel_name']) && isset($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']])) |
|
207 | 207 | { |
208 | 208 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']]['join_table_alias'].'_name'); |
209 | 209 | } |
210 | - elseif(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']])){ |
|
210 | + elseif (!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']])) { |
|
211 | 211 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']]['join_table_alias'].'_name'); |
212 | 212 | } |
213 | 213 | $recordField = $this->getTruncatedColumnAlias(strtoupper($layout_def['table_alias']).'_'.strtoupper($layout_def['name'])); |
@@ -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. |
@@ -45,16 +45,16 @@ discard block |
||
45 | 45 | { |
46 | 46 | function displayListPlain($layout_def) { |
47 | 47 | |
48 | - $value= $this->_get_list_value($layout_def); |
|
48 | + $value = $this->_get_list_value($layout_def); |
|
49 | 49 | |
50 | - if (isset($layout_def['widget_type']) && $layout_def['widget_type'] =='checkbox') { |
|
50 | + if (isset($layout_def['widget_type']) && $layout_def['widget_type'] == 'checkbox') { |
|
51 | 51 | |
52 | - if ($value != '' && ($value == 'on' || intval($value) == 1 || $value == 'yes')) |
|
52 | + if ($value != '' && ($value == 'on' || intval($value) == 1 || $value == 'yes')) |
|
53 | 53 | { |
54 | 54 | return " <input name='checkbox_display' class='checkbox' type='checkbox' disabled='true' checked>"; |
55 | 55 | } |
56 | 56 | //Modification to allow checkboxes to be displayed correctly in subpanel |
57 | - if ($layout_def['checkbox_value']=='true'){ |
|
57 | + if ($layout_def['checkbox_value'] == 'true') { |
|
58 | 58 | return " <input name='".$layout_def['module']."checkbox_display[]' class='checkbox' type='checkbox' id='".$layout_def['module']."checkbox_display_id[]' value=\"".$layout_def['fields']['ID']."\" onclick=''>"; |
59 | 59 | } |
60 | 60 |
@@ -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,8 +47,8 @@ discard block |
||
47 | 47 | { |
48 | 48 | function display($defines, $additionalFormFields = NULL, $nonbutton = false) |
49 | 49 | { |
50 | - if((ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true) || |
|
51 | - $defines['module'] == "History" & !ACLController::checkAccess("Emails", 'edit', true))){ |
|
50 | + if ((ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true) || |
|
51 | + $defines['module'] == "History" & !ACLController::checkAccess("Emails", 'edit', true))) { |
|
52 | 52 | $temp = ''; |
53 | 53 | return $temp; |
54 | 54 | } |
@@ -68,11 +68,11 @@ discard block |
||
68 | 68 | $additionalFormFields['parent_id'] = $defines['focus']->id; |
69 | 69 | $additionalFormFields['parent_name'] = $defines['focus']->name; |
70 | 70 | |
71 | - if(isset($defines['focus']->email1)) |
|
71 | + if (isset($defines['focus']->email1)) |
|
72 | 72 | { |
73 | 73 | $additionalFormFields['to_email_addrs'] = $defines['focus']->email1; |
74 | 74 | } |
75 | - if(ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)){ |
|
75 | + if (ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)) { |
|
76 | 76 | $button = "<input id='".preg_replace('[ ]', '', $value)."_button' title='$title' class='button' type='button' name='".preg_replace('[ ]', '', mb_strtolower($value, 'UTF-8'))."_button' value='$value' disabled/>\n"; |
77 | 77 | return $button; |
78 | 78 | } |