Code Duplication    Length = 19-19 lines in 2 locations

mod/event_calendar/models/model.php 1 location

@@ 177-195 (lines=19) @@
174
}
175
176
//Validation if recurrence box is check
177
if ($event_calendar_repeating_events != 'no') {
178
	$validation ='';
179
	$repeats = get_input('repeats');
180
	$e->repeats = $repeats;
181
	if ($repeats == 'yes') {
182
183
		$dow = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday');
184
		foreach ($dow as $w) {
185
			$v = 'event-calendar-repeating-'.$w.'-value';
186
			$event->$v = get_input($v);
187
				if($event->$v == 1){
188
					$validation = '1';
189
				}
190
		}
191
		if (!$validation){
192
			return false;
193
		}
194
	}
195
}
196
197
	// ok, the input passes the validation so put the values in the real event object
198

mod/gc_mobile_api/models/event.php 1 location

@@ 639-657 (lines=19) @@
636
 }
637
 
638
 //Validation if recurrence box is check
639
 if ($event_calendar_repeating_events != 'no') {
640
	 $validation ='';
641
	 $repeats = get_input('repeats');
642
	 $e->repeats = $repeats;
643
	 if ($repeats == 'yes') {
644
 
645
		 $dow = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday');
646
		 foreach ($dow as $w) {
647
			 $v = 'event-calendar-repeating-'.$w.'-value';
648
			 $event->$v = get_input($v);
649
				 if($event->$v == 1){
650
					 $validation = '1';
651
				 }
652
		 }
653
		 if (!$validation){
654
			 return false;
655
		 }
656
	 }
657
	}
658
	$keys = array(
659
		'title',
660
		'access_id',