From: Stéphane Jacob
Date: Mon, 13 Dec 2010 16:22:44 +0000 (+0100)
Subject: Adds check for corps.
X-Git-Tag: xorg/1.0.2~73
X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=551e00c175feb8f3511c603f8871b70900f461ef;p=platal.git
Adds check for corps.
Signed-off-by: Stéphane Jacob
---
diff --git a/modules/fusionax.php b/modules/fusionax.php
index 6b8b373..d180c6d 100644
--- a/modules/fusionax.php
+++ b/modules/fusionax.php
@@ -42,7 +42,8 @@ class FusionAxModule extends PLModule
'fusionax/deceased' => $this->make_hook('deceased', AUTH_MDP, 'admin'),
'fusionax/promo' => $this->make_hook('promo', AUTH_MDP, 'admin'),
'fusionax/names' => $this->make_hook('names', AUTH_MDP, 'admin'),
- 'fusionax/edu' => $this->make_hook('edu', AUTH_MDP, 'admin')
+ 'fusionax/edu' => $this->make_hook('edu', AUTH_MDP, 'admin'),
+ 'fusionax/corps' => $this->make_hook('corps', AUTH_MDP, 'admin')
);
} elseif (Platal::globals()->merge->state == 'done') {
return array(
@@ -607,6 +608,27 @@ class FusionAxModule extends PLModule
$page->assign('missingCoupleCount', $missingCouple->total());
}
+ function handler_corps(&$page)
+ {
+ $page->changeTpl('fusionax/corps.tpl');
+
+ $missingCorps = XDB::rawIterator('SELECT DISTINCT(f.corps_sortie) AS name
+ FROM fusionax_anciens AS f
+ WHERE NOT EXISTS (SELECT *
+ FROM profile_corps_enum AS c
+ WHERE f.corps_sortie = c.abbreviation)');
+ $missingGrade = XDB::rawIterator('SELECT DISTINCT(f.grade) AS name
+ FROM fusionax_anciens AS f
+ WHERE NOT EXISTS (SELECT *
+ FROM profile_corps_rank_enum AS c
+ WHERE f.grade = c.name)');
+
+ $page->assign('missingCorps', $missingCorps);
+ $page->assign('missingGrade', $missingGrade);
+ $page->assign('missingCorpsCount', $missingCorps->total());
+ $page->assign('missingGradeCount', $missingGrade->total());
+ }
+
function handler_issues_deathdate(&$page, $action = '')
{
$page->changeTpl('fusionax/deathdate_issues.tpl');
diff --git a/templates/fusionax/corps.tpl b/templates/fusionax/corps.tpl
new file mode 100644
index 0000000..ce22a0c
--- /dev/null
+++ b/templates/fusionax/corps.tpl
@@ -0,0 +1,40 @@
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2010 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+
+
+
+ Il y a {$missingCorpsCount} corps manquant{if $missingCorpsCount > 1}s{/if} dans notre base{if $missingCorpsCount eq 0}.
{else} :
+
+
+ {iterate from=$missingCorps item=corps}- {$corps.name}
{/iterate}
+
{/if}
+
+
+ Il y a {$missingGradeCount} grade{if $missingGradeCount > 1}s{/if} manquant{if $missingGradeCount > 1}s{/if} dans
+ notre base{if $missingGradeCount eq 0}.
{else} :
+
+
+ {iterate from=$missingGrade item=grade}- {$grade.name}
{/iterate}
+
{/if}
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
diff --git a/templates/fusionax/index.tpl b/templates/fusionax/index.tpl
index 39762a3..b8aac7d 100644
--- a/templates/fusionax/index.tpl
+++ b/templates/fusionax/index.tpl
@@ -36,6 +36,7 @@
Corrélation des promotions
Corrélation des noms
Corrélation des formations
+ Corrélation des corps