Merge branch 'dev' into test
authorOlivier Larchevêque <olivier.larcheveque@auf.org>
Fri, 12 Aug 2011 15:44:37 +0000 (11:44 -0400)
committerOlivier Larchevêque <olivier.larcheveque@auf.org>
Fri, 12 Aug 2011 15:44:37 +0000 (11:44 -0400)
16 files changed:
buildout.cfg
project/lib.py
project/media/css/sgrh.css
project/media/images/femme.png [new file with mode: 0644]
project/media/images/homme.png [new file with mode: 0644]
project/media/images/masters/femme.svg [new file with mode: 0644]
project/media/images/masters/homme.svg [new file with mode: 0644]
project/rh/api.py [new file with mode: 0644]
project/rh/models.py
project/rh/templates/rh/employes_liste.html
project/rh/templates/rh/include/dossier.html
project/rh/templates/rh/profil.html
project/rh/urls.py
project/rh/views.py
project/settings.py
src/auf.django.emploi/CHANGES

index d5185a9..b12acc5 100644 (file)
@@ -10,10 +10,9 @@ find-links = http://pypi.auf.org/simple/auf.recipe.django/
     http://pypi.auf.org/simple/auf.django.workflow/
     http://pypi.auf.org/simple/auf.django.admingroup/
     http://pypi.auf.org/simple/auf.django.metadata/
+    http://pypi.auf.org/simple/auf.django.emploi/
     http://pypi.auf.org/django-alphafilter/
 
-develop = src/auf.django.emploi
-
 eggs =
     django
     south
@@ -52,6 +51,7 @@ django-reversion = 1.3.3
 auf.django.workflow = 0.14dev
 django-ajax-selects = 1.1.4
 django-alphafilter = 0.5.3auf4
+auf.django.emploi = 0.1dev
 #reportlab = 2.5
 #html5lib = 0.90
 #pyPDF = 1.13
index 7a2e010..e73b3a1 100644 (file)
@@ -10,7 +10,10 @@ def get_employe_from_user(user):
     try:
         ref_employe = ref.Authentification.objects.get(courriel=user.email).id
         employe = rh.Employe.objects.get(id=ref_employe.id)
-        employe.courriel = ref.Employe.objects.get(id=employe.id).courriel
+        ref_employe = ref.Employe.objects.get(id=employe.id)
+        employe.courriel = ref_employe.courriel
+        employe.tel_pro_poste = ref_employe.telephone_poste
+        employe.tel_pro_ip = ref_employe.telephone_ip
     except:
         #raise Exception(u"L'employé avec le courriel %s n'a pas été trouvé dans le référentiel." % user.email)
         employe = rh.Employe.objects.none()
index 62e6167..bf26b48 100644 (file)
@@ -16,4 +16,9 @@
 .droite60 { float:right; width:58%; padding-left:2%; }
 
 .nombre { text-align:right; }
