|
From: Benjamin C. <bc...@us...> - 2001-08-13 13:34:54
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv6680
Modified Files:
TODO global.css include.php query.php
Log Message:
Added counts of and links to bugs reported by and assigned to user to the bottom nav
Index: TODO
===================================================================
RCS file: /cvsroot/phpbt/phpbt/TODO,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- TODO 2001/08/11 17:31:23 1.5
+++ TODO 2001/08/13 13:34:49 1.6
@@ -1,9 +1,6 @@
Bugs:
- Create bugs via email
-Bottom Nav:
-- Counts of and links to bugs reported by and assigned to user
-
Personal Page:
- Choose columns to display in bug list
Index: global.css
===================================================================
RCS file: /cvsroot/phpbt/phpbt/global.css,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- global.css 2001/08/10 13:51:06 1.4
+++ global.css 2001/08/13 13:34:49 1.5
@@ -36,6 +36,10 @@
font-family: "Arial","Helvetica","MS Sans Serif","Sans-Serif";
}
+input[type="reset"] {
+ font-family: "Arial","Helvetica","MS Sans Serif","Sans-Serif";
+ }
+
textarea {
font-size: 12px;
}
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- include.php 2001/08/11 17:09:24 1.27
+++ include.php 2001/08/13 13:34:49 1.28
@@ -157,15 +157,24 @@
class templateclass extends Template {
function pparse($target, $handle, $append = false) {
- global $auth, $perm;
+ global $auth, $perm, $q;
+ $u = $auth->auth['uid'];
$this->set_block('wrap', 'logoutblock', 'loblock');
$this->set_block('wrap', 'loginblock', 'liblock');
$this->set_block('wrap', 'adminnavblock', 'anblock');
- if ($auth->auth['uid'] && $auth->auth['uid'] != 'nobody') {
+ if ($u && $u != 'nobody') {
+ list($owner_open, $owner_closed) =
+ $q->grab("select sum(if(s.Name in ('Unconfirmed','New','Assigned','Reopened'),1,0)) as Open, sum(if(s.Name not in ('Unconfirmed','New','Assigned','Reopened'),1,0)) as Closed from Bug b left join Status s on Status = StatusID where AssignedTo = $u");
+ list($reporter_open, $reporter_closed) =
+ $q->grab("select sum(if(s.Name in ('Unconfirmed','New','Assigned','Reopened'),1,0)) as Open, sum(if(s.Name not in ('Unconfirmed','New','Assigned','Reopened'),1,0)) as Closed from Bug b left join Status s on Status = StatusID where CreatedBy = $u");
$this->set_var(array(
'loggedinas' => $auth->auth['email'],
- 'liblock' => ''
+ 'liblock' => '',
+ 'owner_open' => $owner_open,
+ 'owner_closed' => $owner_closed,
+ 'reporter_open' => $reporter_open,
+ 'reporter_closed' => $reporter_closed
));
$this->parse('loblock', 'logoutblock', true);
} else {
Index: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- query.php 2001/08/09 22:17:02 1.13
+++ query.php 2001/08/13 13:34:49 1.14
@@ -94,17 +94,21 @@
}
-function build_query($showmybugs = false) {
+function build_query($assignedto, $reportedby, $open) {
global $q, $sess, $auth, $querystring, $status, $resolution, $os, $priority,
$severity, $email1, $emailtype1, $emailfield1, $Title, $Description, $URL,
$Title_type, $Description_type, $URL_type, $projects, $versions, $components;
// Open bugs assigned to the user -- a hit list
- if ($showmybugs) {
- $q->query("select StatusID from Status where Name in ('Unconfirmed', 'New', 'Assigned', 'Reopened')");
+ if ($assignedto || $reportedby) {
+ $q->query("select StatusID from Status where Name ".($open ? '' : 'not ')."in ('Unconfirmed', 'New', 'Assigned', 'Reopened')");
while ($statusid = $q->grab_field()) $status[] = $statusid;
$query[] = 'Status in ('.delimit_list(',',$status).')';
- $query[] = "AssignedTo = {$auth->auth['uid']}";
+ if ($assignedto) {
+ $query[] = "AssignedTo = {$auth->auth['uid']}";
+ } else {
+ $query[] = "Bug.CreatedBy = {$auth->auth['uid']}";
+ }
} else {
// Select boxes
if ($status) $flags[] = 'Status in ('.delimit_list(',',$status).')';
@@ -152,7 +156,7 @@
if (!$sess->is_registered('querystring')) $sess->register('querystring');
}
-function list_items($showmybugs = false) {
+function list_items($assignedto = 0, $reportedby = 0, $open = 0) {
global $querystring, $me, $q, $t, $selrange, $order, $sort, $query,
$page, $op, $select, $TITLE, $STRING, $savedqueryname, $u;
@@ -165,7 +169,7 @@
$q->query("insert into SavedQuery (UserID, SavedQueryName, SavedQueryString) values ($u, '$savedqueryname', '$savedquerystring')");
}
if (!$order) { $order = 'BugID'; $sort = 'asc'; }
- if (!$querystring or $op) build_query($showmybugs);
+ if (!$querystring or $op) build_query($assignedto, $reportedby, $open);
$nr = $q->grab_field("select count(*) from Bug left join User Owner on Bug.AssignedTo = Owner.UserID left join User Reporter on Bug.CreatedBy = Reporter.UserID ".($querystring != '' ? "where $querystring": ''));
list($selrange, $llimit, $npages, $pages) = multipages($nr,$page,
@@ -234,10 +238,10 @@
case 'query' : show_query(); break;
case 'doquery' : list_items(); break;
case 'delquery' : delete_saved_query($queryid); break;
- case 'mybugs' : list_items(true); break;
+ case 'mybugs' : list_items($assignedto, $reportedby, $open); break;
default : show_query(); break;
}
-else list_items();
+else list_items($assignedto, $reportedby, $open);
$t->pparse('main',array('content','wrap','main'));
|