| @@ 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() |
|
| @@ 2155-2174 (lines=20) @@ | ||
| 2152 | } |
|
| 2153 | ||
| 2154 | ||
| 2155 | public function getArchiveYear() |
|
| 2156 | { |
|
| 2157 | require_once $GLOBALS['babInstallPath'].'utilit/dateTime.php'; |
|
| 2158 | $year = (int) substr($this->date_begin, 0, 4); |
|
| 2159 | ||
| 2160 | if (0 === $year) |
|
| 2161 | { |
|
| 2162 | return null; |
|
| 2163 | } |
|
| 2164 | ||
| 2165 | $day = absences_getVacationOption('archivage_day'); |
|
| 2166 | $month = absences_getVacationOption('archivage_month'); |
|
| 2167 | ||
| 2168 | $currentYear = new BAB_DateTime($year, $month, $day); |
|
| 2169 | if($this->date_begin < $currentYear->getIsoDate()){ |
|
| 2170 | $year = $year-1; |
|
| 2171 | } |
|
| 2172 | ||
| 2173 | return $year; |
|
| 2174 | } |
|
| 2175 | ||
| 2176 | public function archive() |
|
| 2177 | { |
|