Bonjour,

Voici un patch 0.85 pour naviguer avec la flèche de gauche et droite
dans les formulaire. 

Quand on est dans un formulaire, on a les flèches de navigation pour
aller a la fiche suivante ou précédente. Ce patch permet de naviguer
avec les touches du clavier (flèche de droite pour aller à la fiche
suivante, et flèche de gauche pour aller à la fiche précédente).



Cordialement,
--
David DURIEUX
Tel : +33 (0)4.82.53.30.53
Mail : d.duri...@siprossii.com
Site Web : http://www.siprossii.com/

SIPROSSII
Rue des jardins
69860 Monsols
FRANCE
Index: inc/commonglpi.class.php
===================================================================
--- inc/commonglpi.class.php	(revision 22999)
+++ inc/commonglpi.class.php	(working copy)
@@ -752,9 +752,15 @@
          }
 
          if ($prev >= 0) {
-            echo "<td class='left'><a href='$cleantarget?id=$prev$extraparamhtml'>".
+            echo "<td class='left'><a href='$cleantarget?id=$prev$extraparamhtml' id='previouspage'>".
                   "<img src='".$CFG_GLPI["root_doc"]."/pics/left.png' alt=\"".__s('Previous').
                     "\" title=\"".__s('Previous')."\"></a></td>";
+            $js = '$("body").keydown(function(e) {
+                       if(e.keyCode == 37) {
+                         window.location = $("#previouspage").attr("href");
+                       }
+                  });';
+            echo Html::scriptBlock($js);
          } else {
             echo "<td class='left'><img src='".$CFG_GLPI["root_doc"]."/pics/left_off.png' alt=\"".
                                     __s('Previous')."\" title=\"".__s('Previous')."\"></td>";
@@ -798,9 +804,15 @@
          }
 
          if ($next >= 0) {
-            echo "<td class='right'><a href='$cleantarget?id=$next$extraparamhtml'>".
+            echo "<td class='right'><a href='$cleantarget?id=$next$extraparamhtml' id='nextpage'>".
                   "<img src='".$CFG_GLPI["root_doc"]."/pics/right.png' alt=\"".__s('Next').
                     "\" title=\"".__s('Next')."\"></a></td>";
+            $js = '$("body").keydown(function(e) {
+                       if(e.keyCode == 39) {
+                         window.location = $("#nextpage").attr("href");
+                       }
+                  });';
+            echo Html::scriptBlock($js);
          } else {
             echo "<td class='right'><img src='".$CFG_GLPI["root_doc"]."/pics/right_off.png' alt=\"".
                                      __s('Next')."\" title=\"".__s('Next')."\"></td>";
_______________________________________________
Glpi-dev mailing list
Glpi-dev@gna.org
https://mail.gna.org/listinfo/glpi-dev

Reply via email to