Finishes the interrelation of the id of both databases, the preparation of the views...
authorStéphane Jacob <jacou@melix.net>
Fri, 3 Oct 2008 14:19:17 +0000 (16:19 +0200)
committerStéphane Jacob <jacou@melix.net>
Tue, 7 Oct 2008 10:27:22 +0000 (12:27 +0200)
modules/fusionax.php
modules/fusionax/Anciens.sql
templates/fusionax/deceased.tpl [moved from templates/fusionax/misc.tpl with 77% similarity]
templates/fusionax/ids.tpl
templates/fusionax/idswrongInXorg.tpl [new file with mode: 0644]
templates/fusionax/import.tpl
templates/fusionax/index.tpl
templates/fusionax/view.tpl [new file with mode: 0644]
upgrade/merge-0.0.1/00_names.sql

index 66064ad..28958be 100644 (file)
@@ -38,10 +38,11 @@ class FusionAxModule extends PLModule
     function handlers()
     {
         return array(
-            'fusionax'          => $this->make_hook('index', AUTH_MDP, 'admin'),
-            'fusionax/import'   => $this->make_hook('import', AUTH_MDP,'admin'),
-            'fusionax/ids'      => $this->make_hook('ids', AUTH_MDP, 'admin'),
-            'fusionax/misc'     => $this->make_hook('misc', AUTH_MDP, 'admin'),
+            'fusionax'          => $this->make_hook('index',    AUTH_MDP, 'admin'),
+            'fusionax/import'   => $this->make_hook('import',   AUTH_MDP, 'admin'),
+            'fusionax/view'     => $this->make_hook('view',     AUTH_MDP, 'admin'),
+            'fusionax/ids'      => $this->make_hook('ids',      AUTH_MDP, 'admin'),
+            'fusionax/deceased' => $this->make_hook('deceased', AUTH_MDP, 'admin'),
         );
     }
 
@@ -160,6 +161,53 @@ class FusionAxModule extends PLModule
         exit;
     }
 
