; | 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 | |
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 | /
------+-------------------------------------------+----------------
--- /dev/null
+<?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();
+?>
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 ();
}
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();
}
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);
-{* $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">
</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>
--- /dev/null
+{* $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}&rq_id={$smarty.get.rq_id}">Répondre</a>]
+</p>
+{if $fups}
+<table class="bicol">
+ {foreach item=fup from=$fups}
+ <tr><th>{$fup.username} <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}&rq_id={$smarty.get.rq_id}">Répondre</a>]
+</p>
+{/if}
+{/dynamic}
+
+{* vim:set et sw=2 sts=2 sws=2: *}