@@ -58,7 +58,7 @@ |
||
58 | 58 | } |
59 | 59 | $this->_view_toolbar->add_items($buttons); |
60 | 60 | |
61 | - if ( $this->_topic->can_do('midgard:update') |
|
61 | + if ($this->_topic->can_do('midgard:update') |
|
62 | 62 | && $this->_topic->can_do('midcom:component_config')) { |
63 | 63 | $this->_node_toolbar->add_item($workflow->get_button($this->router->generate('config'), [ |
64 | 64 | MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('component configuration'), |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | ]; |
49 | 49 | } |
50 | 50 | |
51 | - if ( midcom::get()->auth->can_user_do('midgard:create', null, org_openpsa_contacts_person_dba::class) |
|
51 | + if (midcom::get()->auth->can_user_do('midgard:create', null, org_openpsa_contacts_person_dba::class) |
|
52 | 52 | && $this->group->can_do('midgard:create')) { |
53 | 53 | $buttons[] = $workflow->get_button($this->router->generate('person_new_group', ['guid' => $this->group->guid]), [ |
54 | 54 | MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('create person'), |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | $siteconfig = org_openpsa_core_siteconfig::get_instance(); |
60 | 60 | $user_url = $siteconfig->get_node_full_url('org.openpsa.user'); |
61 | - if ( $user_url |
|
61 | + if ($user_url |
|
62 | 62 | && midcom::get()->auth->can_user_do('org.openpsa.user:access', null, org_openpsa_user_interface::class)) { |
63 | 63 | $buttons[] = [ |
64 | 64 | MIDCOM_TOOLBAR_URL => $user_url . "group/{$this->group->guid}/", |
@@ -171,7 +171,7 @@ |
||
171 | 171 | { |
172 | 172 | $this->prepare_toolbar(false); |
173 | 173 | |
174 | - if ( $this->_topic->can_do('midgard:update') |
|
174 | + if ($this->_topic->can_do('midgard:update') |
|
175 | 175 | && $this->_topic->can_do('midcom:component_config')) { |
176 | 176 | $workflow = $this->get_workflow('datamanager'); |
177 | 177 | $this->_node_toolbar->add_item($workflow->get_button($this->router->generate('config'), [ |
@@ -96,7 +96,8 @@ discard block |
||
96 | 96 | $customer = org_openpsa_contacts_group_dba::get_cached($invoice->customer); |
97 | 97 | $entry['customer'] = "<a href=\"{$this->router->generate('list_customer_all', ['guid' => $customer->guid])}\">" . $customer->get_label() . "</a>"; |
98 | 98 | $entry['index_customer'] = $customer->get_label(); |
99 | - } catch (midcom_error $e) { |
|
99 | + } |
|
100 | + catch (midcom_error $e) { |
|
100 | 101 | $entry['customer'] = ''; |
101 | 102 | $entry['index_customer'] = ''; |
102 | 103 | } |
@@ -110,7 +111,8 @@ discard block |
||
110 | 111 | $entry['contact'] = "<a href=\"{$this->router->generate('list_customer_all', ['guid' => $contact->guid])}\">" . $contact->get_label() . "</a>"; |
111 | 112 | $entry['contact'] = $contact_widget->show_inline(); |
112 | 113 | $entry['index_contact'] = $contact->get_label(); |
113 | - } catch (midcom_error $e) { |
|
114 | + } |
|
115 | + catch (midcom_error $e) { |
|
114 | 116 | $entry['contact'] = ''; |
115 | 117 | $entry['index_contact'] = ''; |
116 | 118 | } |
@@ -257,7 +259,8 @@ discard block |
||
257 | 259 | { |
258 | 260 | try { |
259 | 261 | $this->_customer = new org_openpsa_contacts_group_dba($guid); |
260 | - } catch (midcom_error $e) { |
|
262 | + } |
|
263 | + catch (midcom_error $e) { |
|
261 | 264 | $this->_customer = new org_openpsa_contacts_person_dba($guid); |
262 | 265 | } |
263 | 266 | $data['customer'] = $this->_customer; |
@@ -169,7 +169,7 @@ |
||
169 | 169 | case 'proposed': |
170 | 170 | $html = $this->render_status($task->manager, "from %s"); |
171 | 171 | $task->get_members(); |
172 | - if ( $task->can_do('midgard:update') |
|
172 | + if ($task->can_do('midgard:update') |
|
173 | 173 | && isset($task->resources[midcom_connection::get_user()])) { |
174 | 174 | $html .= '<form method="post" action="' . $this->router->generate('workflow', ['guid' => $task->guid]) . '">'; |
175 | 175 | //TODO: If we need all resources to accept task hide tools when we have accepted and replace with "pending acceptance from..." |
@@ -291,7 +291,8 @@ discard block |
||
291 | 291 | $url = $this->router->generate('project', ['guid' => $project->guid]); |
292 | 292 | $ret['project'] = '<a href="' . $url . '">' . $project->title . '</a>'; |
293 | 293 | $ret['index_project'] = $project->title; |
294 | - } catch (midcom_error $e) { |
|
294 | + } |
|
295 | + catch (midcom_error $e) { |
|
295 | 296 | $e->log(); |
296 | 297 | } |
297 | 298 | |
@@ -303,7 +304,8 @@ discard block |
||
303 | 304 | $customer_url = "{$contacts_url}group/{$customer->guid}/"; |
304 | 305 | $ret['customer'] = "<a href='{$customer_url}' title='{$customer->official}'>{$customer->get_label()}</a>"; |
305 | 306 | $ret['index_customer'] = $customer->name; |
306 | - } catch (midcom_error $e) { |
|
307 | + } |
|
308 | + catch (midcom_error $e) { |
|
307 | 309 | $ret['customer'] = ''; |
308 | 310 | $ret['index_customer'] = ''; |
309 | 311 | } |
@@ -61,7 +61,8 @@ discard block |
||
61 | 61 | try { |
62 | 62 | $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($at_entry->arguments['deliverable']); |
63 | 63 | $salesproject = org_openpsa_sales_salesproject_dba::get_cached($deliverable->salesproject); |
64 | - } catch (midcom_error $e) { |
|
64 | + } |
|
65 | + catch (midcom_error $e) { |
|
65 | 66 | $e->log(); |
66 | 67 | return $invoice; |
67 | 68 | } |
@@ -103,7 +104,8 @@ discard block |
||
103 | 104 | $invoice[$fieldname] = '<a href="' . $sales_url . 'list/customer/' . $object->guid . '/">' . $invoice[$fieldname] . '</a>'; |
104 | 105 | } |
105 | 106 | $invoice['index_' . $fieldname] = $object->get_label(); |
106 | - } catch (midcom_error $e) { |
|
107 | + } |
|
108 | + catch (midcom_error $e) { |
|
107 | 109 | $e->log(); |
108 | 110 | } |
109 | 111 | } |
@@ -48,7 +48,8 @@ discard block |
||
48 | 48 | if ($sales_url) { |
49 | 49 | $entry['deliverable'] = '<a href="' . $sales_url . 'deliverable/' . $deliverable->guid . '/">' . $entry['deliverable'] . '</a>'; |
50 | 50 | } |
51 | - } catch (midcom_error $e) { |
|
51 | + } |
|
52 | + catch (midcom_error $e) { |
|
52 | 53 | $entry['deliverable'] = ''; |
53 | 54 | } |
54 | 55 | try { |
@@ -57,7 +58,8 @@ discard block |
||
57 | 58 | if ($projects_url) { |
58 | 59 | $entry['task'] = '<a href="' . $projects_url . 'task/' . $task->guid . '/">' . $entry['task'] . '</a>'; |
59 | 60 | } |
60 | - } catch (midcom_error $e) { |
|
61 | + } |
|
62 | + catch (midcom_error $e) { |
|
61 | 63 | $entry['task'] = ''; |
62 | 64 | } |
63 | 65 |
@@ -195,7 +195,8 @@ discard block |
||
195 | 195 | try { |
196 | 196 | $event = new org_openpsa_calendar_event_dba($member->event); |
197 | 197 | $set_as_modified = true; |
198 | - } catch (midcom_error $e) { |
|
198 | + } |
|
199 | + catch (midcom_error $e) { |
|
199 | 200 | debug_add("event_resource #{$member->id} links to bogus event #{$member->event}, skipping and removing", MIDCOM_LOG_WARN); |
200 | 201 | $member->delete(); |
201 | 202 | return; |
@@ -223,7 +224,8 @@ discard block |
||
223 | 224 | |
224 | 225 | try { |
225 | 226 | $event = new org_openpsa_calendar_event_dba($member->eid); |
226 | - } catch (midcom_error $e) { |
|
227 | + } |
|
228 | + catch (midcom_error $e) { |
|
227 | 229 | debug_add("eventmember #{$member->id} links to bogus event #{$member->eid}, skipping and removing", MIDCOM_LOG_WARN); |
228 | 230 | $member->delete(); |
229 | 231 | return; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | } |
126 | 126 | // TODO: Shared tasks need a separate check (different member object) |
127 | 127 | |
128 | - if ( !empty($this->busy_members) |
|
128 | + if (!empty($this->busy_members) |
|
129 | 129 | || !empty($this->busy_resources)) { |
130 | 130 | //Unresolved conflicts (note return value is for conflicts not lack of them) |
131 | 131 | midcom::get()->auth->drop_sudo(); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | } |
189 | 189 | |
190 | 190 | if (array_key_exists($member->event, $modified_events)) { |
191 | - $event =& $modified_events[$member->event]; |
|
191 | + $event = & $modified_events[$member->event]; |
|
192 | 192 | $set_as_modified = false; |
193 | 193 | } else { |
194 | 194 | try { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | } |
203 | 203 | debug_add("overlap found in event {$event->title} (#{$event->id})"); |
204 | 204 | |
205 | - if ( $event->tentative |
|
205 | + if ($event->tentative |
|
206 | 206 | && $rob_tentative) { |
207 | 207 | debug_add('event is tentative, robbing resources'); |
208 | 208 | $event->resources = array_diff_key($event->resources, $this->_event->resources); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | } |
230 | 230 | debug_add("overlap found in event {$event->title} (#{$event->id})"); |
231 | 231 | |
232 | - if ( $event->tentative |
|
232 | + if ($event->tentative |
|
233 | 233 | && $rob_tentative) { |
234 | 234 | debug_add('event is tentative, robbing participants'); |
235 | 235 | $event->participants = array_diff_key($event->participants, $this->_event->participants); |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
36 | - if ( empty($input) |
|
37 | - || ( $input instanceof DateTime |
|
36 | + if (empty($input) |
|
37 | + || ($input instanceof DateTime |
|
38 | 38 | && $input->format('Y-m-d H:i:s') == '0001-01-01 00:00:00')) { |
39 | 39 | return $result; |
40 | 40 | } |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | throw new TransformationFailedException('Expected an array.'); |
60 | 60 | } |
61 | 61 | |
62 | - if ( empty($array['date']) |
|
63 | - || ( $array['date'] instanceof DateTime |
|
62 | + if (empty($array['date']) |
|
63 | + || ($array['date'] instanceof DateTime |
|
64 | 64 | && $array['date']->format('Y-m-d H:i:s') == '0001-01-01 00:00:00')) { |
65 | 65 | return; |
66 | 66 | } |
@@ -37,7 +37,6 @@ |
||
37 | 37 | - 1: MIDCOM_PRIVILEGE_ALLOW |
38 | 38 | - 2: MIDCOM_PRIVILEGE_DENY |
39 | 39 | - 3: MIDCOM_PRIVILEGE_INHERIT |
40 | - |
|
41 | 40 | * @property string $guid |
42 | 41 | * @package midcom |
43 | 42 | */ |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | */ |
247 | 247 | public function set_assignee($assignee) : bool |
248 | 248 | { |
249 | - if ( is_a($assignee, midcom_core_user::class) |
|
249 | + if (is_a($assignee, midcom_core_user::class) |
|
250 | 250 | || is_a($assignee, midcom_core_group::class)) { |
251 | 251 | $this->assignee = $assignee->id; |
252 | 252 | } elseif (is_string($assignee)) { |
@@ -305,12 +305,12 @@ discard block |
||
305 | 305 | } |
306 | 306 | } |
307 | 307 | |
308 | - if ( !$this->is_magic_assignee() |
|
308 | + if (!$this->is_magic_assignee() |
|
309 | 309 | && !$this->get_assignee()) { |
310 | 310 | debug_add("The assignee identifier '{$this->assignee}' is invalid.", MIDCOM_LOG_INFO); |
311 | 311 | return false; |
312 | 312 | } |
313 | - if ( $this->assignee == 'OWNER' |
|
313 | + if ($this->assignee == 'OWNER' |
|
314 | 314 | && $this->privilegename == 'midgard:owner') { |
315 | 315 | debug_add("Tried to assign midgard:owner to the OWNER magic assignee, this is invalid.", MIDCOM_LOG_INFO); |
316 | 316 | return false; |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | MIDCOM_LOG_INFO); |
323 | 323 | return false; |
324 | 324 | } |
325 | - if ( !$object->can_do('midgard:update') |
|
325 | + if (!$object->can_do('midgard:update') |
|
326 | 326 | || !$object->can_do('midgard:privileges')) { |
327 | 327 | debug_add("Insufficient privileges on the content object with the GUID '{$this->__guid}', midgard:update and midgard:privileges required.", |
328 | 328 | MIDCOM_LOG_INFO); |
@@ -124,7 +124,8 @@ |
||
124 | 124 | if ($this->__cached_object === null) { |
125 | 125 | try { |
126 | 126 | $this->__cached_object = midcom::get()->dbfactory->get_object_by_guid($this->objectguid); |
127 | - } catch (midcom_error $e) { |
|
127 | + } |
|
128 | + catch (midcom_error $e) { |
|
128 | 129 | return null; |
129 | 130 | } |
130 | 131 | } |