petites modifs sur les trackers pour permettre de changer les propriétés d'un post...
authorx2000habouzit <x2000habouzit>
Mon, 26 Apr 2004 14:17:18 +0000 (14:17 +0000)
committerx2000habouzit <x2000habouzit>
Mon, 26 Apr 2004 14:17:18 +0000 (14:17 +0000)
configs/menu.conf.php
htdocs/css/default.css
htdocs/trackers/show_rq.php
templates/trackers/show.tpl
templates/trackers/show_rq.tpl

index e62b2af..ee2c90d 100644 (file)
@@ -40,7 +40,7 @@ if(logged()) {
         $menu['***'] = Array (
             'Marketing' => '###url###',
             'Administration' => '###url###',
-            'Trackers' => '###url###',
+            'Trackers' => 'trackers/',
             'Clear cache' => 'clear_all_cache.php'
         );
     }
index d9e6b6c..e6e372c 100644 (file)
@@ -408,5 +408,9 @@ margin-right : 2px;
     font-size: 95%;
     vertical-align: top;
 }
+
+#content input {
+    font-size: 95%
+}
 /* vim: set et ts=4 sts=4 sw=4: */
-/* $Id: default.css,v 1.25 2004-03-26 21:23:44 x2000coic Exp $ */
+/* $Id: default.css,v 1.26 2004-04-26 14:17:19 x2000habouzit Exp $ */
index dddad63..5d977b8 100644 (file)
@@ -5,10 +5,17 @@ require('tracker.inc.php');
 
 $tracker = new Tracker($_GET['tr_id']);
 
