Project

General

Profile

« Previous | Next » 

Revision 0259c7ef

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

dossiers: enable pause facturation and comment

View differences:

calebasse/dossiers/forms.py
29 29
    comment = forms.CharField(label='Commentaire',
30 30
            required=False, widget=forms.Textarea)
31 31

  
32
class GeneralForm(ModelForm):
33
    class Meta:
34
        model = PatientRecord
35
        fields = ('comment', 'pause')
36
        widgets = {
37
                'comment': forms.Textarea(attrs={'cols': 50, 'rows': 5}),
38
                }
39

  
32 40
class CivilStatusForm(ModelForm):
33 41
    class Meta:
34 42
        model = PatientRecord
calebasse/dossiers/models.py
5 5
from datetime import datetime
6 6
from datetime import timedelta
7 7

  
8
from django import forms
8 9
from django.db import models
9 10
from django.contrib.auth.models import User
10 11

  
calebasse/dossiers/templates/dossiers/patientrecord_update.html
20 20
    <li><a href="#tabs-8">Données à caractère médical</a>
21 21
  </ul>
22 22
  <div id="tabs-1"> <!-- Général -->
23
    <form method="post" id="general-form" class="patientrecordform">
24
    {% csrf_token %}
23 25
    <div class="left">
24 26
      <ul>
25
        <li><label>N° dossier papier :</label> {{ object.paper_id|default_if_none:"Aucun" }} <button>✍</button></li>
27
          <li><label>N° dossier papier :</label> {{ object.paper_id|default_if_none:"Aucun" }} <button>✍</button></li>
26 28
        <li><label>N° dossier informatique :</label>{{ object.id }}</li>
27 29
        <li><label>Nom :</label> {{ object.last_name }}</li>
28 30
        <li><label>Prénom :</label> {{ object.first_name }}</li>
......
37 39
        <li><label>Date d'inscription :</label> {{ object.created|date:"d/m/Y" }}</li>
38 40
        <li><label>Lieu de socialisation :</label> {{ object.school }}</li>
39 41
        <li><label>Commentaire :</label><br/>
40
        <textarea cols="50" rows="5">{{ object.comment|default_if_none:"" }}</textarea>
41
        <button>Mettre à jour</button></li>
42
        {{ forms.general.comment }}
43
        <button id="btn-maj">Mettre à jour</button></li>
42 44
      </ul>
43 45
    </div>
44 46
    <div class="right">
......
70 72
        <button id="reopen-patientrecord">Ré-accueillir</button>
71 73
        <button id="patientrecord-history">Historique</button><br/>
72 74
        <hr/>
73
        3/6 diagnostics
75
        <p id="pause-msg" style="display: none; font-size: 10px;">Pause facturation mise à jour</p>
76
        {{ forms.general.pause.label_tag }} : {{ forms.general.pause }}
77
        <!-- 3/6 diagnostics -->
74 78
      </div>
79
        </form>
75 80

  
76
      <div class="notifs">
81
      <!-- <div class="notifs">
77 82
        <h4>Notifications</h4>
78 83
        <ul>
79 84
          <li>Dossier en pause facturation <button>Sortir</button></li>
80
        </ul>
81
      </div>
85
      </ul>
86
  </div> -->
82 87

  
83 88
    </div>
84 89
    <br style="clear:both"/>
calebasse/dossiers/views.py
5 5
from calebasse.agenda.models import Occurrence
6 6
from calebasse.dossiers.models import PatientRecord, Status, FileState
7 7
from calebasse.dossiers.forms import (SearchForm, CivilStatusForm, StateForm,
8
        PhysiologyForm, FamillyForm, InscriptionForm)
8
        PhysiologyForm, FamillyForm, InscriptionForm, GeneralForm)
9 9
from calebasse.dossiers.states import STATES_MAPPING, STATE_CHOICES_TYPE
10 10
from calebasse.ressources.models import Service
11 11

  
......
51 51
class PatientRecordView(ServiceViewMixin, MultiUpdateView):
52 52
    model = PatientRecord
53 53
    forms_classes = {
54
            'general': GeneralForm,
54 55
            'id': CivilStatusForm,
55 56
            'physiology': PhysiologyForm,
56 57
            'inscription': InscriptionForm,
......
60 61
    success_url = './view'
61 62

  
62 63
    def get_success_url(self):
63
        return self.success_url + '#tab=' + self.request.POST['tab']
64
        if self.request.POST.has_key('tab'):
65
            return self.success_url + '#tab=' + self.request.POST['tab']
66
        else:
67
            return self.success_url
64 68

  
65 69
    def get_context_data(self, **kwargs):
66 70
        ctx = super(PatientRecordView, self).get_context_data(**kwargs)
calebasse/static/js/calebasse.dossiers.js
43 43
    $('.checkbox_state').click(function() {
44 44
        $("#search").click();
45 45
    });
46
    $('#id_general-pause').click(function() {
47
        $('#btn-maj').click();
48
    });
46 49
    $('.pr-line').click(function() {
47 50
        window.location.href = $(this).data('link');
48 51
    });
......
98 101
    var tabid = $.url($(location).attr('href')).fparam('tab');
99 102
    if (tabid) {
100 103
        $tabs.tabs('select',  parseInt(tabid));
104
        location.hash = '';
101 105
    }
102 106
  });
103 107
})(window.jQuery)

Also available in: Unified diff