@@ -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'), |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function merge($obj1, $obj2, $merge_mode) |
47 | 47 | { |
48 | - if ( $merge_mode !== 'all' |
|
48 | + if ($merge_mode !== 'all' |
|
49 | 49 | && $merge_mode !== 'future') { |
50 | 50 | debug_add("invalid mode {$merge_mode}", MIDCOM_LOG_ERROR); |
51 | 51 | throw new midcom_error('invalid merge mode'); |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | if (!empty($conf['duplicate_check'])) { |
88 | 88 | $dup = $this->check_duplicate($results, $result, $conf['duplicate_check']); |
89 | 89 | |
90 | - if ( is_object($dup) |
|
90 | + if (is_object($dup) |
|
91 | 91 | || $dup === false) { |
92 | - if ( !is_object($dup) |
|
92 | + if (!is_object($dup) |
|
93 | 93 | || !array_key_exists($dup->id, $todelete)) { |
94 | 94 | $todelete[$result->id] = $result; |
95 | 95 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | } |
100 | 100 | } |
101 | - if ( $needs_update |
|
101 | + if ($needs_update |
|
102 | 102 | && !$result->update()) { |
103 | 103 | throw new midcom_error("Failed to update {$classname} #{$result->id}, errstr: " . midcom_connection::get_error_string()); |
104 | 104 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | foreach ($results as $result) { |
150 | - if ( $result->$field === $object->$field |
|
150 | + if ($result->$field === $object->$field |
|
151 | 151 | && $result->id !== $object->id) { |
152 | 152 | return $result; |
153 | 153 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $changed = false; |
166 | 166 | foreach ($person2 as $property => $value) { |
167 | 167 | // Copy only simple properties not marked to be skipped missing from person1 |
168 | - if ( empty($person2->$property) |
|
168 | + if (empty($person2->$property) |
|
169 | 169 | || !empty($person1->$property) |
170 | 170 | || isset($skip_properties[$property]) |
171 | 171 | || !is_scalar($value)) { |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | public function __set($name, $value) |
33 | 33 | { |
34 | - if ( $name == 'homepage' |
|
34 | + if ($name == 'homepage' |
|
35 | 35 | && !empty($value) |
36 | 36 | && $value != $this->homepage) { |
37 | 37 | $this->_register_prober = true; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | public function __get($property) |
79 | 79 | { |
80 | - if ( $property == 'invoice_label' |
|
80 | + if ($property == 'invoice_label' |
|
81 | 81 | || $property == 'postal_label') { |
82 | 82 | if (!isset($this->_address_extras[$property])) { |
83 | 83 | $this->_get_address_extra($property); |
@@ -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(); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $this->calculate_price(false); |
56 | 56 | |
57 | - if ( $this->orgOpenpsaObtype == org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
57 | + if ($this->orgOpenpsaObtype == org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
58 | 58 | && $this->continuous == true) { |
59 | 59 | $this->end = 0; |
60 | 60 | } elseif ($this->end < $this->start) { |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $calculator->run($this); |
141 | 141 | $cost = $calculator->get_cost(); |
142 | 142 | $price = $calculator->get_price(); |
143 | - if ( $price != $this->price |
|
143 | + if ($price != $this->price |
|
144 | 144 | || $cost != $this->cost) { |
145 | 145 | $this->price = $price; |
146 | 146 | $this->cost = $cost; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $units = $agreement_hours['invoiceable']; |
188 | 188 | $uninvoiceableUnits = $agreement_hours['reported'] - ($agreement_hours['invoiceable'] + $agreement_hours['invoiced']); |
189 | 189 | |
190 | - if ( $units != $this->units |
|
190 | + if ($units != $this->units |
|
191 | 191 | || $uninvoiceableUnits != $this->uninvoiceableUnits) { |
192 | 192 | debug_add("agreement values have changed, setting units to " . $units . ", uninvoiceable: " . $uninvoiceableUnits); |
193 | 193 | $this->units = $units; |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | |
243 | 243 | public function invoice() |
244 | 244 | { |
245 | - if ( $this->state >= self::STATE_INVOICED |
|
245 | + if ($this->state >= self::STATE_INVOICED |
|
246 | 246 | || $this->orgOpenpsaObtype == org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION) { |
247 | 247 | return false; |
248 | 248 | } |
@@ -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; |