Project

General

Profile

« Previous | Next » 

Revision e36e0819

Added by Mikaël Ates about 13 years ago

validation : feasible in the services of the appointment only, double only at the CMPP (#2030).

View differences:

calebasse/agenda/appointments.py
display_name = VALIDATION_STATES[state.state_name]
if not state.previous_state:
state = None
self.validation = (event_act, state, display_name)
validation_states = None
if service in services:
validation_states = dict(VALIDATION_STATES)
if not 'CMPP' in [s.name for s in services] and \
'ACT_DOUBLE' in validation_states:
validation_states.pop('ACT_DOUBLE')
self.validation = (event_act, state, display_name, validation_states)
else:
self.event_type = occurrence.event.event_type
calebasse/agenda/templates/agenda/index.html
Non pointé.
{% endif %}
</span>
{% if not appointment.validation.0.validation_locked %}
{% if not appointment.validation.0.validation_locked and appointment.validation.3 %}
<form method="post" class="inline-form">
{% csrf_token %}
<input type="hidden" value="{{appointment.validation.0.id}}" name="acte-id">
<select data-previous="{{ last_status.state_name }}" name="act_state">
{% for state_name, display_state_name in validation_states.items %}
{% for state_name, display_state_name in appointment.validation.3.items %}
<option value="{{ state_name }}" {% if state_name == appointment.validation.1.state_name %}selected{% endif %}>{{ display_state_name }}</option>
{% endfor %}
</select>
calebasse/agenda/views.py
context['disponibility'] = Occurrence.objects.daily_disponiblity(context['date'],
occurrences_workers, workers, time_tables_workers)
context['validation_states'] = VALIDATION_STATES
return context
class AgendaServiceActivityView(TemplateView):
......
state = None
act.date = act.date.strftime("%H:%M")
actes.append((act, state, display_name))
context['validation_states'] = VALIDATION_STATES
context['validation_states'] = dict(VALIDATION_STATES)
if self.service.name != 'CMPP' and \
'ACT_DOUBLE' in context['validation_states']:
context['validation_states'].pop('ACT_DOUBLE')
context['actes'] = actes
context['validation_msg'] = validation_msg
context['authorized_lock'] = authorized_lock

Also available in: Unified diff