+.date { text-align:right; }
 .archive td { background-color:#e6e6e6; }
+
+.bordure { border:1px solid #162d50; }
+
+div.contenu { padding:10px 0px 10px 0px; }
diff --git a/project/media/images/femme.png b/project/media/images/femme.png
new file mode 100644 (file)
index 0000000..dce57a7
Binary files /dev/null and b/project/media/images/femme.png differ
diff --git a/project/media/images/homme.png b/project/media/images/homme.png
new file mode 100644 (file)
index 0000000..a3f017e
Binary files /dev/null and b/project/media/images/homme.png differ
diff --git a/project/media/images/masters/femme.svg b/project/media/images/masters/femme.svg
new file mode 100644 (file)
index 0000000..7432312
--- /dev/null
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="240.87302"
+   height="938.12268"
+   id="svg3610"
+   sodipodi:version="0.32"
+   inkscape:version="0.47 r22583"
+   version="1.0"
+   sodipodi:docname="femme.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <title
+     id="title3635">Person Outline</title>
+  <defs
+     id="defs3612">
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient3661">
+      <stop
+         style="stop-color:#162d50;stop-opacity:1;"
+         offset="0"
+         id="stop3663" />
+      <stop
+         style="stop-color:#162d50;stop-opacity:0;"
+         offset="1"
+         id="stop3665" />
+    </linearGradient>
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective3618" />
+    <inkscape:perspective
+       id="perspective3602"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <inkscape:perspective
+       id="perspective2825"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <inkscape:perspective
+       id="perspective2839"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <inkscape:perspective
+       id="perspective2839-5"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3661"
+       id="linearGradient3667"
+       x1="-241.76562"
+       y1="105.12268"
+       x2="-358.8125"
+       y2="-8.5625"
+       gradientUnits="userSpaceOnUse" />
+    <inkscape:perspective
+       id="perspective3681"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3661-8"
+       id="linearGradient3667-7"
+       x1="-241.76562"
+       y1="105.12268"
+       x2="-358.8125"
+       y2="-8.5625"
+       gradientUnits="userSpaceOnUse" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient3661-8">
+      <stop
+         style="stop-color:#162d50;stop-opacity:1;"
+         offset="0"
+         id="stop3663-6" />
+      <stop
+         style="stop-color:#162d50;stop-opacity:0;"
+         offset="1"
+         id="stop3665-0" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3661"
+       id="linearGradient3719"
+       gradientUnits="userSpaceOnUse"
+       x1="-241.76562"
+       y1="105.12268"
+       x2="-358.8125"
+       y2="-8.5625" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.25"
+     inkscape:cx="-205.47635"
+     inkscape:cy="824.55123"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer2"
+     showgrid="false"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     inkscape:window-width="959"
+     inkscape:window-height="1000"
+     inkscape:window-x="959"
+     inkscape:window-y="0"
+     inkscape:window-maximized="0" />
+  <metadata
+     id="metadata3615">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title>Person Outline</dc:title>
+        <dc:contributor>
+          <cc:Agent>
+            <dc:title>Fabricatorz, Lu Fang, Jon Phillips</dc:title>
+          </cc:Agent>
+        </dc:contributor>
+        <cc:license
+           rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/licenses/publicdomain/">
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Reproduction" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Distribution" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="original"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-269.84466,-34.953103)"
+     sodipodi:insensitive="true"
+     style="display:none">
+    <path
+       d="m 470.39937,381.29025 c 0.6446,-0.16592 1.2649,-0.3072 1.6279,-0.28141 0.1658,0.01 0.3475,0.0449 0.5134,0.0559 0,0 -2.1418,0.22773 -2.1418,0.22773 l 5e-4,-0.002 z m -64.2371,303.4367 c -2.0914,6.80308 -1.5723,14.64451 -2.0914,18.8222 -0.5247,4.18264 -1.5672,1.57227 -1.5672,13.06711 0,11.50481 -2.0964,35.02371 -4.7068,47.04768 -2.6154,12.02392 -2.6154,19.33613 -2.6154,27.18251 0,7.84131 -8.3604,41.81683 -8.3604,41.81683 0,0 -1.0426,15.16351 -1.0426,15.16351 0,0 -1.0427,5.22589 -1.0427,5.22589 0,0 -0.5292,-24.04292 -0.5292,-24.04292 0,0 -3.1397,-9.41359 -3.1397,-9.41359 0,0 -9.4085,-81.01824 -9.4085,-86.24918 0,-5.22592 -2.6104,-14.63936 -2.6104,-14.63936 0,0 2.0915,-6.79828 2.0915,-6.79828 0,0 1.567,-26.1342 1.567,-26.1342 0,0 2.6105,-12.02394 2.6105,-12.02394 0,0 3.1395,-29.79793 5.236,-56.45641 2.0863,-26.66329 8.8844,-63.77347 8.8844,-63.77347 0,0 2.0863,-10.45671 2.0863,-10.45671 0,0 5.755,18.29301 10.4567,71.61487 4.0969,46.4077 -2.3938,33.5219 2.0912,48.09082 2.0915,6.79817 4.183,15.16354 2.0915,21.95664 l -8e-4,0 z m 102.9801,-368.01157 c 0,0 -2.0915,-2.09139 -2.0915,-2.09139 0,0 0.5247,-0.52472 2.6154,-3.13946 2.0914,-2.6154 -2.6154,-3.65353 -3.1395,-6.26905 -0.5248,-2.61542 -9.9275,-32.93236 -9.9275,-32.93236 0,0 1.0427,-6.79815 -1.0439,-11.49988 -2.0963,-4.7068 -1.0482,-21.43753 -1.5722,-31.88931 -0.5248,-10.45673 -7.3172,-16.72569 -14.1153,-20.3893 -6.7982,-3.65871 -15.6171,-6.29923 -21.4326,-5.74996 -24.708,2.36348 -23.5994,3.09418 -8.3652,-4.18273 0,0 1.0483,-8.36538 3.1343,-14.1153 2.0964,-5.74995 -0.519,-3.12939 -2.0863,-9.40854 -1.5672,-6.27398 -0.5247,-6.27398 0.5247,-13.59126 1.0427,-7.32219 -0.5247,-10.45673 -3.1395,-13.5963 -2.6105,-3.12432 -3.1346,-1.03822 -3.1346,-10.44664 0,-9.40853 -4.7017,-19.8703 -9.4085,-43.913254 -4.7068,-24.047988 -31.3702,-50.187225 -37.1151,-53.840872 -5.755,-3.658584 -13.5963,-4.706671 -19.3411,-4.706671 -5.755,0 -10.9808,3.658572 -10.9808,3.658572 0,0 -7.8363,1.5672 -13.0672,2.091373 -5.2259,0.524716 -12.0241,8.36523 -18.298,15.687546 -6.269,7.312107 -14.6345,29.273783 -17.2499,45.475546 -2.6104,16.20149 -1.5673,21.95661 -5.7499,38.67723 -4.1827,16.73591 -7.8414,24.04789 -7.8414,24.04789 0,0 3.1346,12.54809 3.1346,12.54809 0,0 17.9352,10.96577 17.9352,10.96577 0,0 4.354,6.53613 4.354,6.53613 0,0 -14.5185,7.25671 -30.6496,10.20467 -14.9922,2.74157 -16.7308,6.80322 -20.9084,30.32212 -4.1826,23.52383 -6.279,64.81661 -9.9376,95.13858 -3.6536,30.31695 18.8221,63.24943 21.9616,66.91305 1.9604,2.28791 7.2869,2.27277 10.9959,1.94012 1.7133,28.76989 2.4039,2.89257 -0.023,28.37681 -1.0428,10.9809 -2.6104,23.52396 -2.6104,23.52396 0,0 -1.0484,8.36534 -1.0484,8.36534 0,0 -3.1345,9.92755 -5.2257,17.77389 -2.0864,7.84133 0,26.13936 0,26.13936 0,0 0.5247,26.13926 0.5247,31.8892 0,5.7449 0,14.10532 0,14.10532 0,0 4.7017,62.73536 8.3604,89.91284 3.6637,27.18745 5.2308,65.87491 5.2308,65.87491 0,0 -0.5191,4.17756 -0.5191,4.17756 0,0 1.0427,4.17771 1.0427,4.17771 0,0 -1.5722,5.23094 -1.5722,5.23094 0,0 0.5291,5.22577 0,9.41344 -0.5191,4.17771 -3.1344,17.77401 -3.1344,17.77401 0,0 1.5722,12.54294 0.5246,33.45137 -1.0482,20.91355 5.2259,60.63902 7.8364,77.36482 2.6203,16.73073 9.9376,50.18725 12.0289,63.77346 2.0914,13.5963 1.5672,9.41357 1.5672,9.41357 0,0 3.6587,2.61542 3.6587,2.61542 0,0 2.1165,11.28327 -0.1357,14.84105 -3.598,5.65924 -17.1037,12.65395 -17.1037,12.65395 0,0 -1.5622,13.06709 -1.5622,13.06709 0,0 35.0086,-1.3506 41.8019,-1.88473 6.798,-0.51351 14.7854,1.09875 22.6217,-10.40136 7.8464,-11.50492 4.5657,-18.86738 4.5657,-18.86738 0,0 -1.5724,-6.27398 -1.5724,-6.27398 0,0 1.0484,-3.6587 1.0484,-3.6587 0,0 3.6587,3.6587 3.6587,3.6587 0,0 2.3182,12.14479 9.9275,25.61508 6.7982,12.02406 13.0721,8.88448 13.0721,8.88448 0,0 10.457,-1.04271 10.457,-1.04271 0,0 3.6534,-3.13453 3.6534,-3.13453 3.2453,-10.18451 2.8876,-10.08383 9.9377,-22.99968 6.2741,-11.50505 0.5191,-9.93774 0.5191,-9.93774 0,0 9.9376,-4.70173 9.9376,-4.70173 0,0 11.4949,-51.75456 11.4949,-51.75456 0,0 2.0964,-22.47563 2.0964,-22.47563 0,0 3.6535,-31.36514 3.6535,-31.36514 0,0 3.1396,-17.24984 3.1396,-17.24984 0,0 1.5623,-25.62024 1.5623,-25.62024 0,0 5.2308,-25.08622 6.803,-41.28774 1.5672,-16.21172 -1.5722,-15.16362 -2.0913,-22.99989 -0.5247,-7.84625 0,-8.89446 -2.0914,-23.00976 -2.0912,-14.11542 2.6105,-28.74482 2.6105,-28.74482 0,0 5.2257,-51.23029 5.2257,-51.23029 0,0 8.8947,-59.07182 14.1205,-77.89391 5.2258,-18.81201 1.5622,-22.99474 1.5622,-39.73062 0,-16.72064 0.5292,-20.90831 0.5292,-20.90831 0,0 -5.7548,-27.18251 -10.9808,-46.52372 -5.231,-19.34111 -5.7449,-19.34111 -6.2739,-28.74961 -0.4989,-9.06087 0.917,-17.08358 1.0224,-17.66818 7.1913,0.71532 16.2319,3.55275 16.2319,3.55275 0,0 4.1777,0 8.8845,-4.70174 4.7017,-4.70679 7.8361,-27.71162 8.8844,-33.97564 1.0427,-6.27892 1.5722,-21.9666 1.5722,-21.9666 0,0 2.0914,-3.13442 2.0914,-3.13442 0,0 -1.5722,-4.17779 -1.5722,-4.17779 l -0.003,-4.5e-4 z"
+       style="fill:#2e3436;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       id="path3445" />
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer2"
+     inkscape:label="cadre"
+     sodipodi:insensitive="true"
+     style="display:none">
+    <path
+       style="fill:#2e3436;fill-opacity:1;fill-rule:nonzero;stroke:none"
+       d="m 403.1875,419.9375 286.09375,0 c -2.42884,-8.6426 -10.90625,-36.25 -10.90625,-36.25 0,0 1.28833,-8.36623 -1.28125,-14.15625 -2.58152,-5.79626 -1.29221,-26.41024 -1.9375,-39.28125 -0.64627,-12.8771 -9.00338,-20.58214 -17.375,-25.09375 -8.37175,-4.50558 -19.24466,-7.77016 -26.40625,-7.09375 -30.42704,2.91054 -29.04164,3.80502 -10.28125,-5.15625 0,0 1.27491,-10.29417 3.84375,-17.375 2.58165,-7.08086 -0.63243,-3.86119 -2.5625,-11.59375 -1.92996,-7.72619 -0.63605,-7.70778 0.65625,-16.71875 1.28404,-9.01703 -0.65496,-12.88372 -3.875,-16.75 -3.21474,-3.84749 -3.875,-1.28886 -3.875,-12.875 0,-11.58628 -5.76624,-24.45444 -11.5625,-54.0625 C 597.92249,133.91699 565.07464,101.71809 558,97.21875 550.91292,92.713331 541.26202,91.4375 534.1875,91.4375 c -7.08709,0 -13.53125,4.5 -13.53125,4.5 0,0 -9.65208,1.916999 -16.09375,2.5625 -6.43552,0.646169 -14.80516,10.29532 -22.53125,19.3125 -7.72006,9.00461 -18.02922,36.07934 -21.25,56.03125 -3.21461,19.95157 -1.91177,27.03414 -7.0625,47.625 -5.15085,20.6097 -9.65625,29.59375 -9.65625,29.59375 l 3.84375,15.46875 22.09375,13.5 5.375,8.0625 c 0,0 -17.88511,8.93219 -37.75,12.5625 -18.46238,3.37615 -20.60543,8.38104 -25.75,37.34375 -3.65114,20.53479 -6.01788,52.0185 -8.6875,81.9375 z"
+       id="path3445-5" />
+    <rect
+       style="fill:none;stroke:#000000;stroke-width:2.07371759;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"
+       id="rect2815"
+       width="297.92627"
+       height="397.92627"
+       x="-520.25604"
+       y="2.3311157" />
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer3"
+     inkscape:label="couleur">
+    <g
+       transform="translate(327.29291,-377.17157)"
+       id="g3669-0"
+       inkscape:export-xdpi="111"
+       inkscape:export-ydpi="111">
+      <path
+         id="path3445-5-6"
+         d="m -358.8125,319.9375 286.09375,0 c -2.428845,-8.6426 -10.90625,-36.25 -10.90625,-36.25 0,0 1.288326,-8.36623 -1.28125,-14.15625 -2.58152,-5.79626 -1.292212,-26.41024 -1.9375,-39.28125 -0.646273,-12.8771 -9.003378,-20.58214 -17.375,-25.09375 -8.37175,-4.50558 -19.24466,-7.77016 -26.40625,-7.09375 -30.42704,2.91054 -29.04164,3.80502 -10.28125,-5.15625 0,0 1.27491,-10.29417 3.84375,-17.375 2.58165,-7.08086 -0.63243,-3.86119 -2.5625,-11.59375 -1.92996,-7.72619 -0.63605,-7.70778 0.65625,-16.71875 1.28404,-9.01703 -0.65496,-12.88372 -3.875,-16.75 -3.21474,-3.84749 -3.875,-1.28886 -3.875,-12.875 0,-11.58628 -5.76624,-24.45444 -11.5625,-54.0625 C -164.07751,33.916987 -196.92536,1.71809 -204,-2.78125 c -7.08708,-4.505419 -16.73798,-5.78125 -23.8125,-5.78125 -7.08709,0 -13.53125,4.5 -13.53125,4.5 0,0 -9.65208,1.916999 -16.09375,2.5625 -6.43552,0.646169 -14.80516,10.295322 -22.53125,19.3125 -7.72006,9.004606 -18.02922,36.079341 -21.25,56.03125 -3.21461,19.951575 -1.91177,27.03414 -7.0625,47.625 -5.15085,20.6097 -9.65625,29.59375 -9.65625,29.59375 l 3.84375,15.46875 22.09375,13.5 5.375,8.0625 c 0,0 -17.88511,8.93219 -37.75,12.5625 -18.46238,3.37615 -20.60543,8.38104 -25.75,37.34375 -3.65114,20.53479 -6.01788,52.0185 -8.6875,81.9375 z"
+         style="fill:url(#linearGradient3667-7);fill-opacity:1;fill-rule:nonzero;stroke:none" />
+      <rect
+         y="-77.668884"
+         x="-370.25604"
+         height="397.92627"
+         width="297.92627"
+         id="rect2815-4"
+         style="fill:none;stroke:none;display:inline" />
+    </g>
+  </g>
+</svg>
diff --git a/project/media/images/masters/homme.svg b/project/media/images/masters/homme.svg
new file mode 100644 (file)
index 0000000..e143386
--- /dev/null
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="284.47598"
+   height="926.01123"
+   id="svg3610"
+   sodipodi:version="0.32"
+   inkscape:version="0.47 r22583"
+   version="1.0"
+   sodipodi:docname="homme.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <title
+     id="title3635">Person Outline</title>
+  <defs
+     id="defs3612">
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient3737">
+      <stop
+         style="stop-color:#162d50;stop-opacity:1;"
+         offset="0"
+         id="stop3739" />
+      <stop
+         style="stop-color:#162d50;stop-opacity:0;"
+         offset="1"
+         id="stop3741" />
+    </linearGradient>
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective3618" />
+    <inkscape:perspective
+       id="perspective3602"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <inkscape:perspective
+       id="perspective2826"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <inkscape:perspective
+       id="perspective2848"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <inkscape:perspective
+       id="perspective3647"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <inkscape:perspective
+       id="perspective3669"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3737"
+       id="linearGradient3743"
+       x1="573.76666"
+       y1="113.84858"
+       x2="428.98541"
+       y2="17.749233"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(-428.30468,-400.02041)" />
+    <inkscape:perspective
+       id="perspective3795"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.4"
+     inkscape:cx="350.71429"
+     inkscape:cy="1178.7384"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer3"
+     showgrid="false"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     inkscape:window-width="1920"
+     inkscape:window-height="1005"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata3615">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title>Person Outline</dc:title>
+        <dc:contributor>
+          <cc:Agent>
+            <dc:title>Fabricatorz, Lu Fang, Jon Phillips</dc:title>
+          </cc:Agent>
+        </dc:contributor>
+        <cc:license
+           rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/licenses/publicdomain/">
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Reproduction" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Distribution" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="original"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-271.64725,-41.007513)"
+     style="display:none"
+     sodipodi:insensitive="true">
+    <path
+       d="m 363.7044,144.14656 c 0,0 -3.1395,3.13455 -6.279,0.62451 -3.1296,-2.50957 -10.0335,-18.19209 -10.0335,-18.19209 0,0 0,-8.78379 0,-8.78379 0,0 -0.6245,-4.3943 -0.6245,-4.3943 0,0 -4.3892,-4.38927 -4.3892,-4.38927 0,0 -6.904,-7.53389 -1.8899,-21.961655 5.0192,-14.427793 13.1831,-30.115475 19.4571,-34.504727 6.2691,-4.3943 17.5623,-8.153687 17.5623,-8.153687 0,0 6.9039,-1.88473 6.9039,-1.88473 0,0 8.7838,-0.630111 8.7838,-0.630111 0,0 1.2497,-3.139459 13.8028,2.514717 12.548,5.639069 17.5673,10.668319 26.9758,20.071799 9.4136,9.408628 11.9232,10.668517 12.548,17.567364 0.6346,6.898945 0,15.062828 0,15.062828 0,0 -1.2598,5.019142 1.2599,10.033262 2.5045,5.0243 5.6441,3.76452 1.2497,10.6684 -4.3943,6.89896 -8.7786,11.91821 -8.7786,11.91821 0,0 -5.0243,5.01422 -5.0243,5.01422 0,0 -2.5095,-3.13454 -2.5095,1.88966 0,5.01423 -2.5047,11.92325 -2.5047,11.92325 0,0 2.5047,26.34589 2.5047,26.34589 0,0 1.8846,1.88486 8.7887,3.13959 6.899,1.25484 16.9374,7.52882 26.9758,7.52882 10.0335,0 11.9232,0 11.9232,0 0,0 3.1345,3.75939 -5.0243,6.274 -8.1536,2.5097 -9.4086,2.5097 -4.3944,5.64422 5.0243,3.13958 14.4328,6.27398 14.4328,6.27398 0,0 13.1781,1.88485 20.707,8.15884 7.5288,6.27401 23.2164,35.12956 23.2164,38.89904 0,3.75938 8.7786,8.15379 6.2741,12.54811 -2.5146,4.38925 -3.1396,6.89893 -3.1396,6.89893 0,0 0.6256,5.0242 4.3943,10.66843 3.7646,5.64398 10.0385,24.46607 11.9182,30.11534 1.8797,5.64412 1.2549,8.78358 4.3943,17.56231 3.1345,8.78358 3.7595,18.82716 1.8798,21.33673 -1.8798,2.50463 -0.6301,8.78357 -3.7695,16.31252 -3.1346,7.52377 -0.6245,11.29323 -5.6441,15.05766 -5.0141,3.75937 -15.6826,7.52884 -15.6826,7.52884 0,0 -4.3943,0.62562 -4.3943,0.62562 0,0 0.6301,13.17307 2.5095,21.33169 1.8848,8.15378 0,21.33692 6.2741,38.89913 6.2792,17.56736 11.2933,50.19229 11.2933,50.19229 0,0 -3.7644,9.40851 -9.4136,15.05766 -5.6441,5.64926 -32.6199,13.80295 -32.6199,13.80295 0,0 4.3893,93.48068 1.2547,106.65868 -3.1394,13.17304 -5.0192,21.33681 -8.1587,23.21651 -3.1395,1.87969 2.5095,34.50462 0.6301,42.03344 -1.8797,7.52895 -3.7696,28.23072 -3.7696,28.23072 0,0 1.8899,13.80801 1.8899,13.80801 0,0 5.644,6.27399 5.644,6.27399 0,0 1.2499,13.16801 1.2499,13.16801 0,0 -1.2499,36.39437 -5.6442,48.93733 -4.3892,12.55315 -2.5095,16.31767 -2.5095,21.96683 0,5.64409 -7.529,30.11534 -7.529,30.11534 0,0 4.3944,35.12956 4.3944,35.12956 0,0 5.6441,6.904 5.6441,6.904 0,0 17.5674,12.5481 23.8464,16.94252 6.269,4.38925 24.4662,16.93736 24.4662,16.93736 0,0 7.5239,6.27398 6.9041,10.66326 -0.6347,4.3943 -5.0194,10.66347 -5.0194,10.66347 0,0 -15.0627,11.29315 -37.6491,4.39431 -22.5867,-6.89894 -57.7212,-25.72104 -57.7212,-25.72104 0,0 -20.7019,-10.66337 -20.7019,-10.66337 0,0 -4.3943,-5.64927 -4.3943,-5.64927 0,0 -0.6256,-5.01914 -0.6256,-5.01914 0,0 3.1344,-3.76442 3.1344,-3.76442 0,0 3.1396,-2.50957 3.1396,-2.50957 0,0 0,-5.64422 0,-5.64422 0,0 -6.899,-8.15873 -8.1588,-13.80787 -1.2498,-5.63919 -1.8798,-98.49996 -0.6245,-111.67291 1.2549,-13.17798 1.8848,-23.2164 3.1345,-26.98596 1.2549,-3.75433 2.5096,-6.89897 2.5096,-6.89897 0,0 -1.8847,-8.14862 -1.8847,-8.14862 0,0 0,-7.53389 0,-7.53389 0,0 5.6493,-15.68767 5.6493,-15.68767 0,0 -13.1731,-50.81724 -13.1731,-62.11037 0,-11.29832 -2.5096,-50.19231 -2.5096,-50.19231 0,0 -7.5338,-25.72115 -7.5338,-25.72115 0,0 -2.5046,-8.15871 -2.5046,-8.15871 0,0 -4.3943,6.26894 -8.1537,10.66828 -3.7645,4.38434 -1.2598,8.77877 -6.904,21.32685 -5.6491,12.55305 -18.1972,48.9425 -18.1972,48.9425 0,0 -10.0385,39.52891 -10.0385,39.52891 0,0 -8.7836,89.09142 -8.7836,89.09142 0,0 -15.6877,119.82658 -15.6877,119.82658 0,0 0,11.29338 0,15.05768 0,3.76453 -9.4085,17.56737 -10.0385,21.96167 -0.62,4.39431 4.3945,7.53388 -1.8796,14.42779 -6.274,6.904 -8.1536,16.94239 -15.0577,16.31756 -6.899,-0.6301 -33.8798,-1.25978 -38.2692,-7.53388 -4.3893,-6.27905 -1.2598,-40.77872 -1.2598,-40.77872 0,0 4.3994,-6.27399 4.3994,-6.27399 0,0 0,-37.6443 0,-37.6443 0,0 24.4663,-186.34148 24.4663,-186.34148 0,0 -1.8797,-24.4663 -1.8797,-24.4663 0,0 -2.5146,-42.03861 -2.5146,-42.03861 0,0 5.0242,-84.697 5.0242,-84.697 0,0 2.5046,-13.17799 2.5046,-13.17799 0,0 -4.3894,-6.26907 -4.3894,-6.26907 0,0 -11.9232,-3.13946 -11.9232,-3.13946 0,0 4.3944,-28.23072 4.3944,-28.23072 0,0 19.447,-94.11562 19.447,-94.11562 0,0 -8.1537,-11.91317 -8.1537,-11.91317 0,0 -10.0384,-66.50973 -10.0384,-66.50973 0,0 10.0384,-84.69712 10.0384,-84.69712 0,0 15.6875,-14.43273 21.9616,-17.57231 6.274,-3.13957 20.0719,-12.54809 20.0719,-12.54809 0,0 6.904,-8.15369 6.904,-8.15369 0,0 11.2933,-10.03851 15.0577,-11.91821 3.7594,-1.87968 4.3944,-3.13958 4.3944,-3.13958 0,0 -2.5147,-12.54809 -3.1396,-17.56734 -0.6256,-5.01916 -5.6492,-13.17284 -5.6492,-13.17284 l -2e-4,-3.5e-4 z"
+       style="fill:#2e3436;fill-opacity:1;fill-rule:evenodd;stroke:none"
+       id="path3449" />
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer2"
+     inkscape:label="cadre"
+     style="display:none"
+     sodipodi:insensitive="true">
+    <rect
+       style="fill:none;stroke:#000000;stroke-width:2.07371759;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"
+       id="rect2815"
+       width="297.92627"
+       height="397.92627"
+       x="-500.2439"
+       y="-100.6916" />
+    <path
+       style="fill:#2e3436;fill-opacity:1;fill-rule:evenodd;stroke:none;display:inline"
+       d="m 435.04631,294.80075 289.5625,0 0,-86.875 c -10.62108,-8.37864 -28.3125,-10.9375 -28.3125,-10.9375 0,0 -13.18847,-4.38817 -20.21875,-8.78125 -7.01615,-4.38599 -5.25272,-4.39452 6.15625,-7.90625 11.41626,-3.51857 7.03125,-8.78125 7.03125,-8.78125 l -16.6875,0 c -14.0463,0 -28.09653,-8.77541 -37.75,-10.53125 -9.66061,-1.75568 -12.28125,-4.40625 -12.28125,-4.40625 l -3.5,-36.84375 c 0,0 3.5,-9.67131 3.5,-16.6875 0,-7.030145 3.5,-2.65625 3.5,-2.65625 l 7.03125,-6.999995 c 0,0 6.1325,-7.03408 12.28125,-16.6875 6.14889,-9.6603 1.75445,-7.90721 -1.75,-14.9375 -3.52569,-7.01604 -1.75,-14.03125 -1.75,-14.03125 0,0 0.88796,-11.40911 0,-21.0625 -0.87426,-9.65325 -4.39046,-11.42867 -17.5625,-24.5937501 -13.16489,-13.1578799 -20.19213,-20.2032499 -37.75,-28.0937499 -17.565,-7.91164 -19.3125,-3.5 -19.3125,-3.5 l -12.28125,0.875 -9.65625,2.625 c 0,0 -15.82168,5.28875 -24.59375,11.4375 -8.77893,6.1416899 -20.1956,28.09307 -27.21875,48.28125 -7.01601,20.18815 2.65625,30.71875 2.65625,30.71875 l 6.125,6.125 0.875,6.15625 0,12.28125 c 0,0 9.65215,21.957215 14.03125,25.468745 4.39297,3.51219 8.8125,-0.875 8.8125,-0.875 0,0 7.03088,11.4144 7.90625,18.4375 0.8744,7.02321 4.375,24.59375 4.375,24.59375 0,0 -0.89588,1.74485 -6.15625,4.375 -5.26737,2.63019 -21.0625,16.6875 -21.0625,16.6875 l -9.65625,11.40625 c 0,0 -19.31481,13.16944 -28.09375,17.5625 -8.77907,4.39307 -30.71875,24.59375 -30.71875,24.59375 l -7.53125,63.5625 z"
+       id="path3449-0-2" />
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer3"
+     inkscape:label="couleur"
+     style="display:inline">
+    <g
+       id="g3809"
+       inkscape:export-xdpi="111"
+       inkscape:export-ydpi="111">
+      <path
+         id="path3449-0-2-6"
+         d="m 0.680721,-56.732338 289.562499,0 0,-86.875002 c -10.62108,-8.37864 -28.3125,-10.9375 -28.3125,-10.9375 0,0 -13.18847,-4.38817 -20.21875,-8.78125 -7.01615,-4.38599 -5.25272,-4.39452 6.15625,-7.90625 11.41626,-3.51857 7.03125,-8.78125 7.03125,-8.78125 l -16.6875,0 c -14.0463,0 -28.09653,-8.77541 -37.75,-10.53125 -9.66061,-1.75568 -12.28125,-4.40625 -12.28125,-4.40625 l -3.5,-36.84375 c 0,0 3.5,-9.67131 3.5,-16.6875 0,-7.03014 3.5,-2.65625 3.5,-2.65625 l 7.03125,-6.99999 c 0,0 6.1325,-7.03408 12.28125,-16.6875 6.14889,-9.6603 1.75445,-7.90721 -1.75,-14.9375 -3.52569,-7.01604 -1.75,-14.03125 -1.75,-14.03125 0,0 0.88796,-11.40911 0,-21.0625 -0.87426,-9.65325 -4.39046,-11.42867 -17.5625,-24.59375 -13.16489,-13.15788 -20.19213,-20.20325 -37.75,-28.09375 -17.565,-7.91164 -19.3125,-3.5 -19.3125,-3.5 l -12.28125,0.875 -9.65625,2.625 c 0,0 -15.821679,5.28875 -24.593749,11.4375 -8.77893,6.14169 -20.1956,28.09307 -27.21875,48.28125 -7.01601,20.18815 2.65625,30.71875 2.65625,30.71875 l 6.125,6.125 0.875,6.15625 0,12.28125 c 0,0 9.65215,21.95721 14.03125,25.46874 4.39297,3.51219 8.8125,-0.875 8.8125,-0.875 0,0 7.03088,11.4144 7.90625,18.4375 0.874399,7.02321 4.374999,24.59375 4.374999,24.59375 0,0 -0.89588,1.74485 -6.156249,4.375 -5.26737,2.63019 -21.0625,16.6875 -21.0625,16.6875 l -9.65625,11.40625 c 0,0 -19.31481,13.16944 -28.09375,17.5625 -8.77907,4.39307 -30.71875,24.59375 -30.71875,24.59375 l -7.53125,63.562502 z"
+         style="fill:url(#linearGradient3743);fill-opacity:1;fill-rule:evenodd;stroke:none;display:inline" />
+      <rect
+         y="-454.76947"
+         x="-7.4808683"
+         height="397.92627"
+         width="297.92627"
+         id="rect2815-5"
+         style="fill:none;stroke:none;stroke-width:2.07371759000000022;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" />
+    </g>
+  </g>
+</svg>
diff --git a/project/rh/api.py b/project/rh/api.py
new file mode 100644 (file)
index 0000000..bc43de1
--- /dev/null
@@ -0,0 +1,52 @@
+# -*- encoding: utf-8 -*
+from os.path import exists
+
+from django.conf import settings
+from django.http import HttpResponse 
+from django.shortcuts import get_object_or_404
+
+import rh.models as rh
+
+PATH_PHOTOS = settings.PRIVE_MEDIA_ROOT + '/employe/photos/'
+PATH_DEFAUT = settings.MEDIA_ROOT + '/images/'
+FILE_DEFAUT_HOMME = 'homme.png'
+FILE_DEFAUT_FEMME = 'femme.png'
+
+#@
+def photo(request, id):
+    """Retourne la photo de l'employé si elle existe (sinon default fonction du genre).
+    Input : id = id de l'employé
+    Output : Photo via HTTP (avec bon mime-type) ou Erreur 550 HTTP : Permission denied.
+    """   
+    default = False
+    employe = get_object_or_404(rh.Employe, pk=id)
+    
+    # image
+    # TODO : chercher n'importe quelle image (peu importe extension)
+    path = "%s%d%s" % (PATH_PHOTOS, employe.id, '.jpg')
+    image = get_image(path)
+    if not image :
+        default = True            
+        filename = FILE_DEFAUT_HOMME
+        if employe.genre.lower() == 'f':
+            filename = FILE_DEFAUT_FEMME
+        path = PATH_DEFAUT + filename
+        image = get_image(path)
+        
+    # status
+    status = 404    # 550, Permission denied géré dans décorateur
+    if image:
+        status = 200
+    return HttpResponse(content=image, status=status)
+    
+# helper
+def get_image(path):
+    image = None
+    if exists(path):
+        try:
+            f = open(path)
+            image = f.read()
+            f.close()
+        except:
+            pass
+    return image
index c05e28d..b78a967 100644 (file)
@@ -26,6 +26,10 @@ def dossier_piece_dispatch(instance, filename):
     path = "dossier/%s/%s" % (instance.dossier_id, filename)
     return path
 
