@@ -3,7 +3,7 @@ |
||
3 | 3 | $title = $this->data['midcom_services_auth_access_denied_title']; |
4 | 4 | $login_warning = $this->data['midcom_services_auth_access_denied_login_warning']; |
5 | 5 | |
6 | -midcom::get()->head->add_stylesheet(MIDCOM_STATIC_URL.'/midcom.services.auth/style.css'); |
|
6 | +midcom::get()->head->add_stylesheet(MIDCOM_STATIC_URL . '/midcom.services.auth/style.css'); |
|
7 | 7 | ?> |
8 | 8 | <!DOCTYPE html> |
9 | 9 | <html lang="<?php echo midcom::get()->i18n->get_current_language(); ?>"> |
@@ -2,7 +2,7 @@ |
||
2 | 2 | $title = $this->data['midcom_services_auth_show_login_page_title']; |
3 | 3 | $login_warning = $this->data['midcom_services_auth_show_login_page_login_warning']; |
4 | 4 | |
5 | -midcom::get()->head->add_stylesheet(MIDCOM_STATIC_URL.'/midcom.services.auth/style.css'); |
|
5 | +midcom::get()->head->add_stylesheet(MIDCOM_STATIC_URL . '/midcom.services.auth/style.css'); |
|
6 | 6 | ?> |
7 | 7 | <!DOCTYPE html> |
8 | 8 | <html lang="<?php echo midcom::get()->i18n->get_current_language(); ?>"> |
@@ -42,7 +42,8 @@ |
||
42 | 42 | } |
43 | 43 | try { |
44 | 44 | $resource = org_openpsa_calendar_resource_dba::get_cached($this->resource); |
45 | - } catch (midcom_error $e) { |
|
45 | + } |
|
46 | + catch (midcom_error $e) { |
|
46 | 47 | debug_add("Cannot fetch resource #{$this->resource} returning false", MIDCOM_LOG_INFO); |
47 | 48 | return false; |
48 | 49 | } |
@@ -66,7 +66,8 @@ discard block |
||
66 | 66 | try { |
67 | 67 | $task = org_openpsa_projects_task_dba::get_cached($this->task); |
68 | 68 | $url = $projects_url . 'task/' . $task->guid . '/'; |
69 | - } catch (midcom_error $e) { |
|
69 | + } |
|
70 | + catch (midcom_error $e) { |
|
70 | 71 | } |
71 | 72 | } |
72 | 73 | if ( $url == '' |
@@ -74,7 +75,8 @@ discard block |
||
74 | 75 | try { |
75 | 76 | $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($this->deliverable); |
76 | 77 | $url = $sales_url . 'deliverable/' . $deliverable->guid . '/'; |
77 | - } catch (midcom_error $e) { |
|
78 | + } |
|
79 | + catch (midcom_error $e) { |
|
78 | 80 | } |
79 | 81 | } |
80 | 82 | if ($url != '') { |
@@ -96,7 +98,8 @@ discard block |
||
96 | 98 | $deliverable = new org_openpsa_sales_salesproject_deliverable_dba($this->deliverable); |
97 | 99 | self::update_deliverable($deliverable); |
98 | 100 | } |
99 | - } catch (midcom_error $e) { |
|
101 | + } |
|
102 | + catch (midcom_error $e) { |
|
100 | 103 | $e->log(); |
101 | 104 | } |
102 | 105 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | public function _on_creating() : bool |
27 | 27 | { |
28 | - if ( $this->invoice |
|
28 | + if ($this->invoice |
|
29 | 29 | && $this->position == 0) { |
30 | 30 | $invoice = org_openpsa_invoices_invoice_dba::get_cached($this->invoice); |
31 | 31 | $this->position = count($invoice->get_invoice_items()) + 1; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } catch (midcom_error $e) { |
76 | 76 | } |
77 | 77 | } |
78 | - if ( $url == '' |
|
78 | + if ($url == '' |
|
79 | 79 | && $sales_url) { |
80 | 80 | try { |
81 | 81 | $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($this->deliverable); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $invoice = new org_openpsa_invoices_invoice_dba($this->invoice); |
98 | 98 | $old_sum = $invoice->sum; |
99 | 99 | self::update_invoice($invoice); |
100 | - if ( $old_sum != $invoice->sum |
|
100 | + if ($old_sum != $invoice->sum |
|
101 | 101 | && !empty($this->deliverable)) { |
102 | 102 | $deliverable = new org_openpsa_sales_salesproject_deliverable_dba($this->deliverable); |
103 | 103 | self::update_deliverable($deliverable); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | if ($invoiced != $deliverable->invoiced) { |
137 | 137 | $deliverable->invoiced = $invoiced; |
138 | - if ( $deliverable->orgOpenpsaObtype !== org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
138 | + if ($deliverable->orgOpenpsaObtype !== org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
139 | 139 | && $deliverable->state < org_openpsa_sales_salesproject_deliverable_dba::STATE_INVOICED) { |
140 | 140 | $deliverable->state = org_openpsa_sales_salesproject_deliverable_dba::STATE_INVOICED; |
141 | 141 | } |
@@ -25,7 +25,8 @@ discard block |
||
25 | 25 | midcom::get()->auth->request_sudo($this->_component); |
26 | 26 | try { |
27 | 27 | $person = new midcom_db_person($args['guid']); |
28 | - } catch (midcom_error $e) { |
|
28 | + } |
|
29 | + catch (midcom_error $e) { |
|
29 | 30 | $handler->print_error('Person with guid #' . $args['guid'] . ' does not exist'); |
30 | 31 | midcom::get()->auth->drop_sudo(); |
31 | 32 | return false; |
@@ -33,7 +34,8 @@ discard block |
||
33 | 34 | $accounthelper = new org_openpsa_user_accounthelper($person); |
34 | 35 | try { |
35 | 36 | $accounthelper->reopen_account(); |
36 | - } catch (midcom_error $e) { |
|
37 | + } |
|
38 | + catch (midcom_error $e) { |
|
37 | 39 | $handler->print_error($e->getMessage()); |
38 | 40 | midcom::get()->auth->drop_sudo(); |
39 | 41 | return false; |
@@ -63,7 +63,7 @@ |
||
63 | 63 | public function _on_created() |
64 | 64 | { |
65 | 65 | //Remove the resource if necessary |
66 | - if ( $this->type == self::DECLINED |
|
66 | + if ($this->type == self::DECLINED |
|
67 | 67 | && $this->targetPerson) { |
68 | 68 | $qb = org_openpsa_projects_task_resource_dba::new_query_builder(); |
69 | 69 | $qb->add_constraint('task', '=', $this->task); |
@@ -95,7 +95,8 @@ |
||
95 | 95 | org_openpsa_projects_workflow::accept($task, 0, $this->comment); |
96 | 96 | return; |
97 | 97 | } |
98 | - } catch (midcom_error $e) { |
|
98 | + } |
|
99 | + catch (midcom_error $e) { |
|
99 | 100 | $e->log(); |
100 | 101 | } |
101 | 102 | } |
@@ -68,7 +68,7 @@ |
||
68 | 68 | $status_changer_label = $this->l10n->get('system'); |
69 | 69 | $target_person_label = $this->l10n->get('system'); |
70 | 70 | |
71 | - if ( $status_change->metadata->creator |
|
71 | + if ($status_change->metadata->creator |
|
72 | 72 | && $status_change->metadata->creator != $fallback_creator->guid) { |
73 | 73 | $status_changer = org_openpsa_widgets_contact::get($status_change->metadata->creator); |
74 | 74 | $status_changer_label = $status_changer->show_inline(); |
@@ -23,7 +23,8 @@ discard block |
||
23 | 23 | try { |
24 | 24 | $person = new midcom_db_person($this->uid); |
25 | 25 | $grp = new midcom_db_group($this->gid); |
26 | - } catch (midcom_error $e) { |
|
26 | + } |
|
27 | + catch (midcom_error $e) { |
|
27 | 28 | $e->log(); |
28 | 29 | return 'Invalid membership record'; |
29 | 30 | } |
@@ -40,7 +41,8 @@ discard block |
||
40 | 41 | } |
41 | 42 | try { |
42 | 43 | $person = new midcom_db_person($this->uid); |
43 | - } catch (midcom_error $e) { |
|
44 | + } |
|
45 | + catch (midcom_error $e) { |
|
44 | 46 | return; |
45 | 47 | } |
46 | 48 | midcom::get()->cache->invalidate($person->guid); |
@@ -88,7 +88,8 @@ |
||
88 | 88 | $style = midcom_db_style::get_cached($style_id); |
89 | 89 | $styleeditor_url = midcom_connection::get_url('self') . "__mfa/asgard/object/view/{$style->guid}/"; |
90 | 90 | $enabled = true; |
91 | - } catch (midcom_error $e) { |
|
91 | + } |
|
92 | + catch (midcom_error $e) { |
|
92 | 93 | $e->log(); |
93 | 94 | } |
94 | 95 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | $buttons = []; |
59 | 59 | $workflow = new midcom\workflow\datamanager; |
60 | - if ( $this->topic->can_do('midgard:update') |
|
60 | + if ($this->topic->can_do('midgard:update') |
|
61 | 61 | && $this->topic->can_do('midcom.admin.folder:topic_management')) { |
62 | 62 | $buttons[] = $workflow->get_button("__ais/folder/edit/", [ |
63 | 63 | MIDCOM_TOOLBAR_LABEL => midcom::get()->i18n->get_string('edit folder', 'midcom.admin.folder'), |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | ]; |
92 | 92 | } |
93 | 93 | $buttons = array_merge($buttons, $this->get_approval_controls($this->topic, false)); |
94 | - if ( $this->topic->can_do('midcom.admin.folder:template_management') |
|
94 | + if ($this->topic->can_do('midcom.admin.folder:template_management') |
|
95 | 95 | && midcom::get()->auth->can_user_do('midgard.admin.asgard:manage_objects', null, 'midgard_admin_asgard_plugin')) { |
96 | 96 | $enabled = false; |
97 | 97 | $styleeditor_url = ''; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | MIDCOM_TOOLBAR_ACCESSKEY => 'f', |
125 | 125 | ]); |
126 | 126 | } |
127 | - if ( $this->topic->guid !== midcom::get()->config->get('midcom_root_topic_guid') |
|
127 | + if ($this->topic->guid !== midcom::get()->config->get('midcom_root_topic_guid') |
|
128 | 128 | && $this->topic->can_do('midgard:delete')) { |
129 | 129 | $workflow = new midcom\workflow\delete(['object' => $this->topic, 'recursive' => true]); |
130 | 130 | $buttons[] = $workflow->get_button("__ais/folder/delete/", [ |