Project

General

Profile

« Previous | Next » 

Revision 88abfb2a

Added by Jérôme Schneider about 12 years ago

agenda: fix comments management

  • appointments.py: set description to empty string if None and fix
    description detection
  • forms.py: use UpdateAppoinment for PeriodicUpdate instead of
    NewAppoinment
  • ajax-worker-tab.html: remove now useless if

View differences:

calebasse/agenda/appointments.py
self.patient_record_id = event.patient.id
self.patient_record_paper_id = event.patient.paper_id
self.act_type = event.act_type.name
self.description = event.act.comment
if self.act_id:
self.description = event.act.comment
self.is_billed = event.act.is_billed
state = event.get_state()
state_name = state.state_name if state else 'NON_VALIDE'
......
self.event_type = event.event_type
for worker in self.workers:
self.workers_code.append("%s-%s" % (worker.id, worker.last_name.upper()))
if not self.description:
self.description = ''
def init_free_time(self, length, begin_time):
self.type = "free"
calebasse/agenda/forms.py
appointment.services = [self.service]
return appointment
class UpdatePeriodicAppointmentForm(NewAppointmentForm):
class UpdateAppointmentForm(NewAppointmentForm):
class Meta(NewAppointmentForm.Meta):
fields = (
'start_datetime',
'date',
'time',
'duration',
'patient',
'participants',
'room',
'act_type',
)
class UpdatePeriodicAppointmentForm(UpdateAppointmentForm):
def clean(self):
cleaned_data = super(UpdatePeriodicAppointmentForm, self).clean()
......
u"La date doit être supérieur au dernier acte facturé de la récurrence"])
return cleaned_data
class DisablePatientAppointmentForm(NewAppointmentForm):
class DisablePatientAppointmentForm(UpdateAppointmentForm):
def __init__(self, instance, service=None, **kwargs):
super(DisablePatientAppointmentForm, self).__init__(instance,
......
else:
return self.cleaned_data.get('patient', None)
class UpdateAppointmentForm(NewAppointmentForm):
class Meta(NewAppointmentForm.Meta):
fields = (
'start_datetime',
'date',
'time',
'duration',
'patient',
'participants',
'room',
'act_type',
)
class NewEventForm(BaseForm):
title = forms.CharField(label=u"Complément de l'intitulé", max_length=32, required=False)
calebasse/agenda/templates/agenda/ajax-worker-tab.html
<div class="tabs-worker-{{ worker_agenda.worker.id }} textedit">
<span></span>
{% if service in appointment.services_names or not appointment.services_names %}
<textarea>{% if appointment.description %}{{ appointment.description }}{% endif %}</textarea>
<textarea>{{ appointment.description }}</textarea>
<button disabled="disabled" data-event-id="{{ appointment.event_id }}" data-date="{{ date|date:"Y-m-d" }}" {% if appointment.act_id %}data-act-id="{{ appointment.act_id }}{% endif %}">✔</button>
{% else %}
<p>{{ appointment.description }}</p>
......
</div>
{% else %}
{% if appointment.description %}
<p>{% if appointment.description %}{{ appointment.description }}{% endif %}</p>
<p>{{ appointment.description }}</p>
{% endif %}
{% endif %}
</div>

Also available in: Unified diff