Code Duplication    Length = 21-22 lines in 2 locations

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

@@ 336-357 (lines=22) @@
333
			}
334
			unset($possible_quantity_conflicts);
335
336
			if (count($conflicts))
337
			{
338
				foreach($conflicts as $key => $conflict)
339
				{
340
						$conflict['participants'] = array_intersect_key((array)$conflict['participants'],$event['participants']);
341
					if (!$this->check_perms(EGW_ACL_READ,$conflict))
342
					{
343
						$conflicts[$key] = array(
344
							'id'    => $conflict['id'],
345
							'title' => lang('busy'),
346
							'participants' => $conflict['participants'],
347
							'start' => $conflict['start'],
348
							'end'   => $conflict['end'],
349
						);
350
					}
351
				}
352
				if ($this->debug > 2 || $this->debug == 'update')
353
				{
354
					$this->debug_message('calendar_boupdate::update() %1 conflicts found %2',false,count($conflicts),$conflicts);
355
				}
356
				return $conflicts;
357
			}
358
		}
359
360
		//echo "saving $event[id]="; _debug_array($event);
@@ 558-578 (lines=21) @@
555
		}
556
		unset($possible_quantity_conflicts);
557
558
		if (count($conflicts))
559
		{
560
			foreach($conflicts as $key => $conflict)
561
			{
562
					$conflict['participants'] = array_intersect_key((array)$conflict['participants'],$event['participants']);
563
				if (!$this->check_perms(Acl::READ,$conflict))
564
				{
565
					$conflicts[$key] = array(
566
						'id'    => $conflict['id'],
567
						'title' => lang('busy'),
568
						'participants' => $conflict['participants'],
569
						'start' => $conflict['start'],
570
						'end'   => $conflict['end'],
571
					);
572
				}
573
			}
574
			if ($this->debug > 2 || $this->debug == 'conflicts')
575
			{
576
				$this->debug_message(__METHOD__.'() %1 conflicts found %2',false,count($conflicts),$conflicts);
577
			}
578
		}
579
		return $conflicts;
580
	}
581