2 /*=====================================================================*\
3 || ###################################################################
5 || # Copyright ©2002-2007 Blue Static
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 2 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(
30 define('SVN', '$Id$');
32 $focus['index
'] = 'focus
';
34 require_once('./global.php
');
35 require_once('./includes
/class_sort
.php
');
37 if (!can_perform('canviewbugs
'))
39 $message->errorPermission();
42 $sort = new ListSorter('index
');
44 require_once 'includes
/pagination
.php
';
45 $pagination = new Pagination();
46 $pagination->processIncomingData();
48 // ###################################################################
50 $count = $db->queryFirst("
51 SELECT COUNT(*) AS count
52 FROM " . TABLE_PREFIX . "bug
53 WHERE (!hidden OR (hidden AND product IN (" . fetch_on_bits('canviewhidden
') . "))" . (can_perform('canviewownhidden
') ? " OR (hidden AND userid = " . bugdar::$userinfo['userid
'] . " AND product IN (" . fetch_on_bits('canviewownhidden
') . "))" : "") . ")
54 AND product IN (" . fetch_on_bits('canviewbugs
') . ")" . ((bugdar::$options['hidestatuses
'] OR isset(bugdar::$userinfo['hidestatuses
'])) ? "
55 AND status NOT IN (" . (bugdar::$userinfo['hidestatuses
'] != '' ? bugdar::$userinfo['hidestatuses
'] : bugdar::$options['hidestatuses
']) . ")" : "")
60 $message->error(T('There are no bugs to display
. This could be because you
do not have permission to view bugs
, or there may be none in the database
.'));
63 $pagination->setTotal($count['count
']);
64 $pagination->splitPages();
66 $bugs_fetch = $db->query($sort->fetch_sql_query(null, $pagination->fetchLimit($pagination->getPage() - 1) . ", " . $pagination->getPerPage()));
68 foreach ($bugs_fetch as $bug)
70 BSFunctions::swap_css_classes('altcolor
', '');
71 $bug = ProcessBugDataForDisplay($bug, BSFunctions::$cssClass);
72 $bugs .= $sort->constructRow($bug);
77 $columnHeads = $sort->constructColumnHeaders(true, 'p
=' . $pagination->page . '&
;pp
=' . $pagination->perpage);
78 $show['pagenav
'] = ($pagination->getPageCount() > 1);
79 $pagenav = $pagination->constructPageNav($sort->fetch_sort_link($sort->sortkey));
81 $tpl = new BSTemplate('trackerhome
');
83 'columnHeads
' => $columnHeads,
86 $tpl->evaluate()->flush();
88 /*=====================================================================*\
89 || ###################################################################
92 || ###################################################################
93 \*=====================================================================*/