Code Duplication    Length = 19-19 lines in 2 locations

mod/gc_mobile_api/models/event.php 1 location

@@ 558-576 (lines=19) @@
555
 }
556
557
 //Validation if recurrence box is check
558
 if ($event_calendar_repeating_events != 'no') {
559
	 $validation ='';
560
	 $repeats = get_input('repeats');
561
	 $e->repeats = $repeats;
562
	 if ($repeats == 'yes') {
563
564
		 $dow = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday');
565
		 foreach ($dow as $w) {
566
			 $v = 'event-calendar-repeating-'.$w.'-value';
567
			 $event->$v = get_input($v);
568
				 if($event->$v == 1){
569
					 $validation = '1';
570
				 }
571
		 }
572
		 if (!$validation){
573
			 return false;
574
		 }
575
	 }
576
	}
577
	$keys = array(
578
		'title',
579
		'access_id',

mod/event_calendar/models/model.php 1 location

@@ 160-178 (lines=19) @@
157
}
158
159
//Validation if recurrence box is check
160
if ($event_calendar_repeating_events != 'no') {
161
	$validation ='';
162
	$repeats = get_input('repeats');
163
	$e->repeats = $repeats;
164
	if ($repeats == 'yes') {
165
166
		$dow = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday');
167
		foreach ($dow as $w) {
168
			$v = 'event-calendar-repeating-'.$w.'-value';
169
			$event->$v = get_input($v);
170
				if($event->$v == 1){
171
					$validation = '1';
172
				}
173
		}
174
		if (!$validation){
175
			return false;
176
		}
177
	}
178
}
179
180
	// ok, the input passes the validation so put the values in the real event object
181