r308: Changing index row display.
[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 define('SVN', '$Id$');
19
20 $focus['index'] = 'focus';
21
22 require_once('./global.php');
23
24 if (!can_perform('canviewbugs'))
25 {
26 $message->error_permission();
27 }
28
29 // ###################################################################
30
31 // #*# pagination needs to be done here
32
33 $bugs_fetch = $db->query("
34 SELECT bug.*, user1.displayname AS firstreport, user2.displayname AS lastpost, user3.displayname AS hiddenlastpost
35 FROM " . TABLE_PREFIX . "bug AS bug
36 LEFT JOIN user AS user1
37 ON (bug.userid = user1.userid)
38 LEFT JOIN user AS user2
39 ON (bug.lastpostby = user2.userid)
40 LEFT JOIN user AS user3
41 ON (bug.hiddenlastpostby = user3.userid)" . ((!can_perform('canviewhidden')) ? "
42 WHERE !hidden" : "") . "
43 ORDER BY bug." . ((can_perform('canviewhidden')) ? "lastposttime" : "hiddenlastposttime") . " DESC"
44 );
45
46 while ($bug = $db->fetch_array($bugs_fetch))
47 {
48 $bug['bgcolour'] = $bugsys->datastore['status']["$bug[status]"]['color'];
49 $bug['product'] = $bugsys->datastore['product']["$bug[productid]"]['title'];
50 $bug['version'] = $bugsys->datastore['version']["$bug[versionid]"]['version'];
51 $bug['status'] = $bugsys->datastore['status']["$bug[status]"]['status'];
52 $bug['resolution'] = $bugsys->datastore['resolution']["$bug[resolution]"]['resolution'];
53
54 $bug['hiddendisplay'] = ((!can_perform('canviewhidden') AND $bug['hiddenlastposttime']) ? true : false);
55
56 $bug['lastposttime'] = (($bug['hiddendisplay']) ? $bug['hiddenlastposttime'] : $bug['lastposttime']);
57 $bug['lastpost'] = (($bug['hiddendisplay']) ? $bug['hiddenlastpost'] : $bug['lastpost']);
58
59 $bug['lastposttime'] = $datef->format($bugsys->options['dateformat'], $bug['lastposttime']);
60
61 eval('$bugs .= "' . $template->fetch('trackerhome_bits') . '";');
62 }
63
64 $db->free_result($bugs_fetch);
65
66 $show['newreport'] = ((can_perform('cansubmitbugs')) ? true : false);
67
68 eval('$template->flush("' . $template->fetch('TRACKERHOME') . '");');
69
70 /*=====================================================================*\
71 || ###################################################################
72 || # $HeadURL$
73 || # $Id$
74 || ###################################################################
75 \*=====================================================================*/
76 ?>