120 |
120 |
$('#newrdv').click(function() {
|
121 |
121 |
var participants = $('.person-item.active').map(function (i, v) { return $(v).data('worker-id'); });
|
122 |
122 |
var qs = $.param({participants: $.makeArray(participants) }, true);
|
123 |
|
var new_appointment_url = "{% url 'nouveau-rdv' service=service date=date %}?" + qs;
|
|
123 |
var new_appointment_url = $(this).data('url') + "?" + qs;
|
|
124 |
$('#rdv').load(new_appointment_url,
|
|
125 |
function () {
|
|
126 |
function onsuccess(response, status, xhr, form) {
|
|
127 |
var parse = $(response);
|
|
128 |
if ($('.errorlist', parse).length != 0) {
|
|
129 |
$('#rdv').html(response);
|
|
130 |
$('#rdv form').ajaxForm({
|
|
131 |
success: onsuccess,
|
|
132 |
});
|
|
133 |
$('#rdv .datepicker-date').datepicker({dateFormat: 'yy-m-d', showOn: 'button'});
|
|
134 |
console.log('error');
|
|
135 |
} else {
|
|
136 |
console.log('success');
|
|
137 |
window.location.reload(true);
|
|
138 |
}
|
|
139 |
}
|
|
140 |
$('#rdv .datepicker-date').datepicker({dateFormat: 'yy-m-d', showOn: 'button'});
|
|
141 |
$('form', this).ajaxForm({
|
|
142 |
success: onsuccess
|
|
143 |
});
|
|
144 |
$(this).dialog({title: 'Nouveau rendez-vous',
|
|
145 |
width: '800px',
|
|
146 |
buttons: [ { text: "Fermer",
|
|
147 |
click: function() { $(this).dialog("close"); } },
|
|
148 |
{ text: "Ajouter",
|
|
149 |
click: function() { $("#rdv form").submit(); } }]});
|
|
150 |
});
|
|
151 |
});
|
|
152 |
$('#newevent').click(function() {
|
|
153 |
var participants = $('.person-item.active').map(function (i, v) { return $(v).data('worker-id'); });
|
|
154 |
var qs = $.param({participants: $.makeArray(participants) }, true);
|
|
155 |
var new_appointment_url = $(this).data('url') + "?" + qs;
|
124 |
156 |
$('#rdv').load(new_appointment_url,
|
125 |
157 |
function () {
|
126 |
158 |
function onsuccess(response, status, xhr, form) {
|
agenda: continue generic event management