@@ -83,7 +83,8 @@ |
||
| 83 | 83 | $productgroup = new org_openpsa_products_product_group_dba($this->_product->productGroup); |
| 84 | 84 | $replacements['<PRODUCTGROUP_TITLE>'] = $productgroup->title; |
| 85 | 85 | $replacements['<PRODUCTGROUP_CODE>'] = $productgroup->code; |
| 86 | - } catch (midcom_error $e) { |
|
| 86 | + } |
|
| 87 | + catch (midcom_error $e) { |
|
| 87 | 88 | $replacements['<PRODUCTGROUP_TITLE>'] = ''; |
| 88 | 89 | $replacements['<PRODUCTGROUP_CODE>'] = ''; |
| 89 | 90 | } |
@@ -74,7 +74,8 @@ |
||
| 74 | 74 | if (is_a($stat, midcom_services_indexer_client::class)) { |
| 75 | 75 | try { |
| 76 | 76 | $stat->reindex(); |
| 77 | - } catch (RequestException $e) { |
|
| 77 | + } |
|
| 78 | + catch (RequestException $e) { |
|
| 78 | 79 | if ($e->hasResponse()) { |
| 79 | 80 | $crawler = new Crawler($e->getResponse()->getBody()->getContents()); |
| 80 | 81 | $body = $crawler->filter('body')->html(); |
@@ -79,7 +79,8 @@ |
||
| 79 | 79 | |
| 80 | 80 | try { |
| 81 | 81 | require OPENPSA_PROJECT_BASEDIR . $file; |
| 82 | - } catch (\midcom_error_forbidden $e) { |
|
| 82 | + } |
|
| 83 | + catch (\midcom_error_forbidden $e) { |
|
| 83 | 84 | $dialog = $this->getHelperSet()->get('question'); |
| 84 | 85 | $this->login($dialog, $input, $output); |
| 85 | 86 | require OPENPSA_PROJECT_BASEDIR . $file; |
@@ -8,7 +8,8 @@ discard block |
||
| 8 | 8 | try { |
| 9 | 9 | $creator = new midcom_db_person($view_metadata->get('creator')); |
| 10 | 10 | $creator_string = "<a href=\"" . midcom_connection::get_url('self') . "__mfa/asgard/object/view/{$creator->guid}/\">$creator->name</a>"; |
| 11 | - } catch (midcom_error $e) { |
|
| 11 | + } |
|
| 12 | + catch (midcom_error $e) { |
|
| 12 | 13 | $creator_string = $data['l10n']->get('unknown person'); |
| 13 | 14 | } |
| 14 | 15 | $created = (int) $view_metadata->get('created'); |
@@ -21,7 +22,8 @@ discard block |
||
| 21 | 22 | try { |
| 22 | 23 | $editor = new midcom_db_person($view_metadata->get('revisor')); |
| 23 | 24 | $editor_string = "<a href=\"" . midcom_connection::get_url('self') . "__mfa/asgard/object/view/{$editor->guid}/\">$editor->name</a>"; |
| 24 | - } catch (midcom_error $e) { |
|
| 25 | + } |
|
| 26 | + catch (midcom_error $e) { |
|
| 25 | 27 | $editor_string = $data['l10n']->get('unknown person'); |
| 26 | 28 | } |
| 27 | 29 | |
@@ -100,7 +100,8 @@ |
||
| 100 | 100 | $parent->add_members('resources', [$this->person]); |
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | - } catch (midcom_error $e) { |
|
| 103 | + } |
|
| 104 | + catch (midcom_error $e) { |
|
| 104 | 105 | $e->log(); |
| 105 | 106 | } |
| 106 | 107 | |
@@ -238,7 +238,8 @@ discard block |
||
| 238 | 238 | $salesproject = org_openpsa_sales_salesproject_dba::get_cached($agreement->salesproject); |
| 239 | 239 | $this->customer = $salesproject->customer; |
| 240 | 240 | } |
| 241 | - } catch (midcom_error $e) { |
|
| 241 | + } |
|
| 242 | + catch (midcom_error $e) { |
|
| 242 | 243 | } |
| 243 | 244 | } else { |
| 244 | 245 | // No agreement, we can't be invoiceable |
@@ -283,7 +284,8 @@ discard block |
||
| 283 | 284 | try { |
| 284 | 285 | $agreement = new org_openpsa_sales_salesproject_deliverable_dba($this->get_agreement()); |
| 285 | 286 | $agreement->update_units($this->id, $hours); |
| 286 | - } catch (midcom_error $e) { |
|
| 287 | + } |
|
| 288 | + catch (midcom_error $e) { |
|
| 287 | 289 | } |
| 288 | 290 | |
| 289 | 291 | if ($update) { |
@@ -68,7 +68,8 @@ discard block |
||
| 68 | 68 | $field['type_config']['options'] = [0 => '', $customer->id => $customer->official]; |
| 69 | 69 | |
| 70 | 70 | $defaults['customer'] = $customer->id; |
| 71 | - } catch (midcom_error $e) { |
|
| 71 | + } |
|
| 72 | + catch (midcom_error $e) { |
|
| 72 | 73 | $customer = new org_openpsa_contacts_person_dba($guid); |
| 73 | 74 | $defaults['customerContact'] = $customer->id; |
| 74 | 75 | $field['type_config']['options'] = $this->list_groups(new org_openpsa_sales_salesproject_dba, [$customer->id => true]); |
@@ -142,7 +143,8 @@ discard block |
||
| 142 | 143 | try { |
| 143 | 144 | $company = org_openpsa_contacts_group_dba::get_cached($company_id); |
| 144 | 145 | $ret[$company->id] = $company->get_label(); |
| 145 | - } catch (midcom_error $e) { |
|
| 146 | + } |
|
| 147 | + catch (midcom_error $e) { |
|
| 146 | 148 | $e->log(); |
| 147 | 149 | } |
| 148 | 150 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $result = $this->is_username_available($fields); |
| 48 | 48 | |
| 49 | 49 | $accounthelper = new org_openpsa_user_accounthelper(); |
| 50 | - if ($fields['password']['switch'] && !$accounthelper->check_password_strength($fields['password']['password'])){ |
|
| 50 | + if ($fields['password']['switch'] && !$accounthelper->check_password_strength($fields['password']['password'])) { |
|
| 51 | 51 | $result = ['password' => midcom::get()->i18n->get_string('password weak', 'org.openpsa.user')]; |
| 52 | 52 | } |
| 53 | 53 | |
@@ -155,10 +155,10 @@ discard block |
||
| 155 | 155 | $user = new midcom_db_person($fields["person"]); |
| 156 | 156 | |
| 157 | 157 | $accounthelper = new org_openpsa_user_accounthelper($user); |
| 158 | - if (!$accounthelper->check_password_reuse($fields['new_password'])){ |
|
| 158 | + if (!$accounthelper->check_password_reuse($fields['new_password'])) { |
|
| 159 | 159 | $result['password'] = midcom::get()->i18n->get_string('password was already used', 'org.openpsa.user'); |
| 160 | 160 | } |
| 161 | - if (!$accounthelper->check_password_strength($fields['new_password'])){ |
|
| 161 | + if (!$accounthelper->check_password_strength($fields['new_password'])) { |
|
| 162 | 162 | $result['password'] = midcom::get()->i18n->get_string('password weak', 'org.openpsa.user'); |
| 163 | 163 | } |
| 164 | 164 | if (!empty($result)) { |
@@ -165,14 +165,16 @@ |
||
| 165 | 165 | $this->skip_page_style = true; |
| 166 | 166 | try { |
| 167 | 167 | $response = $this->httpkernel->handle($request, HttpKernelInterface::SUB_REQUEST, false); |
| 168 | - } catch (midcom_error $e) { |
|
| 168 | + } |
|
| 169 | + catch (midcom_error $e) { |
|
| 169 | 170 | if ($e instanceof midcom_error_notfound || $e instanceof midcom_error_forbidden) { |
| 170 | 171 | $e->log(); |
| 171 | 172 | midcom_core_context::leave(); |
| 172 | 173 | return; |
| 173 | 174 | } |
| 174 | 175 | throw $e; |
| 175 | - } finally { |
|
| 176 | + } |
|
| 177 | + finally { |
|
| 176 | 178 | $this->skip_page_style = $backup; |
| 177 | 179 | } |
| 178 | 180 | |