@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | public function __construct($identifier = null) |
| 24 | 24 | { |
| 25 | - if ( midcom::get()->config->get('person_class') != 'midgard_person' |
|
| 25 | + if (midcom::get()->config->get('person_class') != 'midgard_person' |
|
| 26 | 26 | && midcom::get()->config->get('person_class') != 'openpsa_person') { |
| 27 | 27 | $this->__mgdschema_class_name__ = midcom::get()->config->get('person_class'); |
| 28 | 28 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | public function __set($name, $value) |
| 33 | 33 | { |
| 34 | - if ( $name == 'homepage' |
|
| 34 | + if ($name == 'homepage' |
|
| 35 | 35 | && !empty($value) |
| 36 | 36 | && $value != $this->homepage) { |
| 37 | 37 | $this->_url_changed = true; |
@@ -61,16 +61,16 @@ discard block |
||
| 61 | 61 | private function _check_page_vars() |
| 62 | 62 | { |
| 63 | 63 | $page_var = $this->_prefix . 'page'; |
| 64 | - $results_var = $this->_prefix . 'results'; |
|
| 64 | + $results_var = $this->_prefix . 'results'; |
|
| 65 | 65 | if (!empty($_REQUEST[$page_var])) { |
| 66 | 66 | debug_add("{$page_var} has value: {$_REQUEST[$page_var]}"); |
| 67 | - $this->_current_page = (int)$_REQUEST[$page_var]; |
|
| 67 | + $this->_current_page = (int) $_REQUEST[$page_var]; |
|
| 68 | 68 | } |
| 69 | 69 | if (!empty($_REQUEST[$results_var])) { |
| 70 | 70 | debug_add("{$results_var} has value: {$_REQUEST[$results_var]}"); |
| 71 | - $this->results_per_page = (int)$_REQUEST[$results_var]; |
|
| 71 | + $this->results_per_page = (int) $_REQUEST[$results_var]; |
|
| 72 | 72 | } |
| 73 | - $this->_offset = ($this->_current_page-1)*$this->results_per_page; |
|
| 73 | + $this->_offset = ($this->_current_page - 1) * $this->results_per_page; |
|
| 74 | 74 | if ($this->_offset < 0) { |
| 75 | 75 | $this->_offset = 0; |
| 76 | 76 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | return $this->_midcom_qb->add_constraint($param, $op, $val); |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | - public function add_order($param, $sort='ASC') |
|
| 295 | + public function add_order($param, $sort = 'ASC') |
|
| 296 | 296 | { |
| 297 | 297 | if (!$this->_sanity_check()) { |
| 298 | 298 | return false; |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | if (!$this->_sanity_check()) { |
| 330 | 330 | return false; |
| 331 | 331 | } |
| 332 | - if ( !$this->count |
|
| 332 | + if (!$this->count |
|
| 333 | 333 | || $this->_count_mode != 'count') { |
| 334 | 334 | $this->count = $this->_midcom_qb_count->count(); |
| 335 | 335 | } |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | if (!$this->_sanity_check()) { |
| 343 | 343 | return false; |
| 344 | 344 | } |
| 345 | - if ( !$this->count |
|
| 345 | + if (!$this->count |
|
| 346 | 346 | || $this->_count_mode != 'count_unchecked') { |
| 347 | 347 | $this->count = $this->_midcom_qb_count->count_unchecked(); |
| 348 | 348 | } |
@@ -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; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $this->_task = new org_openpsa_projects_task_dba($args[0]); |
| 59 | 59 | $this->_task->require_do('midgard:create'); |
| 60 | 60 | |
| 61 | - if ( array_key_exists('org_openpsa_projects_prospects', $_POST) |
|
| 61 | + if (array_key_exists('org_openpsa_projects_prospects', $_POST) |
|
| 62 | 62 | && $_POST['save']) { |
| 63 | 63 | $qb = org_openpsa_projects_task_resource_dba::new_query_builder(); |
| 64 | 64 | $qb->add_constraint('guid', 'IN', array_keys($_POST['org_openpsa_projects_prospects'])); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | // create relatedto |
| 90 | 90 | org_openpsa_relatedto_plugin::create($event, 'org.openpsa.calendar', $this->_task, 'org.openpsa.projects'); |
| 91 | 91 | } |
| 92 | - if ( $update_prospect |
|
| 92 | + if ($update_prospect |
|
| 93 | 93 | && !$prospect->update()) { |
| 94 | 94 | debug_add('Failed to update prospect: ' . midcom_connection::get_error_string(), MIDCOM_LOG_ERROR); |
| 95 | 95 | } |
@@ -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); |
@@ -91,7 +91,8 @@ |
||
| 91 | 91 | if ($recipient->guid == $this->metadata->creator) { |
| 92 | 92 | return org_openpsa_projects_workflow::accept($task, 0, $this->comment); |
| 93 | 93 | } |
| 94 | - } catch (midcom_error $e) { |
|
| 94 | + } |
|
| 95 | + catch (midcom_error $e) { |
|
| 95 | 96 | $e->log(); |
| 96 | 97 | } |
| 97 | 98 | } |
@@ -124,7 +124,8 @@ |
||
| 124 | 124 | { |
| 125 | 125 | try { |
| 126 | 126 | $task = new org_openpsa_projects_task_dba($args['task']); |
| 127 | - } catch (midcom_error $e) { |
|
| 127 | + } |
|
| 128 | + catch (midcom_error $e) { |
|
| 128 | 129 | $e->log(); |
| 129 | 130 | return false; |
| 130 | 131 | } |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | */ |
| 52 | 52 | private function _find_suspects_event(midcom_core_dbaobject $object, $defaults, array &$links_array) |
| 53 | 53 | { |
| 54 | - if ( !is_array($object->participants) |
|
| 54 | + if (!is_array($object->participants) |
|
| 55 | 55 | || count($object->participants) < 1) { |
| 56 | 56 | //We have invalid list or zero participants, abort |
| 57 | 57 | return; |
@@ -231,7 +231,7 @@ |
||
| 231 | 231 | $new_status = $this->_find_status($this->_status_map[$this->status_type], $status_types); |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - if ( !is_null($new_status) |
|
| 234 | + if (!is_null($new_status) |
|
| 235 | 235 | && $this->status != $new_status) { |
| 236 | 236 | $this->status = $new_status; |
| 237 | 237 | $update_required = true; |
@@ -44,7 +44,8 @@ |
||
| 44 | 44 | if (!$obj instanceof org_openpsa_contacts_person_dba) { |
| 45 | 45 | try { |
| 46 | 46 | $obj = new org_openpsa_contacts_person_dba($obj->id); |
| 47 | - } catch (midcom_error $e) { |
|
| 47 | + } |
|
| 48 | + catch (midcom_error $e) { |
|
| 48 | 49 | $e->log(); |
| 49 | 50 | continue; |
| 50 | 51 | } |
@@ -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(); |