@@ -98,8 +98,8 @@ |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | // Check the Metadata if and only if we are configured to do so. |
101 | - if ( is_object($this->object) |
|
102 | - && ( midcom::get()->config->get('show_hidden_objects') == false |
|
101 | + if (is_object($this->object) |
|
102 | + && (midcom::get()->config->get('show_hidden_objects') == false |
|
103 | 103 | || midcom::get()->config->get('show_unapproved_objects') == false)) { |
104 | 104 | // Check Hiding, Scheduling and Approval |
105 | 105 | $metadata = $this->object->metadata; |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | public function is_readable_by($user_id) |
30 | 30 | { |
31 | - return ( empty($this->object) |
|
31 | + return (empty($this->object) |
|
32 | 32 | || !$this->guid |
33 | 33 | || !$user_id |
34 | 34 | || midcom::get()->auth->acl->can_do_byguid('midgard:read', $this->guid, $this->object->__midcom_class_name__, $user_id)); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | } |
182 | 182 | |
183 | 183 | // Set the status |
184 | - if ( $this->can_do('net.nehmer.comments:moderation') |
|
184 | + if ($this->can_do('net.nehmer.comments:moderation') |
|
185 | 185 | && !$this->_sudo_requested) { |
186 | 186 | $this->status = net_nehmer_comments_comment::ABUSE; |
187 | 187 | } else { |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | return false; |
206 | 206 | } |
207 | 207 | // Set the status |
208 | - if ( !$this->can_do('net.nehmer.comments:moderation') |
|
208 | + if (!$this->can_do('net.nehmer.comments:moderation') |
|
209 | 209 | || $this->_sudo_requested) { |
210 | 210 | return false; |
211 | 211 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | } |
230 | 230 | |
231 | 231 | // Set the status |
232 | - if ( !$this->can_do('net.nehmer.comments:moderation') |
|
232 | + if (!$this->can_do('net.nehmer.comments:moderation') |
|
233 | 233 | || $this->_sudo_requested) { |
234 | 234 | return false; |
235 | 235 | } |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | */ |
249 | 249 | public function report_not_abuse() |
250 | 250 | { |
251 | - if ( !$this->can_do('net.nehmer.comments:moderation') |
|
251 | + if (!$this->can_do('net.nehmer.comments:moderation') |
|
252 | 252 | || $this->_sudo_requested) { |
253 | 253 | return false; |
254 | 254 | } |
@@ -351,8 +351,8 @@ discard block |
||
351 | 351 | { |
352 | 352 | $config = midcom_baseclasses_components_configuration::get('net.nehmer.comments', 'config'); |
353 | 353 | |
354 | - if ( $config->get('ratings_enable') |
|
355 | - && ( $config->get('ratings_cache_to_object') |
|
354 | + if ($config->get('ratings_enable') |
|
355 | + && ($config->get('ratings_cache_to_object') |
|
356 | 356 | || $config->get('comment_count_cache_to_object'))) { |
357 | 357 | // Handle ratings |
358 | 358 | $comments = net_nehmer_comments_comment::list_by_objectguid($this->objectguid); |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | return false; |
414 | 414 | } |
415 | 415 | |
416 | - if ( empty($this->title) |
|
416 | + if (empty($this->title) |
|
417 | 417 | && empty($this->content)) { |
418 | 418 | // No need to send notifications about empty rating entries |
419 | 419 | return false; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $tagstring = self::resolve_tagname($tagname); |
69 | 69 | $tag = net_nemein_tag_tag_dba::get_by_tag($tagstring); |
70 | 70 | if (!$tag) { |
71 | - $tag = new net_nemein_tag_tag_dba(); |
|
71 | + $tag = new net_nemein_tag_tag_dba(); |
|
72 | 72 | $tag->tag = $tagstring; |
73 | 73 | $tag->url = $url; |
74 | 74 | if (!$tag->create()) { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | return; |
78 | 78 | } |
79 | 79 | } |
80 | - $link = new net_nemein_tag_link_dba(); |
|
80 | + $link = new net_nemein_tag_link_dba(); |
|
81 | 81 | $link->tag = $tag->id; |
82 | 82 | $link->context = self::resolve_context($tagname); |
83 | 83 | $link->value = self::resolve_value($tagname); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | */ |
190 | 190 | public function copy_tags($from, $to, $component = null) |
191 | 191 | { |
192 | - if ( !is_object($from) |
|
192 | + if (!is_object($from) |
|
193 | 193 | || !is_object($to)) { |
194 | 194 | return false; |
195 | 195 | } |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | $quote_open = false; |
494 | 494 | for ($i = 0; $i < (strlen($tags_string) + 1); $i++) { |
495 | 495 | $char = substr($tags_string, $i, 1); |
496 | - if ( ( $char == ' ' |
|
496 | + if (($char == ' ' |
|
497 | 497 | && !$quote_open) |
498 | 498 | || $i == strlen($tags_string)) { |
499 | 499 | $tags[] = $current_tag; |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | $quote_open = false; |
505 | 505 | continue; |
506 | 506 | } |
507 | - if ( $char === '"' |
|
507 | + if ($char === '"' |
|
508 | 508 | || $char === "'") { |
509 | 509 | $quote_open = $char; |
510 | 510 | continue; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $event = new org_openpsa_calendar_event_dba($this->eid); |
67 | 67 | } |
68 | 68 | |
69 | - if ( $recipient->id == midcom_connection::get_user() |
|
69 | + if ($recipient->id == midcom_connection::get_user() |
|
70 | 70 | && !$event->send_notify_me) { |
71 | 71 | //Do not send notification to current user |
72 | 72 | debug_add('event->send_notify_me is false and recipient is current user, aborting notify'); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | return false; |
112 | 112 | } |
113 | 113 | |
114 | - if ( $type == 'cancel' |
|
114 | + if ($type == 'cancel' |
|
115 | 115 | || $type == 'remove') { |
116 | 116 | // TODO: Create iCal export with correct delete commands |
117 | 117 | } else { |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | while ($stamp <= $end) { |
186 | 186 | $ymd = date('Ymd', $stamp); |
187 | 187 | debug_add("making sure date {$ymd} has at least one event"); |
188 | - $stamp = mktime(0, 0, 1, date('m', $stamp), date('d', $stamp)+1, date('Y', $stamp)); |
|
188 | + $stamp = mktime(0, 0, 1, date('m', $stamp), date('d', $stamp) + 1, date('Y', $stamp)); |
|
189 | 189 | if (array_key_exists($ymd, $events_by_date)) { |
190 | 190 | continue; |
191 | 191 | } |
@@ -202,12 +202,12 @@ discard block |
||
202 | 202 | $workday_starts = 8; |
203 | 203 | $workday_ends = 16; |
204 | 204 | |
205 | - $workday_starts_ts = mktime($workday_starts, 0, 0, (int)$ymd_matches[2], (int)$ymd_matches[3], (int)$ymd_matches[1]); |
|
206 | - $workday_ends_ts = mktime($workday_ends, 0, 0, (int)$ymd_matches[2], (int)$ymd_matches[3], (int)$ymd_matches[1]); |
|
205 | + $workday_starts_ts = mktime($workday_starts, 0, 0, (int) $ymd_matches[2], (int) $ymd_matches[3], (int) $ymd_matches[1]); |
|
206 | + $workday_ends_ts = mktime($workday_ends, 0, 0, (int) $ymd_matches[2], (int) $ymd_matches[3], (int) $ymd_matches[1]); |
|
207 | 207 | $last_end_time = false; |
208 | 208 | $last_event = false; |
209 | 209 | foreach ($events as $event) { |
210 | - if ( $event->end <= $workday_starts_ts |
|
210 | + if ($event->end <= $workday_starts_ts |
|
211 | 211 | || $event->start >= $workday_ends_ts) { |
212 | 212 | // We need not to consider this event, it is outside the defined workday |
213 | 213 | continue; |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | if ($last_end_time === false) { |
239 | 239 | $last_end_time = $workday_starts_ts; |
240 | 240 | } |
241 | - if ( $last_end_time < $workday_ends_ts |
|
241 | + if ($last_end_time < $workday_ends_ts |
|
242 | 242 | && (($workday_ends_ts - $last_end_time) >= $amount)) { |
243 | 243 | $slots[] = self::_create_slot($last_end_time, $workday_ends_ts, $last_event); |
244 | 244 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | |
40 | 40 | public function resolve_object_link(midcom_db_topic $topic, midcom_core_dbaobject $object) |
41 | 41 | { |
42 | - if ( $object instanceof org_openpsa_documents_document_dba |
|
42 | + if ($object instanceof org_openpsa_documents_document_dba |
|
43 | 43 | && $object->topic == $topic->id) { |
44 | 44 | return "document/{$object->guid}/"; |
45 | 45 | } |
@@ -107,7 +107,7 @@ |
||
107 | 107 | $qb->add_constraint('id', '<>', $this->id); |
108 | 108 | } |
109 | 109 | // Make sure the product is in the same product group |
110 | - $qb->add_constraint('productGroup', '=', (int)$this->productGroup); |
|
110 | + $qb->add_constraint('productGroup', '=', (int) $this->productGroup); |
|
111 | 111 | |
112 | 112 | return ($qb->count() == 0); |
113 | 113 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | { |
171 | 171 | debug_add("task->start() called with user #" . midcom_connection::get_user()); |
172 | 172 | //PONDER: Check actual status objects for more accurate logic ? |
173 | - if ( $task->status >= org_openpsa_projects_task_status_dba::STARTED |
|
173 | + if ($task->status >= org_openpsa_projects_task_status_dba::STARTED |
|
174 | 174 | && $task->status <= org_openpsa_projects_task_status_dba::APPROVED) { |
175 | 175 | //We already have started status |
176 | 176 | debug_add('Task has already been started'); |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | |
383 | 383 | private static function is_manager($task) |
384 | 384 | { |
385 | - return ( $task->manager == 0 |
|
385 | + return ($task->manager == 0 |
|
386 | 386 | || midcom_connection::get_user() == $task->manager); |
387 | 387 | } |
388 | 388 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | public function _on_updated() |
94 | 94 | { |
95 | 95 | // Sync the object's ACL properties into MidCOM ACL system |
96 | - if ( !$this->_skip_acl_refresh) { |
|
96 | + if (!$this->_skip_acl_refresh) { |
|
97 | 97 | if ($this->orgOpenpsaAccesstype && $this->orgOpenpsaOwnerWg) { |
98 | 98 | debug_add("Synchronizing task ACLs to MidCOM"); |
99 | 99 | $sync = new org_openpsa_core_acl_synchronizer(); |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | |
327 | 327 | if ($report_data['invoice']) { |
328 | 328 | $hours['invoiced'] += $report_hours; |
329 | - } elseif ( $report_data['invoiceable'] |
|
329 | + } elseif ($report_data['invoiceable'] |
|
330 | 330 | && ($report_data['isapproved'] || !$invoice_approved_only)) { |
331 | 331 | $hours['invoiceable'] += $report_hours; |
332 | 332 | } |