@@ -20,7 +20,7 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | private function _populate_node_toolbar() |
| 22 | 22 | { |
| 23 | - if ( $this->_topic->can_do('midgard:update') |
|
| 23 | + if ($this->_topic->can_do('midgard:update') |
|
| 24 | 24 | && $this->_topic->can_do('midcom:component_config')) { |
| 25 | 25 | $workflow = $this->get_workflow('datamanager'); |
| 26 | 26 | $this->_node_toolbar->add_item($workflow->get_button($this->router->generate('config'), [ |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | $search_config = org_openpsa_widgets_ui::get_search_providers(); |
| 3 | -if ( array_key_exists('org.openpsa.documents', $search_config) |
|
| 3 | +if (array_key_exists('org.openpsa.documents', $search_config) |
|
| 4 | 4 | && midcom::get()->indexer->enabled()) { |
| 5 | 5 | $url = $data['router']->generate('search'); ?> |
| 6 | 6 | <div class="area" id="document_search"> |
@@ -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'), [ |
@@ -104,7 +104,8 @@ discard block |
||
| 104 | 104 | $customer = org_openpsa_contacts_group_dba::get_cached($invoice->customer); |
| 105 | 105 | $entry['customer'] = "<a href=\"{$this->router->generate('list_customer_all', ['guid' => $customer->guid])}\">" . $customer->get_label() . "</a>"; |
| 106 | 106 | $entry['index_customer'] = $customer->get_label(); |
| 107 | - } catch (midcom_error $e) { |
|
| 107 | + } |
|
| 108 | + catch (midcom_error $e) { |
|
| 108 | 109 | $entry['customer'] = ''; |
| 109 | 110 | $entry['index_customer'] = ''; |
| 110 | 111 | } |
@@ -115,7 +116,8 @@ discard block |
||
| 115 | 116 | $contact = org_openpsa_contacts_person_dba::get_cached($invoice->customerContact); |
| 116 | 117 | $entry['contact'] = "<a href=\"{$this->router->generate('list_customer_all', ['guid' => $contact->guid])}\">" . $contact->get_label() . "</a>"; |
| 117 | 118 | $entry['index_contact'] = $contact->get_label(); |
| 118 | - } catch (midcom_error $e) { |
|
| 119 | + } |
|
| 120 | + catch (midcom_error $e) { |
|
| 119 | 121 | $entry['contact'] = ''; |
| 120 | 122 | $entry['index_contact'] = ''; |
| 121 | 123 | } |
@@ -267,7 +269,8 @@ discard block |
||
| 267 | 269 | { |
| 268 | 270 | try { |
| 269 | 271 | $this->_customer = new org_openpsa_contacts_group_dba($guid); |
| 270 | - } catch (midcom_error $e) { |
|
| 272 | + } |
|
| 273 | + catch (midcom_error $e) { |
|
| 271 | 274 | $this->_customer = new org_openpsa_contacts_person_dba($guid); |
| 272 | 275 | } |
| 273 | 276 | $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); |