Adds button for addresses dump, so that we avoid sending too many ax ids in GET.
authorStéphane Jacob <sj@m4x.org>
Tue, 27 Sep 2011 20:09:52 +0000 (22:09 +0200)
committerStéphane Jacob <sj@m4x.org>
Tue, 27 Sep 2011 20:16:18 +0000 (22:16 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
htdocs/javascript/search.js
templates/search/adv.form.tpl

index ddee7d9..29ba340 100644 (file)
@@ -331,5 +331,14 @@ function searchForJobTerm(treeid, jtid, full_name)
     $("input[name='jobterm']").val(jtid);
 }
 
+function addressesDump()
+{
+    if ($('#addresses_dump:checked').length > 0) {
+        $('#recherche').attr('action', 'search/adv/addresses').attr('method', 'post').removeAttr('onsubmit');
+    } else {
+        $('#recherche').attr('action', 'search/adv').attr('method', 'get');
+    }
+}
+
 // }}}
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index 6f38815..0a425a1 100644 (file)
         </table>
       </td>
     </tr>
-        {if hasPerm('admin,edit_directory')}
+    {if hasPerm('admin,edit_directory')}
     <tr>
       <td>Matricule AX</td>
       <td>
         <br />
         <i>Entrer une liste de matricules AX (un par ligne)</i>
       </td>
-        {/if}
-        {if $smarty.session.auth ge AUTH_COOKIE}
     </tr>
+    {/if}
+    {if $smarty.session.auth ge AUTH_COOKIE}
     <tr>
       <td colspan="2">
           <input type='checkbox' name='order' value='date_mod' {if $smarty.request.order eq "date_mod"}checked='checked'{/if} id="order"/>
            <label for="exact">Faire une recherche exacte.</label>
       </td>
     </tr>
-        {/if}
+    {/if}
+    {if hasPerm('admin,edit_directory')}
+    <tr>
+      <td colspan="2">
+           <label><input type="checkbox" id="addresses_dump" onclick="addressesDump();" />Tableau des adresses postales.</label>
+      </td>
+    </tr>
+    {/if}
     <tr><td colspan="2"></td></tr>
     <tr>
       <td colspan="2" style="text-align: center">