@@ -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 | /********************************************************************************* |
5 | 5 | * SugarCRM Community Edition is a customer relationship management program developed by |
@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function preDisplay() |
51 | 51 | { |
52 | - if($_REQUEST['module'] != 'Calls' && isset($_REQUEST['status']) && empty($_REQUEST['status'])) { |
|
52 | + if ($_REQUEST['module'] != 'Calls' && isset($_REQUEST['status']) && empty($_REQUEST['status'])) { |
|
53 | 53 | $this->bean->status = ''; |
54 | 54 | } //if |
55 | - if(!empty($_REQUEST['status']) && ($_REQUEST['status'] == 'Held')) { |
|
55 | + if (!empty($_REQUEST['status']) && ($_REQUEST['status'] == 'Held')) { |
|
56 | 56 | $this->bean->status = 'Held'; |
57 | 57 | } |
58 | 58 | parent::preDisplay(); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $this->ss->assign('remindersDefaultValuesDataJson', Reminder::loadRemindersDefaultValuesDataJson()); |
82 | 82 | $this->ss->assign('remindersDisabled', json_encode(false)); |
83 | 83 | |
84 | - if($this->ev->isDuplicate){ |
|
84 | + if ($this->ev->isDuplicate) { |
|
85 | 85 | $this->bean->status = $this->bean->getDefaultStatus(); |
86 | 86 | } //if |
87 | 87 | parent::display(); |
@@ -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. |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | parent::process(); |
55 | 55 | |
56 | - if($this->viaAJAX) { // override for ajax call |
|
56 | + if ($this->viaAJAX) { // override for ajax call |
|
57 | 57 | $this->ss->assign('saveOnclick', "onclick='if(check_form(\"accountsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"accounts\"); else return false;'"); |
58 | 58 | $this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_accounts\")';"); |
59 | 59 | } |
@@ -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. |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | |
44 | 44 | |
45 | - global $json,$current_user; |
|
45 | + global $json, $current_user; |
|
46 | 46 | |
47 | 47 | |
48 | 48 | if ($_REQUEST['object_type'] == "Meeting") |
@@ -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. |
@@ -41,46 +41,46 @@ discard block |
||
41 | 41 | |
42 | 42 | function additionalDetailsLead($fields) { |
43 | 43 | static $mod_strings; |
44 | - if(empty($mod_strings)) { |
|
44 | + if (empty($mod_strings)) { |
|
45 | 45 | global $current_language; |
46 | 46 | $mod_strings = return_module_language($current_language, 'Leads'); |
47 | 47 | } |
48 | 48 | |
49 | 49 | $overlib_string = ''; |
50 | - if(!empty($fields['ID'])) { |
|
51 | - $overlib_string .= '<input type="hidden" value="'. $fields['ID']; |
|
50 | + if (!empty($fields['ID'])) { |
|
51 | + $overlib_string .= '<input type="hidden" value="'.$fields['ID']; |
|
52 | 52 | $overlib_string .= '">'; |
53 | 53 | } |
54 | 54 | |
55 | - $overlib_string .= '<h2><img src="index.php?entryPoint=getImage&themeName=' . SugarThemeRegistry::current()->name .'&imageName=Leads.gif"/> '.$mod_strings['LBL_CONTACT'].'</h2>'; |
|
55 | + $overlib_string .= '<h2><img src="index.php?entryPoint=getImage&themeName='.SugarThemeRegistry::current()->name.'&imageName=Leads.gif"/> '.$mod_strings['LBL_CONTACT'].'</h2>'; |
|
56 | 56 | |
57 | - if(!empty($fields['PRIMARY_ADDRESS_STREET']) || !empty($fields['PRIMARY_ADDRESS_CITY']) || |
|
57 | + if (!empty($fields['PRIMARY_ADDRESS_STREET']) || !empty($fields['PRIMARY_ADDRESS_CITY']) || |
|
58 | 58 | !empty($fields['PRIMARY_ADDRESS_STATE']) || !empty($fields['PRIMARY_ADDRESS_POSTALCODE']) || |
59 | 59 | !empty($fields['PRIMARY_ADDRESS_COUNTRY'])) |
60 | - $overlib_string .= '<b>' . $mod_strings['LBL_PRIMARY_ADDRESS'] . '</b><br>'; |
|
61 | - if(!empty($fields['PRIMARY_ADDRESS_STREET'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'] . '<br>'; |
|
62 | - if(!empty($fields['PRIMARY_ADDRESS_CITY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'] . ', '; |
|
63 | - if(!empty($fields['PRIMARY_ADDRESS_STATE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'] . ' '; |
|
64 | - if(!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'] . ' '; |
|
65 | - if(!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'] . '<br>'; |
|
66 | - if(strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) |
|
60 | + $overlib_string .= '<b>'.$mod_strings['LBL_PRIMARY_ADDRESS'].'</b><br>'; |
|
61 | + if (!empty($fields['PRIMARY_ADDRESS_STREET'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'].'<br>'; |
|
62 | + if (!empty($fields['PRIMARY_ADDRESS_CITY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'].', '; |
|
63 | + if (!empty($fields['PRIMARY_ADDRESS_STATE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'].' '; |
|
64 | + if (!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'].' '; |
|
65 | + if (!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'].'<br>'; |
|
66 | + if (strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) |
|
67 | 67 | $overlib_string .= '<br>'; |
68 | - if(!empty($fields['PHONE_MOBILE'])) $overlib_string .= '<b>'. $mod_strings['LBL_MOBILE_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_MOBILE'] . '</span><br>'; |
|
69 | - if(!empty($fields['PHONE_HOME'])) $overlib_string .= '<b>'. $mod_strings['LBL_HOME_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_HOME'] . '</span><br>'; |
|
70 | - if(!empty($fields['PHONE_OTHER'])) $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_OTHER'] . '</span><br>'; |
|
71 | - if(!empty($fields['LEAD_SOURCE'])) $overlib_string .= '<b>'. $mod_strings['LBL_LEAD_SOURCE'] . '</b> ' . $fields['LEAD_SOURCE'] . '<br>'; |
|
68 | + if (!empty($fields['PHONE_MOBILE'])) $overlib_string .= '<b>'.$mod_strings['LBL_MOBILE_PHONE'].'</b> <span class="phone">'.$fields['PHONE_MOBILE'].'</span><br>'; |
|
69 | + if (!empty($fields['PHONE_HOME'])) $overlib_string .= '<b>'.$mod_strings['LBL_HOME_PHONE'].'</b> <span class="phone">'.$fields['PHONE_HOME'].'</span><br>'; |
|
70 | + if (!empty($fields['PHONE_OTHER'])) $overlib_string .= '<b>'.$mod_strings['LBL_OTHER_PHONE'].'</b> <span class="phone">'.$fields['PHONE_OTHER'].'</span><br>'; |
|
71 | + if (!empty($fields['LEAD_SOURCE'])) $overlib_string .= '<b>'.$mod_strings['LBL_LEAD_SOURCE'].'</b> '.$fields['LEAD_SOURCE'].'<br>'; |
|
72 | 72 | |
73 | - if(!empty($fields['EMAIL2'])) |
|
74 | - $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_EMAIL_ADDRESS'] . '</b> ' . |
|
75 | - "<a href=index.php?module=Emails&action=Compose&contact_id={$fields['ID']}&" . |
|
76 | - "parent_type=Contacts&parent_id={$fields['ID']}&to_addrs_ids={$fields['ID']}&to_addrs_names" . |
|
77 | - "={$fields['FIRST_NAME']} {$fields['LAST_NAME']}&to_addrs_emails={$fields['EMAIL2']}&" . |
|
78 | - "to_email_addrs=" . urlencode("{$fields['FIRST_NAME']} {$fields['LAST_NAME']} <{$fields['EMAIL2']}>") . |
|
73 | + if (!empty($fields['EMAIL2'])) |
|
74 | + $overlib_string .= '<b>'.$mod_strings['LBL_OTHER_EMAIL_ADDRESS'].'</b> '. |
|
75 | + "<a href=index.php?module=Emails&action=Compose&contact_id={$fields['ID']}&". |
|
76 | + "parent_type=Contacts&parent_id={$fields['ID']}&to_addrs_ids={$fields['ID']}&to_addrs_names". |
|
77 | + "={$fields['FIRST_NAME']} {$fields['LAST_NAME']}&to_addrs_emails={$fields['EMAIL2']}&". |
|
78 | + "to_email_addrs=".urlencode("{$fields['FIRST_NAME']} {$fields['LAST_NAME']} <{$fields['EMAIL2']}>"). |
|
79 | 79 | "&return_module=Contacts&return_action=ListView'>{$fields['EMAIL2']}</a><br>"; |
80 | 80 | |
81 | - if(!empty($fields['DESCRIPTION'])) { |
|
82 | - $overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300); |
|
83 | - if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...'; |
|
81 | + if (!empty($fields['DESCRIPTION'])) { |
|
82 | + $overlib_string .= '<b>'.$mod_strings['LBL_DESCRIPTION'].'</b> '.substr($fields['DESCRIPTION'], 0, 300); |
|
83 | + if (strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...'; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | return array('fieldToAddTo' => 'NAME', |
@@ -1,35 +1,35 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | $viewdefs ['Leads'] = |
3 | -array ( |
|
3 | +array( |
|
4 | 4 | 'EditView' => |
5 | - array ( |
|
5 | + array( |
|
6 | 6 | 'templateMeta' => |
7 | - array ( |
|
7 | + array( |
|
8 | 8 | 'form' => |
9 | - array ( |
|
9 | + array( |
|
10 | 10 | 'hidden' => |
11 | - array ( |
|
11 | + array( |
|
12 | 12 | 0 => '<input type="hidden" name="prospect_id" value="{if isset($smarty.request.prospect_id)}{$smarty.request.prospect_id}{else}{$bean->prospect_id}{/if}">', |
13 | 13 | 1 => '<input type="hidden" name="account_id" value="{if isset($smarty.request.account_id)}{$smarty.request.account_id}{else}{$bean->account_id}{/if}">', |
14 | 14 | 2 => '<input type="hidden" name="contact_id" value="{if isset($smarty.request.contact_id)}{$smarty.request.contact_id}{else}{$bean->contact_id}{/if}">', |
15 | 15 | 3 => '<input type="hidden" name="opportunity_id" value="{if isset($smarty.request.opportunity_id)}{$smarty.request.opportunity_id}{else}{$bean->opportunity_id}{/if}">', |
16 | 16 | ), |
17 | 17 | 'buttons' => |
18 | - array ( |
|
18 | + array( |
|
19 | 19 | 0 => 'SAVE', |
20 | 20 | 1 => 'CANCEL', |
21 | 21 | ), |
22 | 22 | ), |
23 | 23 | 'maxColumns' => '2', |
24 | 24 | 'widths' => |
25 | - array ( |
|
25 | + array( |
|
26 | 26 | 0 => |
27 | - array ( |
|
27 | + array( |
|
28 | 28 | 'label' => '10', |
29 | 29 | 'field' => '30', |
30 | 30 | ), |
31 | 31 | 1 => |
32 | - array ( |
|
32 | + array( |
|
33 | 33 | 'label' => '10', |
34 | 34 | 'field' => '30', |
35 | 35 | ), |
@@ -37,55 +37,55 @@ discard block |
||
37 | 37 | 'javascript' => '<script type="text/javascript" language="Javascript">function copyAddressRight(form) {ldelim} form.alt_address_street.value = form.primary_address_street.value;form.alt_address_city.value = form.primary_address_city.value;form.alt_address_state.value = form.primary_address_state.value;form.alt_address_postalcode.value = form.primary_address_postalcode.value;form.alt_address_country.value = form.primary_address_country.value;return true; {rdelim} function copyAddressLeft(form) {ldelim} form.primary_address_street.value =form.alt_address_street.value;form.primary_address_city.value = form.alt_address_city.value;form.primary_address_state.value = form.alt_address_state.value;form.primary_address_postalcode.value =form.alt_address_postalcode.value;form.primary_address_country.value = form.alt_address_country.value;return true; {rdelim} </script>', |
38 | 38 | 'useTabs' => false, |
39 | 39 | 'tabDefs' => |
40 | - array ( |
|
40 | + array( |
|
41 | 41 | 'LBL_CONTACT_INFORMATION' => |
42 | - array ( |
|
42 | + array( |
|
43 | 43 | 'newTab' => false, |
44 | 44 | 'panelDefault' => 'expanded', |
45 | 45 | ), |
46 | 46 | 'LBL_PANEL_ADVANCED' => |
47 | - array ( |
|
47 | + array( |
|
48 | 48 | 'newTab' => false, |
49 | 49 | 'panelDefault' => 'expanded', |
50 | 50 | ), |
51 | 51 | 'LBL_PANEL_ASSIGNMENT' => |
52 | - array ( |
|
52 | + array( |
|
53 | 53 | 'newTab' => false, |
54 | 54 | 'panelDefault' => 'expanded', |
55 | 55 | ), |
56 | 56 | ), |
57 | 57 | ), |
58 | 58 | 'panels' => |
59 | - array ( |
|
59 | + array( |
|
60 | 60 | 'LBL_CONTACT_INFORMATION' => |
61 | - array ( |
|
61 | + array( |
|
62 | 62 | 0 => |
63 | - array ( |
|
63 | + array( |
|
64 | 64 | 0 => |
65 | - array ( |
|
65 | + array( |
|
66 | 66 | 'name' => 'first_name', |
67 | 67 | 'customCode' => '{html_options name="salutation" id="salutation" options=$fields.salutation.options selected=$fields.salutation.value} <input name="first_name" id="first_name" size="25" maxlength="25" type="text" value="{$fields.first_name.value}">', |
68 | 68 | ), |
69 | 69 | ), |
70 | 70 | 1 => |
71 | - array ( |
|
71 | + array( |
|
72 | 72 | 0 => 'last_name', |
73 | 73 | 1 => 'phone_work', |
74 | 74 | ), |
75 | 75 | 2 => |
76 | - array ( |
|
76 | + array( |
|
77 | 77 | 0 => 'title', |
78 | 78 | 1 => 'phone_mobile', |
79 | 79 | ), |
80 | 80 | 3 => |
81 | - array ( |
|
81 | + array( |
|
82 | 82 | 0 => 'department', |
83 | 83 | 1 => 'phone_fax', |
84 | 84 | ), |
85 | 85 | 4 => |
86 | - array ( |
|
86 | + array( |
|
87 | 87 | 0 => |
88 | - array ( |
|
88 | + array( |
|
89 | 89 | 'name' => 'account_name', |
90 | 90 | 'type' => 'varchar', |
91 | 91 | 'validateDependency' => false, |
@@ -94,14 +94,14 @@ discard block |
||
94 | 94 | 1 => 'website', |
95 | 95 | ), |
96 | 96 | 5 => |
97 | - array ( |
|
97 | + array( |
|
98 | 98 | 0 => |
99 | - array ( |
|
99 | + array( |
|
100 | 100 | 'name' => 'primary_address_street', |
101 | 101 | 'hideLabel' => true, |
102 | 102 | 'type' => 'address', |
103 | 103 | 'displayParams' => |
104 | - array ( |
|
104 | + array( |
|
105 | 105 | 'key' => 'primary', |
106 | 106 | 'rows' => 2, |
107 | 107 | 'cols' => 30, |
@@ -109,12 +109,12 @@ discard block |
||
109 | 109 | ), |
110 | 110 | ), |
111 | 111 | 1 => |
112 | - array ( |
|
112 | + array( |
|
113 | 113 | 'name' => 'alt_address_street', |
114 | 114 | 'hideLabel' => true, |
115 | 115 | 'type' => 'address', |
116 | 116 | 'displayParams' => |
117 | - array ( |
|
117 | + array( |
|
118 | 118 | 'key' => 'alt', |
119 | 119 | 'copy' => 'primary', |
120 | 120 | 'rows' => 2, |
@@ -124,48 +124,48 @@ discard block |
||
124 | 124 | ), |
125 | 125 | ), |
126 | 126 | 6 => |
127 | - array ( |
|
127 | + array( |
|
128 | 128 | 0 => 'email1', |
129 | 129 | ), |
130 | 130 | 7 => |
131 | - array ( |
|
131 | + array( |
|
132 | 132 | 0 => 'description', |
133 | 133 | ), |
134 | 134 | ), |
135 | 135 | 'LBL_PANEL_ADVANCED' => |
136 | - array ( |
|
136 | + array( |
|
137 | 137 | 0 => |
138 | - array ( |
|
138 | + array( |
|
139 | 139 | 0 => 'status', |
140 | 140 | 1 => 'lead_source', |
141 | 141 | ), |
142 | 142 | 1 => |
143 | - array ( |
|
143 | + array( |
|
144 | 144 | 0 => |
145 | - array ( |
|
145 | + array( |
|
146 | 146 | 'name' => 'status_description', |
147 | 147 | ), |
148 | 148 | 1 => |
149 | - array ( |
|
149 | + array( |
|
150 | 150 | 'name' => 'lead_source_description', |
151 | 151 | ), |
152 | 152 | ), |
153 | 153 | 2 => |
154 | - array ( |
|
154 | + array( |
|
155 | 155 | 0 => 'opportunity_amount', |
156 | 156 | 1 => 'refered_by', |
157 | 157 | ), |
158 | 158 | 3 => |
159 | - array ( |
|
159 | + array( |
|
160 | 160 | 0 => 'campaign_name', |
161 | 161 | ), |
162 | 162 | ), |
163 | 163 | 'LBL_PANEL_ASSIGNMENT' => |
164 | - array ( |
|
164 | + array( |
|
165 | 165 | 0 => |
166 | - array ( |
|
166 | + array( |
|
167 | 167 | 0 => |
168 | - array ( |
|
168 | + array( |
|
169 | 169 | 'name' => 'assigned_user_name', |
170 | 170 | 'label' => 'LBL_ASSIGNED_TO', |
171 | 171 | ), |
@@ -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. |
@@ -46,15 +46,15 @@ discard block |
||
46 | 46 | ********************************************************************************/ |
47 | 47 | |
48 | 48 | $viewdefs ['Leads'] = |
49 | -array ( |
|
49 | +array( |
|
50 | 50 | 'QuickCreate' => |
51 | - array ( |
|
51 | + array( |
|
52 | 52 | 'templateMeta' => |
53 | - array ( |
|
53 | + array( |
|
54 | 54 | 'form' => |
55 | - array ( |
|
55 | + array( |
|
56 | 56 | 'hidden' => |
57 | - array ( |
|
57 | + array( |
|
58 | 58 | 0 => '<input type="hidden" name="prospect_id" value="{if isset($smarty.request.prospect_id)}{$smarty.request.prospect_id}{else}{$bean->prospect_id}{/if}">', |
59 | 59 | 1 => '<input type="hidden" name="contact_id" value="{if isset($smarty.request.contact_id)}{$smarty.request.contact_id}{else}{$bean->contact_id}{/if}">', |
60 | 60 | 2 => '<input type="hidden" name="opportunity_id" value="{if isset($smarty.request.opportunity_id)}{$smarty.request.opportunity_id}{else}{$bean->opportunity_id}{/if}">', |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | ), |
64 | 64 | 'maxColumns' => '2', |
65 | 65 | 'widths' => |
66 | - array ( |
|
66 | + array( |
|
67 | 67 | 0 => |
68 | - array ( |
|
68 | + array( |
|
69 | 69 | 'label' => '10', |
70 | 70 | 'field' => '30', |
71 | 71 | ), |
72 | 72 | 1 => |
73 | - array ( |
|
73 | + array( |
|
74 | 74 | 'label' => '10', |
75 | 75 | 'field' => '30', |
76 | 76 | ), |
@@ -79,94 +79,94 @@ discard block |
||
79 | 79 | 'useTabs' => false, |
80 | 80 | ), |
81 | 81 | 'panels' => |
82 | - array ( |
|
82 | + array( |
|
83 | 83 | 'lbl_contact_information' => |
84 | - array ( |
|
84 | + array( |
|
85 | 85 | 0 => |
86 | - array ( |
|
86 | + array( |
|
87 | 87 | 0 => |
88 | - array ( |
|
88 | + array( |
|
89 | 89 | 'name' => 'first_name', |
90 | 90 | ), |
91 | 91 | 1 => |
92 | - array ( |
|
92 | + array( |
|
93 | 93 | 'name' => 'status', |
94 | 94 | ), |
95 | 95 | ), |
96 | 96 | 1 => |
97 | - array ( |
|
97 | + array( |
|
98 | 98 | 0 => |
99 | - array ( |
|
99 | + array( |
|
100 | 100 | 'name' => 'last_name', |
101 | 101 | 'displayParams' => |
102 | - array ( |
|
102 | + array( |
|
103 | 103 | 'required' => true, |
104 | 104 | ), |
105 | 105 | ), |
106 | 106 | 1 => |
107 | - array ( |
|
107 | + array( |
|
108 | 108 | 'name' => 'phone_work', |
109 | 109 | ), |
110 | 110 | ), |
111 | 111 | 2 => |
112 | - array ( |
|
112 | + array( |
|
113 | 113 | 0 => |
114 | - array ( |
|
114 | + array( |
|
115 | 115 | 'name' => 'title', |
116 | 116 | ), |
117 | 117 | 1 => |
118 | - array ( |
|
118 | + array( |
|
119 | 119 | 'name' => 'phone_mobile', |
120 | 120 | ), |
121 | 121 | ), |
122 | 122 | 3 => |
123 | - array ( |
|
123 | + array( |
|
124 | 124 | 0 => |
125 | - array ( |
|
125 | + array( |
|
126 | 126 | 'name' => 'department', |
127 | 127 | ), |
128 | 128 | 1 => |
129 | - array ( |
|
129 | + array( |
|
130 | 130 | 'name' => 'phone_fax', |
131 | 131 | ), |
132 | 132 | ), |
133 | 133 | 4 => |
134 | - array ( |
|
134 | + array( |
|
135 | 135 | 0 => |
136 | - array ( |
|
136 | + array( |
|
137 | 137 | 'name' => 'account_name', |
138 | 138 | ), |
139 | 139 | 1 => |
140 | - array ( |
|
140 | + array( |
|
141 | 141 | 'name' => 'do_not_call', |
142 | 142 | ), |
143 | 143 | ), |
144 | 144 | 5 => |
145 | - array ( |
|
145 | + array( |
|
146 | 146 | 0 => |
147 | - array ( |
|
147 | + array( |
|
148 | 148 | 'name' => 'email1', |
149 | 149 | ), |
150 | 150 | ), |
151 | 151 | 6 => |
152 | - array ( |
|
152 | + array( |
|
153 | 153 | 0 => |
154 | - array ( |
|
154 | + array( |
|
155 | 155 | 'name' => 'lead_source', |
156 | 156 | ), |
157 | 157 | 1 => |
158 | - array ( |
|
158 | + array( |
|
159 | 159 | 'name' => 'refered_by', |
160 | 160 | ), |
161 | 161 | ), |
162 | 162 | 7 => |
163 | - array ( |
|
163 | + array( |
|
164 | 164 | 0 => |
165 | - array ( |
|
165 | + array( |
|
166 | 166 | 'name' => 'assigned_user_name', |
167 | 167 | ), |
168 | 168 | 1 => |
169 | - array ( |
|
169 | + array( |
|
170 | 170 | 'name' => 'team_name', |
171 | 171 | ), |
172 | 172 | ), |
@@ -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. |
@@ -42,45 +42,45 @@ discard block |
||
42 | 42 | |
43 | 43 | |
44 | 44 | $listViewDefs ['Leads'] = |
45 | -array ( |
|
45 | +array( |
|
46 | 46 | 'NAME' => |
47 | - array ( |
|
47 | + array( |
|
48 | 48 | 'width' => '10%', |
49 | 49 | 'label' => 'LBL_LIST_NAME', |
50 | 50 | 'link' => true, |
51 | 51 | 'orderBy' => 'name', |
52 | 52 | 'default' => true, |
53 | 53 | 'related_fields' => |
54 | - array ( |
|
54 | + array( |
|
55 | 55 | 0 => 'first_name', |
56 | 56 | 1 => 'last_name', |
57 | 57 | 2 => 'salutation', |
58 | 58 | ), |
59 | 59 | ), |
60 | 60 | 'STATUS' => |
61 | - array ( |
|
61 | + array( |
|
62 | 62 | 'width' => '7%', |
63 | 63 | 'label' => 'LBL_LIST_STATUS', |
64 | 64 | 'default' => true, |
65 | 65 | ), |
66 | 66 | 'ACCOUNT_NAME' => |
67 | - array ( |
|
67 | + array( |
|
68 | 68 | 'width' => '15%', |
69 | 69 | 'label' => 'LBL_LIST_ACCOUNT_NAME', |
70 | 70 | 'default' => true, |
71 | 71 | 'related_fields' => |
72 | - array ( |
|
72 | + array( |
|
73 | 73 | 0 => 'account_id', |
74 | 74 | ), |
75 | 75 | ), |
76 | 76 | 'PHONE_WORK' => |
77 | - array ( |
|
77 | + array( |
|
78 | 78 | 'width' => '15%', |
79 | 79 | 'label' => 'LBL_LIST_PHONE', |
80 | 80 | 'default' => true, |
81 | 81 | ), |
82 | 82 | 'EMAIL1' => |
83 | - array ( |
|
83 | + array( |
|
84 | 84 | 'width' => '16%', |
85 | 85 | 'label' => 'LBL_LIST_EMAIL_ADDRESS', |
86 | 86 | 'sortable' => false, |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | 'default' => true, |
89 | 89 | ), |
90 | 90 | 'ASSIGNED_USER_NAME' => |
91 | - array ( |
|
91 | + array( |
|
92 | 92 | 'width' => '5%', |
93 | 93 | 'label' => 'LBL_LIST_ASSIGNED_USER', |
94 | 94 | 'module' => 'Employees', |
@@ -96,133 +96,133 @@ discard block |
||
96 | 96 | 'default' => true, |
97 | 97 | ), |
98 | 98 | 'TITLE' => |
99 | - array ( |
|
99 | + array( |
|
100 | 100 | 'width' => '10%', |
101 | 101 | 'label' => 'LBL_TITLE', |
102 | 102 | 'default' => false, |
103 | 103 | ), |
104 | 104 | 'REFERED_BY' => |
105 | - array ( |
|
105 | + array( |
|
106 | 106 | 'width' => '10%', |
107 | 107 | 'label' => 'LBL_REFERED_BY', |
108 | 108 | 'default' => false, |
109 | 109 | ), |
110 | 110 | 'LEAD_SOURCE' => |
111 | - array ( |
|
111 | + array( |
|
112 | 112 | 'width' => '10%', |
113 | 113 | 'label' => 'LBL_LEAD_SOURCE', |
114 | 114 | 'default' => false, |
115 | 115 | ), |
116 | 116 | 'DEPARTMENT' => |
117 | - array ( |
|
117 | + array( |
|
118 | 118 | 'width' => '10%', |
119 | 119 | 'label' => 'LBL_DEPARTMENT', |
120 | 120 | 'default' => false, |
121 | 121 | ), |
122 | 122 | 'DO_NOT_CALL' => |
123 | - array ( |
|
123 | + array( |
|
124 | 124 | 'width' => '10%', |
125 | 125 | 'label' => 'LBL_DO_NOT_CALL', |
126 | 126 | 'default' => false, |
127 | 127 | ), |
128 | 128 | 'PHONE_HOME' => |
129 | - array ( |
|
129 | + array( |
|
130 | 130 | 'width' => '10%', |
131 | 131 | 'label' => 'LBL_HOME_PHONE', |
132 | 132 | 'default' => false, |
133 | 133 | ), |
134 | 134 | 'PHONE_MOBILE' => |
135 | - array ( |
|
135 | + array( |
|
136 | 136 | 'width' => '10%', |
137 | 137 | 'label' => 'LBL_MOBILE_PHONE', |
138 | 138 | 'default' => false, |
139 | 139 | ), |
140 | 140 | 'PHONE_OTHER' => |
141 | - array ( |
|
141 | + array( |
|
142 | 142 | 'width' => '10%', |
143 | 143 | 'label' => 'LBL_OTHER_PHONE', |
144 | 144 | 'default' => false, |
145 | 145 | ), |
146 | 146 | 'PHONE_FAX' => |
147 | - array ( |
|
147 | + array( |
|
148 | 148 | 'width' => '10%', |
149 | 149 | 'label' => 'LBL_FAX_PHONE', |
150 | 150 | 'default' => false, |
151 | 151 | ), |
152 | 152 | 'PRIMARY_ADDRESS_COUNTRY' => |
153 | - array ( |
|
153 | + array( |
|
154 | 154 | 'width' => '10%', |
155 | 155 | 'label' => 'LBL_PRIMARY_ADDRESS_COUNTRY', |
156 | 156 | 'default' => false, |
157 | 157 | ), |
158 | 158 | 'PRIMARY_ADDRESS_STREET' => |
159 | - array ( |
|
159 | + array( |
|
160 | 160 | 'width' => '10%', |
161 | 161 | 'label' => 'LBL_PRIMARY_ADDRESS_STREET', |
162 | 162 | 'default' => false, |
163 | 163 | ), |
164 | 164 | 'PRIMARY_ADDRESS_CITY' => |
165 | - array ( |
|
165 | + array( |
|
166 | 166 | 'width' => '10%', |
167 | 167 | 'label' => 'LBL_PRIMARY_ADDRESS_CITY', |
168 | 168 | 'default' => false, |
169 | 169 | ), |
170 | 170 | 'PRIMARY_ADDRESS_STATE' => |
171 | - array ( |
|
171 | + array( |
|
172 | 172 | 'width' => '10%', |
173 | 173 | 'label' => 'LBL_PRIMARY_ADDRESS_STATE', |
174 | 174 | 'default' => false, |
175 | 175 | ), |
176 | 176 | 'PRIMARY_ADDRESS_POSTALCODE' => |
177 | - array ( |
|
177 | + array( |
|
178 | 178 | 'width' => '10%', |
179 | 179 | 'label' => 'LBL_PRIMARY_ADDRESS_POSTALCODE', |
180 | 180 | 'default' => false, |
181 | 181 | ), |
182 | 182 | 'ALT_ADDRESS_COUNTRY' => |
183 | - array ( |
|
183 | + array( |
|
184 | 184 | 'width' => '10%', |
185 | 185 | 'label' => 'LBL_ALT_ADDRESS_COUNTRY', |
186 | 186 | 'default' => false, |
187 | 187 | ), |
188 | 188 | 'ALT_ADDRESS_STREET' => |
189 | - array ( |
|
189 | + array( |
|
190 | 190 | 'width' => '10%', |
191 | 191 | 'label' => 'LBL_ALT_ADDRESS_STREET', |
192 | 192 | 'default' => false, |
193 | 193 | ), |
194 | 194 | 'ALT_ADDRESS_CITY' => |
195 | - array ( |
|
195 | + array( |
|
196 | 196 | 'width' => '10%', |
197 | 197 | 'label' => 'LBL_ALT_ADDRESS_CITY', |
198 | 198 | 'default' => false, |
199 | 199 | ), |
200 | 200 | 'ALT_ADDRESS_STATE' => |
201 | - array ( |
|
201 | + array( |
|
202 | 202 | 'width' => '10%', |
203 | 203 | 'label' => 'LBL_ALT_ADDRESS_STATE', |
204 | 204 | 'default' => false, |
205 | 205 | ), |
206 | 206 | 'ALT_ADDRESS_POSTALCODE' => |
207 | - array ( |
|
207 | + array( |
|
208 | 208 | 'width' => '10%', |
209 | 209 | 'label' => 'LBL_ALT_ADDRESS_POSTALCODE', |
210 | 210 | 'default' => false, |
211 | 211 | ), |
212 | 212 | 'CREATED_BY' => |
213 | - array ( |
|
213 | + array( |
|
214 | 214 | 'width' => '10%', |
215 | 215 | 'label' => 'LBL_CREATED', |
216 | 216 | 'default' => false, |
217 | 217 | ), |
218 | 218 | 'MODIFIED_BY_NAME' => |
219 | - array ( |
|
219 | + array( |
|
220 | 220 | 'width' => '5%', |
221 | 221 | 'label' => 'LBL_MODIFIED', |
222 | 222 | 'default' => false, |
223 | 223 | ), |
224 | 224 | 'DATE_ENTERED' => |
225 | - array ( |
|
225 | + array( |
|
226 | 226 | 'width' => '10%', |
227 | 227 | 'label' => 'LBL_DATE_ENTERED', |
228 | 228 | 'default' => true, |
@@ -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. |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | global $current_language; |
57 | 57 | global $mod_strings; |
58 | 58 | |
59 | - if(!isset($_SESSION['SHOW_DUPLICATES'])) |
|
59 | + if (!isset($_SESSION['SHOW_DUPLICATES'])) |
|
60 | 60 | { |
61 | 61 | $GLOBALS['log']->error("Unauthorized access to this area."); |
62 | 62 | sugar_die("Unauthorized access to this area."); |
63 | 63 | } |
64 | 64 | |
65 | - parse_str($_SESSION['SHOW_DUPLICATES'],$_POST); |
|
65 | + parse_str($_SESSION['SHOW_DUPLICATES'], $_POST); |
|
66 | 66 | $post = array_map("securexss", $_POST); |
67 | 67 | foreach ($post as $k => $v) { |
68 | 68 | $_POST[$k] = $v; |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | $duplicateLeads = array(); |
96 | 96 | $db = DBManagerFactory::getInstance(); |
97 | 97 | $result = $db->query($query); |
98 | - $i=0; |
|
99 | - while (($row=$db->fetchByAssoc($result)) != null) { |
|
98 | + $i = 0; |
|
99 | + while (($row = $db->fetchByAssoc($result)) != null) { |
|
100 | 100 | $duplicateLeads[$i] = $row; |
101 | 101 | $i++; |
102 | 102 | } |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | // Bug 25311 - Add special handling for when the form specifies many-to-many relationships |
122 | - if(!empty($_POST['Leadsrelate_to'])) { |
|
122 | + if (!empty($_POST['Leadsrelate_to'])) { |
|
123 | 123 | $input .= "<input type='hidden' name='relate_to' value='{$_POST['Leadsrelate_to']}'>\n"; |
124 | 124 | } |
125 | 125 | |
126 | - if(!empty($_POST['Leadsrelate_id'])) { |
|
126 | + if (!empty($_POST['Leadsrelate_id'])) { |
|
127 | 127 | $input .= "<input type='hidden' name='relate_id' value='{$_POST['Leadsrelate_id']}'>\n"; |
128 | 128 | } |
129 | 129 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $input .= $emailAddress->getEmailAddressWidgetDuplicatesView($lead); |
133 | 133 | |
134 | 134 | $get = ''; |
135 | - if(!empty($_POST['return_module'])) |
|
135 | + if (!empty($_POST['return_module'])) |
|
136 | 136 | { |
137 | 137 | $this->ss->assign('RETURN_MODULE', $_POST['return_module']); |
138 | 138 | } else { |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | $get .= "&return_action="; |
143 | - if(!empty($_POST['return_action'])) |
|
143 | + if (!empty($_POST['return_action'])) |
|
144 | 144 | { |
145 | 145 | $this->ss->assign('RETURN_ACTION', $_POST['return_action']); |
146 | 146 | } else { |
@@ -149,38 +149,38 @@ discard block |
||
149 | 149 | |
150 | 150 | /////////////////////////////////////////////////////////////////////////////// |
151 | 151 | //// INBOUND EMAIL WORKFLOW |
152 | - if(isset($_REQUEST['inbound_email_id'])) { |
|
152 | + if (isset($_REQUEST['inbound_email_id'])) { |
|
153 | 153 | $this->ss->assign('INBOUND_EMAIL_ID', $_REQUEST['inbound_email_id']); |
154 | 154 | $this->ss->assign('RETURN_MODULE', 'Emails'); |
155 | 155 | $this->ss->assign('RETURN_ACTION', 'EditView'); |
156 | - if(isset($_REQUEST['start'])) { |
|
156 | + if (isset($_REQUEST['start'])) { |
|
157 | 157 | $this->ss->assign('START', $_REQUEST['start']); |
158 | 158 | } |
159 | 159 | } |
160 | 160 | //// END INBOUND EMAIL WORKFLOW |
161 | 161 | /////////////////////////////////////////////////////////////////////////////// |
162 | - if(!empty($_POST['popup'])) |
|
162 | + if (!empty($_POST['popup'])) |
|
163 | 163 | { |
164 | 164 | $input .= '<input type="hidden" name="popup" value="'.$_POST['popup'].'">'; |
165 | 165 | } else { |
166 | 166 | $input .= '<input type="hidden" name="popup" value="false">'; |
167 | 167 | } |
168 | 168 | |
169 | - if(!empty($_POST['to_pdf'])) |
|
169 | + if (!empty($_POST['to_pdf'])) |
|
170 | 170 | { |
171 | 171 | $input .= '<input type="hidden" name="to_pdf" value="'.$_POST['to_pdf'].'">'; |
172 | 172 | } else { |
173 | 173 | $input .= '<input type="hidden" name="to_pdf" value="false">'; |
174 | 174 | } |
175 | 175 | |
176 | - if(!empty($_POST['create'])) |
|
176 | + if (!empty($_POST['create'])) |
|
177 | 177 | { |
178 | 178 | $input .= '<input type="hidden" name="create" value="'.$_POST['create'].'">'; |
179 | 179 | } else { |
180 | 180 | $input .= '<input type="hidden" name="create" value="false">'; |
181 | 181 | } |
182 | 182 | |
183 | - if(!empty($_POST['return_id'])) |
|
183 | + if (!empty($_POST['return_id'])) |
|
184 | 184 | { |
185 | 185 | $this->ss->assign('RETURN_ID', $_POST['return_id']); |
186 | 186 | } |
@@ -189,9 +189,9 @@ discard block |
||
189 | 189 | |
190 | 190 | //Load the appropriate template |
191 | 191 | $template = 'modules/Leads/tpls/ShowDuplicates.tpl'; |
192 | - if(file_exists('custom/' . $template)) |
|
192 | + if (file_exists('custom/'.$template)) |
|
193 | 193 | { |
194 | - $template = 'custom/' . $template; |
|
194 | + $template = 'custom/'.$template; |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | $saveLabel = string_format($app_strings['LBL_SAVE_OBJECT'], array($this->module)); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | //// php.exe -f silentUpgrade.php [Path to Upgrade Package zip] [Path to Log file] [Path to Instance] |
43 | 43 | //// See below the Usage for more details. |
44 | 44 | ///////////////////////////////////////////////////////////////////////////////////////// |
45 | -ini_set('memory_limit',-1); |
|
45 | +ini_set('memory_limit', -1); |
|
46 | 46 | /////////////////////////////////////////////////////////////////////////////// |
47 | 47 | //// UTILITIES THAT MUST BE LOCAL :( |
48 | 48 | //local function for clearing cache |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | if ($current = @opendir($thedir)) { |
51 | 51 | while (false !== ($children = readdir($current))) { |
52 | 52 | if ($children != "." && $children != "..") { |
53 | - if (is_dir($thedir . "/" . $children)) { |
|
54 | - clearCacheSU($thedir . "/" . $children, $extension); |
|
53 | + if (is_dir($thedir."/".$children)) { |
|
54 | + clearCacheSU($thedir."/".$children, $extension); |
|
55 | 55 | } |
56 | - elseif (is_file($thedir . "/" . $children) && substr_count($children, $extension)) { |
|
57 | - unlink($thedir . "/" . $children); |
|
56 | + elseif (is_file($thedir."/".$children) && substr_count($children, $extension)) { |
|
57 | + unlink($thedir."/".$children); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | } |
@@ -62,34 +62,34 @@ discard block |
||
62 | 62 | } |
63 | 63 | //Bug 24890, 24892. default_permissions not written to config.php. Following function checks and if |
64 | 64 | //no found then adds default_permissions to the config file. |
65 | - function checkConfigForPermissions(){ |
|
66 | - if(file_exists(getcwd().'/config.php')){ |
|
65 | + function checkConfigForPermissions() { |
|
66 | + if (file_exists(getcwd().'/config.php')) { |
|
67 | 67 | require(getcwd().'/config.php'); |
68 | 68 | } |
69 | 69 | global $sugar_config; |
70 | - if(!isset($sugar_config['default_permissions'])){ |
|
71 | - $sugar_config['default_permissions'] = array ( |
|
70 | + if (!isset($sugar_config['default_permissions'])) { |
|
71 | + $sugar_config['default_permissions'] = array( |
|
72 | 72 | 'dir_mode' => 02770, |
73 | 73 | 'file_mode' => 0660, |
74 | 74 | 'user' => '', |
75 | 75 | 'group' => '', |
76 | 76 | ); |
77 | 77 | ksort($sugar_config); |
78 | - if(is_writable('config.php') && write_array_to_file("sugar_config", $sugar_config,'config.php')) { |
|
78 | + if (is_writable('config.php') && write_array_to_file("sugar_config", $sugar_config, 'config.php')) { |
|
79 | 79 | //writing to the file |
80 | 80 | } |
81 | 81 | } |
82 | 82 | } |
83 | -function checkLoggerSettings(){ |
|
84 | - if(file_exists(getcwd().'/config.php')){ |
|
83 | +function checkLoggerSettings() { |
|
84 | + if (file_exists(getcwd().'/config.php')) { |
|
85 | 85 | require(getcwd().'/config.php'); |
86 | 86 | } |
87 | 87 | global $sugar_config; |
88 | - if(!isset($sugar_config['logger'])){ |
|
89 | - $sugar_config['logger'] =array ( |
|
88 | + if (!isset($sugar_config['logger'])) { |
|
89 | + $sugar_config['logger'] = array( |
|
90 | 90 | 'level'=>'fatal', |
91 | 91 | 'file' => |
92 | - array ( |
|
92 | + array( |
|
93 | 93 | 'ext' => '.log', |
94 | 94 | 'name' => 'sugarcrm', |
95 | 95 | 'dateFormat' => '%c', |
@@ -99,23 +99,23 @@ discard block |
||
99 | 99 | ), |
100 | 100 | ); |
101 | 101 | ksort($sugar_config); |
102 | - if(is_writable('config.php') && write_array_to_file("sugar_config", $sugar_config,'config.php')) { |
|
102 | + if (is_writable('config.php') && write_array_to_file("sugar_config", $sugar_config, 'config.php')) { |
|
103 | 103 | //writing to the file |
104 | 104 | } |
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
108 | -function checkResourceSettings(){ |
|
109 | - if(file_exists(getcwd().'/config.php')){ |
|
108 | +function checkResourceSettings() { |
|
109 | + if (file_exists(getcwd().'/config.php')) { |
|
110 | 110 | require(getcwd().'/config.php'); |
111 | 111 | } |
112 | 112 | global $sugar_config; |
113 | - if(!isset($sugar_config['resource_management'])){ |
|
113 | + if (!isset($sugar_config['resource_management'])) { |
|
114 | 114 | $sugar_config['resource_management'] = |
115 | - array ( |
|
115 | + array( |
|
116 | 116 | 'special_query_limit' => 50000, |
117 | 117 | 'special_query_modules' => |
118 | - array ( |
|
118 | + array( |
|
119 | 119 | 0 => 'Reports', |
120 | 120 | 1 => 'Export', |
121 | 121 | 2 => 'Import', |
@@ -125,22 +125,22 @@ discard block |
||
125 | 125 | 'default_limit' => 1000, |
126 | 126 | ); |
127 | 127 | ksort($sugar_config); |
128 | - if(is_writable('config.php') && write_array_to_file("sugar_config", $sugar_config,'config.php')) { |
|
128 | + if (is_writable('config.php') && write_array_to_file("sugar_config", $sugar_config, 'config.php')) { |
|
129 | 129 | //writing to the file |
130 | 130 | } |
131 | 131 | } |
132 | 132 | } |
133 | 133 | |
134 | -function createMissingRels(){ |
|
135 | - $relForObjects = array('leads'=>'Leads','campaigns'=>'Campaigns','prospects'=>'Prospects'); |
|
136 | - foreach($relForObjects as $relObjName=>$relModName){ |
|
134 | +function createMissingRels() { |
|
135 | + $relForObjects = array('leads'=>'Leads', 'campaigns'=>'Campaigns', 'prospects'=>'Prospects'); |
|
136 | + foreach ($relForObjects as $relObjName=>$relModName) { |
|
137 | 137 | //assigned_user |
138 | 138 | $guid = create_guid(); |
139 | 139 | $query = "SELECT id FROM relationships WHERE relationship_name = '{$relObjName}_assigned_user'"; |
140 | - $result= $GLOBALS['db']->query($query, true); |
|
140 | + $result = $GLOBALS['db']->query($query, true); |
|
141 | 141 | $a = null; |
142 | 142 | $a = $GLOBALS['db']->fetchByAssoc($result); |
143 | - if(!isset($a['id']) && empty($a['id']) ){ |
|
143 | + if (!isset($a['id']) && empty($a['id'])) { |
|
144 | 144 | $qRel = "INSERT INTO relationships (id,relationship_name, lhs_module, lhs_table, lhs_key, rhs_module, rhs_table, rhs_key, join_table, join_key_lhs, join_key_rhs, relationship_type, relationship_role_column, relationship_role_column_value, reverse, deleted) |
145 | 145 | VALUES ('{$guid}', '{$relObjName}_assigned_user','Users','users','id','{$relModName}','{$relObjName}','assigned_user_id',NULL,NULL,NULL,'one-to-many',NULL,NULL,'0','0')"; |
146 | 146 | $GLOBALS['db']->query($qRel); |
@@ -148,10 +148,10 @@ discard block |
||
148 | 148 | //modified_user |
149 | 149 | $guid = create_guid(); |
150 | 150 | $query = "SELECT id FROM relationships WHERE relationship_name = '{$relObjName}_modified_user'"; |
151 | - $result= $GLOBALS['db']->query($query, true); |
|
151 | + $result = $GLOBALS['db']->query($query, true); |
|
152 | 152 | $a = null; |
153 | 153 | $a = $GLOBALS['db']->fetchByAssoc($result); |
154 | - if(!isset($a['id']) && empty($a['id']) ){ |
|
154 | + if (!isset($a['id']) && empty($a['id'])) { |
|
155 | 155 | $qRel = "INSERT INTO relationships (id,relationship_name, lhs_module, lhs_table, lhs_key, rhs_module, rhs_table, rhs_key, join_table, join_key_lhs, join_key_rhs, relationship_type, relationship_role_column, relationship_role_column_value, reverse, deleted) |
156 | 156 | VALUES ('{$guid}', '{$relObjName}_modified_user','Users','users','id','{$relModName}','{$relObjName}','modified_user_id',NULL,NULL,NULL,'one-to-many',NULL,NULL,'0','0')"; |
157 | 157 | $GLOBALS['db']->query($qRel); |
@@ -159,10 +159,10 @@ discard block |
||
159 | 159 | //created_by |
160 | 160 | $guid = create_guid(); |
161 | 161 | $query = "SELECT id FROM relationships WHERE relationship_name = '{$relObjName}_created_by'"; |
162 | - $result= $GLOBALS['db']->query($query, true); |
|
162 | + $result = $GLOBALS['db']->query($query, true); |
|
163 | 163 | $a = null; |
164 | 164 | $a = $GLOBALS['db']->fetchByAssoc($result); |
165 | - if(!isset($a['id']) && empty($a['id']) ){ |
|
165 | + if (!isset($a['id']) && empty($a['id'])) { |
|
166 | 166 | $qRel = "INSERT INTO relationships (id,relationship_name, lhs_module, lhs_table, lhs_key, rhs_module, rhs_table, rhs_key, join_table, join_key_lhs, join_key_rhs, relationship_type, relationship_role_column, relationship_role_column_value, reverse, deleted) |
167 | 167 | VALUES ('{$guid}', '{$relObjName}_created_by','Users','users','id','{$relModName}','{$relObjName}','created_by',NULL,NULL,NULL,'one-to-many',NULL,NULL,'0','0')"; |
168 | 168 | $GLOBALS['db']->query($qRel); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | function merge_passwordsetting($sugar_config, $sugar_version) { |
182 | 182 | $passwordsetting_defaults = array( |
183 | - 'passwordsetting' => array ( |
|
183 | + 'passwordsetting' => array( |
|
184 | 184 | 'SystemGeneratedPasswordON' => '', |
185 | 185 | 'generatepasswordtmpl' => '', |
186 | 186 | 'lostpasswordtmpl' => '', |
@@ -192,18 +192,18 @@ discard block |
||
192 | 192 | 'systexpirationtime' => '', |
193 | 193 | 'systexpirationtype' => '0', |
194 | 194 | 'systexpirationlogin' => '', |
195 | - ) , |
|
195 | + ), |
|
196 | 196 | ); |
197 | 197 | |
198 | 198 | |
199 | - $sugar_config = sugarArrayMerge($passwordsetting_defaults, $sugar_config ); |
|
199 | + $sugar_config = sugarArrayMerge($passwordsetting_defaults, $sugar_config); |
|
200 | 200 | |
201 | 201 | // need to override version with default no matter what |
202 | 202 | $sugar_config['sugar_version'] = $sugar_version; |
203 | 203 | |
204 | - ksort( $sugar_config ); |
|
204 | + ksort($sugar_config); |
|
205 | 205 | |
206 | - if( write_array_to_file( "sugar_config", $sugar_config, "config.php" ) ){ |
|
206 | + if (write_array_to_file("sugar_config", $sugar_config, "config.php")) { |
|
207 | 207 | return true; |
208 | 208 | } |
209 | 209 | else { |
@@ -212,17 +212,17 @@ discard block |
||
212 | 212 | } |
213 | 213 | |
214 | 214 | function addDefaultModuleRoles($defaultRoles = array()) { |
215 | - foreach($defaultRoles as $roleName=>$role){ |
|
216 | - foreach($role as $category=>$actions){ |
|
217 | - foreach($actions as $name=>$access_override){ |
|
215 | + foreach ($defaultRoles as $roleName=>$role) { |
|
216 | + foreach ($role as $category=>$actions) { |
|
217 | + foreach ($actions as $name=>$access_override) { |
|
218 | 218 | $query = "SELECT * FROM acl_actions WHERE name='$name' AND category = '$category' AND acltype='$roleName' AND deleted=0 "; |
219 | 219 | $result = $GLOBALS['db']->query($query); |
220 | 220 | //only add if an action with that name and category don't exist |
221 | - $row=$GLOBALS['db']->fetchByAssoc($result); |
|
221 | + $row = $GLOBALS['db']->fetchByAssoc($result); |
|
222 | 222 | if ($row == null) { |
223 | 223 | $guid = create_guid(); |
224 | 224 | $currdate = gmdate('Y-m-d H:i:s'); |
225 | - $query= "INSERT INTO acl_actions (id,date_entered,date_modified,modified_user_id,name,category,acltype,aclaccess,deleted ) VALUES ('$guid','$currdate','$currdate','1','$name','$category','$roleName','$access_override','0')"; |
|
225 | + $query = "INSERT INTO acl_actions (id,date_entered,date_modified,modified_user_id,name,category,acltype,aclaccess,deleted ) VALUES ('$guid','$currdate','$currdate','1','$name','$category','$roleName','$access_override','0')"; |
|
226 | 226 | $GLOBALS['db']->query($query); |
227 | 227 | } |
228 | 228 | } |
@@ -230,11 +230,11 @@ discard block |
||
230 | 230 | } |
231 | 231 | } |
232 | 232 | |
233 | -function verifyArguments($argv,$usage_dce,$usage_regular){ |
|
233 | +function verifyArguments($argv, $usage_dce, $usage_regular) { |
|
234 | 234 | $upgradeType = ''; |
235 | 235 | $cwd = getcwd(); // default to current, assumed to be in a valid SugarCRM root dir. |
236 | - if(isset($argv[3])) { |
|
237 | - if(is_dir($argv[3])) { |
|
236 | + if (isset($argv[3])) { |
|
237 | + if (is_dir($argv[3])) { |
|
238 | 238 | $cwd = $argv[3]; |
239 | 239 | chdir($cwd); |
240 | 240 | } else { |
@@ -245,12 +245,12 @@ discard block |
||
245 | 245 | } |
246 | 246 | |
247 | 247 | //check if this is an instance |
248 | - if(is_file("{$cwd}/ini_setup.php")){ |
|
248 | + if (is_file("{$cwd}/ini_setup.php")) { |
|
249 | 249 | // this is an instance |
250 | 250 | $upgradeType = constant('DCE_INSTANCE'); |
251 | 251 | //now that this is dce instance we want to make sure that there are |
252 | 252 | // 7 arguments |
253 | - if(count($argv) < 7) { |
|
253 | + if (count($argv) < 7) { |
|
254 | 254 | echo "*******************************************************************************\n"; |
255 | 255 | echo "*** ERROR: Missing required parameters. Received ".count($argv)." argument(s), require 7.\n"; |
256 | 256 | echo $usage_dce; |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | exit(1); |
259 | 259 | } |
260 | 260 | // this is an instance |
261 | - if(!is_dir($argv[1])) { // valid directory . template path? |
|
261 | + if (!is_dir($argv[1])) { // valid directory . template path? |
|
262 | 262 | echo "*******************************************************************************\n"; |
263 | 263 | echo "*** ERROR: First argument must be a full path to the template. Got [ {$argv[1]} ].\n"; |
264 | 264 | echo $usage_dce; |
@@ -266,18 +266,18 @@ discard block |
||
266 | 266 | exit(1); |
267 | 267 | } |
268 | 268 | } |
269 | - else if(is_file("{$cwd}/include/entryPoint.php")) { |
|
269 | + else if (is_file("{$cwd}/include/entryPoint.php")) { |
|
270 | 270 | //this should be a regular sugar install |
271 | 271 | $upgradeType = constant('SUGARCRM_INSTALL'); |
272 | 272 | //check if this is a valid zip file |
273 | - if(!is_file($argv[1])) { // valid zip? |
|
273 | + if (!is_file($argv[1])) { // valid zip? |
|
274 | 274 | echo "*******************************************************************************\n"; |
275 | 275 | echo "*** ERROR: First argument must be a full path to the patch file. Got [ {$argv[1]} ].\n"; |
276 | 276 | echo $usage_regular; |
277 | 277 | echo "FAILURE\n"; |
278 | 278 | exit(1); |
279 | 279 | } |
280 | - if(count($argv) < 5) { |
|
280 | + if (count($argv) < 5) { |
|
281 | 281 | echo "*******************************************************************************\n"; |
282 | 282 | echo "*** ERROR: Missing required parameters. Received ".count($argv)." argument(s), require 5.\n"; |
283 | 283 | echo $usage_regular; |
@@ -292,29 +292,29 @@ discard block |
||
292 | 292 | exit(1); |
293 | 293 | } |
294 | 294 | |
295 | - if(isset($argv[7]) && file_exists($argv[7].'SugarTemplateUtilties.php')){ |
|
295 | + if (isset($argv[7]) && file_exists($argv[7].'SugarTemplateUtilties.php')) { |
|
296 | 296 | require_once($argv[7].'SugarTemplateUtilties.php'); |
297 | 297 | } |
298 | 298 | |
299 | 299 | return $upgradeType; |
300 | 300 | } |
301 | 301 | |
302 | -function upgradeDCEFiles($argv,$instanceUpgradePath){ |
|
302 | +function upgradeDCEFiles($argv, $instanceUpgradePath) { |
|
303 | 303 | //copy and update following files from upgrade package |
304 | - $upgradeTheseFiles = array('cron.php','download.php','index.php','install.php','soap.php','sugar_version.php','vcal_server.php'); |
|
305 | - foreach($upgradeTheseFiles as $file){ |
|
304 | + $upgradeTheseFiles = array('cron.php', 'download.php', 'index.php', 'install.php', 'soap.php', 'sugar_version.php', 'vcal_server.php'); |
|
305 | + foreach ($upgradeTheseFiles as $file) { |
|
306 | 306 | $srcFile = clean_path("{$instanceUpgradePath}/$file"); |
307 | 307 | $destFile = clean_path("{$argv[3]}/$file"); |
308 | - if(file_exists($srcFile)){ |
|
309 | - if(!is_dir(dirname($destFile))) { |
|
308 | + if (file_exists($srcFile)) { |
|
309 | + if (!is_dir(dirname($destFile))) { |
|
310 | 310 | mkdir_recursive(dirname($destFile)); // make sure the directory exists |
311 | 311 | } |
312 | - copy_recursive($srcFile,$destFile); |
|
312 | + copy_recursive($srcFile, $destFile); |
|
313 | 313 | $_GET['TEMPLATE_PATH'] = $destFile; |
314 | 314 | $_GET['CONVERT_FILE_ONLY'] = true; |
315 | - if(!class_exists('TemplateConverter')){ |
|
315 | + if (!class_exists('TemplateConverter')) { |
|
316 | 316 | include($argv[7].'templateConverter.php'); |
317 | - }else{ |
|
317 | + } else { |
|
318 | 318 | TemplateConverter::convertFile($_GET['TEMPLATE_PATH']); |
319 | 319 | } |
320 | 320 | |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | |
326 | 326 | |
327 | 327 | |
328 | -function threeWayMerge(){ |
|
328 | +function threeWayMerge() { |
|
329 | 329 | //using threeway merge apis |
330 | 330 | } |
331 | 331 | //// END UTILITIES THAT MUST BE LOCAL :( |
@@ -339,8 +339,8 @@ discard block |
||
339 | 339 | //End of #52872 |
340 | 340 | |
341 | 341 | // only run from command line |
342 | -if(isset($_SERVER['HTTP_USER_AGENT'])) { |
|
343 | - fwrite(STDERR,'This utility may only be run from the command line or command prompt.'); |
|
342 | +if (isset($_SERVER['HTTP_USER_AGENT'])) { |
|
343 | + fwrite(STDERR, 'This utility may only be run from the command line or command prompt.'); |
|
344 | 344 | exit(1); |
345 | 345 | } |
346 | 346 | //Clean_string cleans out any file passed in as a parameter |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | |
350 | 350 | /////////////////////////////////////////////////////////////////////////////// |
351 | 351 | //// USAGE |
352 | -$usage_dce =<<<eoq1 |
|
352 | +$usage_dce = <<<eoq1 |
|
353 | 353 | Usage: php.exe -f silentUpgrade.php [upgradeZipFile] [logFile] [pathToSugarInstance] |
354 | 354 | |
355 | 355 | On Command Prompt Change directory to where silentUpgrade.php resides. Then type path to |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | |
371 | 371 | eoq1; |
372 | 372 | |
373 | -$usage_regular =<<<eoq2 |
|
373 | +$usage_regular = <<<eoq2 |
|
374 | 374 | Usage: php.exe -f silentUpgrade.php [upgradeZipFile] [logFile] [pathToSugarInstance] [admin-user] |
375 | 375 | |
376 | 376 | On Command Prompt Change directory to where silentUpgrade.php resides. Then type path to |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | |
393 | 393 | /////////////////////////////////////////////////////////////////////////////// |
394 | 394 | //// STANDARD REQUIRED SUGAR INCLUDES AND PRESETS |
395 | -if(!defined('sugarEntry')) define('sugarEntry', true); |
|
395 | +if (!defined('sugarEntry')) define('sugarEntry', true); |
|
396 | 396 | |
397 | 397 | $_SESSION = array(); |
398 | 398 | $_SESSION['schema_change'] = 'sugar'; // we force-run all SQL |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | global $cwd; |
410 | 410 | $cwd = getcwd(); // default to current, assumed to be in a valid SugarCRM root dir. |
411 | 411 | |
412 | -$upgradeType = verifyArguments($argv,$usage_dce,$usage_regular); |
|
412 | +$upgradeType = verifyArguments($argv, $usage_dce, $usage_regular); |
|
413 | 413 | |
414 | 414 | /////////////////////////////////////////////////////////////////////////////// |
415 | 415 | ////// Verify that all the arguments are appropriately placed//////////////// |
@@ -419,14 +419,14 @@ discard block |
||
419 | 419 | //$GLOBALS['log'] = LoggerManager::getLogger('SugarCRM'); |
420 | 420 | //require_once('/var/www/html/eddy/sugarnode/SugarTemplateUtilities.php'); |
421 | 421 | |
422 | -$path = $argv[2]; // custom log file, if blank will use ./upgradeWizard.log |
|
422 | +$path = $argv[2]; // custom log file, if blank will use ./upgradeWizard.log |
|
423 | 423 | //$db = &DBManagerFactory::getInstance(); //<--------- |
424 | 424 | |
425 | 425 | |
426 | 426 | //$UWstrings = return_module_language('en_us', 'UpgradeWizard'); |
427 | 427 | //$adminStrings = return_module_language('en_us', 'Administration'); |
428 | 428 | //$mod_strings = array_merge($adminStrings, $UWstrings); |
429 | -$subdirs = array('full', 'langpack', 'module', 'patch', 'theme', 'temp'); |
|
429 | +$subdirs = array('full', 'langpack', 'module', 'patch', 'theme', 'temp'); |
|
430 | 430 | |
431 | 431 | //$_REQUEST['zip_from_dir'] = $zip_from_dir; |
432 | 432 | |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | $errors = array(); |
449 | 449 | |
450 | 450 | |
451 | -if($upgradeType == constant('DCE_INSTANCE')){ |
|
451 | +if ($upgradeType == constant('DCE_INSTANCE')) { |
|
452 | 452 | //$instanceUpgradePath = "{$argv[1]}/DCEUpgrade/{$zip_from_dir}"; |
453 | 453 | //$instanceUpgradePath = "{$argv[1]}"; |
454 | 454 | include ("ini_setup.php"); |
@@ -494,25 +494,25 @@ discard block |
||
494 | 494 | $isDCEInstance = true; |
495 | 495 | $configOptions = $sugar_config['dbconfig']; |
496 | 496 | |
497 | - $GLOBALS['log'] = LoggerManager::getLogger('SugarCRM'); |
|
498 | - $db = &DBManagerFactory::getInstance(); |
|
497 | + $GLOBALS['log'] = LoggerManager::getLogger('SugarCRM'); |
|
498 | + $db = &DBManagerFactory::getInstance(); |
|
499 | 499 | /////////////////////////////////////////////////////////////////////////////// |
500 | 500 | //// MAKE SURE PATCH IS COMPATIBLE |
501 | 501 | |
502 | - if(is_file("{$argv[1]}/manifest.php")) { |
|
502 | + if (is_file("{$argv[1]}/manifest.php")) { |
|
503 | 503 | // provides $manifest array |
504 | 504 | include("{$argv[1]}/manifest.php"); |
505 | 505 | } |
506 | 506 | //If Instance then the files will be accessed from Template/DCEUpgrade folder |
507 | 507 | $zip_from_dir = ''; |
508 | - if( isset( $manifest['copy_files']['from_dir'] ) && $manifest['copy_files']['from_dir'] != "" ){ |
|
509 | - $zip_from_dir = $manifest['copy_files']['from_dir']; |
|
508 | + if (isset($manifest['copy_files']['from_dir']) && $manifest['copy_files']['from_dir'] != "") { |
|
509 | + $zip_from_dir = $manifest['copy_files']['from_dir']; |
|
510 | 510 | } |
511 | 511 | |
512 | 512 | $instanceUpgradePath = "{$argv[1]}/{$zip_from_dir}"; |
513 | 513 | $_SESSION['sugar_version_file'] = ''; |
514 | 514 | $srcFile = clean_path("{$instanceUpgradePath}/sugar_version.php"); |
515 | - if(file_exists($srcFile)) { |
|
515 | + if (file_exists($srcFile)) { |
|
516 | 516 | $_SESSION['sugar_version_file'] = $srcFile; |
517 | 517 | } |
518 | 518 | |
@@ -520,9 +520,9 @@ discard block |
||
520 | 520 | global $instancePath; |
521 | 521 | $instancePath = $instanceUpgradePath; |
522 | 522 | $_SESSION['instancePath'] = $instancePath; |
523 | - if(file_exists("{$instanceUpgradePath}/modules/UpgradeWizard/uw_utils.php")){ |
|
523 | + if (file_exists("{$instanceUpgradePath}/modules/UpgradeWizard/uw_utils.php")) { |
|
524 | 524 | require_once("{$instanceUpgradePath}/modules/UpgradeWizard/uw_utils.php"); |
525 | - } else{ |
|
525 | + } else { |
|
526 | 526 | require_once("{$newtemplate_path}/modules/UpgradeWizard/uw_utils.php"); |
527 | 527 | } |
528 | 528 | |
@@ -532,8 +532,8 @@ discard block |
||
532 | 532 | //check for db upgrade |
533 | 533 | //check exit on conflicts |
534 | 534 | $skipDBUpgrade = 'no'; //default |
535 | - if($argv[6] != null && !empty($argv[6])){ |
|
536 | - if(strtolower($argv[6]) == 'yes'){ |
|
535 | + if ($argv[6] != null && !empty($argv[6])) { |
|
536 | + if (strtolower($argv[6]) == 'yes') { |
|
537 | 537 | $skipDBUpgrade = 'yes'; //override |
538 | 538 | } |
539 | 539 | } |
@@ -543,12 +543,12 @@ discard block |
||
543 | 543 | global $path; |
544 | 544 | $path = $argv[2]; |
545 | 545 | |
546 | - if($skipDBUpgrade == 'no'){ |
|
546 | + if ($skipDBUpgrade == 'no') { |
|
547 | 547 | //upgrade the db |
548 | 548 | /////////////////////////////////////////////////////////////////////////////// |
549 | 549 | //// HANDLE PREINSTALL SCRIPTS |
550 | 550 | $file = "{$argv[1]}/".constant('SUGARCRM_PRE_INSTALL_FILE'); |
551 | - if(is_file($file)) { |
|
551 | + if (is_file($file)) { |
|
552 | 552 | include($file); |
553 | 553 | logThis('Running pre_install()...', $path); |
554 | 554 | pre_install(); |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | |
558 | 558 | |
559 | 559 | //run the 3-way merge |
560 | - if(file_exists($newtemplate_path.'/modules/UpgradeWizard/SugarMerge/SugarMerge.php')){ |
|
560 | + if (file_exists($newtemplate_path.'/modules/UpgradeWizard/SugarMerge/SugarMerge.php')) { |
|
561 | 561 | logThis('Running 3 way merge()...', $path); |
562 | 562 | require_once($newtemplate_path.'/modules/UpgradeWizard/SugarMerge/SugarMerge.php'); |
563 | 563 | $merger = new SugarMerge($instanceUpgradePath, $argv[4].'/', $argv[3].'/custom'); |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | |
568 | 568 | logThis('Starting post_install()...', $path); |
569 | 569 | $file = "{$argv[1]}/".constant('SUGARCRM_POST_INSTALL_FILE'); |
570 | - if(is_file($file)) { |
|
570 | + if (is_file($file)) { |
|
571 | 571 | include($file); |
572 | 572 | post_install(); |
573 | 573 | } |
@@ -590,14 +590,14 @@ discard block |
||
590 | 590 | logThis('Set default_max_tabs to 7', $path); |
591 | 591 | $sugar_config['default_max_tabs'] = '7'; |
592 | 592 | |
593 | - if( !write_array_to_file( "sugar_config", $sugar_config, "config.php" ) ) { |
|
593 | + if (!write_array_to_file("sugar_config", $sugar_config, "config.php")) { |
|
594 | 594 | logThis('*** ERROR: could not write config.php! - upgrade will fail!', $path); |
595 | 595 | $errors[] = 'Could not write config.php!'; |
596 | 596 | } |
597 | 597 | |
598 | 598 | //check to see if there are any new files that need to be added to systems tab |
599 | 599 | //retrieve old modules list |
600 | - logThis('check to see if new modules exist',$path); |
|
600 | + logThis('check to see if new modules exist', $path); |
|
601 | 601 | $oldModuleList = array(); |
602 | 602 | $newModuleList = array(); |
603 | 603 | include($argv[4].'/include/modules.php'); |
@@ -624,18 +624,18 @@ discard block |
||
624 | 624 | $GLOBALS['reload_vardefs'] = true; |
625 | 625 | |
626 | 626 | foreach ($beanFiles as $bean => $file) { |
627 | - if(file_exists($newtemplate_path . '/' . $file) && $bean != 'UpgradeHistory'){ |
|
627 | + if (file_exists($newtemplate_path.'/'.$file) && $bean != 'UpgradeHistory') { |
|
628 | 628 | unset($GLOBALS['dictionary'][$bean]); |
629 | - require_once($newtemplate_path . '/' . $file); |
|
629 | + require_once($newtemplate_path.'/'.$file); |
|
630 | 630 | |
631 | - $focus = new $bean (); |
|
632 | - if(empty($focus->table_name) || isset($repairedTables[$focus->table_name])) { |
|
631 | + $focus = new $bean(); |
|
632 | + if (empty($focus->table_name) || isset($repairedTables[$focus->table_name])) { |
|
633 | 633 | continue; |
634 | 634 | } |
635 | 635 | |
636 | 636 | if (($focus instanceOf SugarBean)) { |
637 | 637 | $sql = $db->repairTable($focus, true); |
638 | - if(!empty($sql)) { |
|
638 | + if (!empty($sql)) { |
|
639 | 639 | logThis($sql, $path); |
640 | 640 | $repairedTables[$focus->table_name] = true; |
641 | 641 | } |
@@ -648,14 +648,14 @@ discard block |
||
648 | 648 | foreach ($dictionary as $meta) { |
649 | 649 | $tablename = $meta['table']; |
650 | 650 | |
651 | - if(isset($repairedTables[$tablename])) { |
|
651 | + if (isset($repairedTables[$tablename])) { |
|
652 | 652 | continue; |
653 | 653 | } |
654 | 654 | |
655 | 655 | $fielddefs = $meta['fields']; |
656 | 656 | $indices = $meta['indices']; |
657 | 657 | $sql = $GLOBALS['db']->repairTableParams($tablename, $fielddefs, $indices, true); |
658 | - if(!empty($sql)) { |
|
658 | + if (!empty($sql)) { |
|
659 | 659 | logThis($sql, $path); |
660 | 660 | $repairedTables[$tablename] = true; |
661 | 661 | } |
@@ -672,39 +672,39 @@ discard block |
||
672 | 672 | $oldModuleList = $newTB->get_key_array($oldModuleList); |
673 | 673 | |
674 | 674 | //iterate through list and remove commonalities to get new modules |
675 | - foreach ($newModuleList as $remove_mod){ |
|
676 | - if(in_array($remove_mod, $oldModuleList)){ |
|
675 | + foreach ($newModuleList as $remove_mod) { |
|
676 | + if (in_array($remove_mod, $oldModuleList)) { |
|
677 | 677 | unset($newModuleList[$remove_mod]); |
678 | 678 | } |
679 | 679 | } |
680 | 680 | //new modules list now has left over modules which are new to this install, so lets add them to the system tabs |
681 | - logThis('new modules to add are '.var_export($newModuleList,true),$path); |
|
681 | + logThis('new modules to add are '.var_export($newModuleList, true), $path); |
|
682 | 682 | |
683 | 683 | //grab the existing system tabs |
684 | 684 | $tabs = $newTB->get_system_tabs(); |
685 | 685 | |
686 | 686 | //add the new tabs to the array |
687 | - foreach($newModuleList as $nm ){ |
|
687 | + foreach ($newModuleList as $nm) { |
|
688 | 688 | $tabs[$nm] = $nm; |
689 | 689 | } |
690 | 690 | |
691 | 691 | //now assign the modules to system tabs |
692 | 692 | $newTB->set_system_tabs($tabs); |
693 | - logThis('module tabs updated',$path); |
|
693 | + logThis('module tabs updated', $path); |
|
694 | 694 | |
695 | 695 | |
696 | 696 | |
697 | - if($ce_to_pro_ent){ |
|
697 | + if ($ce_to_pro_ent) { |
|
698 | 698 | //add the global team if it does not exist |
699 | 699 | $globalteam = new Team(); |
700 | 700 | $globalteam->retrieve('1'); |
701 | 701 | include($newtemplate_path.'/modules/Administration/language/en_us.lang.php'); |
702 | - if(isset($globalteam->name)){ |
|
702 | + if (isset($globalteam->name)) { |
|
703 | 703 | |
704 | 704 | echo 'Global '.$mod_strings['LBL_UPGRADE_TEAM_EXISTS'].'<br>'; |
705 | 705 | logThis(" Finish Building private teams", $path); |
706 | 706 | |
707 | - }else{ |
|
707 | + } else { |
|
708 | 708 | $globalteam->create_team("Global", $mod_strings['LBL_GLOBAL_TEAM_DESC'], $globalteam->global_team); |
709 | 709 | } |
710 | 710 | |
@@ -719,20 +719,20 @@ discard block |
||
719 | 719 | logThis(" Finish Building the team_set and team_sets_teams", $path); |
720 | 720 | |
721 | 721 | //upgrade teams |
722 | - if(file_exists($newtemplate_path.'/modules/Administration/upgradeTeams.php')) { |
|
722 | + if (file_exists($newtemplate_path.'/modules/Administration/upgradeTeams.php')) { |
|
723 | 723 | logThis(" Start {$newtemplate_path}/modules/Administration/upgradeTeams.php", $path); |
724 | 724 | include($newtemplate_path.'/modules/Administration/upgradeTeams.php'); |
725 | 725 | logThis(" Finish {$newtemplate_path}/modules/Administration/upgradeTeams.php", $path); |
726 | 726 | |
727 | 727 | //update the users records to have default team |
728 | - logThis('running query to populate default_team on users table',$path); |
|
728 | + logThis('running query to populate default_team on users table', $path); |
|
729 | 729 | $GLOBALS['db']->query("update users set default_team = (select teams.id from teams where teams.name = concat('(',users.user_name, ')') or team.associated_user_id = users.id)"); |
730 | 730 | |
731 | 731 | } |
732 | 732 | |
733 | 733 | //run upgrade script for dashlets to include sales/marketing |
734 | - if(function_exists('upgradeDashletsForSalesAndMarketing')){ |
|
735 | - logThis('calling upgradeDashlets script',$path); |
|
734 | + if (function_exists('upgradeDashletsForSalesAndMarketing')) { |
|
735 | + logThis('calling upgradeDashlets script', $path); |
|
736 | 736 | upgradeDashletsForSalesAndMarketing(); |
737 | 737 | } |
738 | 738 | |
@@ -743,15 +743,15 @@ discard block |
||
743 | 743 | global $sugar_config; |
744 | 744 | |
745 | 745 | require("{$instanceUpgradePath}/sugar_version.php"); |
746 | - if(!rebuildConfigFile($sugar_config, $sugar_version)) { |
|
746 | + if (!rebuildConfigFile($sugar_config, $sugar_version)) { |
|
747 | 747 | logThis('*** ERROR: could not write config.php! - upgrade will fail!', $path); |
748 | 748 | $errors[] = 'Could not write config.php!'; |
749 | 749 | } |
750 | 750 | checkConfigForPermissions(); |
751 | 751 | |
752 | 752 | // clear out the theme cache |
753 | - if(!class_exists('SugarThemeRegistry')){ |
|
754 | - require_once($newtemplate_path . '/include/SugarTheme/SugarTheme.php'); |
|
753 | + if (!class_exists('SugarThemeRegistry')) { |
|
754 | + require_once($newtemplate_path.'/include/SugarTheme/SugarTheme.php'); |
|
755 | 755 | } |
756 | 756 | SugarThemeRegistry::buildRegistry(); |
757 | 757 | SugarThemeRegistry::clearAllCaches(); |
@@ -759,7 +759,7 @@ discard block |
||
759 | 759 | // re-minify the JS source files |
760 | 760 | $_REQUEST['root_directory'] = getcwd(); |
761 | 761 | $_REQUEST['js_rebuild_concat'] = 'rebuild'; |
762 | - require_once($newtemplate_path . '/jssource/minify.php'); |
|
762 | + require_once($newtemplate_path.'/jssource/minify.php'); |
|
763 | 763 | |
764 | 764 | //as last step, rebuild the language files and rebuild relationships |
765 | 765 | /* |
@@ -776,55 +776,55 @@ discard block |
||
776 | 776 | |
777 | 777 | |
778 | 778 | //Also set the tracker settings if flavor conversion ce->pro or ce->ent |
779 | -if(isset($_SESSION['current_db_version']) && isset($_SESSION['target_db_version'])){ |
|
779 | +if (isset($_SESSION['current_db_version']) && isset($_SESSION['target_db_version'])) { |
|
780 | 780 | if (version_compare($_SESSION['current_db_version'], $_SESSION['target_db_version'], '=')) |
781 | 781 | { |
782 | 782 | $_REQUEST['upgradeWizard'] = true; |
783 | 783 | ob_start(); |
784 | 784 | include('include/Smarty/internals/core.write_file.php'); |
785 | 785 | ob_end_clean(); |
786 | - $db =& DBManagerFactory::getInstance(); |
|
787 | - if($ce_to_pro_ent){ |
|
786 | + $db = & DBManagerFactory::getInstance(); |
|
787 | + if ($ce_to_pro_ent) { |
|
788 | 788 | //Also set license information |
789 | 789 | $admin = new Administration(); |
790 | 790 | $category = 'license'; |
791 | 791 | $value = 0; |
792 | 792 | $admin->saveSetting($category, 'users', $value); |
793 | - $key = array('num_lic_oc','key','expire_date'); |
|
793 | + $key = array('num_lic_oc', 'key', 'expire_date'); |
|
794 | 794 | $value = ''; |
795 | - foreach($key as $k){ |
|
795 | + foreach ($key as $k) { |
|
796 | 796 | $admin->saveSetting($category, $k, $value); |
797 | 797 | } |
798 | 798 | } |
799 | 799 | } |
800 | 800 | } |
801 | 801 | |
802 | -set_upgrade_progress('end','done','end','done'); |
|
802 | +set_upgrade_progress('end', 'done', 'end', 'done'); |
|
803 | 803 | |
804 | -if(file_exists($newtemplate_path . '/modules/Configurator/Configurator.php')){ |
|
805 | - set_upgrade_progress('configurator','in_progress'); |
|
806 | - require_once($newtemplate_path . '/include/utils/array_utils.php'); |
|
807 | - if(!class_exists('Configurator')){ |
|
808 | - require_once($newtemplate_path . '/modules/Configurator/Configurator.php'); |
|
804 | +if (file_exists($newtemplate_path.'/modules/Configurator/Configurator.php')) { |
|
805 | + set_upgrade_progress('configurator', 'in_progress'); |
|
806 | + require_once($newtemplate_path.'/include/utils/array_utils.php'); |
|
807 | + if (!class_exists('Configurator')) { |
|
808 | + require_once($newtemplate_path.'/modules/Configurator/Configurator.php'); |
|
809 | 809 | } |
810 | 810 | $Configurator = new Configurator(); |
811 | - if(class_exists('Configurator')){ |
|
811 | + if (class_exists('Configurator')) { |
|
812 | 812 | $Configurator->parseLoggerSettings(); |
813 | 813 | } |
814 | - set_upgrade_progress('configurator','done'); |
|
814 | + set_upgrade_progress('configurator', 'done'); |
|
815 | 815 | } |
816 | 816 | |
817 | 817 | //unset the logger previously instantiated |
818 | -if(file_exists($newtemplate_path . '/include/SugarLogger/LoggerManager.php')){ |
|
819 | - set_upgrade_progress('logger','in_progress'); |
|
820 | - if(!class_exists('LoggerManager')){ |
|
818 | +if (file_exists($newtemplate_path.'/include/SugarLogger/LoggerManager.php')) { |
|
819 | + set_upgrade_progress('logger', 'in_progress'); |
|
820 | + if (!class_exists('LoggerManager')) { |
|
821 | 821 | |
822 | 822 | } |
823 | - if(class_exists('LoggerManager')){ |
|
823 | + if (class_exists('LoggerManager')) { |
|
824 | 824 | unset($GLOBALS['log']); |
825 | 825 | $GLOBALS['log'] = LoggerManager::getLogger('SugarCRM'); |
826 | 826 | } |
827 | - set_upgrade_progress('logger','done'); |
|
827 | + set_upgrade_progress('logger', 'done'); |
|
828 | 828 | } |
829 | 829 | |
830 | 830 | /////////////////////////////////////////////////////////////////////////////// |
@@ -832,8 +832,8 @@ discard block |
||
832 | 832 | $phpErrors = ob_get_contents(); |
833 | 833 | ob_end_clean(); |
834 | 834 | |
835 | -if(count($errors) > 0) { |
|
836 | - foreach($errors as $error) { |
|
835 | +if (count($errors) > 0) { |
|
836 | + foreach ($errors as $error) { |
|
837 | 837 | logThis("****** SilentUpgrade ERROR: {$error}", $path); |
838 | 838 | } |
839 | 839 | echo "FAILED\n"; |