agenda: resource unselected in new patient rendez-vous popup when it's unselected in resources list

Closes #3000
This commit is contained in:
Serghei Mihai 2013-07-19 16:28:38 +02:00
parent 8f9501a373
commit 86870402b4
1 changed files with 8 additions and 4 deletions

View File

@ -83,7 +83,7 @@ function enable_events(base) {
$(base).find('.newrdv').click(function() {
var participants = $('.person-item.active').map(function (i, v) { return $(v).data('worker-id'); });
var qs = $.param({participants: $.makeArray(participants),
room: false,
room: $.cookie('active-ressource-agenda'),
time: $(this).data('hour') }, true);
var new_appointment_url = $(this).data('url') + "?" + qs;
event_dialog(new_appointment_url, 'Nouveau rendez-vous', '850px', 'Ajouter');
@ -95,7 +95,7 @@ function enable_events(base) {
$(base).find('.newevent').click(function() {
var participants = $('.person-item.active').map(function (i, v) { return $(v).data('worker-id'); });
var qs = $.param({participants: $.makeArray(participants),
room: false,
room: $.cookie('active-ressource-agenda'),
time: $(this).data('hour') }, true);
event_dialog($(this).data('url') + "?" + qs, 'Nouvel événement', '850px', 'Ajouter');
});
@ -514,8 +514,12 @@ function event_dialog(url, title, width, btn_text) {
$('a.close-tab').click(function() {
console.log('close');
$('#' + $(this).data('target')).click()
console.log($(this).data('target'));
var target = '#' + $(this).data('target');
$(target).click();
if ($.cookie('active-ressource-agenda') == $(target).data('ressource-id')) {
$.cookie('active-ressource-agenda','', { path: '/' });
}
});