// fix shop association generation with HelperForm

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9862 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-11-03 17:27:30 +00:00
parent 17b7d300b7
commit c88bcde30e
5 changed files with 12 additions and 5 deletions
@@ -255,10 +255,7 @@
{elseif $input.type == 'categories'}
{include file='helper/form/form_category.tpl' categories=$input.values}
{elseif $input.type == 'asso_shop' && isset($asso_shop) && $asso_shop}
<label>{l s='Shop association:'}</label>
<div class="margin-form">
{$asso_shop}
</div>
{elseif $input.type == 'color'}
<script type="text/javascript" src="../js/jquery/jquery-colorpicker.js"></script>
<input type="color"
+1
View File
@@ -279,6 +279,7 @@ class HelperCore
$assos = array();
$sql = 'SELECT id_'.$type.', `'.pSQL($this->identifier).'`
FROM `'._DB_PREFIX_.pSQL($this->table).'_'.$type.'`';
foreach (Db::getInstance()->executeS($sql) as $row)
$assos[$row['id_'.$type]][] = $row[$this->identifier];
+7 -1
View File
@@ -75,6 +75,12 @@ class HelperFormCore extends Helper
if ($this->submit_action == '')
$this->submit_action = 'submitAdd'.$this->table;
if (isset($this->fields_form['asso_shop']) && Shop::isFeatureActive())
if ($this->fields_form['asso_shop'] == 'group')
$asso_shop = $this->displayAssoShop('group_shop');
elseif ($this->fields_form['asso_shop'] == 'shop')
$asso_shop = $this->displayAssoShop();
$iso = $this->context->language->iso_code;
$this->tpl->assign(array(
'submit_action' => $this->submit_action,
@@ -95,7 +101,7 @@ class HelperFormCore extends Helper
'vat_number' => file_exists(_PS_MODULE_DIR_.'vatnumber/ajax.php'),
'module_dir' => _MODULE_DIR_,
'contains_states' => (isset($this->fields_value['id_country']) && isset($this->fields_value['id_state'])) ? Country::containsStates($this->fields_value['id_country']) : null,
'asso_shop' => (isset($this->fields_form['asso_shop']) && $this->fields_form['asso_shop']) ? $this->displayAssoShop() : null,
'asso_shop' => isset($asso_shop) ? $asso_shop : null,
'iso' => file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en',
'path_css' => _THEME_CSS_DIR_,
'ad' => dirname($_SERVER["PHP_SELF"]),
@@ -218,6 +218,7 @@ class AdminCurrenciesControllerCore extends AdminController
),
array(
'type' => 'asso_shop',
'label' => 'Shop:',
'name' => ''
)
),
@@ -225,7 +226,7 @@ class AdminCurrenciesControllerCore extends AdminController
'title' => $this->l(' Save '),
'class' => 'button'
),
'asso_shop' => Shop::isFeatureActive()
'asso_shop' => 'shop'
);
parent::__construct();
}
@@ -80,9 +80,11 @@ class AdminZonesControllerCore extends AdminController
),
array(
'type' => 'asso_shop',
'label' => 'Shop groups:',
'name' => ''
)
),
'asso_shop' => 'group',
'submit' => array(
'title' => $this->l(' Save '),
'class' => 'button'