@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function _handler_approval(Request $request, $handler_id) |
25 | 25 | { |
26 | - if ( !$request->request->has('guid') |
|
26 | + if (!$request->request->has('guid') |
|
27 | 27 | || !$request->request->has('return_to')) { |
28 | 28 | throw new midcom_error('Cannot process approval request, request is incomplete.'); |
29 | 29 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | midcom::get()->auth->require_valid_user(); |
34 | 34 | midcom::get()->skip_page_style = true; |
35 | 35 | |
36 | - $this->add_stylesheet(MIDCOM_STATIC_URL ."/midcom.helper.imagepopup/styling.css", 'screen'); |
|
36 | + $this->add_stylesheet(MIDCOM_STATIC_URL . "/midcom.helper.imagepopup/styling.css", 'screen'); |
|
37 | 37 | |
38 | 38 | $data['filetype'] = $filetype; |
39 | 39 | $data['object'] = null; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | $this->object = midcom::get()->dbfactory->get_object_by_guid($guid); |
50 | 50 | |
51 | - if ( !midcom::get()->config->get('midcom_services_rcs_enable') |
|
51 | + if (!midcom::get()->config->get('midcom_services_rcs_enable') |
|
52 | 52 | || !$this->object->_use_rcs) { |
53 | 53 | throw new midcom_error_notfound("Revision control not supported for " . get_class($this->object) . "."); |
54 | 54 | } |
@@ -216,8 +216,8 @@ discard block |
||
216 | 216 | public function _handler_history($handler_id, array $args) |
217 | 217 | { |
218 | 218 | // Check if the comparison request is valid |
219 | - if ( !empty($_GET['first']) && !empty($_GET['last']) |
|
220 | - && $_GET['first'] !== $_GET['last']) { |
|
219 | + if (!empty($_GET['first']) && !empty($_GET['last']) |
|
220 | + && $_GET['first'] !== $_GET['last']) { |
|
221 | 221 | return new midcom_response_relocate($this->url_prefix . "diff/{$args[0]}/{$_GET['first']}/{$_GET['last']}/"); |
222 | 222 | } |
223 | 223 | |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | { |
253 | 253 | $this->load_object($args[0]); |
254 | 254 | |
255 | - if ( !$this->backend->version_exists($args[1]) |
|
255 | + if (!$this->backend->version_exists($args[1]) |
|
256 | 256 | || !$this->backend->version_exists($args[2])) { |
257 | 257 | throw new midcom_error_notfound("One of the revisions {$args[1]} or {$args[2]} does not exist."); |
258 | 258 | } |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | $this->object->require_do('midgard:update'); |
324 | 324 | // TODO: set another privilege for restoring? |
325 | 325 | |
326 | - if ( $this->backend->version_exists($args[1]) |
|
326 | + if ($this->backend->version_exists($args[1]) |
|
327 | 327 | && $this->backend->restore_to_revision($args[1])) { |
328 | 328 | midcom::get()->uimessages->add($this->_l10n->get('midcom.admin.rcs'), sprintf($this->_l10n->get('restore to version %s successful'), $args[1])); |
329 | 329 | return new midcom_response_relocate($this->get_object_url()); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | public function _handler_create(Request $request, $guid) |
45 | 45 | { |
46 | 46 | $this->_current_object = midcom::get()->dbfactory->get_object_by_guid($guid); |
47 | - $entry= new org_openpsa_relatedto_journal_entry_dba(); |
|
47 | + $entry = new org_openpsa_relatedto_journal_entry_dba(); |
|
48 | 48 | $entry->linkGuid = $this->_current_object->guid; |
49 | 49 | |
50 | 50 | midcom::get()->head->set_pagetitle($this->_l10n->get('add journal entry')); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $workflow = $this->get_workflow('datamanager', ['controller' => $data['controller']]); |
69 | 69 | if ($entry->can_do('midgard:delete')) { |
70 | 70 | $delete = $this->get_workflow('delete', ['object' => $entry]); |
71 | - $url = $this->router->generate('journal_entry_delete', ['guid' => $guid ]); |
|
71 | + $url = $this->router->generate('journal_entry_delete', ['guid' => $guid]); |
|
72 | 72 | $workflow->add_dialog_button($delete, $url); |
73 | 73 | } |
74 | 74 | return $workflow->run($request); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $workflow = $this->get_workflow('datamanager', ['controller' => $data['controller']]); |
59 | 59 | $response = $workflow->run($request); |
60 | 60 | |
61 | - if ( $workflow->get_state() == 'save' |
|
61 | + if ($workflow->get_state() == 'save' |
|
62 | 62 | && $this->create_account($this->person, $data["controller"]->get_form_values())) { |
63 | 63 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.user'), sprintf($this->_l10n->get('person %s created'), $this->person->name)); |
64 | 64 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $accounthelper = new org_openpsa_user_accounthelper($this->person); |
149 | 149 | |
150 | 150 | // Update account |
151 | - if ( !$accounthelper->set_account($controller->get_form_values()["username"], $password) |
|
151 | + if (!$accounthelper->set_account($controller->get_form_values()["username"], $password) |
|
152 | 152 | && midcom_connection::get_error() != MGD_ERR_OK) { |
153 | 153 | // Failure, give a message |
154 | 154 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.user'), $this->_l10n->get("failed to update the user account, reason") . ': ' . midcom_connection::get_error_string(), 'error'); |
@@ -75,7 +75,7 @@ |
||
75 | 75 | { |
76 | 76 | $nap = new midcom_helper_nav(); |
77 | 77 | $node = $nap->get_node($nap->get_current_node()); |
78 | - $compose_url = $node[MIDCOM_NAV_RELATIVEURL] . 'message/compose/' . $data['message']->guid .'/'; |
|
78 | + $compose_url = $node[MIDCOM_NAV_RELATIVEURL] . 'message/compose/' . $data['message']->guid . '/'; |
|
79 | 79 | $data['batch_url_base_full'] = $node[MIDCOM_NAV_RELATIVEURL] . 'message/send_bg/' . $data['message']->guid . '/'; |
80 | 80 | debug_add("compose_url: {$compose_url}"); |
81 | 81 | debug_add("batch_url base: {$data['batch_url_base_full']}"); |
@@ -100,7 +100,8 @@ |
||
100 | 100 | try { |
101 | 101 | $task = org_openpsa_projects_task_dba::get_cached($hour_report->task); |
102 | 102 | $options['success_url'] = $this->router->generate('list_hours_task', ['guid' => $task->guid]); |
103 | - } catch (midcom_error $e) { |
|
103 | + } |
|
104 | + catch (midcom_error $e) { |
|
104 | 105 | $e->log(); |
105 | 106 | } |
106 | 107 | return $this->get_workflow('delete', $options)->run($request); |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | } |
71 | 71 | } elseif (!$this->form->isSubmitted()) { |
72 | 72 | $this->form->handleRequest($request); |
73 | - if ( $this->form->isSubmitted() |
|
73 | + if ($this->form->isSubmitted() |
|
74 | 74 | && $button = $this->form->getClickedButton()) { |
75 | 75 | $operation = $button->getConfig()->getOption('operation'); |
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | - if ( in_array($operation, [self::SAVE, self::NEXT]) |
|
79 | + if (in_array($operation, [self::SAVE, self::NEXT]) |
|
80 | 80 | && !$this->form->isValid()) { |
81 | 81 | $operation = self::EDIT; |
82 | 82 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | if ($storage->get_last_operation() === self::SAVE) { |
160 | 160 | // Get GUIDs and such for new-created dependent objects |
161 | 161 | $this->dm->set_storage($storage->get_value(), $this->dm->get_schema()->get_name()); |
162 | - } elseif ( !$this->form->isValid() |
|
162 | + } elseif (!$this->form->isValid() |
|
163 | 163 | && $storage->move_uploaded_files() > 0) { |
164 | 164 | $form = $this->dm->get_form($this->form->getName(), true); |
165 | 165 | $this->copy_errors($this->form, $form); |
@@ -70,7 +70,7 @@ |
||
70 | 70 | |
71 | 71 | private function process_attachment() |
72 | 72 | { |
73 | - if ( !isset($this->attachment->metadata) |
|
73 | + if (!isset($this->attachment->metadata) |
|
74 | 74 | || !is_object($this->attachment->metadata)) { |
75 | 75 | return; |
76 | 76 | } |