Revision ad2b7483
Added by Serghei Mihai over 11 years ago
| calebasse/agenda/templates/agenda/ajax-ressource-tab.html | ||
|---|---|---|
|
|
||
|
<div>
|
||
|
{% if appointment.type == 'free' %}
|
||
|
<button class='newrdv' data-url="{% url 'nouveau-rdv' service=service date=date %}" data-hour="{{ appointment.begin_hour }}">Nouveau rendez-vous patient</button>
|
||
|
<button class='newevent' data-url="{% url 'new-event' service=service date=date %}" data-hour="{{ appointment.begin_hour }}">Nouvel événement</button>
|
||
|
<button class='newrdv' data-url="{% url 'nouveau-rdv' service=service date=date %}" data-hour="{{ appointment.begin_hour }}" data-duration="{{ appointment.length }}">Nouveau rendez-vous patient</button>
|
||
|
<button class='newevent' data-url="{% url 'new-event' service=service date=date %}" data-hour="{{ appointment.begin_hour }}" data-duration="{{ appointment.length }}">Nouvel événement</button>
|
||
|
{% endif %}
|
||
|
{% if appointment.event_id %}
|
||
|
{% if appointment.workers %}
|
||
| calebasse/agenda/templates/agenda/ajax-worker-tab.html | ||
|---|---|---|
|
|
||
|
<div>
|
||
|
{% if appointment.type == 'free' %}
|
||
|
<button class='newrdv' data-url="{% url 'nouveau-rdv' service=service date=date %}" data-hour="{{ appointment.begin_hour }}">Nouveau rendez-vous patient</button>
|
||
|
<button class='newevent' data-url="{% url 'new-event' service=service date=date %}" data-hour="{{ appointment.begin_hour }}">Nouvel événement</button>
|
||
|
<button class='newrdv' data-url="{% url 'nouveau-rdv' service=service date=date %}" data-hour="{{ appointment.begin_hour }}" data-duration="{{ appointment.length }}">Nouveau rendez-vous patient</button>
|
||
|
<button class='newevent' data-url="{% url 'new-event' service=service date=date %}" data-hour="{{ appointment.begin_hour }}" data-duration="{{ appointment.length }}">Nouvel événement</button>
|
||
|
{% endif %}
|
||
|
{% if appointment.event_id %}
|
||
|
{% if appointment.workers %}
|
||
| calebasse/agenda/views.py | ||
|---|---|---|
|
initial['participants'] = self.request.GET.getlist('participants')
|
||
|
initial['time'] = self.request.GET.get('time')
|
||
|
initial['ressource'] = self.request.GET.get('ressource')
|
||
|
initial['duration'] = self.request.GET.get('duration')
|
||
|
return initial
|
||
|
|
||
|
def get_form_kwargs(self):
|
||
| ... | ... | |
|
initial['time'] = self.request.GET.get('time')
|
||
|
initial['event_type'] = 2
|
||
|
initial['ressource'] = self.request.GET.get('ressource')
|
||
|
initial['duration'] = self.request.GET.get('duration')
|
||
|
if not initial.has_key('services'):
|
||
|
initial['services'] = [self.service]
|
||
|
return initial
|
||
| calebasse/static/js/calebasse.agenda.js | ||
|---|---|---|
|
}
|
||
|
}
|
||
|
|
||
|
function get_participants() {
|
||
|
function get_initial_fields(button, base) {
|
||
|
var participants = new Array();
|
||
|
var active_agenda = $.cookie('active-agenda').split('-');
|
||
|
var ressource = '';
|
||
| ... | ... | |
|
var data = v.split('-'); return data[1]
|
||
|
});
|
||
|
}
|
||
|
console.log($(button).data('duration'));
|
||
|
return $.param({participants: $.makeArray(participants),
|
||
|
ressource: ressource,
|
||
|
time: $(this).data('hour') }, true);
|
||
|
time: $(button).data('hour'),
|
||
|
duration: $(button).data('duration')}, true);
|
||
|
}
|
||
|
|
||
|
function enable_new_appointment(base) {
|
||
|
var base = base || 'body';
|
||
|
$(base).find('.newrdv').click(function() {
|
||
|
event_dialog($(this).data('url') + "?" + get_participants(), 'Nouveau rendez-vous', '850px', 'Ajouter');
|
||
|
event_dialog($(this).data('url') + "?" + get_initial_fields(this, base), 'Nouveau rendez-vous', '850px', 'Ajouter');
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function enable_new_event(base) {
|
||
|
var base = base || 'body';
|
||
|
$(base).find('.newevent').click(function() {
|
||
|
event_dialog($(this).data('url') + "?" + get_participants(), 'Nouvel événement', '850px', 'Ajouter');
|
||
|
event_dialog($(this).data('url') + "?" + get_initial_fields(this, base), 'Nouvel événement', '850px', 'Ajouter');
|
||
|
});
|
||
|
}
|
||
|
|
||
Also available in: Unified diff
agenda: schedule or event start time and duration initialized on free time