error_permission(); } // ################################################################### $pagination = new Pagination('p', 'pp'); $count = $db->query_first(" SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "bug WHERE (!hidden OR (hidden AND productid IN (" . fetch_on_bits('canviewhidden') . "))) AND productid IN (" . fetch_on_bits('canviewbugs') . ")" ); $pagination->total = $count['count']; $pagination->split_pages(); $bugs_fetch = $db->query(" SELECT bug.*, user1.displayname AS firstreport, user2.displayname AS lastpost, user3.displayname AS hiddenlastpost FROM " . TABLE_PREFIX . "bug AS bug LEFT JOIN " . TABLE_PREFIX . "user AS user1 ON (bug.userid = user1.userid) LEFT JOIN " . TABLE_PREFIX . "user AS user2 ON (bug.lastpostby = user2.userid) LEFT JOIN " . TABLE_PREFIX . "user AS user3 ON (bug.hiddenlastpostby = user3.userid) WHERE bug.productid IN (" . fetch_on_bits('canviewbugs') . ") AND (!hidden OR (hidden AND productid IN (" . fetch_on_bits('canviewhidden') . "))) ORDER BY bug." . ((can_perform('canviewhidden')) ? "lastposttime" : "hiddenlastposttime") . " DESC LIMIT " . $pagination->fetch_limit($pagination->page - 1) . ", " . $pagination->perpage ); while ($bug = $db->fetch_array($bugs_fetch)) { $funct->exec_swap_bg($stylevar['alt_colour'], ''); $bug['bgcolour'] = ($bugsys->userinfo['showcolours'] ? $bugsys->datastore['status']["$bug[status]"]['color'] : $funct->bgcolour); $bug['product'] = $bugsys->datastore['product']["$bug[productid]"]['title']; $bug['version'] = $bugsys->datastore['version']["$bug[versionid]"]['version']; $bug['status'] = $bugsys->datastore['status']["$bug[status]"]['status']; $bug['resolution'] = $bugsys->datastore['resolution']["$bug[resolution]"]['resolution']; $bug['priority'] = $bugsys->datastore['priority']["$bug[priority]"]['priority']; $bug['severity'] = $bugsys->datastore['severity']["$bug[severity]"]['severity']; $bug['hiddendisplay'] = ((!can_perform('canviewhidden', $bug['productid']) AND $bug['hiddenlastposttime']) ? true : false); $bug['lastposttime'] = (($bug['hiddendisplay']) ? $bug['hiddenlastposttime'] : $bug['lastposttime']); $bug['lastpost'] = (($bug['hiddendisplay']) ? $bug['hiddenlastpost'] : $bug['lastpost']); $bug['lastposttime'] = $datef->format($bugsys->options['dateformat'], $bug['lastposttime']); eval('$bugs .= "' . $template->fetch('trackerhome_bits') . '";'); } $db->free_result($bugs_fetch); $show['pagenav'] = (($pagination->pagecount > 1) ? true : false); $pagenav = $pagination->construct_page_nav('index.php'); eval('$template->flush("' . $template->fetch('trackerhome') . '");'); /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>