r207: s/canviewhiddenbugs/canviewhidden/g
[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 $message->error_permission();
23 }
24
25 // ###################################################################
26
27 // #*# pagination needs to be done here
28
29 $bugs_fetch = $db->query("
30 SELECT bug.*, user1.displayname AS firstreport, user2.displayname AS lastpost
31 FROM " . TABLE_PREFIX . "bug AS bug
32 LEFT JOIN user AS user1
33 ON (bug.userid = user1.userid)
34 LEFT JOIN user AS user2
35 ON (bug.lastpostby = user2.userid)" . ((!can_perform('canviewhidden')) ? "
36 WHERE !hidden" : "") . "
37 ORDER BY bug.lastposttime DESC"
38 );
39
40 while ($bug = $db->fetch_array($bugs_fetch))
41 {
42 $bug['bgcolour'] = $bugsys->datastore['status']["$bug[status]"]['color'];
43 $bug['product'] = $bugsys->datastore['product']["$bug[productid]"]['title'];
44 $bug['version'] = $bugsys->datastore['version']["$bug[versionid]"]['version'];
45 $bug['status'] = $bugsys->datastore['status']["$bug[status]"]['status'];
46 $bug['resolution'] = $bugsys->datastore['resolution']["$bug[resolution]"]['resolution'];
47 $bug['lastpostinfo'] = datelike('standard', $bug['lastposttime']) . ' by ' . $bug['lastpost'];
48 eval('$bugs .= "' . $template->fetch('trackerhome_bits') . '";');
49 }
50
51 $db->free_result($bugs_fetch);
52
53 $show['newreport'] = ((can_perform('cansubmitbugs')) ? true : false);
54
55 eval('$template->flush("' . $template->fetch('TRACKERHOME') . '");');
56
57 /*=====================================================================*\
58 || ###################################################################
59 || # $HeadURL$
60 || # $Id$
61 || ###################################################################
62 \*=====================================================================*/
63 ?>