Esempio n. 1
0
 public function edit()
 {
     $task = $this->getTask();
     $cid = JRequest::getVar('cid', array(), 'request', 'array');
     try {
         if ($task == 'edit' && count($cid) < 1) {
             throw new Exception(JText::_('AOM_DATA_MISTAKE'));
         } elseif ($task == 'add') {
             $cid = array(0);
         }
         $this->setResources();
         $id = (int) $cid[0];
         JRequest::setVar('view', 'editstatus');
         $view = $this->getView('editstatus', 'html');
         $view->assign('task', $task);
         $view->assign('id', $id);
         parent::display();
     } catch (Exception $e) {
         $model = $this->getModel('statuses');
         $link = JRoute::_($model->getUrl(), false);
         $message = $e->getMessage();
         $type = 'error';
         $this->setRedirect($link, $message, $type);
     }
 }
Esempio n. 2
0
 public function edit()
 {
     $cid = JRequest::getVar('cid', array(), 'request', 'array');
     try {
         if (count($cid) < 1) {
             throw new Exception('AOM_DATA_MISTAKE');
         }
         $id = (int) $cid[0];
         JRequest::setVar('view', 'editair');
         $view = $this->getView('editair', 'html');
         $view->assign('id', $id);
         parent::display();
     } catch (Exception $e) {
         $model = $this->getModel('orders');
         $link = JRoute::_($model->getUrl(), false);
         $message = $e->getMessage();
         $type = 'error';
         $this->setRedirect($link, JText::_($message), $type);
     }
 }