Shows user filter used after a newsletter has been sent (Closes #1526)
authorBrice Gelineau <brice.gelineau@polytechnique.org>
Tue, 27 Sep 2011 13:32:42 +0000 (15:32 +0200)
committerBrice Gelineau <brice.gelineau@polytechnique.org>
Tue, 27 Sep 2011 13:32:42 +0000 (15:32 +0200)
Signed-off-by: Brice Gelineau <brice.gelineau@polytechnique.org>
ChangeLog
templates/newsletter/edit.tpl

index b70261a..1597f01 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,7 @@ Bug/Wish:
 
     * Newsletter:
         - #1509: Adds a Reply-To field for newsletters                     -GLN
+        - #1526: Shows user filter used after sending                      -GLN
 
     * Payments:
         - #1512: Allows payments for unlogged users                        -JAC
index 6ec0b3e..5ef9561 100644 (file)
       </td>
     </tr>
     {/if}
-    {if $issue->isEditable()}
-      {if $nl->criteria->hasFlag('promo')}
+    {if $nl->criteria->hasFlag('promo')}
       <tr>
         <td class="titre">Promotions</td>
         <td>
-          {include file="include/select_promo.tpl" promo_data=$smarty.request egal1="egal1" egal2="egal2" promo1="promo1" promo2="promo2" edu_type="edu_type"}
+          {if $issue->isEditable()}
+            {include file="include/select_promo.tpl" promo_data=$smarty.request egal1="egal1" egal2="egal2" promo1="promo1" promo2="promo2" edu_type="edu_type"}
+          {else}
+            {if t($smarty.request.promo1)}
+              {if $smarty.request.egal1 eq "="}
+                {$smarty.request.promo1}
+              {elseif t($smarty.request.promo2)}
+                {if $smarty.request.egal1 eq "&gt;="}
+                  {$smarty.request.promo1} à {$smarty.request.promo2}
+                {else}
+                  {$smarty.request.promo2} à {$smarty.request.promo1}
+                {/if}
+              {else}
+                {if $smarty.request.egal1 eq "&gt;="}
+                  après {$smarty.request.promo1}
+                {else}
+                  avant {$smarty.request.promo1}
+                {/if}
+              {/if}
+            {else}
+              Toutes les promotions
+            {/if}
+            {if $smarty.request.edu_type eq #UserFilter::GRADE_ING#}(X){/if}
+            {if $smarty.request.edu_type eq #UserFilter::GRADE_MST#}(Master){/if}
+            {if $smarty.request.edu_type eq #UserFilter::GRADE_PHD#}(Docteur){/if}
+          {/if}
         </td>
       </tr>
-      {/if}
-      {if $nl->criteria->hasFlag('axid')}
+    {/if}
+    {if $nl->criteria->hasFlag('axid')}
       <tr>
         <td class="titre">Matricule AX</td>
         <td>
-          <textarea name="axid" rows="10" cols="12">{$smarty.request.axid}</textarea>
-          <br />
-          <i>Entrer une liste de matricules AX (un par ligne)</i><br />
-          <input type="checkbox" name="axid_reversed" id="axid_reversed" {if $smarty.request.axid_reversed}checked="checked"{/if} value="1" />
-          Inverser la sélection <i>(sélectionner dans l'intervalle de promotions, à l'exception des matricules indiqués)</i>
+          {if $issue->isEditable()}
+            <textarea name="axid" rows="10" cols="12">{$smarty.request.axid}</textarea>
+            <br />
+            <i>Entrer une liste de matricules AX (un par ligne)</i><br />
+            <input type="checkbox" name="axid_reversed" id="axid_reversed" {if $smarty.request.axid_reversed}checked="checked"{/if} value="1" />
+            Inverser la sélection <i>(sélectionner dans l'intervalle de promotions, à l'exception des matricules indiqués)</i>
+          {else}
+            {$smarty.request.axid}
+          {/if}
         </td>
       </tr>
-      {/if}
     {/if}
     <tr class='center'>
       <td colspan='2'>