From: Stéphane Jacob Date: Mon, 11 Oct 2010 20:30:06 +0000 (+0200) Subject: Merge: improves promotion comparison, adds name comparison. X-Git-Tag: xorg/1.0.1~57 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=a3f12425c61948a0cb264bf1a8504d37d993b948;p=platal.git Merge: improves promotion comparison, adds name comparison. Signed-off-by: Stéphane Jacob --- diff --git a/modules/fusionax.php b/modules/fusionax.php index e5d853d..c391ad1 100644 --- a/modules/fusionax.php +++ b/modules/fusionax.php @@ -40,6 +40,7 @@ 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'), ); } @@ -462,18 +463,85 @@ class FusionAxModule extends PLModule $page->changeTpl('fusionax/promo.tpl'); $res = XDB::iterator('SELECT pid, private_name, promo_etude_xorg, promo_sortie_xorg, promo_etude_ax, promo FROM fusionax_promo - WHERE !(promo_etude_ax + 1 = promo_etude_xorg AND promo_etude_xorg + 3 = promo_sortie_xorg)'); + WHERE !(promo_etude_ax + 1 = promo_etude_xorg AND promo_etude_xorg + 3 = promo_sortie_xorg) + AND !(promo_etude_ax + 1 = promo_etude_xorg AND promo_etude_xorg + 4 = promo_sortie_xorg) + AND !(promo_etude_ax = promo_etude_xorg + 1) + ORDER BY promo_etude_xorg'); $nbMissmatchingPromos = $res->total(); + $page->assign('nbMissmatchingPromos', $res->total()); + $page->assign('missmatchingPromos', $res); + + $res = XDB::iterator('SELECT pid, private_name, promo_etude_xorg, promo_sortie_xorg, promo_etude_ax, promo + FROM fusionax_promo + WHERE promo_etude_ax = promo_etude_xorg + 1 + ORDER BY promo_etude_xorg'); + $nbMissmatchingPromos += $res->total(); $page->assign('nbMissmatchingPromos1', $res->total()); $page->assign('missmatchingPromos1', $res); + $res = XDB::iterator('SELECT pid, private_name, promo_etude_xorg, promo_sortie_xorg, promo_etude_ax, promo FROM fusionax_promo - WHERE promo_etude_ax + 1 = promo_etude_xorg AND promo_etude_xorg + 3 = promo_sortie_xorg'); + WHERE promo_etude_ax + 1 = promo_etude_xorg AND promo_etude_xorg + 3 = promo_sortie_xorg + ORDER BY promo_etude_xorg'); $nbMissmatchingPromos += $res->total(); $page->assign('nbMissmatchingPromos2', $res->total()); $page->assign('missmatchingPromos2', $res); - $page->assign('nbMissmatchingPromos', $nbMissmatchingPromos); + + $res = XDB::iterator('SELECT pid, private_name, promo_etude_xorg, promo_sortie_xorg, promo_etude_ax, promo + FROM fusionax_promo + WHERE promo_etude_ax + 1 = promo_etude_xorg AND promo_etude_xorg + 4 = promo_sortie_xorg + ORDER BY promo_etude_xorg'); + $nbMissmatchingPromos += $res->total(); + $page->assign('nbMissmatchingPromos3', $res->total()); + $page->assign('missmatchingPromos3', $res); + + $page->assign('nbMissmatchingPromosTotal', $nbMissmatchingPromos); + } + + function handler_names(&$page, $action = '') + { + $page->changeTpl('fusionax/names.tpl'); + + $res = XDB::query('SELECT COUNT(*) + FROM fusionax_anciens AS f + INNER JOIN profiles AS p ON (f.ax_id = p.ax_id)'); + $page->assign('total', $res->fetchOneCell()); + + // To be checked: + // | lastname | 1 | + // | lastname_marital | 2 | + // | lastname_ordinary | 3 | + // | firstname | 4 | + // | firstname_ordinary | 7 | + // | firstname_other | 8 | + // | name_other | 9 | + // | name_ini | 10 | + // | firstname_ini | 11 | + $res = XDB::query("SELECT COUNT(*) + FROM fusionax_anciens AS f + INNER JOIN profiles AS p ON (f.ax_id = p.ax_id) + LEFT JOIN profile_name AS pnp ON (p.pid = pnp.pid AND pnp.typeid = 1) + LEFT JOIN profile_name AS pnm ON (p.pid = pnm.pid AND pnm.typeid = 2) + LEFT JOIN profile_name AS pno ON (p.pid = pno.pid AND pno.typeid = 3) + LEFT JOIN profile_name AS pne ON (p.pid = pne.pid AND pne.typeid = 9) + LEFT JOIN profile_name AS pni ON (p.pid = pni.pid AND pni.typeid = 10) + WHERE IF(f.partic_patro, CONCAT(f.partic_patro, CONCAT(' ', f.Nom_patronymique)), f.Nom_patronymique) NOT IN (pnp.name, pno.name, pnm.name, pne.name, pni.name) + OR IF(f.partic_nom, CONCAT(f.partic_nom, CONCAT(' ', f.Nom_usuel)), f.Nom_usuel) NOT IN (pnp.name, pno.name, pnm.name, pne.name, pni.name) + OR f.Nom_complet NOT IN (pnp.name, pno.name, pnm.name, pne.name, pni.name)"); + $page->assign('lastnameIssues', $res->fetchOneCell()); + + $res = XDB::query('SELECT COUNT(*) + FROM fusionax_anciens AS f + INNER JOIN profiles AS p ON (f.ax_id = p.ax_id) + LEFT JOIN profile_name AS pnf ON (p.pid = pnf.pid AND pnf.typeid = 4) + LEFT JOIN profile_name AS pno ON (p.pid = pno.pid AND pno.typeid = 7) + LEFT JOIN profile_name AS pne ON (p.pid = pne.pid AND pne.typeid = 8) + LEFT JOIN profile_name AS pni ON (p.pid = pni.pid AND pni.typeid = 11) + WHERE f.prenom NOT IN (pnf.name, pno.name, pne.name, pni.name)'); + $page->assign('firstnameIssues', $res->fetchOneCell()); + } } -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:?> +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: +?> diff --git a/templates/fusionax/index.tpl b/templates/fusionax/index.tpl index 351842c..7c2ddfa 100644 --- a/templates/fusionax/index.tpl +++ b/templates/fusionax/index.tpl @@ -35,10 +35,11 @@
  • Création des VIEW annexes nécessaires aux corrélations
  • Corrélation des dates de décès
  • Corrélation des promotions
  • -
  • Corrélation des données d'identification
  • -
  • Corrélation des coordonnées
  • -
  • Corrélation des informations professionnelles
  • -
  • Corrélation des informations de formations
  • +
  • Corrélation des noms
  • +

    + Une fois ces vérifications faites, un root peut lancer le script merge.php dans le répertoire upgrade/1.0.1/merge/ +

    + {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/fusionax/names.tpl b/templates/fusionax/names.tpl new file mode 100644 index 0000000..d9d1f4c --- /dev/null +++ b/templates/fusionax/names.tpl @@ -0,0 +1,35 @@ +{**************************************************************************} +{* *} +{* 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 *} +{* *} +{**************************************************************************} + +

    Fusion des annuaires X.org - AX / noms

    + +

    + +

    + Il y a {$total} camarades dans l'intersection de nos bases. +

    +

    + +{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/fusionax/promo.tpl b/templates/fusionax/promo.tpl index 7d67c0f..c9d8fa8 100644 --- a/templates/fusionax/promo.tpl +++ b/templates/fusionax/promo.tpl @@ -24,14 +24,22 @@

    -{if $nbMissmatchingPromos > 0} -

    Il y a {$nbMissmatchingPromos} différences entre les deux bases dans pour les promotions.

    -

    Grosses différences (oranjisation ?) :

    +{if $nbMissmatchingPromosTotal > 0} +

    Il y a {$nbMissmatchingPromosTotal} différences entre les deux bases dans pour les promotions.

    + +

    Grosses différences ({$nbMissmatchingPromos} camarades) :

    +{include file='fusionax/listFusion.tpl' fusionList=$missmatchingPromos field1='pid' namefield1='ID X.org' field3='promo_etude_xorg' +namefield3='etude_xorg' field4='promo_sortie_xorg' namefield4='sortie_xorg' field2='promo_etude_ax' namefield2='etude_ax'} + +

    Petites différences (oranjisation) ({$nbMissmatchingPromos1} camarades) :

    {include file='fusionax/listFusion.tpl' fusionList=$missmatchingPromos1 field1='pid' namefield1='ID X.org' field3='promo_etude_xorg' namefield3='etude_xorg' field4='promo_sortie_xorg' namefield4='sortie_xorg' field2='promo_etude_ax' namefield2='etude_ax'} -

    Petites différences : promo_etude_xorg == promo_etude_ax + 1 et promo_etude_xorg + 3 == promo_sortie_xorg, a priori ce sont les étrangers que nous avons mal -inclus

    +

    Petites différences (oranjisation + étrangers) ({$nbMissmatchingPromos3} camarades) :

    +{include file='fusionax/listFusion.tpl' fusionList=$missmatchingPromos3 field1='pid' namefield1='ID X.org' field3='promo_etude_xorg' +namefield3='etude_xorg' field4='promo_sortie_xorg' namefield4='sortie_xorg' field2='promo_etude_ax' namefield2='etude_ax'} + +

    Petites différences : (étrangers mal inclus) ({$nbMissmatchingPromos2} camarades)

    {include file='fusionax/listFusion.tpl' fusionList=$missmatchingPromos2 field1='pid' namefield1='ID X.org' field3='promo_etude_xorg' namefield3='etude_xorg' field4='promo_sortie_xorg' namefield4='sortie_xorg' field2='promo_etude_ax' namefield2='etude_ax'} {/if}