+if(isset($_POST['n_sub']) && $tracker->post_perms_ok()) {
+    $sql = "UPDATE trackers.requests
+            SET    pri='{$_POST['n_pri']}',admin_id='{$_POST['n_admin']}'
+            WHERE  tr_id='{$_GET['tr_id']}' AND rq_id='{$_GET['rq_id']}'";
+    $globals->db->query($sql);
+}
+
 $res = $globals->db->query("SELECT r.*, a.username, b.username AS admin, s.texte AS state
                             FROM trackers.requests    AS r
                             LEFT JOIN trackers.states AS s USING(st_id)
-                            LEFT JOIN auth_user_md5   AS a ON(r.user_id=a.user_id)
+                            LEFT JOIN auth_user_md5   AS a ON(r.user_id = a.user_id)
                             LEFT JOIN auth_user_md5   AS b ON(r.admin_id = b.user_id)
                             WHERE tr_id='{$_GET['tr_id']}' AND rq_id='{$_GET['rq_id']}'");
 
@@ -21,6 +28,12 @@ mysql_free_result($res);
 $page->assign('request', $request);
 $page->assign('tracker', $tracker);
 
+$sql = "SELECT    user_id,username
+        FROM      auth_user_md5
+        WHERE     perms='admin'
+        ORDER BY  username";
+$page->mysql_assign($sql, 'admins');
+
 $sql = "SELECT *, username
         FROM      trackers.followups 
         LEFT JOIN auth_user_md5 USING(user_id)
index 6107d77..46931ed 100644 (file)
@@ -1,4 +1,4 @@
-{* $Id: show.tpl,v 1.5 2004-02-25 13:14:39 x2000habouzit Exp $ *}
+{* $Id: show.tpl,v 1.6 2004-04-26 14:17:19 x2000habouzit Exp $ *}
 
 {literal}
 <script type="text/javascript">
@@ -37,7 +37,7 @@
   </tr>
 {foreach item=rq from=$requests}
   <tr class="pri{$rq.pri}">
-    <td>{$rq.date|date_format:"%m&nbsp;%Y"}</td>
+    <td>{$rq.date|date_format:"%d %b&nbsp;%Y"}</td>
     <td><a href="show_rq.php?tr_id={$smarty.get.tr_id}&amp;rq_id={$rq.rq_id}">{$rq.summary}</a></td>
     <td class="right">{if $rq.username}<a href="mailto:{$rq.username}@polytechnique.org">{$rq.username}</a>{else}-{/if}</td>
   </tr>
@@ -45,7 +45,7 @@
 <tr><th colspan="3"></th></tr>
 {foreach item=rq from=$close}
   <tr>
-    <td>{$rq.date|date_format:"%m&nbsp;%Y"}</td>
+    <td>{$rq.date|date_format:"%d %b&nbsp;%Y"}</td>
     <td><a href="show_rq.php?tr_id={$smarty.get.tr_id}&amp;rq_id={$rq.rq_id}">{$rq.summary}</a></td>
     <td class="action"><a href="javascript:del({$rq.rq_id})">delete</a></td>
   </tr>
index 026aa5e..edcf6d3 100644 (file)
@@ -1,4 +1,4 @@
-{* $Id: show_rq.tpl,v 1.1 2004-02-23 21:50:38 x2000habouzit Exp $ *}
+{* $Id: show_rq.tpl,v 1.2 2004-04-26 14:17:19 x2000habouzit Exp $ *}
 
 {dynamic}
 
@@ -8,37 +8,72 @@
 </p>
 
 <div class="rubrique">
-  {$request.summary} (posté le {$request.date|date_format:"%d.%m.%Y"})
+  {$request.summary} (posté le {$request.date|date_format:"%d %b %Y"})
 </div>
 
-<table class="bicol">
-  <tr>
-    <th>priorité</th>
-    <th>Soumis par</th>
-    <th>Assigné à </th>
-    <th>Etat actuel</th>
-  </tr>
-  <tr class="impair">
-    <td class="center">
-      {$tracker->pris[$request.pri]}
-    </td>
-    <td class="center">
-      {if $request.username}
-      <a href="mailto:{$request.username}@polytechnique.org">{$request.username}</a>
-      {else}-{/if}
-    </td>
-    <td class="center">
-      {if $request.admin}
-      <a href="mailto:{$request.admin}@polytechnique.org">{$request.admin}</a>
-      {else}-{/if}
-    </td>
-    <td class="center">
-      {$request.state}
-    </td>
-  </tr>
-  <tr><th colspan="4">Texte posté</th></tr>
-  <tr><td colspan="4"><tt>{$request.texte|escape|nl2br}</tt></td></tr>
-</table>
+<form action="{$smarty.server.REQUEST_URI}" method="post">
+  <table class="bicol">
+    <tr>
+      <th>priorité</th>
+      <th>Soumis par</th>
+      <th>Assigné à </th>
+      <th>Etat actuel</th>
+    </tr>
+    <tr class="impair">
+      <td class="center">
+        {$tracker->pris[$request.pri]}
+      </td>
+      <td class="center">
+        {if $request.username}
+        <a href="mailto:{$request.username}@polytechnique.org">{$request.username}</a>
+        {else}-{/if}
+      </td>
+      <td class="center">
+        {if $request.admin}
+        <a href="mailto:{$request.admin}@polytechnique.org">{$request.admin}</a>
+        {else}-{/if}
+      </td>
+      <td class="center">
+        {$request.state}
+      </td>
+    </tr>
+    <tr><th colspan="4">Texte posté</th></tr>
+    <tr><td colspan="4"><tt>{$request.texte|escape|nl2br}</tt></td></tr>
+    <tr><th colspan="4">Changer des propriétés</th></tr>
+    <tr class="impair">
+      <td class="center">
+        <select name="n_pri">
+          <option value="5" {if $request.pri eq 5}selected="selected"{/if}>{$tracker->pris[5]}</option>
+          <option value="4" {if $request.pri eq 4}selected="selected"{/if}>{$tracker->pris[4]}</option>
+          <option value="3" {if $request.pri eq 3}selected="selected"{/if}>{$tracker->pris[3]}</option>
+          <option value="2" {if $request.pri eq 2}selected="selected"{/if}>{$tracker->pris[2]}</option>
+          <option value="1" {if $request.pri eq 1}selected="selected"{/if}>{$tracker->pris[1]}</option>
+        </select>
+      </td>
+      <td class="center">
+        {if $request.username}
+        <a href="mailto:{$request.username}@polytechnique.org">{$request.username}</a>
+        {else}-{/if}
+      </td>
+      <td class="center">
+        <select name="n_admin">
+          <option value="">-</option>
+          {foreach item=a from=$admins}
+          <option value="{$a.user_id}" {if $a.username eq $request.admin}selected="selected"{/if}>{$a.username}</option>
+          {/foreach}
+        </select>
+      </td>
+      <td class="center">
+        {$request.state}
+      </td>
+    </tr>
+    <tr>
+      <td class="center" colspan="4">
+        <input type="submit" value="modifier" name="n_sub" />
+      </td>
+    </tr>
+  </table>
+</form>
 
 <br />
 
@@ -51,7 +86,7 @@
 {if $fups}
 <table class="bicol">
   {foreach item=fup from=$fups}
-  <tr><th>{$fup.username}&nbsp;&nbsp;&nbsp;<span class="smaller">le {$fup.date|date_format:"%d.%m.%Y"}</span></th></tr>
+  <tr><th>{$fup.username}&nbsp;&nbsp;&nbsp;<span class="smaller">le {$fup.date|date_format:"%d %b %Y"}</span></th></tr>
   <tr><td><tt>{$fup.texte|escape|nl2br}</tt></td></tr>
   {/foreach}
 </table>