コード例 #1
0
 /**
  * EditAction for Resources
  *
  * @return void
  */
 public function editresourcesupplierAction()
 {
     $this->view->title = "Edit Resources";
     $form = new Production_Form_Resourcesupplier();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($this->getRequest()->getPost())) {
             $model = new Supplier_Model_Resource();
             $id = $this->getRequest()->getPost('id');
             $model->update($form->getValues(), 'id = ' . (int) $id);
             return $this->_helper->_redirector->gotoSimple('consult', 'productionsuppliers', 'production');
         } else {
             $form->populate($this->getRequest()->getPost());
         }
     } else {
         $id = $this->_getParam('id', 0);
         if ($id > 0) {
             $model = new Supplier_Model_Resource();
             $form->populate($model->fetchEntry($id));
         }
     }
     $this->view->form = $form;
 }
コード例 #2
0
 public function outlitterAction()
 {
     if ($this->getRequest()->isPost()) {
         $del = $this->getRequest()->getPost('del');
         if ($del == 'Yes') {
             $id = $this->getRequest()->getPost('id');
             $model = new Supplier_Model_Resource();
             $model->outLitter($id);
         }
         return $this->_helper->_redirector->gotoSimple('consult', 'supplier', 'supplier');
     } else {
         $id = $this->_getParam('id', 0);
         if ($id > 0) {
             $model = new Supplier_Model_Resource();
             $this->view->contact = $model->fetchEntry($id);
         }
     }
 }