@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | public function _on_creating() : bool |
| 27 | 27 | { |
| 28 | - if ( !$this->referrer |
|
| 28 | + if (!$this->referrer |
|
| 29 | 29 | && !empty($_SERVER['HTTP_REFERER'])) { |
| 30 | 30 | $this->referrer = $_SERVER['HTTP_REFERER']; |
| 31 | 31 | } |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | $profit = $value - $cost; |
| 122 | - if ( $this->value != $value |
|
| 122 | + if ($this->value != $value |
|
| 123 | 123 | || $this->profit != $profit) { |
| 124 | 124 | $this->value = $value; |
| 125 | 125 | $this->profit = $value - $cost; |
@@ -184,12 +184,12 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | public function _on_updating() : bool |
| 186 | 186 | { |
| 187 | - if ( $this->state != self::STATE_ACTIVE |
|
| 187 | + if ($this->state != self::STATE_ACTIVE |
|
| 188 | 188 | && !$this->end) { |
| 189 | 189 | //Not active anymore and end not set, set it to now |
| 190 | 190 | $this->end = time(); |
| 191 | 191 | } |
| 192 | - if ( $this->end |
|
| 192 | + if ($this->end |
|
| 193 | 193 | && $this->state == self::STATE_ACTIVE) { |
| 194 | 194 | //Returned to active state, clear the end marker. |
| 195 | 195 | $this->end = 0; |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | public function _on_creating() : bool |
| 27 | 27 | { |
| 28 | - if ( $this->invoice |
|
| 28 | + if ($this->invoice |
|
| 29 | 29 | && $this->position == 0) { |
| 30 | 30 | $invoice = org_openpsa_invoices_invoice_dba::get_cached($this->invoice); |
| 31 | 31 | $this->position = count($invoice->get_invoice_items()) + 1; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | } catch (midcom_error $e) { |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | - if ( $url == '' |
|
| 78 | + if ($url == '' |
|
| 79 | 79 | && $sales_url) { |
| 80 | 80 | try { |
| 81 | 81 | $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($this->deliverable); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $invoice = new org_openpsa_invoices_invoice_dba($this->invoice); |
| 98 | 98 | $old_sum = $invoice->sum; |
| 99 | 99 | self::update_invoice($invoice); |
| 100 | - if ( $old_sum != $invoice->sum |
|
| 100 | + if ($old_sum != $invoice->sum |
|
| 101 | 101 | && !empty($this->deliverable)) { |
| 102 | 102 | $deliverable = new org_openpsa_sales_salesproject_deliverable_dba($this->deliverable); |
| 103 | 103 | self::update_deliverable($deliverable); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | if ($invoiced != $deliverable->invoiced) { |
| 137 | 137 | $deliverable->invoiced = $invoiced; |
| 138 | - if ( $deliverable->orgOpenpsaObtype !== org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
| 138 | + if ($deliverable->orgOpenpsaObtype !== org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
| 139 | 139 | && $deliverable->state < org_openpsa_sales_salesproject_deliverable_dba::STATE_INVOICED) { |
| 140 | 140 | $deliverable->state = org_openpsa_sales_salesproject_deliverable_dba::STATE_INVOICED; |
| 141 | 141 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | public function _on_creating() : bool |
| 42 | 42 | { |
| 43 | - return ( $this->validate_tag($this->tag) |
|
| 43 | + return ($this->validate_tag($this->tag) |
|
| 44 | 44 | && $this->_check_duplicates() == 0); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | public function _on_updating() : bool |
| 71 | 71 | { |
| 72 | - return ( $this->validate_tag($this->tag) |
|
| 72 | + return ($this->validate_tag($this->tag) |
|
| 73 | 73 | && $this->_check_duplicates() == 0); |
| 74 | 74 | } |
| 75 | 75 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function _on_creating() : bool |
| 30 | 30 | { |
| 31 | - if ( $this->title == '' |
|
| 31 | + if ($this->title == '' |
|
| 32 | 32 | || !$this->topic) { |
| 33 | 33 | // We must have wikiword and topic at this stage |
| 34 | 34 | return false; |