.bordure { border:1px solid #162d50; }
div.contenu { padding:10px 0px 10px 0px; }
+
+li.no_puce { list-style-type:none; }
# -=- encoding: utf-8 -=-
+from datetime import date
+
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.conf import settings
+
from auf.django.metadata.models import AUFMetadata
from auf.django.metadata.managers import NoDeleteManager
import datamaster_modeles.models as ref
"""
from django.core.urlresolvers import reverse
return reverse('rh_photo', kwargs={'id':self.id})
+
+ def postes_encours(self):
+ pass
+
+ def dossiers_passes(self):
+ today = date.today()
+ return self.dossiers.filter(date_fin__lt=today).order_by('-date_fin')
+
+ def dossiers_futurs(self):
+ today = date.today()
+ return self.dossiers.filter(date_debut__gt=today).order_by('-date_fin')
+
+ def dossiers_encours(self):
+ dossiers_p_f = self.dossiers_passes() | self.dossiers_futurs()
+ ids_dossiers_p_f = [d.id for d in dossiers_p_f]
+ return self.dossiers.exclude(id__in=ids_dossiers_p_f).order_by('-date_fin')
class EmployePiece(models.Model):
"""Documents relatifs à un employé.
-{% extends 'base.html' %}
+{% extends 'sgrh.html' %}
{% block title %}RH - {{ employe }}{% endblock %}
{% block sous_titre %}Employés{% endblock %}
{% block main %}
-<h1>{{ employe }}</h1>
-{{ employe }}
-{% endblock %}
+{% include "rh/include/employe.html" %}
+{% endblock %}
-{% extends 'base.html' %}
+{% extends 'sgrh.html' %}
{% block title %}RH - Employés{% endblock %}
{% block sous_titre %}Employés{% endblock %}
<ul>
{% for e in employes %}
- <li>
- {% comment %}
- {% if e.genre.lower == 'f' %}
- <img src="{{ MEDIA_URL }}/images/femme16x21.png" alt="" />
- {% else %}
- <img src="{{ MEDIA_URL }}/images/homme16x21.png" alt="" />
- {% endif %}
- {% endcomment %}
- <img src="{{ e.url_photo }}" alt="" width="16" height="21" />
- <a href="{% url rh_employe e.id %}">{{ e }}</a>
- </li>
+ {% include "rh/include/employe_li.html" %}
{% endfor %}
</ul>
--- /dev/null
+<div id="identification" class="contenu">
+ <div class="gauche">
+ <img src="{{ employe.url_photo }}" alt="Photo" class="bordure" />
+ </div>
+ <div class="gauche">
+ <h1>{{ employe.civilite }} {{ employe }}</h1>
+
+ {% for d in employe.dossiers_encours %}
+ <p>
+ {% if employe.genre.upper == 'F' %}
+ {{ d.poste.nom_feminin }}
+ {% else %}
+ {{ d.poste.nom }}
+ {% endif %}
+ </p>
+ <p>
+ {{ d.poste.service|default_if_none:"Service inconnu" }}<br />
+ {{ d.poste.implantation.nom|default_if_none:"Implantation inconnue" }}<br />
+ {{ d.poste.implantation.adresse_physique_ville|default_if_none:"Ville inconnue" }}
+ </p>
+ {% endfor %}
+ </div>
+</div>
--- /dev/null
+<li class="no_puce">
+<img src="{{ e.url_photo }}" alt="" width="16" height="21" />
+<a href="{% url rh_employe e.id %}">{{ e }}</a>
+</li>
{% block sous_titre %}Mon profil RH{% endblock %}
{% block main %}
-<div id="identification" class="contenu">
- <div class="gauche">
- <img src="{{ employe.url_photo }}" alt="Photo" class="bordure" />
- </div>
- <div class="gauche">
- <h1>{{ employe.civilite }} {{ employe }}</h1>
-
- {% for d in dossiers_encours %}
- <p>
- {% if employe.genre.upper == 'F' %}
- {{ d.poste.nom_feminin }}
- {% else %}
- {{ d.poste.nom }}
- {% endif %}
- </p>
- <p>
- {{ d.poste.service|default_if_none:"Service inconnu" }}<br />
- {{ d.poste.implantation.nom }}<br />
- {{ d.poste.implantation.adresse_physique_ville }}
- </p>
- {% endfor %}
- </div>
-</div>
+
+{% include "rh/include/employe.html" %}
<div id="infos_perso" class="clear gauche50 contenu">
<h2>Informations personnelles</h2>
<tr>
<th>Téléphone :</th>
<td>
- {% for d in dossiers_encours %}
+ {% for d in employe.dossiers_encours %}
{% if d.poste.implantation.telephone_interne %}
{{ d.poste.implantation.telephone_interne }}
{% else %}
<tr>
<th>Télécopie :</th>
<td>
- {% for d in dossiers_encours %}
+ {% for d in employe.dossiers_encours %}
{% if d.poste.implantation.fax_interne %}
{{ d.poste.implantation.fax_interne }}
{% else %}
<tr>
<th>Adresse postale :</th>
<td>
- {% for d in dossiers_encours %}
+ {% for d in employe.dossiers_encours %}
{% comment %}
Formattage identique à annuaire intranet.
{% endcomment %}
<hr />
<div id="postes" class="contenu">
- <h2>Poste{{ dossiers_encours|pluralize }} en cours</h2>
+ <h2>Poste{{ employe.dossiers_encours|pluralize }} en cours</h2>
- {% for d in dossiers_encours %}
+ {% for d in employe.dossiers_encours %}
<h3>{{ d.poste.nom }}</h3>
<p>
{{ d.poste.service }}<br />
<hr />
<div id="dossiers" class="contenu">
- <h2>Ancien{{ dossiers|pluralize }} poste{{ dossiers|pluralize }}</h2>
+ <h2>
+ Ancien{{ employe.dossiers.count|pluralize }} poste{{ employe.dossiers.count|pluralize }}
+ ({{ employe.dossiers.count }})
+ </h2>
<table>
<tbody>
- {% for d in dossiers_passes %}
+ {% for d in employe.dossiers_passes %}
{% include "rh/include/dossier.html" %}
{% endfor %}
</tbody>
{% endcomment %}
{% endblock %}
-
c['user'] = request.user
c['employe'] = employe
c['dossiers'] = dossiers.count()
- c['dossiers_passes'] = dossiers_passes
- c['dossiers_encours'] = dossiers_encours
return render_to_response('rh/profil.html', c, rc)
# employes
-{% extends 'base.html' %}
+{% extends 'sgrh.html' %}
{% block title %}RH - Erreur 404{% endblock %}
{% block sous_titre %}Erreur 404{% endblock %}
-{% extends 'base.html' %}
+{% extends 'sgrh.html' %}
{% block title %}RH - Erreur 500{% endblock %}
{% block sous_titre %}Erreur 500{% endblock %}
-{% extends 'base.html' %}
+{% extends 'sgrh.html' %}
{% block title %}RH - Erreur 550{% endblock %}
{% block sous_titre %}Erreur 550{% endblock %}
<p>Dix employés au hasard...</p>
{% for e in employes %}
<ul>
- <li><a href="{% url rh_employe e.id %}">{{ e }}</a></li>
+ {% include "rh/include/employe_li.html" %}
</ul>
{% endfor %}
</div>