From 70c65f3afd13138f80bcda7b2fdb5f4e4b3efd22 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Thu, 8 Jan 2009 16:04:56 +0100 Subject: [PATCH] Adds explanations for the different types of names. --- modules/profile.php | 14 ++++++++ templates/profile/general.tpl | 4 +-- templates/profile/name_info.tpl | 57 +++++++++++++++++++++++++++++++++ upgrade/newdirectory-0.0.1/00_names.sql | 27 +++++++++------- 4 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 templates/profile/name_info.tpl diff --git a/modules/profile.php b/modules/profile.php index 386dca6..7ae3acf 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -46,6 +46,7 @@ class ProfileModule extends PLModule 'javascript/education.js' => $this->make_hook('education_js', AUTH_COOKIE), 'javascript/grades.js' => $this->make_hook('grades_js', AUTH_COOKIE), 'profile/medal' => $this->make_hook('medal', AUTH_PUBLIC), + 'profile/name_info' => $this->make_hook('name_info', AUTH_PUBLIC), 'profile/orange' => $this->make_hook('p_orange', AUTH_MDP), 'profile/usage' => $this->make_hook('p_usage', AUTH_MDP), @@ -139,6 +140,19 @@ class ProfileModule extends PLModule exit; } + function handler_name_info(&$page) + { + header('Content-Type: text/html; charset=utf-8'); + $page->changeTpl('profile/name_info.tpl', SIMPLE); + $res = XDB::iterator("SELECT name, explanations, + FIND_IN_SET('public', flags) AS public, + FIND_IN_SET('has_particle', flags) AS has_particle + FROM profile_name_search_enum + WHERE NOT FIND_IN_SET('not_displayed', flags) + ORDER BY NOT FIND_IN_SET('public', flags)"); + $page->assign('types', $res); + } + function handler_networking(&$page, $mid) { $res = XDB::query("SELECT icon diff --git a/templates/profile/general.tpl b/templates/profile/general.tpl index ac1df2c..7827677 100644 --- a/templates/profile/general.tpl +++ b/templates/profile/general.tpl @@ -47,7 +47,7 @@ - Comment t'appeller + Comment t'appeller
sur le site, dans la lettre mensuelle... @@ -61,7 +61,7 @@ Ils déterminent la façon dont ton nom apparaît sur les annuaires en ligne et papier et ta fiche apparaitra quand on cherche un de ces noms. Pour plus d'explications sur l'icône suivante - {icon name="information" title="Plus d'infos"}.
+ {icon name="information" title="Plus d'infos"}.
Si un de tes noms commence par une particule, coche la case en bout de ligne.
diff --git a/templates/profile/name_info.tpl b/templates/profile/name_info.tpl new file mode 100644 index 0000000..8e6244d --- /dev/null +++ b/templates/profile/name_info.tpl @@ -0,0 +1,57 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2008 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 *} +{* *} +{**************************************************************************} + +

Les différents types de noms

+ + + + + + + + + {iterate from=$types item=type} + + + + + + + {/iterate} +
TypeDescriptionConfidentialité ¹Prise en compte de la particule ²
{$type.name}{$type.explanations} + {if $type.public} + {icon name="flag_green" title="site public"} + {else} + {icon name="flag_red" title="site privé"} + {/if} + {if $type.has_particle}Oui{else}Non{/if}
+ +

Légende :

+ + +{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/upgrade/newdirectory-0.0.1/00_names.sql b/upgrade/newdirectory-0.0.1/00_names.sql index 5359a9e..fdbea10 100644 --- a/upgrade/newdirectory-0.0.1/00_names.sql +++ b/upgrade/newdirectory-0.0.1/00_names.sql @@ -33,18 +33,21 @@ CREATE TABLE IF NOT EXISTS profile_name_search_enum ( UNIQUE (name) ) CHARSET=utf8; -INSERT INTO profile_name_search_enum (name, flags) - VALUES ('Nom patronymique', 'has_particle,always_displayed,public'), - ('Nom marital', 'has_particle,always_displayed,public'), - ('Nom usuel', 'has_particle,always_displayed,public'), - ('Prénom', 'always_displayed,public'), - ('Pseudonyme (nom de plume)', 'always_displayed,public'), - ('Surnom', ''), - ('Prénom usuel', 'public'), - ('Autre prénom', ''), - ('Autre nom', ''), - ('Nom initial', 'has_particle,not_displayed,public'), - ('Prénom initial', 'has_particle,not_displayed,public'); +INSERT INTO profile_name_search_enum (name, flags, explanations) + VALUES ('Nom patronymique', 'has_particle,always_displayed,public', 'Le nom de famille avec lequel tu es né'), + ('Nom marital', 'has_particle,always_displayed,public', + 'Ton nom d\'épouse ou d\'époux'), + ('Nom usuel', 'has_particle,always_displayed,public', + 'Le nom de famille que tu utilises usuellement s\'il est différent du nom patronymique, ce peut-être une version racourcie de celui-ci, ton nom marital, une combianaison de ces deux noms...'), + ('Prénom', 'always_displayed,public', 'Ton prénom'), + ('Pseudonyme (nom de plume)', 'always_displayed,public', + 'Pseudonyme pour les artistes, gens de lettres'), + ('Surnom', '', 'Surnom à l\'École ou ailleurs'), + ('Prénom usuel', 'public', 'Si tu utilises une version raccourcie, francisée... de ton prénom'), + ('Autre prénom', '', 'Si tu as d\'autres prénoms et que tu souhaites les faire apparaître'), + ('Autre nom', '', 'Si tu as d\'autres noms et que tu souhaites les faire apparaître'), + ('Nom initial', 'has_particle,not_displayed,public', ''), + ('Prénom initial', 'has_particle,not_displayed,public', ''); DROP TABLE IF EXISTS profile_name_search; -- 2.1.4