[-] BO : fixed bug #PSCFV-2342 - fix issue on Admin Tab position
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15398 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -88,6 +88,11 @@ class AdminTabsControllerCore extends AdminController
|
||||
public function renderForm()
|
||||
{
|
||||
$tabs = Tab::getTabs($this->context->language->id, 0);
|
||||
// If editing, we clean itself
|
||||
if (Tools::isSubmit('id_tab'))
|
||||
foreach ($tabs as $key => $tab)
|
||||
if ($tab['id_tab'] == Tools::getValue('id_tab'))
|
||||
unset($tabs[$key]);
|
||||
|
||||
// added category "Home" in var $tabs
|
||||
$tab_zero = array(
|
||||
@@ -254,11 +259,11 @@ class AdminTabsControllerCore extends AdminController
|
||||
if ($tab->move($direction))
|
||||
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token);
|
||||
}
|
||||
else if (Tools::getValue('position') && !Tools::isSubmit('submitAdd'.$this->table))
|
||||
elseif (Tools::getValue('position') && !Tools::isSubmit('submitAdd'.$this->table))
|
||||
{
|
||||
if ($this->tabAccess['edit'] !== '1')
|
||||
$this->errors[] = Tools::displayError('You do not have permission to edit here.');
|
||||
else if (!Validate::isLoadedObject($object = new Tab((int)Tools::getValue($this->identifier))))
|
||||
elseif (!Validate::isLoadedObject($object = new Tab((int)Tools::getValue($this->identifier))))
|
||||
$this->errors[] = Tools::displayError('An error occurred while updating status for object.').
|
||||
' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
|
||||
if (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position')))
|
||||
@@ -266,6 +271,8 @@ class AdminTabsControllerCore extends AdminController
|
||||
else
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf=5&token='.Tools::getAdminTokenLite('AdminTabs'));
|
||||
}
|
||||
elseif (Tools::isSubmit('submitAddtab') && Tools::getValue('id_tab') == Tools::getValue('id_parent'))
|
||||
$this->errors[] = Tools::displayError('You can\'t put this tab in itself');
|
||||
else
|
||||
{
|
||||
// Temporary add the position depend of the selection of the parent category
|
||||
@@ -314,4 +321,4 @@ class AdminTabsControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user