2 /*=====================================================================*\
3 || ################################################################### ||
4 || # Bugdar [#]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 \*=====================================================================*/
13 $fetchtemplates = array(
20 define('SVN', '$Id$');
22 $focus['index'] = 'focus';
24 require_once('./global.php');
25 require_once('./includes/class_pagination.php');
27 if (!can_perform('canviewbugs'))
29 $message->error_permission();
32 // ###################################################################
34 $pagination = new Pagination('p', 'pp');
35 $count = $db->query_first("
36 SELECT COUNT(*) AS count
37 FROM " . TABLE_PREFIX
. "bug
38 WHERE (!hidden OR (hidden AND productid IN (" . fetch_on_bits('canviewhidden') . ")))
39 AND productid IN (" . fetch_on_bits('canviewbugs') . ")"
42 $pagination->total
= $count['count'];
43 $pagination->split_pages();
45 $bugs_fetch = $db->query("
46 SELECT bug.*, user1.displayname AS firstreport, user2.displayname AS lastpost, user3.displayname AS hiddenlastpost
47 FROM " . TABLE_PREFIX
. "bug AS bug
48 LEFT JOIN " . TABLE_PREFIX
. "user AS user1
49 ON (bug.userid = user1.userid)
50 LEFT JOIN " . TABLE_PREFIX
. "user AS user2
51 ON (bug.lastpostby = user2.userid)
52 LEFT JOIN " . TABLE_PREFIX
. "user AS user3
53 ON (bug.hiddenlastpostby = user3.userid)
54 WHERE bug.productid IN (" . fetch_on_bits('canviewbugs') . ")
55 AND (!hidden OR (hidden AND productid IN (" . fetch_on_bits('canviewhidden') . ")))
56 ORDER BY bug." . ((can_perform('canviewhidden')) ?
"lastposttime" : "hiddenlastposttime") . " DESC
57 LIMIT " . $pagination->fetch_limit($pagination->page
- 1) . ", " . $pagination->perpage
60 while ($bug = $db->fetch_array($bugs_fetch))
62 $funct->exec_swap_bg($stylevar['alt_colour'], '');
63 $bug['bgcolour'] = ($bugsys->userinfo
['showcolours'] ?
$bugsys->datastore
['status']["$bug[status]"]['color'] : $funct->bgcolour
);
64 $bug['product'] = $bugsys->datastore
['product']["$bug[productid]"]['title'];
65 $bug['version'] = $bugsys->datastore
['version']["$bug[versionid]"]['version'];
66 $bug['status'] = $bugsys->datastore
['status']["$bug[status]"]['status'];
67 $bug['resolution'] = $bugsys->datastore
['resolution']["$bug[resolution]"]['resolution'];
68 $bug['priority'] = $bugsys->datastore
['priority']["$bug[priority]"]['priority'];
69 $bug['severity'] = $bugsys->datastore
['severity']["$bug[severity]"]['severity'];
71 $bug['hiddendisplay'] = ((!can_perform('canviewhidden', $bug['productid']) AND $bug['hiddenlastposttime']) ? true
: false
);
73 $bug['lastposttime'] = (($bug['hiddendisplay']) ?
$bug['hiddenlastposttime'] : $bug['lastposttime']);
74 $bug['lastpost'] = (($bug['hiddendisplay']) ?
$bug['hiddenlastpost'] : $bug['lastpost']);
76 $bug['lastposttime'] = $datef->format($bugsys->options
['dateformat'], $bug['lastposttime']);
78 eval('$bugs .= "' . $template->fetch('trackerhome_bits') . '";');
81 $db->free_result($bugs_fetch);
83 $show['pagenav'] = (($pagination->pagecount
> 1) ? true
: false
);
84 $pagenav = $pagination->construct_page_nav('index.php');
86 eval('$template->flush("' . $template->fetch('TRACKERHOME') . '");');
88 /*=====================================================================*\
89 || ###################################################################
92 || ###################################################################
93 \*=====================================================================*/