@@ -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. |
@@ -71,11 +73,12 @@ discard block |
||
71 | 73 | $portalUsername = $this->bean->db->quote($_REQUEST['portal_name']); |
72 | 74 | $result = $this->bean->db->query("Select count(id) as total from contacts where portal_name = '$portalUsername' and deleted='0'"); |
73 | 75 | $total = 0; |
74 | - while($row = $this->bean->db->fetchByAssoc($result)) |
|
75 | - $total = $row['total']; |
|
76 | + while($row = $this->bean->db->fetchByAssoc($result)) { |
|
77 | + $total = $row['total']; |
|
78 | + } |
|
76 | 79 | echo $total; |
80 | + } else { |
|
81 | + echo '0'; |
|
77 | 82 | } |
78 | - else |
|
79 | - echo '0'; |
|
80 | 83 | } |
81 | 84 | } |
82 | 85 | \ No newline at end of file |
@@ -53,8 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | array_push($recordIds, $val['id']); |
55 | 55 | } |
56 | - } |
|
57 | - else{ |
|
56 | + } else{ |
|
58 | 57 | $recordIds = explode(',',$_REQUEST['uid']); |
59 | 58 | } |
60 | 59 | |
@@ -150,7 +149,7 @@ discard block |
||
150 | 149 | |
151 | 150 | rename($sugar_config['upload_dir'].'nfile.pdf',$sugar_config['upload_dir'].$note->id); |
152 | 151 | |
153 | - }catch(mPDF_exception $e){ |
|
152 | + } catch(mPDF_exception $e){ |
|
154 | 153 | echo $e; |
155 | 154 | } |
156 | 155 | } |
@@ -32,18 +32,15 @@ discard block |
||
32 | 32 | foreach($focus->field_defs as $field_def) { |
33 | 33 | if($field_def['type'] == 'currency'){ |
34 | 34 | $repl_arr[$key."_".$field_def['name']] = currency_format_number($focus->$field_def['name'],$params = array('currency_symbol' => false)); |
35 | - } |
|
36 | - else if(($field_def['type'] == 'radioenum' || $field_def['type'] == 'enum') && isset($field_def['options'])) { |
|
35 | + } else if(($field_def['type'] == 'radioenum' || $field_def['type'] == 'enum') && isset($field_def['options'])) { |
|
37 | 36 | $repl_arr[$key."_".$field_def['name']] = translate($field_def['options'],$focus->module_dir,$focus->$field_def['name']); |
38 | - } |
|
39 | - else if($field_def['type'] == 'multienum' && isset($field_def['options'])) { |
|
37 | + } else if($field_def['type'] == 'multienum' && isset($field_def['options'])) { |
|
40 | 38 | $repl_arr[$key."_".$field_def['name']] = implode(', ', unencodeMultienum($focus->$field_def['name'])); |
41 | 39 | } |
42 | 40 | //Fix for Windows Server as it needed to be converted to a string. |
43 | 41 | else if($field_def['type'] == 'int') { |
44 | 42 | $repl_arr[$key."_".$field_def['name']] = strval($focus->$field_def['name']); |
45 | - } |
|
46 | - else { |
|
43 | + } else { |
|
47 | 44 | $repl_arr[$key."_".$field_def['name']] = $focus->$field_def['name']; |
48 | 45 | } |
49 | 46 | } // end foreach() |
@@ -59,13 +56,11 @@ discard block |
||
59 | 56 | { |
60 | 57 | $sep = get_number_seperators(); |
61 | 58 | $value=rtrim(rtrim(format_number($value), '0'),$sep[1]);//.$app_strings['LBL_PERCENTAGE_SYMBOL']; |
62 | - } |
|
63 | - else |
|
59 | + } else |
|
64 | 60 | { |
65 | 61 | $value=currency_format_number($value,$params = array('currency_symbol' => false)); |
66 | 62 | } |
67 | - } |
|
68 | - else |
|
63 | + } else |
|
69 | 64 | { |
70 | 65 | $value=''; |
71 | 66 | } |
@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | global $app_strings, $sugar_config; |
31 | 31 | if (preg_match('/^6\./', $sugar_config['sugar_version'])) { |
32 | 32 | $script = '<a href="#" style="width: 150px" class="menuItem" onmouseover="hiliteItem(this,\'yes\');" onmouseout="unhiliteItem(this);" onclick="showPopup()">'.$app_strings['LBL_GENERATE_LETTER'].'</a>'; |
33 | - } |
|
34 | - else{ |
|
33 | + } else{ |
|
35 | 34 | $script = ' <input class="button" type="button" value="'.$app_strings['LBL_GENERATE_LETTER'].'" ' .'onClick="showPopup();">'; |
36 | 35 | } |
37 | 36 | |
@@ -96,8 +95,7 @@ discard block |
||
96 | 95 | } |
97 | 96 | } |
98 | 97 | </script>'; |
99 | - } |
|
100 | - else{ |
|
98 | + } else{ |
|
101 | 99 | echo '<script> |
102 | 100 | function showPopup(){ |
103 | 101 | alert(\''.$app_strings['LBL_NO_TEMPLATE'].'\'); |
@@ -148,8 +146,7 @@ discard block |
||
148 | 146 | } |
149 | 147 | } |
150 | 148 | </script>'; |
151 | - } |
|
152 | - else{ |
|
149 | + } else{ |
|
153 | 150 | echo '<script> |
154 | 151 | function showPopup(){ |
155 | 152 | alert(\''.$app_strings['LBL_NO_TEMPLATE'].'\'); |
@@ -131,17 +131,16 @@ discard block |
||
131 | 131 | $pdf->writeHTML($printable); |
132 | 132 | if($task == 'pdf'){ |
133 | 133 | $pdf->Output($file_name, "D"); |
134 | - }else{ |
|
134 | + } else{ |
|
135 | 135 | $fp = fopen($sugar_config['upload_dir'].'attachfile.pdf','wb'); |
136 | 136 | fclose($fp); |
137 | 137 | $pdf->Output($sugar_config['upload_dir'].'attachfile.pdf','F'); |
138 | 138 | sendEmail::send_email($module,$module_type, '',$file_name, true,$module->id); |
139 | 139 | } |
140 | - }catch(mPDF_exception $e){ |
|
140 | + } catch(mPDF_exception $e){ |
|
141 | 141 | echo $e; |
142 | 142 | } |
143 | - } |
|
144 | - else if($task == 'email') |
|
143 | + } else if($task == 'email') |
|
145 | 144 | { |
146 | 145 | sendEmail::send_email($module,$module_type, $printable,'', false); |
147 | 146 | } |
@@ -222,8 +221,7 @@ discard block |
||
222 | 221 | } |
223 | 222 | $tcount=strpos($parts[1],$endElement)+strlen($endElement); |
224 | 223 | $parts[1]= substr($parts[1],$tcount); |
225 | - } |
|
226 | - else{ |
|
224 | + } else{ |
|
227 | 225 | $tcount = strrpos($text,$startElement); |
228 | 226 | $text = substr($text,0,$tcount); |
229 | 227 | |
@@ -309,8 +307,7 @@ discard block |
||
309 | 307 | //check if there is only one line item |
310 | 308 | if($firstNum == $lastNum){ |
311 | 309 | $linePart = $firstValue; |
312 | - } |
|
313 | - else{ |
|
310 | + } else{ |
|
314 | 311 | $tparts = explode($lastValue,$tparts[1]); |
315 | 312 | $linePart = $firstValue . $tparts[0] . $lastValue; |
316 | 313 | } |
@@ -390,8 +387,7 @@ discard block |
||
390 | 387 | //check if there is only one line item |
391 | 388 | if($firstNum == $lastNum){ |
392 | 389 | $linePart = $firstValue; |
393 | - } |
|
394 | - else{ |
|
390 | + } else{ |
|
395 | 391 | $tparts = explode($lastValue,$tparts[1]); |
396 | 392 | $linePart = $firstValue . $tparts[0] . $lastValue; |
397 | 393 | } |
@@ -44,10 +44,11 @@ |
||
44 | 44 | $email->type = "draft"; |
45 | 45 | $email->status = "draft"; |
46 | 46 | |
47 | - if(!empty($module->billing_contact_id) && $module->billing_contact_id!="") |
|
48 | - $contact_id = $module->billing_contact_id; |
|
49 | - else if(!empty($module->contact_id) && $module->contact_id!="") |
|
50 | - $contact_id = $module->contact_id; |
|
47 | + if(!empty($module->billing_contact_id) && $module->billing_contact_id!="") { |
|
48 | + $contact_id = $module->billing_contact_id; |
|
49 | + } else if(!empty($module->contact_id) && $module->contact_id!="") { |
|
50 | + $contact_id = $module->contact_id; |
|
51 | + } |
|
51 | 52 | |
52 | 53 | require_once('modules/Contacts/Contact.php'); |
53 | 54 | $contact = new Contact; |
@@ -47,7 +47,9 @@ discard block |
||
47 | 47 | } //End loop. |
48 | 48 | |
49 | 49 | foreach($unset as $name){ |
50 | - if(isset($fields[$name])) unset( $fields[$name]); |
|
50 | + if(isset($fields[$name])) { |
|
51 | + unset( $fields[$name]); |
|
52 | + } |
|
51 | 53 | } |
52 | 54 | |
53 | 55 | } |
@@ -124,7 +126,7 @@ discard block |
||
124 | 126 | if(isset($arr['vname']) && $arr['vname'] != '') { |
125 | 127 | $label = $rel_module_label . ' : ' . translate($arr['vname'], $mod->module_dir); |
126 | 128 | $module_label = trim(translate($arr['vname'],$mod->module_dir),':'); |
127 | - }else { |
|
129 | + } else { |
|
128 | 130 | $label = $rel_module_label . ' : '. $name; |
129 | 131 | $module_label = $name; |
130 | 132 | } |
@@ -175,7 +177,9 @@ discard block |
||
175 | 177 | $sort_fields[$name] = $relModuleName.' : '. $name; |
176 | 178 | } |
177 | 179 | if($arr['type'] == 'relate' && isset($arr['id_name']) && $arr['id_name'] != ''){ |
178 | - if(isset($fields[$arr['id_name']])) unset( $fields[$arr['id_name']]); |
|
180 | + if(isset($fields[$arr['id_name']])) { |
|
181 | + unset( $fields[$arr['id_name']]); |
|
182 | + } |
|
179 | 183 | } |
180 | 184 | } |
181 | 185 | } //End loop. |
@@ -269,7 +273,9 @@ discard block |
||
269 | 273 | $vardef['type'] = 'varchar'; |
270 | 274 | } |
271 | 275 | |
272 | - if(isset($vardef['precision'])) unset($vardef['precision']); |
|
276 | + if(isset($vardef['precision'])) { |
|
277 | + unset($vardef['precision']); |
|
278 | + } |
|
273 | 279 | |
274 | 280 | //$vardef['precision'] = $locale->getPrecedentPreference('default_currency_significant_digits', $current_user); |
275 | 281 | |
@@ -308,8 +314,9 @@ discard block |
||
308 | 314 | // remove the special text entry field function 'getEmailAddressWidget' |
309 | 315 | if ( isset($vardef['function']) |
310 | 316 | && ( $vardef['function'] == 'getEmailAddressWidget' |
311 | - || $vardef['function']['name'] == 'getEmailAddressWidget' ) ) |
|
312 | - unset($vardef['function']); |
|
317 | + || $vardef['function']['name'] == 'getEmailAddressWidget' ) ) { |
|
318 | + unset($vardef['function']); |
|
319 | + } |
|
313 | 320 | |
314 | 321 | if(isset($vardef['name']) && ($vardef['name'] == 'date_entered' || $vardef['name'] == 'date_modified')){ |
315 | 322 | $vardef['name'] = 'aow_temp_date'; |
@@ -334,8 +341,9 @@ discard block |
||
334 | 341 | } |
335 | 342 | |
336 | 343 | // hack to disable one of the js calls in this control |
337 | - if ( isset($vardef['function']) && ( $vardef['function'] == 'getCurrencyDropDown' || $vardef['function']['name'] == 'getCurrencyDropDown' ) ) |
|
338 | - $contents .= "{literal}<script>function CurrencyConvertAll() { return; }</script>{/literal}"; |
|
344 | + if ( isset($vardef['function']) && ( $vardef['function'] == 'getCurrencyDropDown' || $vardef['function']['name'] == 'getCurrencyDropDown' ) ) { |
|
345 | + $contents .= "{literal}<script>function CurrencyConvertAll() { return; }</script>{/literal}"; |
|
346 | + } |
|
339 | 347 | |
340 | 348 | // Save it to the cache file |
341 | 349 | if($fh = @sugar_fopen($file, 'w')) { |
@@ -361,8 +369,7 @@ discard block |
||
361 | 369 | $t23 = strpos($time_format, '23') !== false ? '%H' : '%I'; |
362 | 370 | if(!isset($match[2]) || $match[2] == '') { |
363 | 371 | $ss->assign('CALENDAR_FORMAT', $date_format . ' ' . $t23 . $time_separator . "%M"); |
364 | - } |
|
365 | - else { |
|
372 | + } else { |
|
366 | 373 | $pm = $match[2] == "pm" ? "%P" : "%p"; |
367 | 374 | $ss->assign('CALENDAR_FORMAT', $date_format . ' ' . $t23 . $time_separator . "%M" . $pm); |
368 | 375 | } |
@@ -371,8 +378,9 @@ discard block |
||
371 | 378 | |
372 | 379 | // populate the fieldlist from the vardefs |
373 | 380 | $fieldlist = array(); |
374 | - if ( !isset($focus) || !($focus instanceof SugarBean) ) |
|
375 | - require_once($beanFiles[$beanList[$module]]); |
|
381 | + if ( !isset($focus) || !($focus instanceof SugarBean) ) { |
|
382 | + require_once($beanFiles[$beanList[$module]]); |
|
383 | + } |
|
376 | 384 | $focus = new $beanList[$module]; |
377 | 385 | // create the dropdowns for the parent type fields |
378 | 386 | $vardefFields = $focus->getFieldDefinitions(); |
@@ -382,14 +390,17 @@ discard block |
||
382 | 390 | foreach ( $vardefFields as $name => $properties ) { |
383 | 391 | $fieldlist[$name] = $properties; |
384 | 392 | // fill in enums |
385 | - if(isset($fieldlist[$name]['options']) && is_string($fieldlist[$name]['options']) && isset($app_list_strings[$fieldlist[$name]['options']])) |
|
386 | - $fieldlist[$name]['options'] = $app_list_strings[$fieldlist[$name]['options']]; |
|
393 | + if(isset($fieldlist[$name]['options']) && is_string($fieldlist[$name]['options']) && isset($app_list_strings[$fieldlist[$name]['options']])) { |
|
394 | + $fieldlist[$name]['options'] = $app_list_strings[$fieldlist[$name]['options']]; |
|
395 | + } |
|
387 | 396 | // Bug 32626: fall back on checking the mod_strings if not in the app_list_strings |
388 | - elseif(isset($fieldlist[$name]['options']) && is_string($fieldlist[$name]['options']) && isset($mod_strings[$fieldlist[$name]['options']])) |
|
389 | - $fieldlist[$name]['options'] = $mod_strings[$fieldlist[$name]['options']]; |
|
397 | + elseif(isset($fieldlist[$name]['options']) && is_string($fieldlist[$name]['options']) && isset($mod_strings[$fieldlist[$name]['options']])) { |
|
398 | + $fieldlist[$name]['options'] = $mod_strings[$fieldlist[$name]['options']]; |
|
399 | + } |
|
390 | 400 | // Bug 22730: make sure all enums have the ability to select blank as the default value. |
391 | - if(!isset($fieldlist[$name]['options'][''])) |
|
392 | - $fieldlist[$name]['options'][''] = ''; |
|
401 | + if(!isset($fieldlist[$name]['options'][''])) { |
|
402 | + $fieldlist[$name]['options'][''] = ''; |
|
403 | + } |
|
393 | 404 | } |
394 | 405 | |
395 | 406 | // fill in function return values |
@@ -399,8 +410,9 @@ discard block |
||
399 | 410 | { |
400 | 411 | $function = $fieldlist[$fieldname]['function']['name']; |
401 | 412 | // include various functions required in the various vardefs |
402 | - if ( isset($fieldlist[$fieldname]['function']['include']) && is_file($fieldlist[$fieldname]['function']['include'])) |
|
403 | - require_once($fieldlist[$fieldname]['function']['include']); |
|
413 | + if ( isset($fieldlist[$fieldname]['function']['include']) && is_file($fieldlist[$fieldname]['function']['include'])) { |
|
414 | + require_once($fieldlist[$fieldname]['function']['include']); |
|
415 | + } |
|
404 | 416 | $_REQUEST[$fieldname] = $value; |
405 | 417 | $value = $function($focus, $fieldname, $value, $view); |
406 | 418 | |
@@ -456,9 +468,11 @@ discard block |
||
456 | 468 | $value = $focus->convertField($value, $fieldlist[$fieldname]); |
457 | 469 | if(!empty($params['date_format']) && isset($params['date_format'])){ |
458 | 470 | $convert_format = "Y-m-d H:i:s"; |
459 | - if($fieldlist[$fieldname]['type'] == 'date') $convert_format = "Y-m-d"; |
|
471 | + if($fieldlist[$fieldname]['type'] == 'date') { |
|
472 | + $convert_format = "Y-m-d"; |
|
473 | + } |
|
460 | 474 | $fieldlist[$fieldname]['value'] = $timedate->to_display($value, $convert_format, $params['date_format']); |
461 | - }else{ |
|
475 | + } else{ |
|
462 | 476 | $fieldlist[$fieldname]['value'] = $timedate->to_display_date_time($value, true, true); |
463 | 477 | } |
464 | 478 | $fieldlist[$fieldname]['name'] = $aow_field; |
@@ -519,7 +533,9 @@ discard block |
||
519 | 533 | |
520 | 534 | $value = json_decode(html_entity_decode_utf8($value), true); |
521 | 535 | |
522 | - if(!file_exists('modules/AOBH_BusinessHours/AOBH_BusinessHours.php')) unset($app_list_strings['aow_date_type_list']['business_hours']); |
|
536 | + if(!file_exists('modules/AOBH_BusinessHours/AOBH_BusinessHours.php')) { |
|
537 | + unset($app_list_strings['aow_date_type_list']['business_hours']); |
|
538 | + } |
|
523 | 539 | |
524 | 540 | $field = ''; |
525 | 541 | |
@@ -527,11 +543,12 @@ discard block |
||
527 | 543 | $field .= "<select type='text' name='$aow_field".'[0]'."' id='$aow_field".'[0]'."' title='' tabindex='116'>". getDateFields($module, $view, $value[0], $field_option) ."</select> "; |
528 | 544 | $field .= "<select type='text' name='$aow_field".'[1]'."' id='$aow_field".'[1]'."' onchange='date_field_change(\"$aow_field\")' title='' tabindex='116'>". get_select_options_with_id($app_list_strings['aow_date_operator'], $value[1]) ."</select> "; |
529 | 545 | $display = 'none'; |
530 | - if($value[1] == 'plus' || $value[1] == 'minus') $display = ''; |
|
546 | + if($value[1] == 'plus' || $value[1] == 'minus') { |
|
547 | + $display = ''; |
|
548 | + } |
|
531 | 549 | $field .= "<input type='text' style='width:40px; display:$display' name='$aow_field".'[2]'."' id='$aow_field".'[2]'."' title='' value='$value[2]' tabindex='116'> "; |
532 | 550 | $field .= "<select type='text' style='display:$display' name='$aow_field".'[3]'."' id='$aow_field".'[3]'."' title='' tabindex='116'>". get_select_options_with_id($app_list_strings['aow_date_type_list'], $value[3]) ."</select>"; |
533 | - } |
|
534 | - else { |
|
551 | + } else { |
|
535 | 552 | $field = getDateFields($module, $view, $value[0], $field_option).' '.$app_list_strings['aow_date_operator'][$value[1]]; |
536 | 553 | if($value[1] == 'plus' || $value[1] == 'minus'){ |
537 | 554 | $field .= ' '.$value[2].' '.$app_list_strings['aow_date_type_list'][$value[3]]; |
@@ -547,7 +564,9 @@ discard block |
||
547 | 564 | |
548 | 565 | $fields = $app_list_strings['aow_date_options']; |
549 | 566 | |
550 | - if(!$field_option) unset($fields['field']); |
|
567 | + if(!$field_option) { |
|
568 | + unset($fields['field']); |
|
569 | + } |
|
551 | 570 | |
552 | 571 | if ($module != '') { |
553 | 572 | if(isset($beanList[$module]) && $beanList[$module]){ |
@@ -580,8 +599,7 @@ discard block |
||
580 | 599 | |
581 | 600 | if(!file_exists('modules/SecurityGroups/SecurityGroup.php')){ |
582 | 601 | unset($app_list_strings['aow_assign_options']['security_group']); |
583 | - } |
|
584 | - else{ |
|
602 | + } else{ |
|
585 | 603 | $securityGroups = get_bean_select_array(true, 'SecurityGroup','name', '','name',true); |
586 | 604 | } |
587 | 605 | |
@@ -591,17 +609,19 @@ discard block |
||
591 | 609 | $field .= "<select type='text' name='$aow_field".'[0]'."' id='$aow_field".'[0]'."' onchange='assign_field_change(\"$aow_field\")' title='' tabindex='116'>". get_select_options_with_id($app_list_strings['aow_assign_options'], $value[0]) ."</select> "; |
592 | 610 | if(!file_exists('modules/SecurityGroups/SecurityGroup.php')){ |
593 | 611 | $field .= "<input type='hidden' name='$aow_field".'[1]'."' id='$aow_field".'[1]'."' value='' />"; |
594 | - } |
|
595 | - else { |
|
612 | + } else { |
|
596 | 613 | $display = 'none'; |
597 | - if($value[0] == 'security_group') $display = ''; |
|
614 | + if($value[0] == 'security_group') { |
|
615 | + $display = ''; |
|
616 | + } |
|
598 | 617 | $field .= "<select type='text' style='display:$display' name='$aow_field".'[1]'."' id='$aow_field".'[1]'."' title='' tabindex='116'>". get_select_options_with_id($securityGroups, $value[1]) ."</select> "; |
599 | 618 | } |
600 | 619 | $display = 'none'; |
601 | - if($value[0] == 'role' || $value[0] == 'security_group') $display = ''; |
|
620 | + if($value[0] == 'role' || $value[0] == 'security_group') { |
|
621 | + $display = ''; |
|
622 | + } |
|
602 | 623 | $field .= "<select type='text' style='display:$display' name='$aow_field".'[2]'."' id='$aow_field".'[2]'."' title='' tabindex='116'>". get_select_options_with_id($roles, $value[2]) ."</select> "; |
603 | - } |
|
604 | - else { |
|
624 | + } else { |
|
605 | 625 | $field = $app_list_strings['aow_assign_options'][$value[1]]; |
606 | 626 | } |
607 | 627 | return $field; |
@@ -616,8 +636,7 @@ discard block |
||
616 | 636 | $option .= '<option value="'.$key.'" selected>'.$value.'</option>'; |
617 | 637 | } else if($selected_value == $key) { |
618 | 638 | $option .= '<option value="'.$key.'" selected>'.$value.'</option>'; |
619 | - } |
|
620 | - else { |
|
639 | + } else { |
|
621 | 640 | $option .= '<option value="'.$key.'">'.$value.'</option>'; |
622 | 641 | } |
623 | 642 | } |
@@ -644,8 +663,7 @@ discard block |
||
644 | 663 | if(!empty($users[$key])) { |
645 | 664 | return $users[$key]; |
646 | 665 | } |
647 | - } |
|
648 | - else if (is_file($file)){ |
|
666 | + } else if (is_file($file)){ |
|
649 | 667 | require_once($file); |
650 | 668 | if(isset($lastUser['User']) && $lastUser['User'] != '') { |
651 | 669 | $users_by_key = array_flip($users); // now keys are values |
@@ -706,7 +724,9 @@ discard block |
||
706 | 724 | $mod = new $beanList[$module](); |
707 | 725 | |
708 | 726 | foreach($mod->get_related_fields() as $field){ |
709 | - if(isset($field['link'])) $checked_link[] = $field['link']; |
|
727 | + if(isset($field['link'])) { |
|
728 | + $checked_link[] = $field['link']; |
|
729 | + } |
|
710 | 730 | if(!isset($field['module']) || !in_array($field['module'],$emailableModules) || (isset($field['dbType']) && $field['dbType'] == "id")){ |
711 | 731 | continue; |
712 | 732 | } |
@@ -749,7 +769,9 @@ discard block |
||
749 | 769 | switch($bean->field_defs[$field]['type']) { |
750 | 770 | case 'datetime': |
751 | 771 | case 'datetimecombo': |
752 | - if(empty($value)) break; |
|
772 | + if(empty($value)) { |
|
773 | + break; |
|
774 | + } |
|
753 | 775 | if ($value == 'NULL') { |
754 | 776 | $value = ''; |
755 | 777 | break; |
@@ -760,7 +782,9 @@ discard block |
||
760 | 782 | } |
761 | 783 | break; |
762 | 784 | case 'date': |
763 | - if(empty($value)) break; |
|
785 | + if(empty($value)) { |
|
786 | + break; |
|
787 | + } |
|
764 | 788 | if ($value == 'NULL') { |
765 | 789 | $value = ''; |
766 | 790 | break; |
@@ -771,7 +795,9 @@ discard block |
||
771 | 795 | } |
772 | 796 | break; |
773 | 797 | case 'time': |
774 | - if(empty($value)) break; |
|
798 | + if(empty($value)) { |
|
799 | + break; |
|
800 | + } |
|
775 | 801 | if ($value == 'NULL') { |
776 | 802 | $value = ''; |
777 | 803 | break; |
@@ -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. |
@@ -84,7 +86,7 @@ discard block |
||
84 | 86 | } |
85 | 87 | } |
86 | 88 | |
87 | - }else{ |
|
89 | + } else{ |
|
88 | 90 | sugar_die("FAILED TO ADD: $category - TYPE $type NOT DEFINED IN modules/ACLActions/actiondefs.php"); |
89 | 91 | } |
90 | 92 | |
@@ -112,7 +114,7 @@ discard block |
||
112 | 114 | $action->mark_deleted($row['id']); |
113 | 115 | } |
114 | 116 | } |
115 | - }else{ |
|
117 | + } else{ |
|
116 | 118 | sugar_die("FAILED TO REMOVE: $category : $name - TYPE $type NOT DEFINED IN modules/ACLActions/actiondefs.php"); |
117 | 119 | } |
118 | 120 | } |
@@ -180,7 +182,9 @@ discard block |
||
180 | 182 | global $ACLActions; |
181 | 183 | $options = array(); |
182 | 184 | |
183 | - if(empty($ACLActions[$type]['actions'][$action]['aclaccess']))return $options; |
|
185 | + if(empty($ACLActions[$type]['actions'][$action]['aclaccess'])) { |
|
186 | + return $options; |
|
187 | + } |
|
184 | 188 | foreach($ACLActions[$type]['actions'][$action]['aclaccess'] as $action){ |
185 | 189 | $options[$action] = ACLAction::AccessName($action); |
186 | 190 | } |
@@ -231,14 +235,14 @@ discard block |
||
231 | 235 | if(!$refresh && !empty($_SESSION['ACL'][$user_id])){ |
232 | 236 | if(empty($category) && empty($action)){ |
233 | 237 | return $_SESSION['ACL'][$user_id]; |
234 | - }else{ |
|
238 | + } else{ |
|
235 | 239 | if(!empty($category) && isset($_SESSION['ACL'][$user_id][$category])){ |
236 | 240 | if(empty($action)){ |
237 | 241 | if(empty($type)){ |
238 | 242 | return $_SESSION['ACL'][$user_id][$category]; |
239 | 243 | } |
240 | 244 | return $_SESSION['ACL'][$user_id][$category][$type]; |
241 | - }else if(!empty($type) && isset($_SESSION['ACL'][$user_id][$category][$type][$action])){ |
|
245 | + } else if(!empty($type) && isset($_SESSION['ACL'][$user_id][$category][$type][$action])){ |
|
242 | 246 | return $_SESSION['ACL'][$user_id][$category][$type][$action]; |
243 | 247 | } |
244 | 248 | } |
@@ -358,12 +362,12 @@ discard block |
||
358 | 362 | $_SESSION['ACL'] = array(); |
359 | 363 | } |
360 | 364 | $_SESSION['ACL'][$user_id] = $selected_actions; |
361 | - }else{ |
|
365 | + } else{ |
|
362 | 366 | if(empty($action) && !empty($category)){ |
363 | 367 | if(!empty($type)){ |
364 | 368 | $_SESSION['ACL'][$user_id][$category][$type] = $selected_actions[$category][$type];} |
365 | 369 | $_SESSION['ACL'][$user_id][$category] = $selected_actions[$category]; |
366 | - }else{ |
|
370 | + } else{ |
|
367 | 371 | if(!empty($action) && !empty($category) && !empty($type)){ |
368 | 372 | $_SESSION['ACL'][$user_id][$category][$type][$action] = $selected_actions[$category][$action]; |
369 | 373 | |
@@ -382,8 +386,9 @@ discard block |
||
382 | 386 | // Fallback to array key if translation is empty |
383 | 387 | $a = empty($app_list_strings['moduleList'][$a]) ? $a : $app_list_strings['moduleList'][$a]; |
384 | 388 | $b = empty($app_list_strings['moduleList'][$b]) ? $b : $app_list_strings['moduleList'][$b]; |
385 | - if ($a == $b) |
|
386 | - return 0; |
|
389 | + if ($a == $b) { |
|
390 | + return 0; |
|
391 | + } |
|
387 | 392 | return ($a < $b) ? -1 : 1; |
388 | 393 | } |
389 | 394 | |
@@ -478,7 +483,9 @@ discard block |
||
478 | 483 | return true; |
479 | 484 | } |
480 | 485 | //check if we don't have it set in the cache if not lets reload the cache |
481 | - if(ACLAction::getUserAccessLevel($user_id, $category, 'access', $type) < ACL_ALLOW_ENABLED) return false; |
|
486 | + if(ACLAction::getUserAccessLevel($user_id, $category, 'access', $type) < ACL_ALLOW_ENABLED) { |
|
487 | + return false; |
|
488 | + } |
|
482 | 489 | if(empty($_SESSION['ACL'][$user_id][$category][$type][$action])){ |
483 | 490 | ACLAction::getUserActions($user_id, false); |
484 | 491 | |
@@ -574,8 +581,7 @@ discard block |
||
574 | 581 | if($cat_name=='Users'&& $act_name=='admin'){ |
575 | 582 | $categories[$cat_name][$type_name][$act_name]['accessOptions'][ACL_ALLOW_DEFAULT]=ACLAction::AccessName(ACL_ALLOW_DEFAULT);; |
576 | 583 | $categories[$cat_name][$type_name][$act_name]['accessOptions'][ACL_ALLOW_DEV]=ACLAction::AccessName(ACL_ALLOW_DEV);; |
577 | - } |
|
578 | - else{ |
|
584 | + } else{ |
|
579 | 585 | $categories[$cat_name][$type_name][$act_name]['accessOptions'] = ACLAction::getAccessOptions($act_name, $type_name); |
580 | 586 | } |
581 | 587 | } |
@@ -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. |
@@ -62,12 +64,15 @@ discard block |
||
62 | 64 | { |
63 | 65 | global $timedate; |
64 | 66 | |
65 | - if(empty($options['mypbss_date_start'])) |
|
66 | - $options['mypbss_date_start'] = $timedate->nowDbDate(); |
|
67 | - if(empty($options['mypbss_date_end'])) |
|
68 | - $options['mypbss_date_end'] = $timedate->asDbDate($timedate->getNow()->modify("+6 months")); |
|
69 | - if(empty($options['title'])) |
|
70 | - $options['title'] = translate('LBL_MY_PIPELINE_FORM_TITLE', 'Home'); |
|
67 | + if(empty($options['mypbss_date_start'])) { |
|
68 | + $options['mypbss_date_start'] = $timedate->nowDbDate(); |
|
69 | + } |
|
70 | + if(empty($options['mypbss_date_end'])) { |
|
71 | + $options['mypbss_date_end'] = $timedate->asDbDate($timedate->getNow()->modify("+6 months")); |
|
72 | + } |
|
73 | + if(empty($options['title'])) { |
|
74 | + $options['title'] = translate('LBL_MY_PIPELINE_FORM_TITLE', 'Home'); |
|
75 | + } |
|
71 | 76 | |
72 | 77 | parent::__construct($id,$options); |
73 | 78 | } |
@@ -80,11 +85,12 @@ discard block |
||
80 | 85 | global $app_list_strings; |
81 | 86 | |
82 | 87 | $selected_datax = array(); |
83 | - if (count($this->mypbss_sales_stages) > 0) |
|
84 | - foreach ($this->mypbss_sales_stages as $key) |
|
88 | + if (count($this->mypbss_sales_stages) > 0) { |
|
89 | + foreach ($this->mypbss_sales_stages as $key) |
|
85 | 90 | $selected_datax[] = $key; |
86 | - else |
|
87 | - $selected_datax = array_keys($app_list_strings['sales_stage_dom']); |
|
91 | + } else { |
|
92 | + $selected_datax = array_keys($app_list_strings['sales_stage_dom']); |
|
93 | + } |
|
88 | 94 | |
89 | 95 | $this->_searchFields['mypbss_sales_stages']['options'] = $app_list_strings['sales_stage_dom']; |
90 | 96 | $this->_searchFields['mypbss_sales_stages']['input_name0'] = $selected_datax; |
@@ -316,8 +322,7 @@ discard block |
||
316 | 322 | $datax[$key] = $app_list_strings['sales_stage_dom'][$key]; |
317 | 323 | array_push($selected_datax, $key); |
318 | 324 | } |
319 | - } |
|
320 | - else { |
|
325 | + } else { |
|
321 | 326 | $datax = $app_list_strings['sales_stage_dom']; |
322 | 327 | $selected_datax = array_keys($app_list_strings['sales_stage_dom']); |
323 | 328 | } |
@@ -391,8 +396,9 @@ discard block |
||
391 | 396 | " AND opportunities.date_closed >= ". db_convert("'".$this->mypbss_date_start."'",'date'). |
392 | 397 | " AND opportunities.date_closed <= ".db_convert("'".$this->mypbss_date_end."'",'date') . |
393 | 398 | " AND opportunities.assigned_user_id = users.id AND opportunities.deleted=0 "; |
394 | - if ( count($this->mypbss_sales_stages) > 0 ) |
|
395 | - $query .= " AND opportunities.sales_stage IN ('" . implode("','",$this->mypbss_sales_stages) . "') "; |
|
399 | + if ( count($this->mypbss_sales_stages) > 0 ) { |
|
400 | + $query .= " AND opportunities.sales_stage IN ('" . implode("','",$this->mypbss_sales_stages) . "') "; |
|
401 | + } |
|
396 | 402 | $query .= " GROUP BY opportunities.sales_stage ,users.user_name,opportunities.assigned_user_id"; |
397 | 403 | |
398 | 404 | return $query; |