// Fix some bug on advanced stock management

This commit is contained in:
rGaillard
2012-07-11 15:46:39 +00:00
parent 9195b74cb7
commit 3672b02c66
10 changed files with 66 additions and 41 deletions
+7 -4
View File
@@ -137,8 +137,8 @@ class HelperFormCore extends Helper
break;
case 'shop' :
$params['html'] = $this->renderAssoShop($params['type']);
$shops = Shop::getShops(true, null, true);
$disable_shops = isset($params['disable_shared']) ? $params['disable_shared'] : false;
$params['html'] = $this->renderAssoShop($disable_shops);
if (Shop::getTotalShops(false) == 1)
unset($this->fields_form[$fieldset_key]['form']['input'][$key]);
break;
@@ -190,7 +190,7 @@ class HelperFormCore extends Helper
*
* @return string
*/
public function renderAssoShop()
public function renderAssoShop($disable_shared = false)
{
if (!Shop::isFeatureActive())
return;
@@ -228,8 +228,11 @@ class HelperFormCore extends Helper
$tpl = $this->createTemplate('assoshop.tpl');
$tree = Shop::getTree();
$nb_shop = 0;
foreach ($tree as $value)
foreach ($tree as &$value)
{
$value['disable_shops'] = (isset($value[$disable_shared]) && $value[$disable_shared]);
$nb_shop += count($value['shops']);
}
$tpl->assign(array(
'input' => array(
'type' => 'shop',