From 2fad6caaf37741a07697101d4776f6976e998756 Mon Sep 17 00:00:00 2001
From: =?utf8?q?St=C3=A9phane=20Jacob?=
Date: Mon, 1 Nov 2010 21:39:18 +0100
Subject: [PATCH] Adds education verifications before merge.
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Jacob
---
modules/fusionax.php | 34 +++++++++++++++++++++++++++-
templates/fusionax/education.tpl | 49 ++++++++++++++++++++++++++++++++++++++++
templates/fusionax/index.tpl | 1 +
3 files changed, 83 insertions(+), 1 deletion(-)
create mode 100644 templates/fusionax/education.tpl
diff --git a/modules/fusionax.php b/modules/fusionax.php
index ff77c3b..857f0d2 100644
--- a/modules/fusionax.php
+++ b/modules/fusionax.php
@@ -41,7 +41,8 @@ class FusionAxModule extends PLModule
'fusionax/ids' => $this->make_hook('ids', AUTH_MDP, 'admin'),
'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/names' => $this->make_hook('names', AUTH_MDP, 'admin'),
+ 'fusionax/edu' => $this->make_hook('edu', AUTH_MDP, 'admin')
);
} elseif (Platal::globals()->merge->state == 'done') {
return array(
@@ -575,6 +576,37 @@ class FusionAxModule extends PLModule
}
+ function handler_edu(&$page, $action = '')
+ {
+ $page->changeTpl('fusionax/education.tpl');
+
+ $missingEducation = XDB::rawIterator("SELECT DISTINCT(f.Intitule_diplome)
+ FROM fusionax_formations AS f
+ WHERE f.Intitule_diplome != '' AND NOT EXISTS (SELECT *
+ FROM profile_education_enum AS e
+ WHERE f.Intitule_diplome = e.name)");
+ $missingDegree = XDB::rawIterator("SELECT DISTINCT(f.Intitule_formation)
+ FROM fusionax_formations AS f
+ WHERE f.Intitule_formation != '' AND NOT EXISTS (SELECT *
+ FROM profile_education_degree_enum AS e
+ WHERE f.Intitule_formation = e.abbreviation)");
+ $missingCouple = XDB::rawIterator("SELECT DISTINCT(f.Intitule_diplome) AS edu, f.Intitule_formation AS degree, ee.id AS eduid, de.id AS degreeid
+ FROM fusionax_formations AS f
+ INNER JOIN profile_education_enum AS ee ON (f.Intitule_diplome = ee.name)
+ INNER JOIN profile_education_degree_enum AS de ON (f.Intitule_formation = de.abbreviation)
+ WHERE f.Intitule_diplome != '' AND f.Intitule_formation != ''
+ AND NOT EXISTS (SELECT *
+ FROM profile_education_degree AS d
+ WHERE ee.id = d.eduid AND de.id = d.degreeid)");
+
+ $page->assign('missingEducation', $missingEducation);
+ $page->assign('missingDegree', $missingDegree);
+ $page->assign('missingCouple', $missingCouple);
+ $page->assign('missingEducationCount', $missingEducation->total());
+ $page->assign('missingDegreeCount', $missingDegree->total());
+ $page->assign('missingCoupleCount', $missingCouple->total());
+ }
+
function handler_issues_deathdate(&$page, $action = '')
{
$page->changeTpl('fusionax/deathdate_issues.tpl');
diff --git a/templates/fusionax/education.tpl b/templates/fusionax/education.tpl
new file mode 100644
index 0000000..2e376ca
--- /dev/null
+++ b/templates/fusionax/education.tpl
@@ -0,0 +1,49 @@
+{**************************************************************************}
+{* *}
+{* 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 {$missingEducationCount} université{if $missingEducationCount > 1}s{/if} manquante{if $missingEducationCount > 1}s{/if} dans
+ notre base{if $missingEducationCount eq 0}.
{else} :
+
+
+ {iterate from=$missingEducation item=education}- {$education.Intitule_diplome}
{/iterate}
+
{/if}
+
+
+ Il y a {$missingDegreeCount} diplôme{if $missingDegreeCount > 1}s{/if} manquant{if $missingDegreeCount > 1}s{/if} dans
+ notre base{if $missingDegreeCount eq 0}.
{else} :
+
+
+ {iterate from=$missingDegree item=degree}- {$degree.Intitule_formation}
{/iterate}
+
{/if}
+
+
+ Il y a {$missingCoupleCount} couple{if $missingCoupleCount > 1}s{/if} manquant{if $missingCoupleCount > 1}s{/if} dans
+ notre base{if $missingCoupleCount eq 0}.
{else} :
+
+
+ {iterate from=$missingCouple item=couple}- {$couple.edu}, {$couple.degree} ({$couple.eduid}, {$couple.degreeid})
{/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 edadc0c..39762a3 100644
--- a/templates/fusionax/index.tpl
+++ b/templates/fusionax/index.tpl
@@ -35,6 +35,7 @@
Corrélation des dates de décès
Corrélation des promotions
Corrélation des noms
+ Corrélation des formations
--
2.1.4