Revision 31541882
Added by Serghei Mihai over 11 years ago
| calebasse/actes/templates/actes/act_listing.html | ||
|---|---|---|
|
if ($(this).data('isbilled') == "False")
|
||
|
{
|
||
|
var id = $(this).data('id');
|
||
|
generic_ajaxform_dialog($(this).data('id') + '/update', "Modifier l'acte",
|
||
|
'#acte-dlg', '700px', 'Modifier', '.',
|
||
|
function (dialog) {
|
||
|
var buttons = $(dialog).dialog('option', 'buttons');
|
||
|
buttons.push({
|
||
|
text: "Supprimer",
|
||
|
id: "delete-btn",
|
||
|
click: function () {
|
||
|
$(dialog).dialog('close');
|
||
|
generic_ajaxform_dialog(id + '/delete', "Supprimer l'acte",
|
||
|
'#acte-dlg', '500px', 'Oui', window.location.href);
|
||
|
var delete_button = {
|
||
|
text: "Supprimer",
|
||
|
id: "delete-btn",
|
||
|
click: function () {
|
||
|
$(dialog).dialog('close');
|
||
|
generic_ajaxform_dialog(id + '/delete', "Supprimer l'acte",
|
||
|
'#acte-dlg', '500px', 'Oui', window.location.href);
|
||
|
|
||
|
}
|
||
|
});
|
||
|
$(dialog).dialog('option', 'buttons', buttons);
|
||
|
}
|
||
|
);
|
||
|
}
|
||
|
};
|
||
|
generic_ajaxform_dialog($(this).data('id') + '/update', "Modifier l'acte",
|
||
|
'#acte-dlg', '700px', 'Modifier', '.', function (dialog) {});
|
||
|
} else if ($(this).data('oldbilled') == "True") {
|
||
|
generic_ajaxform_dialog($(this).data('id') + '/rebill', "Refacturer cet acte de l'ancienne facturation) ?",
|
||
|
'#acte-dlg', '700px', 'Refacturer', '.');
|
||
| calebasse/static/js/calebasse.agenda.js | ||
|---|---|---|
|
|
||
|
var id = $(this).data('id');
|
||
|
var delete_url = $(this).data('delete-url');
|
||
|
generic_ajaxform_dialog('/' + service + '/' + app_name + '/' + current_date + '/update-periodic-event/' + id,
|
||
|
'Modifier un évènement périodique', '#ajax-dlg', '900px', 'Modifier', null,
|
||
|
function (dialog) {
|
||
|
$('#ajax-dlg .datepicker-date').datepicker({dateFormat: 'd/m/yy', showOn: 'button'});
|
||
|
var buttons = $(dialog).dialog('option', 'buttons');
|
||
|
var delete_button = {
|
||
|
text: "Supprimer",
|
||
|
id: "delete-btn",
|
||
|
click: function () {
|
||
|
var delete_button = {
|
||
|
text: "Supprimer",
|
||
|
id: "delete-btn",
|
||
|
click: function () {
|
||
|
var r = delete_prompt("Etes-vous sûr de vouloir supprimer cet évènement récurrent ?");
|
||
|
if (r == true)
|
||
|
{
|
||
| ... | ... | |
|
}
|
||
|
}
|
||
|
};
|
||
|
buttons.push(delete_button);
|
||
|
$(dialog).dialog('option', 'buttons', buttons);
|
||
|
}
|
||
|
generic_ajaxform_dialog('/' + service + '/' + app_name + '/' + current_date + '/update-periodic-event/' + id,
|
||
|
'Modifier un évènement périodique', '#ajax-dlg', '900px', 'Modifier', null,
|
||
|
function (dialog) {
|
||
|
$('#ajax-dlg .datepicker-date').datepicker({dateFormat: 'd/m/yy', showOn: 'button'});
|
||
|
}, null, delete_button
|
||
|
);
|
||
|
});
|
||
|
$(base).on('click', '.update-periodic-rdv', function () {
|
||
|
$('.ui-icon-closethick').click();
|
||
|
var id = $(this).data('id');
|
||
|
var delete_url = $(this).data('delete-url');
|
||
|
generic_ajaxform_dialog('/' + service + '/' + app_name + '/' + current_date + '/update-periodic-rdv/' + id,
|
||
|
'Modifier un rendez-vous périodique', '#ajax-dlg', '900px', 'Modifier', null,
|
||
|
function (dialog) {
|
||
|
$('#ajax-dlg .datepicker-date').datepicker({dateFormat: 'd/m/yy', showOn: 'button'});
|
||
|
var buttons = $(dialog).dialog('option', 'buttons');
|
||
|
buttons.push({
|
||
|
text: "Supprimer",
|
||
|
id: "delete-btn",
|
||
|
click: function () {
|
||
|
var delete_button = {
|
||
|
text: "Supprimer",
|
||
|
id: "delete-btn",
|
||
|
click: function () {
|
||
|
var r = delete_prompt("Etes-vous sûr de vouloir supprimer ce rendez-vous récurrent ?");
|
||
|
if (r == true)
|
||
|
{
|
||
| ... | ... | |
|
}
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
$(dialog).dialog('option', 'buttons', buttons);
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
generic_ajaxform_dialog('/' + service + '/' + app_name + '/' + current_date + '/update-periodic-rdv/' + id,
|
||
|
'Modifier un rendez-vous périodique', '#ajax-dlg', '900px', 'Modifier', null,
|
||
|
function (dialog) {
|
||
|
$('#ajax-dlg .datepicker-date').datepicker({dateFormat: 'd/m/yy', showOn: 'button'});
|
||
|
}, null, delete_button
|
||
|
);
|
||
|
});
|
||
|
}
|
||
| calebasse/static/js/calebasse.dialog.js | ||
|---|---|---|
|
$button.removeAttr('disabled');
|
||
|
}
|
||
|
|
||
|
function generic_ajaxform_dialog(url, title, id, width, btn_submit_name, redirectToUrl, on_load_callback, height) {
|
||
|
function generic_ajaxform_dialog(url, title, id, width, btn_submit_name, redirectToUrl, on_load_callback, height, extra_button) {
|
||
|
if (! height)
|
||
|
height = 'auto';
|
||
|
$(id).load(url,
|
||
| ... | ... | |
|
$('form', this).ajaxForm({
|
||
|
success: onsuccess,
|
||
|
});
|
||
|
var buttons = [{text: "Annuler",
|
||
|
id: "close-btn",
|
||
|
click: function() { $(this).dialog("close"); } },
|
||
|
{text:btn_submit_name,
|
||
|
id: "submit-btn",
|
||
|
click: function() {
|
||
|
disable_button($('#submit-btn'));
|
||
|
$(id + " form").submit();
|
||
|
}}];
|
||
|
|
||
|
if (extra_button)
|
||
|
buttons.push(extra_button);
|
||
|
$(this).dialog({title: title,
|
||
|
modal: true,
|
||
|
width: width,
|
||
|
height: height,
|
||
|
buttons: [ { text: "Annuler",
|
||
|
id: "close-btn",
|
||
|
click: function() { $(this).dialog("close"); } },
|
||
|
{ text: btn_submit_name,
|
||
|
id: "submit-btn",
|
||
|
click: function() {
|
||
|
disable_button($('#submit-btn'));
|
||
|
$(id + " form").submit();
|
||
|
} }]});
|
||
|
buttons: buttons});
|
||
|
if (on_load_callback) {
|
||
|
on_load_callback($(this));
|
||
|
}
|
||
Also available in: Unified diff
ajaxfom dialog function updated