@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | public function _on_creating() |
20 | 20 | { |
21 | - if ( $this->invoice |
|
21 | + if ($this->invoice |
|
22 | 22 | && $this->position == 0) { |
23 | 23 | $invoice = org_openpsa_invoices_invoice_dba::get_cached($this->invoice); |
24 | 24 | $this->position = count($invoice->get_invoice_items()) + 1; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } catch (midcom_error $e) { |
70 | 70 | } |
71 | 71 | } |
72 | - if ( $url == '' |
|
72 | + if ($url == '' |
|
73 | 73 | && $sales_url) { |
74 | 74 | try { |
75 | 75 | $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($this->deliverable); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $invoice = new org_openpsa_invoices_invoice_dba($this->invoice); |
92 | 92 | $old_sum = $invoice->sum; |
93 | 93 | self::update_invoice($invoice); |
94 | - if ( $old_sum != $invoice->sum |
|
94 | + if ($old_sum != $invoice->sum |
|
95 | 95 | && !empty($this->deliverable)) { |
96 | 96 | $deliverable = new org_openpsa_sales_salesproject_deliverable_dba($this->deliverable); |
97 | 97 | self::update_deliverable($deliverable); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | if ($invoiced != $deliverable->invoiced) { |
133 | 133 | $deliverable->invoiced = $invoiced; |
134 | - if ( $deliverable->orgOpenpsaObtype !== org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
134 | + if ($deliverable->orgOpenpsaObtype !== org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
135 | 135 | && $deliverable->state < org_openpsa_sales_salesproject_deliverable_dba::STATE_INVOICED) { |
136 | 136 | $deliverable->state = org_openpsa_sales_salesproject_deliverable_dba::STATE_INVOICED; |
137 | 137 | } |
@@ -102,7 +102,7 @@ |
||
102 | 102 | if (is_string($value)) { |
103 | 103 | $this->_headers[$header] = trim($value); |
104 | 104 | } |
105 | - if ( strtolower($header) == 'from' |
|
105 | + if (strtolower($header) == 'from' |
|
106 | 106 | || strtolower($header) == 'reply-to' |
107 | 107 | || strtolower($header) == 'to') { |
108 | 108 | $this->_headers[$header] = $this->_encode_address_field($value); |
@@ -77,9 +77,9 @@ |
||
77 | 77 | $filter_id = $this->_identifier . '_' . $filtername; |
78 | 78 | $user = midcom::get()->auth->user->get_storage(); |
79 | 79 | |
80 | - if ( isset($_POST['unset_filter']) |
|
80 | + if (isset($_POST['unset_filter']) |
|
81 | 81 | && $_POST['unset_filter'] == $filter_id) { |
82 | - if ( $user->get_parameter("org_openpsa_core_filter", $filter_id) |
|
82 | + if ($user->get_parameter("org_openpsa_core_filter", $filter_id) |
|
83 | 83 | && !$user->delete_parameter("org_openpsa_core_filter", $filter_id)) { |
84 | 84 | $message_content = sprintf( |
85 | 85 | $l10n->get('the handed filter for %s could not be set as parameter'), |
@@ -63,7 +63,7 @@ |
||
63 | 63 | public function _on_created() |
64 | 64 | { |
65 | 65 | //Remove the resource if necessary |
66 | - if ( $this->type == self::DECLINED |
|
66 | + if ($this->type == self::DECLINED |
|
67 | 67 | && $this->targetPerson) { |
68 | 68 | $qb = org_openpsa_projects_task_resource_dba::new_query_builder(); |
69 | 69 | $qb->add_constraint('task', '=', $this->task); |
@@ -68,7 +68,7 @@ |
||
68 | 68 | $status_changer_label = $this->l10n->get('system'); |
69 | 69 | $target_person_label = $this->l10n->get('system'); |
70 | 70 | |
71 | - if ( $status_change->metadata->creator |
|
71 | + if ($status_change->metadata->creator |
|
72 | 72 | && $status_change->metadata->creator != $fallback_creator->guid) { |
73 | 73 | $status_changer = org_openpsa_widgets_contact::get($status_change->metadata->creator); |
74 | 74 | $status_changer_label = $status_changer->show_inline(); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | } |
92 | 92 | $profit = $value - $cost; |
93 | - if ( $this->value != $value |
|
93 | + if ($this->value != $value |
|
94 | 94 | || $this->profit != $profit) { |
95 | 95 | $this->value = $value; |
96 | 96 | $this->profit = $value - $cost; |
@@ -220,12 +220,12 @@ discard block |
||
220 | 220 | |
221 | 221 | public function _on_updating() |
222 | 222 | { |
223 | - if ( $this->state != self::STATE_ACTIVE |
|
223 | + if ($this->state != self::STATE_ACTIVE |
|
224 | 224 | && !$this->end) { |
225 | 225 | //Not active anymore and end not set, set it to now |
226 | 226 | $this->end = time(); |
227 | 227 | } |
228 | - if ( $this->end |
|
228 | + if ($this->end |
|
229 | 229 | && $this->state == self::STATE_ACTIVE) { |
230 | 230 | //Returned to active state, clear the end marker. |
231 | 231 | $this->end = 0; |
@@ -37,7 +37,7 @@ |
||
37 | 37 | { |
38 | 38 | return preg_replace_callback( |
39 | 39 | "%(<\s*)+(/\s*)+{$element}%i", |
40 | - function ($matches) { |
|
40 | + function($matches) { |
|
41 | 41 | return htmlentities($matches[0]); |
42 | 42 | }, |
43 | 43 | $input |
@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | $http_client = new org_openpsa_httplib(); |
57 | 57 | $http_client->set_param('timeout', 300); |
58 | -if ( !empty($_SERVER['PHP_AUTH_USER']) |
|
58 | +if (!empty($_SERVER['PHP_AUTH_USER']) |
|
59 | 59 | && !empty($_SERVER['PHP_AUTH_PW'])) { |
60 | 60 | $http_client->basicauth['user'] = $_SERVER['PHP_AUTH_USER']; |
61 | 61 | $http_client->basicauth['password'] = $_SERVER['PHP_AUTH_PW']; |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | { |
464 | 464 | // Complete fields |
465 | 465 | $this->indexed = time(); |
466 | - if ( $this->author == '' |
|
466 | + if ($this->author == '' |
|
467 | 467 | && isset($this->creator->name)) { |
468 | 468 | $this->author = $this->creator->name; |
469 | 469 | } |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | public function read_metadata_from_object($object) |
607 | 607 | { |
608 | 608 | // Published is set to non-empty value, use it as creation data |
609 | - if ( !empty($object->metadata->published) |
|
609 | + if (!empty($object->metadata->published) |
|
610 | 610 | && !preg_match('/0{1,4}-0{1,2}0{1,2}\s+0{1,2}:0{1,2}:0{1,2}/', $object->metadata->published)) { |
611 | 611 | $this->created = $this->read_unixtime($object->metadata->published); |
612 | 612 | } elseif (isset($object->metadata->created)) { |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | return @strtotime($stamp); |
646 | 646 | } |
647 | 647 | // Unix timestamp |
648 | - return (int)$stamp; |
|
648 | + return (int) $stamp; |
|
649 | 649 | } |
650 | 650 | |
651 | 651 | /** |