Un petit nouveau qui souhaite contribuer.

Il n'arrive pas à s'inscrire sur la ML, donc je forward sa proposition.

J'ai pas eu le temps de regarder.

++


-------- Message original --------
Sujet: Fwd: Fix pour task #1879 Split my tickets and tickets which are
assigned to me on the central view
Date : Mon, 14 Dec 2009 08:33:33 -0800
De : Erich Iseli <erich.is...@iseli.org>
Pour : <r...@famillecollet.com>

Bonjour Rémi,

Toujours pas de nouvelle concernant la liste dév. Je t'envoie donc mon
patch comme convenu ce matin. Merci.

Erich alias ricky_ds

-------- Original Message --------
Subject: Fix pour task #1879 Split my tickets and tickets which are
assigned to me on the central view
Date: Sun, 13 Dec 2009 14:16:33 -0800
From: Erich Iseli <erich.is...@iseli.org>
To: <glpi-dev@gna.org>

Bonjour,

Je viens de terminer la task citée en titre:
https://forge.indepnet.net/issues/show/1879

Fichiers modifiés:
- inc/central.class.php (ajout d'un bloc supplémentaire dans la vue
personnelle et dans la vue groupe destiné à recevoir les tickets créés par
soi-meme respectivement ses propres groupes)
- inc/ticket.function.php (dans la fonction showJobList() - séparation des
tickets assignés à soi-meme respectivement à ses propres groupes d'une
part
et les tickets dont soi-meme resp. ses propres groupes sont les créateurs)
- locales/fr_FR.php (ajout de 3 strings dans la catégorie "central")

De plus, en faisant mes tests, je suis tombé sur un bug mineur dans une
feuille de style. Dont voici le patch:

--- /home/erich/svn/glpi/trunk/css/print.css    2009-12-12
12:08:32.000000000 +0100
+++ glpi/css/print.css  2009-12-13 21:43:29.000000000 +0100
@@ -27,7 +27,6 @@

--------------------------------------------------------------------------
 */

-*/
 /* ################--------------- GLPI CSS style
---------------#################### */

Bon début de semaine à tout le monde,

Erich Iseli
--- /home/erich/svn/glpi/trunk/inc/central.class.php	2009-12-13 21:07:52.000000000 +0100
+++ glpi/inc/central.class.php	2009-12-13 22:38:30.000000000 +0100
@@ -118,6 +118,9 @@
             echo "<tr><td class='top' width='450px'>";
             showCentralJobList($_SERVER['PHP_SELF'],0,"waiting",false);
             echo "</td></tr>";
+            echo "<tr><td class='top' width='450px'><br>";
+            showCentralJobList($_SERVER['PHP_SELF'],0,"requestbyself",false);
+            echo "</td></tr>";
          }
          echo "</table></td>";
          echo "<td class='top'><table><tr>";
@@ -162,6 +165,9 @@
             echo "<tr><td class='top' width='450px'><br>";
             showCentralJobList($_SERVER['PHP_SELF'],0,"process",true);
             echo "</td></tr>";
+            echo "<tr><td class='top' width='450px'><br>";
+            showCentralJobList($_SERVER['PHP_SELF'],0,"requestbyselfgroup",true);
+            echo "</td></tr>";
          }
          echo "</table></td>";
          echo "<td class='top'><table>";
--- /home/erich/svn/glpi/trunk/inc/ticket.function.php	2009-12-13 21:07:52.000000000 +0100
+++ glpi/inc/ticket.function.php	2009-12-13 22:53:59.000000000 +0100
@@ -110,11 +110,7 @@
    }
 
    $search_users_id = " (`glpi_tickets`.`users_id` = '".$_SESSION["glpiID"]."'
-                         AND (`status` = 'new'
-                              OR `status` = 'plan'
-                              OR `status` = 'assign'
-                              OR `status` = 'waiting'))
-                       OR ";
+                         AND (`status` IN ('new', 'plan', 'assign', 'waiting')))";
    $search_assign = " `users_id_assign` = '".$_SESSION["glpiID"]."' ";
    if ($showgrouptickets) {
       $search_users_id = "";
@@ -124,11 +120,7 @@
          $search_assign = " `groups_id_assign` IN ('$groups') ";
          if (haveRight("show_group_ticket",1)) {
             $search_users_id = " (`groups_id` IN ('$groups')
-                                  AND (`status` = 'new'
-                                       OR `status` = 'plan'
-                                       OR `status` = 'assign'
-                                       OR `status` = 'waiting'))
-                                OR ";
+                                  AND (`status` IN ('new', 'plan', 'assign', 'waiting')))";
          }
       }
    }
