From: Anne Limoges Date: Mon, 2 Sep 2013 12:42:35 +0000 (+0200) Subject: Adds job infos in xnetgroup csv. X-Git-Tag: xorg/1.1.9~18 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=23281bb322a228a0a48aacf9be8035ba55251aa1;p=platal.git Adds job infos in xnetgroup csv. --- diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index 2774de5..051b0da 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -460,12 +460,25 @@ class XnetGrpModule extends PLModule $filename = $globals->asso('diminutif') . '.csv'; } $users = $globals->asso()->getMembersFilter(null, new UFO_Name())->getUsers(); + $admin = may_update(); pl_cached_content_headers('text/x-csv', 'iso-8859-1', 1); - echo utf8_decode("Nom;Prénom;Sexe;Promotion;Commentaire\n"); + echo utf8_decode("Nom;Prénom;Sexe;Promotion;Commentaire"); + if ($admin) { + echo utf8_decode(";Société;Poste\n"); + } else { + echo utf8_decode("\n"); + } foreach ($users as $user) { $line = $user->lastName() . ';' . $user->firstName() . ';' . ($user->isFemale() ? 'F' : 'M') - . ';' . $user->promo() . ';' . strtr($user->group_comm, ';', ','); + . ';' . $user->promo() . ';' . strtr($user->group_comm, ';', ','); + if ($admin) { + if ($user->hasProfile()) { + $line .= ';' . $user->profile()->getMainJob()->company->name . ';' . $user->profile()->getMainJob()->description; + } else { + $line .= ';;'; + } + } echo utf8_decode($line) . "\n"; } exit();