Code Duplication    Length = 20-20 lines in 3 locations

programs/utilit/cet_deposit_request.class.php 1 location

@@ 326-345 (lines=20) @@
323
	}
324
	
325
	
326
	public function getArchiveYear()
327
	{
328
		require_once $GLOBALS['babInstallPath'].'utilit/dateTime.php';
329
		$year = (int) substr($this->createdOn, 0, 4);
330
		
331
		if (0 === $year)
332
		{
333
			return null;
334
		}
335
		
336
		$day = absences_getVacationOption('archivage_day');
337
		$month = absences_getVacationOption('archivage_month');
338
		
339
		$currentYear = new BAB_DateTime($year, $month, $day);
340
		if($this->createdOn < $currentYear->getIsoDate()){
341
			$year = $year-1;
342
		}
343
		
344
		return $year;
345
	}
346
	
347
	
348
	

programs/utilit/workperiod_recover_request.class.php 1 location

@@ 432-451 (lines=20) @@
429
	}
430
	
431
	
432
	public function getArchiveYear()
433
	{
434
		require_once $GLOBALS['babInstallPath'].'utilit/dateTime.php';
435
		$year = (int) substr($this->date_begin, 0, 4);
436
		
437
		if (0 === $year)
438
		{
439
			return null;
440
		}
441
		
442
		$day = absences_getVacationOption('archivage_day');
443
		$month = absences_getVacationOption('archivage_month');
444
		
445
		$currentYear = new BAB_DateTime($year, $month, $day);
446
		if($this->date_begin < $currentYear->getIsoDate()){
447
			$year = $year-1;
448
		}
449
		
450
		return $year;
451
	}
452
	
453
	
454
	public function archive()

programs/utilit/entry.class.php 1 location

@@ 1816-1835 (lines=20) @@
1813
	}
1814
1815
1816
	public function getArchiveYear()
1817
	{
1818
		require_once $GLOBALS['babInstallPath'].'utilit/dateTime.php';
1819
		$year = (int) substr($this->date_begin, 0, 4);
1820
1821
		if (0 === $year)
1822
		{
1823
			return null;
1824
		}
1825
1826
		$day = absences_getVacationOption('archivage_day');
1827
		$month = absences_getVacationOption('archivage_month');
1828
1829
		$currentYear = new BAB_DateTime($year, $month, $day);
1830
		if($this->date_begin < $currentYear->getIsoDate()){
1831
			$year = $year-1;
1832
		}
1833
1834
		return $year;
1835
	}
1836
1837
	public function archive()
1838
	{