--- /dev/null
+{% extends 'base.html' %}
+{% load adminmedia %}
+
+{% block title %}RH - DAE - Embauche{% endblock %}
+{% block titre %}Ressources humaines{% endblock %}
+{% block sous_titre %}Demande d'autorisation d'embauche{% endblock %}
+
+{% block extrahead %}
+ <script src="{{ MEDIA_URL }}js/jquery-1.5.1.min.js"
+ type="text/javascript"></script>
+
+ {% 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" />
+ <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/dae.css" />
+ <script type="text/javascript" src="/admin/jsi18n/"></script>
+ <script type="text/javascript" src="{% admin_media_prefix %}js/core.js"></script>
+ <script type="text/javascript" src="{% admin_media_prefix %}js/calendar.js"></script>
+ <script type="text/javascript" src="{% admin_media_prefix %}js/admin/DateTimeShortcuts.js"></script>
+ <script src="{{ MEDIA_URL }}js/dae.js" type="text/javascript"></script>
+ <script src="{{ MEDIA_URL }}js/dae-embauche.js" type="text/javascript"></script>
+{% endblock %}
+
+{% block main %}
+<h1>Demandes d'autorisation d'engagement de personnel</h1>
+<form action="" method="post" enctype="multipart/form-data">
+<h2 class="section">SECTION 1 - POSTE</h2>
+{% with dossier.poste as poste %}
+{% include 'dae/poste_resume.html' %}
+{% endwith %}
+
+<h2 class="section">SECTION 2 - PERSONNEL ENGAGÉ</h2>
+<fieldset>
+<div>
+ <div class="gauche"><h2>Personne</h2></div>
+ <div class="droite">
+ <table class="droite">
+ <tbody>
+ <tr>
+ <th>Mobilité interne</th>
+ <td colspan="3">{% if dossier.mobilite_interne %}oui{% else %}non{% endif %}
+ </tr>
+ </tbody>
+ </table>
+ </div>
+</div>
+<div class="clear"></div>
+<table id="form-employe">
+ <tbody>
+ <tr>
+ <th>Employé</th>
+ <td colspan="5">{{ dossier.employe }}</td>
+ </tr>
+ </tbody>
+</table>
+
+</fieldset>
+
+<fieldset>
+<h2>Comparaison salariale</h2>
+<span class="info">dans la région pour les employés occupant un poste similaire</span>
+<table>
+ <tbody>
+ <tr>
+ <th>Employé</th>
+ <th>Poste</th>
+ <th>Date fin contrat</th>
+ <th>Salaire</th>
+ <th>Salaire EUR</th>
+ <th>Implantation</th>
+ <th>Famille Emploi</th>
+ </tr>
+ {% for d in comparaison_dossiers %}
+ <tr>
+ <td>{{ d.employe }}</td>
+ <td>{{ d.poste1.type_poste.nom }} {{ d.complement1 }}</td>
+ <td>{{ d.contrat_date_fin|default:"en cours" }}</td>
+ <td>{{ d.get_salaire_display }}</td>
+ <td>{{ d.get_salaire_euro_display }}</td>
+ <td>{{ d.poste1.implantation }}</td>
+ <td>{{ d.poste1.type_poste.famille_emploi.nom }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
+</fieldset>
+
+
+ <div id="form-dossier">
+ {% comment %}Wrapper du formulaire de dossier{% endcomment %}
+ {% include "dae/embauche-dossier-consulter.html" %}
+ </div>
+
+ <fieldset>
+ <h2>Pièces jointes</h2>
+ <p class="info">CV, lettre de motivation...</p>
+ {% include "dae/pieces.html" %}
+ </fieldset>
+
+ <h2 class="section">SECTION 3 - COÛT GLOBAL</h2>
+
+ <fieldset>
+
+ {% if new %}
+ <p>
+ Vous devez enregister ce dossier avant de pouvoir détailler le
+ coût global.
+ </p>
+ {% else %}
+ <table cellspacing="0" id="global-cost">
+ {% include 'dae/embauche-remun.html' %}
+ </table>
+
+ <select id="type-remun" name="type-remun">
+ <option value="">(Ajouter une ligne)</option>
+ {% for tr in type_remun %}
+ <option value="{{ tr.id }}">{{ tr.nom }}</option>
+ {% endfor %}
+ </select>
+ {% endif %}
+
+ </fieldset>
+
+ <h2 class="section">SECTION 4 - JUSTIFICATION DE LA DEMANDE (OBLIGATOIRE)</h2>
+ <h3>A - Justification du poste</h3>
+ <p>{{ poste.justification }}</p>
+
+ <h3>B - Justification de l'employé</h3>
+ <p class="info">Les questions posées pour la justification apparaîtront après avoir enregistré le dossier.</p>
+ <table>
+ <tr>
+ <th>NOUVEL EMPLOYÉ</th>
+ <th>RENOUVELLEMENT, PROLONGATION, RECLASSEMENT, MOBILITÉ INTERNE</th>
+ </tr>
+ <tr>
+ <td>
+ {% with justificationsNouveauForm as form %}
+ {% include "dae/justifications.html" %}
+ {% endwith %}
+ </td>
+ <td>
+ {% with justificationsAutreForm as form %}
+ {% include "dae/justifications.html" %}
+ {% endwith %}
+ </td>
+ </tr>
+ </table>
+ <input type="submit" name="save" value="Sauvegarder" />
+</form>
+{% endblock %}
+
<table>
<tr>
<th>Embauche</th>
- <th>Soumis le</th>
- <th>Soumis par</th>
- <th>Valid. rég.</th>
- <th>Valid. RH</th>
- <th>Valid. SG</th>
- <th>Valid. Recteur</th>
- <th>Décision finale</th>
</tr>
-{% for dossier, premiere_revision in embauches %}
+{% for dossier in embauches %}
<tr>
- <td><a href="{% url embauche dossier.poste.key dossier.id %}">{{ dossier }}</a></td>
- <td>{{ premiere_revision.date_created|date:"Y-m-d" }}</td>
- <td>{{ premiere_revision.user }}</td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
+ <td><a href="{% url embauche_consulter dossier.id %}">{{ dossier }}</a></td>
</tr>
{% endfor %}
</table>
# embauche
url(r'^embauches$', 'embauches_liste', name='dae_embauches_liste'),
url(r'^embauche$', 'embauche', name='embauche'),
- url(r'^embauche/(?P<key>.*)/(?P<dossier>.*)$', 'embauche',
- name='embauche'),
+ url(r'^embauche/consulter/(?P<dossier_id>.*)$', 'embauche_consulter', name='embauche_consulter'),
+ url(r'^embauche/(?P<key>.*)/(?P<dossier>.*)$', 'embauche', name='embauche'),
url(r'^embauche/(?P<key>.*)$', 'embauche', name='embauche'),
# ajax
# Exclusion de "Indemnité de fonction" des types de rémun utilisés
return rh.TypeRemuneration.objects.exclude(pk=7)
+def get_dossiers_connexes(poste):
+ # Chargement des données de comparaison
+ comparaison_dossiers = []
+ famille = poste.type_poste.famille_emploi
+ # postes DAE (vieux dossiers)
+ postes_region = dae.Poste.objects.filter(implantation__region=poste.implantation.region)
+ for p in postes_region:
+ dossiers = p.get_dossiers()
+ if len(dossiers) > 0 and dossiers[0].poste1.type_poste.famille_emploi == famille:
+ comparaison_dossiers.append(dossiers[0])
+ # poste RHv1 (vieux dossiers)
+ postes_region = rh.Poste.objects.filter(implantation__region=poste.implantation.region)
+ for p in postes_region:
+ dossiers = p.poste1.all().order_by('rh_v1_dossier.date_creation') # through key incohérente... (dossiers)
+ if len(dossiers) > 0 and dossiers[0].poste1.type_poste.famille_emploi == famille:
+ comparaison_dossiers.append(dossiers[0])
+ return comparaison_dossiers
+
+
+@admin_required
+def embauche_consulter(request, dossier_id):
+ dossier = get_object_or_404(dae.Dossier, pk=dossier_id)
+ vars = {
+ 'dossier' : dossier,
+ 'comparaison_dossiers' : get_dossiers_connexes(dossier.poste),
+ }
+ return render_to_response('dae/embauche_consulter.html', vars, RequestContext(request))
+
@admin_required
def embauche(request, key=None, dossier=None):
""" Formulaire d'autorisation d'embauche. """
justificationsNouveauForm = JustificationNouvelEmployeForm(instance=dossier)
justificationsAutreForm = JustificationAutreEmployeForm(instance=dossier)
- # Chargement des données de comparaison
- comparaison_dossiers = []
- famille = poste.type_poste.famille_emploi
- # postes DAE (vieux dossiers)
- postes_region = dae.Poste.objects.filter(implantation__region=poste.implantation.region)
- for p in postes_region:
- dossiers = p.get_dossiers()
- if len(dossiers) > 0 and dossiers[0].poste1.type_poste.famille_emploi == famille:
- comparaison_dossiers.append(dossiers[0])
- # poste RHv1 (vieux dossiers)
- postes_region = rh.Poste.objects.filter(implantation__region=poste.implantation.region)
- for p in postes_region:
- dossiers = p.poste1.all().order_by('rh_v1_dossier.date_creation') # through key incohérente... (dossiers)
- if len(dossiers) > 0 and dossiers[0].poste1.type_poste.famille_emploi == famille:
- comparaison_dossiers.append(dossiers[0])
-
vars = dict(step='employe',
type_remun=type_remun,
poste=poste,
piecesForm=piecesForm,
justificationsNouveauForm=justificationsNouveauForm,
justificationsAutreForm=justificationsAutreForm,
- comparaison_dossiers=comparaison_dossiers,
+ comparaison_dossiers=get_dossiers_connexes(poste),
forms=dict(employe=employe_form, dossier=dossier_form, )
)
def embauches_liste(request):
""" Liste des embauches. """
vars = dict()
- vars['embauches'] = []
- for d in dae.Dossier.objects.all().order_by('-date_creation'):
- versions = Version.objects.get_for_object(d)
- if len(versions) > 0:
- premiere_revision = versions[0].revision
- else:
- premiere_revision = None
- vars['embauches'].append((d, premiere_revision))
- return render_to_response('dae/embauches_liste.html', vars,
- RequestContext(request))
+ vars['embauches'] = dae.Dossier.objects.all().order_by('-date_creation')
+ return render_to_response('dae/embauches_liste.html', vars, RequestContext(request))
def employe(request, key):
""" Récupération AJAX de l'employé pour la page d'embauche. """