From a41bf2f836624f5a1e162c75766d7322bef96cfd Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Mon, 27 Nov 2006 14:40:49 +0000 Subject: [PATCH] #277: Ergonomy of registration git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1185 839d8a87-29fc-0310-9880-83ba4fa771e5 --- ChangeLog | 5 +++ include/xorg.inc.php | 9 ++++-- modules/register.php | 14 +++++--- templates/register/breadcrumb.tpl | 32 +++++++++++++++++++ templates/register/end.tpl | 2 ++ templates/register/step0.tpl | 1 + templates/register/step1.tpl | 2 ++ templates/register/step2.tpl | 18 +++++++++-- templates/register/step3.tpl | 1 + templates/register/step4.tpl | 1 + templates/register/success.tpl | 2 ++ templates/skin/register.tpl | 67 +++++++++++++++++++++++++++++++++++++++ 12 files changed, 145 insertions(+), 9 deletions(-) create mode 100644 templates/register/breadcrumb.tpl create mode 100644 templates/skin/register.tpl diff --git a/ChangeLog b/ChangeLog index a58eff6..b75144b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ ================================================================================ VERSION 0.9.13 ?? ?? 2007 +Bug/Wish: + + * Register: + - #277: Improve ergonomy -FRU + From 0.9.12 branch: * Search: diff --git a/include/xorg.inc.php b/include/xorg.inc.php index 97c8a03..cfeaab3 100644 --- a/include/xorg.inc.php +++ b/include/xorg.inc.php @@ -36,9 +36,14 @@ class XorgPage extends PlatalPage function run() { - global $globals; + global $globals, $platal; $this->assign('globals', $globals); - $this->_run('skin/'.S::v('skin', 'default.tpl')); + if ($platal->path == 'register') { + $skin = 'register.tpl'; + } else { + $skin = S::v('skin', 'default.tpl'); + } + $this->_run('skin/' . $skin); } } diff --git a/modules/register.php b/modules/register.php index a85bf6c..002b7ef 100644 --- a/modules/register.php +++ b/modules/register.php @@ -85,8 +85,13 @@ class RegisterModule extends PLModule case 1: if (Post::has('promo')) { $promo = Post::i('promo'); - if ($promo < 1900 || $promo > date('Y')) { - $err = "La promotion saisie est incorrecte !"; + $res = XDB::query("SELECT COUNT(*) + FROM auth_user_md5 + WHERE perms='pending' AND deces = '0000-00-00' + AND promo = {?}", + $promo); + if (!$res->fetchOneCell()) { + $err = "La promotion saisie est incorrecte ou tous les camardes de cette promo sont inscrits !"; } else { $sub_state['step'] = 2; $sub_state['promo'] = $promo; @@ -177,7 +182,7 @@ class RegisterModule extends PLModule } $_SESSION['sub_state'] = $sub_state; - $page->changeTpl('register/step'.intval($sub_state['step']).'.tpl', SIMPLE); + $page->changeTpl('register/step'.intval($sub_state['step']).'.tpl'); if (isset($err)) { $page->trig($err); } @@ -193,7 +198,7 @@ class RegisterModule extends PLModule global $globals; $page->changeTpl('register/end.tpl'); - + $_SESSION['sub_state'] = array('step' => 5); require_once('user.func.inc.php'); if ($hash) { @@ -308,6 +313,7 @@ class RegisterModule extends PLModule { $page->changeTpl('register/success.tpl'); + $_SESSION['sub_state'] = array('step' => 5); if (Env::has('response2')) { $_SESSION['password'] = $password = Post::v('response2'); diff --git a/templates/register/breadcrumb.tpl b/templates/register/breadcrumb.tpl new file mode 100644 index 0000000..d27b224 --- /dev/null +++ b/templates/register/breadcrumb.tpl @@ -0,0 +1,32 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2006 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 *} +{* *} +{**************************************************************************} + +{assign var="step" value=$smarty.session.sub_state.step} +
+ Procédure d'inscription : + {if !$step}{/if}Charte{if !$step}{/if} » + {if $step eq 1 || $step eq 2}{/if}Identification{if $step eq 1 || $step eq 2}{/if} » + {if $step eq 4 || $step eq 3}{/if}Pré-Inscription{if $step eq 4 || $step eq 3}{/if} » + {if $step eq 5}{/if}Validation{if $step eq 5}{/if} +
+ +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/register/end.tpl b/templates/register/end.tpl index d3f98dc..3f1d7b5 100644 --- a/templates/register/end.tpl +++ b/templates/register/end.tpl @@ -20,6 +20,8 @@ {* *} {**************************************************************************} +{include file="register/breadcrumb.tpl"} +