+def employe_piece_dispatch(instance, filename):
+    path = "employe/%s/%s" % (instance.employe_id, filename)
+    return path
+
 
 class Commentaire(AUFMetadata):
     texte = models.TextField()
@@ -349,6 +353,13 @@ class Employe(AUFMetadata):
         elif self.genre.upper() == u'F':
             civilite = u'Mme'
         return civilite
+        
+    def url_photo(self):
+        """Retourne l'URL du service retournant la photo de l'Employe.
+        Équivalent reverse url 'rh_photo' avec id en param.
+        """
+        from django.core.urlresolvers import reverse
+        return reverse('rh_photo', kwargs={'id':self.id})
 
 class EmployePiece(models.Model):
     """Documents relatifs à un employé.
@@ -358,7 +369,7 @@ class EmployePiece(models.Model):
                             related_name='+')
     nom = models.CharField(verbose_name="Nom", max_length=255)
     fichier = models.FileField(verbose_name="Fichier", 
-                            upload_to=dossier_piece_dispatch, 
+                            upload_to=employe_piece_dispatch, 
                             storage=storage_prive)
 
     class Meta:
@@ -1040,3 +1051,7 @@ class ResponsableImplantation(AUFMetadata):
         ordering = ['implantation__nom']
         verbose_name = "Responsable d'implantation"
         verbose_name_plural = "Responsables d'implantation"
+
+def dossier_piece_dispatch(instance, filename):
+    path = "dossier/%s/%s" % (instance.dossier_id, filename)
+    return path
index 2b58faa..6f1fcda 100644 (file)
@@ -4,7 +4,7 @@
 {% block sous_titre %}Employés{% endblock %}
 
 {% block main %}
-<h1>Employés</h1>
+<h1>Employé{{ employes|pluralize }} ({{ employes.count }}) </h1>
 
 <ul>
 <li style="display:inline"><a href="">Annuaire courriel</a></li>
@@ -19,7 +19,17 @@ http://intranet.auf/rubrique46.html
 
 <ul>
 {% for e in employes %}
-    <li><a href="{% url rh_employe e.id %}">{{ e }}</a></li>
+    <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>
 {% endfor %}
 </ul>
 
index f47f19b..c689a9e 100644 (file)
@@ -1,9 +1,7 @@
 <tr{% if d.archive %} class="archive"{% endif %}>
-    <td class="nombre">{{ d.id }}</td>
     <td><a href ="">{{ d.poste.nom }}</a></td>
-    <td>{{ d.date_debut }}</td>
-    <td>{{ d.date_fin|default_if_none:"" }}</td>
-    <td></td>
-    <td></td>
-    <td></td>
+    <td>du</td>
+    <td class="date">{{ d.date_debut }}</td>
+    <td>au</td>
+    <td class="date">{{ d.date_fin|default_if_none:"" }}</td>
 </tr>
index 16bbe2d..d833ca1 100644 (file)
@@ -4,11 +4,13 @@
 {% block sous_titre %}Mon profil RH{% endblock %}
 
 {% block main %}
-<h1>Mon profil RH</h1>
-
-<div id="identification">
-    <div class="gauche50">
-        <h2>{{ employe.civilite }} {{ employe }}</h2>
+<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' %}
             </p>
         {% endfor %}
     </div>
-    <div class="gauche50">
-        <img src="{{ employe.photo }}" alt="Photo" width="150" height="200" />
-    </div>
-</div>
-<hr class="clear" />
-
-<div>
-    <h2>Dépendants (ayant-droits)</h2>
-    {% if employe.ayantdroits.all %}
-    <ul>
-    {% for ad in employe.ayantdroits.all %}
-        <li>{{ ad }}</li>
-    {% endfor %}
-    </ul>
-    {% else %}
-        Aucun dépendant.
-    {% endif %}
 </div>
 
-<div id="infos" class="gauche50">
-    <h2>Informations professionnelles AUF</h2>
-    <table>
-        <tbody>
-            <tr>
-                <th>Date d'entrée :</th>
-                <td>{{ employe.date_entree }}</td>
-            </tr>
-        </tbody>
-    </table>
-
-</div>
-<div id="infos_perso" class="gauche50">
+<div id="infos_perso" class="clear gauche50 contenu">
     <h2>Informations personnelles</h2>
     <table>
         <tbody>
-            {% comment %}
+            {% if employe.nom_affichage %}
             <tr>
                 <th>Nom d'affichage :</th>
                 <td>{{ employe.nom_affichage }}</td>
             </tr>
-            {% endcomment %}
+            {% endif %}
             <tr>
                 <th>Date de naissance :</th>
                 <td>{{ employe.date_naissance }}</td>
         </tbody>
     </table>
 </div>
-
-<div id="coord" class="clear gauche50">
-    <h2>Coordonnées professionnelles AUF</h2>
+<div id="infos" class="gauche50 contenu">
+    <h2>Informations professionnelles AUF</h2>
     <table>
         <tbody>
             <tr>
-                <th>Courriel :</th>
-                <td>{{ employe.courriel }}</td>
-            </tr>
-            <tr>
-                <th>Téléphone IP :</th>
-                <td>{{ employe.champ }}</td>
-            </tr>
-            <tr>
-                <th>Téléphone :</th>
-                <td>{{ employe.champ }}</td>
-            </tr>
-            <tr>
-                <th>Télécopie :</th>
-                <td>{{ employe.champ }}</td>
-            </tr>
-            <tr>
-                <th>Adresse postale :</th>
-                <td>
-                </td>
+                <th>Date d'entrée :</th>
+                <td>{{ employe.date_entree }}</td>
             </tr>
         </tbody>
     </table>
 </div>
-<div id="coord_perso" class="gauche50">
+
+<div id="coord_perso" class="clear gauche50 contenu">
     <h2>Coordonnées personnelles</h2>
     <table>
         <tbody>
                 <td>
                     {{ employe.adresse }}<br />
                     {% if employe.ville or employe.province %}
-                        {{ employe.ville }}
-                        {% if employe.ville and employe.province %}, {% endif %}
+                        {{ employe.ville }}{% if employe.ville and employe.province %}, {% endif %}
                         {{ employe.province }}
                         <br />
                     {% endif %}
         </tbody>
     </table>
 </div>
-
-<div id="postes" class="clear">
-    <h2>Poste{{ dossiers_encours|pluralize }}</h2>
-    Globalement, mettre les infos du poste pertinente (n'en a pas beaucoup)...
-    ... mais surtout les infos du dossier (le fait que cette personne occupe ce poste).
-    {% for d in dossiers_encours %}
+<div id="coord" class="gauche50 contenu">
+    <h2>Coordonnées professionnelles AUF</h2>
     <table>
         <tbody>
             <tr>
-                <th>Nom :</th>
-                <td>{{ d.poste.nom }}</td>
-            </tr>
-            <tr>
-                <th>Implantation :</th>
-                <td>{{ d.poste.implantation }}</td>
-            </tr>
-            <tr>
-                <th>Type de poste :</th>
-                <td>{{ d.poste.type_poste }}</td>
+                <th>Courriel :</th>
+                <td>{{ employe.courriel }}</td>
             </tr>
             <tr>
-                <th>Service :</th>
-                <td>{{ d.poste.service }}</td>
+                <th>Téléphone IP :</th>
+                <td>{{ employe.tel_pro_ip|default_if_none:"" }}</td>
             </tr>
             <tr>
-                <th>Poste du responsable :</th>
-                <td>{{ d.poste.responsable }}</td>
+                <th>Téléphone :</th>
+                <td>
+                {% for d in dossiers_encours %}
+                    {% if d.poste.implantation.telephone_interne %}
+                        {{ d.poste.implantation.telephone_interne }}
+                    {% else %}
+                        {{ d.poste.implantation.telephone|default_if_none:"" }}
+                    {% endif %}
+                    {% if employe.tel_pro_poste %}
+                        poste {{ employe.tel_pro_poste }}
+                    {% endif %}
+                {% endfor %}
+                </td>
             </tr>
             <tr>
-                <th>Régime de travail :</th>
-                <td>{{ d.poste.regime_travail }}</td>
+                <th>Télécopie :</th>
+                <td>
+                {% for d in dossiers_encours %}
+                    {% if d.poste.implantation.fax_interne %}
+                        {{ d.poste.implantation.fax_interne }}
+                    {% else %}
+                        {{ d.poste.implantation.fax|default_if_none:"" }}
+                    {% endif %}
+                {% endfor %}
+                </td>
             </tr>
             <tr>
-                <th>Nombre d'heures par semaine :</th>
-                <td>{{ d.poste.regime_travail_nb_heure_semaine }}</td>
+                <th>Adresse postale :</th>
+                <td>
+                {% for d in dossiers_encours %}
+                    {% comment %}
+                    Formattage identique à annuaire intranet.
+                    {% endcomment %}
+                    {% with d.poste.implantation as i %}
+                        {% if i.adresse_postale_precision_avant %}
+                            {{ i.adresse_postale_precision_avant }}<br />
+                        {% endif %}
+                        {% if i.adresse_postale_no  %}
+                            {{ i.adresse_postale_no }}, 
+                        {% endif %}
+                        {% if i.adresse_postale_rue %}
+                            {{ i.adresse_postale_rue }}<br />
+                        {% endif %}
+                        {% if i.adresse_postale_bureau %}
+                            {{ i.adresse_postale_bureau }} 
+                        {% endif %}
+                        {% if i.adresse_postale_precision %}
+                            {{ i.adresse_postale_precision }}<br />
+                        {% endif %}
+                        {% if i.adresse_postale_boite_postale %}
+                            {{ i.adresse_postale_boite_postale }}<br />
+                        {% endif %}
+                        {% if i.adresse_postale_code_postal_avant_ville %}
+                            {% if i.adresse_postale_code_postal %}
+                                {{ i.adresse_postale_code_postal }} 
+                            {% endif %}
+                            {{ i.adresse_postale_ville }}{% if i.adresse_postale_ville and i.adresse_postale_region %}, {% endif %}
+                            {% if i.adresse_postale_region %}
+                                ({{ i.adresse_postale_region }})<br />
+                            {% endif %}
+                        {% else %}
+                            {{ i.adresse_postale_ville }}{% if i.adresse_postale_ville and i.adresse_postale_region %}, {% endif %}
+                            {% if i.adresse_postale_region %}
+                                ({{ i.adresse_postale_region }})
+                            {% endif %}
+                            {% if i.adresse_postale_code_postal %}
+                                 {{ i.adresse_postale_code_postal }}<br />
+                            {% endif %}
+                        {% endif %}
+                        {{ i.adresse_postale_pays.nom }}
+                    {% endwith %}
+                {% endfor %}
+                </td>
             </tr>
         </tbody>
     </table>
+</div>
+<div class="clear contenu">
+    <h2>Dépendants (ayant-droits)</h2>
+    {% if employe.ayantdroits.all %}
+    <ul>
+    {% for ad in employe.ayantdroits.all %}
+        <li>{{ ad }}</li>
     {% endfor %}
+    </ul>
+    {% else %}
+        <p>Aucun dépendant.</p>
+    {% endif %}
 </div>
+<hr />
 
-<div id="dossiers">
-    <h2>Dossier{{ dossiers|pluralize }}</h2>
-    <table>
-    <thead>
-        <tr>
-            <th></th>
-            <th>Poste</th>
-            <th>Début</th>
-            <th>Fin</th>
-            <th>Contrat(s)</th>
-            <th>Début</th>
-            <th>Fin</th>
-        </tr>
-    </thead>
-    <tbody>
+<div id="postes" class="contenu">
+    <h2>Poste{{ dossiers_encours|pluralize }} en cours</h2>
+    
     {% for d in dossiers_encours %}
-        {% include "rh/include/dossier.html" %}
+        <h3>{{ d.poste.nom }}</h3>
+        <p>
+        {{ d.poste.service }}<br />
+        {{ d.poste.implantation.nom }}<br />
+        {{ d.poste.implantation.adresse_physique_ville }}
+        </p>
+        <table>
+            <tbody>
+                <tr>
+                    <th>Type de poste :</th>
+                    <td>{{ d.poste.type_poste }}</td>
+                    <th>Sous la responsabilité du poste :</th>
+                    <td>{{ d.poste.responsable }}</td>
+                </tr>
+                <tr>
+                    <th>Statut :</th>
+                    <td>{{ d.statut }}</td>
+                    <th>Organisation d'origine :</th>
+                    <td>{{ d.organisme_bstg|default_if_none:"Non applicable" }}</td>
+                </tr>
+                <tr>
+                    <th>En remplacement sur ce poste ?</th>
+                    <td>{{ d.remplacement|yesno:"oui, non" }}</td>
+                    <th></th>
+                    <td></td>
+                </tr>
+                <tr>
+                    <th>Statut résidence :</th>
+                    <td>{{ d.get_statut_residence_display }}</td>
+                    <th></th>
+                    <td></td>
+                </tr>
+                <tr>
+                    <th>Régime de travail (prévu) :</th>
+                    <td>{{ d.poste.regime_travail }}</td>
+                    <th>Nombre d'heures par semaine (prévu) :</th>
+                    <td>{{ d.poste.regime_travail_nb_heure_semaine }}</td>
+                </tr>
+                <tr>
+                    <th>Régime de travail (réel) :</th>
+                    <td>
+                    {% if d.regime_travail %}
+                        {{ d.regime_travail }} % du temps complet
+                    {% endif %}
+                    </td>
+                    <th>Nombre d'heures par semaine (réel) :</th>
+                    <td>{{ d.regime_travail_nb_heure_semaine }}</td>
+                </tr>
+                <tr>
+                    <th>Début d'occupation :</th>
+                    <td>{{ d.date_debut }}</td>
+                    <th>Fin d'occupation :</th>
+                    <td>{{ d.date_fin|default_if_none:"Non définie" }}</td>
+                </tr>
+            </tbody>
+        </table>
+        
+        <h3>Rémunération</h3>
+        {{ d.classement }}<br />
+        
+        <h3>Contrats</h3>
+        {{ d.contrats }}
+        
     {% endfor %}
+</div>
+<hr />
+
+<div id="dossiers" class="contenu">
+    <h2>Ancien{{ dossiers|pluralize }} poste{{ dossiers|pluralize }}</h2>
+    <table>
+    <tbody>
     {% for d in dossiers_passes %}
         {% include "rh/include/dossier.html" %}
     {% endfor %}
index 3d13bb4..d7f925f 100644 (file)
@@ -7,3 +7,8 @@ urlpatterns = patterns(
     url(r'^profil$', 'profil', name='rh_profil'),
     url(r'^employes/(?P<id>\d+)$', 'employe', name='rh_employe'),
 )
+# api
+urlpatterns += patterns(
+    'project.rh.api',
+    url(r'^employes/(?P<id>\d+)/photo$', 'photo', name='rh_photo'),
+)
index 4916040..dd820da 100644 (file)
@@ -42,7 +42,13 @@ def profil(request):
 @login_required
 def employes_liste(request):
     """Liste des employés."""
-    employes = rh.Employe.objects.all()
+    today = date.today()
+    employes = rh.Employe.objects   \
+                    .filter(actif=True, supprime=False)   \
+                    .filter(dossiers__actif=True, dossiers__supprime=False) \
+                    .exclude(dossiers__date_debut__gt=today) \
+                    .exclude(dossiers__date_fin__lt=today) \
+                    .order_by('nom')
     c = {
         'user':request.user,
         'employes':employes,
index 7805bcd..20c2bec 100644 (file)
@@ -16,7 +16,7 @@ ADMINS = (
 MANAGERS = ADMINS
 
 TIME_ZONE = 'Canada/Montreal'
-DATE_FORMAT = 'd F Y'
+DATE_FORMAT = 'j F Y'
 LANGUAGE_CODE = 'fr-ca'
 
 # Absolute path to the directory that holds media.
index 218fcb3..c60e5a3 100644 (file)
@@ -4,4 +4,7 @@ auf.django.emploi
 0.1
 ---
 
-* Création du module : 
+* Création du module
+
+* Les pièces-jointes ne sont pas gérées
+