@@ -45,16 +45,16 @@ discard block |
||
45 | 45 | * Contributor(s): ______________________________________.. |
46 | 46 | ********************************************************************************/ |
47 | 47 | $viewdefs = array ( |
48 | - 'Contacts' => |
|
49 | - array ( |
|
48 | + 'Contacts' => |
|
49 | + array ( |
|
50 | 50 | 'QuickCreate' => |
51 | 51 | array ( |
52 | - 'templateMeta' => |
|
53 | - array ( |
|
52 | + 'templateMeta' => |
|
53 | + array ( |
|
54 | 54 | 'form' => |
55 | 55 | array ( |
56 | - 'hidden' => |
|
57 | - array ( |
|
56 | + 'hidden' => |
|
57 | + array ( |
|
58 | 58 | '<input type="hidden" name="opportunity_id" value="{$smarty.request.opportunity_id}">', |
59 | 59 | '<input type="hidden" name="case_id" value="{$smarty.request.case_id}">', |
60 | 60 | '<input type="hidden" name="bug_id" value="{$smarty.request.bug_id}">', |
@@ -62,91 +62,91 @@ discard block |
||
62 | 62 | '<input type="hidden" name="inbound_email_id" value="{$smarty.request.inbound_email_id}">', |
63 | 63 | '{if !empty($smarty.request.contact_id)}<input type="hidden" name="reports_to_id" value="{$smarty.request.contact_id}">{/if}', |
64 | 64 | '{if !empty($smarty.request.contact_name)}<input type="hidden" name="report_to_name" value="{$smarty.request.contact_name}">{/if}', |
65 | - ), |
|
65 | + ), |
|
66 | 66 | ), |
67 | 67 | 'maxColumns' => '2', |
68 | 68 | 'widths' => |
69 | 69 | array ( |
70 | - array ( |
|
70 | + array ( |
|
71 | 71 | 'label' => '10', |
72 | 72 | 'field' => '30', |
73 | - ), |
|
74 | - array ( |
|
73 | + ), |
|
74 | + array ( |
|
75 | 75 | 'label' => '10', |
76 | 76 | 'field' => '30', |
77 | - ), |
|
77 | + ), |
|
78 | + ), |
|
78 | 79 | ), |
79 | - ), |
|
80 | - 'panels' => |
|
81 | - array ( |
|
80 | + 'panels' => |
|
81 | + array ( |
|
82 | 82 | 'default' => |
83 | 83 | array ( |
84 | 84 | |
85 | - array ( |
|
85 | + array ( |
|
86 | 86 | |
87 | 87 | array ( |
88 | - 'name' => 'first_name', |
|
88 | + 'name' => 'first_name', |
|
89 | 89 | 'customCode' => '{html_options name="salutation" id="salutation" options=$fields.salutation.options selected=$fields.salutation.value}' |
90 | 90 | . ' <input name="first_name" id="first_name" size="25" maxlength="25" type="text" value="{$fields.first_name.value}">', |
91 | 91 | ), |
92 | 92 | |
93 | 93 | array ( |
94 | - 'name' => 'account_name', |
|
94 | + 'name' => 'account_name', |
|
95 | + ), |
|
95 | 96 | ), |
96 | - ), |
|
97 | 97 | |
98 | - array ( |
|
98 | + array ( |
|
99 | 99 | |
100 | 100 | array ( |
101 | - 'name' => 'last_name', |
|
102 | - 'displayParams'=>array('required'=>true), |
|
101 | + 'name' => 'last_name', |
|
102 | + 'displayParams'=>array('required'=>true), |
|
103 | 103 | ), |
104 | 104 | |
105 | 105 | array ( |
106 | - 'name' => 'phone_work', |
|
106 | + 'name' => 'phone_work', |
|
107 | + ), |
|
107 | 108 | ), |
108 | - ), |
|
109 | 109 | |
110 | - array ( |
|
110 | + array ( |
|
111 | 111 | |
112 | 112 | array ( |
113 | - 'name' => 'title', |
|
113 | + 'name' => 'title', |
|
114 | 114 | ), |
115 | 115 | |
116 | 116 | array ( |
117 | - 'name' => 'phone_mobile', |
|
117 | + 'name' => 'phone_mobile', |
|
118 | + ), |
|
118 | 119 | ), |
119 | - ), |
|
120 | 120 | |
121 | - array ( |
|
121 | + array ( |
|
122 | 122 | |
123 | 123 | array ( |
124 | - 'name' => 'phone_fax', |
|
124 | + 'name' => 'phone_fax', |
|
125 | 125 | ), |
126 | 126 | |
127 | 127 | array ( |
128 | - 'name' => 'do_not_call', |
|
128 | + 'name' => 'do_not_call', |
|
129 | + ), |
|
129 | 130 | ), |
130 | - ), |
|
131 | 131 | |
132 | - array ( |
|
133 | 132 | array ( |
134 | - 'name' => 'email1', |
|
133 | + array ( |
|
134 | + 'name' => 'email1', |
|
135 | 135 | ), |
136 | 136 | array ( |
137 | - 'name' => 'lead_source', |
|
137 | + 'name' => 'lead_source', |
|
138 | + ), |
|
138 | 139 | ), |
139 | - ), |
|
140 | 140 | |
141 | - array ( |
|
141 | + array ( |
|
142 | 142 | |
143 | 143 | array ( |
144 | - 'name' => 'assigned_user_name', |
|
144 | + 'name' => 'assigned_user_name', |
|
145 | 145 | ), |
146 | - ), |
|
146 | + ), |
|
147 | + ), |
|
147 | 148 | ), |
148 | - ), |
|
149 | 149 | ), |
150 | - ), |
|
150 | + ), |
|
151 | 151 | ); |
152 | 152 | ?> |
@@ -43,12 +43,12 @@ |
||
43 | 43 | * To change the template for this generated file go to |
44 | 44 | * Window - Preferences - PHPeclipse - PHP - Code Templates |
45 | 45 | */ |
46 | - $metafiles['Contacts'] = array( |
|
47 | - 'detailviewdefs' => 'modules/Contacts/metadata/detailviewdefs.php', |
|
48 | - 'editviewdefs' => 'modules/Contacts/metadata/editviewdefs.php', |
|
49 | - 'listviewdefs' => 'modules/Contacts/metadata/listviewdefs.php', |
|
50 | - 'searchdefs' => 'modules/Contacts/metadata/searchdefs.php', |
|
51 | - 'popupdefs' => 'modules/Contacts/metadata/popupdefs.php', |
|
52 | - 'searchfields' => 'modules/Contacts/metadata/SearchFields.php', |
|
53 | - ); |
|
46 | + $metafiles['Contacts'] = array( |
|
47 | + 'detailviewdefs' => 'modules/Contacts/metadata/detailviewdefs.php', |
|
48 | + 'editviewdefs' => 'modules/Contacts/metadata/editviewdefs.php', |
|
49 | + 'listviewdefs' => 'modules/Contacts/metadata/listviewdefs.php', |
|
50 | + 'searchdefs' => 'modules/Contacts/metadata/searchdefs.php', |
|
51 | + 'popupdefs' => 'modules/Contacts/metadata/popupdefs.php', |
|
52 | + 'searchfields' => 'modules/Contacts/metadata/SearchFields.php', |
|
53 | + ); |
|
54 | 54 | ?> |
@@ -42,61 +42,61 @@ discard block |
||
42 | 42 | |
43 | 43 | |
44 | 44 | $listViewDefs['Contacts'] = array( |
45 | - 'NAME' => array( |
|
46 | - 'width' => '20%', |
|
47 | - 'label' => 'LBL_LIST_NAME', |
|
48 | - 'link' => true, |
|
45 | + 'NAME' => array( |
|
46 | + 'width' => '20%', |
|
47 | + 'label' => 'LBL_LIST_NAME', |
|
48 | + 'link' => true, |
|
49 | 49 | 'contextMenu' => array('objectType' => 'sugarPerson', |
50 | - 'metaData' => array('contact_id' => '{$ID}', |
|
51 | - 'module' => 'Contacts', |
|
52 | - 'return_action' => 'ListView', |
|
53 | - 'contact_name' => '{$FULL_NAME}', |
|
54 | - 'parent_id' => '{$ACCOUNT_ID}', |
|
55 | - 'parent_name' => '{$ACCOUNT_NAME}', |
|
56 | - 'return_module' => 'Contacts', |
|
57 | - 'return_action' => 'ListView', |
|
58 | - 'parent_type' => 'Account', |
|
59 | - 'notes_parent_type' => 'Account') |
|
60 | - ), |
|
61 | - 'orderBy' => 'name', |
|
50 | + 'metaData' => array('contact_id' => '{$ID}', |
|
51 | + 'module' => 'Contacts', |
|
52 | + 'return_action' => 'ListView', |
|
53 | + 'contact_name' => '{$FULL_NAME}', |
|
54 | + 'parent_id' => '{$ACCOUNT_ID}', |
|
55 | + 'parent_name' => '{$ACCOUNT_NAME}', |
|
56 | + 'return_module' => 'Contacts', |
|
57 | + 'return_action' => 'ListView', |
|
58 | + 'parent_type' => 'Account', |
|
59 | + 'notes_parent_type' => 'Account') |
|
60 | + ), |
|
61 | + 'orderBy' => 'name', |
|
62 | 62 | 'default' => true, |
63 | 63 | 'related_fields' => array('first_name', 'last_name', 'salutation', 'account_name', 'account_id'), |
64 | - ), |
|
65 | - 'TITLE' => array( |
|
66 | - 'width' => '15%', |
|
67 | - 'label' => 'LBL_LIST_TITLE', |
|
64 | + ), |
|
65 | + 'TITLE' => array( |
|
66 | + 'width' => '15%', |
|
67 | + 'label' => 'LBL_LIST_TITLE', |
|
68 | 68 | 'default' => true), |
69 | - 'ACCOUNT_NAME' => array( |
|
70 | - 'width' => '34%', |
|
71 | - 'label' => 'LBL_LIST_ACCOUNT_NAME', |
|
72 | - 'module' => 'Accounts', |
|
73 | - 'id' => 'ACCOUNT_ID', |
|
74 | - 'link' => true, |
|
69 | + 'ACCOUNT_NAME' => array( |
|
70 | + 'width' => '34%', |
|
71 | + 'label' => 'LBL_LIST_ACCOUNT_NAME', |
|
72 | + 'module' => 'Accounts', |
|
73 | + 'id' => 'ACCOUNT_ID', |
|
74 | + 'link' => true, |
|
75 | 75 | 'contextMenu' => array('objectType' => 'sugarAccount', |
76 | - 'metaData' => array('return_module' => 'Contacts', |
|
77 | - 'return_action' => 'ListView', |
|
78 | - 'module' => 'Accounts', |
|
79 | - 'return_action' => 'ListView', |
|
80 | - 'parent_id' => '{$ACCOUNT_ID}', |
|
81 | - 'parent_name' => '{$ACCOUNT_NAME}', |
|
82 | - 'account_id' => '{$ACCOUNT_ID}', |
|
83 | - 'account_name' => '{$ACCOUNT_NAME}'), |
|
84 | - ), |
|
76 | + 'metaData' => array('return_module' => 'Contacts', |
|
77 | + 'return_action' => 'ListView', |
|
78 | + 'module' => 'Accounts', |
|
79 | + 'return_action' => 'ListView', |
|
80 | + 'parent_id' => '{$ACCOUNT_ID}', |
|
81 | + 'parent_name' => '{$ACCOUNT_NAME}', |
|
82 | + 'account_id' => '{$ACCOUNT_ID}', |
|
83 | + 'account_name' => '{$ACCOUNT_NAME}'), |
|
84 | + ), |
|
85 | 85 | 'default' => true, |
86 | 86 | 'sortable'=> true, |
87 | 87 | 'ACLTag' => 'ACCOUNT', |
88 | 88 | 'related_fields' => array('account_id')), |
89 | - 'EMAIL1' => array( |
|
90 | - 'width' => '15%', |
|
91 | - 'label' => 'LBL_LIST_EMAIL_ADDRESS', |
|
92 | - 'sortable' => false, |
|
93 | - 'link' => true, |
|
94 | - 'customCode' => '{$EMAIL1_LINK}{$EMAIL1}</a>', |
|
89 | + 'EMAIL1' => array( |
|
90 | + 'width' => '15%', |
|
91 | + 'label' => 'LBL_LIST_EMAIL_ADDRESS', |
|
92 | + 'sortable' => false, |
|
93 | + 'link' => true, |
|
94 | + 'customCode' => '{$EMAIL1_LINK}{$EMAIL1}</a>', |
|
95 | 95 | 'default' => true |
96 | - ), |
|
97 | - 'PHONE_WORK' => array( |
|
98 | - 'width' => '15%', |
|
99 | - 'label' => 'LBL_OFFICE_PHONE', |
|
96 | + ), |
|
97 | + 'PHONE_WORK' => array( |
|
98 | + 'width' => '15%', |
|
99 | + 'label' => 'LBL_OFFICE_PHONE', |
|
100 | 100 | 'default' => true), |
101 | 101 | 'DEPARTMENT' => array( |
102 | 102 | 'width' => '10', |
@@ -177,6 +177,6 @@ discard block |
||
177 | 177 | 'DATE_ENTERED' => array( |
178 | 178 | 'width' => '10', |
179 | 179 | 'label' => 'LBL_DATE_ENTERED', |
180 | - 'default' => true) |
|
180 | + 'default' => true) |
|
181 | 181 | ); |
182 | 182 | ?> |
@@ -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 | } |
@@ -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 |
@@ -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 |
@@ -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. |
@@ -26,17 +26,17 @@ discard block |
||
26 | 26 | |
27 | 27 | //ini_set('display_errors', '1'); |
28 | 28 | |
29 | - require_once('modules/AOS_PDF_Templates/PDF_Lib/mpdf.php'); |
|
30 | - require_once('modules/AOS_PDF_Templates/templateParser.php'); |
|
31 | - require_once('modules/AOS_PDF_Templates/AOS_PDF_Templates.php'); |
|
29 | + require_once('modules/AOS_PDF_Templates/PDF_Lib/mpdf.php'); |
|
30 | + require_once('modules/AOS_PDF_Templates/templateParser.php'); |
|
31 | + require_once('modules/AOS_PDF_Templates/AOS_PDF_Templates.php'); |
|
32 | 32 | |
33 | - global $sugar_config; |
|
33 | + global $sugar_config; |
|
34 | 34 | |
35 | 35 | $module_type = $_REQUEST['module']; |
36 | - $module_type_create = rtrim($module_type,'s'); |
|
37 | - $module_type_low = strtolower($module_type); |
|
36 | + $module_type_create = rtrim($module_type,'s'); |
|
37 | + $module_type_low = strtolower($module_type); |
|
38 | 38 | |
39 | - $module = new $module_type_create(); |
|
39 | + $module = new $module_type_create(); |
|
40 | 40 | |
41 | 41 | $recordIds = array(); |
42 | 42 | |
@@ -59,101 +59,101 @@ discard block |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | |
62 | - $template = new AOS_PDF_Templates(); |
|
63 | - $template->retrieve($_REQUEST['templateID']); |
|
62 | + $template = new AOS_PDF_Templates(); |
|
63 | + $template->retrieve($_REQUEST['templateID']); |
|
64 | 64 | |
65 | - $pdf=new mPDF('en','A4','','DejaVuSansCondensed',$template->margin_left,$template->margin_right,$template->margin_top,$template->margin_bottom,$template->margin_header,$template->margin_footer); |
|
65 | + $pdf=new mPDF('en','A4','','DejaVuSansCondensed',$template->margin_left,$template->margin_right,$template->margin_top,$template->margin_bottom,$template->margin_header,$template->margin_footer); |
|
66 | 66 | |
67 | - foreach ($recordIds as $recordId) { |
|
68 | - $module->retrieve($recordId); |
|
69 | - $pdf_history=new mPDF('en','A4','','DejaVuSansCondensed',$template->margin_left,$template->margin_right,$template->margin_top,$template->margin_bottom,$template->margin_header,$template->margin_footer); |
|
67 | + foreach ($recordIds as $recordId) { |
|
68 | + $module->retrieve($recordId); |
|
69 | + $pdf_history=new mPDF('en','A4','','DejaVuSansCondensed',$template->margin_left,$template->margin_right,$template->margin_top,$template->margin_bottom,$template->margin_header,$template->margin_footer); |
|
70 | 70 | |
71 | - $object_arr = array(); |
|
72 | - $object_arr[$module_type] = $module->id; |
|
71 | + $object_arr = array(); |
|
72 | + $object_arr[$module_type] = $module->id; |
|
73 | 73 | |
74 | - if($module_type === 'Contacts') |
|
75 | - { |
|
76 | - $object_arr['Accounts'] = $module->account_id; |
|
77 | - } |
|
74 | + if($module_type === 'Contacts') |
|
75 | + { |
|
76 | + $object_arr['Accounts'] = $module->account_id; |
|
77 | + } |
|
78 | 78 | |
79 | - $search = array ('@<script[^>]*?>.*?</script>@si', // Strip out javascript |
|
80 | - '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags |
|
81 | - '@([\r\n])[\s]+@', // Strip out white space |
|
82 | - '@&(quot|#34);@i', // Replace HTML entities |
|
83 | - '@&(amp|#38);@i', |
|
84 | - '@&(lt|#60);@i', |
|
85 | - '@&(gt|#62);@i', |
|
86 | - '@&(nbsp|#160);@i', |
|
87 | - '@&(iexcl|#161);@i', |
|
88 | - '@<address[^>]*?>@si' |
|
89 | - ); |
|
79 | + $search = array ('@<script[^>]*?>.*?</script>@si', // Strip out javascript |
|
80 | + '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags |
|
81 | + '@([\r\n])[\s]+@', // Strip out white space |
|
82 | + '@&(quot|#34);@i', // Replace HTML entities |
|
83 | + '@&(amp|#38);@i', |
|
84 | + '@&(lt|#60);@i', |
|
85 | + '@&(gt|#62);@i', |
|
86 | + '@&(nbsp|#160);@i', |
|
87 | + '@&(iexcl|#161);@i', |
|
88 | + '@<address[^>]*?>@si' |
|
89 | + ); |
|
90 | 90 | |
91 | - $replace = array ('', |
|
92 | - '', |
|
93 | - '\1', |
|
94 | - '"', |
|
95 | - '&', |
|
96 | - '<', |
|
97 | - '>', |
|
98 | - ' ', |
|
99 | - chr(161), |
|
100 | - '<br>' |
|
101 | - ); |
|
91 | + $replace = array ('', |
|
92 | + '', |
|
93 | + '\1', |
|
94 | + '"', |
|
95 | + '&', |
|
96 | + '<', |
|
97 | + '>', |
|
98 | + ' ', |
|
99 | + chr(161), |
|
100 | + '<br>' |
|
101 | + ); |
|
102 | 102 | |
103 | - $text = preg_replace($search, $replace, $template->description); |
|
104 | - $text = preg_replace_callback('/\{DATE\s+(.*?)\}/', |
|
105 | - function ($matches) { return date($matches[1]); }, |
|
106 | - $text ); |
|
107 | - $header = preg_replace($search, $replace, $template->pdfheader); |
|
108 | - $footer = preg_replace($search, $replace, $template->pdffooter); |
|
103 | + $text = preg_replace($search, $replace, $template->description); |
|
104 | + $text = preg_replace_callback('/\{DATE\s+(.*?)\}/', |
|
105 | + function ($matches) { return date($matches[1]); }, |
|
106 | + $text ); |
|
107 | + $header = preg_replace($search, $replace, $template->pdfheader); |
|
108 | + $footer = preg_replace($search, $replace, $template->pdffooter); |
|
109 | 109 | |
110 | - $converted = templateParser::parse_template($text, $object_arr); |
|
111 | - $header = templateParser::parse_template($header, $object_arr); |
|
112 | - $footer = templateParser::parse_template($footer, $object_arr); |
|
110 | + $converted = templateParser::parse_template($text, $object_arr); |
|
111 | + $header = templateParser::parse_template($header, $object_arr); |
|
112 | + $footer = templateParser::parse_template($footer, $object_arr); |
|
113 | 113 | |
114 | - $printable = str_replace("\n","<br />",$converted); |
|
114 | + $printable = str_replace("\n","<br />",$converted); |
|
115 | 115 | |
116 | - $file_name = str_replace(" ","_",$template->name).".pdf"; |
|
116 | + $file_name = str_replace(" ","_",$template->name).".pdf"; |
|
117 | 117 | |
118 | - ob_clean(); |
|
119 | - try{ |
|
120 | - $note = new Note(); |
|
121 | - $note->modified_user_id = $current_user->id; |
|
122 | - $note->created_by = $current_user->id; |
|
123 | - $note->name = $file_name; |
|
124 | - $note->parent_type = $module_type; |
|
125 | - $note->parent_id = $module->id; |
|
126 | - $note->file_mime_type = 'application/pdf'; |
|
127 | - $note->filename = $file_name; |
|
128 | - if($module_type == 'Contacts') |
|
129 | - { |
|
130 | - $note->contact_id = $module->id; |
|
131 | - $note->parent_type = 'Accounts'; |
|
132 | - $note->parent_id = $module->account_id; |
|
133 | - } |
|
134 | - $note->save(); |
|
118 | + ob_clean(); |
|
119 | + try{ |
|
120 | + $note = new Note(); |
|
121 | + $note->modified_user_id = $current_user->id; |
|
122 | + $note->created_by = $current_user->id; |
|
123 | + $note->name = $file_name; |
|
124 | + $note->parent_type = $module_type; |
|
125 | + $note->parent_id = $module->id; |
|
126 | + $note->file_mime_type = 'application/pdf'; |
|
127 | + $note->filename = $file_name; |
|
128 | + if($module_type == 'Contacts') |
|
129 | + { |
|
130 | + $note->contact_id = $module->id; |
|
131 | + $note->parent_type = 'Accounts'; |
|
132 | + $note->parent_id = $module->account_id; |
|
133 | + } |
|
134 | + $note->save(); |
|
135 | 135 | |
136 | - $fp = fopen($sugar_config['upload_dir'].'nfile.pdf','wb'); |
|
137 | - fclose($fp); |
|
136 | + $fp = fopen($sugar_config['upload_dir'].'nfile.pdf','wb'); |
|
137 | + fclose($fp); |
|
138 | 138 | |
139 | - $pdf_history->setAutoFont(); |
|
140 | - $pdf_history->SetHTMLHeader($header); |
|
141 | - $pdf_history->SetHTMLFooter($footer); |
|
142 | - $pdf_history->writeHTML($printable); |
|
143 | - $pdf_history->Output($sugar_config['upload_dir'].'nfile.pdf','F'); |
|
139 | + $pdf_history->setAutoFont(); |
|
140 | + $pdf_history->SetHTMLHeader($header); |
|
141 | + $pdf_history->SetHTMLFooter($footer); |
|
142 | + $pdf_history->writeHTML($printable); |
|
143 | + $pdf_history->Output($sugar_config['upload_dir'].'nfile.pdf','F'); |
|
144 | 144 | |
145 | - $pdf->AddPage(); |
|
146 | - $pdf->setAutoFont(); |
|
147 | - $pdf->SetHTMLHeader($header); |
|
148 | - $pdf->SetHTMLFooter($footer); |
|
149 | - $pdf->writeHTML($printable); |
|
145 | + $pdf->AddPage(); |
|
146 | + $pdf->setAutoFont(); |
|
147 | + $pdf->SetHTMLHeader($header); |
|
148 | + $pdf->SetHTMLFooter($footer); |
|
149 | + $pdf->writeHTML($printable); |
|
150 | 150 | |
151 | - rename($sugar_config['upload_dir'].'nfile.pdf',$sugar_config['upload_dir'].$note->id); |
|
151 | + rename($sugar_config['upload_dir'].'nfile.pdf',$sugar_config['upload_dir'].$note->id); |
|
152 | 152 | |
153 | - }catch(mPDF_exception $e){ |
|
154 | - echo $e; |
|
155 | - } |
|
156 | - } |
|
153 | + }catch(mPDF_exception $e){ |
|
154 | + echo $e; |
|
155 | + } |
|
156 | + } |
|
157 | 157 | |
158 | - $pdf->Output($file_name, "D"); |
|
158 | + $pdf->Output($file_name, "D"); |
|
159 | 159 | ?> |
@@ -35,103 +35,103 @@ |
||
35 | 35 | * "Powered by SugarCRM". |
36 | 36 | ********************************************************************************/ |
37 | 37 | |
38 | - if(!defined('ACL_ALLOW_NONE')){ |
|
39 | - define('ACL_ALLOW_ADMIN_DEV', 100); |
|
40 | - define('ACL_ALLOW_ADMIN', 99); |
|
41 | - define('ACL_ALLOW_ALL', 90); |
|
42 | - define('ACL_ALLOW_ENABLED', 89); |
|
43 | - /* BEGIN - SECURITY GROUPS */ |
|
44 | - define('ACL_ALLOW_GROUP', 80); //securitygroup |
|
45 | - /* END - SECURITY GROUPS */ |
|
46 | - define('ACL_ALLOW_OWNER', 75); |
|
47 | - define('ACL_ALLOW_NORMAL', 1); |
|
48 | - define('ACL_ALLOW_DEFAULT', 0); |
|
49 | - define('ACL_ALLOW_DISABLED', -98); |
|
50 | - define('ACL_ALLOW_NONE', -99); |
|
51 | - define('ACL_ALLOW_DEV', 95); |
|
52 | - } |
|
53 | - /** |
|
54 | - * $GLOBALS['ACLActionAccessLevels |
|
55 | - * these are rendering descriptions for Access Levels giving information such as the label, color, and text color to use when rendering the access level |
|
56 | - */ |
|
57 | - $GLOBALS['ACLActionAccessLevels'] = array( |
|
58 | - ACL_ALLOW_ALL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ALL', 'text_color'=>'white'), |
|
59 | - ACL_ALLOW_OWNER=>array('color'=>'#6F6800', 'label'=>'LBL_ACCESS_OWNER', 'text_color'=>'white'), |
|
60 | - ACL_ALLOW_NONE=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_NONE', 'text_color'=>'white'), |
|
61 | - ACL_ALLOW_ENABLED=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ENABLED', 'text_color'=>'white'), |
|
62 | - ACL_ALLOW_DISABLED=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_DISABLED', 'text_color'=>'white'), |
|
63 | - ACL_ALLOW_ADMIN=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN', 'text_color'=>'white'), |
|
64 | - ACL_ALLOW_NORMAL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_NORMAL', 'text_color'=>'white'), |
|
65 | - ACL_ALLOW_DEFAULT=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_DEFAULT', 'text_color'=>'white'), |
|
66 | - ACL_ALLOW_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_DEV', 'text_color'=>'white'), |
|
67 | - ACL_ALLOW_ADMIN_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN_DEV', 'text_color'=>'white'), |
|
68 | - /* BEGIN - SECURITY GROUPS */ |
|
69 | - ACL_ALLOW_GROUP=>array('color'=>'#0000A0', 'label'=>'LBL_ACCESS_GROUP', 'text_color'=>'white'), //securitygroup |
|
70 | - /* END - SECURITY GROUPS */ |
|
71 | - ); |
|
38 | + if(!defined('ACL_ALLOW_NONE')){ |
|
39 | + define('ACL_ALLOW_ADMIN_DEV', 100); |
|
40 | + define('ACL_ALLOW_ADMIN', 99); |
|
41 | + define('ACL_ALLOW_ALL', 90); |
|
42 | + define('ACL_ALLOW_ENABLED', 89); |
|
43 | + /* BEGIN - SECURITY GROUPS */ |
|
44 | + define('ACL_ALLOW_GROUP', 80); //securitygroup |
|
45 | + /* END - SECURITY GROUPS */ |
|
46 | + define('ACL_ALLOW_OWNER', 75); |
|
47 | + define('ACL_ALLOW_NORMAL', 1); |
|
48 | + define('ACL_ALLOW_DEFAULT', 0); |
|
49 | + define('ACL_ALLOW_DISABLED', -98); |
|
50 | + define('ACL_ALLOW_NONE', -99); |
|
51 | + define('ACL_ALLOW_DEV', 95); |
|
52 | + } |
|
53 | + /** |
|
54 | + * $GLOBALS['ACLActionAccessLevels |
|
55 | + * these are rendering descriptions for Access Levels giving information such as the label, color, and text color to use when rendering the access level |
|
56 | + */ |
|
57 | + $GLOBALS['ACLActionAccessLevels'] = array( |
|
58 | + ACL_ALLOW_ALL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ALL', 'text_color'=>'white'), |
|
59 | + ACL_ALLOW_OWNER=>array('color'=>'#6F6800', 'label'=>'LBL_ACCESS_OWNER', 'text_color'=>'white'), |
|
60 | + ACL_ALLOW_NONE=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_NONE', 'text_color'=>'white'), |
|
61 | + ACL_ALLOW_ENABLED=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_ENABLED', 'text_color'=>'white'), |
|
62 | + ACL_ALLOW_DISABLED=>array('color'=>'#FF0000', 'label'=>'LBL_ACCESS_DISABLED', 'text_color'=>'white'), |
|
63 | + ACL_ALLOW_ADMIN=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN', 'text_color'=>'white'), |
|
64 | + ACL_ALLOW_NORMAL=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_NORMAL', 'text_color'=>'white'), |
|
65 | + ACL_ALLOW_DEFAULT=>array('color'=>'#008000', 'label'=>'LBL_ACCESS_DEFAULT', 'text_color'=>'white'), |
|
66 | + ACL_ALLOW_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_DEV', 'text_color'=>'white'), |
|
67 | + ACL_ALLOW_ADMIN_DEV=>array('color'=>'#0000FF', 'label'=>'LBL_ACCESS_ADMIN_DEV', 'text_color'=>'white'), |
|
68 | + /* BEGIN - SECURITY GROUPS */ |
|
69 | + ACL_ALLOW_GROUP=>array('color'=>'#0000A0', 'label'=>'LBL_ACCESS_GROUP', 'text_color'=>'white'), //securitygroup |
|
70 | + /* END - SECURITY GROUPS */ |
|
71 | + ); |
|
72 | 72 | /** |
73 | - * $GLOBALS['ACLActions |
|
74 | - * These are the actions for a given type. It includes the ACCESS Levels for that action and the label for that action. Every an object of the category (e.g. module) is added all associated actions are added for that object |
|
75 | - */ |
|
73 | + * $GLOBALS['ACLActions |
|
74 | + * These are the actions for a given type. It includes the ACCESS Levels for that action and the label for that action. Every an object of the category (e.g. module) is added all associated actions are added for that object |
|
75 | + */ |
|
76 | 76 | /* BEGIN - SECURITY GROUPS */ |
77 | 77 | $GLOBALS['ACLActions'] = array( |
78 | - 'module'=>array('actions'=> |
|
79 | - array( |
|
80 | - 'access'=> |
|
81 | - array( |
|
82 | - 'aclaccess'=>array(ACL_ALLOW_ENABLED,ACL_ALLOW_DEFAULT, ACL_ALLOW_DISABLED), |
|
83 | - 'label'=>'LBL_ACTION_ACCESS', |
|
84 | - 'default'=>ACL_ALLOW_ENABLED, |
|
85 | - ), |
|
78 | + 'module'=>array('actions'=> |
|
79 | + array( |
|
80 | + 'access'=> |
|
81 | + array( |
|
82 | + 'aclaccess'=>array(ACL_ALLOW_ENABLED,ACL_ALLOW_DEFAULT, ACL_ALLOW_DISABLED), |
|
83 | + 'label'=>'LBL_ACTION_ACCESS', |
|
84 | + 'default'=>ACL_ALLOW_ENABLED, |
|
85 | + ), |
|
86 | 86 | |
87 | - 'view'=> |
|
88 | - array( |
|
89 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
90 | - 'label'=>'LBL_ACTION_VIEW', |
|
91 | - 'default'=>ACL_ALLOW_ALL, |
|
92 | - ), |
|
87 | + 'view'=> |
|
88 | + array( |
|
89 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
90 | + 'label'=>'LBL_ACTION_VIEW', |
|
91 | + 'default'=>ACL_ALLOW_ALL, |
|
92 | + ), |
|
93 | 93 | |
94 | - 'list'=> |
|
95 | - array( |
|
96 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
97 | - 'label'=>'LBL_ACTION_LIST', |
|
98 | - 'default'=>ACL_ALLOW_ALL, |
|
99 | - ), |
|
100 | - 'edit'=> |
|
101 | - array( |
|
102 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
103 | - 'label'=>'LBL_ACTION_EDIT', |
|
104 | - 'default'=>ACL_ALLOW_ALL, |
|
94 | + 'list'=> |
|
95 | + array( |
|
96 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
97 | + 'label'=>'LBL_ACTION_LIST', |
|
98 | + 'default'=>ACL_ALLOW_ALL, |
|
99 | + ), |
|
100 | + 'edit'=> |
|
101 | + array( |
|
102 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
103 | + 'label'=>'LBL_ACTION_EDIT', |
|
104 | + 'default'=>ACL_ALLOW_ALL, |
|
105 | 105 | |
106 | - ), |
|
107 | - 'delete'=> |
|
108 | - array( |
|
109 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
110 | - 'label'=>'LBL_ACTION_DELETE', |
|
111 | - 'default'=>ACL_ALLOW_ALL, |
|
106 | + ), |
|
107 | + 'delete'=> |
|
108 | + array( |
|
109 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
110 | + 'label'=>'LBL_ACTION_DELETE', |
|
111 | + 'default'=>ACL_ALLOW_ALL, |
|
112 | 112 | |
113 | - ), |
|
114 | - 'import'=> |
|
115 | - array( |
|
116 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
117 | - 'label'=>'LBL_ACTION_IMPORT', |
|
118 | - 'default'=>ACL_ALLOW_ALL, |
|
119 | - ), |
|
120 | - 'export'=> |
|
121 | - array( |
|
122 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
123 | - 'label'=>'LBL_ACTION_EXPORT', |
|
124 | - 'default'=>ACL_ALLOW_ALL, |
|
125 | - ), |
|
113 | + ), |
|
114 | + 'import'=> |
|
115 | + array( |
|
116 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
117 | + 'label'=>'LBL_ACTION_IMPORT', |
|
118 | + 'default'=>ACL_ALLOW_ALL, |
|
119 | + ), |
|
120 | + 'export'=> |
|
121 | + array( |
|
122 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_GROUP,ACL_ALLOW_OWNER,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
123 | + 'label'=>'LBL_ACTION_EXPORT', |
|
124 | + 'default'=>ACL_ALLOW_ALL, |
|
125 | + ), |
|
126 | 126 | 'massupdate'=> |
127 | - array( |
|
128 | - 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
129 | - 'label'=>'LBL_ACTION_MASSUPDATE', |
|
130 | - 'default'=>ACL_ALLOW_ALL, |
|
131 | - ), |
|
127 | + array( |
|
128 | + 'aclaccess'=>array(ACL_ALLOW_ALL,ACL_ALLOW_DEFAULT, ACL_ALLOW_NONE), |
|
129 | + 'label'=>'LBL_ACTION_MASSUPDATE', |
|
130 | + 'default'=>ACL_ALLOW_ALL, |
|
131 | + ), |
|
132 | 132 | |
133 | 133 | |
134 | - ),), |
|
134 | + ),), |
|
135 | 135 | ); |
136 | 136 | /* END - SECURITY GROUPS */ |
137 | 137 |