+    /** Import de l'annuaire de l'AX depuis l'export situé dans le home de jacou */
+    function handler_view(&$page, $action = '')
+    {
+        $globals = Platal::globals();
+
+        $page->changeTpl('fusionax/view.tpl');
+        if ($action == 'create') {
+            XDB::execute('DROP VIEW IF EXISTS fusionax_deceased');
+            XDB::execute('CREATE VIEW  fusionax_deceased AS
+                               SELECT  u.user_id, a.id_ancien, u.nom, u.prenom, u.promo, u.deces AS deces_xorg, a.Date_deces AS deces_ax
+                                 FROM  auth_user_md5 i  AS u
+                           INNER JOIN  fusionax_anciens AS a ON (a.id_ancien = u.matricule_ax)
+                                WHERE  u.deces != a.Date_deces');
+            XDB::execute('DROP VIEW IF EXISTS fusionax_promo');
+            XDB::execute('CREATE VIEW  fusionax_promo AS
+                               SELECT  u.user_id, u.matricule_ax, u.nom, u.prenom, u.promo AS promo_etude_xorg,
+                                       f.promotion_etude AS promo_etude_ax, u.promo_sortie AS promo_sortie_xorg
+                                 FROM  auth_user_md5    AS u
+                           INNER JOIN  fusionax_anciens AS f ON (u.matricule_ax = f.id_ancien)
+                                WHERE  u.promo != f.promotion_etude AND !(f.promotion_etude = u.promo + 1 AND u.promo_sortie = u.promo + 4)');
+        }
+    }
+
+    /* Mets à NULL le matricule_ax de ces camarades pour marquer le fait qu'ils ne figurent pas dans l'annuaire de l'AX */
+    private static function clear_wrong_in_xorg($user_id)
+    {
+        $res = XDB::execute("UPDATE  fusionax_xorg_anciens
+                                SET  matricule_ax = NULL
+                              WHERE  user_id = {?}", $user_id);
+        if (!$res) {
+            return 0;
+        }
+        return XDB::affectedRows() / 2;
+    }
+
+    /* Cherche les les anciens présents dans Xorg avec un matricule_ax ne correspondant à rien dans la base de l'AX 
+     * (mises à part les promo 1921 et 1923 qui ne figurent pas dans les données de l'AX)*/
+    private static function find_wrong_in_xorg($limit = 10)
+    {
+        return XDB::iterator("SELECT  u.promo, u.user_id, u.display_name
+                                FROM  fusionax_xorg_anciens AS u
+                               WHERE  NOT EXISTS (SELECT  *
+                                                    FROM  fusionax_anciens AS f
+                                                   WHERE  f.id_ancien = u.matricule_ax)
+                                      AND u.matricule_ax IS NOT NULL AND promo != 1921 AND promo != 1923");
+    }
+
     /** Lier les identifiants d'un ancien dans les deux annuaires
      * @param user_id identifiant dans l'annuaire X.org
      * @param matricule_ax identifiant dans l'annuaire de l'AX
@@ -167,7 +215,7 @@ class FusionAxModule extends PLModule
      */
     private static function link_by_ids($user_id, $matricule_ax)
     {
-        $res = XDB::execute("UPDATE  fusionax_import AS i
+        $res = XDB::execute("UPDATE  fusionax_import       AS i
                          INNER JOIN  fusionax_xorg_anciens AS u
                                 SET  u.matricule_ax = i.id_ancien,
                                      i.user_id = u.user_id,
@@ -191,54 +239,52 @@ class FusionAxModule extends PLModule
     private static function find_easy_to_link($limit = 10, $sure = false)
     {
         $easy_to_link = XDB::iterator("
-        SELECT  xorg.display_name, xorg.promo, xorg.user_id, ax.id_ancien,
+        SELECT  u.display_name, u.promo, u.user_id, ax.id_ancien,
                 CONCAT(ax.prenom, ' ', ax.nom_complet, ' (X ', ax.promotion_etude, ')') AS display_name_ax,
                 COUNT(*) AS nbMatches
-          FROM  fusionax_anciens AS ax
-    INNER JOIN  fusionax_import AS i ON (i.id_ancien = ax.id_ancien AND i.user_id IS NULL)
-     LEFT JOIN  fusionax_xorg_anciens AS xorg ON (xorg.matricule_ax IS NULL
-                                                  AND ax.Nom_complet = xorg.nom
-                                                  AND ax.prenom = xorg.prenom
-                                                  AND xorg.promo = ax.promotion_etude)
-      GROUP BY  xorg.user_id
-        HAVING  xorg.user_id IS NOT NULL AND nbMatches = 1 " . ($limit ? ('LIMIT ' . $limit) : ''));
+          FROM  fusionax_anciens      AS ax
+    INNER JOIN  fusionax_import       AS i ON (i.id_ancien = ax.id_ancien AND i.user_id IS NULL)
+     LEFT JOIN  fusionax_xorg_anciens AS u ON (u.matricule_ax IS NULL
+                                               AND ax.Nom_patronymique = u.nom
+                                               AND ax.prenom = u.prenom
+                                               AND u.promo = ax.promotion_etude)
+      GROUP BY  u.user_id
+        HAVING  u.user_id IS NOT NULL AND nbMatches = 1 " . ($limit ? ('LIMIT ' . $limit) : ''));
         if ($easy_to_link->total() > 0 || $sure) {
             return $easy_to_link;
         }
         return XDB::iterator("
-        SELECT  xorg.display_name, xorg.promo, xorg.user_id, ax.id_ancien,
+        SELECT  u.display_name, u.promo, u.user_id, ax.id_ancien,
                 CONCAT(ax.prenom, ' ', ax.nom_complet, ' (X ', ax.promotion_etude, ')') AS display_name_ax,
                 COUNT(*) AS nbMatches
-          FROM  fusionax_anciens AS ax
-    INNER JOIN  fusionax_import AS i ON (i.id_ancien = ax.id_ancien AND i.user_id IS NULL)
-     LEFT JOIN  fusionax_xorg_anciens AS xorg ON (xorg.matricule_ax IS NULL
-                                                  AND (ax.Nom_complet = xorg.nom
-                                                       OR ax.Nom_complet LIKE CONCAT(xorg.nom,' %')
-                                                       OR ax.Nom_complet LIKE CONCAT(xorg.nom,'-%')
-                                                       OR ax.Nom_usuel = xorg.nom
-                                                       OR xorg.nom LIKE CONCAT('% ',ax.Nom_complet))
-                                                  AND xorg.promo < ax.promotion_etude + 2
-                                                  AND xorg.promo > ax.promotion_etude - 2)
-      GROUP BY  xorg.user_id
-        HAVING  xorg.user_id IS NOT NULL AND nbMatches = 1" . ($limit ? ('LIMIT ' . $limit) : ''));
+          FROM  fusionax_anciens      AS ax
+    INNER JOIN  fusionax_import       AS i ON (i.id_ancien = ax.id_ancien AND i.user_id IS NULL)
+     LEFT JOIN  fusionax_xorg_anciens AS u ON (u.matricule_ax IS NULL
+                                               AND (ax.Nom_patronymique = u.nom
+                                                    OR ax.Nom_patronymique LIKE CONCAT(u.nom, ' %')
+                                                    OR ax.Nom_patronymique LIKE CONCAT(u.nom, '-%')
+                                                    OR ax.Nom_usuel = u.nom
+                                                    OR u.nom LIKE CONCAT('% ', ax.Nom_patronymique))
+                                               AND u.promo < ax.promotion_etude + 2
+                                               AND u.promo > ax.promotion_etude - 2)
+      GROUP BY  u.user_id
+        HAVING  u.user_id IS NOT NULL AND nbMatches = 1 " . ($limit ? ('LIMIT ' . $limit) : ''));
     }
 
     /** Module de mise en correspondance les ids */
     function handler_ids(&$page, $part = 'main', $user_id = null, $matricule_ax = null)
     {
         $globals = Platal::globals();
+        $nbToLink = 100;
 
         $page->addJsLink('jquery.js');
-        $page->assign(
-            'xorg_title',
-            'Polytechnique.org - Fusion - Mise en correspondance simple');
+        $page->assign('xorg_title', 'Polytechnique.org - Fusion - Mise en correspondance simple');
         if ($part == 'missingInAX') {
             // locate all persons from this database that are not in AX's
             $page->changeTpl('fusionax/idsMissingInAx.tpl');
-            $missingInAX = XDB::iterator("SELECT  u.promo, u.user_id, u.display_name
-                                            FROM  fusionax_xorg_anciens AS u
-                                           WHERE  u.matricule_ax IS NULL
-                                           LIMIT  20");
+            $missingInAX = XDB::iterator("SELECT  promo, user_id, display_name
+                                            FROM  fusionax_xorg_anciens
+                                           WHERE  matricule_ax IS NULL");
             $page->assign('missingInAX', $missingInAX);
             return;
         }
@@ -250,17 +296,35 @@ class FusionAxModule extends PLModule
                                                     a.id_ancien
                                               FROM  fusionax_import
                                         INNER JOIN  fusionax_anciens AS a USING (id_ancien)
-                                             WHERE  fusionax_import.user_id IS NULL
-                                             LIMIT  20");
+                                             WHERE  fusionax_import.user_id IS NULL");
             $page->assign('missingInXorg', $missingInXorg);
             return;
         }
+        if ($part == 'wrongInXorg') {
+            // locate all persons from Xorg database that have a bad AX id
+            $page->changeTpl('fusionax/idswrongInXorg.tpl');
+            $wrongInXorg = FusionAxModule::find_wrong_in_xorg($nbToLink);
+            $page->assign('wrongInXorg', $wrongInXorg);
+            return;
+        }
+        if ($part == 'cleanwronginxorg') {
+            $linksToDo = FusionAxModule::find_wrong_in_xorg($nbToLink);
+            while ($l = $linksToDo->next()) {
+                FusionAxModule::clear_wrong_in_xorg($l['user_id']);
+            }
+            pl_redirect('fusionax/ids/wrongInXorg');
+        }
+        if ($part == 'lier') {
+            if (Post::has('user_id') && Post::has('matricule_ax')) {
+                FusionAxModule::link_by_ids(Post::i('user_id'), Post::v('matricule_ax'));
+            }
+        }
         if ($part == 'link') {
             FusionAxModule::link_by_ids($user_id, $matricule_ax);
             exit;
         }
         if ($part == 'linknext') {
-            $linksToDo = FusionAxModule::find_easy_to_link(10);
+            $linksToDo = FusionAxModule::find_easy_to_link($nbToLink);
             while ($l = $linksToDo->next()) {
                 FusionAxModule::link_by_ids($l['user_id'], $l['id_ancien']);
             }
@@ -286,38 +350,63 @@ class FusionAxModule extends PLModule
             if ($missingInXorg) {
                 $page->assign('nbMissingInXorg', $missingInXorg->fetchOneCell());
             }
-            $easyToLink = FusionAxModule::find_easy_to_link(10);
-            if ($easyToLink->total() > 0) { 
+            $wrongInXorg = FusionAxModule::find_wrong_in_xorg($nbToLink);
+            if ($wrongInXorg->total() > 0) {
+                $page->assign('wrongInXorg', $wrongInXorg->total());
+            }
+            $easyToLink = FusionAxModule::find_easy_to_link($nbToLink);
+            if ($easyToLink->total() > 0) {
+                $page->assign('nbMatch', $easyToLink->total());
                 $page->assign('easyToLink', $easyToLink);
             }
         }
     }
 
-    function handler_misc(&$page)
+    function handler_deceased(&$page, $action = '')
     {
-        $page->changeTpl('fusionax/misc.tpl');
+        if ($action == 'updateXorg') {
+            XDB::execute('UPDATE  fusionax_deceased
+                             SET  deces_xorg = deces_ax
+                           WHERE  deces_xorg = "0000-00-00"');
+        }
+        if ($action == 'updateAX') {
+            XDB::execute('UPDATE  fusionax_deceased
+                             SET  deces_ax = deces_xorg
+                           WHERE  deces_ax = "0000-00-00"');
+        }
+        if ($action == 'update') {
+            if (Post::has('user_id') && Post::has('date')) {
+                XDB::execute('UPDATE  fusionax_deceased
+                                 SET  deces_ax = {?}, deces_xorg = {?}
+                               WHERE  user_id = {?}',
+                             Post::v('date'), Post::v('date'), Post::i('user_id'));
+            }
+        }
+        $page->changeTpl('fusionax/deceased.tpl');
         // deceased
         $deceasedErrorsSql = XDB::query('SELECT COUNT(*) FROM fusionax_deceased');
         $page->assign('deceasedErrors', $deceasedErrorsSql->fetchOneCell());
-        $page->assign('deceasedMissingInXorg',
-                      XDB::iterator('SELECT  d.user_id, d.id_ancien, d.nom, d.prenom, d.promo, d.deces_ax,
-                                             CONCAT(d.prenom, " ", d.nom) AS display_name
-                                       FROM  fusionax_deceased AS d
-                                      WHERE  d.deces_xorg = "0000-00-00"
-                                      LIMIT  10'));
-        $page->assign('deceasedMissingInAX',
-                      XDB::iterator('SELECT  d.user_id, d.id_ancien, d.nom, d.prenom, d.promo, d.deces_xorg,
-                                             CONCAT(d.prenom, " ", d.nom) AS display_name
-                                       FROM  fusionax_deceased AS d
-                                      WHERE  d.deces_ax = "0000-00-00"
-                                      LIMIT  10'));
-        $page->assign('deceasedDifferent',
-                      XDB::iterator('SELECT  d.user_id, d.id_ancien, d.nom, d.prenom, d.promo,
-                                             d.deces_ax, d.deces_xorg,
-                                             CONCAT(d.prenom, " ", d.nom) AS display_name
-                                       FROM  fusionax_deceased AS d
-                                      WHERE  d.deces_xorg != "0000-00-00" AND d.deces_ax != "0000-00-00"
-                                      LIMIT  10'));
+        $res = XDB::iterator('SELECT  d.user_id, d.id_ancien, d.nom, d.prenom, d.promo, d.deces_ax,
+                                      CONCAT(d.prenom, " ", d.nom) AS display_name
+                                FROM  fusionax_deceased AS d
+                               WHERE  d.deces_xorg = "0000-00-00"
+                               LIMIT  10');
+        $page->assign('nbDeceasedMissingInXorg', $res->total());
+        $page->assign('deceasedMissingInXorg', $res);
+        $res = XDB::iterator('SELECT  d.user_id, d.id_ancien, d.nom, d.prenom, d.promo, d.deces_xorg,
+                                      CONCAT(d.prenom, " ", d.nom) AS display_name
+                                FROM  fusionax_deceased AS d
+                               WHERE  d.deces_ax = "0000-00-00"
+                               LIMIT  10');
+        $page->assign('nbDeceasedMissingInAX', $res->total());
+        $page->assign('deceasedMissingInAX', $res);
+        $res = XDB::iterator('SELECT  d.user_id, d.id_ancien, d.nom, d.prenom, d.promo,
+                                      d.deces_ax, d.deces_xorg,
+                                      CONCAT(d.prenom, " ", d.nom, " ", d.user_id) AS display_name
+                                FROM  fusionax_deceased AS d
+                               WHERE  d.deces_xorg != "0000-00-00" AND d.deces_ax != "0000-00-00"');
+        $page->assign('nbDeceasedDifferent', $res->total());
+        $page->assign('deceasedDifferent', $res);
     }
 }
 
index 87fa8c8..7964f43 100644 (file)
@@ -56,11 +56,3 @@ CREATE TABLE IF NOT EXISTS `fusionax_import` (
 
 INSERT INTO `fusionax_import` ( SELECT `id_ancien`, NULL, NULL FROM `fusionax_anciens` );
 REPLACE INTO `fusionax_import` ( SELECT `matricule_ax`, `user_id`, NOW() FROM `auth_user_md5` );
-
-DROP VIEW IF EXISTS `fusionax_deceased`;
-
-CREATE VIEW  fusionax_deceased AS
-     SELECT  u.user_id, a.id_ancien, u.nom, u.prenom, u.promo, u.deces AS deces_xorg, a.Date_deces AS deces_ax
-       FROM  auth_user_md5 AS u
- INNER JOIN  fusionax_anciens AS a ON (a.id_ancien = u.matricule_ax)
-      WHERE  u.deces != a.Date_deces;
similarity index 77%
rename from templates/fusionax/misc.tpl
rename to templates/fusionax/deceased.tpl
index de6b539..888c17e 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 
-<h2><a href="fusionax">Fusion des annuaires X.org - AX<a> / Divers</h2>
-
-<h3>Décès</h3>
+<h2><a href="fusionax">Fusion des annuaires X.org - AX<a> / Décès</h2>
 
 {if $deceasedErrors}
-
 <p>Voici les {$deceasedErrors} différences entre les deux annuaires pour les renseignements de
 décès.</p>
 
+{if $nbDeceasedMissingInXorg > 0}
 <p>Anciens déclarés décédés dans l'annuaire AX mais pas sur Xorg</p>
-
 {include file='fusionax/listFusion.tpl' fusionList=$deceasedMissingInXorg field1='deces_ax' namefield1='Décès AX'}
 
-<p>Anciens déclarés décédés dans l'annuaire Xorg mais pas chez l'AX</p>
+<a href="fusionax/deceased/updateXorg">Inclure toutes les dates de décès connues par l'AX sur Xorg.</a>
+{/if}
 
+{if $nbDeceasedMissingInAX > 0}
+<p>Anciens déclarés décédés dans l'annuaire Xorg mais pas chez l'AX</p>
 {include file='fusionax/listFusion.tpl' fusionList=$deceasedMissingInAX field1='deces_xorg' namefield1='Décès X.org'}
 
-<p>Anciens déclarés décédés dans les deux annuaires mais pas avec la même date</p>
+<a href="fusionax/deceased/updateAX">Considérer ces cas comme traités (il n'y a rien à importer).</a>
+{/if}
 
+{if $nbDeceasedDifferent > 0}
+<p>Anciens déclarés décédés dans les deux annuaires mais pas avec la même date</p>
 {include file='fusionax/listFusion.tpl' fusionList=$deceasedDifferent field1='deces_xorg' field2='deces_ax' namefield1='Décès X.org' namefield2='Décès AX'}
 
-{else}
+<h3>Mettre en correspondance</h3>
+<form action="fusionax/deceased/update" method="post">
+  User ID X.org : <input type="text" name="user_id" value=""/><br/>
+  Date de décès : <input type="text" name="date" value""/><br/>
+  <input type="submit" value="Mettre à jour"/>
+</form>
+{/if}
 
+{else}
 <p>Aucune différence pour les renseignements de décès entre les deux annuaires.</p>
-
 {/if}
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index fb6df30..3f48241 100644 (file)
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-<h2><a href="fusionax">Fusion des annuaires X.org - AX<a> / Identifiants</h2>
+<h2><a href="fusionax">Fusion des annuaires X.org - AX</a> / Identifiants</h2>
 
 <p>Le préalable à toute fusion de renseignements pour une personne entre ce
 que contient la base AX et ce que contient ce site est bien évidemment de
@@ -38,10 +38,16 @@ trouver une correspondance entre les personnes renseignés dans ces annuaires.</
 <p><a href="fusionax/ids/missingInXorg">{$nbMissingInXorg} ancien{if $nbMissingInXorg > 1}s{/if}</a>.</p>
 {/if}
 
+{if $wrongInXorg > 0}
+<h3>Anciens ayant un matricule_ax sur Xorg ne correspondant à rien dans la base de l'AX</h3>
+
+<p><a href="fusionax/ids/wrongInXorg">{$wrongInXorg} ancien{if $wrongInXorg > 1}s{/if}</a>.</p>
+{/if}
+
 <h3>Mettre en correspondance</h3>
-<form action="fusionax/ids/lier" method="get">
-       Matricule AX : <input name="matricule_ax" value""/><br/>
-       User ID X.org : <input name="user_id" value=""/><br/>
+<form action="fusionax/ids/lier" method="post">
+       Matricule AX : <input type="text" name="matricule_ax" value""/><br/>
+       User ID X.org : <input type="text" name="user_id" value=""/><br/>
        <input type="submit" value="Lier"/>
 </form>
 
@@ -49,7 +55,11 @@ trouver une correspondance entre les personnes renseignés dans ces annuaires.</
 <div id="autolink" name="autolink">
 <h3>Mise en correspondance automatique</h3>
 {if $easyToLink}
-<p>Ces anciens sont probablement les mêmes (à peu près mêmes nom, prénom, promo)</p>
+<p>
+  Ces anciens sont probablement les mêmes (à peu près mêmes nom, prénom, promo)<br />
+  {$nbMatch} correspondances trouvées.
+</p>
+
 {include file="fusionax/listFusion.tpl" fusionList=$easyToLink fusionAction="fusionax/ids/link" name="lier" field1="display_name_ax" namefield1="Ancien AX"}
 <p><a href="fusionax/ids/linknext">Lier toutes les fiches affichées</a> <span id="fusion-reload" style="display:none"> - <a href="fusionax/ids#autolink">Trouver d'autres correspondances</a></span></p>
 <script type="text/javascript">
diff --git a/templates/fusionax/idswrongInXorg.tpl b/templates/fusionax/idswrongInXorg.tpl
new file mode 100644 (file)
index 0000000..4701aa4
--- /dev/null
@@ -0,0 +1,32 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 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               *}
+{*                                                                        *}
+{**************************************************************************}
+
+<h2><a href="fusionax">Fusion des annuaires X.org - AX<a> / <a href="fusionax/ids">Identifiants<a> /  Présents dans Xorg avec un matricule_ax ne correspondant à rien
+dans la base de l'AX (mises à part les promo 1921 et 1923 qui ne figurent pas dans les données de l'AX)</h2>
+
+<p></p>
+
+{if $wrongInXorg}
+{include file='fusionax/listFusion.tpl' fusionList=$wrongInXorg field1='user_id' namefield1='ID X.org'}
+
+<p><a href="fusionax/ids/cleanwronginxorg">Mettre à NULL le matricule_ax de ces camarades pour marquer le fait qu'ils ne figurent pas dans l'annuaire de l'AX</a></p>
+{/if}
index a6b2e99..f798c96 100644 (file)
@@ -48,3 +48,5 @@
 <input type="button" value="Lancer l'import"/>
 </div>
 {/if}
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index ec652b4..f0a490b 100644 (file)
 <li>Voir la <a href="Fusion">documentation</a></li>
 <li><a href="fusionax/import">Import de la base AX</a> {if $lastimport} - (dernier import le {$lastimport}){/if}</li> 
 <li>Mise en <a href="fusionax/ids">correspondance simple</a></li>
+<li>Création des <a href="fusionax/view">VIEW annexes nécessaires aux corrélations</a></li>
 <li>Corrélation des <a href="fusionax/names">données d'identification</a></li>
 <li>Corrélation des <a href="fusionax/coords">coordonnées</a></li>
 <li>Corrélation des <a href="fusionax/pros">informations professionnelles</a></li>
 <li>Corrélation des <a href="fusionax/studies">informations de formations</a></li>
-<li><a href="fusionax/misc">Divers</a></li>
+<li>Corrélation des <a href="fusionax/deceased">dates de décès</a></li>
 </ul>
 
 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
diff --git a/templates/fusionax/view.tpl b/templates/fusionax/view.tpl
new file mode 100644 (file)
index 0000000..c0796cc
--- /dev/null
@@ -0,0 +1,25 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 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               *}
+{*                                                                        *}
+{**************************************************************************}
+
+<h2><a href="fusionax">Fusion des annuaires X.org - AX<a> / Création des VIEW annexes nécessaires aux corrélations </h2>
+
+<p><a href="fusionax/view/create">Création des VIEW annexes nécessaires aux corrélations</a></p>
index 832c2a2..1bce81d 100644 (file)
@@ -1,9 +1,8 @@
-CREATE OR REPLACE ALGORITHM=MERGE VIEW fusionax_xorg_anciens AS
-    SELECT
-        u.user_id, u.matricule_ax, u.promo,
-        n.display AS display_name, n.sort AS sort_name,
-        u.nom, u.prenom
-    FROM `auth_user_md5` AS u
-    INNER JOIN `profile_names_display` AS n ON ( n.user_id = u.user_id );
+CREATE OR REPLACE ALGORITHM=MERGE VIEW  fusionax_xorg_anciens AS
+                                SELECT  u.user_id, u.matricule_ax, u.promo,
+                                        n.display AS display_name, n.sort AS sort_name,
+                                        u.nom, u.prenom
+                                  FROM  auth_user_md5         AS u
+                            INNER JOIN  profile_names_display AS n ON (n.user_id = u.user_id);
 
 -- vim:set syntax=mysql: