Fixes a few issues in the process of the broken addresses.
[platal.git] / modules / profile / general.inc.php
index 11d3076..8afe3f8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2007 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -29,7 +29,7 @@ class ProfileNom implements ProfileSetting
 
     private function prepareField($value)
     {
-        $value = strtoupper(replace_accent($value));
+        $value = mb_strtoupper($value);
         return preg_replace('/[^A-Z]/', ' ', $value);
     }
 
@@ -52,9 +52,8 @@ class ProfileNom implements ProfileSetting
                 || $this->matchWord($ini, $new, $newLen)
                 || ($field == 'nom' && $new == 'DE ' . $old);
         if (!$success) {
-            global $page;
-            $page->trig("Le $field que tu as choisi ($value) est trop loin de ton $field initial ($init)"
-                       . (($init == $current)? "" : " et de ton prénom précédent ($current)"));
+            Platal::page()->trigError("Le $field que tu as choisi ($value) est trop loin de ton $field initial ($init)"
+                                    . (($init == $current)? "" : " et de ton prénom précédent ($current)"));
         }
         return $success ? $value : $current;
     }
@@ -128,7 +127,7 @@ class ProfileGeneral extends ProfilePage
                                    q.profile_mobile as mobile, q.profile_mobile_pub as mobile_pub,
                                    q.profile_web as web, q.profile_web_pub as web_pub,
                                    q.profile_freetext as freetext, q.profile_freetext_pub as freetext_pub,
-                                   q.profile_nick as nick, q.profile_from_ax as synchro_ax, u.matricule_ax,
+                                   q.profile_nick as nick, q.profile_from_ax as synchro_ax, u.hruid,
                                    IF(a1.aid IS NULL, -1, a1.aid) as appli_id1, a1.type as appli_type1,
                                    IF(a2.aid IS NULL, -1, a2.aid) as appli_id2, a2.type as appli_type2
                              FROM  auth_user_md5   AS u
@@ -197,7 +196,7 @@ class ProfileGeneral extends ProfilePage
         }
     }
 
-    public function _prepare(PlatalPage &$page, $id)
+    public function _prepare(PlPage &$page, $id)
     {
         require_once "applis.func.inc.php";
     }