Project

General

Profile

« Previous | Next » 

Revision 36d6d03e

Added by Benjamin Dauvergne over 12 years ago

add confirmation dialog to the automatic validation button, fixes #1886

View differences:

calebasse/agenda/templates/agenda/act-validation.html
10 10
          <input type="hidden" name="unlock-all" value="1">
11 11
          <button id="unlock-all">Tout déverrouiller</button>
12 12
        </form>
13
        <form method="post">
13
        <form method="post" id="validate-all-form">
14 14
          {% csrf_token %}
15 15
          <input type="hidden" name="validate-all" value="1">
16 16
          <button id="validate-all">Validation automatique</button>
......
85 85
    $(this).next('button').prop('disabled',
86 86
      ($(this).data('previous') == $(this).val()));
87 87
  })
88
  $('#validate-all-form').on('submit', function () {
89
    return window.confirm('Confirmez-vous la validation automatique des actes ?');
90
  });
88 91
</script>
89 92
{% endblock %}
calebasse/agenda/views.py
201 201
                nb_acts_annul_famille, nb_acts_abs_ess_pps,
202 202
                nb_acts_enf_hosp) = \
203 203
                automated_validation(self.date, self.service,
204
                    request.user, commit = False)
205
            #TODO: call confirmation pop-up
204
                    request.user)
206 205
        elif 'unlock-all' in request.POST:
207 206
            #TODO: check that the user is authorized
208 207
            unlock_all_acts_of_the_day(self.date)

Also available in: Unified diff