Code Duplication    Length = 18-18 lines in 2 locations

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

@@ 2775-2792 (lines=18) @@
2772
2773
			$messages = null;
2774
			$conflicts = $this->bo->update($event,false,true,false,true,$messages);
2775
			if (!is_array($conflicts) && $conflicts)
2776
			{
2777
				// now we need to add the original start as recur-execption to the series
2778
				$recur_event = $this->bo->read($event['reference']);
2779
				$recur_event['recur_exception'][] = $d->format('ts');
2780
				// check if we need to move the alarms, because they are next on that exception
2781
				$this->bo->check_move_alarms($recur_event, null, $d);
2782
				unset($recur_event['start']); unset($recur_event['end']);	// no update necessary
2783
				unset($recur_event['alarm']);	// unsetting alarms too, as they cant be updated without start!
2784
				$this->bo->update($recur_event,true);	// no conflict check here
2785
2786
				// Sending null will trigger a removal of the original for that date
2787
				Api\Json\Response::get()->generic('data', array('uid' => 'calendar::'.$_eventId, 'data' => null));
2788
2789
				unset($recur_event);
2790
				unset($event['edit_single']);			// if we further edit it, it's just a single event
2791
				unset($preserv['edit_single']);
2792
			}
2793
		}
2794
2795
		$d = new Api\DateTime($targetDateTime, Api\DateTime::$user_timezone);
@@ 3020-3037 (lines=18) @@
3017
3018
			$messages = null;
3019
			$conflicts = $this->bo->update($event,true,true,false,true,$messages);
3020
			if (!is_array($conflicts) && $conflicts)
3021
			{
3022
				// now we need to add the original start as recur-execption to the series
3023
				$recur_event = $this->bo->read($event['reference']);
3024
				$recur_event['recur_exception'][] = $d->format('ts');
3025
				// check if we need to move the alarms, because they are next on that exception
3026
				$this->bo->check_move_alarms($recur_event, null, $d);
3027
				unset($recur_event['start']); unset($recur_event['end']);	// no update necessary
3028
				unset($recur_event['alarm']);	// unsetting alarms too, as they cant be updated without start!
3029
				$this->bo->update($recur_event,true);	// no conflict check here
3030
3031
				// Sending null will trigger a removal of the original for that date
3032
				Api\Json\Response::get()->generic('data', array('uid' => 'calendar::'.$_eventId, 'data' => null));
3033
3034
				unset($recur_event);
3035
				unset($event['edit_single']);			// if we further edit it, it's just a single event
3036
				unset($preserv['edit_single']);
3037
			}
3038
		}
3039
		foreach($remove as $participant)
3040
		{