@@ -7,7 +7,7 @@ |
||
7 | 7 | $link = $data['router']->generate('components_component', ['component' => $component]); |
8 | 8 | |
9 | 9 | echo "<li class=\"component\">"; |
10 | - echo "<a href=\"{$link}\">" . midcom::get()->i18n->get_string($component, $component) ." </a>\n"; |
|
10 | + echo "<a href=\"{$link}\">" . midcom::get()->i18n->get_string($component, $component) . " </a>\n"; |
|
11 | 11 | echo "<ul>\n"; |
12 | 12 | foreach ($elements as $name => $path) { |
13 | 13 | echo "<li>"; |
@@ -61,7 +61,8 @@ |
||
61 | 61 | { |
62 | 62 | try { |
63 | 63 | $this->_object = midcom::get()->dbfactory->get_object_by_guid($guid); |
64 | - } catch (midcom_error $e) { |
|
64 | + } |
|
65 | + catch (midcom_error $e) { |
|
65 | 66 | if (midcom_connection::get_error() == MGD_ERR_OBJECT_DELETED) { |
66 | 67 | $relocate = $this->router->generate('object_deleted', ['guid' => $guid]); |
67 | 68 | midcom::get()->relocate($relocate); |
@@ -223,10 +223,10 @@ |
||
223 | 223 | $new_type_reflector = midcom_helper_reflector::get($new_type); |
224 | 224 | $link_properties = $new_type_reflector->get_link_properties(); |
225 | 225 | foreach ($link_properties as $property => $link) { |
226 | - if ( ($link['class'] && midcom_helper_reflector::is_same_class($link['class'], $this->_object->__mgdschema_class_name__)) |
|
226 | + if (($link['class'] && midcom_helper_reflector::is_same_class($link['class'], $this->_object->__mgdschema_class_name__)) |
|
227 | 227 | || $link['type'] == MGD_TYPE_GUID) { |
228 | 228 | $defaults[$property] = $this->_object->{$link['target']}; |
229 | - } elseif ( $property == $parent_property |
|
229 | + } elseif ($property == $parent_property |
|
230 | 230 | && midcom_helper_reflector::is_same_class($new_type, $this->_object->__mgdschema_class_name__)) { |
231 | 231 | $defaults[$property] = $this->_object->$parent_property; |
232 | 232 | } |
@@ -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'), [ |
@@ -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 | } |