@@ -44,27 +44,27 @@ |
||
44 | 44 | |
45 | 45 | class ContactsViewDetail extends ViewDetail |
46 | 46 | { |
47 | - /** |
|
48 | - * @see SugarView::display() |
|
49 | - * |
|
50 | - * We are overridding the display method to manipulate the portal information. |
|
51 | - * If portal is not enabled then don't show the portal fields. |
|
52 | - */ |
|
53 | - public function display(){ |
|
54 | - global $sugar_config; |
|
47 | + /** |
|
48 | + * @see SugarView::display() |
|
49 | + * |
|
50 | + * We are overridding the display method to manipulate the portal information. |
|
51 | + * If portal is not enabled then don't show the portal fields. |
|
52 | + */ |
|
53 | + public function display(){ |
|
54 | + global $sugar_config; |
|
55 | 55 | |
56 | - $aop_portal_enabled = !empty($sugar_config['aop']['enable_portal']) && !empty($sugar_config['aop']['enable_aop']); |
|
56 | + $aop_portal_enabled = !empty($sugar_config['aop']['enable_portal']) && !empty($sugar_config['aop']['enable_aop']); |
|
57 | 57 | |
58 | - $this->ss->assign("AOP_PORTAL_ENABLED", $aop_portal_enabled); |
|
58 | + $this->ss->assign("AOP_PORTAL_ENABLED", $aop_portal_enabled); |
|
59 | 59 | |
60 | - require_once('modules/AOS_PDF_Templates/formLetter.php'); |
|
61 | - formLetter::DVPopupHtml('Contacts'); |
|
60 | + require_once('modules/AOS_PDF_Templates/formLetter.php'); |
|
61 | + formLetter::DVPopupHtml('Contacts'); |
|
62 | 62 | |
63 | - $admin = new Administration(); |
|
64 | - $admin->retrieveSettings(); |
|
65 | - if(isset($admin->settings['portal_on']) && $admin->settings['portal_on']) { |
|
66 | - $this->ss->assign("PORTAL_ENABLED", true); |
|
67 | - } |
|
68 | - parent::display(); |
|
69 | - } |
|
63 | + $admin = new Administration(); |
|
64 | + $admin->retrieveSettings(); |
|
65 | + if(isset($admin->settings['portal_on']) && $admin->settings['portal_on']) { |
|
66 | + $this->ss->assign("PORTAL_ENABLED", true); |
|
67 | + } |
|
68 | + parent::display(); |
|
69 | + } |
|
70 | 70 | } |
@@ -52,29 +52,29 @@ |
||
52 | 52 | |
53 | 53 | class ContactsViewRetrieveEmail extends SugarView { |
54 | 54 | |
55 | - function ContactsViewRetrieveEmail(){ |
|
56 | - parent::SugarView(); |
|
57 | - } |
|
55 | + function ContactsViewRetrieveEmail(){ |
|
56 | + parent::SugarView(); |
|
57 | + } |
|
58 | 58 | |
59 | - function process() { |
|
60 | - $this->display(); |
|
61 | - } |
|
59 | + function process() { |
|
60 | + $this->display(); |
|
61 | + } |
|
62 | 62 | |
63 | - function display(){ |
|
64 | - $data = array(); |
|
65 | - $data['target'] = $_REQUEST['target']; |
|
63 | + function display(){ |
|
64 | + $data = array(); |
|
65 | + $data['target'] = $_REQUEST['target']; |
|
66 | 66 | if(!empty($_REQUEST['email'])) { |
67 | - $db = DBManagerFactory::getInstance(); |
|
68 | - $email = $GLOBALS['db']->quote(strtoupper(trim($_REQUEST['email']))); |
|
69 | - $result = $db->query("SELECT * FROM email_addresses WHERE email_address_caps = '$email' AND deleted = 0"); |
|
70 | - if($row = $db->fetchByAssoc($result)) { |
|
71 | - $data['email'] = $row; |
|
72 | - } else { |
|
73 | - $data['email'] = ''; |
|
74 | - } |
|
67 | + $db = DBManagerFactory::getInstance(); |
|
68 | + $email = $GLOBALS['db']->quote(strtoupper(trim($_REQUEST['email']))); |
|
69 | + $result = $db->query("SELECT * FROM email_addresses WHERE email_address_caps = '$email' AND deleted = 0"); |
|
70 | + if($row = $db->fetchByAssoc($result)) { |
|
71 | + $data['email'] = $row; |
|
72 | + } else { |
|
73 | + $data['email'] = ''; |
|
74 | + } |
|
75 | 75 | } |
76 | - $json = new JSON(JSON_LOOSE_TYPE); |
|
77 | - echo $json->encode($data); |
|
78 | - } |
|
76 | + $json = new JSON(JSON_LOOSE_TYPE); |
|
77 | + echo $json->encode($data); |
|
78 | + } |
|
79 | 79 | } |
80 | 80 | ?> |
81 | 81 | \ No newline at end of file |
@@ -46,17 +46,17 @@ |
||
46 | 46 | { |
47 | 47 | public function preDisplay() |
48 | 48 | { |
49 | - parent::preDisplay(); |
|
50 | - if($this->_isDCForm) { |
|
51 | - //XXX TODO 20110329 Frank Steegmans: Hack to make quick create fields populate when used through the DC menu |
|
52 | - // NOTE HOWEVER that sqs_objects form fields are not properly populated because of some other hacks |
|
53 | - // resulting in none of the fields properly populating when selecting an account |
|
54 | - if(!empty($this->bean->phone_office))$_REQUEST['phone_work'] = $this->bean->phone_office; |
|
55 | - if(!empty($this->bean->billing_address_street))$_REQUEST['primary_address_street'] = $this->bean->billing_address_street; |
|
56 | - if(!empty($this->bean->billing_address_city))$_REQUEST['primary_address_city'] = $this->bean->billing_address_city; |
|
57 | - if(!empty($this->bean->billing_address_state))$_REQUEST['primary_address_state'] = $this->bean->billing_address_state; |
|
58 | - if(!empty($this->bean->billing_address_country))$_REQUEST['primary_address_country'] = $this->bean->billing_address_country; |
|
59 | - if(!empty($this->bean->billing_address_postalcode))$_REQUEST['primary_address_postalcode'] = $this->bean->billing_address_postalcode; |
|
60 | - } |
|
49 | + parent::preDisplay(); |
|
50 | + if($this->_isDCForm) { |
|
51 | + //XXX TODO 20110329 Frank Steegmans: Hack to make quick create fields populate when used through the DC menu |
|
52 | + // NOTE HOWEVER that sqs_objects form fields are not properly populated because of some other hacks |
|
53 | + // resulting in none of the fields properly populating when selecting an account |
|
54 | + if(!empty($this->bean->phone_office))$_REQUEST['phone_work'] = $this->bean->phone_office; |
|
55 | + if(!empty($this->bean->billing_address_street))$_REQUEST['primary_address_street'] = $this->bean->billing_address_street; |
|
56 | + if(!empty($this->bean->billing_address_city))$_REQUEST['primary_address_city'] = $this->bean->billing_address_city; |
|
57 | + if(!empty($this->bean->billing_address_state))$_REQUEST['primary_address_state'] = $this->bean->billing_address_state; |
|
58 | + if(!empty($this->bean->billing_address_country))$_REQUEST['primary_address_country'] = $this->bean->billing_address_country; |
|
59 | + if(!empty($this->bean->billing_address_postalcode))$_REQUEST['primary_address_postalcode'] = $this->bean->billing_address_postalcode; |
|
60 | + } |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | \ No newline at end of file |
@@ -48,18 +48,18 @@ |
||
48 | 48 | |
49 | 49 | class ContactsViewContactAddressPopup extends SugarView { |
50 | 50 | |
51 | - function ContactsViewContactAddressPopup(){ |
|
52 | - parent::SugarView(); |
|
53 | - } |
|
51 | + function ContactsViewContactAddressPopup(){ |
|
52 | + parent::SugarView(); |
|
53 | + } |
|
54 | 54 | |
55 | - function process() { |
|
56 | - $this->display(); |
|
57 | - } |
|
55 | + function process() { |
|
56 | + $this->display(); |
|
57 | + } |
|
58 | 58 | |
59 | - function display() { |
|
60 | - $this->renderJavascript(); |
|
61 | - $popup = new Popup_Picker(); |
|
62 | - echo $popup->process_page_for_address(); |
|
63 | - } |
|
59 | + function display() { |
|
60 | + $this->renderJavascript(); |
|
61 | + $popup = new Popup_Picker(); |
|
62 | + echo $popup->process_page_for_address(); |
|
63 | + } |
|
64 | 64 | } |
65 | 65 | ?> |
66 | 66 | \ No newline at end of file |
@@ -42,13 +42,13 @@ |
||
42 | 42 | |
43 | 43 | class ContactsViewCloseContactAddressPopup extends ViewList { |
44 | 44 | |
45 | - function CloseContactAddressPopup(){ |
|
46 | - parent::ViewList(); |
|
47 | - } |
|
45 | + function CloseContactAddressPopup(){ |
|
46 | + parent::ViewList(); |
|
47 | + } |
|
48 | 48 | |
49 | - function display() { |
|
49 | + function display() { |
|
50 | 50 | if(isset($_REQUEST['close_window'])) echo "<script>window.close();</script>"; |
51 | 51 | parent::display(); |
52 | - } |
|
52 | + } |
|
53 | 53 | } |
54 | 54 | ?> |
@@ -54,17 +54,17 @@ discard block |
||
54 | 54 | |
55 | 55 | class ContactsViewValidPortalUsername extends SugarView |
56 | 56 | { |
57 | - /** |
|
58 | - * @see SugarView::process() |
|
59 | - */ |
|
57 | + /** |
|
58 | + * @see SugarView::process() |
|
59 | + */ |
|
60 | 60 | public function process() |
61 | - { |
|
62 | - $this->display(); |
|
63 | - } |
|
61 | + { |
|
62 | + $this->display(); |
|
63 | + } |
|
64 | 64 | |
65 | - /** |
|
66 | - * @see SugarView::display() |
|
67 | - */ |
|
65 | + /** |
|
66 | + * @see SugarView::display() |
|
67 | + */ |
|
68 | 68 | public function display() |
69 | 69 | { |
70 | 70 | if (!empty($_REQUEST['portal_name'])) { |
@@ -76,6 +76,6 @@ discard block |
||
76 | 76 | echo $total; |
77 | 77 | } |
78 | 78 | else |
79 | - echo '0'; |
|
80 | - } |
|
79 | + echo '0'; |
|
80 | + } |
|
81 | 81 | } |
82 | 82 | \ No newline at end of file |
@@ -48,18 +48,18 @@ |
||
48 | 48 | |
49 | 49 | class ContactsViewMailMergePopup extends SugarView { |
50 | 50 | |
51 | - function ContactAddressPopup(){ |
|
52 | - parent::SugarView(); |
|
53 | - } |
|
51 | + function ContactAddressPopup(){ |
|
52 | + parent::SugarView(); |
|
53 | + } |
|
54 | 54 | |
55 | - function process() { |
|
56 | - $this->display(); |
|
57 | - } |
|
55 | + function process() { |
|
56 | + $this->display(); |
|
57 | + } |
|
58 | 58 | |
59 | - function display() { |
|
59 | + function display() { |
|
60 | 60 | |
61 | - $popup = new Popup_Picker(); |
|
62 | - echo $popup->process_page_for_merge(); |
|
63 | - } |
|
61 | + $popup = new Popup_Picker(); |
|
62 | + echo $popup->process_page_for_merge(); |
|
63 | + } |
|
64 | 64 | } |
65 | 65 | ?> |
66 | 66 | \ No newline at end of file |
@@ -62,7 +62,7 @@ |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { |
65 | - $focus->id = ""; |
|
65 | + $focus->id = ""; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | // Prepopulate either side of the relationship if passed in. |
@@ -25,109 +25,109 @@ |
||
25 | 25 | */ |
26 | 26 | |
27 | 27 | class templateParser{ |
28 | - function parse_template_bean($string, $key, &$focus) { |
|
29 | - global $app_strings; |
|
30 | - $repl_arr = array(); |
|
28 | + function parse_template_bean($string, $key, &$focus) { |
|
29 | + global $app_strings; |
|
30 | + $repl_arr = array(); |
|
31 | 31 | |
32 | - foreach($focus->field_defs as $field_def) { |
|
32 | + foreach($focus->field_defs as $field_def) { |
|
33 | 33 | if($field_def['type'] == 'currency'){ |
34 | 34 | $repl_arr[$key."_".$field_def['name']] = currency_format_number($focus->$field_def['name'],$params = array('currency_symbol' => false)); |
35 | 35 | } |
36 | - else if(($field_def['type'] == 'radioenum' || $field_def['type'] == 'enum') && isset($field_def['options'])) { |
|
36 | + else if(($field_def['type'] == 'radioenum' || $field_def['type'] == 'enum') && isset($field_def['options'])) { |
|
37 | 37 | $repl_arr[$key."_".$field_def['name']] = translate($field_def['options'],$focus->module_dir,$focus->$field_def['name']); |
38 | - } |
|
38 | + } |
|
39 | 39 | else if($field_def['type'] == 'multienum' && isset($field_def['options'])) { |
40 | - $repl_arr[$key."_".$field_def['name']] = implode(', ', unencodeMultienum($focus->$field_def['name'])); |
|
41 | - } |
|
40 | + $repl_arr[$key."_".$field_def['name']] = implode(', ', unencodeMultienum($focus->$field_def['name'])); |
|
41 | + } |
|
42 | 42 | //Fix for Windows Server as it needed to be converted to a string. |
43 | 43 | else if($field_def['type'] == 'int') { |
44 | 44 | $repl_arr[$key."_".$field_def['name']] = strval($focus->$field_def['name']); |
45 | 45 | } |
46 | 46 | else { |
47 | - $repl_arr[$key."_".$field_def['name']] = $focus->$field_def['name']; |
|
48 | - } |
|
49 | - } // end foreach() |
|
47 | + $repl_arr[$key."_".$field_def['name']] = $focus->$field_def['name']; |
|
48 | + } |
|
49 | + } // end foreach() |
|
50 | 50 | |
51 | - krsort($repl_arr); |
|
52 | - reset($repl_arr); |
|
51 | + krsort($repl_arr); |
|
52 | + reset($repl_arr); |
|
53 | 53 | |
54 | - foreach ($repl_arr as $name=>$value) { |
|
55 | - if (strpos($name,'product_discount')>0){ |
|
56 | - if($value != '' && $value != '0.00') |
|
57 | - { |
|
58 | - if($repl_arr['aos_products_quotes_discount'] == 'Percentage') |
|
59 | - { |
|
60 | - $sep = get_number_seperators(); |
|
61 | - $value=rtrim(rtrim(format_number($value), '0'),$sep[1]);//.$app_strings['LBL_PERCENTAGE_SYMBOL']; |
|
62 | - } |
|
63 | - else |
|
64 | - { |
|
65 | - $value=currency_format_number($value,$params = array('currency_symbol' => false)); |
|
66 | - } |
|
67 | - } |
|
68 | - else |
|
69 | - { |
|
70 | - $value=''; |
|
71 | - } |
|
72 | - } |
|
73 | - if ($name === 'aos_products_product_image'){ |
|
74 | - $value = '<img src="'.$value.'"width="50" height="50"/>'; |
|
75 | - } |
|
76 | - if ($name === 'aos_products_quotes_product_qty'){ |
|
77 | - $sep = get_number_seperators(); |
|
78 | - $value=rtrim(rtrim(format_number($value), '0'),$sep[1]); |
|
79 | - } |
|
80 | - if ($name === 'aos_products_quotes_vat'||strpos($name,'pct')>0 || strpos($name,'percent')>0 || strpos($name,'percentage')>0){ |
|
81 | - $sep = get_number_seperators(); |
|
82 | - $value=rtrim(rtrim(format_number($value), '0'),$sep[1]).$app_strings['LBL_PERCENTAGE_SYMBOL']; |
|
83 | - } |
|
84 | - if (strpos($name,'date')>0 || strpos($name,'expiration')>0){ |
|
85 | - if($value != ''){ |
|
86 | - $dt = explode(' ',$value); |
|
87 | - $value = $dt[0]; |
|
88 | - } |
|
89 | - } |
|
90 | - if($value != '' && is_string($value)) { |
|
91 | - $string = str_replace("\$$name", $value, $string); |
|
92 | - } else if(strpos($name,'address')>0) { |
|
93 | - $string = str_replace("\$$name<br />", '', $string); |
|
94 | - $string = str_replace("\$$name <br />", '', $string); |
|
95 | - $string = str_replace("\$$name", '', $string); |
|
96 | - } else { |
|
97 | - $string = str_replace("\$$name", ' ', $string); |
|
98 | - } |
|
54 | + foreach ($repl_arr as $name=>$value) { |
|
55 | + if (strpos($name,'product_discount')>0){ |
|
56 | + if($value != '' && $value != '0.00') |
|
57 | + { |
|
58 | + if($repl_arr['aos_products_quotes_discount'] == 'Percentage') |
|
59 | + { |
|
60 | + $sep = get_number_seperators(); |
|
61 | + $value=rtrim(rtrim(format_number($value), '0'),$sep[1]);//.$app_strings['LBL_PERCENTAGE_SYMBOL']; |
|
62 | + } |
|
63 | + else |
|
64 | + { |
|
65 | + $value=currency_format_number($value,$params = array('currency_symbol' => false)); |
|
66 | + } |
|
67 | + } |
|
68 | + else |
|
69 | + { |
|
70 | + $value=''; |
|
71 | + } |
|
72 | + } |
|
73 | + if ($name === 'aos_products_product_image'){ |
|
74 | + $value = '<img src="'.$value.'"width="50" height="50"/>'; |
|
75 | + } |
|
76 | + if ($name === 'aos_products_quotes_product_qty'){ |
|
77 | + $sep = get_number_seperators(); |
|
78 | + $value=rtrim(rtrim(format_number($value), '0'),$sep[1]); |
|
79 | + } |
|
80 | + if ($name === 'aos_products_quotes_vat'||strpos($name,'pct')>0 || strpos($name,'percent')>0 || strpos($name,'percentage')>0){ |
|
81 | + $sep = get_number_seperators(); |
|
82 | + $value=rtrim(rtrim(format_number($value), '0'),$sep[1]).$app_strings['LBL_PERCENTAGE_SYMBOL']; |
|
83 | + } |
|
84 | + if (strpos($name,'date')>0 || strpos($name,'expiration')>0){ |
|
85 | + if($value != ''){ |
|
86 | + $dt = explode(' ',$value); |
|
87 | + $value = $dt[0]; |
|
88 | + } |
|
89 | + } |
|
90 | + if($value != '' && is_string($value)) { |
|
91 | + $string = str_replace("\$$name", $value, $string); |
|
92 | + } else if(strpos($name,'address')>0) { |
|
93 | + $string = str_replace("\$$name<br />", '', $string); |
|
94 | + $string = str_replace("\$$name <br />", '', $string); |
|
95 | + $string = str_replace("\$$name", '', $string); |
|
96 | + } else { |
|
97 | + $string = str_replace("\$$name", ' ', $string); |
|
98 | + } |
|
99 | 99 | |
100 | 100 | |
101 | - } |
|
101 | + } |
|
102 | 102 | |
103 | - return $string; |
|
104 | - } |
|
105 | - function parse_template($string, &$bean_arr) { |
|
106 | - global $beanFiles, $beanList; |
|
103 | + return $string; |
|
104 | + } |
|
105 | + function parse_template($string, &$bean_arr) { |
|
106 | + global $beanFiles, $beanList; |
|
107 | 107 | |
108 | - foreach($bean_arr as $bean_name => $bean_id) { |
|
108 | + foreach($bean_arr as $bean_name => $bean_id) { |
|
109 | 109 | |
110 | - require_once($beanFiles[$beanList[$bean_name]]); |
|
110 | + require_once($beanFiles[$beanList[$bean_name]]); |
|
111 | 111 | |
112 | - $focus = new $beanList[$bean_name]; |
|
113 | - $focus->retrieve($bean_id); |
|
112 | + $focus = new $beanList[$bean_name]; |
|
113 | + $focus->retrieve($bean_id); |
|
114 | 114 | |
115 | - $string = templateParser::parse_template_bean($string, $focus->table_name, $focus); |
|
115 | + $string = templateParser::parse_template_bean($string, $focus->table_name, $focus); |
|
116 | 116 | |
117 | - foreach($focus->field_defs as $focus_name => $focus_arr){ |
|
118 | - if($focus_arr['type'] == 'relate'){ |
|
119 | - if(isset($focus_arr['module']) && $focus_arr['module'] != '' && $focus_arr['module'] != 'EmailAddress'){ |
|
120 | - //$relate_focus_name = $beanList[$focus_arr['module']]; |
|
121 | - $relate_focus = new $beanList[$focus_arr['module']](); |
|
122 | - $relate_focus->retrieve($focus->$focus_arr['id_name']); |
|
123 | - //$object_arr[$relate_focus->module_dir] = $focus->$focus_arr['id_name']; |
|
124 | - $string = templateParser::parse_template_bean($string, $focus_arr['name'], $relate_focus); |
|
125 | - } |
|
126 | - } |
|
127 | - } |
|
117 | + foreach($focus->field_defs as $focus_name => $focus_arr){ |
|
118 | + if($focus_arr['type'] == 'relate'){ |
|
119 | + if(isset($focus_arr['module']) && $focus_arr['module'] != '' && $focus_arr['module'] != 'EmailAddress'){ |
|
120 | + //$relate_focus_name = $beanList[$focus_arr['module']]; |
|
121 | + $relate_focus = new $beanList[$focus_arr['module']](); |
|
122 | + $relate_focus->retrieve($focus->$focus_arr['id_name']); |
|
123 | + //$object_arr[$relate_focus->module_dir] = $focus->$focus_arr['id_name']; |
|
124 | + $string = templateParser::parse_template_bean($string, $focus_arr['name'], $relate_focus); |
|
125 | + } |
|
126 | + } |
|
127 | + } |
|
128 | 128 | |
129 | - } |
|
130 | - return $string; |
|
131 | - } |
|
132 | - } |
|
129 | + } |
|
130 | + return $string; |
|
131 | + } |
|
132 | + } |
|
133 | 133 | ?> |