Commit | Line | Data |
---|---|---|
139686f2 NC |
1 | {% extends 'base.html' %} |
2 | ||
e8e75458 | 3 | {% block title %}RH - DAE - Embauche{% endblock %} |
4 | {% block titre %}Ressources humaines{% endblock %} | |
5 | {% block sous_titre %}Demande d'autorisation d'embauche{% endblock %} | |
6 | ||
139686f2 NC |
7 | {% block extrahead %} |
8 | <script src="{{ MEDIA_URL }}js/jquery-1.5.1.min.js" | |
9 | type="text/javascript"></script> | |
da3ca955 | 10 | |
11 | <style> | |
12 | h2.section { | |
13 | width:100%; | |
14 | background-color: #D0E8F8; | |
15 | text-align: center; | |
16 | color: #5F5F5F; | |
17 | margin: 50px 0px 26px 0px; | |
18 | border-bottom: 3px solid #BBD8EC; | |
19 | padding: 4px; | |
20 | } | |
21 | .row {padding: 10px 0px; clear: both; display:block;} | |
22 | .row * {float: left; margin: 0px; padding: 0px; margin-right: 4px;} | |
23 | .row li {list-style-type: none;} | |
24 | .underline {text-decoration: underline;} | |
25 | .clear {display: block; clear: both;} | |
26 | .note {text-decoration: underline; font-style: italic; margin-left: 12px;} | |
27 | .info {font-size:13px; font-style: italic;} | |
28 | .noborder {border:none; margin:0; padding; 0} | |
29 | tr.noborder td {border:none; padding-left: 0;} | |
30 | .gauche { float:left; } | |
31 | .droite { float:right; text-align:right; } | |
32 | .clear { clear:both; width:100%; } | |
33 | </style> | |
139686f2 | 34 | {% endblock %} |
139686f2 NC |
35 | |
36 | {% block main %} | |
da3ca955 | 37 | <h1>Demandes d'autorisation d'engagement de personnel</h1> |
0db0aedd | 38 | <form action="" method="post" enctype="multipart/form-data"> |
da3ca955 | 39 | {% if step == 'poste' %} |
40 | <h2 class="section">SECTION 1 - POSTE</h2> | |
41 | <fieldset> | |
42 | <h2>Poste visé</h2> | |
43 | ||
44 | <table cellspacing="0"> | |
139686f2 | 45 | {{ form.as_table }} |
da3ca955 | 46 | </table> |
47 | </fieldset> | |
139686f2 | 48 | |
da3ca955 | 49 | <script type="text/javascript"> |
139686f2 NC |
50 | $('#id_poste').change(function() { |
51 | window.location = '{% url embauche %}/' + $(this).val(); | |
52 | }); | |
da3ca955 | 53 | </script> |
54 | {% else %} | |
55 | <h2 class="section">SECTION 1 - POSTE</h2> | |
56 | <fieldset> | |
57 | <h2>Poste : {{ poste.nom }} ({{ poste.implantation.nom }})</h2> | |
58 | ||
59 | </fieldset> | |
60 | ||
61 | <h2 class="section">SECTION 2 - PERSONNEL ENGAGÉ</h2> | |
62 | <fieldset> | |
63 | <div> | |
64 | <div class="gauche"><h2>Personne</h2></div> | |
65 | <div class="droite"> | |
66 | <table class="droite"> | |
67 | <tbody> | |
68 | <tr> | |
69 | <th>Mobilité interne</th> | |
70 | <td colspan="3"><input id="mobilite_interne" type="checkbox" name="mobilite_interne" /></td> | |
71 | </tr> | |
72 | </tbody> | |
73 | </table> | |
74 | </div> | |
75 | </div> | |
76 | <div class="clear"></div> | |
77 | <table id="form-employe"> | |
78 | <tbody> | |
79 | <tr> | |
80 | <th> | |
81 | Employé :<br /> | |
82 | {{ forms.employe.employe.errors }} | |
83 | </th> | |
84 | <td colspan="5">{{ forms.employe.employe }}</td> | |
85 | </tr> | |
86 | <tr> | |
87 | <th> | |
88 | {{ forms.employe.nom.label_tag }} :<br /> | |
89 | {{ forms.employe.nom.errors }} | |
90 | </th> | |
91 | <td>{{ forms.employe.nom }}</td> | |
92 | <th> | |
93 | {{ forms.employe.prenom.label_tag }} :<br /> | |
94 | {{ forms.employe.prenom.errors }} | |
95 | </th> | |
96 | <td>{{ forms.employe.prenom }}</td> | |
97 | <th> | |
98 | {{ forms.employe.genre.label_tag }} :<br /> | |
99 | {{ forms.employe.genre.errors }} | |
100 | </th> | |
101 | <td>{{ forms.employe.genre }}</td> | |
102 | </tr> | |
103 | </tbody> | |
104 | </table> | |
105 | ||
106 | <input type="hidden" id="poste" name="poste" | |
107 | value="dae-{{ poste.id }}" /> | |
108 | <input type="hidden" id="implantation" name="implantation" | |
109 | value="{{ poste.implantation_id }}" /> | |
110 | <input type="hidden" id="dossier" name="dossier" | |
111 | value="{{ dossier.id }}" /> | |
112 | </fieldset> | |
113 | ||
114 | <script type="text/javascript"> | |
139686f2 NC |
115 | function activateEmployeDropDown() { |
116 | $('#id_employe').change(loadEmploye); | |
117 | } | |
118 | ||
119 | function loadEmploye() { | |
120 | var employeUrl = '{% url employe %}/' + $(this).val(); | |
121 | $('#form-employe').html('<tr><td>Chargement...</td></tr>') | |
da3ca955 | 122 | .load(employeUrl, activateEmployeDropDown); |
139686f2 | 123 | var dossierUrl = '{% url dossier %}/' + $('#poste').val() + |
da3ca955 | 124 | '/' + $(this).val(); |
139686f2 | 125 | $('#form-dossier').html('<tr><td>Chargement...</td></tr>') |
da3ca955 | 126 | .load(dossierUrl, activateDossierDropDowns); |
139686f2 | 127 | } |
139686f2 NC |
128 | activateEmployeDropDown(); |
129 | </script> | |
130 | ||
0801327c | 131 | {% with forms.dossier as form %} |
da3ca955 | 132 | {% include "dae/embauche-dossier.html" %} |
0801327c | 133 | {% endwith %} |
6b34f27e | 134 | |
dbb687ad OL |
135 | <fieldset> |
136 | <h2>Pièces jointes</h2> | |
137 | <p class="info">CV, lettre de motivation...</p> | |
138 | {% include "dae/pieces.html" %} | |
139 | </fieldset> | |
140 | ||
139686f2 NC |
141 | <script type="text/javascript"> |
142 | function activateDossierDropDowns() { | |
143 | $('#id_classement, #id_devise').change(loadSalaire); | |
144 | } | |
145 | ||
146 | function loadSalaire() { | |
147 | $.getJSON('{% url salaire %}/' + $('#implantation').val() + '/' + | |
148 | $('#id_devise').val() + '/' + $('#id_classement').val(), | |
149 | function(data) { | |
139686f2 NC |
150 | $('#id_salaire').val(data.salaire_devise); |
151 | }); | |
152 | } | |
153 | ||
154 | activateDossierDropDowns(); | |
155 | </script> | |
cb1d62b5 | 156 | |
0801327c NC |
157 | <h2 class="section">SECTION 3 - COÛT GLOBAL</h2> |
158 | ||
cb1d62b5 | 159 | <fieldset> |
cb1d62b5 NC |
160 | |
161 | {% if new %} | |
162 | <p> | |
163 | Vous devez enregister ce dossier avant de pouvoir détailler le | |
164 | coût global. | |
165 | </p> | |
166 | {% else %} | |
167 | <table cellspacing="0" id="global-cost"> | |
168 | {% include 'dae/embauche-remun.html' %} | |
169 | </table> | |
170 | ||
171 | <select id="type-remun" name="type-remun"> | |
172 | <option value="">(Ajouter une ligne)</option> | |
173 | {% for tr in type_remun %} | |
174 | <option value="{{ tr.id }}">{{ tr.nom }}</option> | |
175 | {% endfor %} | |
176 | </select> | |
177 | {% endif %} | |
178 | ||
179 | </fieldset> | |
180 | ||
8629520e NC |
181 | <script type="text/javascript"> |
182 | function round2(n) { | |
183 | return Math.round(n * 100) / 100; | |
184 | } | |
185 | ||
186 | $('#global-cost input[id^="montant"]').live('keyup', function() { | |
187 | var value = $(this).val(), | |
188 | idParts = $(this).attr('id').split('-'), | |
189 | name = idParts[0], | |
190 | id = idParts[1]; | |
191 | if (name == 'montant') { | |
192 | $('#montant_mois-' + id).val(round2(value / 12)); | |
193 | } else { | |
194 | value = value * 12; | |
195 | $('#montant-' + id).val(round2(value)); | |
196 | } | |
197 | var taux = $('#taux_devise-' + id).val(); | |
198 | $('#montant_euro_mois-' + id).text(round2(value / taux / 12)); | |
199 | $('#montant_euro-' + id).text(round2(value / taux)); | |
200 | }); | |
201 | </script> | |
202 | ||
0801327c NC |
203 | <h2 class="section">SECTION 4 - JUSTIFICATION DE LA DEMANDE (OBLIGATOIRE)</h2> |
204 | ||
139686f2 | 205 | <input type="submit" name="save" value="Sauvegarder" /> |
cb1d62b5 NC |
206 | </form> |
207 | <script type="text/javascript"> | |
208 | $('#type-remun').change(function() { | |
209 | if ($(this).val() != '') { | |
210 | $('#global-cost').html('<tr><td>Chargement...</td></tr>') | |
211 | .load('{% url add_remun %}/' + | |
212 | $('#dossier').val() + '/' + | |
213 | $(this).val(), function() { | |
214 | $('#type-remun').val(''); | |
215 | }); | |
216 | } | |
217 | }); | |
218 | </script> | |
219 | {% endif %} | |
139686f2 NC |
220 | {% endblock %} |
221 |