Suite à MAJ 2.3.4, il manquait des choses dans des templates

This commit is contained in:
2020-05-03 09:13:06 +02:00
parent 35a800ca0e
commit 3f71343401
212 changed files with 1396 additions and 7451 deletions

View File

@@ -124,7 +124,7 @@
<select class="form-control" id="cat_source" name="cat_source" size="10" multiple>
{loop type="category-tree" category=0 name="available-categories" backend_context=1}
{$selected = in_array($ID, $value)}
<option {if $selected}disabled class="disabled-select-option"{/if}style="padding-left: {$LEVEL * 20}px" value="{$ID}">{$TITLE}</option>
<option {if $selected}disabled class="disabled-select-option"{/if} value="{$ID}">{option_offset l=$LEVEL label={$TITLE}}</option>
{/loop}
</select>
</div>
@@ -142,7 +142,7 @@
{form_field field="categories"}
<div class="form-group ">
<label for="cat_source" class="control-label">{intl l='Selected categories'}</label>
<select {form_field_attributes field='categories'}'>
<select {form_field_attributes field='categories'}>
{* protect ourselves against empty $value, which causes all categories to be displayed *}
{if empty($value)}{$value = [ 0 ]}{/if}
{loop type="category" category=0 name="selected-of-categories" id={$value|default:0|implode:','} backend_context=1 return_url=false}
@@ -252,14 +252,37 @@
<script>
(function($) {
{* data-date-format is a moment.js date format *}
var loadingProduct = true;
{* data-date-format is a moment.js date format *}
{$langcode = {lang attr="code"}|substr:0:2}
$('.datetime-picker').datetimepicker({
locale: "{$langcode}"
}).on('dp.change', function(e) {
if ($(this).attr('id')=='start_date') {
$('#end_date').data('DateTimePicker').minDate(e.date);
} else if ($(this).attr('id')=='end_date') {
$('#start_date').data('DateTimePicker').maxDate(e.date);
}
});
// prevent form submission during products load
$(document.body).on('submit', '#sale-update-form', function(ev) {
if (loadingProduct) {
return false;
}
});
if ($('#sale-update-form #start_date').val()!='') {
$('#sale-update-form #end_date').data('DateTimePicker').minDate($('#sale-update-form #start_date').val());
}
if ($('#sale-update-form #end_date').val()!='') {
$('#sale-update-form #start_date').data('DateTimePicker').maxDate($('#sale-update-form #end_date').val());
}
$(document.body).on('change', '.invert-selection', function(ev) {
var checked = $(this).prop('checked');
@@ -426,6 +449,7 @@
});
}
loadingProduct = true;
$('#sale-products-list').empty();
$.ajax('{url path="/admin/sale/update-product-list/%id" id=$sale_id}', {
@@ -443,6 +467,8 @@
$.each(selected_attributes, function(productId, attrAvIdsStr) {
setProductAttributeIds(productId, attrAvIdsStr);
});
loadingProduct = false;
});
}
@@ -480,4 +506,4 @@
{hook name="sale.edit-js" location='sale-edit-js' sale_id={$sale_id}}
{hook name="wysiwyg.js" location="wysiwyg-sale-edit-js" }
{/block}
{/block}