affichage d'un thread.
authorx2000habouzit <x2000habouzit>
Mon, 23 Feb 2004 21:50:37 +0000 (21:50 +0000)
committerx2000habouzit <x2000habouzit>
Mon, 23 Feb 2004 21:50:37 +0000 (21:50 +0000)
reste à : répondre à un thread
          ajouter les notifications par mail

etat_migration
htdocs/trackers/show_rq.php [new file with mode: 0644]
include/tracker.inc.php
include/xorg.page.inc.php
scripts/migration.sql
templates/trackers/show.tpl
templates/trackers/show_rq.tpl [new file with mode: 0644]

index 941b34f..2847ae0 100644 (file)
@@ -90,11 +90,6 @@ Etat  | Ancien nom                                                             | Nouveau nom
 ;        | sondage/resultats.php                                         |  |
 ;        | sondage/titre.php                                             |  |
 ;        | sondage/validation.php                                        | /
-------+-[ trackers ]------------------------------+----------------
-;!       | trackers/tracker_show.php                             | \
-;!       | trackers/tracker_show_rq.php                          |  \_ ajouter à diogenes
-;!       | trackers/index.php                                            |  /  (mad)
-;!       | trackers/tracker_admin.php                            | /
 ------+-[ news ]----------------------------------+----------------
 ;!       | news/abonnements.php                                          | \
 ;!       | news/article.php                                              |  |
@@ -201,4 +196,9 @@ x!!   | auth-wiki.php                                                         | obsolete
 x!!      | profil2.php                                                           | -
 x!!      | trackers/tracker_delete.php                           | -
 x!!      | trezo/trezo.inc.php                                           | -
+------+-[ trackers ]------------------------------+----------------
+x!!      | trackers/tracker_show.php                             | \
+x!!      | trackers/tracker_show_rq.php                          |  \_ récrit de 0 (ou presque)
+x!!      | trackers/index.php                                            |  / 
+x!!      | trackers/tracker_admin.php                            | /
 ------+-------------------------------------------+----------------
diff --git a/htdocs/trackers/show_rq.php b/htdocs/trackers/show_rq.php
new file mode 100644 (file)
index 0000000..cc2330c
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+require('auto.prepend.inc.php');
+new_skinned_page('trackers/show_rq.tpl', AUTH_COOKIE);
+require('tracker.inc.php');
+
+$tracker = new Tracker($_GET['tr_id']);
+
+
+$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 b ON(r.admin_id = b.user_id)
+                            WHERE tr_id='{$_GET['tr_id']}' AND rq_id='{$_GET['rq_id']}'");
+
+if(empty($tracker->id) || !$tracker->read_perms_ok() || !mysql_num_rows($res))
+    $page->failure();
+
+$request = mysql_fetch_assoc($res);
+mysql_free_result($res);
+
+$page->assign('request', $request);
+$page->assign('tracker', $tracker);
+
+$sql = "SELECT *, username
+        FROM      trackers.followups 
+        LEFT JOIN auth_user_md5 USING(user_id)
+        WHERE rq_id='{$_GET['rq_id']}'";
+$page->mysql_assign($sql, 'fups');
+
+$page->run();   
+?>
index 684b726..bf67b9e 100644 (file)
@@ -40,7 +40,7 @@ class Tracker {
                 LEFT JOIN trackers.mail_lists AS m USING(ml_id)
                 WHERE tr_id='$tr_id'");
         if(!mysql_num_rows($req)) {
-            unset($this->id);
+            $this->id = 0;
             return;
         }
         $this->pris = array ();
index ec9b4f8..3a10b75 100644 (file)
@@ -81,8 +81,10 @@ class XorgPage extends DiogenesCorePage {
     }
 
     function failure() {
-        $this->_tpl = 'failure.tpl';
         $this->_page_type = SKINNED;
+        $this->_tpl = 'failure.tpl';
+        $this->assign('xorg_tpl', 'failure.tpl');
+        $this->caching=0;
         $this->run();
     }
 
index 4790de5..a9173c2 100644 (file)
@@ -23,4 +23,6 @@ USE trackers;
 DROP TABLE cat_abo;
 DROP TABLE categories;
 ALTER TABLE requests DROP COLUMN cat_id;
+ALTER TABLE followups DROP COLUMN fu_id;
 ALTER TABLE requests ADD INDEX (tr_id);
+ALTER TABLE followups ADD INDEX (rq_id);
index e60a170..661e206 100644 (file)
@@ -1,4 +1,4 @@
-{* $Id: show.tpl,v 1.2 2004-02-23 19:09:38 x2000habouzit Exp $ *}
+{* $Id: show.tpl,v 1.3 2004-02-23 21:50:38 x2000habouzit Exp $ *}
 
 {literal}
 <script type="text/javascript">
@@ -15,7 +15,7 @@
 </script>
 {/literal}
 
-<form id="op" method="post" action="{$smarty.server.REQUEST_URI}">
+<form id="op" method="post" action="{$smarty.server.PHP_SELF}">
   <input type="hidden" id="id" name="id" value="" />
 </form>
 
diff --git a/templates/trackers/show_rq.tpl b/templates/trackers/show_rq.tpl
new file mode 100644 (file)
index 0000000..026aa5e
--- /dev/null
@@ -0,0 +1,64 @@
+{* $Id: show_rq.tpl,v 1.1 2004-02-23 21:50:38 x2000habouzit Exp $ *}
+
+{dynamic}
+
+<p class="normal">
+  [<a href="index.php">Liste des trackers</a>]
+  [<a href="show.php?tr_id={$smarty.get.tr_id}">Revenir au tracker</a>]
+</p>
+
+<div class="rubrique">
+  {$request.summary} (posté le {$request.date|date_format:"%d.%m.%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>
+
+<br />
+
+<div class="rubrique">
+  Réponses
+</div>
+<p class="normal">
+  [<a href="answer.php?tr_id={$smarty.get.tr_id}&amp;rq_id={$smarty.get.rq_id}">Répondre</a>]
+</p>
+{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><td><tt>{$fup.texte|escape|nl2br}</tt></td></tr>
+  {/foreach}
+</table>
+<p class="normal">
+  [<a href="answer.php?tr_id={$smarty.get.tr_id}&amp;rq_id={$smarty.get.rq_id}">Répondre</a>]
+</p>
+{/if}
+{/dynamic}
+
+{* vim:set et sw=2 sts=2 sws=2: *}