@@ -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; |
@@ -120,14 +120,16 @@ |
||
120 | 120 | if (!empty($this->customer)) { |
121 | 121 | try { |
122 | 122 | return org_openpsa_contacts_group_dba::get_cached($this->customer); |
123 | - } catch (midcom_error $e) { |
|
123 | + } |
|
124 | + catch (midcom_error $e) { |
|
124 | 125 | $e->log(); |
125 | 126 | } |
126 | 127 | } |
127 | 128 | if (!empty($this->customerContact)) { |
128 | 129 | try { |
129 | 130 | return org_openpsa_contacts_person_dba::get_cached($this->customerContact); |
130 | - } catch (midcom_error $e) { |
|
131 | + } |
|
132 | + catch (midcom_error $e) { |
|
131 | 133 | $e->log(); |
132 | 134 | } |
133 | 135 | } |
@@ -23,7 +23,8 @@ discard block |
||
23 | 23 | try { |
24 | 24 | $person = new midcom_db_person($this->uid); |
25 | 25 | $grp = new midcom_db_group($this->gid); |
26 | - } catch (midcom_error $e) { |
|
26 | + } |
|
27 | + catch (midcom_error $e) { |
|
27 | 28 | $e->log(); |
28 | 29 | return 'Invalid membership record'; |
29 | 30 | } |
@@ -40,7 +41,8 @@ discard block |
||
40 | 41 | } |
41 | 42 | try { |
42 | 43 | $person = new midcom_db_person($this->uid); |
43 | - } catch (midcom_error $e) { |
|
44 | + } |
|
45 | + catch (midcom_error $e) { |
|
44 | 46 | return; |
45 | 47 | } |
46 | 48 | midcom::get()->cache->invalidate($person->guid); |
@@ -78,7 +78,7 @@ |
||
78 | 78 | { |
79 | 79 | parent::__set($property, $value); |
80 | 80 | |
81 | - if ( $property == 'firstname' |
|
81 | + if ($property == 'firstname' |
|
82 | 82 | || $property == 'lastname' |
83 | 83 | || $property == 'homepage' |
84 | 84 | || $property == 'email') { |
@@ -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 |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | if ($uplink == $root_id) { |
223 | 223 | return true; |
224 | 224 | } |
225 | - if ( $uplink == false |
|
225 | + if ($uplink == false |
|
226 | 226 | || $uplink == -1) { |
227 | 227 | return false; |
228 | 228 | } |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | $entry = "<span class=\"{$current_class}\">{$entry}</span>"; |
447 | 447 | } |
448 | 448 | } else { |
449 | - if ( !empty($data['napobject'][MIDCOM_NAV_GUID]) |
|
449 | + if (!empty($data['napobject'][MIDCOM_NAV_GUID]) |
|
450 | 450 | && in_array($data['napobject'][MIDCOM_NAV_GUID], $skip_guids)) { |
451 | 451 | continue; |
452 | 452 | } |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | $id = "custom-{$key}"; |
570 | 570 | |
571 | 571 | $url = "{$prefix}{$entry[MIDCOM_NAV_URL]}"; |
572 | - if ( substr($entry[MIDCOM_NAV_URL], 0, 1) == '/' |
|
572 | + if (substr($entry[MIDCOM_NAV_URL], 0, 1) == '/' |
|
573 | 573 | || preg_match('|^https?://|', $entry[MIDCOM_NAV_URL])) { |
574 | 574 | $url = $entry[MIDCOM_NAV_URL]; |
575 | 575 | } |
@@ -296,7 +296,8 @@ |
||
296 | 296 | // the tree. This is, for example, used by the on-delete cache invalidation. |
297 | 297 | try { |
298 | 298 | $object = midcom::get()->dbfactory->get_object_by_guid($guid); |
299 | - } catch (midcom_error $e) { |
|
299 | + } |
|
300 | + catch (midcom_error $e) { |
|
300 | 301 | debug_add("Could not load GUID {$guid}, trying to continue anyway. Last error was: " . $e->getMessage(), MIDCOM_LOG_WARN); |
301 | 302 | } |
302 | 303 | if (!empty($object)) { |
@@ -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': |
@@ -88,7 +88,8 @@ |
||
88 | 88 | $style = midcom_db_style::get_cached($style_id); |
89 | 89 | $styleeditor_url = midcom_connection::get_url('self') . "__mfa/asgard/object/view/{$style->guid}/"; |
90 | 90 | $enabled = true; |
91 | - } catch (midcom_error $e) { |
|
91 | + } |
|
92 | + catch (midcom_error $e) { |
|
92 | 93 | $e->log(); |
93 | 94 | } |
94 | 95 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | } |
38 | 38 | $buttons = []; |
39 | 39 | $workflow = new midcom\workflow\datamanager; |
40 | - if ( $this->topic->can_do('midgard:update') |
|
40 | + if ($this->topic->can_do('midgard:update') |
|
41 | 41 | && $this->topic->can_do('midcom.admin.folder:topic_management')) { |
42 | 42 | $buttons[] = $workflow->get_button("__ais/folder/edit/", [ |
43 | 43 | MIDCOM_TOOLBAR_LABEL => midcom::get()->i18n->get_string('edit folder', 'midcom.admin.folder'), |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | ]); |
50 | 50 | } |
51 | 51 | |
52 | - if ( $urltopic->can_do('midgard:update') |
|
52 | + if ($urltopic->can_do('midgard:update') |
|
53 | 53 | && $urltopic->can_do('midcom.admin.folder:topic_management')) { |
54 | 54 | // Allow to move other than root folder |
55 | 55 | if ($urltopic->guid !== midcom::get()->config->get('midcom_root_topic_guid')) { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
64 | - if ( $this->topic->can_do('midgard:update') |
|
64 | + if ($this->topic->can_do('midgard:update') |
|
65 | 65 | && $this->topic->can_do('midcom.admin.folder:topic_management')) { |
66 | 66 | $buttons[] = [ |
67 | 67 | MIDCOM_TOOLBAR_URL => "__ais/folder/order/", |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | ]; |
79 | 79 | } |
80 | 80 | $buttons = array_merge($buttons, $this->get_approval_controls($this->topic, false)); |
81 | - if ( $this->topic->can_do('midcom.admin.folder:template_management') |
|
81 | + if ($this->topic->can_do('midcom.admin.folder:template_management') |
|
82 | 82 | && midcom::get()->auth->can_user_do('midgard.admin.asgard:manage_objects', null, 'midgard_admin_asgard_plugin')) { |
83 | 83 | $enabled = false; |
84 | 84 | $styleeditor_url = ''; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | ]; |
104 | 104 | } |
105 | 105 | |
106 | - if ( $this->topic->can_do('midgard:create') |
|
106 | + if ($this->topic->can_do('midgard:create') |
|
107 | 107 | && $this->topic->can_do('midcom.admin.folder:topic_management')) { |
108 | 108 | $buttons[] = $workflow->get_button("__ais/folder/create/", [ |
109 | 109 | MIDCOM_TOOLBAR_LABEL => midcom::get()->i18n->get_string('create subfolder', 'midcom.admin.folder'), |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | MIDCOM_TOOLBAR_ACCESSKEY => 'f', |
112 | 112 | ]); |
113 | 113 | } |
114 | - if ( $urltopic->guid !== midcom::get()->config->get('midcom_root_topic_guid') |
|
114 | + if ($urltopic->guid !== midcom::get()->config->get('midcom_root_topic_guid') |
|
115 | 115 | && $urltopic->can_do('midgard:delete') |
116 | 116 | && $urltopic->can_do('midcom.admin.folder:topic_management')) { |
117 | 117 | $workflow = new midcom\workflow\delete(['object' => $urltopic, 'recursive' => true]); |
@@ -4,7 +4,8 @@ |
||
4 | 4 | try { |
5 | 5 | $person = new midcom_db_person($metadata->locker); |
6 | 6 | $name = $person->name; |
7 | -} catch (midcom_error $e) { |
|
7 | +} |
|
8 | +catch (midcom_error $e) { |
|
8 | 9 | $name = $this->data['handler']->_l10n_midcom->get('unknown user'); |
9 | 10 | $e->log(); |
10 | 11 | } |