Example #1
0
 /**
  * Prints the given calendar out based on type
  * @param none
  */
 function print_calendar()
 {
     $this->print_calendars("changeMyCal(%d,%d,%d,{$this->type})");
     print_date_span($this->firstDate, $this->lastDate, $this->type);
     print_view_links($this->actualDate, $this->type);
     switch ($this->type) {
         case MYCALENDARTYPE_DAY:
         case MYCALENDARTYPE_WEEK:
             print_day_reservations($this->reservations, $this->firstDate, $this->totalDays);
             break;
         case MYCALENDARTYPE_MONTH:
             print_month_reservations($this->reservations, $this->firstDate);
     }
     print_details_div();
 }
Example #2
0
 /**
  * Prints the given calendar out based on type
  * @param none
  */
 function print_calendar()
 {
     global $conf;
     $is_private = $conf['app']['privacyMode'] && !Auth::isAdmin();
     if ($this->type != MYCALENDARTYPE_SIGNUP) {
         $paramname = $this->isresource ? 'machid' : 'scheduleid';
         $paramvalue = $this->isresource ? $this->machid : $this->scheduleid;
         $prefix = $this->isresource ? 'm' : 's';
         $this->print_calendars("changeResCalendar(%d,%d,%d,{$this->type},'{$prefix}|{$paramvalue}')");
         print_date_span($this->firstDate, $this->lastDate, $this->type, array($paramname), array($paramvalue), $this->name);
         print_view_links($this->actualDate, $this->type, array($paramname), array($paramvalue));
         print_resource_jump_link($this->resources, $this->schedules, $this->machid, $this->scheduleid, $this->actualDate, $this->type, $this->isresource);
         switch ($this->type) {
             case MYCALENDARTYPE_DAY:
             case MYCALENDARTYPE_WEEK:
                 if ($this->isresource) {
                     print_day_resource_reservations($this->reservations, $this->firstDate, $this->totalDays, $this->scheduleid, $this->starttime, $this->endtime, $this->timespan, $is_private);
                 } else {
                     print_day_reservations($this->reservations, $this->firstDate, $this->totalDays, false, $is_private);
                 }
                 break;
             case MYCALENDARTYPE_MONTH:
                 print_month_reservations($this->reservations, $this->firstDate, array('fname', 'lname'), false, $is_private, $this->scheduleid);
         }
         print_details_div();
     } else {
         print_signup_sheet($this->reservations, $this->firstDate, 1, $this->starttime, $this->endtime, $this->timespan, $this->name, $is_private);
     }
 }