From: x2000habouzit Date: Mon, 23 Feb 2004 21:50:37 +0000 (+0000) Subject: affichage d'un thread. X-Git-Tag: xorg/old~1834 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=6a19b45afa449a2b4902d8cea76f5af4340fcdff;p=platal.git affichage d'un thread. reste à : répondre à un thread ajouter les notifications par mail --- diff --git a/etat_migration b/etat_migration index 941b34f..2847ae0 100644 --- a/etat_migration +++ b/etat_migration @@ -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 index 0000000..cc2330c --- /dev/null +++ b/htdocs/trackers/show_rq.php @@ -0,0 +1,32 @@ +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(); +?> diff --git a/include/tracker.inc.php b/include/tracker.inc.php index 684b726..bf67b9e 100644 --- a/include/tracker.inc.php +++ b/include/tracker.inc.php @@ -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 (); diff --git a/include/xorg.page.inc.php b/include/xorg.page.inc.php index ec9b4f8..3a10b75 100644 --- a/include/xorg.page.inc.php +++ b/include/xorg.page.inc.php @@ -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(); } diff --git a/scripts/migration.sql b/scripts/migration.sql index 4790de5..a9173c2 100644 --- a/scripts/migration.sql +++ b/scripts/migration.sql @@ -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); diff --git a/templates/trackers/show.tpl b/templates/trackers/show.tpl index e60a170..661e206 100644 --- a/templates/trackers/show.tpl +++ b/templates/trackers/show.tpl @@ -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} {/literal} -
+
diff --git a/templates/trackers/show_rq.tpl b/templates/trackers/show_rq.tpl new file mode 100644 index 0000000..026aa5e --- /dev/null +++ b/templates/trackers/show_rq.tpl @@ -0,0 +1,64 @@ +{* $Id: show_rq.tpl,v 1.1 2004-02-23 21:50:38 x2000habouzit Exp $ *} + +{dynamic} + +

+ [Liste des trackers] + [Revenir au tracker] +

+ +
+ {$request.summary} (posté le {$request.date|date_format:"%d.%m.%Y"}) +
+ + + + + + + + + + + + + + + + +
prioritéSoumis parAssigné à Etat actuel
+ {$tracker->pris[$request.pri]} + + {if $request.username} + {$request.username} + {else}-{/if} + + {if $request.admin} + {$request.admin} + {else}-{/if} + + {$request.state} +
Texte posté
{$request.texte|escape|nl2br}
+ +
+ +
+ Réponses +
+

+ [Répondre] +

+{if $fups} + + {foreach item=fup from=$fups} + + + {/foreach} +
{$fup.username}   le {$fup.date|date_format:"%d.%m.%Y"}
{$fup.texte|escape|nl2br}
+

+ [Répondre] +

+{/if} +{/dynamic} + +{* vim:set et sw=2 sts=2 sws=2: *}