@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -midcom::get()->head->add_stylesheet( MIDCOM_STATIC_URL . '/midcom.services.auth/style.css'); |
|
| 2 | +midcom::get()->head->add_stylesheet(MIDCOM_STATIC_URL . '/midcom.services.auth/style.css'); |
|
| 3 | 3 | $title = 'About Midgard'; |
| 4 | 4 | midcom::get()->auth->require_valid_user(); |
| 5 | 5 | ?> |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | private function send($httpcode, $message) |
| 250 | 250 | { |
| 251 | 251 | $error_actions = midcom::get()->config->get('error_actions'); |
| 252 | - if ( !isset($error_actions[$httpcode]) |
|
| 252 | + if (!isset($error_actions[$httpcode]) |
|
| 253 | 253 | || !isset($error_actions[$httpcode]['action'])) { |
| 254 | 254 | // No action specified for this error code, skip |
| 255 | 255 | return; |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | return; |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | - if ( !is_writable($config['filename']) |
|
| 282 | + if (!is_writable($config['filename']) |
|
| 283 | 283 | && !is_writable(dirname($config['filename']))) { |
| 284 | 284 | debug_add("Error logging file {$config['filename']} is not writable", MIDCOM_LOG_WARN); |
| 285 | 285 | return; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public static function create($from_obj, $from_component, $to_obj, $to_component, $status = false, $extra = false) |
| 33 | 33 | { |
| 34 | - if ( !is_object($from_obj) |
|
| 34 | + if (!is_object($from_obj) |
|
| 35 | 35 | || !is_object($to_obj)) { |
| 36 | 36 | return false; |
| 37 | 37 | } |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | debug_print_r("processing button '{$mode}' with data:", $data); |
| 259 | 259 | if ($data === false) { |
| 260 | 260 | //In case somebody didn't unset() a button from the defaults, just marked it as false |
| 261 | - debug_add('data marked as false, skipping (the correct way is to unset() the key)', MIDCOM_LOG_WARN); |
|
| 261 | + debug_add('data marked as false, skipping (the correct way is to unset() the key)', MIDCOM_LOG_WARN); |
|
| 262 | 262 | continue; |
| 263 | 263 | } |
| 264 | 264 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | // TODO: Warehouse management: create new order |
| 86 | - if ( $this->_deliverable->end < $next_cycle_start |
|
| 86 | + if ($this->_deliverable->end < $next_cycle_start |
|
| 87 | 87 | && $this->_deliverable->end != 0) { |
| 88 | 88 | debug_add('Do not register next cycle, the contract ends before'); |
| 89 | 89 | return $this->_deliverable->end_subscription(); |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | if ($this->_deliverable->unit != 'd') { |
| 307 | 307 | //If previous cycle was run at the end of the month, the new one should be at the end of the month as well |
| 308 | 308 | $date = new DateTime(gmdate('Y-m-d', $time), new DateTimeZone('GMT')); |
| 309 | - if ( $date->format('t') == $date->format('j') |
|
| 309 | + if ($date->format('t') == $date->format('j') |
|
| 310 | 310 | && $new_date->format('t') != $new_date->format('j')) { |
| 311 | 311 | $new_date->setDate((int) $new_date->format('Y'), (int) $new_date->format('m'), (int) $new_date->format('t')); |
| 312 | 312 | } |
@@ -372,11 +372,11 @@ discard block |
||
| 372 | 372 | break; |
| 373 | 373 | case 'q': |
| 374 | 374 | // Quarterly recurring subscription |
| 375 | - $identifier = ceil(((int)$date->format('n')) / 4) . 'Q' . $date->format('y'); |
|
| 375 | + $identifier = ceil(((int) $date->format('n')) / 4) . 'Q' . $date->format('y'); |
|
| 376 | 376 | break; |
| 377 | 377 | case 'hy': |
| 378 | 378 | // Half-yearly recurring subscription |
| 379 | - $identifier = ceil(((int)$date->format('n')) / 6) . '/' . $date->format('Y'); |
|
| 379 | + $identifier = ceil(((int) $date->format('n')) / 6) . '/' . $date->format('Y'); |
|
| 380 | 380 | break; |
| 381 | 381 | case 'y': |
| 382 | 382 | // Yearly recurring subscription |
@@ -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 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - if ( !$person |
|
| 131 | + if (!$person |
|
| 132 | 132 | && !empty($subscriber['person']['handphone'])) { |
| 133 | 133 | // Perform a simple cell phone test. More complicated duplicate checking is best left to the o.o.contacts duplicate checker |
| 134 | 134 | $qb = org_openpsa_contacts_person_dba::new_query_builder(); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | // User is or has been subscriber earlier, update status |
| 175 | 175 | $member = $members[0]; |
| 176 | 176 | |
| 177 | - if ( $member->orgOpenpsaObtype == org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED |
|
| 177 | + if ($member->orgOpenpsaObtype == org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED |
|
| 178 | 178 | || $member->orgOpenpsaObtype == org_openpsa_directmarketing_campaign_member_dba::NORMAL) { |
| 179 | 179 | $this->_import_status['already_subscribed']++; |
| 180 | 180 | return; |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | $qb = org_openpsa_contacts_group_dba::new_query_builder(); |
| 216 | 216 | |
| 217 | - if ( array_key_exists('company_id', $this->_schemadbs['organization']['default']->fields) |
|
| 217 | + if (array_key_exists('company_id', $this->_schemadbs['organization']['default']->fields) |
|
| 218 | 218 | && !empty($subscriber['organization']['company_id'])) { |
| 219 | 219 | // Imported data has a company id, we use that instead of name |
| 220 | 220 | $qb->add_constraint($this->_schemadbs['organization']['default']->fields['company_id']['storage']['location'], '=', $subscriber['organization']['company_id']); |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | // Seek by official name |
| 223 | 223 | $qb->add_constraint('official', '=', $subscriber['organization']['official']); |
| 224 | 224 | |
| 225 | - if ( array_key_exists('city', $this->_schemadbs['organization']['default']->fields) |
|
| 225 | + if (array_key_exists('city', $this->_schemadbs['organization']['default']->fields) |
|
| 226 | 226 | && !empty($subscriber['organization']['city'])) { |
| 227 | 227 | // Imported data has a city, we use also that for matching |
| 228 | 228 | $qb->add_constraint($this->_schemadbs['organization']['default']->fields['city']['storage']['location'], '=', $subscriber['organization']['city']); |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | $date_identifier = date('Y-m-d', $row['date']); |
| 128 | - $row_identifier = $task->id . '-' . $row['person']; |
|
| 128 | + $row_identifier = $task->id . '-' . $row['person']; |
|
| 129 | 129 | |
| 130 | 130 | if (!isset($reports[$row_identifier])) { |
| 131 | 131 | try { |
@@ -191,7 +191,7 @@ |
||
| 191 | 191 | $this->html_body = preg_replace("/\n\r|\r\n|\r/", "\n", $this->html_body); |
| 192 | 192 | |
| 193 | 193 | //Try to translate HTML-only body to plaintext as well |
| 194 | - if ( strlen($this->body) == 0 |
|
| 194 | + if (strlen($this->body) == 0 |
|
| 195 | 195 | && strlen($this->html_body) > 0 |
| 196 | 196 | && !$this->allow_only_html) { |
| 197 | 197 | $this->body = $this->html2text($this->html_body); |
@@ -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); |