Code Duplication    Length = 7-7 lines in 3 locations

calendar/inc/class.calendar_bo.inc.php 1 location

@@ 899-905 (lines=7) @@
896
				}
897
			}
898
			// same with the alarms
899
			if (isset($event['alarm']) && is_array($event['alarm']))
900
			{
901
				foreach($event['alarm'] as &$alarm)
902
				{
903
					$alarm['time'] = $this->date2usertime((int)$alarm['time'],$date_format);
904
				}
905
			}
906
		}
907
	}
908

calendar/inc/class.calendar_boupdate.inc.php 2 locations

@@ 2888-2894 (lines=7) @@
2885
			if (isset($event[$ts])) $event[$ts] = $event[$ts] ? $this->date2usertime($event[$ts]) : 0;
2886
		}
2887
		// same with the recur exceptions
2888
		if (isset($event['recur_exception']) && is_array($event['recur_exception']))
2889
		{
2890
			foreach($event['recur_exception'] as $n => $date)
2891
			{
2892
				$event['recur_exception'][$n] = $this->date2usertime($date);
2893
			}
2894
		}
2895
		// same with the alarms
2896
		if (isset($event['alarm']) && is_array($event['alarm']))
2897
		{
@@ 2896-2902 (lines=7) @@
2893
			}
2894
		}
2895
		// same with the alarms
2896
		if (isset($event['alarm']) && is_array($event['alarm']))
2897
		{
2898
			foreach($event['alarm'] as $id => $alarm)
2899
			{
2900
				$event['alarm'][$id]['time'] = $this->date2usertime($alarm['time']);
2901
			}
2902
		}
2903
    }
2904
	/**
2905
	 * Delete events that are more than $age years old