Ejemplo n.º 1
0
 /**
  * Display a building in a location
  *
  * @param int $location_id
  * @param int $building_id
  * @return \Symfony\Component\HttpFoundation\Response
  * @access public
  */
 public function showLocationBuildingAction($location_id, $building_id)
 {
     //must be an integer
     $location_id = (int) $location_id;
     $building_id = (int) $building_id;
     if ($location_id === 0 || $building_id === 0) {
         redirect($this->helper->route('consim_core_location', array('location_id' => $location_id)));
     }
     $location = $this->locationService->getLocation($location_id);
     $building = $this->buildingService->getBuilding($building_id);
     //add location to navbar
     $this->add_navlinks($location->getName(), $this->helper->route('consim_core_location', array('location_id' => $location->getId())));
     //Show all Works
     $this->workService->allWorksToTemplate($building->getTypeId());
     add_form_key('working');
     // Set output vars for display in the template
     $this->template->assign_vars(array('BUILDING_NAME' => $building->getName() != '' ? '"' . $building->getName() . '"' : '', 'BUILDING_DESCRIPTION' => $building->getDescription() != '' ? '' . $building->getDescription() . '' : '', 'BUILDING_TYP' => $building->getTypeName(), 'LOCATION' => $location->getName(), 'BACK_TO_LOCATION' => $this->helper->route('consim_core_location', array('location_id' => $location_id)), 'S_WORK_ACTION' => $this->helper->route('consim_core_work_start')));
     // Send all data to the template file
     return $this->helper->render('consim_building.html', $this->user->lang('CONSIM'));
 }