@@ -1,6 +1,8 @@ |
||
1 | 1 | <?php |
2 | - if(!defined('sugarEntry'))define('sugarEntry', true); |
|
3 | -/********************************************************************************* |
|
2 | + if(!defined('sugarEntry')) { |
|
3 | + define('sugarEntry', true); |
|
4 | + } |
|
5 | + /********************************************************************************* |
|
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
6 | 8 |
@@ -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. |
@@ -94,8 +96,7 @@ discard block |
||
94 | 96 | if(!empty($default_modules_sources[$module])){ |
95 | 97 | $merged = array_merge($modules_sources[$module], $default_modules_sources[$module]); |
96 | 98 | $default_modules_sources[$module] = $merged; |
97 | - } |
|
98 | - else{ |
|
99 | + } else{ |
|
99 | 100 | $default_modules_sources[$module] = $modules_sources[$module]; |
100 | 101 | } |
101 | 102 | } |
@@ -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. |
@@ -60,20 +62,20 @@ discard block |
||
60 | 62 | $baseQuery = 'select id,first_name, last_name, title, email1, email2 from prospects where deleted!=1 and ('; |
61 | 63 | if(!empty($_POST[$prefix.'first_name']) && !empty($_POST[$prefix.'last_name'])){ |
62 | 64 | $query = $baseQuery ." (first_name like '". $_POST[$prefix.'first_name'] . "%' and last_name = '". $_POST[$prefix.'last_name'] ."')"; |
63 | - }else{ |
|
65 | + } else{ |
|
64 | 66 | $query = $baseQuery ." last_name = '". $_POST[$prefix.'last_name'] ."'"; |
65 | 67 | } |
66 | 68 | if(!empty($_POST[$prefix.'email1'])){ |
67 | 69 | if(empty($query)){ |
68 | 70 | $query = $baseQuery. " email1='". $_POST[$prefix.'email1'] . "' or email2 = '". $_POST[$prefix.'email1'] ."'"; |
69 | - }else { |
|
71 | + } else { |
|
70 | 72 | $query .= "or email1='". $_POST[$prefix.'email1'] . "' or email2 = '". $_POST[$prefix.'email1'] ."'"; |
71 | 73 | } |
72 | 74 | } |
73 | 75 | if(!empty($_POST[$prefix.'email2'])){ |
74 | 76 | if(empty($query)) { |
75 | 77 | $query = $baseQuery. " email1='". $_POST[$prefix.'email2'] . "' or email2 = '". $_POST[$prefix.'email2'] ."'"; |
76 | - }else{ |
|
78 | + } else{ |
|
77 | 79 | $query .= "or email1='". $_POST[$prefix.'email2'] . "' or email2 = '". $_POST[$prefix.'email2'] ."'"; |
78 | 80 | } |
79 | 81 | |
@@ -87,7 +89,9 @@ discard block |
||
87 | 89 | while($row = $db->fetchByAssoc($result)) { |
88 | 90 | $rows[] = $row; |
89 | 91 | } |
90 | - if(count($rows) > 0) return $rows; |
|
92 | + if(count($rows) > 0) { |
|
93 | + return $rows; |
|
94 | + } |
|
91 | 95 | } |
92 | 96 | return null; |
93 | 97 | } |
@@ -98,15 +102,16 @@ discard block |
||
98 | 102 | if(!empty($mod)){ |
99 | 103 | global $current_language; |
100 | 104 | $mod_strings = return_module_language($current_language, $mod); |
101 | - }else global $mod_strings; |
|
105 | + } else { |
|
106 | + global $mod_strings; |
|
107 | + } |
|
102 | 108 | global $app_strings; |
103 | 109 | $cols = sizeof($rows[0]) * 2 + 1; |
104 | 110 | if ($action != 'ShowDuplicates') |
105 | 111 | { |
106 | 112 | $form = '<table width="100%"><tr><td>'.$mod_strings['MSG_DUPLICATE']. '</td></tr><tr><td height="20"></td></tr></table>'; |
107 | 113 | $form .= "<form action='index.php' method='post' name='dupProspects'><input type='hidden' name='selectedProspect' value=''>"; |
108 | - } |
|
109 | - else |
|
114 | + } else |
|
110 | 115 | { |
111 | 116 | $form = '<table width="100%"><tr><td>'.$mod_strings['MSG_SHOW_DUPLICATES']. '</td></tr><tr><td height="20"></td></tr></table>'; |
112 | 117 | } |
@@ -132,8 +137,9 @@ discard block |
||
132 | 137 | foreach($rows as $row){ |
133 | 138 | |
134 | 139 | $form .= "<tr class='$rowColor'>"; |
135 | - if ($action != 'ShowDuplicates') |
|
136 | - $form .= "<td width='1%' nowrap='nowrap' ><a href='#' onClick=\"document.dupProspects.selectedProspect.value='${row['id']}';document.dupProspects.submit() \">[${app_strings['LBL_SELECT_BUTTON_LABEL']}]</a> </td>\n"; |
|
140 | + if ($action != 'ShowDuplicates') { |
|
141 | + $form .= "<td width='1%' nowrap='nowrap' ><a href='#' onClick=\"document.dupProspects.selectedProspect.value='${row['id']}';document.dupProspects.submit() \">[${app_strings['LBL_SELECT_BUTTON_LABEL']}]</a> </td>\n"; |
|
142 | + } |
|
137 | 143 | |
138 | 144 | $wasSet = false; |
139 | 145 | |
@@ -142,8 +148,7 @@ discard block |
||
142 | 148 | if(!$wasSet) { |
143 | 149 | $form .= "<td scope='row' ><a target='_blank' href='index.php?module=Prospects&action=DetailView&record=${row['id']}'>$value</a></td>\n"; |
144 | 150 | $wasSet = true; |
145 | - } |
|
146 | - else { |
|
151 | + } else { |
|
147 | 152 | $form .= "<td><a target='_blank' href='index.php?module=Prospects&action=DetailView&record=${row['id']}'>$value</a></td>\n"; |
148 | 153 | } |
149 | 154 | } |
@@ -151,7 +156,7 @@ discard block |
||
151 | 156 | |
152 | 157 | if($rowColor == 'evenListRowS1'){ |
153 | 158 | $rowColor = 'oddListRowS1'; |
154 | - }else{ |
|
159 | + } else{ |
|
155 | 160 | $rowColor = 'evenListRowS1'; |
156 | 161 | } |
157 | 162 | $form .= "</tr>"; |
@@ -374,7 +379,9 @@ discard block |
||
374 | 379 | if(!empty($mod)){ |
375 | 380 | global $current_language; |
376 | 381 | $mod_strings = return_module_language($current_language, $mod); |
377 | -}else global $mod_strings; |
|
382 | +} else { |
|
383 | + global $mod_strings; |
|
384 | +} |
|
378 | 385 | global $app_strings; |
379 | 386 | |
380 | 387 | $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE']; |
@@ -423,10 +430,16 @@ discard block |
||
423 | 430 | if(!$focus->ACLAccess('Save')){ |
424 | 431 | return null; |
425 | 432 | } |
426 | - if (!isset($GLOBALS['check_notify'])) $GLOBALS['check_notify']=false; |
|
433 | + if (!isset($GLOBALS['check_notify'])) { |
|
434 | + $GLOBALS['check_notify']=false; |
|
435 | + } |
|
427 | 436 | |
428 | - if (!isset($_POST[$prefix.'email_opt_out'])) $focus->email_opt_out = 0; |
|
429 | - if (!isset($_POST[$prefix.'do_not_call'])) $focus->do_not_call = 0; |
|
437 | + if (!isset($_POST[$prefix.'email_opt_out'])) { |
|
438 | + $focus->email_opt_out = 0; |
|
439 | + } |
|
440 | + if (!isset($_POST[$prefix.'do_not_call'])) { |
|
441 | + $focus->do_not_call = 0; |
|
442 | + } |
|
430 | 443 | |
431 | 444 | if (empty($_POST['record']) && empty($_POST['dup_checked'])) { |
432 | 445 | /* |
@@ -482,15 +495,29 @@ discard block |
||
482 | 495 | $GLOBALS['log']->debug("Saved record with id of ".$return_id); |
483 | 496 | if(isset($_POST['popup']) && $_POST['popup'] == 'true') { |
484 | 497 | $get = '&module='; |
485 | - if(!empty($_POST['return_module'])) $get .= $_POST['return_module']; |
|
486 | - else $get .= 'Prospects'; |
|
498 | + if(!empty($_POST['return_module'])) { |
|
499 | + $get .= $_POST['return_module']; |
|
500 | + } else { |
|
501 | + $get .= 'Prospects'; |
|
502 | + } |
|
487 | 503 | $get .= '&action='; |
488 | - if(!empty($_POST['return_action'])) $get .= $_POST['return_action']; |
|
489 | - else $get .= 'Popup'; |
|
490 | - if(!empty($_POST['return_id'])) $get .= '&return_id='.$_POST['return_id']; |
|
491 | - if(!empty($_POST['popup'])) $get .= '&popup='.$_POST['popup']; |
|
492 | - if(!empty($_POST['create'])) $get .= '&create='.$_POST['create']; |
|
493 | - if(!empty($_POST['to_pdf'])) $get .= '&to_pdf='.$_POST['to_pdf']; |
|
504 | + if(!empty($_POST['return_action'])) { |
|
505 | + $get .= $_POST['return_action']; |
|
506 | + } else { |
|
507 | + $get .= 'Popup'; |
|
508 | + } |
|
509 | + if(!empty($_POST['return_id'])) { |
|
510 | + $get .= '&return_id='.$_POST['return_id']; |
|
511 | + } |
|
512 | + if(!empty($_POST['popup'])) { |
|
513 | + $get .= '&popup='.$_POST['popup']; |
|
514 | + } |
|
515 | + if(!empty($_POST['create'])) { |
|
516 | + $get .= '&create='.$_POST['create']; |
|
517 | + } |
|
518 | + if(!empty($_POST['to_pdf'])) { |
|
519 | + $get .= '&to_pdf='.$_POST['to_pdf']; |
|
520 | + } |
|
494 | 521 | $get .= '&first_name=' . $focus->first_name; |
495 | 522 | $get .= '&last_name=' . $focus->last_name; |
496 | 523 | $get .= '&query=true'; |
@@ -500,7 +527,7 @@ discard block |
||
500 | 527 | if($redirect){ |
501 | 528 | require_once('include/formbase.php'); |
502 | 529 | handleRedirect($return_id, 'Prospects'); |
503 | - }else{ |
|
530 | + } else{ |
|
504 | 531 | return $focus; |
505 | 532 | } |
506 | 533 | } |
@@ -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. |
@@ -48,42 +50,70 @@ discard block |
||
48 | 50 | |
49 | 51 | $overlib_string = ''; |
50 | 52 | |
51 | - if(!empty($fields['ACCOUNT_NAME'])) $overlib_string .= '<b>'. $mod_strings['LBL_EDIT_ACCOUNT_NAME'] . '</b> ' . $fields['ACCOUNT_NAME'] . '<br>'; |
|
53 | + if(!empty($fields['ACCOUNT_NAME'])) { |
|
54 | + $overlib_string .= '<b>'. $mod_strings['LBL_EDIT_ACCOUNT_NAME'] . '</b> ' . $fields['ACCOUNT_NAME'] . '<br>'; |
|
55 | + } |
|
52 | 56 | if(!empty($fields['PRIMARY_ADDRESS_STREET']) || !empty($fields['PRIMARY_ADDRESS_CITY']) || |
53 | 57 | !empty($fields['PRIMARY_ADDRESS_STATE']) || !empty($fields['PRIMARY_ADDRESS_POSTALCODE']) || |
54 | - !empty($fields['PRIMARY_ADDRESS_COUNTRY'])) |
|
55 | - $overlib_string .= '<b>' . $mod_strings['LBL_PRIMARY_ADDRESS'] . '</b><br>'; |
|
56 | - if(!empty($fields['PRIMARY_ADDRESS_STREET'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'] . '<br>'; |
|
57 | - if(!empty($fields['PRIMARY_ADDRESS_STREET_2'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_2'] . '<br>'; |
|
58 | - if(!empty($fields['PRIMARY_ADDRESS_STREET_3'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_3'] . '<br>'; |
|
59 | - if(!empty($fields['PRIMARY_ADDRESS_CITY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'] . ', '; |
|
60 | - if(!empty($fields['PRIMARY_ADDRESS_STATE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'] . ' '; |
|
61 | - if(!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'] . ' '; |
|
62 | - if(!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'] . '<br>'; |
|
63 | - if(strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) |
|
64 | - $overlib_string .= '<br>'; |
|
65 | - if(!empty($fields['PHONE_MOBILE'])) $overlib_string .= '<b>'. $mod_strings['LBL_MOBILE_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_MOBILE'] . '</span><br>'; |
|
66 | - if(!empty($fields['PHONE_HOME'])) $overlib_string .= '<b>'. $mod_strings['LBL_HOME_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_HOME'] . '</span><br>'; |
|
67 | - if(!empty($fields['PHONE_OTHER'])) $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_OTHER'] . '</span><br>'; |
|
58 | + !empty($fields['PRIMARY_ADDRESS_COUNTRY'])) { |
|
59 | + $overlib_string .= '<b>' . $mod_strings['LBL_PRIMARY_ADDRESS'] . '</b><br>'; |
|
60 | + } |
|
61 | + if(!empty($fields['PRIMARY_ADDRESS_STREET'])) { |
|
62 | + $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'] . '<br>'; |
|
63 | + } |
|
64 | + if(!empty($fields['PRIMARY_ADDRESS_STREET_2'])) { |
|
65 | + $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_2'] . '<br>'; |
|
66 | + } |
|
67 | + if(!empty($fields['PRIMARY_ADDRESS_STREET_3'])) { |
|
68 | + $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_3'] . '<br>'; |
|
69 | + } |
|
70 | + if(!empty($fields['PRIMARY_ADDRESS_CITY'])) { |
|
71 | + $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'] . ', '; |
|
72 | + } |
|
73 | + if(!empty($fields['PRIMARY_ADDRESS_STATE'])) { |
|
74 | + $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'] . ' '; |
|
75 | + } |
|
76 | + if(!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) { |
|
77 | + $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'] . ' '; |
|
78 | + } |
|
79 | + if(!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) { |
|
80 | + $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'] . '<br>'; |
|
81 | + } |
|
82 | + if(strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) { |
|
83 | + $overlib_string .= '<br>'; |
|
84 | + } |
|
85 | + if(!empty($fields['PHONE_MOBILE'])) { |
|
86 | + $overlib_string .= '<b>'. $mod_strings['LBL_MOBILE_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_MOBILE'] . '</span><br>'; |
|
87 | + } |
|
88 | + if(!empty($fields['PHONE_HOME'])) { |
|
89 | + $overlib_string .= '<b>'. $mod_strings['LBL_HOME_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_HOME'] . '</span><br>'; |
|
90 | + } |
|
91 | + if(!empty($fields['PHONE_OTHER'])) { |
|
92 | + $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_OTHER'] . '</span><br>'; |
|
93 | + } |
|
68 | 94 | |
69 | - if(!empty($fields['EMAIL1'])) |
|
70 | - $overlib_string .= '<b>'. $mod_strings['LBL_EMAIL_ADDRESS'] . '</b> ' . |
|
95 | + if(!empty($fields['EMAIL1'])) { |
|
96 | + $overlib_string .= '<b>'. $mod_strings['LBL_EMAIL_ADDRESS'] . '</b> ' . |
|
71 | 97 | "<a href=index.php?module=Emails&action=Compose&contact_id={$fields['ID']}&" . |
72 | 98 | "parent_type=Contacts&parent_id={$fields['ID']}&to_addrs_ids={$fields['ID']}&to_addrs_names" . |
73 | 99 | "={$fields['FIRST_NAME']} {$fields['LAST_NAME']}&to_addrs_emails={$fields['EMAIL1']}&" . |
74 | 100 | "to_email_addrs=" . urlencode("{$fields['FIRST_NAME']} {$fields['LAST_NAME']} <{$fields['EMAIL1']}>") . |
75 | 101 | "&return_module=Contacts&return_action=ListView'>{$fields['EMAIL1']}</a><br>"; |
76 | - if(!empty($fields['EMAIL2'])) |
|
77 | - $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_EMAIL_ADDRESS'] . '</b> ' . |
|
102 | + } |
|
103 | + if(!empty($fields['EMAIL2'])) { |
|
104 | + $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_EMAIL_ADDRESS'] . '</b> ' . |
|
78 | 105 | "<a href=index.php?module=Emails&action=Compose&contact_id={$fields['ID']}&" . |
79 | 106 | "parent_type=Contacts&parent_id={$fields['ID']}&to_addrs_ids={$fields['ID']}&to_addrs_names" . |
80 | 107 | "={$fields['FIRST_NAME']} {$fields['LAST_NAME']}&to_addrs_emails={$fields['EMAIL2']}&" . |
81 | 108 | "to_email_addrs=" . urlencode("{$fields['FIRST_NAME']} {$fields['LAST_NAME']} <{$fields['EMAIL2']}>") . |
82 | 109 | "&return_module=Contacts&return_action=ListView'>{$fields['EMAIL2']}</a><br>"; |
110 | + } |
|
83 | 111 | |
84 | 112 | if(!empty($fields['DESCRIPTION'])) { |
85 | 113 | $overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300); |
86 | - if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...'; |
|
114 | + if(strlen($fields['DESCRIPTION']) > 300) { |
|
115 | + $overlib_string .= '...'; |
|
116 | + } |
|
87 | 117 | } |
88 | 118 | |
89 | 119 | return array('fieldToAddTo' => 'FULL_NAME', |
@@ -1,6 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | 3 | die('Not A Valid Entry Point'); |
4 | +} |
|
4 | 5 | /********************************************************************************* |
5 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
6 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -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. |
@@ -108,8 +110,10 @@ discard block |
||
108 | 110 | $currency->retrieve($focus->currency_id); |
109 | 111 | if( $currency->deleted != 1){ |
110 | 112 | $xtpl->assign("CURRENCY", $currency->iso4217 .' '.$currency->symbol ); |
111 | - }else $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() ); |
|
112 | -}else{ |
|
113 | + } else { |
|
114 | + $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() ); |
|
115 | + } |
|
116 | + } else{ |
|
113 | 117 | |
114 | 118 | $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() ); |
115 | 119 | |
@@ -185,7 +189,7 @@ discard block |
||
185 | 189 | if(!empty($selected_marketing_id)){$latest_marketing_id = $selected_marketing_id;} |
186 | 190 | if(empty($latest_marketing_id) || $latest_marketing_id === 'all'){ |
187 | 191 | $xtpl->assign("MY_CHART_ROI", $chart->campaign_response_roi_popup($app_list_strings['roi_type_dom'],$app_list_strings['roi_type_dom'],$campaign_id,sugar_cached("xml/") . $cache_file_name_roi,true)); |
188 | - }else{ |
|
192 | + } else{ |
|
189 | 193 | |
190 | 194 | $xtpl->assign("MY_CHART_ROI", $chart->campaign_response_roi_popup($app_list_strings['roi_type_dom'],$app_list_strings['roi_type_dom'],$campaign_id,sugar_cached("xml/") .$cache_file_name_roi,true)); |
191 | 195 | } |
@@ -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. |
@@ -55,7 +57,9 @@ discard block |
||
55 | 57 | global $mod_strings,$app_list_strings,$app_strings,$current_user; |
56 | 58 | |
57 | 59 | |
58 | -if (!is_admin($current_user)&& !is_admin_for_module($GLOBALS['current_user'],'Campaigns')) sugar_die("Unauthorized access to administration."); |
|
60 | +if (!is_admin($current_user)&& !is_admin_for_module($GLOBALS['current_user'],'Campaigns')) { |
|
61 | + sugar_die("Unauthorized access to administration."); |
|
62 | +} |
|
59 | 63 | |
60 | 64 | $params = array(); |
61 | 65 | $params[] = "<a href='index.php?module=Campaigns&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>"; |
@@ -78,9 +82,15 @@ discard block |
||
78 | 82 | $ss = new Sugar_Smarty(); |
79 | 83 | $ss->assign("MOD", $mod_strings); |
80 | 84 | $ss->assign("APP", $app_strings); |
81 | -if (isset($_REQUEST['return_module'])) $ss->assign("RETURN_MODULE", $_REQUEST['return_module']); |
|
82 | -if (isset($_REQUEST['return_action'])) $ss->assign("RETURN_ACTION", $_REQUEST['return_action']); |
|
83 | -if (isset($_REQUEST['return_id'])) $ss->assign("RETURN_ID", $_REQUEST['return_id']); |
|
85 | +if (isset($_REQUEST['return_module'])) { |
|
86 | + $ss->assign("RETURN_MODULE", $_REQUEST['return_module']); |
|
87 | +} |
|
88 | +if (isset($_REQUEST['return_action'])) { |
|
89 | + $ss->assign("RETURN_ACTION", $_REQUEST['return_action']); |
|
90 | +} |
|
91 | +if (isset($_REQUEST['return_id'])) { |
|
92 | + $ss->assign("RETURN_ID", $_REQUEST['return_id']); |
|
93 | +} |
|
84 | 94 | |
85 | 95 | |
86 | 96 | |
@@ -146,7 +156,7 @@ discard block |
||
146 | 156 | |
147 | 157 | if( $colorclass == "class='evenListRowS1'"){ |
148 | 158 | $colorclass= "class='oddListRowS1'"; |
149 | - }else{ |
|
159 | + } else{ |
|
150 | 160 | $colorclass= "class='evenListRowS1'"; |
151 | 161 | } |
152 | 162 | |
@@ -159,7 +169,7 @@ discard block |
||
159 | 169 | } |
160 | 170 | |
161 | 171 | |
162 | -}else{ |
|
172 | +} else{ |
|
163 | 173 | $need_mbox = 'checked'; |
164 | 174 | $mboxTable .= "<tr><td colspan='5'><b>".$mod_strings['LBL_MAILBOX_CHECK_WIZ_BAD']." </b>.</td></tr>"; |
165 | 175 | } |
@@ -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. |
@@ -55,8 +57,9 @@ discard block |
||
55 | 57 | $contents = ""; |
56 | 58 | $query = "SELECT description FROM notes WHERE file_mime_type = 'messsage/rfc822' AND parent_type='Emails' AND parent_id = '".$email->id."' AND deleted=0"; |
57 | 59 | $rs = $GLOBALS['db']->query($query); |
58 | - while ($row = $GLOBALS['db']->fetchByAssoc($rs)) |
|
59 | - $contents .= $row['description']; |
|
60 | + while ($row = $GLOBALS['db']->fetchByAssoc($rs)) { |
|
61 | + $contents .= $row['description']; |
|
62 | + } |
|
60 | 63 | |
61 | 64 | return $contents; |
62 | 65 | } |
@@ -89,9 +92,9 @@ discard block |
||
89 | 92 | { |
90 | 93 | $bounce->activity_type='invalid email'; |
91 | 94 | markEmailAddressInvalid($email); |
95 | + } else { |
|
96 | + $bounce->activity_type='send error'; |
|
92 | 97 | } |
93 | - else |
|
94 | - $bounce->activity_type='send error'; |
|
95 | 98 | |
96 | 99 | $return_id=$bounce->save(); |
97 | 100 | return $return_id; |
@@ -104,8 +107,9 @@ discard block |
||
104 | 107 | */ |
105 | 108 | function markEmailAddressInvalid($email_address) |
106 | 109 | { |
107 | - if(empty($email_address)) |
|
108 | - return; |
|
110 | + if(empty($email_address)) { |
|
111 | + return; |
|
112 | + } |
|
109 | 113 | $sea = new SugarEmailAddress(); |
110 | 114 | $rs = $sea->retrieve_by_string_fields( array('email_address_caps' => trim(strtoupper($email_address))) ); |
111 | 115 | if($rs != null) |
@@ -149,8 +153,7 @@ discard block |
||
149 | 153 | $identifiers = preg_split('/X-CampTrackID: /',$matches[0],-1,PREG_SPLIT_NO_EMPTY); |
150 | 154 | $found = TRUE; |
151 | 155 | $GLOBALS['log']->debug("Found campaign identifier in header of email"); |
152 | - } |
|
153 | - else if( preg_match('/index.php\?entryPoint=removeme&identifier=[a-z0-9\-]*/',$email_description, $matches) ) |
|
156 | + } else if( preg_match('/index.php\?entryPoint=removeme&identifier=[a-z0-9\-]*/',$email_description, $matches) ) |
|
154 | 157 | { |
155 | 158 | $identifiers = preg_split('/index.php\?entryPoint=removeme&identifier=/',$matches[0],-1,PREG_SPLIT_NO_EMPTY); |
156 | 159 | $found = TRUE; |
@@ -207,32 +210,27 @@ discard block |
||
207 | 210 | { |
208 | 211 | $return_id = createBouncedCampaignLogEntry($row, $email, $email_description); |
209 | 212 | return TRUE; |
210 | - } |
|
211 | - else |
|
213 | + } else |
|
212 | 214 | { |
213 | 215 | $GLOBALS['log']->debug("Warning: campaign log entry already exists for identifier $identifier"); |
214 | 216 | return FALSE; |
215 | 217 | } |
216 | - } |
|
217 | - else |
|
218 | + } else |
|
218 | 219 | { |
219 | 220 | $GLOBALS['log']->info("Warning: skipping bounced email with this tracker_key(identifier) in the message body: ".$identifier); |
220 | 221 | return FALSE; |
221 | 222 | } |
222 | - } |
|
223 | - else |
|
223 | + } else |
|
224 | 224 | { |
225 | 225 | $GLOBALS['log']->info("Warning: Empty identifier for campaign log."); |
226 | 226 | return FALSE; |
227 | 227 | } |
228 | - } |
|
229 | - else |
|
228 | + } else |
|
230 | 229 | { |
231 | 230 | $GLOBALS['log']->info("Warning: skipping bounced email because it does not have the removeme link."); |
232 | 231 | return FALSE; |
233 | 232 | } |
234 | - } |
|
235 | - else |
|
233 | + } else |
|
236 | 234 | { |
237 | 235 | $GLOBALS['log']->info("Warning: skipping bounced email because the sender is not MAILER-DAEMON."); |
238 | 236 | 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. |
@@ -76,14 +78,20 @@ discard block |
||
76 | 78 | { |
77 | 79 | |
78 | 80 | } |
79 | -}else{ |
|
81 | +} else{ |
|
80 | 82 | //use html if not inline |
81 | 83 | $ss = new Sugar_Smarty(); |
82 | 84 | $ss->assign("MOD", $mod_strings); |
83 | 85 | $ss->assign("APP", $app_strings); |
84 | - if (isset($_REQUEST['return_module'])) $ss->assign("RETURN_MODULE", $_REQUEST['return_module']); |
|
85 | - if (isset($_REQUEST['return_action'])) $ss->assign("RETURN_ACTION", $_REQUEST['return_action']); |
|
86 | - if (isset($_REQUEST['return_id'])) $ss->assign("RETURN_ID", $_REQUEST['return_id']); |
|
86 | + if (isset($_REQUEST['return_module'])) { |
|
87 | + $ss->assign("RETURN_MODULE", $_REQUEST['return_module']); |
|
88 | + } |
|
89 | + if (isset($_REQUEST['return_action'])) { |
|
90 | + $ss->assign("RETURN_ACTION", $_REQUEST['return_action']); |
|
91 | + } |
|
92 | + if (isset($_REQUEST['return_id'])) { |
|
93 | + $ss->assign("RETURN_ID", $_REQUEST['return_id']); |
|
94 | + } |
|
87 | 95 | // handle Create $module then Cancel |
88 | 96 | if (empty($_REQUEST['return_id'])) { |
89 | 97 | $ss->assign("RETURN_ACTION", 'index'); |
@@ -123,7 +131,7 @@ discard block |
||
123 | 131 | $mboxTable .= "<td>".$details['status']."</td></tr>"; |
124 | 132 | } |
125 | 133 | |
126 | -}else{ |
|
134 | +} else{ |
|
127 | 135 | //if array is empty, then set "bad" message and increment health counter |
128 | 136 | $mboxTable .= "<tr><td colspan='5'><b class='error'>". $mod_strings['LBL_MAILBOX_CHECK1_BAD']."</b></td></tr>"; |
129 | 137 | $email_health =$email_health +1; |
@@ -141,7 +149,7 @@ discard block |
||
141 | 149 | //if from address is the default, then set "bad" message and increment health counter |
142 | 150 | $conf_msg .= "<tr><td colspan = '5'><b class='error'> ".$mod_strings['LBL_MAILBOX_CHECK2_BAD']." </b></td></td>"; |
143 | 151 | $email_health =$email_health +1; |
144 | -}else{ |
|
152 | +} else{ |
|
145 | 153 | $conf_msg .= "<tr><td colspan = '5'><b> ".$mod_strings['LBL_MAILBOX_CHECK2_GOOD']."</b></td></tr>"; |
146 | 154 | $conf_msg .= "<tr><th scope='col' width='20%'><b>".$mod_strings['LBL_WIZ_FROM_NAME']."</b></th>" |
147 | 155 | . " <th scope='col' width='20%'><b>".$mod_strings['LBL_WIZ_FROM_ADDRESS']."</b></th>" |
@@ -150,7 +158,7 @@ discard block |
||
150 | 158 | $conf_msg .= " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SMTPSERVER']."</b></th>" |
151 | 159 | . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SMTPUSER']."</b></th></tr>"; |
152 | 160 | |
153 | - }else{$conf_msg .= "</tr>";} |
|
161 | + } else{$conf_msg .= "</tr>";} |
|
154 | 162 | |
155 | 163 | |
156 | 164 | |
@@ -161,7 +169,7 @@ discard block |
||
161 | 169 | $conf_msg .= "<td>".$focus->settings['mail_smtpserver']."</td>"; |
162 | 170 | $conf_msg .= "<td>".$focus->settings['mail_smtpuser']."</td></tr>"; |
163 | 171 | |
164 | - }else{$conf_msg .= "</tr>";} |
|
172 | + } else{$conf_msg .= "</tr>";} |
|
165 | 173 | |
166 | 174 | } |
167 | 175 | |
@@ -171,7 +179,7 @@ discard block |
||
171 | 179 | if ($email_health>0){ |
172 | 180 | if (is_admin($current_user)){ |
173 | 181 | $email_setup_wiz_link="<a href='index.php?module=Campaigns&action=WizardEmailSetup'>".$mod_strings['LBL_EMAIL_SETUP_WIZ']."</a>"; |
174 | - }else{ |
|
182 | + } else{ |
|
175 | 183 | $email_setup_wiz_link=$mod_strings['LBL_NON_ADMIN_ERROR_MSG']; |
176 | 184 | } |
177 | 185 | } |
@@ -204,7 +212,7 @@ discard block |
||
204 | 212 | $sched_mes_body .= "<td style='text-align: left;'>".$funct['status']."</td></tr>"; |
205 | 213 | if($funct['job']==$check_sched1){ |
206 | 214 | $check_sched1 ="found"; |
207 | - }else{ |
|
215 | + } else{ |
|
208 | 216 | $check_sched2 ="found"; |
209 | 217 | } |
210 | 218 | |
@@ -218,7 +226,7 @@ discard block |
||
218 | 226 | $sched_mes .= "<tr><th scope='col' width='40%'><b>".$mod_strings['LBL_SCHEDULER_NAME']."</b></tH>" |
219 | 227 | . " <th scope='col' width='60%'><b>".$mod_strings['LBL_SCHEDULER_STATUS']."</b></tH></tr>"; |
220 | 228 | |
221 | -}else{ |
|
229 | +} else{ |
|
222 | 230 | $sched_mes = "<table class='other view' cellspacing='1'>"; |
223 | 231 | $sched_mes .= "<tr><td colspan ='3'><font color='red'><b> ".$mod_strings['LBL_SCHEDULER_CHECK_BAD']."</b></font></td></tr>"; |
224 | 232 | $show_admin_link = true; |
@@ -237,7 +245,7 @@ discard block |
||
237 | 245 | if ($sched_health>0){ |
238 | 246 | if (is_admin($current_user)){ |
239 | 247 | $admin_sched_link="<a href='index.php?module=Schedulers&action=index'>".$mod_strings['LBL_SCHEDULER_LINK']."</a>"; |
240 | - }else{ |
|
248 | + } else{ |
|
241 | 249 | $admin_sched_link=$mod_strings['LBL_NON_ADMIN_ERROR_MSG']; |
242 | 250 | } |
243 | 251 | } |
@@ -269,13 +277,13 @@ discard block |
||
269 | 277 | return SugarThemeRegistry::current()->getImage('red_camp', "align='absmiddle'", null, null, ".gif", $mod_strings['LBL_INVALID']); |
270 | 278 | |
271 | 279 | |
272 | - }elseif($num == 0){ |
|
280 | + } elseif($num == 0){ |
|
273 | 281 | //if health number is zero, then all checks passed, set green image |
274 | 282 | //green |
275 | 283 | return SugarThemeRegistry::current()->getImage('green_camp', "align='absmiddle'", null, null, ".gif", $mod_strings['LBL_VALID']); |
276 | 284 | |
277 | 285 | |
278 | - }else{ |
|
286 | + } else{ |
|
279 | 287 | //if health number is between total and num params, then some checks failed but not all, set yellow image |
280 | 288 | //yellow |
281 | 289 | return SugarThemeRegistry::current()->getImage('yellow_camp', "align='absmiddle'", null, null, ".gif", $mod_strings['LBL_ALERT']); |