Esempio n. 1
0
 /**
  * @param \consim\core\entity\Action $action
  */
 public function workWidget(\consim\core\entity\Action $action)
 {
     $now = time();
     $time = $action->getEndTime() - $now;
     $working = $this->container->get('consim.core.entity.work')->load($action->getWorkId());
     $location = $this->container->get('consim.core.service.location')->getLocation($action->getLocationId());
     $building = $this->container->get('consim.core.entity.building')->find($location->getId(), $working->getBuildingTypeId());
     // Set output vars for display in the template
     $this->template->assign_vars(array('SHOW_WORK_WIDGET' => TRUE, 'WORK_WIDGET_IS_WORKING' => $action->getStatus() == 0 ? TRUE : FALSE, 'WORK_WIDGET_IS_FINISHED' => $action->getStatus() == 2 ? TRUE : FALSE, 'WORK_WIDGET_NAME' => $working->getName(), 'WORK_WIDGET_BUILDING_NAME' => $building->getName() != '' ? '"' . $building->getName() . '"' : '', 'WORK_WIDGET_BUILDING_TYPE' => $building->getTypeName(), 'WORK_WIDGET_LOCATION_NAME' => $location->getName(), 'WORK_WIDGET_TIME' => $action->getStatus() == 0 ? date("i:s", $time) : FALSE));
 }