Deprecated: Assigning the return value of new by reference is deprecated in /home/bluestat/public_html/source/index.php on line 477
Bugdar - Blob - ViewGit - Blue Static
<?php
/*=====================================================================*\
|| ###################################################################
|| # Bugdar
|| # Copyright ©2002-2007 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| # the Free Software Foundation; version 2 of the License.
|| #
|| # This program is distributed in the hope that it will be useful, but
|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|| # more details.
|| #
|| # You should have received a copy of the GNU General Public License along
|| # with this program; if not, write to the Free Software Foundation, Inc.,
|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|| ###################################################################
\*=====================================================================*/

$fetchtemplates = array(
	'trackerhome',
	'trackerhome_bits',
	'list_head',
	'pagenav',
	'pagenav_bit'
);

define('SVN', '$Id$');

$focus['index'] = 'focus';

require_once('./global.php');
require_once('./includes/class_sort.php');

if (!can_perform('canviewbugs'))
{
	$message->errorPermission();
}

$sort = new ListSorter('index');
LoadPaginationFramework();

// ###################################################################

$count = $db->query_first("
	SELECT COUNT(*) AS count
	FROM " . TABLE_PREFIX . "bug
	WHERE (!hidden OR (hidden AND product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (hidden AND userid = " . $bugsys->userinfo['userid'] . " AND product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ")
	AND product IN (" . fetch_on_bits('canviewbugs') . ")" . (($bugsys->options['hidestatuses'] OR isset($bugsys->userinfo['hidestatuses'])) ? "
	AND status NOT IN (" . ($bugsys->userinfo['hidestatuses'] != '' ? $bugsys->userinfo['hidestatuses'] : $bugsys->options['hidestatuses']) . ")" : "")
);

if (!$count['count'])
{
	$message->error(_('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.'));
}

$pagination->setTotal($count['count']);
$pagination->splitPages();

$bugs_fetch = $db->query($sort->fetch_sql_query(null, $pagination->fetchLimit($pagination->getPage() - 1) . ", " . $pagination->getPerPage()));

while ($bug = $db->fetch_array($bugs_fetch))
{
	$funct->exec_swap_bg('altcolor', '');
	$bug = ProcessBugDataForDisplay($bug, $funct->bgcolour);
	$bugs .= $sort->constructRow($bug);
}

$db->free_result($bugs_fetch);

$columnHeads = $sort->constructColumnHeaders(true, 'p=' . $pagination->page . '&amp;pp=' . $pagination->perpage);
$show['pagenav'] = ($pagination->getPageCount() > 1);
$pagenav = $pagination->constructPageNav($sort->fetch_sort_link($sort->sortkey));

eval('$template->flush("' . $template->fetch('trackerhome') . '");');

/*=====================================================================*\
|| ###################################################################
|| # $HeadURL$
|| # $Id$
|| ###################################################################
\*=====================================================================*/
?>