hasPriv("admin")) util_show_error_page_and_exit("Insufficient privileges."); if (isset($aClean['sSub'])) { if(($aClean['sSub'] == 'delete' ) && ($aClean['iBuglinkId'])) { $oBuglink = new Bug($aClean['iBuglinkId']); $oBuglink->delete(); } if(($aClean['sSub'] == 'unqueue' ) && ($aClean['iBuglinkId'])) { $oBuglink = new Bug($aClean['iBuglinkId']); $oBuglink->unqueue(); } util_redirect_and_exit($_SERVER['PHP_SELF']."?iItemsPerPage=".$aClean['iItemsPerPage']."&sQueuedOnly=".$aClean['sQueuedOnly']."&iPage=".$aClean['iPage']); } { apidb_header("Administer Bugs"); $pageRange = 10; $QueuedOnly = empty($aClean['sQueuedOnly'])? NULL: $aClean['sQueuedOnly']; $BugLinks = ($QueuedOnly == 'on')?getNumberOfQueuedBugLinks():getNumberOfBugLinks(); $ItemsPerPage = isset($aClean['iItemsPerPage']) ? $aClean['iItemsPerPage'] : 10; $currentPage = isset($aClean['iPage']) ? $aClean['iPage'] : 1; $ItemsPerPage = min($ItemsPerPage,100); $totalPages = max(ceil($BugLinks/$ItemsPerPage),1); $currentPage = min($currentPage,$totalPages); $offset = (($currentPage-1) * $ItemsPerPage); /* display page selection links */ echo '
',"\n"; echo '
',"\n"; echo 'Page '.$currentPage.' of '.$totalPages.'
',"\n"; display_page_range($currentPage, $pageRange, $totalPages, $_SERVER['PHP_SELF']."?iItemsPerPage=".$ItemsPerPage."&sQueuedOnly=".$QueuedOnly); echo '
',"\n"; echo '
',"\n"; /* display the option to choose how many comments per-page to display */ echo ''; echo 'Number of Bug Links per page: '; echo '',"\n"; echo '
',"\n"; echo 'View queued links only: ',"\n"; echo '
',"\n"; echo '',"\n"; echo '
',"\n"; echo '
',"\n"; echo '',"\n"; echo '',"\n"; echo ' ',"\n"; echo ' ',"\n"; echo ' ',"\n"; echo ' ',"\n"; echo ' ',"\n"; echo ' ',"\n"; echo ' ',"\n"; echo ' ',"\n"; echo '',"\n"; if ($QueuedOnly == 'on') { $sWhere = "WHERE appFamily.appId = appVersion.appId AND buglinks.versionId = appVersion.versionId AND buglinks.bug_id = ".BUGZILLA_DB.".bugs.bug_id AND buglinks.queued = 'true'"; } else { $sWhere = "WHERE appFamily.appId = appVersion.appId AND buglinks.versionId = appVersion.versionId AND buglinks.bug_id = ".BUGZILLA_DB.".bugs.bug_id"; } $sQuery = "SELECT appFamily.description as appDescription, appFamily.appName as appName, appVersion.*, buglinks.versionId as versionId, buglinks.bug_id as bug_id, buglinks.linkId as linkId, buglinks.queued as queued, bugs.* FROM appFamily, appVersion, buglinks, bugs.bugs ".$sWhere." ORDER BY buglinks.bug_id, appName, versionName LIMIT ".query_escape_string($offset).", ".query_escape_string($ItemsPerPage).";"; $c = 0; if($hResult = query_parameters($sQuery)) { while($oRow = query_fetch_object($hResult)) { $oApp = new application($oRow->appId); $oVersion = new version($oRow->versionId); // set row color $bgcolor = ($c % 2 == 0) ? "color0" : "color1"; echo '',"\n"; echo ' ',"\n"; echo ' ',"\n"; echo ' ',"\n"; echo ' ',"\n"; echo ' ',"\n"; echo ' ',"\n"; echo ' ',"\n"; $bQueued = ($oRow->queued=="true")?true:false; if ($bQueued) { echo '',"\n"; } else { echo '',"\n"; } echo '',"\n"; $c++; } } echo "
Bug #StatusBug DescriptionApplication NameAplication Descriptionversiondeletechecked
',"\n"; echo ' '.$oRow->bug_id.'',"\n"; echo ' '.$oRow->bug_status.''.$oRow->short_desc.'',"\n"; echo $oApp->objectMakeLink()."\n"; echo ' '.$oRow->appDescription.'',"\n"; echo $oVersion->objectMakeLink()."\n"; echo ' [delete][OK]Yes
","\n"; echo "
","\n"; display_page_range($currentPage, $pageRange, $totalPages, $_SERVER['PHP_SELF']."?iItemsPerPage=".$ItemsPerPage."&sQueuedOnly=".$QueuedOnly); echo "
","\n"; apidb_footer(); } ?>