[+] BO : now you can choose type of attribute group (select , color, radio)

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8691 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vAugagneur
2011-09-21 14:29:32 +00:00
parent 5bc5979e2d
commit 8b6ec916e0
15 changed files with 204 additions and 146 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ class AdminAttributes extends AdminTab
<script type="text/javascript">
var attributesGroups = {';
foreach ($attributes_groups AS $attribute_group)
$strAttributesGroups .= '"'.$attribute_group['id_attribute_group'].'" : '.$attribute_group['is_color_group'].',';
$strAttributesGroups .= '"'.$attribute_group['id_attribute_group'].'" : '.($attribute_group['group_type'] == 'color' ? '1' : '0' ) .',';
echo $strAttributesGroups.'};
</script>
<form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.($token ? $token : $this->token).'" method="post" enctype="multipart/form-data">
+7 -6
View File
@@ -244,13 +244,14 @@ class AdminAttributesGroups extends AdminTab
echo '
<div class="clear"></div>
</div>
<label>'.$this->l('Color group:').' </label>
<label>'.$this->l('Group type:').' </label>
<div class="margin-form">
<input type="radio" name="is_color_group" id="is_color_group_on" value="1" '.($this->getFieldValue($obj, 'is_color_group') ? 'checked="checked" ' : '').'/>
<label class="t" for="is_color_group_on"><img src="../img/admin/enabled.gif" alt="'.$this->l('Enabled').'" title="'.$this->l('Yes').'" /></label>
<input type="radio" name="is_color_group" id="is_color_group_off" value="0" '.(!$this->getFieldValue($obj, 'is_color_group') ? 'checked="checked" ' : '').'/>
<label class="t" for="is_color_group_off"><img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('No').'" /></label>
<p>'.$this->l('This is a color group').'</p>
<select name="group_type">
<option value="select" '.($this->getFieldValue($obj, 'group_type') == 'select' ? 'selected="selected" ' : '').'>'.$this->l('Select').'</option>
<option value="radio" '.($this->getFieldValue($obj, 'group_type') == 'radio' ? 'selected="selected" ' : '').'>'.$this->l('Radio button').'</option>
<option value="color" '.($this->getFieldValue($obj, 'group_type') == 'color' ? 'selected="selected" ' : '').'>'.$this->l('Color').'</option>
</select>
<p>'.$this->l('Choose the type of the attribute group').'</p>
</div>';
if (Shop::isMultiShopActivated())
{
+1 -22
View File
@@ -3611,28 +3611,7 @@ class AdminProducts extends AdminTab
var s_impact2 = document.getElementById(\'span_weight_impact\');
init_elems();
</script>
<hr style="width:100%;" />
<table cellpadding="5">
<tr>
<td class="col-left"><b>'.$this->l('Color picker:').'</b></td>
<td style="padding-bottom:5px;">
<select name="id_color_default">
<option value="0">'.$this->l('Do not display').'</option>';
foreach ($attributes_groups AS $k => $attribute_group)
if (isset($groups[$attribute_group['id_attribute_group']]))
echo '<option value="'.(int)($attribute_group['id_attribute_group']).'"
'.((int)($attribute_group['id_attribute_group']) == (int)($obj->id_color_default) ? 'selected="selected"' : '').'>'
.htmlentities(stripslashes($attribute_group['name']), ENT_COMPAT, 'UTF-8').
'</option>';
echo '
</select>
&nbsp;&nbsp;<input type="submit" value="'.$this->l('OK').'" name="submitAdd'.$this->table.'AndStay" class="button" />
&nbsp;&nbsp;&nbsp;&nbsp;<a href="index.php?tab=AdminAttributesGroups&token='.Tools::getAdminToken('AdminAttributesGroups'.(int)(Tab::getIdFromClassName('AdminAttributesGroups')).(int)$this->context->employee->id).'" onclick="return confirm(\''.$this->l('Are you sure you want to delete entered product information?', __CLASS__, true, false).'\');"><img src="../img/admin/asterisk.gif" alt="" /> '.$this->l('Color attribute management').'</a>
<p >'.$this->l('Activate the color choice by selecting a color attribute group.').'</p>
</td>
</tr>
</table>';
</script>';
}
else
echo '<b>'.$this->l('You must save this product before adding combinations').'.</b>';