[-] BO : fix bug #PSTEST-988 - Attribute values wrong toolbar title

This commit is contained in:
tDidierjean
2012-03-08 14:12:20 +00:00
parent 08526a9d79
commit ef886e7f16
2 changed files with 13 additions and 7 deletions
@@ -27,6 +27,8 @@
class AdminAttributesGroupsControllerCore extends AdminController class AdminAttributesGroupsControllerCore extends AdminController
{ {
protected $id_attribute;
public function __construct() public function __construct()
{ {
$this->context = Context::getContext(); $this->context = Context::getContext();
@@ -469,11 +471,11 @@ class AdminAttributesGroupsControllerCore extends AdminController
'desc' => $this->l('Save') 'desc' => $this->l('Save')
); );
if ($this->display == 'editAttributes') if ($this->display == 'editAttributes' && !$this->id_attribute)
$this->toolbar_btn['save-and-stay'] = array( $this->toolbar_btn['save-and-stay'] = array(
'short' => 'SaveAndStay', 'short' => 'SaveAndStay',
'href' => '#', 'href' => '#',
'desc' => $this->l('Save and add'), 'desc' => $this->l('Save then add another value'),
'force_desc' => true, 'force_desc' => true,
); );
@@ -507,18 +509,18 @@ class AdminAttributesGroupsControllerCore extends AdminController
switch ($this->display) switch ($this->display)
{ {
case 'edit': case 'edit':
$current_tab = array_pop($tabs);
$tabs[] = array('name' => $this->l('Edit new Attribute')); $tabs[] = array('name' => $this->l('Edit new Attribute'));
break; break;
case 'add': case 'add':
$current_tab = array_pop($tabs);
$tabs[] = array('name' => $this->l('Add new Attribute')); $tabs[] = array('name' => $this->l('Add new Attribute'));
break; break;
case 'editAttributes': case 'editAttributes':
$current_tab = array_pop($tabs); if ($this->id_attribute)
$tabs[] = array('name' => $this->l('Add new Value')); $tabs[] = array('name' => $this->l('Edit Value'));
else
$tabs[] = array('name' => $this->l('Add new Value'));
break; break;
} }
// note : this should use a tpl file // note : this should use a tpl file
@@ -536,7 +538,10 @@ class AdminAttributesGroupsControllerCore extends AdminController
parent::initProcess(); parent::initProcess();
if ($this->table == 'attribute') if ($this->table == 'attribute')
{
$this->display = 'editAttributes'; $this->display = 'editAttributes';
$this->id_attribute = (int)Tools::getValue('id_attribute');
}
} }
protected function defineObjectTypeAttribute() protected function defineObjectTypeAttribute()
+2 -1
View File
@@ -162,12 +162,13 @@ $_LANGADM['AdminAttributesGroups4e140ba723a03baa6948340bf90e2ef6'] = 'Nom :';
$_LANGADM['AdminAttributesGroups4f7922279a02c666c5504da88da4ae1b'] = 'Choisir le type d\'attribut'; $_LANGADM['AdminAttributesGroups4f7922279a02c666c5504da88da4ae1b'] = 'Choisir le type d\'attribut';
$_LANGADM['AdminAttributesGroups5204077231fc7164e2269e96b584dd95'] = 'Liste déroulante'; $_LANGADM['AdminAttributesGroups5204077231fc7164e2269e96b584dd95'] = 'Liste déroulante';
$_LANGADM['AdminAttributesGroups52f5e0bc3859bc5f5e25130b6c7e8881'] = 'Position'; $_LANGADM['AdminAttributesGroups52f5e0bc3859bc5f5e25130b6c7e8881'] = 'Position';
$_LANGADM['AdminAttributesGroups577cf2cf1be74419ac04093a2b4cd64d'] = 'Modifier une valeur';
$_LANGADM['AdminAttributesGroups6252c0f2c2ed83b7b06dfca86d4650bb'] = 'Caractères interdits :'; $_LANGADM['AdminAttributesGroups6252c0f2c2ed83b7b06dfca86d4650bb'] = 'Caractères interdits :';
$_LANGADM['AdminAttributesGroups630f6dc397fe74e52d5189e2c80f282b'] = 'Retour à la liste'; $_LANGADM['AdminAttributesGroups630f6dc397fe74e52d5189e2c80f282b'] = 'Retour à la liste';
$_LANGADM['AdminAttributesGroups689202409e48743b914713f96d93947c'] = 'Valeur'; $_LANGADM['AdminAttributesGroups689202409e48743b914713f96d93947c'] = 'Valeur';
$_LANGADM['AdminAttributesGroups68efc336eb9a43e50d8115b6b712aca9'] = 'Sauvegarde et Ajouter';
$_LANGADM['AdminAttributesGroups6c451a8f2e9598b41a6968542cbe6061'] = 'Type d\'attribut:'; $_LANGADM['AdminAttributesGroups6c451a8f2e9598b41a6968542cbe6061'] = 'Type d\'attribut:';
$_LANGADM['AdminAttributesGroups76a2e1080cd661b42c6653fc8fd57367'] = 'Texture :'; $_LANGADM['AdminAttributesGroups76a2e1080cd661b42c6653fc8fd57367'] = 'Texture :';
$_LANGADM['AdminAttributesGroups7d5672f569de406c85249db6f1c99ec0'] = 'Enregistrer puis ajouter une nouvelle valeur';
$_LANGADM['AdminAttributesGroups859c7c7ffc3e60f67f6537f4d7dd98ca'] = 'La texture actuelle :'; $_LANGADM['AdminAttributesGroups859c7c7ffc3e60f67f6537f4d7dd98ca'] = 'La texture actuelle :';
$_LANGADM['AdminAttributesGroups9a63ec735f057c1366284bda67eee7de'] = 'Performances'; $_LANGADM['AdminAttributesGroups9a63ec735f057c1366284bda67eee7de'] = 'Performances';
$_LANGADM['AdminAttributesGroups9c29287ce313fd9ed3e9a86e1af4f4b3'] = 'Couleurs HTML uniquement (par exemple,'; $_LANGADM['AdminAttributesGroups9c29287ce313fd9ed3e9a86e1af4f4b3'] = 'Couleurs HTML uniquement (par exemple,';