@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | midcom::get()->auth->require_admin_user(); |
| 3 | 3 | |
| 4 | -if ( empty($_POST['to']) |
|
| 4 | +if (empty($_POST['to']) |
|
| 5 | 5 | || empty($_POST['from'])) { |
| 6 | 6 | ?> |
| 7 | 7 | <h2>Send test email</h2> |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | foreach ($this->_parameters as $key => $value) { |
| 112 | 112 | $this->_patterns[] = "/__({$key})__/"; |
| 113 | 113 | |
| 114 | - if ( is_array($value) |
|
| 114 | + if (is_array($value) |
|
| 115 | 115 | || is_object($value)) { |
| 116 | 116 | $this->_patterns[] = "/__({$key})_([^ \.>\"-]*?)__/"; |
| 117 | 117 | } |
@@ -57,7 +57,8 @@ discard block |
||
| 57 | 57 | try { |
| 58 | 58 | $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($at_entry->arguments['deliverable']); |
| 59 | 59 | $salesproject = org_openpsa_sales_salesproject_dba::get_cached($deliverable->salesproject); |
| 60 | - } catch (midcom_error $e) { |
|
| 60 | + } |
|
| 61 | + catch (midcom_error $e) { |
|
| 61 | 62 | $e->log(); |
| 62 | 63 | return $invoice; |
| 63 | 64 | } |
@@ -95,7 +96,8 @@ discard block |
||
| 95 | 96 | $object = $classname::get_cached($id); |
| 96 | 97 | $invoice[$fieldname] = $object->render_link(); |
| 97 | 98 | $invoice['index_' . $fieldname] = $object->get_label(); |
| 98 | - } catch (midcom_error $e) { |
|
| 99 | + } |
|
| 100 | + catch (midcom_error $e) { |
|
| 99 | 101 | $e->log(); |
| 100 | 102 | } |
| 101 | 103 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | return $this->fail($this->_l10n->get('no invoice number was handed over')); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - $invoicenumber = (int) $_GET['query'] ; |
|
| 27 | + $invoicenumber = (int) $_GET['query']; |
|
| 28 | 28 | |
| 29 | 29 | if ($invoice = org_openpsa_invoices_invoice_dba::get_by_number($invoicenumber)) { |
| 30 | 30 | return new midcom_response_relocate('invoice/' . $invoice->guid . '/'); |
@@ -51,7 +51,8 @@ |
||
| 51 | 51 | } |
| 52 | 52 | try { |
| 53 | 53 | $this->_request_data['product'] = org_openpsa_products_product_dba::get_cached($this->_deliverable->product); |
| 54 | - } catch (midcom_error $e) { |
|
| 54 | + } |
|
| 55 | + catch (midcom_error $e) { |
|
| 55 | 56 | $this->_request_data['product'] = false; |
| 56 | 57 | } |
| 57 | 58 | } |
@@ -113,7 +113,8 @@ |
||
| 113 | 113 | try { |
| 114 | 114 | $this->_request_data['customer'] = new org_openpsa_contacts_group_dba($guid); |
| 115 | 115 | $qb->add_constraint('customer', '=', $this->_request_data['customer']->id); |
| 116 | - } catch (midcom_error $e) { |
|
| 116 | + } |
|
| 117 | + catch (midcom_error $e) { |
|
| 117 | 118 | $this->_request_data['customer'] = new org_openpsa_contacts_person_dba($guid); |
| 118 | 119 | $qb->add_constraint('customerContact', '=', $this->_request_data['customer']->id); |
| 119 | 120 | } |
@@ -216,7 +216,8 @@ |
||
| 216 | 216 | foreach ($this->_request_data[$identifier] as $member) { |
| 217 | 217 | try { |
| 218 | 218 | $this->_request_data['group'] = org_openpsa_contacts_group_dba::get_cached($member->gid); |
| 219 | - } catch (midcom_error $e) { |
|
| 219 | + } |
|
| 220 | + catch (midcom_error $e) { |
|
| 220 | 221 | $e->log(); |
| 221 | 222 | continue; |
| 222 | 223 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $invoices_url = $siteconfig->get_node_full_url('org.openpsa.invoices'); |
| 108 | 108 | $user_url = $siteconfig->get_node_full_url('org.openpsa.user'); |
| 109 | 109 | |
| 110 | - if ( $invoices_url |
|
| 110 | + if ($invoices_url |
|
| 111 | 111 | && midcom::get()->auth->can_user_do('midgard:create', null, org_openpsa_invoices_invoice_dba::class) |
| 112 | 112 | && $this->_contact->can_do('midgard:update')) { |
| 113 | 113 | $buttons[] = $workflow->get_button($invoices_url . "billingdata/" . $this->_contact->guid . '/', [ |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | ]); |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - if ( $user_url |
|
| 119 | - && ( midcom_connection::get_user() == $this->_contact->id |
|
| 118 | + if ($user_url |
|
| 119 | + && (midcom_connection::get_user() == $this->_contact->id |
|
| 120 | 120 | || midcom::get()->auth->can_user_do('org.openpsa.user:access', null, org_openpsa_user_interface::class))) { |
| 121 | 121 | $buttons[] = [ |
| 122 | 122 | MIDCOM_TOOLBAR_URL => $user_url . "view/{$this->_contact->guid}/", |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | */ |
| 195 | 195 | public function _show_group_memberships($handler_id, array &$data) |
| 196 | 196 | { |
| 197 | - if ( count($data['organizations']) == 0 |
|
| 197 | + if (count($data['organizations']) == 0 |
|
| 198 | 198 | && count($data['groups']) == 0) { |
| 199 | 199 | midcom_show_style('show-person-groups-empty'); |
| 200 | 200 | } else { |
@@ -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 | } |
@@ -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 = []; |
| 328 | - $params['objects'] =& $persons; |
|
| 328 | + $params['objects'] = & $persons; |
|
| 329 | 329 | $params['mode'] = 'person'; |
| 330 | 330 | |
| 331 | 331 | array_walk($persons, [$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 = []; |
| 418 | - $params['objects'] =& $groups; |
|
| 418 | + $params['objects'] = & $groups; |
|
| 419 | 419 | $params['mode'] = 'group'; |
| 420 | 420 | array_walk($groups, [$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 | } |
@@ -114,7 +114,8 @@ |
||
| 114 | 114 | && $deliverable->end > $this->_request_data['start'])) { |
| 115 | 115 | $invoices = array_merge($invoices, $this->_get_invoices_for_subscription($deliverable, $at_entry)); |
| 116 | 116 | } |
| 117 | - } catch (midcom_error $e) { |
|
| 117 | + } |
|
| 118 | + catch (midcom_error $e) { |
|
| 118 | 119 | } |
| 119 | 120 | } |
| 120 | 121 | $invoices = array_merge($invoices, $this->_get_deliverable_invoices()); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | private function _get_invoices_for_subscription($deliverable, $at_entry) |
| 50 | 50 | { |
| 51 | - if ( $deliverable->invoiceByActualUnits |
|
| 51 | + if ($deliverable->invoiceByActualUnits |
|
| 52 | 52 | && $at_entry->arguments['cycle'] > 1) { |
| 53 | 53 | $invoice_sum = $deliverable->invoiced / ($at_entry->arguments['cycle'] - 1); |
| 54 | 54 | if ($invoice_sum == 0) { |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | $time = $at_entry->start; |
| 65 | 65 | $scheduler = new org_openpsa_invoices_scheduler($deliverable); |
| 66 | 66 | |
| 67 | - while ( $time < $this->_request_data['end'] |
|
| 68 | - && ( $time < $deliverable->end |
|
| 67 | + while ($time < $this->_request_data['end'] |
|
| 68 | + && ($time < $deliverable->end |
|
| 69 | 69 | || $deliverable->continuous)) { |
| 70 | 70 | $invoices[] = $this->get_invoice_for_deliverable($deliverable, $invoice_sum, $time, $calculation_base); |
| 71 | 71 | |
@@ -107,8 +107,8 @@ discard block |
||
| 107 | 107 | foreach ($qb->execute() as $at_entry) { |
| 108 | 108 | try { |
| 109 | 109 | $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($at_entry->arguments['deliverable']); |
| 110 | - if ( $deliverable->continuous |
|
| 111 | - || ( $deliverable->start < $this->_request_data['end'] |
|
| 110 | + if ($deliverable->continuous |
|
| 111 | + || ($deliverable->start < $this->_request_data['end'] |
|
| 112 | 112 | && $deliverable->end > $this->_request_data['start'])) { |
| 113 | 113 | $invoices = array_merge($invoices, $this->_get_invoices_for_subscription($deliverable, $at_entry)); |
| 114 | 114 | } |