mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 22:13:13 +00:00
66 lines
1.9 KiB
Twig
66 lines
1.9 KiB
Twig
<form method="POST" action="/prod/baskets/">
|
|
|
|
<label>{% trans 'Nom du nouveau panier' %}</label>
|
|
<input name="name" value="" type="text"/>
|
|
|
|
<label>{% trans 'paniers::description du nouveau panier' %}</label>
|
|
<textarea name="description"></textarea>
|
|
|
|
<label for="new_basket_add_sel" class="checkbox">
|
|
<input type="checkbox" name="lst" value="" id="new_basket_add_sel"/>
|
|
{% trans 'Ajouter ma selection courrante' %}
|
|
</label>
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
|
|
var $dialog = p4.Dialog.get(1);
|
|
var $dialogBox = $dialog.getDomElement();
|
|
|
|
$('input[name="lst"]', $dialogBox).val(p4.Results.Selection.serialize());
|
|
|
|
var buttons = $dialog.getOption('buttons');
|
|
|
|
buttons[language.create] = function(){
|
|
$('form', $dialogBox).trigger('submit')
|
|
};
|
|
|
|
$dialog.setOption('buttons', buttons);
|
|
|
|
$('form', $dialogBox).bind('submit', function(event){
|
|
|
|
var $form = $(this);
|
|
var dialog = $dialogBox.closest('.ui-dialog');
|
|
var buttonPanel = dialog.find('.ui-dialog-buttonpane');
|
|
|
|
$.ajax({
|
|
type: $form.attr('method'),
|
|
url: $form.attr('action'),
|
|
data: $form.serializeArray(),
|
|
dataType: 'json',
|
|
beforeSend:function(){
|
|
$(":button:contains('" + language.create + "')", buttonPanel)
|
|
.attr("disabled", true).addClass("ui-state-disabled");
|
|
},
|
|
success: function(data){
|
|
|
|
p4.WorkZone.refresh(data.basket.id);
|
|
p4.Dialog.Close(1);
|
|
|
|
return;
|
|
},
|
|
error: function(){
|
|
$(":button:contains('" + language.create + "')", buttonPanel)
|
|
.attr("disabled", false).removeClass("ui-state-disabled");
|
|
},
|
|
timeout: function(){
|
|
|
|
}
|
|
});
|
|
|
|
return false;
|
|
});
|
|
});
|
|
</script>
|
|
</form>
|