{% extends 'base.html' %}
+{% load adminmedia %}
-{% block title %}RH - DAE{% endblock %}
+{% block title %}RH - DAE - Poste{% endblock %}
{% block titre %}Ressources humaines{% endblock %}
{% block sous_titre %}
Demande d'autorisation d'embauche
type="text/javascript"></script>
<script src="{{ MEDIA_URL }}js/jquery-ui-1.8.11.custom.min.js"
type="text/javascript"></script>
- <link href="{{ MEDIA_URL }}/css/redmond/jquery-ui-1.8.11.custom.css"
- rel="stylesheet" />
+
+ {% comment %} style pour le calendier {% endcomment %}
+ <script type="text/javascript">
+ window.__admin_media_prefix__ = "{% filter escapejs %}{% admin_media_prefix %}{% endfilter %}";
+ </script>
+ <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/calendrier.css" />
+ <script type="text/javascript" src="/admin/jsi18n/"></script>
+ <script type="text/javascript" src="{% admin_media_prefix %}js/core.js"></script>
+
+ {{ form.media }}
+
+ <script src="{{ MEDIA_URL }}js/dae.js" /></script>
+ <script src="{{ MEDIA_URL }}js/dae-poste.js" /></script>
<style>
- h1.section {background-color: #D0E8F8; text-align: center; color: #5F5F5F; margin: 50px 0px 26px 0px; border-bottom: 3px solid #BBD8EC; padding: 4px;}
.row {padding: 10px 0px; clear: both; display:block;}
.row * {float: left; margin: 0px; padding: 0px; margin-right: 4px;}
.row li {list-style-type: none;}
.info {font-size:13px; font-style: italic;}
.noborder {border:none; margin:0; padding; 0}
tr.noborder td {border:none; padding-left: 0;}
+
</style>
{% endblock %}
{% block main %}
<h1>Demande d'autorisation de création de poste</h1>
-<form action="" method="post">
+<form action="" method="post" enctype="multipart/form-data">
+
<fieldset>
<h2>
{% if new %}
<span class="info">({{form.date_fin.help_text }})</span><br />
{{ form.date_fin.errors }}
</td>
- </tr>
- <tr>
- <td colspan="4" class="info">Pour une durée indéterminée, spécifier uniquement la date de début.</td>
- </tr>
- <tr>
<th>{{ form.regime_travail.label_tag }} :<br />{{ form.regime_travail.errors }}</th>
<td colspan="4">
{{ form.regime_travail }}
</td>
</tr>
<tr>
+ <td colspan="4" class="info">
+ <p id="note-duree">Pour une durée indéterminée, spécifier uniquement la date de début.</p>
+ </td>
<th>
{{ form.regime_travail_nb_heure_semaine.label_tag }} :<br />
{{ form.regime_travail_nb_heure_semaine.errors }}
</th>
- <td colspan="4">{{ form.regime_travail_nb_heure_semaine }}</td>
+ <td>{{ form.regime_travail_nb_heure_semaine }}</td>
</tr>
</tbody>
</table>
<fieldset>
<h2>Classement du poste</h2>
- <table>
+ <table id="classement">
<tbody>
<tr>
<th></th>
</tr>
<tr>
<th>Minimum</th>
- <td>{{ form.classement_min }}</td>
- <td>{{ form.coefficient_min }}</td>
+ <td>
+ {{ form.classement_min }}
+ {{ form.classement_min.errors }}
+ </td>
+ <td>
+ {{ form.coefficient_min }}
+ {{ form.coefficient_min.errors }}
+ </td>
<td>
{{ form.valeur_point_min }}
{{ form.valeur_point_min.errors }}
{{ form.devise_min }}
{{ form.devise_min.errors }}
</td>
- <td >{{ form.salaire_min }}</td>
- <td><span class="devise_min_code">EUR</span></td>
+ <td>
+ {{ form.salaire_min }}
+ {{ form.salaire_min.errors }}
+ </td>
+ <td><span class="devise_code">EUR</span></td>
<td>{{ form.indemn_min }}</td>
- <td><span class="devise_min_code">EUR</span></td>
+ <td><span class="devise_code">EUR</span></td>
<td>{{ form.autre_min }}</td>
- <td><span class="devise_min_code">EUR</span></td>
- <td id="total_min" class="cell-nombre">0.00</td>
- <td><span class="devise_min_code">EUR</span></td>
- <td id="taux_min_euro_display">1</td>
- <td id="total_min_euro" class="cell-nombre">0.00</td>
+ <td><span class="devise_code">EUR</span></td>
+ <td id="total_min" class="total-devise cell-nombre">0.00</td>
+ <td><span class="devise_code">EUR</span></td>
+ <td class="taux">1</td>
+ <td id="total_min_euro" class="total-euro cell-nombre">0.00</td>
<td>€</td>
</tr>
<tr>
<th>Maximun</th>
- <td>{{ form.classement_max }}</td>
- <td>{{ form.coefficient_max }}</td>
+ <td>
+ {{ form.classement_max }}
+ {{ form.classement_max.errors }}
+ </td>
+ <td>
+ {{ form.coefficient_max }}
+ {{ form.coefficient_max.errors }}
+ </td>
<td>
{{ form.valeur_point_max }}
{{ form.valeur_point_max.errors }}
{{ form.devise_max }}
{{ form.devise_max.errors }}
</td>
- <td>{{ form.salaire_max }}</td>
- <td><span class="devise_max_code">EUR</span></td>
+ <td>
+ {{ form.salaire_max }}
+ {{ form.salaire_max.errors }}
+ </td>
+ <td><span class="devise_code">EUR</span></td>
<td>{{ form.indemn_max }}</td>
- <td><span class="devise_max_code">EUR</span></td>
+ <td><span class="devise_code">EUR</span></td>
<td>{{ form.autre_max }}</td>
- <td><span class="devise_max_code">EUR</span></td>
- <td id="total_max" class="cell-nombre">0.00</td>
- <td><span class="devise_max_code">EUR</span></td>
- <td id="taux_max_euro_display">1</td>
- <td id="total_max_euro" class="cell-nombre">0.00</td>
+ <td><span class="devise_code">EUR</span></td>
+ <td id="total_max" class="total-devise cell-nombre">0.00</td>
+ <td><span class="devise_code">EUR</span></td>
+ <td class="taux">1</td>
+ <td id="total_max_euro" class="total-euro cell-nombre">0.00</td>
<td>€</td>
</tr>
</tbody>
<p class="info">N.B Conversion en EUROS au taux de change budgétaire</p>
</fieldset>
- {% if new %}
+ {% comment %}{% if new %}{% endcomment %}
<fieldset>
<h2>Éléments de comparaison</h2>
- <p class="info">Compléter uniquement lors de la création d'un poste</p>
+ <span class="info">Compléter uniquement lors de la création d'un poste</span>
+ <table>
+ <tbody>
+ <tr>
+ <th>Devise</th>
+ <td>
+ {{ form.devise_comparaison }}
+ {{ form.devise_comparaison.errors }}
+ </td>
+ </tr>
+ </tbody>
+ </table>
<table>
<tbody>
<tr>
<th></th>
- <th>Locale</th>
- <th>Université</th>
- <th>Fonction publique</th>
- <th>ONG</th>
- <th>Autre</th>
+ <th colspan="2">Entreprise locale</th>
+ <th colspan="2">Université</th>
+ <th colspan="2">Fonction publique</th>
+ <th colspan="2">ONG</th>
+ <th colspan="2">Autre</th>
</tr>
<tr>
<th>Minimum</th>
<td>{{ form.comp_locale_min }}</td>
+ <td><span class="devise_comp_code">€</span></td>
<td>{{ form.comp_universite_min }}</td>
+ <td><span class="devise_comp_code">€</span></td>
<td>{{ form.comp_fonctionpub_min }}</td>
+ <td><span class="devise_comp_code">€</span></td>
<td>{{ form.comp_ong_min }}</td>
+ <td><span class="devise_comp_code">€</span></td>
<td>{{ form.comp_autre_min }}</td>
+ <td><span class="devise_comp_code">€</span></td>
</tr>
<tr>
<th>Maximum</th>
<td>{{ form.comp_locale_max }}</td>
+ <td><span class="devise_comp_code">€</span></td>
<td>{{ form.comp_universite_max }}</td>
+ <td><span class="devise_comp_code">€</span></td>
<td>{{ form.comp_fonctionpub_max }}</td>
+ <td><span class="devise_comp_code">€</span></td>
<td>{{ form.comp_ong_max }}</td>
+ <td><span class="devise_comp_code">€</span></td>
<td>{{ form.comp_autre_max }}</td>
+ <td><span class="devise_comp_code">€</span></td>
</tr>
</tbody>
</table>
</fieldset>
- {% endif %}
-
- {% comment %}
- <h1 class="section clear">SECTION 2 - PERSONNEL ENGAGÉ</h1>
- <div class="row"></div>
+ {% comment %}{% endif %}{% endcomment %}
- <h1 class="section">SECTION 3 - COÛT GLOBAL</h1>
- <div class="row"></div>
-
- <h1 class="section">SECTION 4 - JUSTIFICATION DE LA DEMANDE (OBLIGATOIRE)</h1>
- <div class="row"></div>
- {% endcomment %}
- <input type="submit" name="save" value="Sauvegarder" />
-</form>
+ <fieldset>
+ <h2>Pièces jointes</h2>
+ <p class="info">Compléter uniquement lors de la création d'un poste</p>
+ {% include "dae/pieces.html" %}
+ </fieldset>
<fieldset>
<h2>Financement</h2>
+ <span class="info">Si vous avez plusieurs financements, cliquer sur sauvegarder et une nouvelle ligne de financement sera disponible.</span>
+ {% include "dae/financements.html" %}
+ </fieldset>
- <table cellspacing="0" id="financing">
- <tr>
- <th>Type</th>
- <th>Montant</th>
- <th>Devise</th>
- <th>Pourcentage</th>
- <th>Commentaire</th>
- <th></th>
- </tr>
- {% for fin in poste.financements.all %}
- <tr>
- <td>{{ fin.get_type_display }}</td>
- <td>{{ fin.montant }}</td>
- <td>€
- {% comment %}
- {{ fin.devise }}
- {% endcomment %}
- </td>
- <td>{{ fin.pourcentage }}</td>
- <td>{{ fin.commentaire }}</td>
- <td><a href="{% url financement poste_key fin.id %}">Modifier</a></td>
- </tr>
- {% empty %}
- <tr>
- <td colspan="5">
- {% if new %}
- Vous devez enregister ce nouveau poste avant de pouvoir spécifier
- la ou les sources de financement.
- {% else %}
- Aucun financement au registre
- {% endif %}
- </td>
- </tr>
- {% endfor %}
- </table>
- {% if not new %}
- <a href="{% url financement poste_key %}" class="new">
- Ajouter une source de financement
- </a>
- {% endif %}
+ {{ form.etat }}
+ <input type="submit" name="save" value="Sauvegarder" />
- <div id="financing-form"></div>
- </fieldset>
+</form>
- <script type="text/javascript">
- $('#id_poste').change(function() {
- window.location = '{% url poste %}/' + $(this).val();
- });
- $('#financing a, a.new').click(function() {
- $('#financing-form').load($(this).attr('href') + '?ajax=1')
- .dialog({
- modal: true,
- height: 500,
- width: 550
- });
- return false;
- });
-
- /* CLASSEMENT MIN */
- $(document).ready(function() {
- valeur_min = '<input type="hidden" id="valeur_min" name="valeur_min" value="0" disabled="disabled">'
- devise_min_code = '<input type="hidden" id="devise_min_code" name="devise_min_code" value="5" disabled="disabled">'
- taux_min_euro = '<input type="hidden" id="taux_min_euro" name="taux_min_euro" value="1" disabled="disabled">'
- $('#id_valeur_point_min').after(valeur_min)
- $('#id_devise_min').after(devise_min_code)
- $('#total_min_euro').after(taux_min_euro)
- });
- /* bindings */
- $('#id_coefficient_min').bind('coeff_min_modified', function(){
- $('#id_salaire_min').trigger('update_salaire_min');
- });
- $('.devise_min_code').bind('update_devise_min_code', function(){
- devise_code = $('#devise_min_code').val();
- $('.devise_min_code').empty();
- $('.devise_min_code').text(devise_code);
- });
- $('#id_salaire_min').bind('update_salaire_min', function(){
- valeur = $('#valeur_min').val();
- coeff = $('#id_coefficient_min').val();
- salaire = coeff * valeur;
- salaire = clean_float(salaire);
- $(this).val(salaire);
- $('#total_min').trigger('update_total_min');
- });
- $('#total_min').bind('update_total_min', function(){
- total = 0;
- salaire = $('#id_salaire_min').val();
- indemn = $('#id_indemn_min').val();
- autre = $('#id_autre_min').val();
- salaire = clean_float(salaire);
- indemn = clean_float(indemn);
- autre = clean_float(autre);
- total = salaire + indemn + autre;
- $(this).empty();
- $(this).text(total.toFixed(2));
- $('#total_min_euro').trigger('update_total_min_euro');
- });
- $('#total_min_euro').bind('update_total_min_euro', function(){
- total = $('#total_min').text();
- taux_euro = $('#taux_min_euro').val();
- total = clean_float(total);
- taux_euro = clean_float(taux_euro);
- total_euro = total * taux_euro;
- $(this).empty();
- $(this).text(total_euro.toFixed(2));
- });
- /* change */
- $('#id_coefficient_min').change(function(){
- $(this).trigger('coeff_min_modified');
- });
- $('#id_classement_min').change(function() {
- url = "{% url dae_coefficient %}";
- $.post(url, {'classement':$(this).val()}, function(data){
- $('#id_coefficient_min').val(data["coefficient"]);
- $('#id_coefficient_min').trigger('coeff_min_modified');
- }, 'json');
- });
- $('#id_valeur_point_min').change(function() {
- url_valeur = "{% url dae_valeur %}";
- url_devise = "{% url dae_devise %}";
- $.post(url_valeur, {'valeur_point':$(this).val()}, function(data){
- $('#valeur_min').val(data["valeur"]);
- $('#id_salaire_min').trigger('update_salaire_min');
- $('#total_min_euro').trigger('update_total_min_euro');
- }, 'json');
- $.post(url_devise, {'valeur_point':$(this).val()}, function(data){
- $('#id_devise_min').val(data["devise"]);
- $('#devise_min_code').val(data["devise_code"]);
- $('#taux_min_euro').val(data["taux_euro"]);
- $('#taux_min_euro_display').empty();
- $('#taux_min_euro_display').text(data["taux_euro"]);
- $('.devise_min_code').trigger('update_devise_min_code');
- $('#total_min_euro').trigger('update_total_min_euro');
- }, 'json');
- });
- $('#id_devise_min').change(function(){
- url_devise_code = "{% url dae_devise_code %}";
- $.post(url_devise_code, {'devise':$(this).val()}, function(data){
- $('#devise_min_code').val(data["devise_code"]);
- $('#taux_min_euro').val(data["taux_euro"]);
- $('#taux_min_euro_display').empty();
- $('#taux_min_euro_display').text(data["taux_euro"]);
- $('.devise_min_code').trigger('update_devise_min_code');
- $('#total_min_euro').trigger('update_total_min_euro');
- }, 'json');
- });
- $('#id_salaire_min').change(function(){
- $('#total_min').trigger('update_total_min');
- });
- $('#id_indemn_min').change(function(){
- $('#total_min').trigger('update_total_min');
- });
- $('#id_autre_min').change(function(){
- $('#total_min').trigger('update_total_min');
- });
-
- /* CLASSEMENT MAX */
- $(document).ready(function() {
- valeur_max = '<input type="hidden" id="valeur_max" name="valeur_max" value="0" disabled="disabled">'
- devise_max_code = '<input type="hidden" id="devise_max_code" name="devise_max_code" value="5" disabled="disabled">'
- taux_max_euro = '<input type="hidden" id="taux_max_euro" name="taux_max_euro" value="1" disabled="disabled">'
- $('#id_valeur_point_max').after(valeur_max)
- $('#id_devise_max').after(devise_max_code)
- $('#total_max_euro').after(taux_max_euro)
- });
- /* bindings */
- $('#id_coefficient_max').bind('coeff_max_modified', function(){
- $('#id_salaire_max').trigger('update_salaire_max');
- });
- $('.devise_max_code').bind('update_devise_max_code', function(){
- devise_code = $('#devise_max_code').val();
- $('.devise_max_code').empty();
- $('.devise_max_code').text(devise_code);
- });
- $('#id_salaire_max').bind('update_salaire_max', function(){
- valeur = $('#valeur_max').val();
- coeff = $('#id_coefficient_max').val();
- salaire = coeff * valeur;
- salaire = clean_float(salaire);
- $(this).val(salaire);
- $('#total_max').trigger('update_total_max');
- });
- $('#total_max').bind('update_total_max', function(){
- total = 0;
- salaire = $('#id_salaire_max').val();
- indemn = $('#id_indemn_max').val();
- autre = $('#id_autre_max').val();
- salaire = clean_float(salaire);
- indemn = clean_float(indemn);
- autre = clean_float(autre);
- total = salaire + indemn + autre;
- $(this).empty();
- $(this).text(total.toFixed(2));
- $('#total_max_euro').trigger('update_total_max_euro');
- });
- $('#total_max_euro').bind('update_total_max_euro', function(){
- total = $('#total_max').text();
- taux_euro = $('#taux_max_euro').val();
- total = clean_float(total);
- taux_euro = clean_float(taux_euro);
- total_euro = total * taux_euro;
- $(this).empty();
- $(this).text(total_euro.toFixed(2));
- });
- /* change */
- $('#id_coefficient_max').change(function(){
- $(this).trigger('coeff_max_modified');
- });
- $('#id_classement_max').change(function() {
- url = "{% url dae_coefficient %}";
- $.post(url, {'classement':$(this).val()}, function(data){
- $('#id_coefficient_max').val(data["coefficient"]);
- $('#id_coefficient_max').trigger('coeff_max_modified');
- }, 'json');
- });
- $('#id_valeur_point_max').change(function() {
- url_valeur = "{% url dae_valeur %}";
- url_devise = "{% url dae_devise %}";
- $.post(url_valeur, {'valeur_point':$(this).val()}, function(data){
- $('#valeur_max').val(data["valeur"]);
- $('#id_salaire_max').trigger('update_salaire_max');
- $('#total_max_euro').trigger('update_total_max_euro');
- }, 'json');
- $.post(url_devise, {'valeur_point':$(this).val()}, function(data){
- $('#id_devise_max').val(data["devise"]);
- $('#devise_max_code').val(data["devise_code"]);
- $('#taux_max_euro').val(data["taux_euro"]);
- $('#taux_max_euro_display').empty();
- $('#taux_max_euro_display').text(data["taux_euro"]);
- $('.devise_max_code').trigger('update_devise_max_code');
- $('#total_max_euro').trigger('update_total_max_euro');
- }, 'json');
- });
- $('#id_devise_max').change(function(){
- url_devise_code = "{% url dae_devise_code %}";
- $.post(url_devise_code, {'devise':$(this).val()}, function(data){
- $('#devise_max_code').val(data["devise_code"]);
- $('#taux_max_euro').val(data["taux_euro"]);
- $('#taux_max_euro_display').empty();
- $('#taux_max_euro_display').text(data["taux_euro"]);
- $('.devise_max_code').trigger('update_devise_max_code');
- $('#total_max_euro').trigger('update_total_max_euro');
- }, 'json');
- });
- $('#id_salaire_max').change(function(){
- $('#total_max').trigger('update_total_max');
- });
- $('#id_indemn_max').change(function(){
- $('#total_max').trigger('update_total_max');
- });
- $('#id_autre_max').change(function(){
- $('#total_max').trigger('update_total_max');
- });
-
- /* helpers */
- function clean_float(value){
- if (value == undefined)
- output = 0;
- else
- output = parseFloat(value);
- output = Math.round(output*100)/100;
- return output;
- }
-
- </script>
{% endblock %}