@@ -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)) { |
@@ -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 |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | $variable = $parts[0] . '->' . $parts[1]; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - if ( isset($variable_parts[1]) |
|
| 87 | + if (isset($variable_parts[1]) |
|
| 88 | 88 | && array_key_exists($variable_parts[1], self::$_filters)) { |
| 89 | 89 | switch ($variable_parts[1]) { |
| 90 | 90 | case 's': |