public function editAction()
 {
     $personId = (int) $this->_getParam('personId');
     if (isset($this->_session->messages)) {
         $this->view->messages = $this->_session->messages;
     }
     $this->_form = new WebVista_Form(array('name' => 'provider-detail'));
     $this->_form->setAction(Zend_Registry::get('baseUrl') . "admin-providers.raw/edit-process");
     $this->_provider = new Provider();
     $this->_provider->person_id = $personId;
     if (!$this->_provider->populate()) {
         if ($personId > 0) {
             //handle case where person exists but no provider record
             $this->view->noProvider = true;
         }
         //do nothing if personId is 0, no person selected yet
     }
     $this->_form->loadORM($this->_provider, 'provider');
     //var_dump($this->_form);
     $this->view->form = $this->_form;
     $this->view->person = $this->_provider;
     $stations = LegacyEnum::getEnumArray('routing_stations');
     $stations = array_merge(array('' => ''), $stations);
     $this->view->stations = $stations;
     $this->render('edit');
 }
 public function editRoomAction()
 {
     $id = (int) $this->_getParam('id');
     $enumerationId = (int) $this->_getParam('enumerationId');
     $enumerationsClosure = new EnumerationsClosure();
     $parentId = $enumerationsClosure->getParentById($enumerationId);
     $enumeration = new Enumeration();
     $enumeration->enumerationId = $parentId;
     $enumeration->populate();
     $orm = new Room();
     if ($id > 0) {
         $orm->roomId = $id;
         $orm->populate();
     }
     $orm->buildingId = $enumeration->ormId;
     $form = new WebVista_Form(array('name' => 'edit-room'));
     $form->setAction(Zend_Registry::get('baseUrl') . 'facilities.raw/process-edit-room');
     $form->loadORM($orm, 'Room');
     $form->setWindow('windowEditRoomId');
     $this->view->form = $form;
     $routingStations = LegacyEnum::getEnumArray('routing_stations');
     $routingStations = array_merge(array('' => ''), $routingStations);
     $this->view->colors = Room::getColorList();
     $this->view->routingStations = $routingStations;
     $this->view->enumerationId = $enumerationId;
     $this->render('edit-room');
 }
Example #3
0
 public static function getEnumArray($name, $key = "key", $value = "value")
 {
     $iter = LegacyEnum::getIterByEnumerationName($name);
     return $iter->toArray($key, $value);
 }
 public function appointmentsGridContextMenuAction()
 {
     header('Content-Type: application/xml;');
     $this->view->xmlHeader = '<?xml version="1.0" ?>';
     $this->view->stations = LegacyEnum::getEnumArray('routing_stations');
     $this->render();
 }
 public function ajaxGetMenuAction()
 {
     $menus = array();
     $menus[] = array('text' => __('Add Column'), 'id' => 'add_column');
     $menus[] = array('text' => __('Remove This Column'), 'id' => 'remove_column');
     $menus[] = array('text' => __('Select Date'), 'id' => 'select_date');
     $menus[] = array('text' => __('Edit This Appointment'), 'id' => 'edit_appointment');
     $menus[] = array('text' => __('Cancel Move'), 'id' => 'cancel_move');
     $this->view->menus = $menus;
     $this->view->stations = LegacyEnum::getEnumArray('routing_stations');
     header('Content-Type: application/xml;');
     $this->render('ajax-get-menu');
 }