@@ -29,7 +29,7 @@ |
||
29 | 29 | public function send() |
30 | 30 | { |
31 | 31 | $context = midcom_core_context::get(); |
32 | - $data =& $context->get_custom_key('request_data'); |
|
32 | + $data = & $context->get_custom_key('request_data'); |
|
33 | 33 | midcom::get()->style->enter_context($context->id); |
34 | 34 | |
35 | 35 | if (isset($data['view_title'])) { |
@@ -117,7 +117,8 @@ |
||
117 | 117 | } |
118 | 118 | break; |
119 | 119 | } |
120 | - } catch (midcom_error $e) { |
|
120 | + } |
|
121 | + catch (midcom_error $e) { |
|
121 | 122 | $e->log(); |
122 | 123 | } |
123 | 124 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | ]; |
145 | 145 | } |
146 | 146 | |
147 | - if ( midcom::get()->config->get('midcom_services_rcs_enable') |
|
147 | + if (midcom::get()->config->get('midcom_services_rcs_enable') |
|
148 | 148 | && $object->can_do('midgard:update') |
149 | 149 | && $object->_use_rcs) { |
150 | 150 | $buttons[] = [ |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | private function get_toolbar_update_items($object) |
206 | 206 | { |
207 | 207 | $buttons = []; |
208 | - if ( is_a($object, midcom_db_topic::class) |
|
208 | + if (is_a($object, midcom_db_topic::class) |
|
209 | 209 | && $object->component |
210 | 210 | && $object->can_do('midcom:component_config')) { |
211 | 211 | $buttons[] = [ |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | MIDCOM_TOOLBAR_ENABLED => $object->can_do('midgard:privileges'), |
244 | 244 | ]; |
245 | 245 | |
246 | - if ( midcom::get()->componentloader->is_installed('midcom.helper.replicator') |
|
246 | + if (midcom::get()->componentloader->is_installed('midcom.helper.replicator') |
|
247 | 247 | && midcom::get()->auth->admin) { |
248 | 248 | $buttons[] = [ |
249 | 249 | MIDCOM_TOOLBAR_URL => "__mfa/asgard_midcom.helper.replicator/object/{$object->guid}/", |
@@ -217,7 +217,8 @@ |
||
217 | 217 | |
218 | 218 | try { |
219 | 219 | $account = new midcom_core_account($person); |
220 | - } catch (midcom_error $e) { |
|
220 | + } |
|
221 | + catch (midcom_error $e) { |
|
221 | 222 | midcom::get()->uimessages->add($this->_l10n->get('midgard.admin.user'), sprintf($this->_l10n->get('failed to get the user with id %s'), $person->id), 'error'); |
222 | 223 | return; |
223 | 224 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | midcom::get()->uimessages->add($this->_l10n->get('midgard.admin.user'), $this->_l10n_midcom->get('updated')); |
59 | 59 | return new midcom_response_relocate("__mfa/asgard_midgard.admin.user/group/edit/{$data['group']->guid}/"); |
60 | 60 | } |
61 | - debug_add('Failed to update the group, last error was '. midcom_connection::get_error_string(), MIDCOM_LOG_ERROR); |
|
61 | + debug_add('Failed to update the group, last error was ' . midcom_connection::get_error_string(), MIDCOM_LOG_ERROR); |
|
62 | 62 | debug_print_r('We operated on this object', $data['group'], MIDCOM_LOG_ERROR); |
63 | 63 | |
64 | 64 | throw new midcom_error('Failed to update the group, see error level log for details'); |
@@ -27,8 +27,8 @@ |
||
27 | 27 | if (!empty($fields["username"])) { |
28 | 28 | $user = midcom::get()->auth->get_user_by_name($fields["username"]); |
29 | 29 | |
30 | - if ( $user |
|
31 | - && ( !isset($fields['person']) |
|
30 | + if ($user |
|
31 | + && (!isset($fields['person']) |
|
32 | 32 | || $user->guid != $fields['person'])) { |
33 | 33 | $result["username"] = sprintf(midcom::get()->i18n->get_string("username %s is already in use", "midgard.admin.user"), $fields['username']); |
34 | 34 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | { |
36 | 36 | midcom::get()->auth->require_valid_user(); |
37 | 37 | //Look for action among POST variables, then load main handler... |
38 | - if ( empty($_POST['org_openpsa_projects_workflow_action']) |
|
38 | + if (empty($_POST['org_openpsa_projects_workflow_action']) |
|
39 | 39 | || !is_array($_POST['org_openpsa_projects_workflow_action'])) { |
40 | 40 | throw new midcom_error('Incomplete request'); |
41 | 41 | } |
@@ -426,7 +426,8 @@ discard block |
||
426 | 426 | $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX); |
427 | 427 | $ret['project'] = '<a href="' . $prefix . 'project/' . $project->guid . '/">' . $project->title . '</a>'; |
428 | 428 | $ret['index_project'] = $project->title; |
429 | - } catch (midcom_error $e) { |
|
429 | + } |
|
430 | + catch (midcom_error $e) { |
|
430 | 431 | $e->log(); |
431 | 432 | } |
432 | 433 | |
@@ -437,7 +438,8 @@ discard block |
||
437 | 438 | $customer_url = "{$this->_request_data['contacts_url']}group/{$customer->guid}/"; |
438 | 439 | $ret['customer'] = "<a href='{$customer_url}' title='{$customer->official}'>{$customer->get_label()}</a>"; |
439 | 440 | $ret['index_customer'] = $customer->name; |
440 | - } catch (midcom_error $e) { |
|
441 | + } |
|
442 | + catch (midcom_error $e) { |
|
441 | 443 | $ret['customer'] = ''; |
442 | 444 | $ret['index_customer'] = ''; |
443 | 445 | } |
@@ -174,7 +174,7 @@ |
||
174 | 174 | case 'proposed': |
175 | 175 | $html = $this->render_status($task->manager, "from %s"); |
176 | 176 | $task->get_members(); |
177 | - if ( $task->can_do('midgard:update') |
|
177 | + if ($task->can_do('midgard:update') |
|
178 | 178 | && isset($task->resources[midcom_connection::get_user()])) { |
179 | 179 | $html .= '<form method="post" action="' . $prefix . 'workflow/' . $task->guid . '/">'; |
180 | 180 | //TODO: If we need all resources to accept task hide tools when we have accepted and replace with "pending acceptance from..." |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $ownerwg = $this->get_parameter('org.openpsa.core', 'orgOpenpsaOwnerWg'); |
21 | 21 | $accesstype = $this->get_parameter('org.openpsa.core', 'orgOpenpsaAccesstype'); |
22 | 22 | |
23 | - if ( $ownerwg |
|
23 | + if ($ownerwg |
|
24 | 24 | && $accesstype) { |
25 | 25 | // Sync the object's ACL properties into MidCOM ACL system |
26 | 26 | $sync = new org_openpsa_core_acl_synchronizer(); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | private function _update_parent_timestamp() |
42 | 42 | { |
43 | 43 | $parent = $this->get_parent(); |
44 | - if ( $parent |
|
44 | + if ($parent |
|
45 | 45 | && $parent->component == 'org.openpsa.documents') { |
46 | 46 | midcom::get()->auth->request_sudo('org.openpsa.documents'); |
47 | 47 |
@@ -115,7 +115,7 @@ |
||
115 | 115 | $request->addHeader('User-Agent: Midgard/' . substr(mgd_version(), 0, 4)); |
116 | 116 | |
117 | 117 | // Handle basic auth |
118 | - if ( !empty($username) |
|
118 | + if (!empty($username) |
|
119 | 119 | && !empty($password)) { |
120 | 120 | // Set basic auth |
121 | 121 | $request->addHeader('Authorization: Basic ' . base64_encode($username . ':' . $password)); |
@@ -129,7 +129,8 @@ |
||
129 | 129 | |
130 | 130 | try { |
131 | 131 | $response = $browser->send($request); |
132 | - } catch (Exception $e) { |
|
132 | + } |
|
133 | + catch (Exception $e) { |
|
133 | 134 | $this->error = $e->getMessage(); |
134 | 135 | debug_add("Got error '{$this->error}' from HTTP request", MIDCOM_LOG_INFO); |
135 | 136 | return false; |