// AdminControllers fixes

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10821 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-11-30 18:16:13 +00:00
parent 29c75d7798
commit bca384dc71
4 changed files with 17 additions and 7 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ class AdminCartsController extends AdminController
), ),
'customer' => array( 'customer' => array(
'title' => $this->l('Customer'), 'title' => $this->l('Customer'),
'width' => 80, 'width' => 'auto',
'filter_key' => 'c!lastname' 'filter_key' => 'c!lastname'
), ),
'total' => array( 'total' => array(
+3 -2
View File
@@ -60,7 +60,7 @@ class AdminGendersController extends AdminController
), ),
'name' => array( 'name' => array(
'title' => $this->l('Name'), 'title' => $this->l('Name'),
'width' => 150, 'width' => 'auto',
'filter_key' => 'b!name' 'filter_key' => 'b!name'
), ),
'type' => array( 'type' => array(
@@ -82,7 +82,8 @@ class AdminGendersController extends AdminController
'align' => 'center', 'align' => 'center',
'image' => 'genders', 'image' => 'genders',
'orderby' => false, 'orderby' => false,
'search' => false 'search' => false,
'width' => 40
) )
); );
+1 -1
View File
@@ -51,7 +51,7 @@ class AdminGroupsController extends AdminController
$this->fieldsDisplay = array( $this->fieldsDisplay = array(
'id_group' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'id_group' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
'name' => array('title' => $this->l('Name'), 'width' => 'auto', 'filter_key' => 'b!name'), 'name' => array('title' => $this->l('Name'), 'width' => 80, 'filter_key' => 'b!name'),
'reduction' => array('title' => $this->l('Discount'), 'width' => 50, 'align' => 'right'), 'reduction' => array('title' => $this->l('Discount'), 'width' => 50, 'align' => 'right'),
'nb' => array('title' => $this->l('Members'), 'width' => 25, 'align' => 'center'), 'nb' => array('title' => $this->l('Members'), 'width' => 25, 'align' => 'center'),
'date_add' => array('title' => $this->l('Creation date'), 'width' => 60, 'type' => 'date', 'align' => 'right')); 'date_add' => array('title' => $this->l('Creation date'), 'width' => 60, 'type' => 'date', 'align' => 'right'));
+12 -3
View File
@@ -85,18 +85,27 @@ class AdminPaymentControllerCore extends AdminController
} }
public function postProcess() public function postProcess()
{
if ($this->action)
$this->saveRestrictions($this->action);
}
public function initProcess()
{ {
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
{ {
if (Tools::isSubmit('submitModulecountry')) if (Tools::isSubmit('submitModulecountry'))
$this->saveRestrictions('country'); $this->action = 'country';
else if (Tools::isSubmit('submitModulecurrency')) else if (Tools::isSubmit('submitModulecurrency'))
$this->saveRestrictions('currency'); $this->action ='currency';
else if (Tools::isSubmit('submitModulegroup')) else if (Tools::isSubmit('submitModulegroup'))
$this->saveRestrictions('group'); $this->action ='group';
} }
else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
} }
private function saveRestrictions($type) private function saveRestrictions($type)
{ {
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'module_'.bqSQL($type).'` WHERE id_shop = '.Context::getContext()->shop->getID(true)); Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'module_'.bqSQL($type).'` WHERE id_shop = '.Context::getContext()->shop->getID(true));