r66: Moving all DB stuff to be handled by ISSO. Working with our one big $bugsys...
[bugdar.git] / index.php
1 <?php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
12
13 $fetchtemplates = array(
14 'TRACKERHOME',
15 'trackerhome_bits'
16 );
17
18 require_once('./global.php');
19
20 if (!can_perform('canviewbugs'))
21 {
22 echo 'no permission';
23 exit;
24 }
25
26 // ###################################################################
27
28 // #*# pagination needs to be done here
29
30 $bugs_fetch = $db->query("
31 SELECT bug.*, user1.displayname AS firstreport, user2.displayname AS lastpost
32 FROM " . TABLE_PREFIX . "bug AS bug
33 LEFT JOIN user AS user1
34 ON (bug.userid = user1.userid)
35 LEFT JOIN user AS user2
36 ON (bug.lastpostby = user2.userid)
37 ORDER BY bug.lastposttime DESC"
38 );
39
40 while ($bug = $db->fetch_array($bugs_fetch))
41 {
42 $bug['product'] = $bugsys->datastore['product']["$bug[productid]"]['title'];
43 $bug['version'] = $bugsys->datastore['version']["$bug[versionid]"]['version'];
44 $bug['status'] = $bugsys->datastore['status']["$bug[status]"]['status'];
45 $bug['resolution'] = $bugsys->datastore['resolution']["$bug[resolution]"]['resolution'];
46 $bug['lastpostinfo'] = datelike('standard', $bug['lastposttime']) . ' by ' . $bug['lastpost'];
47 eval('$bugs .= "' . $tpl->fetch('trackerhome_bits') . '";');
48 }
49
50 $db->free_result($bugs_fetch);
51
52 $show['newreport'] = iff(can_perform('cansubmitbugs'), true, false);
53
54 eval('$tpl->flush("' . $tpl->fetch('TRACKERHOME') . '");');
55
56 /*=====================================================================*\
57 || ###################################################################
58 || # $HeadURL$
59 || # $Id$
60 || ###################################################################
61 \*=====================================================================*/
62 ?>