:'(

diff --git a/templates/register/step0.tpl b/templates/register/step0.tpl index b0bdc12..7364963 100644 --- a/templates/register/step0.tpl +++ b/templates/register/step0.tpl @@ -20,6 +20,7 @@ {* *} {**************************************************************************} +{include file="register/breadcrumb.tpl"}

Conditions générales

diff --git a/templates/register/step1.tpl b/templates/register/step1.tpl index b325570..44a55e7 100644 --- a/templates/register/step1.tpl +++ b/templates/register/step1.tpl @@ -20,6 +20,8 @@ {* *} {**************************************************************************} +{include file="register/breadcrumb.tpl"} +

Identification

diff --git a/templates/register/step2.tpl b/templates/register/step2.tpl index 0029d1a..2050fae 100644 --- a/templates/register/step2.tpl +++ b/templates/register/step2.tpl @@ -20,6 +20,8 @@ {* *} {**************************************************************************} +{include file="register/breadcrumb.tpl"} +

Identification

@@ -29,6 +31,7 @@ {if $smarty.session.sub_state.promo >= 1996} + {assign var="promo" value=$smarty.session.sub_state.promo} @@ -44,10 +47,19 @@ {/if} diff --git a/templates/register/step3.tpl b/templates/register/step3.tpl index 016a23c..c6d27d9 100644 --- a/templates/register/step3.tpl +++ b/templates/register/step3.tpl @@ -20,6 +20,7 @@ {* *} {**************************************************************************} +{include file="register/breadcrumb.tpl"} {if $smarty.session.sub_state.forlife} diff --git a/templates/register/step4.tpl b/templates/register/step4.tpl index 8f0aee1..b582f3e 100644 --- a/templates/register/step4.tpl +++ b/templates/register/step4.tpl @@ -20,6 +20,7 @@ {* *} {**************************************************************************} +{include file="register/breadcrumb.tpl"}

Pré-inscription réussie

diff --git a/templates/register/success.tpl b/templates/register/success.tpl index 9c63fd6..2b7aca8 100644 --- a/templates/register/success.tpl +++ b/templates/register/success.tpl @@ -20,6 +20,8 @@ {* *} {**************************************************************************} +{include file="register/breadcrumb.tpl"} +

Bravo !!!

diff --git a/templates/skin/register.tpl b/templates/skin/register.tpl new file mode 100644 index 0000000..be664cb --- /dev/null +++ b/templates/skin/register.tpl @@ -0,0 +1,67 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2006 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 *} +{* *} +{**************************************************************************} + + + + + + + {include file=skin/common.header.tpl} + {include file=skin/common.bandeau.head.tpl} + + + {include file=skin/common.devel.tpl} + {if $smarty.session.suid} +

matricule
- 6 chiffres terminant par le numéro d'entrée (ex: 960532 ou 101532)
+ 6 chiffres terminant par le numéro d'entrée (ex: + {if $promo < 2000} + {math equation="promo % 100" promo=$promo}0532)
+ {else} + {math equation="(promo % 100) + 100" promo=$promo}532)
+ {/if} Voir sur le GU ou un bulletin de solde pour trouver cette information

- Pour les élèves étrangers voie 2, il est du type :
- Promotion: 1996, Matricule: 970XXX - Promotion: 2001, Matricule 102XXX. + Pour les élèves étrangers voie 2, il est du type : + {if $promo < 1999} + {math equation="(promo + 1) % 100" promo=$promo}0XXX + {else} + {math equation="((promo + 1) % 100) + 100" promo=$promo}XXX + {/if}
+ + + +
+ {$smarty.session.suid} ({$smarty.session.forlife}) + [exit] +
+ {/if} + + {if $simple} +

+ {include file="skin/common.content.tpl"} +
+ {else} + {include file=skin/common.bandeau.tpl} + + + + + + + +
+ [ LOGO ] + [ Polytechnique.org ]
+ [LES X SUR LE WEB] +
+ {include file="skin/common.content.tpl"} +
+ {/if} + + +{* vim:set et sw=2 sts=2 sws=2: *} -- 2.1.4