// Combinations are now saved using the global save product action (#PSTEST-354)

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12417 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2012-01-16 09:28:15 +00:00
parent 5865dd7cf7
commit 4e42a7fa2a
5 changed files with 10 additions and 12 deletions
@@ -43,6 +43,7 @@
var msg_combination_1 = '{l s='Please choose an attribute'}'; var msg_combination_1 = '{l s='Please choose an attribute'}';
var msg_combination_2 = '{l s='Please choose a value'}'; var msg_combination_2 = '{l s='Please choose a value'}';
var msg_combination_3 = '{l s='You can only add one combination per type of attribute'}'; var msg_combination_3 = '{l s='You can only add one combination per type of attribute'}';
var msg_new_combination = '{l s='New combination'}';
</script> </script>
@@ -322,9 +323,6 @@
<tr> <tr>
<td style="width:150px">&nbsp;</td> <td style="width:150px">&nbsp;</td>
<td style="padding-bottom:5px;"> <td style="padding-bottom:5px;">
<span style="float: left;">
<input type="submit" name="submitProductAttribute" id="submitProductAttribute" value="{l s='Add this combination'}" class="button" onclick="attr_selectall(); this.form.action += '&addproduct&tabs=3';" add="{l s='Add this combination'}" update="{l s='Update this combination'}" />
</span>
<span id="ResetSpan" style="float:left;margin-left:8px;display:none;"> <span id="ResetSpan" style="float:left;margin-left:8px;display:none;">
<input type="reset" name="ResetBtn" id="ResetBtn" onclick="init_elems();getE('id_product_attribute').value = 0;" class="button" value="{l s='Cancel modification'}" /> <input type="reset" name="ResetBtn" id="ResetBtn" onclick="init_elems();getE('id_product_attribute').value = 0;" class="button" value="{l s='Cancel modification'}" />
</span> </span>
@@ -332,6 +330,7 @@
</td> </td>
</tr> </tr>
</table> </table>
<div class="separation"></div>
</div> </div>
{$list} {$list}
@@ -204,7 +204,6 @@
if (btn_name == "Combinations") if (btn_name == "Combinations")
{ {
$('#desc-product-new').hide(); $('#desc-product-new').hide();
disableSave();
$('#desc-product-newCombination').show(); $('#desc-product-newCombination').show();
populate_attrs(); populate_attrs();
} }
@@ -1469,6 +1469,7 @@ class AdminProductsControllerCore extends AdminController
$this->processSuppliers($token); $this->processSuppliers($token);
$this->processWarehouses($token); $this->processWarehouses($token);
$this->processFeatures($token); $this->processFeatures($token);
$this->processProductAttribute($token);
$languages = Language::getLanguages(false); $languages = Language::getLanguages(false);
if (!$this->updatePackItems($object)) if (!$this->updatePackItems($object))
$this->errors[] = Tools::displayError('An error occurred while adding products to the pack.'); $this->errors[] = Tools::displayError('An error occurred while adding products to the pack.');
+1 -3
View File
@@ -40,7 +40,6 @@ function removeButtonCombination(item)
$('#add_new_combination').show(); $('#add_new_combination').show();
$('.process-icon-newCombination').removeClass('toolbar-new'); $('.process-icon-newCombination').removeClass('toolbar-new');
$('.process-icon-newCombination').addClass('toolbar-cancel'); $('.process-icon-newCombination').addClass('toolbar-cancel');
$('#submitProductAttribute').val($('#submitProductAttribute').attr(item));
$('#desc-product-newCombination div').html($('#ResetBtn').val()); $('#desc-product-newCombination div').html($('#ResetBtn').val());
$('id_product_attribute').val(0); $('id_product_attribute').val(0);
init_elems(); init_elems();
@@ -52,8 +51,7 @@ function addButtonCombination(item)
$('#add_new_combination').hide(); $('#add_new_combination').hide();
$('.process-icon-newCombination').removeClass('toolbar-cancel'); $('.process-icon-newCombination').removeClass('toolbar-cancel');
$('.process-icon-newCombination').addClass('toolbar-new'); $('.process-icon-newCombination').addClass('toolbar-new');
$('#submitProductAttribute').val($('#submitProductAttribute').attr(item)); $('#desc-product-newCombination div').html(msg_new_combination);
$('#desc-product-newCombination div').html($('#submitProductAttribute').val());
posC = true; posC = true;
} }
+6 -5
View File
@@ -51,7 +51,6 @@ virtual_product_nb_days, is_shareable)
getE('attribute_ean13').value = ean; getE('attribute_ean13').value = ean;
getE('attribute_upc').value = upc; getE('attribute_upc').value = upc;
getE('submitProductAttribute').value = modifyattributegroup;
getE('attribute_wholesale_price').value = Math.abs(wholesale_price); getE('attribute_wholesale_price').value = Math.abs(wholesale_price);
getE('attribute_price').value = Math.abs(price_impact); getE('attribute_price').value = Math.abs(price_impact);
getE('attribute_weight').value = Math.abs(weight_impact); getE('attribute_weight').value = Math.abs(weight_impact);
@@ -120,8 +119,7 @@ virtual_product_nb_days, is_shareable)
$("#virtual_product_filename_attribute").val(virtual_product_filename_attribute); $("#virtual_product_filename_attribute").val(virtual_product_filename_attribute);
$("#add_new_combination").show(); $("#add_new_combination").show();
/* Reset all combination images */ /* Reset all combination images */
combinationImages = $('#id_image_attr').find("input[id^=id_image_attr_]"); combinationImages = $('#id_image_attr').find("input[id^=id_image_attr_]");
combinationImages.each(function() { combinationImages.each(function() {
@@ -131,13 +129,13 @@ virtual_product_nb_days, is_shareable)
/* Check combination images */ /* Check combination images */
if (typeof(combination_images[id_product_attribute]) != 'undefined') if (typeof(combination_images[id_product_attribute]) != 'undefined')
for (i = 0; i < combination_images[id_product_attribute].length; i++) for (i = 0; i < combination_images[id_product_attribute].length; i++)
getE('id_image_attr_' + combination_images[id_product_attribute][i]).checked = true; $('#id_image_attr_' + combination_images[id_product_attribute][i]).attr('checked', 'checked');
check_impact(); check_impact();
check_weight_impact(); check_weight_impact();
check_unit_impact(); check_unit_impact();
var elem = getE('product_att_list'); var elem = getE('product_att_list');
for (var i = 0; i < old_attr.length; i++) for (var i = 0; i < old_attr.length; i++)
{ {
var opt = document.createElement('option'); var opt = document.createElement('option');
@@ -370,3 +368,6 @@ function openCloseLayer(whichLayer)
style.display = style.display == 'none' ? 'block' : 'none'; style.display = style.display == 'none' ? 'block' : 'none';
} }
$(document).ready(function(){
$('#product_form').submit(function(){attr_selectall();console.log('couou');});
});