| @@ 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 | ||
| @@ 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() |
|
| @@ 1801-1820 (lines=20) @@ | ||
| 1798 | } |
|
| 1799 | ||
| 1800 | ||
| 1801 | public function getArchiveYear() |
|
| 1802 | { |
|
| 1803 | require_once $GLOBALS['babInstallPath'].'utilit/dateTime.php'; |
|
| 1804 | $year = (int) substr($this->date_begin, 0, 4); |
|
| 1805 | ||
| 1806 | if (0 === $year) |
|
| 1807 | { |
|
| 1808 | return null; |
|
| 1809 | } |
|
| 1810 | ||
| 1811 | $day = absences_getVacationOption('archivage_day'); |
|
| 1812 | $month = absences_getVacationOption('archivage_month'); |
|
| 1813 | ||
| 1814 | $currentYear = new BAB_DateTime($year, $month, $day); |
|
| 1815 | if($this->date_begin < $currentYear->getIsoDate()){ |
|
| 1816 | $year = $year-1; |
|
| 1817 | } |
|
| 1818 | ||
| 1819 | return $year; |
|
| 1820 | } |
|
| 1821 | ||
| 1822 | public function archive() |
|
| 1823 | { |
|