#627: Easy access to promotion trombi
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sat, 17 Mar 2007 21:16:04 +0000 (21:16 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sat, 17 Mar 2007 21:16:04 +0000 (21:16 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1585 839d8a87-29fc-0310-9880-83ba4fa771e5

ChangeLog
modules/search.php
templates/search/quick.tpl
templates/xnetgrp/forum.tpl

index cf56834..e843fa8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -52,6 +52,7 @@ Bug/Wish:
     * Search:
         - #132: Better french soundex                                      -FRU
         - #173: Show only countries where there is a user                  -FRU
+        - #627: Link to promotion trombi                                   -FRU
 
     * Xnet:
         - #639: Fix the number of pages                                    -FRU
index 2a27ceb..ed0e901 100644 (file)
@@ -211,6 +211,12 @@ class SearchModule extends PLModule
                 new ThrowError('il n\'existe personne correspondant à ces critères dans la base !');
             }
         } else {
+            $res = XDB::query("SELECT  MIN(diminutif), MAX(diminutif)
+                                 FROM  groupex.asso
+                                WHERE  cat = 'Promotions'");
+            list($min, $max) = $res->fetchOneRow();
+            $page->assign('promo_min', $min);
+            $page->assign('promo_max', $max); 
             $page->assign('formulaire',1);
         }
 
index 49ff5a8..43162a7 100644 (file)
 {**************************************************************************}
 
 {include file=search/quick.form.tpl show_js=1}
+
+<h1>Voir le trombi d'une promotion</h1>
+
+<div id="message" style="position:absolute;"></div><br />
+
+<script type="text/javascript" src="javascript/ajax.js"></script>
+<script type="text/javascript">
+  {literal}
+  function showPromo()
+  {
+      var value = document.getElementById('promo').value;
+      if (value < {/literal}{$promo_min}{literal} || value > {/literal}{$promo_max}{literal}) {
+        showTempMessage('message', "La promotion doit être entre {/literal}{$promo_min} et {$promo_max}{literal}.", false);
+        return false;
+      }
+      window.open("http://www.polytechnique.net/login/" + value + "/trombi");
+      return false;
+  }
+  {/literal}
+</script>
+
+<form action="" method="post" onsubmit="return showPromo();">
+<table class="tinybicol" style="width: 30%; margin-right: auto; margin-left: auto">
+  <td class="titre">Promotion :</td>
+  <td>
+    <input type="text" name="promo" id="promo" size="4" value="" />
+    <input type="submit" name="submit_promo" value="Voir" />
+  </td>
+</table>
+</form>
+
 <h1>Comment faire une recherche ?</h1>
 
 <h2>Nom, Prenom, Promo ...</h2>
index 3108c63..e36412b 100644 (file)
@@ -25,7 +25,7 @@
 {$banana|smarty:nodefaults}
 
 <p>
-  Cette page utiliser les <a href="https://www.polytechnique.org/banana/profile">préférences</a> de Polytechnique.org.<br />
+  Cette page utilise les <a href="https://www.polytechnique.org/banana/profile">préférences</a> de Polytechnique.org.<br />
   Tu peux également retrouver tous les forums en te rendant à la rubrique
   <a href="https://www.polytechnique.org/banana">Forums &amp; PA</a>
 </p>