public function displayDefineHolidays($modifier = "specific", $edit = false)
 {
     $this->_authenticateViewHoliday();
     $record = null;
     if ($edit) {
         $holidayObj = new Holidays();
         $record = $holidayObj->fetchHoliday($this->getId());
     }
     switch ($modifier) {
         case "specific":
             $holiday = new Holidays();
             $record['holidayList'] = $holiday->listHolidays();
             $path = "/templates/leave/specificHolidaysDefine.php";
             break;
         case "weekend":
             $path = "/templates/leave/weekendHolidaysDefine.php";
             $weekendsObj = new Weekends();
             $record = $weekendsObj->fetchWeek();
             break;
     }
     $record['rights'] = $_SESSION['localRights'];
     $record['changeWeekends'] = Leave::isLeaveTableEmpty();
     $template = new TemplateMerger($record, $path);
     $modifier = $edit;
     $template->display($modifier);
 }
Exemplo n.º 2
0
 public function displayDefineHolidays($modifier = "specific", $edit = false)
 {
     $this->_authenticateViewHoliday();
     $record = null;
     if ($edit) {
         $holidayObj = new Holidays();
         $record = $holidayObj->fetchHoliday($this->getId());
     }
     switch ($modifier) {
         case "specific":
             $path = "/templates/leave/specificHolidaysDefine.php";
             break;
         case "weekend":
             $path = "/templates/leave/weekendHolidaysDefine.php";
             $weekendsObj = new Weekends();
             $record = $weekendsObj->fetchWeek();
             break;
     }
     $template = new TemplateMerger($record, $path);
     $modifier = $edit;
     $template->display($modifier);
 }
 public function __construct()
 {
     $weekendObj = new Weekends();
     $this->weekends = $weekendObj->fetchWeek();
 }