@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | $schemadb[$schema]->fields[$key]['title'] = $schemadb[$schema]->l10n_schema->get($schemadb[$schema]->fields[$key]['title']); |
115 | 115 | } |
116 | 116 | |
117 | - if ( !isset($this->_request_data['config']->_local[$key]) |
|
117 | + if (!isset($this->_request_data['config']->_local[$key]) |
|
118 | 118 | || $this->_request_data['config']->_local[$key] == $this->_request_data['config']->_global[$key]) { |
119 | 119 | // No local configuration setting, note to user that this is the global value |
120 | 120 | $schemadb[$schema]->fields[$key]['title'] = $schemadb[$schema]->l10n_schema->get($schemadb[$schema]->fields[$key]['title']); |
121 | - $schemadb[$schema]->fields[$key]['title'] .= " <span class=\"global\">(" . $this->_l10n->get('global value') .")</span>"; |
|
121 | + $schemadb[$schema]->fields[$key]['title'] .= " <span class=\"global\">(" . $this->_l10n->get('global value') . ")</span>"; |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | } |
307 | 307 | |
308 | 308 | foreach ($config as $key => $value) { |
309 | - if ( is_array($value) |
|
309 | + if (is_array($value) |
|
310 | 310 | || is_object($value)) { |
311 | 311 | /** |
312 | 312 | * See http://trac.midgard-project.org/ticket/1442 |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | $newval = $post[$key]; |
328 | 328 | } |
329 | 329 | |
330 | - if ( is_a($this->_controller->datamanager->types[$key], 'midcom_helper_datamanager2_type_select') |
|
330 | + if (is_a($this->_controller->datamanager->types[$key], 'midcom_helper_datamanager2_type_select') |
|
331 | 331 | || is_a($this->_controller->datamanager->types[$key], 'midcom_helper_datamanager2_type_boolean')) { |
332 | 332 | // We want the actual values regardless of widget |
333 | 333 | $newval = $this->_controller->datamanager->types[$key]->convert_to_storage(); |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | if (is_object($id)) { |
86 | 86 | $this->__object = midcom::get()->dbfactory->convert_midcom_to_midgard($id); |
87 | 87 | } else { |
88 | - if ( is_string($id) |
|
88 | + if (is_string($id) |
|
89 | 89 | && strlen($id) == 1) { |
90 | 90 | debug_add('Constructing ' . $this->__mgdschema_class_name__ . ' object ' . $id . ' with ID typecast to string. Changing typecast.', MIDCOM_LOG_INFO); |
91 | 91 | $id = (int) $id; |
92 | 92 | } |
93 | - if ( is_int($id) |
|
93 | + if (is_int($id) |
|
94 | 94 | && $id < 1) { |
95 | 95 | throw new midcom_error($id . ' is not a valid database ID'); |
96 | 96 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | //Some useful information for performance tuning |
107 | - if ( midcom::get()->config->get('log_level') >= MIDCOM_LOG_DEBUG |
|
107 | + if (midcom::get()->config->get('log_level') >= MIDCOM_LOG_DEBUG |
|
108 | 108 | && $this->__object->guid) { |
109 | 109 | static $guids = array(); |
110 | 110 | static $total = 0; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
129 | - if ( $this->__object->guid |
|
129 | + if ($this->__object->guid |
|
130 | 130 | && mgd_is_guid($this->__object->guid)) { |
131 | 131 | midcom_baseclasses_core_dbobject::post_db_load_checks($this); |
132 | 132 | } |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | } |
679 | 679 | public function enable_rcs() |
680 | 680 | { |
681 | - $this->_use_rcs = true; |
|
681 | + $this->_use_rcs = true; |
|
682 | 682 | } |
683 | 683 | public function set_rcs_message($msg) |
684 | 684 | { |
@@ -378,7 +378,7 @@ |
||
378 | 378 | // repositories are "merged" manually |
379 | 379 | $directories = array(); |
380 | 380 | $manifests = array(); |
381 | - exec('find ' . MIDCOM_ROOT . ' ' . dirname(MIDCOM_ROOT) . '/src -follow -type d -name "config"', $directories); |
|
381 | + exec('find ' . MIDCOM_ROOT . ' ' . dirname(MIDCOM_ROOT) . '/src -follow -type d -name "config"', $directories); |
|
382 | 382 | foreach ($directories as $directory) { |
383 | 383 | $candidates[] = "{$directory}/manifest.inc"; |
384 | 384 | } |
@@ -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; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | { |
39 | 39 | $this->load_comment($args[0], false); |
40 | 40 | $moderators = $this->_config->get('moderators'); |
41 | - if ( $this->_comment->report_abuse() |
|
41 | + if ($this->_comment->report_abuse() |
|
42 | 42 | && $moderators) { |
43 | 43 | // Prepare notification message |
44 | 44 | $message = array(); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $message['content'] = ''; |
47 | 47 | $logs = $this->_comment->get_logs(); |
48 | 48 | if (count($logs) > 0) { |
49 | - $message['content'] .= $this->_l10n->get('moderation history').":\n\n"; |
|
49 | + $message['content'] .= $this->_l10n->get('moderation history') . ":\n\n"; |
|
50 | 50 | foreach ($logs as $time => $log) { |
51 | 51 | $reported = $this->_l10n->get_formatter()->datetime(strtotime("{$time}Z")); |
52 | 52 | $message['content'] .= $this->_l10n->get(sprintf('%s: %s by %s (from %s)', "$reported:\n", $this->_l10n->get($log['action']), $log['reporter'], $log['ip'])) . "\n\n"; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $this->_comment = new net_nehmer_comments_comment($identifier); |
120 | 120 | |
121 | 121 | if (!$this->_comment->can_do('midgard:update')) { |
122 | - $this->_comment->_sudo_requested = midcom::get()->auth->request_sudo('net.nehmer.comments');; |
|
122 | + $this->_comment->_sudo_requested = midcom::get()->auth->request_sudo('net.nehmer.comments'); ; |
|
123 | 123 | } |
124 | 124 | if ($require_moderation_privilege) { |
125 | 125 | $this->_comment->require_do('net.nehmer.comments:moderation'); |
@@ -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; |
@@ -133,7 +133,7 @@ |
||
133 | 133 | } |
134 | 134 | } |
135 | 135 | |
136 | - if ( is_null($position['longitude']) |
|
136 | + if (is_null($position['longitude']) |
|
137 | 137 | || is_null($position['latitude'])) { |
138 | 138 | // Not enough information for positioning, we need both lon and lat |
139 | 139 | return false; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | } |
126 | 126 | // TODO: Shared tasks need a separate check (different member object) |
127 | 127 | |
128 | - if ( !empty($this->busy_members) |
|
128 | + if (!empty($this->busy_members) |
|
129 | 129 | || !empty($this->busy_resources)) { |
130 | 130 | //Unresolved conflicts (note return value is for conflicts not lack of them) |
131 | 131 | midcom::get()->auth->drop_sudo(); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | //These events have been robbed of (some of) their resources |
139 | 139 | $creator = midcom_db_person::get_cached($event->metadata->creator); |
140 | 140 | $other_participants = array_diff_key($event->participants, array($creator->id => true)); |
141 | - if ( count($other_participants) == 0 |
|
141 | + if (count($other_participants) == 0 |
|
142 | 142 | && count($event->resources) == 0) { |
143 | 143 | /* If modified event has no-one or only creator as participant and no resources |
144 | 144 | then delete it (as it's unlikely the stub event is useful anymore) */ |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | } |
190 | 190 | |
191 | 191 | if (array_key_exists($member->event, $modified_events)) { |
192 | - $event =& $modified_events[$member->event]; |
|
192 | + $event = & $modified_events[$member->event]; |
|
193 | 193 | $set_as_modified = false; |
194 | 194 | } else { |
195 | 195 | try { |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | } |
204 | 204 | debug_add("overlap found in event {$event->title} (#{$event->id})"); |
205 | 205 | |
206 | - if ( $event->tentative |
|
206 | + if ($event->tentative |
|
207 | 207 | && $rob_tentative) { |
208 | 208 | debug_add('event is tentative, robbing resources'); |
209 | 209 | $event->resources = array_diff_key($event->resources, $this->_event->resources); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | } |
231 | 231 | debug_add("overlap found in event {$event->title} (#{$event->id})"); |
232 | 232 | |
233 | - if ( $event->tentative |
|
233 | + if ($event->tentative |
|
234 | 234 | && $rob_tentative) { |
235 | 235 | debug_add('event is tentative, robbing participants'); |
236 | 236 | $event->participants = array_diff_key($event->participants, $this->_event->participants); |
@@ -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 | } |