Example #1
0
 public function delete()
 {
     if (!$this->CheckParams($this->_templateobject->idField)) {
         sendBack();
     }
     parent::delete($this->modeltype);
     sendTo($this->name, 'index', $this->_modules, $this->getOtherParams());
 }
 public function delete()
 {
     if (!$this->checkParams($this->modeltype)) {
         sendBack();
     }
     $flash = Flash::Instance();
     parent::delete($this->modeltype);
     sendTo($_SESSION['refererPage']['controller'], $_SESSION['refererPage']['action'], $_SESSION['refererPage']['modules'], isset($_SESSION['refererPage']['other']) ? $_SESSION['refererPage']['other'] : null);
 }
 public function delete()
 {
     $glheader = DataObjectFactory::Factory($this->_header_model);
     $unposted = $glheader->unpostedTransactionFactory();
     $transaction_model = get_class($unposted);
     if (!$this->checkParams(array($this->_header_model, $transaction_model))) {
         $this->dataError();
         sendBack();
     }
     if (parent::delete($unposted)) {
         sendTo('gltransactionheaders', 'view', $this->_modules, array('id' => $this->data[$this->_header_model]['id']));
     }
     $this->_data['id'] = $this->_data[$transaction_model]['id'];
     $this->refresh();
 }
Example #4
0
 public function delete()
 {
     $flash = Flash::Instance();
     $company = $this->_uses['Lead'];
     $company->load($this->_data['id']);
     if (!$company->isLoaded()) {
         $flash = Flash::instance();
         $flash->addError('You do not have permission to delete this lead.');
         sendTo($this->name, 'index', $this->_modules);
         return;
     }
     $pl = new PreferencePageList('recently_viewed_leads' . EGS_COMPANY_ID);
     $pl->removePage(new Page(array('module' => 'contacts', 'controller' => 'leads', 'action' => 'view', 'id' => $company->id), 'company', $company->name));
     $pl->save();
     parent::delete('Company');
     sendTo('Leads', 'index', array('contacts'));
 }
Example #5
0
 public function delete()
 {
     $flash = Flash::instance();
     $person = $this->_templateobject;
     $person_idfield = $person->idField;
     if (isset($this->_data[$person_idfield]) && !empty($this->_data[$person_idfield])) {
         $person->load($this->_data[$person->idField]);
         if (!$person->isLoaded()) {
             $flash->addError('You do not have permission to delete this person.');
             sendTo($this->name, 'index', $this->_modules);
             return;
         }
         $company = DataObjectFactory::Factory('Company');
         $company->load($person->company_id);
         $company_id = $person->company_id;
         $company_idfield = $company->idField;
         if (parent::delete($person)) {
             if ($company->isLoaded()) {
                 sendTo('Companys', 'view', $this->_modules, array($company_idfield => $company_id));
             } else {
                 sendTo($this->name, 'index', $this->_modules);
             }
         }
         sendTo($this->name, 'view', $this->_modules, array($person_idfield => $this->_data[$person_idfield]));
     }
 }
Example #6
0
 public function delete_field()
 {
     if (!$this->checkParams(array('id', 'dataset_id'))) {
         $this->dataError();
         sendBack();
     }
     $dataset = $this->_uses[$this->modeltype];
     $flash = Flash::Instance();
     $db = DB::Instance();
     $db->StartTrans();
     if (!parent::delete('DatasetField') || !$this->change_table($this->_data, 'delete')) {
         $flash->addError('Error deleting field');
         $db->FailTrans();
     } else {
         $dataset->load($this->_data['dataset_id']);
         $this->createOverview($dataset, $errors);
     }
     $db->CompleteTrans();
     sendTo($this->name, 'view', $this->_modules, array($dataset->idField => $this->_data['dataset_id']));
 }
 public function delete()
 {
     $flash = Flash::Instance();
     parent::delete('POReceivedLine');
     sendTo($_SESSION['refererPage']['controller'], $_SESSION['refererPage']['action'], $_SESSION['refererPage']['modules'], isset($_SESSION['refererPage']['other']) ? $_SESSION['refererPage']['other'] : null);
 }
 public function delete()
 {
     $flash = Flash::Instance();
     $ce = $this->_uses['CalendarEvent'];
     $ce->load($this->_data['id']);
     if ($ce->owner != EGS_USERNAME) {
         $csc = new CalendarShareCollection(new CalendarShare());
         $sh = new SearchHandler($csc);
         $sh->addConstraint(new Constraint('username', '=', EGS_USERNAME));
         $csc->load($sh);
         if ($csc->count() == 0) {
             $flash->addError('You do not have permission to edit that entry');
             sendBack();
         }
     }
     parent::delete('CalendarEvent');
     sendTo('index', 'index', array('calendar'));
 }
Example #9
0
 public function delete()
 {
     $flash = Flash::Instance();
     parent::delete($this->modeltype);
     sendTo($this->name, 'index', $this->_modules);
 }
 public function delete()
 {
     $flash = Flash::Instance();
     parent::delete('SODespatchLine');
     sendTo($this->name, 'index', $this->_modules);
 }