@@ -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); |
@@ -95,7 +95,8 @@ |
||
95 | 95 | org_openpsa_projects_workflow::accept($task, 0, $this->comment); |
96 | 96 | return; |
97 | 97 | } |
98 | - } catch (midcom_error $e) { |
|
98 | + } |
|
99 | + catch (midcom_error $e) { |
|
99 | 100 | $e->log(); |
100 | 101 | } |
101 | 102 | } |
@@ -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; |
@@ -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); |
@@ -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 |
@@ -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 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | $buttons = []; |
59 | 59 | $workflow = new midcom\workflow\datamanager; |
60 | - if ( $this->topic->can_do('midgard:update') |
|
60 | + if ($this->topic->can_do('midgard:update') |
|
61 | 61 | && $this->topic->can_do('midcom.admin.folder:topic_management')) { |
62 | 62 | $buttons[] = $workflow->get_button("__ais/folder/edit/", [ |
63 | 63 | MIDCOM_TOOLBAR_LABEL => midcom::get()->i18n->get_string('edit folder', 'midcom.admin.folder'), |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | ]; |
92 | 92 | } |
93 | 93 | $buttons = array_merge($buttons, $this->get_approval_controls($this->topic, false)); |
94 | - if ( $this->topic->can_do('midcom.admin.folder:template_management') |
|
94 | + if ($this->topic->can_do('midcom.admin.folder:template_management') |
|
95 | 95 | && midcom::get()->auth->can_user_do('midgard.admin.asgard:manage_objects', null, 'midgard_admin_asgard_plugin')) { |
96 | 96 | $enabled = false; |
97 | 97 | $styleeditor_url = ''; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | MIDCOM_TOOLBAR_ACCESSKEY => 'f', |
125 | 125 | ]); |
126 | 126 | } |
127 | - if ( $this->topic->guid !== midcom::get()->config->get('midcom_root_topic_guid') |
|
127 | + if ($this->topic->guid !== midcom::get()->config->get('midcom_root_topic_guid') |
|
128 | 128 | && $this->topic->can_do('midgard:delete')) { |
129 | 129 | $workflow = new midcom\workflow\delete(['object' => $this->topic, 'recursive' => true]); |
130 | 130 | $buttons[] = $workflow->get_button("__ais/folder/delete/", [ |
@@ -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 | } |
@@ -63,7 +63,8 @@ |
||
63 | 63 | |
64 | 64 | try { |
65 | 65 | $attachment = new midcom_db_attachment($guid); |
66 | - } catch (midcom_error $e) { |
|
66 | + } |
|
67 | + catch (midcom_error $e) { |
|
67 | 68 | $e->log(); |
68 | 69 | return "<span class=\"missing_photo\" title=\"{$guid}\">{$fulltag}</span>{$after}"; |
69 | 70 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | return $this->render_link($parts[1], $parts[2]) . $after; |
224 | 224 | |
225 | 225 | // Macro [something: <data>] (for example [abbr: BOFH - Bastard Operator From Hell] or [photo: <GUID>]) |
226 | - case ( preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts) |
|
226 | + case (preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts) |
|
227 | 227 | && method_exists($this, "_run_macro_{$macro_parts[1]}")): |
228 | 228 | $method = "_run_macro_{$macro_parts[1]}"; |
229 | 229 | return $this->$method($macro_parts[2], $match[0], $after); |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $folder = $wikipage_match['latest_parent']; |
257 | 257 | } |
258 | 258 | |
259 | - if ( isset($folder[MIDCOM_NAV_OBJECT]) |
|
259 | + if (isset($folder[MIDCOM_NAV_OBJECT]) |
|
260 | 260 | && $folder[MIDCOM_NAV_OBJECT]->can_do('midgard:create')) { |
261 | 261 | $workflow = $this->get_workflow('datamanager'); |
262 | 262 | return "<a href=\"{$folder[MIDCOM_NAV_ABSOLUTEURL]}create/?wikiword={$wikipage_match['remaining_path']}\" " . $workflow->render_attributes() . " class=\"wiki_missing\" title=\"" . $this->_l10n->get('click to create') . "\">{$text}</a>"; |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | $links[$parts[1]] = $parts[2]; |
292 | 292 | } |
293 | 293 | // Ignore macros [something: <data>] (for example [abbr: BOFH - Bastard Operator From Hell] or [photo: <GUID>]) |
294 | - elseif ( !preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts) |
|
294 | + elseif (!preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts) |
|
295 | 295 | || !method_exists($this, "_run_macro_{$macro_parts[1]}")) { |
296 | 296 | // MediaWiki-style link [wikipage] (no text) |
297 | 297 | $links[$fulltext] = $fulltext; |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $qb->add_constraint('name', '<>', ''); |
47 | 47 | |
48 | 48 | // Unless in Auto-Index mode or the index article is hidden, we skip the index article. |
49 | - if ( !$this->_config->get('autoindex') |
|
49 | + if (!$this->_config->get('autoindex') |
|
50 | 50 | && !$this->_config->get('indexinnav')) { |
51 | 51 | $qb->add_constraint('name', '<>', 'index'); |
52 | 52 | } |