/** * Delete entries * * @param array|string $where SQL WHERE clause(s) * @return int|string */ public function delete($id) { $model_production = new Production_Model_Production(); if ($model_production->fetchHaveCompanyClient($id) != null) { die("esta compañia esta trabajando como cliente de una produccion"); } //delete resource $table = $this->getTable(); $table->delete('companies_id = ' . (int) $id); }
/** * deleteAction for Productions * * @return void */ public function selectAction() { $id = $this->_getParam('id', 0); // //se comprueba que el usuario tiene permiso para esa produccion //se comprueba que el usuario tiene permiso para esa accion hecho $model_permission_production = new Production_Model_Permissionproduction(); if (!$model_permission_production->isUserAllowedProduccition($id)) { echo "no tiene acceso a la produccion " . $production["name"]; return $this->_helper->_redirector->gotoSimple('index', 'production', 'production'); } $model = new Production_Model_Production(); $production = $model->fetchEntry($id); $this->production = new Zend_Session_Namespace('production'); $this->production->id = $id; $this->production->name = $production["name"]; $this->production->activity_users = null; $this->production->activity = null; return $this->_helper->_redirector->gotoSimple('consult', 'finances', 'finances'); }
/** * Delete entries * * @param array|string $where SQL WHERE clause(s) * @return int|string */ public function delete($id) { //check the integration TODO the views and resource check $model_production = new Production_Model_Production(); if ($model_production->fetchHaveCompanyClient($id) != null) { die("esta compañia esta trabajando como cliente de una produccion"); } $model_contact = new Company_Model_Contact(); if ($model_contact->fetchHaveCompanyContact($id)) { die("esta compañia tiene contactos asociaodos"); } //delete resource $table = $this->getTable(); $table->delete('id = ' . (int) $id); }
/** * inlitterAction for Productions * * @return void */ public function inlitterAction() { if ($this->getRequest()->isPost()) { $del = $this->getRequest()->getPost('del'); if ($del == 'Yes') { $model = new Production_Model_Production(); $model->inLitter('id = ' . (int) $id); } return $this->_helper->redirector('index'); } else { if ($id > 0) { $model = new Production_Model_Production(); $this->view->production = $model->fetchEntry($id); } } }