From: x2004laborde Date: Sun, 22 Apr 2007 10:12:13 +0000 (+0000) Subject: Promotion restrictions explanation and correction X-Git-Tag: xorg/0.9.14~66 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=fd0084aa8033382ac66210cbffee72e5a82c8b8a;p=platal.git Promotion restrictions explanation and correction git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1724 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/modules/survey/survey.inc.php b/modules/survey/survey.inc.php index 08123d6..ff4fab6 100644 --- a/modules/survey/survey.inc.php +++ b/modules/survey/survey.inc.php @@ -96,7 +96,7 @@ class Survey if ($this->promos == '') { return true; } - $promos = explode('|', $this->promos); + $promos = explode(',', $this->promos); foreach ($promos as $p) { if ((preg_match('#^\d{4}$#', $p) && $p == $promo) || (preg_match('#^\d{4}-$#', $p) && intval(substr($p, 0, 4)) <= $promo) || @@ -534,7 +534,7 @@ abstract class SurveyQuestion } // }}} -// {{{ abstract class SurveySimple and its derived classes : "opended" questions +// {{{ abstract class SurveySimple and its derived classes : "open" questions // {{{ abstract class SurveySimple extends SurveyQuestion abstract class SurveySimple extends SurveyQuestion { diff --git a/templates/survey/edit_root.tpl b/templates/survey/edit_root.tpl index 9a507b0..cfeea7b 100644 --- a/templates/survey/edit_root.tpl +++ b/templates/survey/edit_root.tpl @@ -41,8 +41,10 @@ function hidePromo(value) { if (value == "0" || value == "") { $("#ln_promo").hide(); + $("#ln_promo_exp").hide(); } else { - $("#ln_promo").show(); + $("#ln_promo").show(); + $("#ln_promo_exp").show(); } } $("[@name='survey_question[mode]']").change(function() { hidePromo(this.value); }); @@ -63,5 +65,12 @@ Promotions + + + + Exemple : 1954,1986-1989,-1942,2000-   restreindra le sondage à toutes les promotions suivantes :
+ 1954, 1986 à 1989, toutes jusqu'à 1942 et toutes à partir 2000 (les bornes sont systématiquement incluses) + + {* vim:set et sw=2 sts=2 ts=8 enc=utf-8: *}