@@ -49,39 +49,39 @@ |
||
49 | 49 | array('label' => '10', 'field' => '30') |
50 | 50 | ), |
51 | 51 | 'includes' => |
52 | - array ( |
|
52 | + array( |
|
53 | 53 | array('file' => 'include/javascript/popup_parent_helper.js'), |
54 | 54 | array('file' => 'cache/include/javascript/sugar_grp_jsolait.js'), |
55 | 55 | array('file' => 'modules/Documents/documents.js'), |
56 | 56 | ), |
57 | 57 | ), |
58 | - 'panels' =>array ( |
|
58 | + 'panels' =>array( |
|
59 | 59 | 'default' => |
60 | - array ( |
|
60 | + array( |
|
61 | 61 | |
62 | - array ( |
|
62 | + array( |
|
63 | 63 | 'status_id', |
64 | 64 | ), |
65 | - array ( |
|
65 | + array( |
|
66 | 66 | array('name'=>'filename', |
67 | 67 | 'displayParams'=>array('required'=>true, 'onchangeSetFileNameTo' => 'document_name'), |
68 | 68 | ), |
69 | 69 | ), |
70 | 70 | |
71 | - array ( |
|
71 | + array( |
|
72 | 72 | 'document_name', |
73 | 73 | array('name'=>'revision', |
74 | 74 | 'customCode' => '<input name="revision" type="text" value="{$fields.revision.value}" {$DISABLED}>' |
75 | 75 | ), |
76 | 76 | ), |
77 | 77 | |
78 | - array ( |
|
79 | - array('name'=>'active_date','displayParams'=>array('required'=>true)), |
|
78 | + array( |
|
79 | + array('name'=>'active_date', 'displayParams'=>array('required'=>true)), |
|
80 | 80 | 'category_id', |
81 | 81 | ), |
82 | 82 | |
83 | 83 | |
84 | - array ( |
|
84 | + array( |
|
85 | 85 | array('name'=>'description', 'displayParams'=>array('rows'=>10, 'cols'=>120)), |
86 | 86 | ), |
87 | 87 | ), |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | $listViewDefs['Documents'] = array( |
45 | 45 | 'DOCUMENT_NAME' => |
46 | - array ( |
|
46 | + array( |
|
47 | 47 | 'width' => '20%', |
48 | 48 | 'label' => 'LBL_NAME', |
49 | 49 | 'link' => true, |
@@ -51,16 +51,16 @@ discard block |
||
51 | 51 | 'bold' => true, |
52 | 52 | ), |
53 | 53 | 'FILENAME' => |
54 | - array ( |
|
54 | + array( |
|
55 | 55 | 'width' => '20%', |
56 | 56 | 'label' => 'LBL_FILENAME', |
57 | 57 | 'link' => true, |
58 | 58 | 'default' => true, |
59 | 59 | 'bold' => false, |
60 | - 'displayParams' => array ( 'module' => 'Documents', ), |
|
60 | + 'displayParams' => array('module' => 'Documents',), |
|
61 | 61 | 'sortable' => false, |
62 | 62 | 'related_fields' => |
63 | - array ( |
|
63 | + array( |
|
64 | 64 | 0 => 'document_revision_id', |
65 | 65 | 1 => 'doc_id', |
66 | 66 | 2 => 'doc_type', |
@@ -68,30 +68,30 @@ discard block |
||
68 | 68 | ), |
69 | 69 | ), |
70 | 70 | 'CATEGORY_ID' => |
71 | - array ( |
|
71 | + array( |
|
72 | 72 | 'width' => '10%', |
73 | 73 | 'label' => 'LBL_LIST_CATEGORY', |
74 | 74 | 'default' => true, |
75 | 75 | ), |
76 | 76 | 'SUBCATEGORY_ID' => |
77 | - array ( |
|
77 | + array( |
|
78 | 78 | 'width' => '15%', |
79 | 79 | 'label' => 'LBL_LIST_SUBCATEGORY', |
80 | 80 | 'default' => true, |
81 | 81 | ), |
82 | 82 | 'LAST_REV_CREATE_DATE' => |
83 | - array ( |
|
83 | + array( |
|
84 | 84 | 'width' => '10%', |
85 | 85 | 'label' => 'LBL_LIST_LAST_REV_DATE', |
86 | 86 | 'default' => true, |
87 | 87 | 'sortable' => false, |
88 | 88 | 'related_fields' => |
89 | - array ( |
|
89 | + array( |
|
90 | 90 | 0 => 'document_revision_id', |
91 | 91 | ), |
92 | 92 | ), |
93 | 93 | 'EXP_DATE' => |
94 | - array ( |
|
94 | + array( |
|
95 | 95 | 'width' => '10%', |
96 | 96 | 'label' => 'LBL_LIST_EXP_DATE', |
97 | 97 | 'default' => true, |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | 'id' => 'ASSIGNED_USER_ID', |
105 | 105 | 'default' => true), |
106 | 106 | 'MODIFIED_BY_NAME' => |
107 | - array ( |
|
107 | + array( |
|
108 | 108 | 'width' => '10%', |
109 | 109 | 'label' => 'LBL_MODIFIED_USER', |
110 | 110 | 'module' => 'Users', |
@@ -112,11 +112,11 @@ discard block |
||
112 | 112 | 'default' => false, |
113 | 113 | 'sortable' => false, |
114 | 114 | 'related_fields' => |
115 | - array ( |
|
115 | + array( |
|
116 | 116 | 0 => 'modified_user_id', |
117 | 117 | ), |
118 | 118 | ), |
119 | - 'DATE_ENTERED' => array ( |
|
119 | + 'DATE_ENTERED' => array( |
|
120 | 120 | 'width' => '10%', |
121 | 121 | 'label' => 'LBL_DATE_ENTERED', |
122 | 122 | 'default' => true, |
@@ -37,20 +37,20 @@ |
||
37 | 37 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
38 | 38 | ********************************************************************************/ |
39 | 39 | |
40 | -require_once 'modules/ModuleBuilder/Module/StudioModule.php' ; |
|
40 | +require_once 'modules/ModuleBuilder/Module/StudioModule.php'; |
|
41 | 41 | |
42 | 42 | class EmployeesStudioModule extends StudioModule { |
43 | - function getProvidedSubpanels () |
|
43 | + function getProvidedSubpanels() |
|
44 | 44 | { |
45 | 45 | // Much like pointy haired bosses, other modules should not be able to relate to Employees. |
46 | 46 | return false; |
47 | 47 | } |
48 | 48 | |
49 | - function getModule () |
|
49 | + function getModule() |
|
50 | 50 | { |
51 | 51 | $normalModules = parent::getModule(); |
52 | 52 | |
53 | - if(isset($normalModules[translate('LBL_RELATIONSHIPS')])) { |
|
53 | + if (isset($normalModules[translate('LBL_RELATIONSHIPS')])) { |
|
54 | 54 | unset($normalModules[translate('LBL_RELATIONSHIPS')]); |
55 | 55 | } |
56 | 56 |
@@ -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,7 +45,7 @@ discard block |
||
45 | 45 | /** |
46 | 46 | * This builds an EmployeesSearchForm from a classic search form. |
47 | 47 | */ |
48 | - function __construct( SearchForm $oldSearchForm ) { |
|
48 | + function __construct(SearchForm $oldSearchForm) { |
|
49 | 49 | parent::SearchForm($oldSearchForm->seed, $oldSearchForm->module, $oldSearchForm->action); |
50 | 50 | $this->setup( |
51 | 51 | // $searchdefs |
@@ -66,14 +66,14 @@ discard block |
||
66 | 66 | public function generateSearchWhere($add_custom_fields = false, $module = '') { |
67 | 67 | $onlyActive = false; |
68 | 68 | if (isset($this->searchFields['open_only_active_users']['value'])) { |
69 | - if ( $this->searchFields['open_only_active_users']['value'] == 1) { |
|
69 | + if ($this->searchFields['open_only_active_users']['value'] == 1) { |
|
70 | 70 | $onlyActive = true; |
71 | 71 | } |
72 | 72 | unset($this->searchFields['open_only_active_users']['value']); |
73 | 73 | } |
74 | 74 | $where_clauses = parent::generateSearchWhere($add_custom_fields, $module); |
75 | 75 | |
76 | - if ( $onlyActive ) { |
|
76 | + if ($onlyActive) { |
|
77 | 77 | $where_clauses[] = "users.employee_status = 'Active'"; |
78 | 78 | } |
79 | 79 |
@@ -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. |
@@ -65,60 +65,60 @@ discard block |
||
65 | 65 | |
66 | 66 | $GLOBALS['log']->info("Campaign detail view"); |
67 | 67 | |
68 | -$xtpl=new XTemplate ('modules/Campaigns/PopupCampaignRoi.html'); |
|
68 | +$xtpl = new XTemplate('modules/Campaigns/PopupCampaignRoi.html'); |
|
69 | 69 | |
70 | 70 | //_pp($_REQUEST['id']); |
71 | -$campaign_id=$_REQUEST['id']; |
|
71 | +$campaign_id = $_REQUEST['id']; |
|
72 | 72 | $campaign = new Campaign(); |
73 | -$opp_query1 = "select camp.name, camp.actual_cost,camp.budget,camp.expected_revenue,count(*) opp_count,SUM(opp.amount) as Revenue, SUM(camp.actual_cost) as Investment, |
|
73 | +$opp_query1 = "select camp.name, camp.actual_cost,camp.budget,camp.expected_revenue,count(*) opp_count,SUM(opp.amount) as Revenue, SUM(camp.actual_cost) as Investment, |
|
74 | 74 | ROUND((SUM(opp.amount) - SUM(camp.actual_cost))/(SUM(camp.actual_cost)), 2)*100 as ROI"; |
75 | 75 | $opp_query1 .= " from opportunities opp"; |
76 | 76 | $opp_query1 .= " right join campaigns camp on camp.id = opp.campaign_id"; |
77 | 77 | $opp_query1 .= " where opp.sales_stage = 'Closed Won' and camp.id='$campaign_id'"; |
78 | 78 | $opp_query1 .= " group by camp.name"; |
79 | 79 | //$opp_query1 .= " and deleted=0"; |
80 | - $opp_result1=$campaign->db->query($opp_query1); |
|
81 | - $opp_data1=$campaign->db->fetchByAssoc($opp_result1); |
|
80 | + $opp_result1 = $campaign->db->query($opp_query1); |
|
81 | + $opp_data1 = $campaign->db->fetchByAssoc($opp_result1); |
|
82 | 82 | //get the click-throughs |
83 | 83 | $query_click = "SELECT count(*) hits "; |
84 | - $query_click.= " FROM campaign_log "; |
|
85 | - $query_click.= " WHERE campaign_id = '$campaign_id' AND activity_type='link' AND related_type='CampaignTrackers' AND archived=0 AND deleted=0"; |
|
84 | + $query_click .= " FROM campaign_log "; |
|
85 | + $query_click .= " WHERE campaign_id = '$campaign_id' AND activity_type='link' AND related_type='CampaignTrackers' AND archived=0 AND deleted=0"; |
|
86 | 86 | |
87 | 87 | //if $marketing id is specified, then lets filter the chart by the value |
88 | - if (!empty($marketing_id)){ |
|
89 | - $query_click.= " AND marketing_id ='$marketing_id'"; |
|
88 | + if (!empty($marketing_id)) { |
|
89 | + $query_click .= " AND marketing_id ='$marketing_id'"; |
|
90 | 90 | } |
91 | 91 | |
92 | - $query_click.= " GROUP BY activity_type, target_type"; |
|
93 | - $query_click.= " ORDER BY activity_type, target_type"; |
|
92 | + $query_click .= " GROUP BY activity_type, target_type"; |
|
93 | + $query_click .= " ORDER BY activity_type, target_type"; |
|
94 | 94 | $result = $campaign->db->query($query_click); |
95 | 95 | |
96 | 96 | |
97 | 97 | $xtpl->assign("OPP_COUNT", $opp_data1['opp_count']); |
98 | - $xtpl->assign("ACTUAL_COST",$opp_data1['actual_cost']); |
|
99 | - $xtpl->assign("PLANNED_BUDGET",$opp_data1['budget']); |
|
100 | - $xtpl->assign("EXPECTED_REVENUE",$opp_data1['expected_revenue']); |
|
98 | + $xtpl->assign("ACTUAL_COST", $opp_data1['actual_cost']); |
|
99 | + $xtpl->assign("PLANNED_BUDGET", $opp_data1['budget']); |
|
100 | + $xtpl->assign("EXPECTED_REVENUE", $opp_data1['expected_revenue']); |
|
101 | 101 | |
102 | 102 | |
103 | 103 | |
104 | 104 | |
105 | - $currency = new Currency(); |
|
106 | -if(isset($focus->currency_id) && !empty($focus->currency_id)) |
|
105 | + $currency = new Currency(); |
|
106 | +if (isset($focus->currency_id) && !empty($focus->currency_id)) |
|
107 | 107 | { |
108 | 108 | $currency->retrieve($focus->currency_id); |
109 | - if( $currency->deleted != 1){ |
|
110 | - $xtpl->assign("CURRENCY", $currency->iso4217 .' '.$currency->symbol ); |
|
111 | - }else $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() ); |
|
112 | -}else{ |
|
109 | + if ($currency->deleted != 1) { |
|
110 | + $xtpl->assign("CURRENCY", $currency->iso4217.' '.$currency->symbol); |
|
111 | + } else $xtpl->assign("CURRENCY", $currency->getDefaultISO4217().' '.$currency->getDefaultCurrencySymbol()); |
|
112 | +} else { |
|
113 | 113 | |
114 | - $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() ); |
|
114 | + $xtpl->assign("CURRENCY", $currency->getDefaultISO4217().' '.$currency->getDefaultCurrencySymbol()); |
|
115 | 115 | |
116 | 116 | } |
117 | 117 | |
118 | 118 | global $current_user; |
119 | -if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){ |
|
119 | +if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) { |
|
120 | 120 | |
121 | - $xtpl->assign("ADMIN_EDIT","<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$_REQUEST['record']. "'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' align='bottom'",null,null,'.gif',$mod_strings['LBL_EDIT_LAYOUT'])."</a>"); |
|
121 | + $xtpl->assign("ADMIN_EDIT", "<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action']."&from_module=".$_REQUEST['module']."&record=".$_REQUEST['record']."'>".SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDIT_LAYOUT'])."</a>"); |
|
122 | 122 | |
123 | 123 | } |
124 | 124 | |
@@ -171,23 +171,23 @@ discard block |
||
171 | 171 | */ |
172 | 172 | |
173 | 173 | //add chart |
174 | -$seps = array("-", "/"); |
|
175 | -$dates = array(date($GLOBALS['timedate']->dbDayFormat), $GLOBALS['timedate']->dbDayFormat); |
|
176 | -$dateFileNameSafe = str_replace($seps, "_", $dates); |
|
177 | -$cache_file_name_roi = $current_user->getUserPrivGuid()."_campaign_response_by_roi_".$dateFileNameSafe[0]."_".$dateFileNameSafe[1].".xml"; |
|
178 | -$chart= new campaign_charts(); |
|
174 | +$seps = array("-", "/"); |
|
175 | +$dates = array(date($GLOBALS['timedate']->dbDayFormat), $GLOBALS['timedate']->dbDayFormat); |
|
176 | +$dateFileNameSafe = str_replace($seps, "_", $dates); |
|
177 | +$cache_file_name_roi = $current_user->getUserPrivGuid()."_campaign_response_by_roi_".$dateFileNameSafe[0]."_".$dateFileNameSafe[1].".xml"; |
|
178 | +$chart = new campaign_charts(); |
|
179 | 179 | |
180 | 180 | //ob_start(); |
181 | 181 | |
182 | 182 | //if marketing id has been selected, then set "latest_marketing_id" to the selected value |
183 | 183 | //latest marketing id will be passed in to filter the charts and subpanels |
184 | 184 | |
185 | - if(!empty($selected_marketing_id)){$latest_marketing_id = $selected_marketing_id;} |
|
186 | - if(empty($latest_marketing_id) || $latest_marketing_id === 'all'){ |
|
187 | - $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{ |
|
185 | + if (!empty($selected_marketing_id)) {$latest_marketing_id = $selected_marketing_id; } |
|
186 | + if (empty($latest_marketing_id) || $latest_marketing_id === 'all') { |
|
187 | + $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 { |
|
189 | 189 | |
190 | - $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)); |
|
190 | + $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 | 191 | } |
192 | 192 | |
193 | 193 | //$output_html .= ob_get_contents(); |
@@ -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,22 +60,22 @@ discard block |
||
60 | 60 | //name is used as key in post, it is also used in creation of summary page for wizard, |
61 | 61 | //so let's clean up the posting so we can reuse the save functionality for inbound emails and |
62 | 62 | //from existing save.php's |
63 | - foreach($camp_steps as $step){ |
|
63 | + foreach ($camp_steps as $step) { |
|
64 | 64 | clean_up_post($step); |
65 | 65 | } |
66 | 66 | /**************************** Save general Email Setup *****************************/ |
67 | 67 | |
68 | 68 | //we do not need to track location if location type is not set |
69 | -if(isset($_POST['tracking_entities_location_type'])) { |
|
69 | +if (isset($_POST['tracking_entities_location_type'])) { |
|
70 | 70 | if ($_POST['tracking_entities_location_type'] != '2') { |
71 | 71 | unset($_POST['tracking_entities_location']); |
72 | 72 | unset($_POST['tracking_entities_location_type']); |
73 | 73 | } |
74 | 74 | } |
75 | 75 | //if the check box is empty, then set it to 0 |
76 | -if(!isset($_POST['mail_smtpauth_req'])) { $_POST['mail_smtpauth_req'] = 0; } |
|
76 | +if (!isset($_POST['mail_smtpauth_req'])) { $_POST['mail_smtpauth_req'] = 0; } |
|
77 | 77 | //default ssl use to false |
78 | -if(!isset($_POST['mail_smtpssl'])) { $_POST['mail_smtpssl'] = 0; } |
|
78 | +if (!isset($_POST['mail_smtpssl'])) { $_POST['mail_smtpssl'] = 0; } |
|
79 | 79 | //reuse existing saveconfig functionality |
80 | 80 | $focus->saveConfig(); |
81 | 81 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | /**************************** Add New Monitored Box *****************************/ |
85 | 85 | //perform this if the option to create new mail box has been checked |
86 | -if(isset($_REQUEST['wiz_new_mbox']) && ($_REQUEST['wiz_new_mbox']=='1')){ |
|
86 | +if (isset($_REQUEST['wiz_new_mbox']) && ($_REQUEST['wiz_new_mbox'] == '1')) { |
|
87 | 87 | |
88 | 88 | //Populate the Request variables that inboundemail expects |
89 | 89 | $_REQUEST['mark_read'] = 1; |
@@ -96,11 +96,11 @@ discard block |
||
96 | 96 | require_once('modules/InboundEmail/Save.php'); |
97 | 97 | |
98 | 98 | } |
99 | - if (!empty($_REQUEST['error'])){ |
|
99 | + if (!empty($_REQUEST['error'])) { |
|
100 | 100 | //an error was found during inbound save. This means the save was allowed but the inbound box had problems, return user to wizard |
101 | 101 | //and display error message |
102 | 102 | header("Location: index.php?action=WizardEmailSetup&module=Campaigns&error=true"); |
103 | - }else{ |
|
103 | + } else { |
|
104 | 104 | //set navigation details |
105 | 105 | header("Location: index.php?action=index&module=Campaigns"); |
106 | 106 | } |
@@ -111,18 +111,18 @@ discard block |
||
111 | 111 | * which does not expect the prefix, and still use the generic create summary functionality in wizard, which |
112 | 112 | * does expect the prefix. |
113 | 113 | */ |
114 | -function clean_up_post($prefix){ |
|
114 | +function clean_up_post($prefix) { |
|
115 | 115 | |
116 | 116 | foreach ($_REQUEST as $key => $val) { |
117 | - if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){ |
|
118 | - $newkey =substr($key, strlen($prefix)) ; |
|
117 | + if ((strstr($key, $prefix)) && (strpos($key, $prefix) == 0)) { |
|
118 | + $newkey = substr($key, strlen($prefix)); |
|
119 | 119 | $_REQUEST[$newkey] = $val; |
120 | 120 | } |
121 | 121 | } |
122 | 122 | |
123 | 123 | foreach ($_POST as $key => $val) { |
124 | - if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){ |
|
125 | - $newkey =substr($key, strlen($prefix)) ; |
|
124 | + if ((strstr($key, $prefix)) && (strpos($key, $prefix) == 0)) { |
|
125 | + $newkey = substr($key, strlen($prefix)); |
|
126 | 126 | $_POST[$newkey] = $val; |
127 | 127 | |
128 | 128 | } |
@@ -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,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | $mod_strings = return_module_language($sugar_config['default_language'], 'Leads'); |
49 | 49 | |
50 | -$app_list_strings['record_type_module'] = array('Contact'=>'Contacts', 'Account'=>'Accounts', 'Opportunity'=>'Opportunities', 'Case'=>'Cases', 'Note'=>'Notes', 'Call'=>'Calls', 'Email'=>'Emails', 'Meeting'=>'Meetings', 'Task'=>'Tasks', 'Lead'=>'Leads','Bug'=>'Bugs', |
|
50 | +$app_list_strings['record_type_module'] = array('Contact'=>'Contacts', 'Account'=>'Accounts', 'Opportunity'=>'Opportunities', 'Case'=>'Cases', 'Note'=>'Notes', 'Call'=>'Calls', 'Email'=>'Emails', 'Meeting'=>'Meetings', 'Task'=>'Tasks', 'Lead'=>'Leads', 'Bug'=>'Bugs', |
|
51 | 51 | |
52 | 52 | ); |
53 | 53 | |
@@ -61,18 +61,18 @@ discard block |
||
61 | 61 | if (isset($_POST['campaign_id']) && !empty($_POST['campaign_id'])) { |
62 | 62 | //adding the client ip address |
63 | 63 | $_POST['client_id_address'] = query_client_ip(); |
64 | - $campaign_id=$_POST['campaign_id']; |
|
64 | + $campaign_id = $_POST['campaign_id']; |
|
65 | 65 | $campaign = new Campaign(); |
66 | 66 | $camp_query = "select name,id from campaigns where id='$campaign_id'"; |
67 | 67 | $camp_query .= " and deleted=0"; |
68 | - $camp_result=$campaign->db->query($camp_query); |
|
68 | + $camp_result = $campaign->db->query($camp_query); |
|
69 | 69 | $camp_data = $campaign->db->fetchByAssoc($camp_result); |
70 | 70 | // Bug 41292 - have to select marketing_id for new lead |
71 | 71 | $db = DBManagerFactory::getInstance(); |
72 | 72 | $marketing = new EmailMarketing(); |
73 | 73 | $marketing_query = $marketing->create_new_list_query( |
74 | 74 | 'date_start desc, date_modified desc', |
75 | - "campaign_id = '{$campaign_id}' and status = 'active' and date_start < " . $db->convert('', 'today'), |
|
75 | + "campaign_id = '{$campaign_id}' and status = 'active' and date_start < ".$db->convert('', 'today'), |
|
76 | 76 | array('id') |
77 | 77 | ); |
78 | 78 | $marketing_result = $db->limitQuery($marketing_query, 0, 1, true); |
@@ -83,22 +83,22 @@ discard block |
||
83 | 83 | $current_user->retrieve($_REQUEST['assigned_user_id']); |
84 | 84 | } |
85 | 85 | |
86 | - if(isset($camp_data) && $camp_data != null ){ |
|
86 | + if (isset($camp_data) && $camp_data != null) { |
|
87 | 87 | $leadForm = new LeadFormBase(); |
88 | 88 | $lead = new Lead(); |
89 | 89 | $prefix = ''; |
90 | - if(!empty($_POST['prefix'])){ |
|
90 | + if (!empty($_POST['prefix'])) { |
|
91 | 91 | $prefix = $_POST['prefix']; |
92 | 92 | } |
93 | 93 | |
94 | - if(empty($lead->id)) { |
|
94 | + if (empty($lead->id)) { |
|
95 | 95 | $lead->id = create_guid(); |
96 | 96 | $lead->new_with_id = true; |
97 | 97 | } |
98 | 98 | $GLOBALS['check_notify'] = true; |
99 | 99 | |
100 | 100 | //bug: 47574 - make sure, that webtolead_email1 field has same required attribute as email1 field |
101 | - if(isset($lead->required_fields['email1'])){ |
|
101 | + if (isset($lead->required_fields['email1'])) { |
|
102 | 102 | $lead->required_fields['webtolead_email1'] = $lead->required_fields['email1']; |
103 | 103 | } |
104 | 104 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | // checkRequired needs a major overhaul before it works for web to lead forms. |
115 | 115 | $lead = $leadForm->handleSave($prefix, false, false, false, $lead); |
116 | 116 | |
117 | - if(!empty($lead)){ |
|
117 | + if (!empty($lead)) { |
|
118 | 118 | |
119 | 119 | //create campaign log |
120 | 120 | $camplog = new CampaignLog(); |
@@ -123,9 +123,9 @@ discard block |
||
123 | 123 | $camplog->related_type = $lead->module_dir; |
124 | 124 | $camplog->activity_type = "lead"; |
125 | 125 | $camplog->target_type = $lead->module_dir; |
126 | - $campaign_log->activity_date=$timedate->now(); |
|
127 | - $camplog->target_id = $lead->id; |
|
128 | - if(isset($marketing_data['id'])) |
|
126 | + $campaign_log->activity_date = $timedate->now(); |
|
127 | + $camplog->target_id = $lead->id; |
|
128 | + if (isset($marketing_data['id'])) |
|
129 | 129 | { |
130 | 130 | $camplog->marketing_id = $marketing_data['id']; |
131 | 131 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | $lead->load_relationship('campaigns'); |
157 | 157 | $lead->campaigns->add($camplog->id); |
158 | - if(!empty($GLOBALS['check_notify'])) { |
|
158 | + if (!empty($GLOBALS['check_notify'])) { |
|
159 | 159 | $lead->save($GLOBALS['check_notify']); |
160 | 160 | } |
161 | 161 | else { |
@@ -164,47 +164,47 @@ discard block |
||
164 | 164 | } |
165 | 165 | |
166 | 166 | //in case there are forms out there still using email_opt_out |
167 | - if(isset($_POST['webtolead_email_opt_out']) || isset($_POST['email_opt_out'])){ |
|
167 | + if (isset($_POST['webtolead_email_opt_out']) || isset($_POST['email_opt_out'])) { |
|
168 | 168 | |
169 | - if(isset ($lead->email1) && !empty($lead->email1)){ |
|
169 | + if (isset ($lead->email1) && !empty($lead->email1)) { |
|
170 | 170 | $sea = new SugarEmailAddress(); |
171 | - $sea->AddUpdateEmailAddress($lead->email1,0,1); |
|
171 | + $sea->AddUpdateEmailAddress($lead->email1, 0, 1); |
|
172 | 172 | } |
173 | - if(isset ($lead->email2) && !empty($lead->email2)){ |
|
173 | + if (isset ($lead->email2) && !empty($lead->email2)) { |
|
174 | 174 | $sea = new SugarEmailAddress(); |
175 | - $sea->AddUpdateEmailAddress($lead->email2,0,1); |
|
175 | + $sea->AddUpdateEmailAddress($lead->email2, 0, 1); |
|
176 | 176 | |
177 | 177 | } |
178 | 178 | } |
179 | - if(isset($_POST['redirect_url']) && !empty($_POST['redirect_url'])){ |
|
179 | + if (isset($_POST['redirect_url']) && !empty($_POST['redirect_url'])) { |
|
180 | 180 | // Get the redirect url, and make sure the query string is not too long |
181 | 181 | $redirect_url = $_POST['redirect_url']; |
182 | 182 | $query_string = ''; |
183 | 183 | $first_char = '&'; |
184 | - if(strpos($redirect_url, '?') === FALSE){ |
|
184 | + if (strpos($redirect_url, '?') === FALSE) { |
|
185 | 185 | $first_char = '?'; |
186 | 186 | } |
187 | 187 | $first_iteration = true; |
188 | 188 | $get_and_post = array_merge($_GET, $_POST); |
189 | - foreach($get_and_post as $param => $value) { |
|
189 | + foreach ($get_and_post as $param => $value) { |
|
190 | 190 | |
191 | - if($param == 'redirect_url' && $param == 'submit') |
|
191 | + if ($param == 'redirect_url' && $param == 'submit') |
|
192 | 192 | continue; |
193 | 193 | |
194 | - if($first_iteration){ |
|
194 | + if ($first_iteration) { |
|
195 | 195 | $first_iteration = false; |
196 | 196 | $query_string .= $first_char; |
197 | 197 | } |
198 | - else{ |
|
198 | + else { |
|
199 | 199 | $query_string .= "&"; |
200 | 200 | } |
201 | 201 | $query_string .= "{$param}=".urlencode($value); |
202 | 202 | } |
203 | - if(empty($lead)) { |
|
204 | - if($first_iteration){ |
|
203 | + if (empty($lead)) { |
|
204 | + if ($first_iteration) { |
|
205 | 205 | $query_string .= $first_char; |
206 | 206 | } |
207 | - else{ |
|
207 | + else { |
|
208 | 208 | $query_string .= "&"; |
209 | 209 | } |
210 | 210 | $query_string .= "error=1"; |
@@ -215,46 +215,46 @@ discard block |
||
215 | 215 | |
216 | 216 | // Check if the headers have been sent, or if the redirect url is greater than 2083 characters (IE max URL length) |
217 | 217 | // and use a javascript form submission if that is the case. |
218 | - if(headers_sent() || strlen($redirect_url) > 2083){ |
|
219 | - echo '<html ' . get_language_header() . '><head><title>SugarCRM</title></head><body>'; |
|
220 | - echo '<form name="redirect" action="' .$_POST['redirect_url']. '" method="GET">'; |
|
218 | + if (headers_sent() || strlen($redirect_url) > 2083) { |
|
219 | + echo '<html '.get_language_header().'><head><title>SugarCRM</title></head><body>'; |
|
220 | + echo '<form name="redirect" action="'.$_POST['redirect_url'].'" method="GET">'; |
|
221 | 221 | |
222 | - foreach($_POST as $param => $value) { |
|
223 | - if($param != 'redirect_url' ||$param != 'submit') { |
|
222 | + foreach ($_POST as $param => $value) { |
|
223 | + if ($param != 'redirect_url' || $param != 'submit') { |
|
224 | 224 | echo '<input type="hidden" name="'.$param.'" value="'.$value.'">'; |
225 | 225 | } |
226 | 226 | } |
227 | - if(empty($lead)) { |
|
227 | + if (empty($lead)) { |
|
228 | 228 | echo '<input type="hidden" name="error" value="1">'; |
229 | 229 | } |
230 | 230 | echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>'; |
231 | 231 | echo '</body></html>'; |
232 | 232 | } |
233 | - else{ |
|
233 | + else { |
|
234 | 234 | header("Location: {$redirect_url}"); |
235 | 235 | die(); |
236 | 236 | } |
237 | 237 | } |
238 | - else{ |
|
238 | + else { |
|
239 | 239 | echo $mod_strings['LBL_THANKS_FOR_SUBMITTING_LEAD']; |
240 | 240 | } |
241 | 241 | sugar_cleanup(); |
242 | 242 | // die to keep code from running into redirect case below |
243 | 243 | die(); |
244 | 244 | } |
245 | - else{ |
|
245 | + else { |
|
246 | 246 | echo $mod_strings['LBL_SERVER_IS_CURRENTLY_UNAVAILABLE']; |
247 | 247 | } |
248 | 248 | } |
249 | 249 | |
250 | 250 | if (!empty($_POST['redirect'])) { |
251 | - if(headers_sent()){ |
|
252 | - echo '<html ' . get_language_header() . '><head><title>SugarCRM</title></head><body>'; |
|
253 | - echo '<form name="redirect" action="' .$_POST['redirect']. '" method="GET">'; |
|
251 | + if (headers_sent()) { |
|
252 | + echo '<html '.get_language_header().'><head><title>SugarCRM</title></head><body>'; |
|
253 | + echo '<form name="redirect" action="'.$_POST['redirect'].'" method="GET">'; |
|
254 | 254 | echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>'; |
255 | 255 | echo '</body></html>'; |
256 | 256 | } |
257 | - else{ |
|
257 | + else { |
|
258 | 258 | header("Location: {$_POST['redirect']}"); |
259 | 259 | die(); |
260 | 260 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | function deleteTestRecords($focus) |
57 | 57 | { |
58 | - if(empty($focus) || empty($focus->id)) |
|
58 | + if (empty($focus) || empty($focus->id)) |
|
59 | 59 | { |
60 | 60 | return; |
61 | 61 | } |
@@ -65,17 +65,17 @@ discard block |
||
65 | 65 | WHERE campaign_log.campaign_id = '{$focus->id}' AND prospect_lists.list_type='test'"); |
66 | 66 | $test_ids = array(); |
67 | 67 | $test_list_ids = array(); |
68 | - while($row = $focus->db->fetchByAssoc($res)) { |
|
68 | + while ($row = $focus->db->fetchByAssoc($res)) { |
|
69 | 69 | $test_ids[] = $row['emailid']; |
70 | 70 | $test_list_ids[$row['listid']] = true; |
71 | 71 | } |
72 | 72 | $test_list_ids = array_keys($test_list_ids); |
73 | 73 | unset($res); |
74 | - if(!empty($test_ids)) { |
|
74 | + if (!empty($test_ids)) { |
|
75 | 75 | $focus->db->query("UPDATE emails SET deleted=1 WHERE id IN ('".join("','", $test_ids)."')"); |
76 | 76 | } |
77 | 77 | |
78 | - if(!empty($test_list_ids)) { |
|
78 | + if (!empty($test_list_ids)) { |
|
79 | 79 | $query = "DELETE FROM emailman WHERE campaign_id = '{$focus->id}' AND list_id IN ('".join("','", $test_list_ids)."')"; |
80 | 80 | $focus->db->query($query); |
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. |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | |
53 | 53 | |
54 | 54 | |
55 | -global $mod_strings,$app_list_strings,$app_strings,$current_user; |
|
55 | +global $mod_strings, $app_list_strings, $app_strings, $current_user; |
|
56 | 56 | |
57 | 57 | |
58 | -if (!is_admin($current_user)&& !is_admin_for_module($GLOBALS['current_user'],'Campaigns')) sugar_die("Unauthorized access to administration."); |
|
58 | +if (!is_admin($current_user) && !is_admin_for_module($GLOBALS['current_user'], 'Campaigns')) sugar_die("Unauthorized access to administration."); |
|
59 | 59 | |
60 | 60 | $params = array(); |
61 | 61 | $params[] = "<a href='index.php?module=Campaigns&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>"; |
@@ -101,25 +101,25 @@ discard block |
||
101 | 101 | $ss->assign('PROTOCOL', get_select_options_with_id($protocol, '')); |
102 | 102 | if (isset($focus->settings['massemailer_campaign_emails_per_run']) && !empty($focus->settings['massemailer_campaign_emails_per_run'])) { |
103 | 103 | $ss->assign("EMAILS_PER_RUN", $focus->settings['massemailer_campaign_emails_per_run']); |
104 | -} else { |
|
104 | +} else { |
|
105 | 105 | $ss->assign("EMAILS_PER_RUN", 500); |
106 | 106 | } |
107 | 107 | |
108 | -if (!isset($focus->settings['massemailer_tracking_entities_location_type']) or empty($focus->settings['massemailer_tracking_entities_location_type']) or $focus->settings['massemailer_tracking_entities_location_type']=='1') { |
|
108 | +if (!isset($focus->settings['massemailer_tracking_entities_location_type']) or empty($focus->settings['massemailer_tracking_entities_location_type']) or $focus->settings['massemailer_tracking_entities_location_type'] == '1') { |
|
109 | 109 | $ss->assign("DEFAULT_CHECKED", "checked"); |
110 | 110 | $ss->assign("TRACKING_ENTRIES_LOCATION_STATE", "disabled"); |
111 | - $ss->assign("TRACKING_ENTRIES_LOCATION",$mod_strings['TRACKING_ENTRIES_LOCATION_DEFAULT_VALUE']); |
|
112 | -} else { |
|
111 | + $ss->assign("TRACKING_ENTRIES_LOCATION", $mod_strings['TRACKING_ENTRIES_LOCATION_DEFAULT_VALUE']); |
|
112 | +} else { |
|
113 | 113 | $ss->assign("USERDEFINED_CHECKED", "checked"); |
114 | - $ss->assign("TRACKING_ENTRIES_LOCATION",$focus->settings["massemailer_tracking_entities_location"]); |
|
114 | + $ss->assign("TRACKING_ENTRIES_LOCATION", $focus->settings["massemailer_tracking_entities_location"]); |
|
115 | 115 | } |
116 | 116 | |
117 | -$ss->assign("SITEURL",$sugar_config['site_url']); |
|
117 | +$ss->assign("SITEURL", $sugar_config['site_url']); |
|
118 | 118 | |
119 | 119 | // Change the default campaign to not store a copy of each message. |
120 | -if (!empty($focus->settings['massemailer_email_copy']) and $focus->settings['massemailer_email_copy']=='1') { |
|
120 | +if (!empty($focus->settings['massemailer_email_copy']) and $focus->settings['massemailer_email_copy'] == '1') { |
|
121 | 121 | $ss->assign("YES_CHECKED", "checked='checked'"); |
122 | -} else { |
|
122 | +} else { |
|
123 | 123 | $ss->assign("NO_CHECKED", "checked='checked'"); |
124 | 124 | } |
125 | 125 | |
@@ -129,25 +129,25 @@ discard block |
||
129 | 129 | /*********** New Mail Box UI DIV Stuff ****************/ |
130 | 130 | $mbox_qry = "select * from inbound_email where deleted ='0' and mailbox_type = 'bounce'"; |
131 | 131 | $mbox_res = $focus->db->query($mbox_qry); |
132 | -while ($mbox_row = $focus->db->fetchByAssoc($mbox_res)){$mbox[] = $mbox_row;} |
|
132 | +while ($mbox_row = $focus->db->fetchByAssoc($mbox_res)) {$mbox[] = $mbox_row; } |
|
133 | 133 | $mbox_msg = ' '; |
134 | 134 | $need_mbox = ''; |
135 | 135 | |
136 | 136 | $mboxTable = "<table class='list view' width='100%' border='0' cellspacing='1' cellpadding='1'>"; |
137 | -if(isset($mbox) && count($mbox)>0){ |
|
138 | - $mboxTable .= "<tr><td colspan='5'><b>" .count($mbox) ." ". $mod_strings['LBL_MAILBOX_CHECK_WIZ_GOOD']." </b>.</td></tr>"; |
|
137 | +if (isset($mbox) && count($mbox) > 0) { |
|
138 | + $mboxTable .= "<tr><td colspan='5'><b>".count($mbox)." ".$mod_strings['LBL_MAILBOX_CHECK_WIZ_GOOD']." </b>.</td></tr>"; |
|
139 | 139 | $mboxTable .= "<tr class='listViewHRS1'><td width='20%'><b>".$mod_strings['LBL_MAILBOX_NAME']."</b></td>" |
140 | 140 | . " <td width='20%'><b>".$mod_strings['LBL_LOGIN']."</b></td>" |
141 | 141 | . " <td width='20%'><b>".$mod_strings['LBL_MAILBOX']."</b></td>" |
142 | 142 | . " <td width='20%'><b>".$mod_strings['LBL_SERVER_URL']."</b></td>" |
143 | 143 | . " <td width='20%'><b>".$mod_strings['LBL_LIST_STATUS']."</b></td></tr>"; |
144 | - $colorclass=' '; |
|
145 | - foreach($mbox as $details){ |
|
144 | + $colorclass = ' '; |
|
145 | + foreach ($mbox as $details) { |
|
146 | 146 | |
147 | - if( $colorclass == "class='evenListRowS1'"){ |
|
148 | - $colorclass= "class='oddListRowS1'"; |
|
149 | - }else{ |
|
150 | - $colorclass= "class='evenListRowS1'"; |
|
147 | + if ($colorclass == "class='evenListRowS1'") { |
|
148 | + $colorclass = "class='oddListRowS1'"; |
|
149 | + } else { |
|
150 | + $colorclass = "class='evenListRowS1'"; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | $mboxTable .= "<tr $colorclass>"; |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | } |
160 | 160 | |
161 | 161 | |
162 | -}else{ |
|
162 | +} else { |
|
163 | 163 | $need_mbox = 'checked'; |
164 | 164 | $mboxTable .= "<tr><td colspan='5'><b>".$mod_strings['LBL_MAILBOX_CHECK_WIZ_BAD']." </b>.</td></tr>"; |
165 | 165 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $ss->assign("MAILBOXES_DETECTED_MESSAGE", $mboxTable); |
168 | 168 | $ss->assign("MBOX_NEEDED", $need_mbox); |
169 | 169 | $ss->assign('ROLLOVER', $email->rolloverStyle); |
170 | -if(!function_exists('imap_open')) { |
|
170 | +if (!function_exists('imap_open')) { |
|
171 | 171 | $ss->assign('IE_DISABLED', 'DISABLED'); |
172 | 172 | } |
173 | 173 | /**************************** SUMMARY UI DIV Stuff *******************/ |
@@ -406,13 +406,13 @@ discard block |
||
406 | 406 | </script> |
407 | 407 | EOQ; |
408 | 408 | |
409 | -if(isset($_REQUEST['error'])){ |
|
409 | +if (isset($_REQUEST['error'])) { |
|
410 | 410 | //if there is an error flagged, then we are coming here after a save where there was an error detected |
411 | 411 | //on an inbound email save. Display error to user so they are aware. |
412 | 412 | $errorString = "<div class='error'>".$mod_strings['ERR_NO_OPTS_SAVED']." <a href='index.php?module=InboundEmail&action=index'>".$mod_strings['ERR_REVIEW_EMAIL_SETTINGS']."</a></div>"; |
413 | 413 | $ss->assign('ERROR', $errorString); |
414 | 414 | //navigate to inbound email page by default |
415 | - $divScript .=" <script>navigate('next');</script>"; |
|
415 | + $divScript .= " <script>navigate('next');</script>"; |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | $ss->assign("DIV_JAVASCRIPT", $divScript); |