From: Stéphane Jacob Date: Tue, 20 Sep 2011 14:14:11 +0000 (+0200) Subject: Remember submitted values on group's main page erroneous edition. X-Git-Tag: xorg/1.1.4~150 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=f611c8bd4f9c19d684ff773592bcfb4b6f450dcd;hp=d70edc30479647cab05bbb56c765cd40a33bd10e;p=platal.git Remember submitted values on group's main page erroneous edition. Signed-off-by: Stéphane Jacob --- diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index 6e72bf5..0de64cc 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -168,12 +168,13 @@ class XnetGrpModule extends PLModule { global $globals; $page->changeTpl('xnetgrp/edit.tpl'); + $error = false; if (S::admin()) { - $dom = XDB::iterator('SELECT * - FROM group_dom - ORDER BY nom'); - $page->assign('dom', $dom); + $domains = XDB::iterator('SELECT * + FROM group_dom + ORDER BY nom'); + $page->assign('domains', $domains); $page->assign('super', true); } @@ -196,12 +197,38 @@ class XnetGrpModule extends PLModule if (Post::v('mail_domain') && (strstr(Post::v('mail_domain'), '.') === false)) { $page->trigError('Le domaine doit être un FQDN (aucune modification effectuée) !!!'); - return; + $error = true; } if (Post::t('nom') == '' || Post::t('diminutif') == '') { $page->trigError('Ni le nom ni le diminutif du groupe ne peuvent être vide.'); + $error = true; + } + if ($error) { + $page->assign('nom', Post::t('nom')); + $page->assign('diminutif', Post::t('diminutif')); + $page->assign('mail_domain', Post::t('mail_domain')); + $page->assign('cat', Post::v('cat')); + $page->assign('dom', Post::v('dom')); + $page->assign('ax', Post::v('ax')); + $page->assign('axDate', Post::t('axDate')); + $page->assign('site', $site); + $page->assign('resp', Post::t('resp')); + $page->assign('mail', Post::t('mail')); + $page->assign('phone', Post::t('phone')); + $page->assign('fax', Post::t('fax')); + $page->assign('address', Post::t('address')); + $page->assign('forum', Post::t('forum')); + $page->assign('inscriptible', Post::v('inscriptible')); + $page->assign('sub_url', Post::t('sub_url')); + $page->assign('unsub_url', Post::t('unsub_url')); + $page->assign('welcome_msg', Post::t('welcome_msg')); + $page->assign('pub', Post::v('pub')); + $page->assign('notif_unsub', Post::i('notif_unsub')); + $page->assign('descr', Post::t('descr')); + $page->assign('error', $error); return; } + $axDate = make_datetime(Post::v('axDate')); if (Post::t('axDate') != '') { $axDate = make_datetime(Post::v('axDate'))->format('Y-m-d'); @@ -275,6 +302,13 @@ class XnetGrpModule extends PLModule pl_redirect('../' . Post::v('diminutif', $globals->asso('diminutif')) . '/edit'); } + $page->assign('error', $error); + $page->assign('cat', $globals->asso('cat')); + $page->assign('dom', $globals->asso('dom')); + $page->assign('ax', $globals->asso('ax')); + $page->assign('inscriptible', $globals->asso('inscriptible')); + $page->assign('pub', $globals->asso('pub')); + $page->assign('notif_unsub', $globals->asso('notif_unsub')); } function handler_mail($page) diff --git a/templates/xnetgrp/edit.tpl b/templates/xnetgrp/edit.tpl index 5af8cda..b63c1bd 100644 --- a/templates/xnetgrp/edit.tpl +++ b/templates/xnetgrp/edit.tpl @@ -31,7 +31,7 @@ Nom : - + @@ -39,7 +39,7 @@ Diminutif : - + @@ -47,7 +47,7 @@ Domaine DNS : - + @@ -56,10 +56,10 @@ @@ -70,16 +70,16 @@ - le + le (ex: 01/01/1970) @@ -102,7 +102,7 @@ Site web : - + @@ -111,7 +111,7 @@ Contact : - + @@ -120,26 +120,26 @@ Adresse email : - + Téléphone - + Fax - + Adresse - + @@ -148,7 +148,7 @@ Forum : - + @@ -157,14 +157,8 @@ Inscription possible : - inscriptible eq 1}checked="checked"{/if} - name="inscriptible" /> - - inscriptible neq 1}checked="checked"{/if} - name="inscriptible" /> - + + @@ -174,7 +168,7 @@ laisser vide par défaut - + @@ -184,7 +178,7 @@ laisser vide par défaut - + @@ -194,7 +188,7 @@ envoyé à l'inscription - + @@ -202,15 +196,15 @@ Diffusion de la liste des membres : -