Example #1
0
 public function edit()
 {
     $company = $this->_uses['Lead'];
     if (!isset($this->_data[$company->idField])) {
         sendTo();
     }
     $company->load($this->_data[$company->idField]);
     if (!$company->isLoaded()) {
         $flash = Flash::instance();
         $flash->addError('You do not have permission to edit this lead.');
         sendTo($this->name, 'index', $this->_modules);
         return;
     }
     $addresslist = array();
     if ($company) {
         foreach ($company->addresses as $address) {
             $addresslist[$address->id] = $address->address;
         }
     }
     $this->view->set('addresses', $addresslist);
     $cic = DataObjectFactory::Factory('CompanyInCategories');
     $selected = $cic->getCategoryID($company->id);
     $this->view->set('selected_categories', $selected);
     parent::edit();
 }
 public function edit()
 {
     $flash = Flash::Instance();
     $ce = $this->_uses['CalendarEvent'];
     $ce->load($this->_data['id']);
     $calendar = new Calendar();
     $this->view->set('calendar_id', $calendar->getWritableCalendars());
     if ($ce->owner != EGS_USERNAME) {
         $flash->addError('You do not have permission to edit that entry');
         sendBack();
     }
     parent::edit();
 }
Example #3
0
 /**
  * Don't allow edit if Activity is completed
  * @see Controller::edit()
  */
 public function edit()
 {
     $flash = Flash::Instance();
     if (isset($this->_data['id'])) {
         $activity = $this->_uses['Activity'];
         $activity->load($this->_data['id']);
         if ($activity->isLoaded() && !is_null($activity->completed)) {
             $flash->addWarning('Activity Marked as Completed, editing not allowed');
             sendBack();
         }
         parent::edit();
     }
 }
Example #4
0
 public function edit()
 {
     $company = $this->_templateobject;
     $companyid = '';
     if (isset($this->_data[$company->idField])) {
         $companyid = $this->_data[$company->idField];
     } elseif (isset($this->_data[get_class($this->_templateobject)][$company->idField])) {
         $companyid = $this->_data[get_class($this->_templateobject)][$company->idField];
     }
     if (empty($companyid)) {
         sendTo();
     }
     $company->load($companyid);
     if (!$company->isLoaded()) {
         $flash = Flash::instance();
         $flash->addError('You do not have permission to edit this contact.');
         sendTo($this->name, 'index', $this->_modules);
         return;
     }
     $cic = DataObjectFactory::Factory('CompanyInCategories');
     $selected = $cic->getCategoryID($companyid);
     $this->view->set('selected_categories', $selected);
     parent::edit();
 }