@@ -141,10 +133,15 @@
                        AND `status` ='waiting' ".
                        getEntitiesRestrictRequest("AND","glpi_tickets");
 
-   } else { // on affiche les tickets planifiés ou assignés à glpiID
-      $query .= "WHERE ($search_users_id (( $search_assign )
-                                          AND (`status` ='plan'
-                                               OR `status` = 'assign'))) ".
+   } else if ($status=="process") { // on affiche les tickets planifiés ou assignés à glpiID
+      $query .= "WHERE ($search_assign)
+                       AND (`status` IN ('plan', 'assign')) ".
+                       getEntitiesRestrictRequest("AND","glpi_tickets");
+   } else { // on affiche les tickets demandés par glpiID qui sont planifiés ou assignés
+            // à quelqu'un d'autre (exclut les self-tickets)
+      $query .= "WHERE ($search_users_id) 
+                       AND (`status` IN ('new', 'plan', 'assign', 'waiting')) 
+                       AND NOT ( $search_assign ) ".
                        getEntitiesRestrictRequest("AND","glpi_tickets");
    }
    $query .= "ORDER BY `date_mod` DESC";
@@ -177,20 +174,24 @@
             echo "<a href=\"".$CFG_GLPI["root_doc"]."/front/ticket.php?$link\">".
                    $LANG['central'][11]."</a>";
          }
+      } else if ($status=="process") {
+         if ($showgrouptickets) {
+            echo "<a href=\"".$CFG_GLPI["root_doc"]."/front/ticket.php?$link\">".
+                   $LANG['central'][18]."</a>";
+         } else {
+            echo "<a href=\"".$CFG_GLPI["root_doc"]."/front/ticket.php?$link\">".
+                   $LANG['central'][9]."</a>";
+         }
       } else {
-         echo $LANG['central'][17]."&nbsp;: ";
          if ($showgrouptickets) {
             if (haveRight("show_group_ticket",1)) {
                echo "<a href=\"".$CFG_GLPI["root_doc"]."/front/ticket.php?group=-1&amp;users_id=".
-                      $_SESSION["glpiID"]."&amp;reset=reset_before\">".$LANG['joblist'][5]."</a> / ";
+                      $_SESSION["glpiID"]."&amp;reset=reset_before\">".$LANG['central'][19]."</a>";
             }
-            echo "<a href=\"".$CFG_GLPI["root_doc"]."/front/ticket.php?$link\">".
-                   $LANG['joblist'][21]."</a>";
          } else {
             echo "<a href=\"".$CFG_GLPI["root_doc"]."/front/ticket.php?users_id=".
-                   $_SESSION["glpiID"]."&amp;reset=reset_before\">".$LANG['joblist'][5]."</a> / ".
-                 "<a href=\"".$CFG_GLPI["root_doc"]."/front/ticket.php?$link\">".
-                   $LANG['joblist'][21]."</a>";
+                   $_SESSION["glpiID"]."&amp;reset=reset_before\">".$LANG['central'][17]."</a> (".
+                   $LANG['joblist'][5] .")";
          }
       }
       echo "</th></tr>";
@@ -208,9 +209,19 @@
       echo "<table class='tab_cadrehov'>";
       echo "<tr><th>";
       if ($status=="waiting") {
-         echo $LANG['central'][11];
+         if ($showgrouptickets) {
+            echo $LANG['central'][16];
+         } else {
+            echo $LANG['central'][11];
+         }
+      } else if ($status=="process") {
+         if ($showgrouptickets) {
+            echo $LANG['central'][18];
+         } else {
+            echo $LANG['central'][9];
+         }
       } else {
-         echo $LANG['central'][9];
+         echo $LANG['central'][17] ." (". $LANG['joblist'][5] . ")";
       }
       echo "</th></tr>";
       echo "</table>";
--- /home/erich/svn/glpi/trunk/locales/fr_FR.php	2009-12-13 19:40:49.000000000 +0100
+++ glpi/locales/fr_FR.php	2009-12-13 22:52:37.000000000 +0100
@@ -181,6 +181,8 @@
 $LANG['central'][14]="Vue groupe";
 $LANG['central'][16]="Les tickets en attente de vos groupes";
 $LANG['central'][17]="Vos tickets";
+$LANG['central'][18]="Les tickets en cours de vos groupes";
+$LANG['central'][19]="Les tickets demandés par vos groupes";
 
 
 $LANG['choice'][0]="Non";
_______________________________________________
Glpi-dev mailing list
Glpi-dev@gna.org
https://mail.gna.org/listinfo/glpi-dev

Reply via email to