// Some fix
This commit is contained in:
1 parent
d735496159
commit
cd627113b6
2 files changed
+72
-17
No files matched your search
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
class AdminAttributesGroupsControllerCore extends AdminController
|
class AdminAttributesGroupsControllerCore extends AdminController
|
||||||
{
|
{
|
||||||
|
public $bootstrap = true;
|
||||||
protected $id_attribute;
|
protected $id_attribute;
|
||||||
protected $position_identifier = 'id_attribute_group';
|
protected $position_identifier = 'id_attribute_group';
|
||||||
protected $attribute_name;
|
protected $attribute_name;
|
||||||
@@ -43,7 +44,8 @@ class AdminAttributesGroupsControllerCore extends AdminController
|
|||||||
$this->fields_list = array(
|
$this->fields_list = array(
|
||||||
'id_attribute_group' => array(
|
'id_attribute_group' => array(
|
||||||
'title' => $this->l('ID'),
|
'title' => $this->l('ID'),
|
||||||
'align' => 'center'
|
'align' => 'center',
|
||||||
|
'class' => 'fixed-width-xs'
|
||||||
),
|
),
|
||||||
'name' => array(
|
'name' => array(
|
||||||
'title' => $this->l('Name'),
|
'title' => $this->l('Name'),
|
||||||
@@ -528,7 +530,7 @@ class AdminAttributesGroupsControllerCore extends AdminController
|
|||||||
if ($this->display == 'view')
|
if ($this->display == 'view')
|
||||||
{
|
{
|
||||||
$this->page_header_toolbar_title = $this->attribute_name[$this->context->employee->id_lang];
|
$this->page_header_toolbar_title = $this->attribute_name[$this->context->employee->id_lang];
|
||||||
$this->page_header_toolbar_btn['new_attribute_group'] = array(
|
$this->page_header_toolbar_btn['back_to_list'] = array(
|
||||||
'href' => self::$currentIndex.'&token='.$this->token,
|
'href' => self::$currentIndex.'&token='.$this->token,
|
||||||
'desc' => $this->l('Back to list'),
|
'desc' => $this->l('Back to list'),
|
||||||
'icon' => 'process-icon-back'
|
'icon' => 'process-icon-back'
|
||||||
|
|||||||
@@ -25,9 +25,9 @@
|
|||||||
*/
|
*/
|
||||||
class AdminFeaturesControllerCore extends AdminController
|
class AdminFeaturesControllerCore extends AdminController
|
||||||
{
|
{
|
||||||
public $bootstrap = true ;
|
public $bootstrap = true;
|
||||||
|
|
||||||
protected $position_identifier = 'id_feature';
|
protected $position_identifier = 'id_feature';
|
||||||
|
protected $feature_name;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -37,7 +37,9 @@ class AdminFeaturesControllerCore extends AdminController
|
|||||||
|
|
||||||
$this->fields_list = array(
|
$this->fields_list = array(
|
||||||
'id_feature' => array(
|
'id_feature' => array(
|
||||||
'title' => $this->l('ID')
|
'title' => $this->l('ID'),
|
||||||
|
'align' => 'center',
|
||||||
|
'class' => 'fixed-width-xs'
|
||||||
),
|
),
|
||||||
'name' => array(
|
'name' => array(
|
||||||
'title' => $this->l('Name'),
|
'title' => $this->l('Name'),
|
||||||
@@ -75,7 +77,7 @@ class AdminFeaturesControllerCore extends AdminController
|
|||||||
{
|
{
|
||||||
$this->addRowAction('edit');
|
$this->addRowAction('edit');
|
||||||
$this->addRowAction('delete');
|
$this->addRowAction('delete');
|
||||||
$this->addRowAction('details');
|
$this->addRowAction('view');
|
||||||
$this->_defaultOrderBy = 'position';
|
$this->_defaultOrderBy = 'position';
|
||||||
|
|
||||||
// Added specific button in toolbar
|
// Added specific button in toolbar
|
||||||
@@ -112,6 +114,43 @@ class AdminFeaturesControllerCore extends AdminController
|
|||||||
$this->identifier = 'id_feature';
|
$this->identifier = 'id_feature';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function renderView()
|
||||||
|
{
|
||||||
|
if (($id = Tools::getValue('id_feature')))
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->setTypeValue();
|
||||||
|
$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->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);
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::renderList();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* method call when ajax request is made with the details row action
|
* method call when ajax request is made with the details row action
|
||||||
* @see AdminController::postProcess()
|
* @see AdminController::postProcess()
|
||||||
@@ -214,17 +253,29 @@ class AdminFeaturesControllerCore extends AdminController
|
|||||||
|
|
||||||
public function initPageHeaderToolbar()
|
public function initPageHeaderToolbar()
|
||||||
{
|
{
|
||||||
$this->page_header_toolbar_title = $this->l('Features');
|
if ($this->display == 'view')
|
||||||
$this->page_header_toolbar_btn['new_feature'] = array(
|
{
|
||||||
'href' => self::$currentIndex.'&addfeature&token='.$this->token,
|
$this->page_header_toolbar_title = $this->feature_name[$this->context->employee->id_lang];
|
||||||
'desc' => $this->l('Add new feature'),
|
$this->page_header_toolbar_btn['back_to_list'] = array(
|
||||||
'icon' => 'process-icon-new'
|
'href' => self::$currentIndex.'&token='.$this->token,
|
||||||
);
|
'desc' => $this->l('Back to list'),
|
||||||
$this->page_header_toolbar_btn['new_feature_value'] = array(
|
'icon' => 'process-icon-back'
|
||||||
'href' => self::$currentIndex.'&addfeature_value&token='.$this->token,
|
);
|
||||||
'desc' => $this->l('Add new feature value'),
|
}
|
||||||
'icon' => 'process-icon-new'
|
else
|
||||||
);
|
{
|
||||||
|
$this->page_header_toolbar_title = $this->l('Features');
|
||||||
|
$this->page_header_toolbar_btn['new_feature'] = array(
|
||||||
|
'href' => self::$currentIndex.'&addfeature&token='.$this->token,
|
||||||
|
'desc' => $this->l('Add new feature'),
|
||||||
|
'icon' => 'process-icon-new'
|
||||||
|
);
|
||||||
|
$this->page_header_toolbar_btn['new_feature_value'] = array(
|
||||||
|
'href' => self::$currentIndex.'&addfeature_value&token='.$this->token,
|
||||||
|
'desc' => $this->l('Add new feature value'),
|
||||||
|
'icon' => 'process-icon-new'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
parent::initPageHeaderToolbar();
|
parent::initPageHeaderToolbar();
|
||||||
}
|
}
|
||||||
@@ -263,6 +314,8 @@ class AdminFeaturesControllerCore extends AdminController
|
|||||||
'desc' => $this->l('Back to the list')
|
'desc' => $this->l('Back to the list')
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
case 'view':
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
parent::initToolbar();
|
parent::initToolbar();
|
||||||
|
|||||||
Reference in new issue
Block a user