@@ -102,7 +102,7 @@ |
||
| 102 | 102 | if (is_string($value)) { |
| 103 | 103 | $this->_headers[$header] = trim($value); |
| 104 | 104 | } |
| 105 | - if ( strtolower($header) == 'from' |
|
| 105 | + if (strtolower($header) == 'from' |
|
| 106 | 106 | || strtolower($header) == 'reply-to' |
| 107 | 107 | || strtolower($header) == 'to') { |
| 108 | 108 | $this->_headers[$header] = $this->_encode_address_field($value); |
@@ -41,7 +41,8 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | try { |
| 43 | 43 | $folder = midcom_db_topic::get_cached($this->topic); |
| 44 | - } catch (midcom_error $e) { |
|
| 44 | + } |
|
| 45 | + catch (midcom_error $e) { |
|
| 45 | 46 | $e->log(); |
| 46 | 47 | } |
| 47 | 48 | $folder->delete_attachment(self::FOLDER_THUMBNAIL); |
@@ -51,7 +52,8 @@ discard block |
||
| 51 | 52 | { |
| 52 | 53 | try { |
| 53 | 54 | return new midcom_db_attachment($this->$type); |
| 54 | - } catch (midcom_error $e) { |
|
| 55 | + } |
|
| 56 | + catch (midcom_error $e) { |
|
| 55 | 57 | $e->log(); |
| 56 | 58 | return false; |
| 57 | 59 | } |
@@ -150,7 +150,7 @@ |
||
| 150 | 150 | $rows = $mc->get_rows(['id', 'name', 'guid'], 'id'); |
| 151 | 151 | |
| 152 | 152 | foreach ($images as $image) { |
| 153 | - if ( !isset($rows[$image->attachment]) |
|
| 153 | + if (!isset($rows[$image->attachment]) |
|
| 154 | 154 | || !isset($rows[$image->image]) |
| 155 | 155 | || !isset($rows[$image->thumbnail])) { |
| 156 | 156 | continue; |
@@ -77,9 +77,9 @@ |
||
| 77 | 77 | $filter_id = $this->_identifier . '_' . $filtername; |
| 78 | 78 | $user = midcom::get()->auth->user->get_storage(); |
| 79 | 79 | |
| 80 | - if ( isset($_POST['unset_filter']) |
|
| 80 | + if (isset($_POST['unset_filter']) |
|
| 81 | 81 | && $_POST['unset_filter'] == $filter_id) { |
| 82 | - if ( $user->get_parameter("org_openpsa_core_filter", $filter_id) |
|
| 82 | + if ($user->get_parameter("org_openpsa_core_filter", $filter_id) |
|
| 83 | 83 | && !$user->delete_parameter("org_openpsa_core_filter", $filter_id)) { |
| 84 | 84 | $message_content = sprintf( |
| 85 | 85 | $l10n->get('the handed filter for %s could not be set as parameter'), |
@@ -35,7 +35,8 @@ |
||
| 35 | 35 | try { |
| 36 | 36 | midcom::get()->dbfactory->get_object_by_guid($param->name); |
| 37 | 37 | $tried[$param->name] = true; |
| 38 | - } catch (midcom_error $e) { |
|
| 38 | + } |
|
| 39 | + catch (midcom_error $e) { |
|
| 39 | 40 | $tried[$param->name] = false; |
| 40 | 41 | } |
| 41 | 42 | } |
@@ -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(); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | $profit = $value - $cost; |
| 93 | - if ( $this->value != $value |
|
| 93 | + if ($this->value != $value |
|
| 94 | 94 | || $this->profit != $profit) { |
| 95 | 95 | $this->value = $value; |
| 96 | 96 | $this->profit = $value - $cost; |
@@ -220,12 +220,12 @@ discard block |
||
| 220 | 220 | |
| 221 | 221 | public function _on_updating() |
| 222 | 222 | { |
| 223 | - if ( $this->state != self::STATE_ACTIVE |
|
| 223 | + if ($this->state != self::STATE_ACTIVE |
|
| 224 | 224 | && !$this->end) { |
| 225 | 225 | //Not active anymore and end not set, set it to now |
| 226 | 226 | $this->end = time(); |
| 227 | 227 | } |
| 228 | - if ( $this->end |
|
| 228 | + if ($this->end |
|
| 229 | 229 | && $this->state == self::STATE_ACTIVE) { |
| 230 | 230 | //Returned to active state, clear the end marker. |
| 231 | 231 | $this->end = 0; |
@@ -120,14 +120,16 @@ |
||
| 120 | 120 | if (!empty($this->customer)) { |
| 121 | 121 | try { |
| 122 | 122 | return org_openpsa_contacts_group_dba::get_cached($this->customer); |
| 123 | - } catch (midcom_error $e) { |
|
| 123 | + } |
|
| 124 | + catch (midcom_error $e) { |
|
| 124 | 125 | $e->log(); |
| 125 | 126 | } |
| 126 | 127 | } |
| 127 | 128 | if (!empty($this->customerContact)) { |
| 128 | 129 | try { |
| 129 | 130 | return org_openpsa_contacts_person_dba::get_cached($this->customerContact); |
| 130 | - } catch (midcom_error $e) { |
|
| 131 | + } |
|
| 132 | + catch (midcom_error $e) { |
|
| 131 | 133 | $e->log(); |
| 132 | 134 | } |
| 133 | 135 | } |
@@ -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); |