[-] BO : BugFix #PSTEST-561 customer creation in fancybox is improved : you cannot select the visitor and guest group as the default group and theses groups are unchecked for the group access

This commit is contained in:
vChabot committed 2012-01-26 17:31:55 +00:00
1 parent dcfd95f959
commit 41430e40cb
1 file changed
+15 -3
+15 -3
View File
@@ -358,7 +358,21 @@ class AdminCustomersControllerCore extends AdminController
'values' => $groups, 'values' => $groups,
'required' => true, 'required' => true,
'desc' => $this->l('Check all the box(es) of groups of which the customer is to be a member') 'desc' => $this->l('Check all the box(es) of groups of which the customer is to be a member')
), )
)
);
// if we add a customer via fancybox (ajax), it's a customer and he doesn't need to be added to the visitor and guest groups
if (Tools::isSubmit('addcustomer') && Tools::isSubmit('submitFormAjax'))
{
$visitor_group = Configuration::get('PS_UNIDENTIFIED_GROUP');
$guest_group = Configuration::get('PS_GUEST_GROUP');
foreach ($groups as $key => $g)
if (in_array($g['id_group'], array($visitor_group, $guest_group)))
unset($groups[$key]);
}
$this->fields_form['input'][] =
array( array(
'type' => 'select', 'type' => 'select',
'label' => $this->l('Default group:'), 'label' => $this->l('Default group:'),
@@ -370,8 +384,6 @@ class AdminCustomersControllerCore extends AdminController
), ),
'hint' => $this->l('The group will be as applied by default.'), 'hint' => $this->l('The group will be as applied by default.'),
'desc' => $this->l('Apply the discount\'s price of this group.') 'desc' => $this->l('Apply the discount\'s price of this group.')
)
)
); );
// if customer is a guest customer, password hasn't to be there // if customer is a guest customer, password hasn't to be there