@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $qb_hr = org_openpsa_projects_hour_report_dba::new_query_builder(); |
45 | 45 | $qb_hr->add_constraint('date', '<=', (int) $this->_request_data['query_data']['end']); |
46 | 46 | $qb_hr->add_constraint('date', '>=', (int) $this->_request_data['query_data']['start']); |
47 | - if ( array_key_exists('invoiceable_filter', $this->_request_data['query_data']) |
|
47 | + if (array_key_exists('invoiceable_filter', $this->_request_data['query_data']) |
|
48 | 48 | && $this->_request_data['query_data']['invoiceable_filter'] != -1) { |
49 | 49 | $qb_hr->add_constraint('invoiceable', '=', (bool) $this->_request_data['query_data']['invoiceable_filter']); |
50 | 50 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $tasks = $this->_expand_task($this->_request_data['query_data']['task']); |
61 | 61 | $qb_hr->add_constraint('task', 'IN', $tasks); |
62 | 62 | } |
63 | - if ( array_key_exists('hour_type_filter', $this->_request_data['query_data']) |
|
63 | + if (array_key_exists('hour_type_filter', $this->_request_data['query_data']) |
|
64 | 64 | && $this->_request_data['query_data']['hour_type_filter'] != 'builtin:all') { |
65 | 65 | $qb_hr->add_constraint('reportType', '=', $this->_request_data['query_data']['hour_type_filter']); |
66 | 66 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | private function add_to_group($new_row, $matching, $sort, $title) |
153 | 153 | { |
154 | - $rows =& $this->_request_data['report']['rows']; |
|
154 | + $rows = & $this->_request_data['report']['rows']; |
|
155 | 155 | if (array_key_exists($matching, $rows)) { |
156 | 156 | $rows[$matching]['rows'][] = $new_row; |
157 | 157 | $rows[$matching]['total_hours'] += $new_row['hour']->hours; |
@@ -123,7 +123,8 @@ |
||
123 | 123 | $row = array(); |
124 | 124 | try { |
125 | 125 | $row['person'] = org_openpsa_contacts_person_dba::get_cached($hour->person); |
126 | - } catch (midcom_error $e) { |
|
126 | + } |
|
127 | + catch (midcom_error $e) { |
|
127 | 128 | $e->log(); |
128 | 129 | continue; |
129 | 130 | } |
@@ -59,7 +59,7 @@ |
||
59 | 59 | |
60 | 60 | private function get_units() |
61 | 61 | { |
62 | - if ( $this->_deliverable->invoiceByActualUnits |
|
62 | + if ($this->_deliverable->invoiceByActualUnits |
|
63 | 63 | || $this->_deliverable->plannedUnits == 0) { |
64 | 64 | // In most cases we calculate the price based on the actual units entered |
65 | 65 | return $this->_deliverable->units; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | function read_object($person) |
134 | 134 | { |
135 | - if ( !is_object($person) |
|
135 | + if (!is_object($person) |
|
136 | 136 | || !midcom::get()->dbfactory->is_a($person, 'midcom_db_person')) { |
137 | 137 | // Given $person is not one |
138 | 138 | return false; |
@@ -156,12 +156,12 @@ discard block |
||
156 | 156 | } |
157 | 157 | } |
158 | 158 | |
159 | - if ( $this->_config->get('jabber_enable_presence') |
|
159 | + if ($this->_config->get('jabber_enable_presence') |
|
160 | 160 | && $person->get_parameter('org.openpsa.jabber', 'jid')) { |
161 | 161 | $this->contact_details['jid'] = $person->get_parameter('org.openpsa.jabber', 'jid'); |
162 | 162 | } |
163 | 163 | |
164 | - if ( $this->_config->get('skype_enable_presence') |
|
164 | + if ($this->_config->get('skype_enable_presence') |
|
165 | 165 | && $person->get_parameter('org.openpsa.skype', 'name')) { |
166 | 166 | $this->contact_details['skype'] = $person->get_parameter('org.openpsa.skype', 'name'); |
167 | 167 | } |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | |
237 | 237 | // Show picture |
238 | 238 | // TODO: Implement photo also in local way |
239 | - if ( $this->_config->get('gravatar_enable') |
|
239 | + if ($this->_config->get('gravatar_enable') |
|
240 | 240 | && !empty($this->contact_details['email'])) { |
241 | 241 | $size = $this->_config->get('gravatar_size'); |
242 | 242 | $gravatar_url = "http://www.gravatar.com/avatar.php?gravatar_id=" . md5($this->contact_details['email']) . "&size=" . $size; |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | |
316 | 316 | private function _show_groups() |
317 | 317 | { |
318 | - if ( !$this->show_groups |
|
318 | + if (!$this->show_groups |
|
319 | 319 | || empty($this->contact_details['id'])) { |
320 | 320 | return; |
321 | 321 | } |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | $cards_to_show[] = $cardname; |
382 | 382 | } |
383 | 383 | } else { |
384 | - if ( $customer->$property |
|
384 | + if ($customer->$property |
|
385 | 385 | || ($customer->street && !$inherited_cards_only && !$default_shown)) { |
386 | 386 | $inherited_cards_only = false; |
387 | 387 | $multiple_addresses = true; |
@@ -403,8 +403,8 @@ discard block |
||
403 | 403 | |
404 | 404 | foreach ($cards_to_show as $cardname) { |
405 | 405 | echo '<div class="vcard">'; |
406 | - if ( $multiple_addresses |
|
407 | - || ( $cardname != 'visiting' |
|
406 | + if ($multiple_addresses |
|
407 | + || ($cardname != 'visiting' |
|
408 | 408 | && !$inherited_cards_only)) { |
409 | 409 | echo '<div style="text-align:center"><em>' . midcom::get()->i18n->get_string($cardname . ' address', 'org.openpsa.contacts') . "</em></div>\n"; |
410 | 410 | } |
@@ -114,7 +114,8 @@ discard block |
||
114 | 114 | |
115 | 115 | try { |
116 | 116 | $person = org_openpsa_contacts_person_dba::get_cached($src); |
117 | - } catch (midcom_error $e) { |
|
117 | + } |
|
118 | + catch (midcom_error $e) { |
|
118 | 119 | $widget = new self(); |
119 | 120 | $cache[$src] = $widget; |
120 | 121 | return $widget; |
@@ -323,7 +324,8 @@ discard block |
||
323 | 324 | foreach ($memberships as $data) { |
324 | 325 | try { |
325 | 326 | $group = org_openpsa_contacts_group_dba::get_cached($data['gid']); |
326 | - } catch (midcom_error $e) { |
|
327 | + } |
|
328 | + catch (midcom_error $e) { |
|
327 | 329 | $e->log(); |
328 | 330 | continue; |
329 | 331 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $workflow = $this->get_workflow('datamanager2', array('controller' => $data['controller'])); |
56 | 56 | $response = $workflow->run(); |
57 | 57 | |
58 | - if ( $workflow->get_state() == 'save' |
|
58 | + if ($workflow->get_state() == 'save' |
|
59 | 59 | && $this->_master->create_account($this->person, $data["controller"]->formmanager)) { |
60 | 60 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.user'), sprintf($this->_l10n->get('person %s created'), $this->person->name)); |
61 | 61 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $accounthelper = new org_openpsa_user_accounthelper($this->person); |
155 | 155 | |
156 | 156 | // Update account |
157 | - if ( !$accounthelper->set_account($formmanager->get_value("username"), $password) |
|
157 | + if (!$accounthelper->set_account($formmanager->get_value("username"), $password) |
|
158 | 158 | && midcom_connection::get_error() != MGD_ERR_OK) { |
159 | 159 | // Failure, give a message |
160 | 160 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.user'), $this->_l10n->get("failed to update the user account, reason") . ': ' . midcom_connection::get_error_string(), 'error'); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $filename = $generator->from_string($this->invoice->get_label()) . '.pdf'; |
88 | 88 | |
89 | 89 | // tmp filename |
90 | - $tmp_file = midcom::get()->config->get('midcom_tempdir') . "/". $filename; |
|
90 | + $tmp_file = midcom::get()->config->get('midcom_tempdir') . "/" . $filename; |
|
91 | 91 | |
92 | 92 | // render pdf to tmp filename |
93 | 93 | $pdf_builder->render($tmp_file); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $attachment->update(); |
101 | 101 | } else { |
102 | 102 | $attachment = $this->invoice->create_attachment($filename, $this->invoice->get_label(), "application/pdf"); |
103 | - if ( !$attachment |
|
103 | + if (!$attachment |
|
104 | 104 | || !$this->invoice->set_parameter("midcom.helper.datamanager2.type.blobs", "guids_pdf_file", $attachment->guid . ":" . $attachment->guid)) { |
105 | 105 | throw new midcom_error("Failed to create invoice attachment for pdf"); |
106 | 106 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | |
59 | 59 | if (midcom::get()->config->get('enable_ajax_editing')) { |
60 | 60 | $data['controller'] = midcom_helper_datamanager2_controller::create('ajax'); |
61 | - $data['controller']->schemadb =& $data['schemadb_product']; |
|
61 | + $data['controller']->schemadb = & $data['schemadb_product']; |
|
62 | 62 | $data['controller']->set_storage($this->_product); |
63 | 63 | $data['controller']->process_ajax(); |
64 | 64 | $data['datamanager'] = $data['controller']->datamanager; |
@@ -85,7 +85,8 @@ |
||
85 | 85 | $productgroup = new org_openpsa_products_product_group_dba($this->_product->productGroup); |
86 | 86 | $title = str_replace('<PRODUCTGROUP_TITLE>', $productgroup->title, $title); |
87 | 87 | $title = str_replace('<PRODUCTGROUP_CODE>', $productgroup->code, $title); |
88 | - } catch (midcom_error $e) { |
|
88 | + } |
|
89 | + catch (midcom_error $e) { |
|
89 | 90 | $title = str_replace(array('<PRODUCTGROUP_TITLE>', '<PRODUCTGROUP_CODE>'), '', $title); |
90 | 91 | } |
91 | 92 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $new_password_encrypted = midcom_connection::prepare_password($new_password); |
147 | 147 | |
148 | 148 | //check if the new encrypted password was already used |
149 | - if ( $this->check_password_reuse($new_password_encrypted) |
|
149 | + if ($this->check_password_reuse($new_password_encrypted) |
|
150 | 150 | && $this->check_password_strength($new_password)) { |
151 | 151 | $this->_save_old_password(); |
152 | 152 | $account->set_password($new_password); |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | for ($i = 0; $i < strlen($password); $i++) { |
337 | 337 | $repeated = true; |
338 | 338 | for ($j = 0; $j < $plen && ($j + $i + $plen) < strlen($password); $j++) { |
339 | - if ( (substr($password, $j + $i, 1) == substr($password, $j + $i + $plen, 1)) |
|
339 | + if ((substr($password, $j + $i, 1) == substr($password, $j + $i + $plen, 1)) |
|
340 | 340 | && $repeated) { |
341 | 341 | $repeated = true; |
342 | 342 | } else { |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | |
479 | 479 | public static function get_person_by_formdata($data) |
480 | 480 | { |
481 | - if ( empty($data['username']) |
|
481 | + if (empty($data['username']) |
|
482 | 482 | || empty($data['password'])) { |
483 | 483 | return false; |
484 | 484 | } |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | $max_attempts = midcom_baseclasses_components_configuration::get($component, 'config')->get('max_password_attempts'); |
513 | 513 | $timeframe = midcom_baseclasses_components_configuration::get($component, 'config')->get('password_block_timeframe_min'); |
514 | 514 | |
515 | - if ( $max_attempts == 0 |
|
515 | + if ($max_attempts == 0 |
|
516 | 516 | || $timeframe == 0) { |
517 | 517 | return $stat; |
518 | 518 | } |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | * If the maximum number of attemps is reached and the oldest attempt |
535 | 535 | * on the stack is within our defined timeframe, we block the account |
536 | 536 | */ |
537 | - if ( count($attempts) >= $max_attempts |
|
537 | + if (count($attempts) >= $max_attempts |
|
538 | 538 | && $attempts[$max_attempts - 1] >= (time() - ($timeframe * 60))) { |
539 | 539 | $this->disable_account(); |
540 | 540 | $stat = false; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | $reflector = midcom_helper_reflector::get($linked_object); |
124 | - $link_html = "<a href='" . midcom::get()->permalinks->create_permalink($linked_object->guid) . "'>" . $reflector->get_object_label($linked_object) ."</a>"; |
|
124 | + $link_html = "<a href='" . midcom::get()->permalinks->create_permalink($linked_object->guid) . "'>" . $reflector->get_object_label($linked_object) . "</a>"; |
|
125 | 125 | $data['linked_objects'][$entry->linkGuid] = $link_html; |
126 | 126 | $data['linked_raw_objects'][$entry->linkGuid] = $reflector->get_object_label($linked_object); |
127 | 127 | } |
@@ -151,8 +151,8 @@ discard block |
||
151 | 151 | //check if there is a page & rows - parameter passed - if add them to qb |
152 | 152 | if (array_key_exists('page', $_POST) && array_key_exists('rows', $_POST)) { |
153 | 153 | $this->_request_data['page'] = $_POST['page']; |
154 | - $this->qb->set_limit((int)$_POST['rows']); |
|
155 | - $offset = ((int)$_POST['page'] - 1) * (int)$_POST['rows']; |
|
154 | + $this->qb->set_limit((int) $_POST['rows']); |
|
155 | + $offset = ((int) $_POST['page'] - 1) * (int) $_POST['rows']; |
|
156 | 156 | $this->qb->set_offset($offset); |
157 | 157 | } |
158 | 158 | } |
@@ -171,7 +171,8 @@ |
||
171 | 171 | //create reflector with linked object to get the right label |
172 | 172 | try { |
173 | 173 | $linked_object = midcom::get()->dbfactory->get_object_by_guid($entry->linkGuid); |
174 | - } catch (midcom_error $e) { |
|
174 | + } |
|
175 | + catch (midcom_error $e) { |
|
175 | 176 | unset($data['entries'][$i]); |
176 | 177 | $e->log(); |
177 | 178 | continue; |
@@ -30,8 +30,8 @@ |
||
30 | 30 | { |
31 | 31 | $classes = array(); |
32 | 32 | foreach (midcom_connection::get_schema_types() as $mgdschema) { |
33 | - if ( substr($mgdschema, 0, 2) == '__' |
|
34 | - || ( class_exists('midgard_reflector_object') |
|
33 | + if (substr($mgdschema, 0, 2) == '__' |
|
34 | + || (class_exists('midgard_reflector_object') |
|
35 | 35 | && !midgard_reflector_object::has_metadata_class($mgdschema))) { |
36 | 36 | continue; |
37 | 37 | } |