Esempio n. 1
0
 public function getContent()
 {
     if (empty($this->content)) {
         PHPWS_Core::initModClass('filecabinet', 'Cabinet.php');
         $this->content = Cabinet::getTag($this->type_id);
     }
     return $this->content;
 }
 public function show()
 {
     PHPWS_Core::initModClass('hms', 'HMS_Residence_Hall.php');
     PHPWS_Core::initModClass('hms', 'HMS_Util.php');
     PHPWS_Core::initModClass('filecabinet', 'Cabinet.php');
     $hall = new HMS_Residence_Hall($this->hallId);
     $tpl = array();
     $tpl['HALL'] = $hall->hall_name;
     if (isset($hall->exterior_image_id)) {
         $tpl['EXTERIOR_IMAGE'] = Cabinet::getTag($hall->exterior_image_id);
     }
     if (isset($hall->room_plan_image_id) && $hall->room_plan_image_id != 0) {
         $file = Cabinet::getFile($hall->room_plan_image_id);
         $tpl['ROOM_PLAN_IMAGE'] = $file->parentLinked();
     }
     if (isset($hall->map_image_id)) {
         $tpl['MAP_IMAGE'] = Cabinet::getTag($hall->map_image_id);
     }
     if (isset($hall->other_image_id) && $hall->other_image_id != 0 && $hall->other_image_id != '0') {
         $file = Cabinet::getFile($hall->other_image_id);
         $tpl['OTHER_IMAGE'] = $file->parentLinked();
     }
     if ($this->rlcAssignment != null && ($this->rlcAssignment->getStateName() == 'confirmed' || $this->rlcAssignment->getStateName() == 'selfselect-invite')) {
         $rlcId = $this->rlcAssignment->getRlc()->getId();
     } else {
         $rlcId = null;
     }
     $floors = $hall->get_floors();
     foreach ($floors as $floor) {
         $row = array();
         if ($floor->count_avail_lottery_rooms($this->student->getGender(), $rlcId) <= 0) {
             $row['FLOOR'] = HMS_Util::ordinal($floor->floor_number);
             $row['ROW_TEXT_COLOR'] = 'class="text-muted"';
             $tpl['floor_list'][] = $row;
             continue;
         }
         $floorCmd = CommandFactory::getCommand('LotteryChooseFloor');
         $floorCmd->setFloorId($floor->id);
         $row['FLOOR'] = $floorCmd->getLink(HMS_Util::ordinal($floor->floor_number) . ' floor');
         $row['ROW_TEXT_COLOR'] = 'grey';
         $tpl['floor_list'][] = $row;
     }
     Layout::addPageTitle("Choose Floor");
     return PHPWS_Template::process($tpl, 'hms', 'student/lottery_choose_floor.tpl');
 }