@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | // if user's lastname is part of the email address, check to see if the difference is only in the domain part |
129 | 129 | $email1 = preg_replace('/@.+/', '', $person1['email']); |
130 | 130 | $email2 = preg_replace('/@.+/', '', $person2['email']); |
131 | - if ( strpos($email1, $person1['lastname']) !== false |
|
131 | + if (strpos($email1, $person1['lastname']) !== false |
|
132 | 132 | && $email1 == $email2) { |
133 | 133 | $ret['email_match'] = true; |
134 | 134 | $ret['p'] += 0.5; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | |
175 | 175 | private function match($property, array $data1, array $data2) |
176 | 176 | { |
177 | - if ( !empty($data1[$property]) |
|
177 | + if (!empty($data1[$property]) |
|
178 | 178 | && $data1[$property] == $data2[$property]) { |
179 | 179 | return true; |
180 | 180 | } |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | $persons = $this->get_person_candidates(); |
326 | 326 | |
327 | 327 | $params = array(); |
328 | - $params['objects'] =& $persons; |
|
328 | + $params['objects'] = & $persons; |
|
329 | 329 | $params['mode'] = 'person'; |
330 | 330 | |
331 | 331 | array_walk($persons, array($this, 'check_all_arraywalk'), $params); |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | continue; |
388 | 388 | } |
389 | 389 | |
390 | - if ( $obj1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $obj2->guid) |
|
390 | + if ($obj1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $obj2->guid) |
|
391 | 391 | || $obj2->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $obj1->guid)) { |
392 | 392 | // Not-duplicate parameter found, returning zero probability |
393 | 393 | continue; |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | |
416 | 416 | $groups = $this->get_group_candidates(); |
417 | 417 | $params = array(); |
418 | - $params['objects'] =& $groups; |
|
418 | + $params['objects'] = & $groups; |
|
419 | 419 | $params['mode'] = 'group'; |
420 | 420 | array_walk($groups, array($this, 'check_all_arraywalk'), $params); |
421 | 421 | |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | { |
480 | 480 | debug_add($message); |
481 | 481 | if ($output) { |
482 | - echo $indent . 'INFO: ' . $message . "<br/>\n"; |
|
482 | + echo $indent . 'INFO: ' . $message . "<br/>\n"; |
|
483 | 483 | flush(); |
484 | 484 | } |
485 | 485 | } |
@@ -382,7 +382,8 @@ |
||
382 | 382 | try { |
383 | 383 | $obj1 = $class::get_cached($arr1['guid']); |
384 | 384 | $obj2 = $class::get_cached($arr2['guid']); |
385 | - } catch (midcom_error $e) { |
|
385 | + } |
|
386 | + catch (midcom_error $e) { |
|
386 | 387 | $e->log(); |
387 | 388 | continue; |
388 | 389 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $qb_receipts->add_constraint('message', '=', $this->_message->id); |
55 | 55 | $qb_receipts->add_constraint('orgOpenpsaObtype', '=', org_openpsa_directmarketing_campaign_messagereceipt_dba::SENT); |
56 | 56 | $receipts = $qb_receipts->execute_unchecked(); |
57 | - $receipt_data =& $this->_request_data['report']['receipt_data']; |
|
57 | + $receipt_data = & $this->_request_data['report']['receipt_data']; |
|
58 | 58 | $receipt_data['first_send'] = time(); |
59 | 59 | $receipt_data['last_send'] = 0; |
60 | 60 | $receipt_data['sent'] = count($receipts); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | private function _get_campaign_data($first_send) |
89 | 89 | { |
90 | - $campaign_data =& $this->_request_data['report']['campaign_data']; |
|
90 | + $campaign_data = & $this->_request_data['report']['campaign_data']; |
|
91 | 91 | $qb_unsub = org_openpsa_directmarketing_campaign_member_dba::new_query_builder(); |
92 | 92 | $qb_unsub->add_constraint('campaign', '=', $this->_message->campaign); |
93 | 93 | $qb_unsub->add_constraint('orgOpenpsaObtype', '=', org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED); |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | $campaign_data['next_message'] = false; |
96 | 96 | // Find "next message" and if present use its sendStarted as constraint for this query |
97 | 97 | $qb_messages = org_openpsa_directmarketing_campaign_message_dba::new_query_builder(); |
98 | - $qb_messages->add_constraint('campaign', '=', $this->_message->campaign); |
|
99 | - $qb_messages->add_constraint('id', '<>', $this->_message->id); |
|
98 | + $qb_messages->add_constraint('campaign', '=', $this->_message->campaign); |
|
99 | + $qb_messages->add_constraint('id', '<>', $this->_message->id); |
|
100 | 100 | $qb_messages->add_constraint('sendStarted', '>', $first_send); |
101 | 101 | $qb_messages->add_order('sendStarted', 'DESC'); |
102 | 102 | $qb_messages->set_limit(1); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | private function _get_link_data($segmentation_param) |
112 | 112 | { |
113 | 113 | $this->_request_data['report']['link_data'] = array(); |
114 | - $link_data =& $this->_request_data['report']['link_data']; |
|
114 | + $link_data = & $this->_request_data['report']['link_data']; |
|
115 | 115 | |
116 | 116 | $link_data['counts'] = array(); |
117 | 117 | $link_data['percentages'] = array('of_links' => array(), 'of_recipients' => array()); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | foreach ($links as $link) { |
138 | 138 | $segment = ''; |
139 | 139 | $segment_notfound = false; |
140 | - if ( $segmentation_param |
|
140 | + if ($segmentation_param |
|
141 | 141 | && !empty($link->person)) { |
142 | 142 | try { |
143 | 143 | $person = org_openpsa_contacts_person_dba::get_cached($link->person); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | if (!isset($link_data['segments'][$segment])) { |
152 | 152 | $link_data['segments'][$segment] = $segment_prototype; |
153 | 153 | } |
154 | - $segment_data =& $link_data['segments'][$segment]; |
|
154 | + $segment_data = & $link_data['segments'][$segment]; |
|
155 | 155 | } else { |
156 | 156 | $segment_data = $segment_prototype; |
157 | 157 | } |
@@ -261,15 +261,15 @@ discard block |
||
261 | 261 | $this->_initialize_field($array['percentages']['of_links'], $link); |
262 | 262 | $this->_initialize_field($array['percentages']['of_recipients'], $link); |
263 | 263 | |
264 | - $link_data =& $this->_request_data['report']['link_data']; |
|
265 | - $array['percentages']['of_links'][$link->target]['total'] = ($array['counts'][$link->target]['total']/$link_data['total'])*100; |
|
266 | - $array['percentages']['of_links'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token]/$link_data['total'])*100; |
|
264 | + $link_data = & $this->_request_data['report']['link_data']; |
|
265 | + $array['percentages']['of_links'][$link->target]['total'] = ($array['counts'][$link->target]['total'] / $link_data['total']) * 100; |
|
266 | + $array['percentages']['of_links'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token] / $link_data['total']) * 100; |
|
267 | 267 | |
268 | - $receipt_data =& $this->_request_data['report']['receipt_data']; |
|
269 | - $array['percentages']['of_recipients'][$link->target]['total'] = ((count($array['counts'][$link->target])-1)/($receipt_data['sent']-$receipt_data['bounced']))*100; |
|
270 | - $array['percentages']['of_recipients'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token]/($receipt_data['sent']-$receipt_data['bounced']))*100; |
|
268 | + $receipt_data = & $this->_request_data['report']['receipt_data']; |
|
269 | + $array['percentages']['of_recipients'][$link->target]['total'] = ((count($array['counts'][$link->target]) - 1) / ($receipt_data['sent'] - $receipt_data['bounced'])) * 100; |
|
270 | + $array['percentages']['of_recipients'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token] / ($receipt_data['sent'] - $receipt_data['bounced'])) * 100; |
|
271 | 271 | |
272 | - if ( !isset($array['percentages']['of_recipients']['total']) |
|
272 | + if (!isset($array['percentages']['of_recipients']['total']) |
|
273 | 273 | || $array['percentages']['of_recipients'][$link->target]['total'] > $array['percentages']['of_recipients']['total']) { |
274 | 274 | $array['percentages']['of_recipients']['total'] = $array['percentages']['of_recipients'][$link->target]['total']; |
275 | 275 | } |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | $this->_campaign = $this->_master->load_campaign($this->_message->campaign); |
336 | 336 | $data['campaign'] = $this->_campaign; |
337 | 337 | |
338 | - if ( isset($_POST['oo_dirmar_userule']) |
|
338 | + if (isset($_POST['oo_dirmar_userule']) |
|
339 | 339 | && !empty($_POST['oo_dirmar_rule_' . $_POST['oo_dirmar_userule']])) { |
340 | 340 | return $this->_create_campaign_from_link($_POST['oo_dirmar_userule']); |
341 | 341 | } |
@@ -142,7 +142,8 @@ |
||
142 | 142 | try { |
143 | 143 | $person = org_openpsa_contacts_person_dba::get_cached($link->person); |
144 | 144 | $segment = $person->get_parameter('org.openpsa.directmarketing.segments', $segmentation_param); |
145 | - } catch (midcom_error $e) { |
|
145 | + } |
|
146 | + catch (midcom_error $e) { |
|
146 | 147 | } |
147 | 148 | if (empty($segment)) { |
148 | 149 | $segment = $this->_l10n->get('no segment'); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | |
40 | 40 | public function resolve_object_link(midcom_db_topic $topic, midcom_core_dbaobject $object) |
41 | 41 | { |
42 | - if ( $object instanceof org_openpsa_documents_document_dba |
|
42 | + if ($object instanceof org_openpsa_documents_document_dba |
|
43 | 43 | && $object->topic == $topic->id) { |
44 | 44 | return "document/{$object->guid}/"; |
45 | 45 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * @package org.openpsa.documents |
13 | 13 | */ |
14 | 14 | class org_openpsa_documents_handler_document_admin extends midcom_baseclasses_components_handler |
15 | - implements midcom_helper_datamanager2_interfaces_create |
|
15 | + implements midcom_helper_datamanager2_interfaces_create |
|
16 | 16 | { |
17 | 17 | /** |
18 | 18 | * The document we're working with (if any). |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | $this->_controller = $this->get_controller('simple', $this->_document); |
116 | 116 | |
117 | - if ( $data['enable_versioning'] |
|
117 | + if ($data['enable_versioning'] |
|
118 | 118 | && !empty($_POST)) { |
119 | 119 | $this->_backup_attachment(); |
120 | 120 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $prefix = $node[MIDCOM_NAV_ABSOLUTEURL]; |
145 | 145 | } |
146 | 146 | |
147 | - return $prefix . "document/" . $this->_document->guid . "/"; |
|
147 | + return $prefix . "document/" . $this->_document->guid . "/"; |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | // First, look at post data (from in-form replace/delete buttons) |
158 | 158 | if (!empty($_POST['document'])) { |
159 | 159 | foreach (array_keys($_POST['document']) as $key) { |
160 | - if ( strpos($key, '_delete') |
|
161 | - || ( strpos($key, '_upload') |
|
160 | + if (strpos($key, '_delete') |
|
161 | + || (strpos($key, '_upload') |
|
162 | 162 | && !strpos($key, 'new_upload'))) { |
163 | 163 | $this->_document->backup_version(); |
164 | 164 | return; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | // If nothing is found, try looking in quickform (regular form submission) |
170 | 170 | $group = $this->_controller->formmanager->form->getElement('document'); |
171 | 171 | foreach ($group->getElements() as $element) { |
172 | - if ( preg_match('/e_exist_.+?_file$/', $element->getName()) |
|
172 | + if (preg_match('/e_exist_.+?_file$/', $element->getName()) |
|
173 | 173 | && $element->isUploadedFile()) { |
174 | 174 | $this->_document->backup_version(); |
175 | 175 | return; |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function _on_handle($handler, array $args) |
41 | 41 | { |
42 | - if ( strpos($handler, 'index') !== false |
|
42 | + if (strpos($handler, 'index') !== false |
|
43 | 43 | || strpos($handler, 'list') !== false) { |
44 | 44 | $task = false; |
45 | - if ( $handler == 'list_hours_task' |
|
45 | + if ($handler == 'list_hours_task' |
|
46 | 46 | || $handler == 'list_hours_task_all') { |
47 | 47 | $task = $args[0]; |
48 | 48 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $person_filter->set_label($this->_l10n->get("choose user")); |
65 | 65 | $qf->add_filter($person_filter); |
66 | 66 | |
67 | - if ( $this->_request_data['handler_id'] != 'index_timestamp' |
|
67 | + if ($this->_request_data['handler_id'] != 'index_timestamp' |
|
68 | 68 | && $this->_request_data['handler_id'] != 'index') { |
69 | 69 | $date_filter = new org_openpsa_core_filter_timeframe('date'); |
70 | 70 | $date_filter->set_label($this->_l10n->get("timeframe")); |
@@ -107,7 +107,7 @@ |
||
107 | 107 | $qb->add_constraint('id', '<>', $this->id); |
108 | 108 | } |
109 | 109 | // Make sure the product is in the same product group |
110 | - $qb->add_constraint('productGroup', '=', (int)$this->productGroup); |
|
110 | + $qb->add_constraint('productGroup', '=', (int) $this->productGroup); |
|
111 | 111 | |
112 | 112 | return ($qb->count() == 0); |
113 | 113 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | { |
171 | 171 | debug_add("task->start() called with user #" . midcom_connection::get_user()); |
172 | 172 | //PONDER: Check actual status objects for more accurate logic ? |
173 | - if ( $task->status >= org_openpsa_projects_task_status_dba::STARTED |
|
173 | + if ($task->status >= org_openpsa_projects_task_status_dba::STARTED |
|
174 | 174 | && $task->status <= org_openpsa_projects_task_status_dba::APPROVED) { |
175 | 175 | //We already have started status |
176 | 176 | debug_add('Task has already been started'); |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | |
383 | 383 | private static function is_manager($task) |
384 | 384 | { |
385 | - return ( $task->manager == 0 |
|
385 | + return ($task->manager == 0 |
|
386 | 386 | || midcom_connection::get_user() == $task->manager); |
387 | 387 | } |
388 | 388 | } |
@@ -356,7 +356,8 @@ |
||
356 | 356 | // The agreement allows invoicing only approved hours, therefore don't mark unapproved |
357 | 357 | $qb->add_constraint('metadata.isapproved', '=', true); |
358 | 358 | } |
359 | - } catch (midcom_error $e) { |
|
359 | + } |
|
360 | + catch (midcom_error $e) { |
|
360 | 361 | $e->log(); |
361 | 362 | } |
362 | 363 |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | public function _on_updated() |
94 | 94 | { |
95 | 95 | // Sync the object's ACL properties into MidCOM ACL system |
96 | - if ( !$this->_skip_acl_refresh) { |
|
96 | + if (!$this->_skip_acl_refresh) { |
|
97 | 97 | if ($this->orgOpenpsaAccesstype && $this->orgOpenpsaOwnerWg) { |
98 | 98 | debug_add("Synchronizing task ACLs to MidCOM"); |
99 | 99 | $sync = new org_openpsa_core_acl_synchronizer(); |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | |
327 | 327 | if ($report_data['invoice']) { |
328 | 328 | $hours['invoiced'] += $report_hours; |
329 | - } elseif ( $report_data['invoiceable'] |
|
329 | + } elseif ($report_data['invoiceable'] |
|
330 | 330 | && ($report_data['isapproved'] || !$invoice_approved_only)) { |
331 | 331 | $hours['invoiceable'] += $report_hours; |
332 | 332 | } |
@@ -240,7 +240,8 @@ discard block |
||
240 | 240 | $salesproject = org_openpsa_sales_salesproject_dba::get_cached($agreement->salesproject); |
241 | 241 | $this->customer = $salesproject->customer; |
242 | 242 | } |
243 | - } catch (midcom_error $e) { |
|
243 | + } |
|
244 | + catch (midcom_error $e) { |
|
244 | 245 | } |
245 | 246 | } else { |
246 | 247 | // No agreement, we can't be invoiceable |
@@ -275,7 +276,8 @@ discard block |
||
275 | 276 | try { |
276 | 277 | $agreement = new org_openpsa_sales_salesproject_deliverable_dba($this->agreement); |
277 | 278 | $agreement->update_units($this->id, $hours); |
278 | - } catch (midcom_error $e) { |
|
279 | + } |
|
280 | + catch (midcom_error $e) { |
|
279 | 281 | } |
280 | 282 | |
281 | 283 | if ($update) { |
@@ -302,7 +304,8 @@ discard block |
||
302 | 304 | try { |
303 | 305 | $agreement = new org_openpsa_sales_salesproject_deliverable_dba($this->agreement); |
304 | 306 | $invoice_approved_only = $agreement->invoiceApprovedOnly; |
305 | - } catch (midcom_error $e) { |
|
307 | + } |
|
308 | + catch (midcom_error $e) { |
|
306 | 309 | $invoice_approved_only = false; |
307 | 310 | } |
308 | 311 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $qb_hr = org_openpsa_projects_hour_report_dba::new_query_builder(); |
45 | 45 | $qb_hr->add_constraint('date', '<=', (int) $this->_request_data['query_data']['end']); |
46 | 46 | $qb_hr->add_constraint('date', '>=', (int) $this->_request_data['query_data']['start']); |
47 | - if ( array_key_exists('invoiceable_filter', $this->_request_data['query_data']) |
|
47 | + if (array_key_exists('invoiceable_filter', $this->_request_data['query_data']) |
|
48 | 48 | && $this->_request_data['query_data']['invoiceable_filter'] != -1) { |
49 | 49 | $qb_hr->add_constraint('invoiceable', '=', (bool) $this->_request_data['query_data']['invoiceable_filter']); |
50 | 50 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $tasks = $this->_expand_task($this->_request_data['query_data']['task']); |
61 | 61 | $qb_hr->add_constraint('task', 'IN', $tasks); |
62 | 62 | } |
63 | - if ( array_key_exists('hour_type_filter', $this->_request_data['query_data']) |
|
63 | + if (array_key_exists('hour_type_filter', $this->_request_data['query_data']) |
|
64 | 64 | && $this->_request_data['query_data']['hour_type_filter'] != 'builtin:all') { |
65 | 65 | $qb_hr->add_constraint('reportType', '=', $this->_request_data['query_data']['hour_type_filter']); |
66 | 66 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | private function add_to_group($new_row, $matching, $sort, $title) |
153 | 153 | { |
154 | - $rows =& $this->_request_data['report']['rows']; |
|
154 | + $rows = & $this->_request_data['report']['rows']; |
|
155 | 155 | if (array_key_exists($matching, $rows)) { |
156 | 156 | $rows[$matching]['rows'][] = $new_row; |
157 | 157 | $rows[$matching]['total_hours'] += $new_row['hour']->hours; |
@@ -123,7 +123,8 @@ |
||
123 | 123 | $row = array(); |
124 | 124 | try { |
125 | 125 | $row['person'] = org_openpsa_contacts_person_dba::get_cached($hour->person); |
126 | - } catch (midcom_error $e) { |
|
126 | + } |
|
127 | + catch (midcom_error $e) { |
|
127 | 128 | $e->log(); |
128 | 129 | continue; |
129 | 130 | } |