Completed
Push — 16.1 ( 7ccc73...046888 )
by Nathan
64:46 queued 51:15
created
calendar/inc/class.calendar_wizard_export_csv.inc.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,8 @@  discard block
 block discarded – undo
13 13
 
14 14
 class calendar_wizard_export_csv extends importexport_wizard_basic_export_csv
15 15
 {
16
-	public function __construct() {
16
+	public function __construct()
17
+	{
17 18
 		parent::__construct();
18 19
 		// Field mapping
19 20
 		$bo = new calendar_tracking();
@@ -24,7 +25,8 @@  discard block
 block discarded – undo
24 25
 		unset($this->export_fields['participants-r']);
25 26
 
26 27
 		$custom = Api\Storage\Customfields::get('calendar', true);
27
-		foreach($custom as $name => $data) {
28
+		foreach($custom as $name => $data)
29
+		{
28 30
 			$this->export_fields['#'.$name] = $data['label'];
29 31
 		}
30 32
 	}
Please login to merge, or discard this patch.
calendar/inc/class.calendar_uiviews.inc.php 1 patch
Braces   +69 added lines, -21 removed lines patch added patch discarded remove patch
@@ -179,7 +179,10 @@  discard block
 block discarded – undo
179 179
 	 */
180 180
 	public function week_number($time)
181 181
 	{
182
-		if (!is_a($time,'DateTime')) $time = new Api\DateTime($time);
182
+		if (!is_a($time,'DateTime'))
183
+		{
184
+			$time = new Api\DateTime($time);
185
+		}
183 186
 
184 187
 		// if week does not start Monday and $time is Sunday --> add one day
185 188
 		if ($this->cal_prefs['weekdaystarts'] != 'Monday' && !($wday = $time->format('w')))
@@ -237,7 +240,8 @@  discard block
 block discarded – undo
237 240
 		$tmpl = new Etemplate('calendar.toolbar');
238 241
 		$tmpl->setElementAttribute('toolbar', 'actions', $this->getToolbarActions($content));
239 242
 		// Adjust toolbar for mobile
240
-		if(Api\Header\UserAgent::mobile()){
243
+		if(Api\Header\UserAgent::mobile())
244
+		{
241 245
 			$tmpl->setElementAttribute('toolbar','class', 'et2_head_toolbar');
242 246
 			$tmpl->setElementAttribute('toolbar','view_range', '3');
243 247
 		}
@@ -396,10 +400,12 @@  discard block
 block discarded – undo
396 400
 		{
397 401
 			foreach (array_keys($actions) as $key)
398 402
 			{
399
-				if (!in_array($key, array('day_view','week_view','next', 'today','previous'))) {
403
+				if (!in_array($key, array('day_view','week_view','next', 'today','previous')))
404
+				{
400 405
 					$actions[$key]['toolbarDefault'] = false;
401 406
 				}
402
-				else {
407
+				else
408
+				{
403 409
 					$actions[$key]['toolbarDefault'] = true;
404 410
 				}
405 411
 			}
@@ -416,29 +422,38 @@  discard block
 block discarded – undo
416 422
 	 */
417 423
 	function &planner($content = array(), $home=false)
418 424
 	{
419
-		if ($this->sortby == 'month')	// yearly planner with month rows
425
+		if ($this->sortby == 'month')
426
+		{
427
+			// yearly planner with month rows
420 428
 		{
421 429
 			$this->first = $this->bo->date2array($this->date);
430
+		}
422 431
 			$this->first['day'] = 1;
423 432
 			unset($this->first['raw']);
424 433
 			$this->last = $this->first;
425 434
 			$this->last['year']++;
426 435
 			$this->last = $this->bo->date2ts($this->last)-1;
427 436
 		}
428
-		elseif (!$this->planner_view || $this->planner_view == 'month')	// planner monthview
437
+		elseif (!$this->planner_view || $this->planner_view == 'month')
438
+		{
439
+			// planner monthview
429 440
 		{
430 441
 			if ($this->day < 15)	// show one complete month
431 442
 			{
432 443
 				$this->_week_align_month($this->first,$this->last);
444
+		}
433 445
 			}
434 446
 			else	// show 2 half month
435 447
 			{
436 448
 				$this->_week_align_month($this->first,$this->last,15);
437 449
 			}
438 450
 		}
439
-		elseif ($this->planner_view == 'week' || $this->planner_view == 'weekN')	// weeekview
451
+		elseif ($this->planner_view == 'week' || $this->planner_view == 'weekN')
452
+		{
453
+			// weeekview
440 454
 		{
441 455
 			$start = new Api\DateTime($this->date);
456
+		}
442 457
 			$start->setWeekstart();
443 458
 			$this->first = $start->format('ts');
444 459
 			$this->last = $this->bo->date2array($this->first);
@@ -477,7 +492,10 @@  discard block
 block discarded – undo
477 492
 			$this->to_client($event);
478 493
 		}
479 494
 
480
-		if ($this->debug > 0) $this->bo->debug_message('uiviews::planner() date=%1: first=%2, last=%3',False,$this->date,$this->bo->date2string($this->first),$this->bo->date2string($this->last));
495
+		if ($this->debug > 0)
496
+		{
497
+			$this->bo->debug_message('uiviews::planner() date=%1: first=%2, last=%3',False,$this->date,$this->bo->date2string($this->first),$this->bo->date2string($this->last));
498
+		}
481 499
 
482 500
 		$tmpl = $home ? $home : new Etemplate('calendar.planner');
483 501
 
@@ -501,7 +519,10 @@  discard block
 block discarded – undo
501 519
 	 */
502 520
 	function &month($weeks=0,$home=false)
503 521
 	{
504
-		if ($this->debug > 0) $this->bo->debug_message('uiviews::month(weeks=%1) date=%2',True,$weeks,$this->date);
522
+		if ($this->debug > 0)
523
+		{
524
+			$this->bo->debug_message('uiviews::month(weeks=%1) date=%2',True,$weeks,$this->date);
525
+		}
505 526
 
506 527
 		if (!$home)
507 528
 		{
@@ -543,7 +564,10 @@  discard block
 block discarded – undo
543 564
 			$weekNavH = "1 month";
544 565
 			$navHeader = lang(adodb_date('F',$this->bo->date2ts($this->date))).' '.$this->year;
545 566
 		}
546
-		if ($this->debug > 0) $this->bo->debug_message('uiviews::month(%1) date=%2: first=%3, last=%4',False,$weeks,$this->date,$this->bo->date2string($this->first),$this->bo->date2string($this->last));
567
+		if ($this->debug > 0)
568
+		{
569
+			$this->bo->debug_message('uiviews::month(%1) date=%2: first=%3, last=%4',False,$weeks,$this->date,$this->bo->date2string($this->first),$this->bo->date2string($this->last));
570
+		}
547 571
 
548 572
 		// Loop through, using Api\DateTime to handle DST
549 573
 		$week = 0;
@@ -588,7 +612,10 @@  discard block
 block discarded – undo
588 612
 		$start->setWeekstart();
589 613
 		$first = $start->format('ts');
590 614
 		$start->setDate($this->year,$this->month+1,$day);
591
-		if ($day == 1) $start->add('-1day');
615
+		if ($day == 1)
616
+		{
617
+			$start->add('-1day');
618
+		}
592 619
 		$start->setWeekstart();
593 620
 		// now we need to calculate the end of the last day of that week
594 621
 		// as simple $last += WEEK_s - 1; does NOT work, if daylight saving changes in that week!!!
@@ -611,19 +638,31 @@  discard block
 block discarded – undo
611 638
 		if (!$days)
612 639
 		{
613 640
 			$days = isset($_GET['days']) ? $_GET['days'] : $this->cal_prefs['days_in_weekview'];
614
-			if ($days != 5) $days = 7;
615
-			if ($days != $this->cal_prefs['days_in_weekview'])	// save the preference
641
+			if ($days != 5)
642
+			{
643
+				$days = 7;
644
+			}
645
+			if ($days != $this->cal_prefs['days_in_weekview'])
646
+			{
647
+				// save the preference
616 648
 			{
617 649
 				$GLOBALS['egw']->preferences->add('calendar','days_in_weekview',$days);
650
+			}
618 651
 				$GLOBALS['egw']->preferences->save_repository();
619 652
 				$this->cal_prefs['days_in_weekview'] = $days;
620 653
 			}
621 654
 		}
622
-		if ($this->debug > 0) $this->bo->debug_message('uiviews::week(days=%1) date=%2',True,$days,$this->date);
655
+		if ($this->debug > 0)
656
+		{
657
+			$this->bo->debug_message('uiviews::week(days=%1) date=%2',True,$days,$this->date);
658
+		}
623 659
 
624
-		if ($days <= 4)		// next 4 days view
660
+		if ($days <= 4)
661
+		{
662
+			// next 4 days view
625 663
 		{
626 664
 			$wd_start = $this->first = $this->bo->date2ts($this->date);
665
+		}
627 666
 			$this->last = strtotime("+$days days",$this->first) - 1;
628 667
 			$view = $days == 1 ? 'day' : 'day4';
629 668
 		}
@@ -632,12 +671,15 @@  discard block
 block discarded – undo
632 671
 			$start = new Api\DateTime($this->date);
633 672
 			$start->setWeekstart();
634 673
 			$wd_start = $this->first = $start->format('ts');
635
-			if ($days <= 5)		// no weekend-days
674
+			if ($days <= 5)
675
+			{
676
+				// no weekend-days
636 677
 			{
637 678
 				switch($this->cal_prefs['weekdaystarts'])
638 679
 				{
639 680
 					case 'Saturday':
640 681
 						$this->first = strtotime("+2 days",$this->first);
682
+			}
641 683
 						break;
642 684
 					case 'Sunday':
643 685
 						$this->first = strtotime("+1 day",$this->first);
@@ -666,7 +708,10 @@  discard block
 block discarded – undo
666 708
 			) + $this->search_params;
667 709
 
668 710
 		$users = $this->search_params['users'];
669
-		if (!is_array($users)) $users = array($users);
711
+		if (!is_array($users))
712
+		{
713
+			$users = array($users);
714
+		}
670 715
 
671 716
 		$content = array('view' => array());
672 717
 
@@ -689,8 +734,7 @@  discard block
 block discarded – undo
689 734
 			$this->last = ($days == 4 ? $this->last : $search_params['end'] = strtotime("+$days days",$this->first) - 1);
690 735
 			if (count($users) == 1 || count($users) >= $this->cal_prefs['week_consolidate']	||// for more then X users, show all in one row
691 736
 				$days == 1 // Showing just 1 day
692
-			)
693
-			{
737
+			) {
694 738
 				$content['view'][] = (array)$this->tagWholeDayOnTop($this->bo->search($search_params)) +
695 739
 					array('owner' => $users);
696 740
 			}
@@ -793,7 +837,8 @@  discard block
 block discarded – undo
793 837
 						}
794 838
 						$todo['icons'] = $icons;
795 839
 						$class = $class == 'row_on' ? 'row_off' : 'row_on';
796
-						if($todo['edit']) {
840
+						if($todo['edit'])
841
+						{
797 842
 							$todo['edit_size'] = $todo['edit']['size'];
798 843
 							unset($todo['edit']['size']);
799 844
 							$edit_icon_href = Api\Html::a_href( $icons, $todo['edit'],'',' data-todo="app|750x590" ');
@@ -914,7 +959,10 @@  discard block
 block discarded – undo
914 959
 		// This disables the event actions for the grid rows (calendar weeks/owners)
915 960
 		foreach($actions as $id => &$action)
916 961
 		{
917
-			if($id=='add') continue;
962
+			if($id=='add')
963
+			{
964
+				continue;
965
+			}
918 966
 			if(!$action['enabled'])
919 967
 			{
920 968
 				$action['enabled'] = 'javaScript:app.calendar.is_event';
Please login to merge, or discard this patch.
calendar/inc/class.calendar_rrule.inc.php 1 patch
Braces   +58 added lines, -14 removed lines patch added patch discarded remove patch
@@ -338,7 +338,10 @@  discard block
 block discarded – undo
338 338
 				$duration = 366*24*3600;
339 339
 				break;
340 340
 		}
341
-		if ($interval > 1) $duration *= $interval;
341
+		if ($interval > 1)
342
+		{
343
+			$duration *= $interval;
344
+		}
342 345
 
343 346
 		return $duration;
344 347
 	}
@@ -481,7 +484,10 @@  discard block
 block discarded – undo
481 484
 		{
482 485
 			return clone $this->time;
483 486
 		}
484
-		if (isset($this->current)) $backup = $this->current;
487
+		if (isset($this->current))
488
+		{
489
+			$backup = $this->current;
490
+		}
485 491
 		$this->rewind();
486 492
 
487 493
 		while(--$count > 0)
@@ -489,7 +495,10 @@  discard block
 block discarded – undo
489 495
 			$this->next_no_exception();
490 496
 		}
491 497
 		$ret = clone $this->current;
492
-		if ($backup) $this->current = $backup;
498
+		if ($backup)
499
+		{
500
+			$this->current = $backup;
501
+		}
493 502
 		return $ret;
494 503
 	}
495 504
 
@@ -631,7 +640,11 @@  discard block
 block discarded – undo
631 640
 		$repeat_days = array();
632 641
 		$rrule = array();
633 642
 
634
-		if ($this->type == self::NONE) return false;	// no recuring event
643
+		if ($this->type == self::NONE)
644
+		{
645
+			return false;
646
+		}
647
+		// no recuring event
635 648
 
636 649
 		if ($version == '1.0')
637 650
 		{
@@ -725,8 +738,14 @@  discard block
 block discarded – undo
725 738
 	 */
726 739
 	public static function event2rrule(array $event,$usertime=true,$to_tz=null)
727 740
 	{
728
-		if (!is_array($event)  || !isset($event['tzid'])) return false;
729
-		if (!$to_tz) $to_tz = $event['tzid'];
741
+		if (!is_array($event)  || !isset($event['tzid']))
742
+		{
743
+			return false;
744
+		}
745
+		if (!$to_tz)
746
+		{
747
+			$to_tz = $event['tzid'];
748
+		}
730 749
 		$timestamp_tz = $usertime ? Api\DateTime::$user_timezone : Api\DateTime::$server_timezone;
731 750
 		$time = is_a($event['start'],'DateTime') ? $event['start'] : new Api\DateTime($event['start'],$timestamp_tz);
732 751
 
@@ -786,7 +805,10 @@  discard block
 block discarded – undo
786 805
 			$event['recur_type'] == self::NONE ||
787 806
 			empty($event['recur_data']) || $event['recur_data'] == ALLDAYS ||
788 807
 			empty($event['tzid']) || empty($to_tz) ||
789
-			$event['tzid'] == $to_tz) return;
808
+			$event['tzid'] == $to_tz)
809
+		{
810
+			return;
811
+		}
790 812
 
791 813
 		if (!isset(self::$tz_cache[$event['tzid']]))
792 814
 		{
@@ -815,11 +837,19 @@  discard block
 block discarded – undo
815 837
 					if ($delta == 1 || $delta == -6)
816 838
 					{
817 839
 						$mask = $mask << 1;
818
-						if ($mask & 128) $mask = $mask - 127; // overflow
840
+						if ($mask & 128)
841
+						{
842
+							$mask = $mask - 127;
843
+						}
844
+						// overflow
819 845
 					}
820 846
 					else
821 847
 					{
822
-						if ($mask & 1) $mask = $mask + 128; // underflow
848
+						if ($mask & 1)
849
+						{
850
+							$mask = $mask + 128;
851
+						}
852
+						// underflow
823 853
 						$mask = $mask >> 1;
824 854
 					}
825 855
 					$event['recur_data'] = $mask;
@@ -828,11 +858,16 @@  discard block
 block discarded – undo
828 858
 	}
829 859
 }
830 860
 
831
-if (isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__)	// some tests
861
+if (isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__)
862
+{
863
+	// some tests
832 864
 {
833 865
 	ini_set('display_errors',1);
866
+}
834 867
 	error_reporting(E_ALL & ~E_NOTICE);
835
-	function lang($str) { return $str; }
868
+	function lang($str)
869
+	{
870
+return $str; }
836 871
 	$GLOBALS['egw_info']['user']['preferences']['common']['tz'] = $_REQUEST['user-tz'] ? $_REQUEST['user-tz'] : 'Europe/Berlin';
837 872
 	require_once('../../api/src/autoload.php');
838 873
 
@@ -863,9 +898,18 @@  discard block
 block discarded – undo
863 898
 
864 899
 	$tz = new DateTimeZone($_REQUEST['tz']);
865 900
 	$time = new Api\DateTime($_REQUEST['time'],$tz);
866
-	if ($_REQUEST['enddate']) $enddate = new Api\DateTime($_REQUEST['enddate'],$tz);
867
-	$weekdays = 0; foreach((array)$_REQUEST['weekdays'] as $mask) { $weekdays |= $mask; }
868
-	if ($_REQUEST['exceptions']) foreach(preg_split("/[,\r\n]+ ?/",$_REQUEST['exceptions']) as $exception) { $exceptions[] = new Api\DateTime($exception); }
901
+	if ($_REQUEST['enddate'])
902
+	{
903
+		$enddate = new Api\DateTime($_REQUEST['enddate'],$tz);
904
+	}
905
+	$weekdays = 0; foreach((array)$_REQUEST['weekdays'] as $mask)
906
+	{
907
+$weekdays |= $mask; }
908
+	if ($_REQUEST['exceptions'])
909
+	{
910
+		foreach(preg_split("/[,\r\n]+ ?/",$_REQUEST['exceptions']) as $exception) { $exceptions[] = new Api\DateTime($exception);
911
+	}
912
+	}
869 913
 
870 914
 	$rrule = new calendar_rrule($time,$_REQUEST['type'],$_REQUEST['interval'],$enddate,$weekdays,$exceptions);
871 915
 	echo "<h3>".$time->format('l').', '.$time.' ('.$tz->getName().') '.$rrule."</h3>\n";
Please login to merge, or discard this patch.
calendar/inc/class.calendar_wizard_import_csv.inc.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,8 @@
 block discarded – undo
33 33
 		// List each custom field
34 34
 		unset($this->mapping_fields['customfields']);
35 35
 		$custom = Api\Storage\Customfields::get('calendar');
36
-		foreach($custom as $name => $data) {
36
+		foreach($custom as $name => $data)
37
+		{
37 38
 			$this->mapping_fields['#'.$name] = $data['label'];
38 39
 		}
39 40
 
Please login to merge, or discard this patch.
calendar/inc/class.calendar_hooks.inc.php 1 patch
Braces   +25 added lines, -6 removed lines patch added patch discarded remove patch
@@ -100,9 +100,12 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	static function settings($hook_data)
102 102
 	{
103
-		if (!$hook_data['setup'])	// does not work on setup time
103
+		if (!$hook_data['setup'])
104
+		{
105
+			// does not work on setup time
104 106
 		{
105 107
 			$bo = new calendar_bo();
108
+		}
106 109
 			$bo->check_set_default_prefs();
107 110
 		}
108 111
 		$yesno = array(
@@ -195,9 +198,12 @@  discard block
 block discarded – undo
195 198
 			1		=> lang('Yes'),
196 199
 			2		=> lang('With credentials included'),
197 200
 		);
198
-		if (!$hook_data['setup'])	// does not work at setup time
201
+		if (!$hook_data['setup'])
202
+		{
203
+			// does not work at setup time
199 204
 		{
200 205
 			$options = array('0' => lang('none'));
206
+		}
201 207
 			foreach($GLOBALS['egw']->accounts->search(array('type' => 'owngroups','app' => 'calendar')) as $group)
202 208
 			{
203 209
 				$options[$group['account_id']] = Api\Accounts::username($group['account_id']);
@@ -388,9 +394,12 @@  discard block
 block discarded – undo
388 394
 				'default' => '',
389 395
 			),
390 396
 		);
391
-		if (isset($bo))	// add custom time-spans set by CalDAV clients, not in our prefs
397
+		if (isset($bo))
398
+		{
399
+			// add custom time-spans set by CalDAV clients, not in our prefs
392 400
 		{
393 401
 			$prefs = $GLOBALS['egw_info']['user']['preferences']['calendar'];
402
+		}
394 403
 			$data = array(
395 404
 				'prefs' => &$prefs,	// use reference to get preference value back
396 405
 				'preprocess' => true,
@@ -689,7 +698,10 @@  discard block
 block discarded – undo
689 698
 	{
690 699
 		//error_log(__METHOD__."(".array2string($data).")");
691 700
 		// caldav perfs are always user specific and cant by switched off
692
-		if ($data['type'] != 'user') return;
701
+		if ($data['type'] != 'user')
702
+		{
703
+			return;
704
+		}
693 705
 
694 706
 		$account_lid = $GLOBALS['egw_info']['user']['account_lid'];
695 707
 		foreach(array(
@@ -698,16 +710,23 @@  discard block
 block discarded – undo
698 710
 		) as $name => $dav)
699 711
 		{
700 712
 			$pref =& $GLOBALS['egw_info']['user']['preferences']['groupdav'][$dav];
701
-			if (true) $pref = str_replace("\r", '', $pref);	// remove CR messing up multiline preg_match
713
+			if (true)
714
+			{
715
+				$pref = str_replace("\r", '', $pref);
716
+			}
717
+			// remove CR messing up multiline preg_match
702 718
 			$val =& $data['prefs'][$name];
703 719
 
704 720
 			//error_log(__METHOD__."() groupdav[$dav]=$pref, calendar[$name]=$val");
705 721
 
706
-			if ($data['preprocess'])	// showing preferences
722
+			if ($data['preprocess'])
723
+			{
724
+				// showing preferences
707 725
 			{
708 726
 				if (!isset($val))	// no calendar pref --> read value from caldav
709 727
 				{
710 728
 					$matches = null;
729
+			}
711 730
 					if (preg_match('/^ACTION:NONE$/mi', $pref))
712 731
 					{
713 732
 						$val = '';
Please login to merge, or discard this patch.
calendar/inc/class.calendar_timegrid_etemplate_widget.inc.php 1 patch
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,10 @@  discard block
 block discarded – undo
33 33
 	{
34 34
 		$form_name = self::form_name($cname, $this->id, $expand);
35 35
 		$value =& self::get_array(self::$request->content, $form_name, true);
36
-		if(!is_array($value)) $value = array();
36
+		if(!is_array($value))
37
+		{
38
+			$value = array();
39
+		}
37 40
 
38 41
 		foreach($value as &$events)
39 42
 		{
@@ -43,7 +46,10 @@  discard block
 block discarded – undo
43 46
 			}
44 47
 			foreach($events as &$event)
45 48
 			{
46
-				if(!is_array($event)) continue;
49
+				if(!is_array($event))
50
+				{
51
+					continue;
52
+				}
47 53
 				foreach(array('start','end') as $date)
48 54
 				{
49 55
 					$event[$date] = Api\DateTime::to($event[$date],'Y-m-d\TH:i:s\Z');
Please login to merge, or discard this patch.
calendar/inc/class.calendar_holidays.inc.php 1 patch
Braces   +32 added lines, -8 removed lines patch added patch discarded remove patch
@@ -41,7 +41,10 @@  discard block
 block discarded – undo
41 41
 	 */
42 42
 	public static function read($country, $year=null)
43 43
 	{
44
-		if (!$year) $year = (int)Api\DateTime::to('now', 'Y');
44
+		if (!$year)
45
+		{
46
+			$year = (int)Api\DateTime::to('now', 'Y');
47
+		}
45 48
 		$level = self::is_url($country) ? Api\Cache::INSTANCE : Api\Cache::TREE;
46 49
 
47 50
 		$holidays = Api\Cache::getCache($level, __CLASS__, $country.':'.$year);
@@ -68,7 +71,10 @@  discard block
 block discarded – undo
68 71
 	 */
69 72
 	public static function render($country, $year=null, $until_year=null)
70 73
 	{
71
-		if (!$year) $year = (int)Api\DateTime::to('now', 'Y');
74
+		if (!$year)
75
+		{
76
+			$year = (int)Api\DateTime::to('now', 'Y');
77
+		}
72 78
 		$end_year = $until_year && $year < $until_year ? $until_year : $year;
73 79
 
74 80
 		$starttime = microtime(true);
@@ -81,22 +87,40 @@  discard block
 block discarded – undo
81 87
 		{
82 88
 			$start = new Api\DateTime($event['start']);
83 89
 			$end = new Api\DateTime($event['end']);
84
-			if ($start->format('Y') > $end_year) continue;
85
-			if ($end->format('Y') < $year && !$event['recur_type']) continue;
90
+			if ($start->format('Y') > $end_year)
91
+			{
92
+				continue;
93
+			}
94
+			if ($end->format('Y') < $year && !$event['recur_type'])
95
+			{
96
+				continue;
97
+			}
86 98
 
87 99
 			// recuring events
88 100
 			if ($event['recur_type'])
89 101
 			{
90 102
 				// calendar_rrule limits no enddate, to 5 years
91
-				if (!$event['recur_enddate']) $event['recur_enddate'] = (1+$end_year).'0101';
103
+				if (!$event['recur_enddate'])
104
+				{
105
+					$event['recur_enddate'] = (1+$end_year).'0101';
106
+				}
92 107
 
93 108
 				$rrule = calendar_rrule::event2rrule($event);
94
-				if ($rrule->enddate && $rrule->enddate->format('Y') < $year) continue;
109
+				if ($rrule->enddate && $rrule->enddate->format('Y') < $year)
110
+				{
111
+					continue;
112
+				}
95 113
 
96 114
 				foreach($rrule as $rtime)
97 115
 				{
98
-					if (($y = (int)$rtime->format('Y')) < $year) continue;
99
-					if ($y > $end_year) break;
116
+					if (($y = (int)$rtime->format('Y')) < $year)
117
+					{
118
+						continue;
119
+					}
120
+					if ($y > $end_year)
121
+					{
122
+						break;
123
+					}
100 124
 
101 125
 					$ymd = (int)$rtime->format('Ymd');
102 126
 					$years[$y][(string)$ymd][] = array(
Please login to merge, or discard this patch.
calendar/inc/class.calendar_import_ical.inc.php 1 patch
Braces   +20 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,7 +15,8 @@  discard block
 block discarded – undo
15 15
 /**
16 16
  * import ical for calendar
17 17
  */
18
-class calendar_import_ical implements importexport_iface_import_plugin  {
18
+class calendar_import_ical implements importexport_iface_import_plugin
19
+{
19 20
 
20 21
 	private static $plugin_options = array(
21 22
 		'fieldsep', 		// char
@@ -104,7 +105,8 @@  discard block
 block discarded – undo
104 105
 	 * @param string $_charset
105 106
 	 * @param definition $_definition
106 107
 	 */
107
-	public function import( $_stream, importexport_definition $_definition ) {
108
+	public function import( $_stream, importexport_definition $_definition )
109
+	{
108 110
 
109 111
 		$this->definition = $_definition;
110 112
 
@@ -154,7 +156,8 @@  discard block
 block discarded – undo
154 156
 	 *
155 157
 	 * @return string name
156 158
 	 */
157
-	public static function get_name() {
159
+	public static function get_name()
160
+	{
158 161
 		return lang('Calendar iCal import');
159 162
 	}
160 163
 
@@ -163,7 +166,8 @@  discard block
 block discarded – undo
163 166
 	 *
164 167
 	 * @return string descriprion
165 168
 	 */
166
-	public static function get_description() {
169
+	public static function get_description()
170
+	{
167 171
 		return lang("Imports events into your Calendar from an iCal File.");
168 172
 	}
169 173
 
@@ -172,7 +176,8 @@  discard block
 block discarded – undo
172 176
 	 *
173 177
 	 * @return string suffix (comma seperated)
174 178
 	 */
175
-	public static function get_filesuffix() {
179
+	public static function get_filesuffix()
180
+	{
176 181
 		return 'ics';
177 182
 	}
178 183
 
@@ -188,7 +193,8 @@  discard block
 block discarded – undo
188 193
 	 * 		preserv		=> array,
189 194
 	 * )
190 195
 	 */
191
-	public function get_options_etpl() {
196
+	public function get_options_etpl()
197
+	{
192 198
 		// lets do it!
193 199
 	}
194 200
 
@@ -197,7 +203,8 @@  discard block
 block discarded – undo
197 203
 	 *
198 204
 	 * @return string etemplate name
199 205
 	 */
200
-	public function get_selectors_etpl() {
206
+	public function get_selectors_etpl()
207
+	{
201 208
 		// lets do it!
202 209
 	}
203 210
 
@@ -209,7 +216,8 @@  discard block
 block discarded – undo
209 216
         *       record_# => warning message
210 217
         *       )
211 218
         */
212
-        public function get_warnings() {
219
+        public function get_warnings()
220
+        {
213 221
 		return $this->warnings;
214 222
 	}
215 223
 
@@ -221,7 +229,8 @@  discard block
 block discarded – undo
221 229
         *       record_# => error message
222 230
         *       )
223 231
         */
224
-        public function get_errors() {
232
+        public function get_errors()
233
+        {
225 234
 		return $this->errors;
226 235
 	}
227 236
 
@@ -233,7 +242,8 @@  discard block
 block discarded – undo
233 242
         *       action => record count
234 243
         * )
235 244
         */
236
-        public function get_results() {
245
+        public function get_results()
246
+        {
237 247
                 return $this->results;
238 248
         }
239 249
 }
240 250
\ No newline at end of file
Please login to merge, or discard this patch.
calendar/inc/class.calendar_timezones.inc.php 1 patch
Braces   +27 added lines, -6 removed lines patch added patch discarded remove patch
@@ -188,10 +188,18 @@  discard block
 block discarded – undo
188 188
 		{
189 189
 			$updated = false;
190 190
 			$msg = self::import_zones($updated);
191
-			if ($updated) error_log($msg);	// log that timezones have been updated
191
+			if ($updated)
192
+			{
193
+				error_log($msg);
194
+			}
195
+			// log that timezones have been updated
192 196
 
193 197
 			$alias_msg = self::import_tz_aliases($updated);
194
-			if ($updated) error_log($alias_msg);	// log that timezone aliases have been updated
198
+			if ($updated)
199
+			{
200
+				error_log($alias_msg);
201
+			}
202
+			// log that timezone aliases have been updated
195 203
 
196 204
 			self::$import_msg = $msg.'<br/>'.$alias_msg;
197 205
 
@@ -249,7 +257,11 @@  discard block
 block discarded – undo
249 257
 				if ($type == 'aliases')
250 258
 				{
251 259
 					$data = array('alias' => $tz2id[$data['aliasTo']]);
252
-					if (!$data['alias']) continue;	// there's no such tzid
260
+					if (!$data['alias'])
261
+					{
262
+						continue;
263
+					}
264
+					// there's no such tzid
253 265
 				}
254 266
 				// check if already in database
255 267
 				$tz2id[$tzid] = $GLOBALS['egw']->db->select('egw_cal_timezones','tz_id',array(
@@ -266,7 +278,10 @@  discard block
 block discarded – undo
266 278
 				),__LINE__,__FILE__,'calendar');
267 279
 
268 280
 				// only query last insert id, if not already in database (gives warning for PostgreSQL)
269
-				if (!$tz2id[$tzid]) $tz2id[$tzid] = $GLOBALS['egw']->db->get_last_insert_id('egw_cal_timezones','tz_id');
281
+				if (!$tz2id[$tzid])
282
+				{
283
+					$tz2id[$tzid] = $GLOBALS['egw']->db->get_last_insert_id('egw_cal_timezones','tz_id');
284
+				}
270 285
 			}
271 286
 		}
272 287
 		Api\Config::save_value('tz_version', $tz_version, 'phpgwapi');
@@ -306,13 +321,16 @@  discard block
 block discarded – undo
306 321
 		foreach($tz_aliases as $alias => $tzid)
307 322
 		{
308 323
 			if ((!($alias_id=self::tz2id($alias, 'alias')) || self::id2tz($alias_id, 'tzid') !== $tzid) &&	// not in DB or different
309
-				($tz_id = self::tz2id($tzid)))	// given tzid for alias exists in DB
324
+				($tz_id = self::tz2id($tzid)))
325
+			{
326
+				// given tzid for alias exists in DB
310 327
 			{
311 328
 				$GLOBALS['egw']->db->insert('egw_cal_timezones',array(
312 329
 					'tz_alias' => $tz_id,
313 330
 				),array(
314 331
 					'tz_tzid' => $alias,
315 332
 				),__LINE__,__FILE__,'calendar');
333
+			}
316 334
 				++$updates;
317 335
 			}
318 336
 			//error_log(__METHOD__."() alias=$alias, tzid=$tzid --> self::tz2id('$alias', 'alias') = ".array2string($alias_id).",  self::tz2id('$tzid')=".array2string($tz_id));
@@ -402,7 +420,10 @@  discard block
 block discarded – undo
402 420
 			$prefs = $prefs_obj->read();
403 421
 			$tzid = $prefs['common']['tz'];
404 422
 		}
405
-		if (!$tzid) $tzid = Api\DateTime::$server_timezone->getName();
423
+		if (!$tzid)
424
+		{
425
+			$tzid = Api\DateTime::$server_timezone->getName();
426
+		}
406 427
 
407 428
 		switch ($type)
408 429
 		{
Please login to merge, or discard this patch.