From: Stéphane Jacob Date: Sun, 11 Jan 2009 12:58:08 +0000 (+0100) Subject: Fixes display names and promo saving. X-Git-Tag: xorg/1.0.0~332^2~344^2~39 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=62835757492bc01f69cab98d6f829469c7612d8f;p=platal.git Fixes display names and promo saving. --- diff --git a/modules/profile/general.inc.php b/modules/profile/general.inc.php index 5ef6455..80037d5 100644 --- a/modules/profile/general.inc.php +++ b/modules/profile/general.inc.php @@ -239,7 +239,8 @@ class ProfileGeneral extends ProfilePage public function __construct(PlWizard &$wiz) { parent::__construct($wiz); - $this->settings['naissance'] = new ProfileDate(); + $this->settings['naissance'] + = new ProfileDate(); $this->settings['freetext_pub'] = $this->settings['photo_pub'] = new ProfilePub(); @@ -251,8 +252,7 @@ class ProfileGeneral extends ProfilePage = $this->settings['yourself'] = $this->settings['display_name'] = $this->settings['sort_name'] - = $this->settings['tooltip_name'] - = $this->settings['promo_display'] + = $this->settings['promo'] = $this->settings['search_names'] = null; $this->settings['synchro_ax'] @@ -273,7 +273,7 @@ class ProfileGeneral extends ProfilePage protected function _fetchData() { // Checkout all data... - $res = XDB::query("SELECT p.promo AS promo_display, e.entry_year AS entry_year, e.grad_year AS grad_year, + $res = XDB::query("SELECT p.promo, e.entry_year AS entry_year, e.grad_year AS grad_year, u.nationalite, u.nationalite2, u.nationalite3, u.naissance, t.display_tel as mobile, t.pub as mobile_pub, d.email_directory as email_directory, @@ -337,7 +337,7 @@ class ProfileGeneral extends ProfilePage $this->values['search_names'][] = $sn; } while ($sn = $sn_all->next()); - // Proposes choice for promo_display + // Proposes choice for promotion if ($this->values['entry_year'] != $this->values['grad_year'] - 3) { for ($i = $this->values['entry_year']; $i < $this->values['grad_year'] - 2; $i++) { $this->values['promo_choice'][] = "X" . $i; @@ -436,7 +436,8 @@ class ProfileGeneral extends ProfilePage $short_name = short_name($search_names, $sn_types_public); $sort_name = short_name($search_names, $sn_types_public); $this->values['public_name'] = build_public_name($search_names, $sn_types_public, $full_name); - $this->values['private_name'] = $public_name . build_private_name($search_names, $sn_types_private); + $this->values['private_name'] = $this->values['public_name'] . + build_private_name($search_names, $sn_types_private); XDB::execute("UPDATE profile_display SET yourself = {?}, public_name = {?}, private_name = {?}, directory_name = {?}, short_name = {?}, sort_name = {?} @@ -455,11 +456,11 @@ class ProfileGeneral extends ProfilePage $this->values['yourself'], S::v('uid')); } } - if ($this->changed['promo_display']) { + if ($this->changed['promo']) { XDB::execute("UPDATE profile_display SET promo = {?} WHERE pid = {?}", - $this->values['promo_display'], S::v('uid')); + $this->values['promo'], S::v('uid')); } } diff --git a/templates/profile/general.tpl b/templates/profile/general.tpl index 3cabb1c..dc96e35 100644 --- a/templates/profile/general.tpl +++ b/templates/profile/general.tpl @@ -97,11 +97,12 @@ {if !$promo_choice} - {$promo_display} + {$promo} + {else} - {foreach from=$promo_choice item="promo_to_display"} - + {/foreach} {/if} diff --git a/templates/profile/orange.tpl b/templates/profile/orange.tpl index 7ce37cc..628ad9a 100644 --- a/templates/profile/orange.tpl +++ b/templates/profile/orange.tpl @@ -35,7 +35,7 @@ Afin de pouvoir être considéré{if $sexe}e{/if} à la fois dans ta promotion d'origine et ta ou tes promotions d'adoption tu peux entrer ici ton année de sortie de l'école. Plus précisément, il s'agit de l'année d'entrée en quatrième année ou année d'application. - Pour tes cocons d'origine ({$promo_display}) il s'agit de l'année {math equation="a + b" a=$promo b=3}. + Pour tes cocons d'origine ({$promo}) il s'agit de l'année {math equation="a + b" a=$promo b=3}.