@@ -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 | } |
@@ -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)) { |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | $password_length = mb_strlen($password); |
| 320 | 320 | |
| 321 | 321 | if ($password_length < $this->_config->get('min_password_length')) { |
| 322 | - if ($show_ui_message){ |
|
| 322 | + if ($show_ui_message) { |
|
| 323 | 323 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.user'), $this->_l10n->get('password too short'), 'error'); |
| 324 | 324 | } |
| 325 | 325 | return false; |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | if ($score < $this->_config->get('min_password_score')) { |
| 340 | - if ($show_ui_message){ |
|
| 340 | + if ($show_ui_message) { |
|
| 341 | 341 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.user'), $this->_l10n->get('password weak'), 'error'); |
| 342 | 342 | } |
| 343 | 343 | return false; |
@@ -131,7 +131,8 @@ discard block |
||
| 131 | 131 | try { |
| 132 | 132 | $this->_backend->index($documents); |
| 133 | 133 | return true; |
| 134 | - } catch (Exception $e) { |
|
| 134 | + } |
|
| 135 | + catch (Exception $e) { |
|
| 135 | 136 | if ($batch) { |
| 136 | 137 | throw $e; |
| 137 | 138 | } |
@@ -160,7 +161,8 @@ discard block |
||
| 160 | 161 | try { |
| 161 | 162 | $this->_backend->delete($RIs); |
| 162 | 163 | return true; |
| 163 | - } catch (Exception $e) { |
|
| 164 | + } |
|
| 165 | + catch (Exception $e) { |
|
| 164 | 166 | debug_add("Deleting error: " . $e->getMessage(), MIDCOM_LOG_ERROR); |
| 165 | 167 | return false; |
| 166 | 168 | } |
@@ -182,7 +184,8 @@ discard block |
||
| 182 | 184 | try { |
| 183 | 185 | $this->_backend->delete_all($constraint); |
| 184 | 186 | return true; |
| 185 | - } catch (Exception $e) { |
|
| 187 | + } |
|
| 188 | + catch (Exception $e) { |
|
| 186 | 189 | debug_add("Deleting error: " . $e->getMessage(), MIDCOM_LOG_ERROR); |
| 187 | 190 | return false; |
| 188 | 191 | } |
@@ -216,7 +219,8 @@ discard block |
||
| 216 | 219 | |
| 217 | 220 | try { |
| 218 | 221 | $result_raw = $this->_backend->query($query, $filter, $options); |
| 219 | - } catch (Exception $e) { |
|
| 222 | + } |
|
| 223 | + catch (Exception $e) { |
|
| 220 | 224 | debug_add("Query error: " . $e->getMessage(), MIDCOM_LOG_ERROR); |
| 221 | 225 | return $result; |
| 222 | 226 | } |
@@ -237,7 +241,8 @@ discard block |
||
| 237 | 241 | if (!empty($document->topic_guid)) { |
| 238 | 242 | try { |
| 239 | 243 | midcom_db_topic::get_cached($document->topic_guid); |
| 240 | - } catch (midcom_error $e) { |
|
| 244 | + } |
|
| 245 | + catch (midcom_error $e) { |
|
| 241 | 246 | // Skip document, the object is hidden. |
| 242 | 247 | debug_add("Skipping the generic document {$document->title}, its topic seems to be invisible, we cannot proceed."); |
| 243 | 248 | continue; |
@@ -250,7 +255,8 @@ discard block |
||
| 250 | 255 | // Strip language code from end of RI if it looks like "<GUID>_<LANG>" |
| 251 | 256 | try { |
| 252 | 257 | midcom::get()->dbfactory->get_object_by_guid(preg_replace('/^([0-9a-f]{32,80})_[a-z]{2}$/', '\\1', $document->RI)); |
| 253 | - } catch (midcom_error $e) { |
|
| 258 | + } |
|
| 259 | + catch (midcom_error $e) { |
|
| 254 | 260 | // Skip document, the object is hidden, deleted or otherwise unavailable. |
| 255 | 261 | //@todo Maybe nonexistent objects should be removed from index? |
| 256 | 262 | continue; |
@@ -409,7 +409,8 @@ |
||
| 409 | 409 | //Get the parent object |
| 410 | 410 | try { |
| 411 | 411 | $parent = midcom::get()->dbfactory->get_object_by_guid($this->objectguid); |
| 412 | - } catch (midcom_error $e) { |
|
| 412 | + } |
|
| 413 | + catch (midcom_error $e) { |
|
| 413 | 414 | $e->log(); |
| 414 | 415 | return; |
| 415 | 416 | } |
@@ -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 | } |
@@ -197,7 +197,8 @@ |
||
| 197 | 197 | if ($this->_response === null) { |
| 198 | 198 | $this->_stop('Could not handle request, unknown method', 405); |
| 199 | 199 | } |
| 200 | - } catch (midcom_error $e) { |
|
| 200 | + } |
|
| 201 | + catch (midcom_error $e) { |
|
| 201 | 202 | $this->_responseStatus = $e->getCode(); |
| 202 | 203 | return $this->_send_response($e->getMessage()); |
| 203 | 204 | } |