@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -50,8 +52,7 @@ discard block |
||
50 | 52 | $focus = new Meeting(); |
51 | 53 | $focus->id = $_REQUEST['object_id']; |
52 | 54 | $test = $focus->set_accept_status($current_user, $_REQUEST['accept_status']); |
53 | - } |
|
54 | - else if ($_REQUEST['object_type'] == "Call") |
|
55 | + } else if ($_REQUEST['object_type'] == "Call") |
|
55 | 56 | { |
56 | 57 | $focus = new Call(); |
57 | 58 | $focus->id = $_REQUEST['object_id']; |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( !defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if ( !defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -74,7 +76,7 @@ discard block |
||
74 | 76 | $max_time = $seconds; |
75 | 77 | } |
76 | 78 | } |
77 | - }else{ |
|
79 | + } else{ |
|
78 | 80 | $max_time = 8400; |
79 | 81 | } |
80 | 82 | $this->now = $GLOBALS['timedate']->nowDb(); |
@@ -130,15 +132,15 @@ discard block |
||
130 | 132 | |
131 | 133 | if ( empty($_SESSION['authenticated_user_language']) ) { |
132 | 134 | $current_language = $GLOBALS['sugar_config']['default_language']; |
133 | - }else{ |
|
135 | + } else{ |
|
134 | 136 | $current_language = $_SESSION['authenticated_user_language']; |
135 | 137 | } |
136 | 138 | |
137 | 139 | if ( !empty($bean->created_by) ) { |
138 | 140 | $user_id = $bean->created_by; |
139 | - }else if ( !empty($bean->assigned_user_id) ) { |
|
141 | + } else if ( !empty($bean->assigned_user_id) ) { |
|
140 | 142 | $user_id = $bean->assigned_user_id; |
141 | - }else { |
|
143 | + } else { |
|
142 | 144 | $user_id = $GLOBALS['current_user']->id; |
143 | 145 | } |
144 | 146 | $user = new User(); |
@@ -153,8 +155,7 @@ discard block |
||
153 | 155 | { |
154 | 156 | $from_address = $admin->settings['notify_fromaddress']; |
155 | 157 | $from_name = $admin->settings['notify_fromname'] ? "" : $admin->settings['notify_fromname']; |
156 | - } |
|
157 | - else |
|
158 | + } else |
|
158 | 159 | { |
159 | 160 | $from_address = $user->emailAddress->getReplyToAddress($user); |
160 | 161 | $from_name = $user->full_name; |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -56,31 +58,54 @@ discard block |
||
56 | 58 | |
57 | 59 | if(!empty($fields['PRIMARY_ADDRESS_STREET']) || !empty($fields['PRIMARY_ADDRESS_CITY']) || |
58 | 60 | !empty($fields['PRIMARY_ADDRESS_STATE']) || !empty($fields['PRIMARY_ADDRESS_POSTALCODE']) || |
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)) |
|
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>'; |
|
61 | + !empty($fields['PRIMARY_ADDRESS_COUNTRY'])) { |
|
62 | + $overlib_string .= '<b>' . $mod_strings['LBL_PRIMARY_ADDRESS'] . '</b><br>'; |
|
63 | + } |
|
64 | + if(!empty($fields['PRIMARY_ADDRESS_STREET'])) { |
|
65 | + $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'] . '<br>'; |
|
66 | + } |
|
67 | + if(!empty($fields['PRIMARY_ADDRESS_CITY'])) { |
|
68 | + $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'] . ', '; |
|
69 | + } |
|
70 | + if(!empty($fields['PRIMARY_ADDRESS_STATE'])) { |
|
71 | + $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'] . ' '; |
|
72 | + } |
|
73 | + if(!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) { |
|
74 | + $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'] . ' '; |
|
75 | + } |
|
76 | + if(!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) { |
|
77 | + $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'] . '<br>'; |
|
78 | + } |
|
79 | + if(strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) { |
|
80 | + $overlib_string .= '<br>'; |
|
81 | + } |
|
82 | + if(!empty($fields['PHONE_MOBILE'])) { |
|
83 | + $overlib_string .= '<b>'. $mod_strings['LBL_MOBILE_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_MOBILE'] . '</span><br>'; |
|
84 | + } |
|
85 | + if(!empty($fields['PHONE_HOME'])) { |
|
86 | + $overlib_string .= '<b>'. $mod_strings['LBL_HOME_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_HOME'] . '</span><br>'; |
|
87 | + } |
|
88 | + if(!empty($fields['PHONE_OTHER'])) { |
|
89 | + $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_OTHER'] . '</span><br>'; |
|
90 | + } |
|
91 | + if(!empty($fields['LEAD_SOURCE'])) { |
|
92 | + $overlib_string .= '<b>'. $mod_strings['LBL_LEAD_SOURCE'] . '</b> ' . $fields['LEAD_SOURCE'] . '<br>'; |
|
93 | + } |
|
72 | 94 | |
73 | - if(!empty($fields['EMAIL2'])) |
|
74 | - $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_EMAIL_ADDRESS'] . '</b> ' . |
|
95 | + if(!empty($fields['EMAIL2'])) { |
|
96 | + $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_EMAIL_ADDRESS'] . '</b> ' . |
|
75 | 97 | "<a href=index.php?module=Emails&action=Compose&contact_id={$fields['ID']}&" . |
76 | 98 | "parent_type=Contacts&parent_id={$fields['ID']}&to_addrs_ids={$fields['ID']}&to_addrs_names" . |
77 | 99 | "={$fields['FIRST_NAME']} {$fields['LAST_NAME']}&to_addrs_emails={$fields['EMAIL2']}&" . |
78 | 100 | "to_email_addrs=" . urlencode("{$fields['FIRST_NAME']} {$fields['LAST_NAME']} <{$fields['EMAIL2']}>") . |
79 | 101 | "&return_module=Contacts&return_action=ListView'>{$fields['EMAIL2']}</a><br>"; |
102 | + } |
|
80 | 103 | |
81 | 104 | if(!empty($fields['DESCRIPTION'])) { |
82 | 105 | $overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300); |
83 | - if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...'; |
|
106 | + if(strlen($fields['DESCRIPTION']) > 300) { |
|
107 | + $overlib_string .= '...'; |
|
108 | + } |
|
84 | 109 | } |
85 | 110 | |
86 | 111 | return array('fieldToAddTo' => 'NAME', |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -85,7 +87,9 @@ discard block |
||
85 | 87 | $first = true; |
86 | 88 | foreach ($duplicates as $duplicate_id) |
87 | 89 | { |
88 | - if (!$first) $query .= ' OR '; |
|
90 | + if (!$first) { |
|
91 | + $query .= ' OR '; |
|
92 | + } |
|
89 | 93 | $first = false; |
90 | 94 | $query .= "id='$duplicate_id' "; |
91 | 95 | } |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -179,8 +181,7 @@ discard block |
||
179 | 181 | if($sugar_config['lead_conv_activity_opt'] == 'move') |
180 | 182 | { |
181 | 183 | $smarty->assign('convertModuleListOptions', get_select_options_with_id(array('None'=>$app_strings['LBL_NONE'], 'Contacts' => $app_list_strings["moduleListSingular"]['Contacts']), '')); |
182 | - } |
|
183 | - else if($sugar_config['lead_conv_activity_opt'] == 'copy') |
|
184 | + } else if($sugar_config['lead_conv_activity_opt'] == 'copy') |
|
184 | 185 | { |
185 | 186 | $smarty->assign('convertModuleListOptions', get_select_options_with_id(array('Contacts' => $app_list_strings["moduleListSingular"]['Contacts']), '')); |
186 | 187 | } |
@@ -212,17 +213,14 @@ discard block |
||
212 | 213 | if ($module == "Accounts" && $field == 'name') |
213 | 214 | { |
214 | 215 | $focus->name = $this->focus->account_name; |
215 | - } |
|
216 | - else if ($module == "Opportunities" && $field == 'amount') |
|
216 | + } else if ($module == "Opportunities" && $field == 'amount') |
|
217 | 217 | { |
218 | 218 | $focus->amount = unformat_number($this->focus->opportunity_amount); |
219 | - } |
|
220 | - else if ($module == "Opportunities" && $field == 'name') { |
|
219 | + } else if ($module == "Opportunities" && $field == 'name') { |
|
221 | 220 | if ($opportunityNameInLayout && !empty($this->focus->opportunity_name)){ |
222 | 221 | $focus->name = $this->focus->opportunity_name; |
223 | 222 | } |
224 | - } |
|
225 | - else if ($field == "id") |
|
223 | + } else if ($field == "id") |
|
226 | 224 | { |
227 | 225 | //If it is not a contact, don't copy the ID from the lead |
228 | 226 | if ($module == "Contacts") { |
@@ -232,25 +230,25 @@ discard block |
||
232 | 230 | { |
233 | 231 | //Special case where company and person have the same field with a different name |
234 | 232 | $focus->phone_office = $this->focus->phone_work; |
235 | - } |
|
236 | - else if (strpos($field, "billing_address") !== false && $focus->field_defs[$field]["type"] == "varchar") /* Bug 42219 fix */ |
|
233 | + } else if (strpos($field, "billing_address") !== false && $focus->field_defs[$field]["type"] == "varchar") { |
|
234 | + /* Bug 42219 fix */ |
|
237 | 235 | { |
238 | 236 | $tmp_field = str_replace("billing_", "primary_", $field); |
237 | + } |
|
239 | 238 | $focus->field_defs[$field]["type"] = "text"; |
240 | 239 | if (isset($this->focus->$tmp_field)) { |
241 | 240 | $focus->$field = $this->focus->$tmp_field; |
242 | 241 | } |
243 | - } |
|
244 | - |
|
245 | - else if (strpos($field, "shipping_address") !== false && $focus->field_defs[$field]["type"] == "varchar") /* Bug 42219 fix */ |
|
242 | + } else if (strpos($field, "shipping_address") !== false && $focus->field_defs[$field]["type"] == "varchar") { |
|
243 | + /* Bug 42219 fix */ |
|
246 | 244 | { |
247 | 245 | $tmp_field = str_replace("shipping_", "primary_", $field); |
246 | + } |
|
248 | 247 | if (isset($this->focus->$tmp_field)) { |
249 | 248 | $focus->$field = $this->focus->$tmp_field; |
250 | 249 | } |
251 | 250 | $focus->field_defs[$field]["type"] = "text"; |
252 | - } |
|
253 | - else if (isset($this->focus->$field)) |
|
251 | + } else if (isset($this->focus->$field)) |
|
254 | 252 | { |
255 | 253 | $focus->$field = $this->focus->$field; |
256 | 254 | } |
@@ -403,8 +401,7 @@ discard block |
||
403 | 401 | unset($_REQUEST["convert_create_Contacts"]); |
404 | 402 | unset($_POST["convert_create_Contacts"]); |
405 | 403 | } |
406 | - } |
|
407 | - elseif (!empty($_REQUEST["convert_create_Contacts"]) && $_REQUEST["convert_create_Contacts"] != "false" && !isset($_POST['ContinueContact'])) |
|
404 | + } elseif (!empty($_REQUEST["convert_create_Contacts"]) && $_REQUEST["convert_create_Contacts"] != "false" && !isset($_POST['ContinueContact'])) |
|
408 | 405 | { |
409 | 406 | require_once('modules/Contacts/ContactFormBase.php'); |
410 | 407 | $contactForm = new ContactFormBase(); |
@@ -425,8 +422,7 @@ discard block |
||
425 | 422 | $_REQUEST['account_id'] = $_REQUEST['selectedAccount']; |
426 | 423 | unset($_REQUEST["convert_create_Accounts"]); |
427 | 424 | unset($_POST["convert_create_Accounts"]); |
428 | - } |
|
429 | - elseif (!empty($_REQUEST["convert_create_Accounts"]) && $_REQUEST["convert_create_Accounts"] != "false" && empty($_POST['ContinueAccount'])) |
|
425 | + } elseif (!empty($_REQUEST["convert_create_Accounts"]) && $_REQUEST["convert_create_Accounts"] != "false" && empty($_POST['ContinueAccount'])) |
|
430 | 426 | { |
431 | 427 | require_once('modules/Accounts/AccountFormBase.php'); |
432 | 428 | $accountForm = new AccountFormBase(); |
@@ -445,8 +441,9 @@ discard block |
||
445 | 441 | { |
446 | 442 | //Save the new record |
447 | 443 | $bean = $beanList[$module]; |
448 | - if (empty($beans[$module])) |
|
449 | - $beans[$module] = new $bean(); |
|
444 | + if (empty($beans[$module])) { |
|
445 | + $beans[$module] = new $bean(); |
|
446 | + } |
|
450 | 447 | |
451 | 448 | $this->populateNewBean($module, $beans[$module], $beans['Contacts'], $lead); |
452 | 449 | // when creating a new contact, create the id for linking with other modules |
@@ -536,8 +533,7 @@ discard block |
||
536 | 533 | { |
537 | 534 | $id_field = $relObject->rhs_key; |
538 | 535 | $lead->$id_field = $bean->id; |
539 | - } |
|
540 | - else |
|
536 | + } else |
|
541 | 537 | { |
542 | 538 | $bean->$leadsRel->add($lead->id); |
543 | 539 | } |
@@ -550,8 +546,7 @@ discard block |
||
550 | 546 | { |
551 | 547 | $bean->account_id = $beans['Accounts']->id; |
552 | 548 | $bean->account_name = $beans['Accounts']->name; |
553 | - } |
|
554 | - else if (!empty($selects['Accounts'])) |
|
549 | + } else if (!empty($selects['Accounts'])) |
|
555 | 550 | { |
556 | 551 | $bean->account_id = $selects['Accounts']; |
557 | 552 | } |
@@ -591,8 +586,7 @@ discard block |
||
591 | 586 | $bean->load_relationship($meetingsRel); |
592 | 587 | $bean->$meetingsRel->add($current_user->id); |
593 | 588 | return $bean; |
594 | - } |
|
595 | - else |
|
589 | + } else |
|
596 | 590 | { |
597 | 591 | return false; |
598 | 592 | } |
@@ -611,8 +605,7 @@ discard block |
||
611 | 605 | <a href='index.php?module={$bean->module_dir}&action=DetailView&record={$bean->id}'> |
612 | 606 | {$bean->get_summary_text()} |
613 | 607 | </a></li>"; |
614 | - } |
|
615 | - else { |
|
608 | + } else { |
|
616 | 609 | global $app_list_strings; |
617 | 610 | if(!empty($app_list_strings['moduleListSingular'][$bean->module_dir])) { |
618 | 611 | $module_name = $app_list_strings['moduleListSingular'][$bean->module_dir]; |
@@ -652,7 +645,7 @@ discard block |
||
652 | 645 | $account_id = create_guid(); |
653 | 646 | if(!empty($beans['Accounts']->id)){ |
654 | 647 | $account_id = $beans['Accounts']->id; |
655 | - }else{ |
|
648 | + } else{ |
|
656 | 649 | $beans['Accounts']->id = $account_id; |
657 | 650 | } |
658 | 651 | $accountParentInfo = array('id'=>$account_id,'type'=>'Accounts'); |
@@ -683,8 +676,7 @@ discard block |
||
683 | 676 | } |
684 | 677 | } |
685 | 678 | } |
686 | - } |
|
687 | - else if ($sugar_config['lead_conv_activity_opt'] == 'move') { |
|
679 | + } else if ($sugar_config['lead_conv_activity_opt'] == 'move') { |
|
688 | 680 | // if to move activities, should be only one module selected |
689 | 681 | if ($_POST['lead_conv_ac_op_sel'] == $module) { |
690 | 682 | $this->moveActivity($activity, $bean); |
@@ -749,7 +741,9 @@ discard block |
||
749 | 741 | $lead |
750 | 742 | ) |
751 | 743 | { |
752 | - if (!$lead) return; |
|
744 | + if (!$lead) { |
|
745 | + return; |
|
746 | + } |
|
753 | 747 | |
754 | 748 | global $beanList, $db; |
755 | 749 | |
@@ -855,7 +849,10 @@ discard block |
||
855 | 849 | if(!isset($_REQUEST[$module . $field]) && isset($lead->$field) && $field != 'id') |
856 | 850 | { |
857 | 851 | $bean->$field = $lead->$field; |
858 | - if($field == 'date_entered') $bean->$field = gmdate($GLOBALS['timedate']->get_db_date_time_format()); //bug 41030 |
|
852 | + if($field == 'date_entered') { |
|
853 | + $bean->$field = gmdate($GLOBALS['timedate']->get_db_date_time_format()); |
|
854 | + } |
|
855 | + //bug 41030 |
|
859 | 856 | } |
860 | 857 | } |
861 | 858 | populateFromPost($module, $bean, true); |
@@ -872,10 +869,11 @@ discard block |
||
872 | 869 | $contact->$fieldDef['id_name'] = $bean->id ; |
873 | 870 | if ($fieldDef['id_name'] != $select) { |
874 | 871 | $rname = isset($fieldDef['rname']) ? $fieldDef['rname'] : ""; |
875 | - if (!empty($rname) && isset($bean->$rname)) |
|
876 | - $contact->$select = $bean->$rname; |
|
877 | - else |
|
878 | - $contact->$select = $bean->name; |
|
872 | + if (!empty($rname) && isset($bean->$rname)) { |
|
873 | + $contact->$select = $bean->$rname; |
|
874 | + } else { |
|
875 | + $contact->$select = $bean->name; |
|
876 | + } |
|
879 | 877 | } |
880 | 878 | } |
881 | 879 | } else if ($module != "Contacts"){ |
@@ -911,30 +909,33 @@ discard block |
||
911 | 909 | if(!isset($_REQUEST[$bean->module_dir . $field]) && strpos($field, "_address_") !== false) |
912 | 910 | { |
913 | 911 | $set = "primary"; |
914 | - if (strpos($field, "alt_") !== false || strpos($field, "shipping_") !== false) |
|
915 | - $set = "alt"; |
|
912 | + if (strpos($field, "alt_") !== false || strpos($field, "shipping_") !== false) { |
|
913 | + $set = "alt"; |
|
914 | + } |
|
916 | 915 | $type = ""; |
917 | 916 | |
918 | - if(strpos($field, "_address_street_2") !== false) |
|
919 | - $type = "_address_street_2"; |
|
920 | - else if(strpos($field, "_address_street_3") !== false) |
|
921 | - $type = "_address_street_3"; |
|
922 | - else if(strpos($field, "_address_street_4") !== false) |
|
923 | - $type = ""; |
|
924 | - else if(strpos($field, "_address_street") !== false) |
|
925 | - $type = "_address_street"; |
|
926 | - else if(strpos($field, "_address_city") !== false) |
|
927 | - $type = "_address_city"; |
|
928 | - else if(strpos($field, "_address_state") !== false) |
|
929 | - $type = "_address_state"; |
|
930 | - else if(strpos($field, "_address_postalcode") !== false) |
|
931 | - $type = "_address_postalcode"; |
|
932 | - else if(strpos($field, "_address_country") !== false) |
|
933 | - $type = "_address_country"; |
|
917 | + if(strpos($field, "_address_street_2") !== false) { |
|
918 | + $type = "_address_street_2"; |
|
919 | + } else if(strpos($field, "_address_street_3") !== false) { |
|
920 | + $type = "_address_street_3"; |
|
921 | + } else if(strpos($field, "_address_street_4") !== false) { |
|
922 | + $type = ""; |
|
923 | + } else if(strpos($field, "_address_street") !== false) { |
|
924 | + $type = "_address_street"; |
|
925 | + } else if(strpos($field, "_address_city") !== false) { |
|
926 | + $type = "_address_city"; |
|
927 | + } else if(strpos($field, "_address_state") !== false) { |
|
928 | + $type = "_address_state"; |
|
929 | + } else if(strpos($field, "_address_postalcode") !== false) { |
|
930 | + $type = "_address_postalcode"; |
|
931 | + } else if(strpos($field, "_address_country") !== false) { |
|
932 | + $type = "_address_country"; |
|
933 | + } |
|
934 | 934 | |
935 | 935 | $var = $set.$type; |
936 | - if (isset($contact->$var)) |
|
937 | - $bean->$field = $contact->$var; |
|
936 | + if (isset($contact->$var)) { |
|
937 | + $bean->$field = $contact->$var; |
|
938 | + } |
|
938 | 939 | } |
939 | 940 | } |
940 | 941 | } |
@@ -956,12 +957,10 @@ discard block |
||
956 | 957 | if (isset($dictionary[$from->object_name]['relationships']) && isset($dictionary[$from->object_name]['relationships'][$rel_name])) |
957 | 958 | { |
958 | 959 | $rel_def = $dictionary[$from->object_name]['relationships'][$rel_name]; |
959 | - } |
|
960 | - else if (isset($dictionary[$to->object_name]['relationships']) && isset($dictionary[$to->object_name]['relationships'][$rel_name])) |
|
960 | + } else if (isset($dictionary[$to->object_name]['relationships']) && isset($dictionary[$to->object_name]['relationships'][$rel_name])) |
|
961 | 961 | { |
962 | 962 | $rel_def = $dictionary[$to->object_name]['relationships'][$rel_name]; |
963 | - } |
|
964 | - else if (isset($dictionary[$rel_name]) && isset($dictionary[$rel_name]['relationships']) |
|
963 | + } else if (isset($dictionary[$rel_name]) && isset($dictionary[$rel_name]['relationships']) |
|
965 | 964 | && isset($dictionary[$rel_name]['relationships'][$rel_name])) |
966 | 965 | { |
967 | 966 | $rel_def = $dictionary[$rel_name]['relationships'][$rel_name]; |
@@ -970,8 +969,7 @@ discard block |
||
970 | 969 | if ($rel_def['lhs_module'] == $from->module_dir && $rel_def['rhs_module'] == $to->module_dir ) |
971 | 970 | { |
972 | 971 | return $field; |
973 | - } |
|
974 | - else if ($rel_def['rhs_module'] == $from->module_dir && $rel_def['lhs_module'] == $to->module_dir ) |
|
972 | + } else if ($rel_def['rhs_module'] == $from->module_dir && $rel_def['lhs_module'] == $to->module_dir ) |
|
975 | 973 | { |
976 | 974 | return $field; |
977 | 975 | } |
@@ -52,8 +52,7 @@ discard block |
||
52 | 52 | if ($children != "." && $children != "..") { |
53 | 53 | if (is_dir($thedir . "/" . $children)) { |
54 | 54 | clearCacheSU($thedir . "/" . $children, $extension); |
55 | - } |
|
56 | - elseif (is_file($thedir . "/" . $children) && substr_count($children, $extension)) { |
|
55 | + } elseif (is_file($thedir . "/" . $children) && substr_count($children, $extension)) { |
|
57 | 56 | unlink($thedir . "/" . $children); |
58 | 57 | } |
59 | 58 | } |
@@ -205,8 +204,7 @@ discard block |
||
205 | 204 | |
206 | 205 | if( write_array_to_file( "sugar_config", $sugar_config, "config.php" ) ){ |
207 | 206 | return true; |
208 | - } |
|
209 | - else { |
|
207 | + } else { |
|
210 | 208 | return false; |
211 | 209 | } |
212 | 210 | } |
@@ -265,8 +263,7 @@ discard block |
||
265 | 263 | echo "FAILURE\n"; |
266 | 264 | exit(1); |
267 | 265 | } |
268 | - } |
|
269 | - else if(is_file("{$cwd}/include/entryPoint.php")) { |
|
266 | + } else if(is_file("{$cwd}/include/entryPoint.php")) { |
|
270 | 267 | //this should be a regular sugar install |
271 | 268 | $upgradeType = constant('SUGARCRM_INSTALL'); |
272 | 269 | //check if this is a valid zip file |
@@ -284,8 +281,7 @@ discard block |
||
284 | 281 | echo "FAILURE\n"; |
285 | 282 | exit(1); |
286 | 283 | } |
287 | - } |
|
288 | - else { |
|
284 | + } else { |
|
289 | 285 | //this should be a regular sugar install |
290 | 286 | echo "*******************************************************************************\n"; |
291 | 287 | echo "*** ERROR: Tried to execute in a non-SugarCRM root directory.\n"; |
@@ -314,7 +310,7 @@ discard block |
||
314 | 310 | $_GET['CONVERT_FILE_ONLY'] = true; |
315 | 311 | if(!class_exists('TemplateConverter')){ |
316 | 312 | include($argv[7].'templateConverter.php'); |
317 | - }else{ |
|
313 | + } else{ |
|
318 | 314 | TemplateConverter::convertFile($_GET['TEMPLATE_PATH']); |
319 | 315 | } |
320 | 316 | |
@@ -392,7 +388,9 @@ discard block |
||
392 | 388 | |
393 | 389 | /////////////////////////////////////////////////////////////////////////////// |
394 | 390 | //// STANDARD REQUIRED SUGAR INCLUDES AND PRESETS |
395 | -if(!defined('sugarEntry')) define('sugarEntry', true); |
|
391 | +if(!defined('sugarEntry')) { |
|
392 | + define('sugarEntry', true); |
|
393 | +} |
|
396 | 394 | |
397 | 395 | $_SESSION = array(); |
398 | 396 | $_SESSION['schema_change'] = 'sugar'; // we force-run all SQL |
@@ -704,7 +702,7 @@ discard block |
||
704 | 702 | echo 'Global '.$mod_strings['LBL_UPGRADE_TEAM_EXISTS'].'<br>'; |
705 | 703 | logThis(" Finish Building private teams", $path); |
706 | 704 | |
707 | - }else{ |
|
705 | + } else{ |
|
708 | 706 | $globalteam->create_team("Global", $mod_strings['LBL_GLOBAL_TEAM_DESC'], $globalteam->global_team); |
709 | 707 | } |
710 | 708 |
@@ -65,8 +65,7 @@ discard block |
||
65 | 65 | if ($children != "." && $children != "..") { |
66 | 66 | if (is_dir($thedir . "/" . $children)) { |
67 | 67 | clearCacheSU($thedir . "/" . $children, $extension); |
68 | - } |
|
69 | - elseif (is_file($thedir . "/" . $children) && substr_count($children, $extension)) { |
|
68 | + } elseif (is_file($thedir . "/" . $children) && substr_count($children, $extension)) { |
|
70 | 69 | unlink($thedir . "/" . $children); |
71 | 70 | } |
72 | 71 | } |
@@ -227,8 +226,7 @@ discard block |
||
227 | 226 | |
228 | 227 | if( write_array_to_file( "sugar_config", $sugar_config, "config.php" ) ){ |
229 | 228 | return true; |
230 | - } |
|
231 | - else { |
|
229 | + } else { |
|
232 | 230 | return false; |
233 | 231 | } |
234 | 232 | } |
@@ -287,8 +285,7 @@ discard block |
||
287 | 285 | echo "FAILURE\n"; |
288 | 286 | exit(1); |
289 | 287 | } |
290 | - } |
|
291 | - else if(is_file("{$cwd}/include/entryPoint.php")) { |
|
288 | + } else if(is_file("{$cwd}/include/entryPoint.php")) { |
|
292 | 289 | //this should be a regular sugar install |
293 | 290 | $upgradeType = constant('SUGARCRM_INSTALL'); |
294 | 291 | //check if this is a valid zip file |
@@ -306,8 +303,7 @@ discard block |
||
306 | 303 | echo "FAILURE\n"; |
307 | 304 | exit(1); |
308 | 305 | } |
309 | - } |
|
310 | - else { |
|
306 | + } else { |
|
311 | 307 | //this should be a regular sugar install |
312 | 308 | echo "*******************************************************************************\n"; |
313 | 309 | echo "*** ERROR: Tried to execute in a non-SugarCRM root directory.\n"; |
@@ -336,7 +332,7 @@ discard block |
||
336 | 332 | $_GET['CONVERT_FILE_ONLY'] = true; |
337 | 333 | if(!class_exists('TemplateConverter')){ |
338 | 334 | include($argv[7].'templateConverter.php'); |
339 | - }else{ |
|
335 | + } else{ |
|
340 | 336 | TemplateConverter::convertFile($_GET['TEMPLATE_PATH']); |
341 | 337 | } |
342 | 338 | |
@@ -414,7 +410,9 @@ discard block |
||
414 | 410 | |
415 | 411 | /////////////////////////////////////////////////////////////////////////////// |
416 | 412 | //// STANDARD REQUIRED SUGAR INCLUDES AND PRESETS |
417 | -if(!defined('sugarEntry')) define('sugarEntry', true); |
|
413 | +if(!defined('sugarEntry')) { |
|
414 | + define('sugarEntry', true); |
|
415 | +} |
|
418 | 416 | |
419 | 417 | $_SESSION = array(); |
420 | 418 | $_SESSION['schema_change'] = 'sugar'; // we force-run all SQL |
@@ -522,8 +520,7 @@ discard block |
||
522 | 520 | $_SESSION['instancePath'] = $instancePath; |
523 | 521 | if(file_exists("{$instanceUpgradePath}/modules/UpgradeWizard/uw_utils.php")){ |
524 | 522 | require_once("{$instanceUpgradePath}/modules/UpgradeWizard/uw_utils.php"); |
525 | - } |
|
526 | - else{ |
|
523 | + } else{ |
|
527 | 524 | require_once("{$argv[4]}/modules/UpgradeWizard/uw_utils.php"); |
528 | 525 | } |
529 | 526 | if(function_exists('set_upgrade_vars')){ |
@@ -583,8 +580,7 @@ discard block |
||
583 | 580 | //$targetFile = clean_path(getcwd() . '/' . $srcFile); |
584 | 581 | if (strpos($srcFile,".svn") !== false) { |
585 | 582 | //do nothing |
586 | - } |
|
587 | - else{ |
|
583 | + } else{ |
|
588 | 584 | $existsCustomFile = true; |
589 | 585 | //log the custom file in |
590 | 586 | logThis($file, $path); |
@@ -596,17 +592,14 @@ discard block |
||
596 | 592 | echo 'Stop and Exit Upgrade. There are customized files. Take a look in the upgrade log'; |
597 | 593 | logThis("Stop and Exit Upgrade. There are customized files. Take a look in the upgrade log", $path); |
598 | 594 | exit(1); |
599 | - } |
|
600 | - else{ |
|
595 | + } else{ |
|
601 | 596 | upgradeDCEFiles($argv,$instanceUpgradePath); |
602 | 597 | } |
603 | - } |
|
604 | - else{ |
|
598 | + } else{ |
|
605 | 599 | //copy and update following files from upgrade package |
606 | 600 | upgradeDCEFiles($argv,$instanceUpgradePath); |
607 | 601 | } |
608 | - } |
|
609 | - else{ |
|
602 | + } else{ |
|
610 | 603 | //copy and update following files from upgrade package |
611 | 604 | upgradeDCEFiles($argv,$instanceUpgradePath); |
612 | 605 | } |
@@ -65,8 +65,7 @@ discard block |
||
65 | 65 | if ($children != "." && $children != "..") { |
66 | 66 | if (is_dir($thedir . "/" . $children)) { |
67 | 67 | clearCacheSU($thedir . "/" . $children, $extension); |
68 | - } |
|
69 | - elseif (is_file($thedir . "/" . $children) && substr_count($children, $extension)) { |
|
68 | + } elseif (is_file($thedir . "/" . $children) && substr_count($children, $extension)) { |
|
70 | 69 | unlink($thedir . "/" . $children); |
71 | 70 | } |
72 | 71 | } |
@@ -269,8 +268,7 @@ discard block |
||
269 | 268 | |
270 | 269 | if( write_array_to_file( "sugar_config", $sugar_config, "config.php" ) ){ |
271 | 270 | return true; |
272 | - } |
|
273 | - else { |
|
271 | + } else { |
|
274 | 272 | return false; |
275 | 273 | } |
276 | 274 | } |
@@ -386,7 +384,9 @@ discard block |
||
386 | 384 | |
387 | 385 | /////////////////////////////////////////////////////////////////////////////// |
388 | 386 | //// STANDARD REQUIRED SUGAR INCLUDES AND PRESETS |
389 | -if(!defined('sugarEntry')) define('sugarEntry', true); |
|
387 | +if(!defined('sugarEntry')) { |
|
388 | + define('sugarEntry', true); |
|
389 | +} |
|
390 | 390 | |
391 | 391 | $_SESSION = array(); |
392 | 392 | $_SESSION['schema_change'] = 'sugar'; // we force-run all SQL |
@@ -500,13 +500,11 @@ discard block |
||
500 | 500 | if(isset($logged_user['id']) && $logged_user['id'] != null){ |
501 | 501 | //do nothing |
502 | 502 | $current_user->retrieve($logged_user['id']); |
503 | - } |
|
504 | - else{ |
|
503 | + } else{ |
|
505 | 504 | echo "FAILURE: Not an admin user in users table. Please provide an admin user\n"; |
506 | 505 | exit(1); |
507 | 506 | } |
508 | - } |
|
509 | - else { |
|
507 | + } else { |
|
510 | 508 | echo "*******************************************************************************\n"; |
511 | 509 | echo "*** ERROR: 4th parameter must be a valid admin user.\n"; |
512 | 510 | echo $usage; |
@@ -771,8 +769,9 @@ discard block |
||
771 | 769 | include($file); |
772 | 770 | post_install(); |
773 | 771 | // cn: only run conversion if admin selects "Sugar runs SQL" |
774 | - if(!empty($_SESSION['allTables']) && $_SESSION['schema_change'] == 'sugar') |
|
775 | - executeConvertTablesSql($_SESSION['allTables']); |
|
772 | + if(!empty($_SESSION['allTables']) && $_SESSION['schema_change'] == 'sugar') { |
|
773 | + executeConvertTablesSql($_SESSION['allTables']); |
|
774 | + } |
|
776 | 775 | //set process to done |
777 | 776 | $progArray['post_install']='done'; |
778 | 777 | //set_upgrade_progress('commit','in_progress','post_install','done'); |
@@ -878,8 +877,7 @@ discard block |
||
878 | 877 | |
879 | 878 | if($new_upgrade->description == null){ |
880 | 879 | $new_upgrade->description = "Silent Upgrade was used to upgrade the instance"; |
881 | - } |
|
882 | - else{ |
|
880 | + } else{ |
|
883 | 881 | $new_upgrade->description = $new_upgrade->description." Silent Upgrade was used to upgrade the instance."; |
884 | 882 | } |
885 | 883 | $new_upgrade->save(); |
@@ -929,8 +927,7 @@ discard block |
||
929 | 927 | ob_start(); |
930 | 928 | if(!isset($_REQUEST['silent'])){ |
931 | 929 | $_REQUEST['silent'] = true; |
932 | - } |
|
933 | - else if(isset($_REQUEST['silent']) && $_REQUEST['silent'] != true){ |
|
930 | + } else if(isset($_REQUEST['silent']) && $_REQUEST['silent'] != true){ |
|
934 | 931 | $_REQUEST['silent'] = true; |
935 | 932 | } |
936 | 933 |
@@ -151,8 +151,7 @@ discard block |
||
151 | 151 | echo "FAILURE\n"; |
152 | 152 | exit(1); |
153 | 153 | } |
154 | - } |
|
155 | - else { |
|
154 | + } else { |
|
156 | 155 | //this should be a regular sugar install |
157 | 156 | echo "*******************************************************************************\n"; |
158 | 157 | echo "*** ERROR: Tried to execute in a non-SugarCRM root directory.\n"; |
@@ -217,7 +216,9 @@ discard block |
||
217 | 216 | |
218 | 217 | /////////////////////////////////////////////////////////////////////////////// |
219 | 218 | //// STANDARD REQUIRED SUGAR INCLUDES AND PRESETS |
220 | -if(!defined('sugarEntry')) define('sugarEntry', true); |
|
219 | +if(!defined('sugarEntry')) { |
|
220 | + define('sugarEntry', true); |
|
221 | +} |
|
221 | 222 | |
222 | 223 | $_SESSION = array(); |
223 | 224 | $_SESSION['schema_change'] = 'sugar'; // we force-run all SQL |
@@ -289,13 +290,11 @@ discard block |
||
289 | 290 | if(isset($logged_user['id']) && $logged_user['id'] != null){ |
290 | 291 | //do nothing |
291 | 292 | $current_user->retrieve($logged_user['id']); |
292 | - } |
|
293 | - else{ |
|
293 | + } else{ |
|
294 | 294 | echo "Not an admin user in users table. Please provide an admin user\n"; |
295 | 295 | exit(1); |
296 | 296 | } |
297 | - } |
|
298 | - else { |
|
297 | + } else { |
|
299 | 298 | echo "*******************************************************************************\n"; |
300 | 299 | echo "*** ERROR: 4th parameter must be a valid admin user.\n"; |
301 | 300 | echo $usage; |
@@ -489,7 +488,7 @@ discard block |
||
489 | 488 | if(isset($globalteam->name)){ |
490 | 489 | echo 'Global '.$mod_strings['LBL_UPGRADE_TEAM_EXISTS'].'<br>'; |
491 | 490 | logThis(" Finish Building Global Team", $path); |
492 | - }else{ |
|
491 | + } else{ |
|
493 | 492 | $globalteam->create_team("Global", $mod_strings['LBL_GLOBAL_TEAM_DESC'], $globalteam->global_team); |
494 | 493 | } |
495 | 494 |