Code Duplication    Length = 4-5 lines in 2 locations

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

@@ 368-371 (lines=4) @@
365
			}
366
			// some checks for recurrences, if you give a date, make it a weekly repeating event and visa versa
367
			if ($event['recur_type'] == MCAL_RECUR_NONE && $event['recur_data']) $event['recur_type'] = MCAL_RECUR_WEEKLY;
368
			if ($event['recur_type'] == MCAL_RECUR_WEEKLY && !$event['recur_data'])
369
			{
370
				$event['recur_data'] = 1 << (int)date('w',$event['start']);
371
			}
372
			if ($event['recur_type'] != MCAL_RECUR_NONE && !isset($event['recur_enddate']))
373
			{
374
				// No recur end date, make sure it's set to something or it won't be changed

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

@@ 2704-2708 (lines=5) @@
2701
								$days = explode(',',$recurenceMatches[1]);
2702
								$recur_days = $this->recur_days;
2703
							}
2704
							else	// no day given, use the day of dtstart
2705
							{
2706
								$vcardData['recur_data'] |= 1 << (int)date('w',$vcardData['start']);
2707
								$vcardData['recur_type'] = MCAL_RECUR_WEEKLY;
2708
							}
2709
							if ($days)
2710
							{
2711
								foreach ($recur_days as $id => $day)