]>
src.bluestatic.org Git - bugdar.git/blob - index.php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
22 $fetchtemplates = array(
29 define('SVN', '$Id$');
31 $focus['index
'] = 'focus
';
33 require_once('./global.php
');
34 require_once('./includes
/class_pagination
.php
');
36 if (!can_perform('canviewbugs
'))
38 $message->error_permission();
41 // ###################################################################
43 $pagination = new Pagination('p
', 'pp
');
44 $count = $db->query_first("
45 SELECT COUNT(*) AS count
46 FROM " . TABLE_PREFIX . "bug
47 WHERE (!hidden OR (hidden AND productid IN (" . fetch_on_bits('canviewhidden
') . ")))
48 AND productid IN (" . fetch_on_bits('canviewbugs
') . ")"
51 $pagination->total = $count['count
'];
52 $pagination->split_pages();
54 $bugs_fetch = $db->query("
55 SELECT bug.*, user1.displayname AS firstreport, user2.displayname AS lastpost, user3.displayname AS hiddenlastpost
56 FROM " . TABLE_PREFIX . "bug AS bug
57 LEFT JOIN " . TABLE_PREFIX . "user AS user1
58 ON (bug.userid = user1.userid)
59 LEFT JOIN " . TABLE_PREFIX . "user AS user2
60 ON (bug.lastpostby = user2.userid)
61 LEFT JOIN " . TABLE_PREFIX . "user AS user3
62 ON (bug.hiddenlastpostby = user3.userid)
63 WHERE bug.productid IN (" . fetch_on_bits('canviewbugs
') . ")
64 AND (!hidden OR (hidden AND productid IN (" . fetch_on_bits('canviewhidden
') . ")))
65 ORDER BY bug." . ((can_perform('canviewhidden
')) ? "lastposttime" : "hiddenlastposttime") . " DESC
66 LIMIT " . $pagination->fetch_limit($pagination->page - 1) . ", " . $pagination->perpage
69 while ($bug = $db->fetch_array($bugs_fetch))
71 $funct->exec_swap_bg($stylevar['alt_colour
'], '');
72 $bug['bgcolour
'] = ($bugsys->userinfo['showcolours
'] ? $bugsys->datastore['status
']["$bug[status]"]['color
'] : $funct->bgcolour);
73 $bug['product
'] = $bugsys->datastore['product
']["$bug[productid]"]['title
'];
74 $bug['version
'] = $bugsys->datastore['version
']["$bug[versionid]"]['version
'];
75 $bug['status
'] = $bugsys->datastore['status
']["$bug[status]"]['status
'];
76 $bug['resolution
'] = $bugsys->datastore['resolution
']["$bug[resolution]"]['resolution
'];
77 $bug['priority
'] = $bugsys->datastore['priority
']["$bug[priority]"]['priority
'];
78 $bug['severity
'] = $bugsys->datastore['severity
']["$bug[severity]"]['severity
'];
80 $bug['hiddendisplay
'] = ((!can_perform('canviewhidden
', $bug['productid
']) AND $bug['hiddenlastposttime
']) ? true : false);
82 $bug['lastposttime
'] = (($bug['hiddendisplay
']) ? $bug['hiddenlastposttime
'] : $bug['lastposttime
']);
83 $bug['lastpost
'] = (($bug['hiddendisplay
']) ? $bug['hiddenlastpost
'] : $bug['lastpost
']);
85 $bug['lastposttime
'] = $datef->format($bugsys->options['dateformat
'], $bug['lastposttime
']);
87 eval('$bugs .= "' . $template->fetch('trackerhome_bits') . '";');
90 $db->free_result($bugs_fetch);
92 $show['pagenav
'] = (($pagination->pagecount > 1) ? true : false);
93 $pagenav = $pagination->construct_page_nav('index
.php
');
95 eval('$template->flush("' . $template->fetch('trackerhome') . '");');
97 /*=====================================================================*\
98 || ###################################################################
101 || ###################################################################
102 \*=====================================================================*/