コード例 #1
0
 public function processSave()
 {
     global $cookie;
     $obj = parent::processSave();
     if (!Module::isInstalled('agilemultipleseller')) {
         return $obj;
     }
     if ($this->is_seller) {
         AgileSellerManager::assignObjectOwner('feature', $obj->id, $cookie->id_employee);
     } else {
         AgileSellerManager::assignObjectOwner('feature', $obj->id, Tools::getValue('id_seller'));
     }
     return $obj;
 }
コード例 #2
0
 public function renderView()
 {
     if ($id = Tools::getValue('id_feature')) {
         $this->setTypeValue();
         $this->list_id = 'feature_value';
         $this->lang = true;
         // Action for list
         $this->addRowAction('edit');
         $this->addRowAction('delete');
         if (!Validate::isLoadedObject($obj = new Feature((int) $id))) {
             $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.') . ' <b>' . $this->table . '</b> ' . Tools::displayError('(cannot load object)');
             return;
         }
         $this->feature_name = $obj->name;
         $this->toolbar_title = $this->feature_name[$this->context->employee->id_lang];
         $this->fields_list = array('id_feature_value' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'), 'value' => array('title' => $this->l('Value')));
         $this->_where = sprintf('AND `id_feature` = %d', (int) $id);
         self::$currentIndex = self::$currentIndex . '&id_feature=' . (int) $id . '&viewfeature';
         $this->processFilter();
         return parent::renderList();
     }
 }