From ad1ac4b2eb466e764e0218bf346b3d72a1c78d39 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 18 May 2004 01:39:00 +0000 Subject: [PATCH] Add new/pending STRs to account page. Fix auth bug - was resetting the cookies to the wrong value. Add common STR definitions file. Add DB building script. --- www/account.php | 63 ++++++++++++++++++++++++++++- www/data/makedb | 5 +++ www/phplib/auth.php | 6 +-- www/phplib/html.php | 12 +++--- www/phplib/str.php | 86 ++++++++++++++++++++++++++++++++++++++++ www/str.php | 96 +++++++++++---------------------------------- 6 files changed, 184 insertions(+), 84 deletions(-) create mode 100755 www/data/makedb create mode 100644 www/phplib/str.php diff --git a/www/account.php b/www/account.php index 8130c67..4e062b0 100644 --- a/www/account.php +++ b/www/account.php @@ -1,7 +1,8 @@ New/Pending\n"); + $email = db_escape($_COOKIE["FROM"]); + print("

New/Pending Articles:

\n"); + print("

No new/pending articles found.

\n"); + print("

New/Pending STRs:

\n"); + $result = db_query("SELECT * FROM str WHERE status >= $STR_STATUS_PENDING " + ."AND (manager_email == '' OR manager_email = '$email') " + ."ORDER BY status DESC, priority DESC, scope DESC, " + ."modify_date"); + $count = db_count($result); + + if ($count == 0) + print("

No new/pending STRs found.

\n"); + else + { + html_start_table(array("Id", "Priority", "Status", "Scope", + "Summary", "Version", "Last Updated", + "Assigned To")); + + while ($row = db_next($result)) + { + $date = date("M d, Y", $row['modify_date']); + $summary = htmlspecialchars($row['summary'], ENT_QUOTES); + $summabbr = htmlspecialchars(abbreviate($row['summary'], 80), ENT_QUOTES); + $prtext = $priority_text[$row['priority']]; + $sttext = $status_text[$row['status']]; + $sctext = $scope_text[$row['scope']]; + + html_start_row(); + + print("" + ."" + ."$row[id]" + ."$prtext" + ."$sttext" + ."$sctext" + ."$summabbr" + ."$row[str_version]" + ."$date"); + + if ($row['manager_email'] != "") + $email = sanitize_email($row['manager_email']); + else + $email = "Unassigned"; + + print("$email"); + + html_end_row(); + } + + html_end_table(); + } + + db_free($result); + html_footer(); break; @@ -86,6 +145,6 @@ switch ($op) // -// End of "$Id: account.php,v 1.1 2004/05/17 20:28:52 mike Exp $". +// End of "$Id: account.php,v 1.2 2004/05/18 01:39:00 mike Exp $". // ?> diff --git a/www/data/makedb b/www/data/makedb new file mode 100755 index 0000000..e8ea443 --- /dev/null +++ b/www/data/makedb @@ -0,0 +1,5 @@ +#!/bin/sh + +sqlite mxml.db diff --git a/www/phplib/html.php b/www/phplib/html.php index 0efe2f5..d235ea7 100644 --- a/www/phplib/html.php +++ b/www/phplib/html.php @@ -1,6 +1,6 @@ " ."" - ." " - ."[ Home | " + ."   " + ."[ Home | " ."Documentation | " ."Download | " ."FAQ | " @@ -127,7 +127,7 @@ html_header($title = "") // I - Additional document title ."\n"); print("" - ."" + ."" ."" ."" - ."
"); } @@ -144,7 +144,7 @@ html_footer() print("

" + ."

" ."Copyright 2003-2004 by Michael Sweet. This library is free " ."software; you can redistribute it and/or modify it " ."under the terms of the GNU Library General Public " diff --git a/www/phplib/str.php b/www/phplib/str.php new file mode 100644 index 0000000..53ba3fa --- /dev/null +++ b/www/phplib/str.php @@ -0,0 +1,86 @@ + "Resolved", + 2 => "Unresolved", + 3 => "Active", + 4 => "Pending", + 5 => "New" +); + +$status_long = array( + 1 => "1 - Closed w/Resolution", + 2 => "2 - Closed w/o Resolution", + 3 => "3 - Active", + 4 => "4 - Pending", + 5 => "5 - New" +); + +$priority_text = array( + 1 => "RFE", + 2 => "LOW", + 3 => "MODERATE", + 4 => "HIGH", + 5 => "CRITICAL" +); + +$priority_long = array( + 1 => "1 - Request for Enhancement, e.g. asking for a feature", + 2 => "2 - Low, e.g. a documentation error or undocumented side-effect", + 3 => "3 - Moderate, e.g. unable to compile the software", + 4 => "4 - High, e.g. key functionality not working", + 5 => "5 - Critical, e.g. nothing working at all" +); + +$scope_text = array( + 1 => "MACH", + 2 => "OS", + 3 => "ALL" +); + +$scope_long = array( + 1 => "1 - Specific to a machine", + 2 => "2 - Specific to an operating system", + 3 => "3 - Applies to all machines and operating systems" +); + + +// +// End of "$Id: str.php,v 1.1 2004/05/18 01:39:00 mike Exp $". +// +?> diff --git a/www/str.php b/www/str.php index a1a1589..4ce4f6b 100644 --- a/www/str.php +++ b/www/str.php @@ -1,31 +1,27 @@ "Michael Sweet " ); @@ -67,53 +63,9 @@ $versions = array( "Web Site" ); -$status_text = array( - 1 => "Resolved", - 2 => "Unresolved", - 3 => "Active", - 4 => "Pending", - 5 => "New" -); - -$status_long = array( - 1 => "1 - Closed w/Resolution", - 2 => "2 - Closed w/o Resolution", - 3 => "3 - Active", - 4 => "4 - Pending", - 5 => "5 - New" -); - -$priority_text = array( - 1 => "RFE", - 2 => "LOW", - 3 => "MODERATE", - 4 => "HIGH", - 5 => "CRITICAL" -); - -$priority_long = array( - 1 => "1 - Request for Enhancement, e.g. asking for a feature", - 2 => "2 - Low, e.g. a documentation error or undocumented side-effect", - 3 => "3 - Moderate, e.g. unable to compile the software", - 4 => "4 - High, e.g. key functionality not working", - 5 => "5 - Critical, e.g. nothing working at all" -); - -$scope_text = array( - 1 => "M", - 2 => "OS", - 3 => "ALL" -); - -$scope_long = array( - 1 => "1 - Specific to a machine", - 2 => "2 - Specific to an operating system", - 3 => "3 - Applies to all machines and operating systems" -); - // -// 'notify_creator()' - Notify creator of an STR of changes... +// 'notify_creator()' - Notify creator of a STR of changes... // function @@ -840,17 +792,12 @@ switch ($op) "Summary", "Version", "Last Updated", "Assigned To")); - if ($LOGIN_USER) - $sumlen = 80; - else - $sumlen = 40; - db_seek($result, $index); for ($i = 0; $i < $STR_PAGE_MAX && $row = db_next($result); $i ++) { $date = date("M d, Y", $row['modify_date']); $summary = htmlspecialchars($row['summary'], ENT_QUOTES); - $summabbr = htmlspecialchars(abbreviate($row['summary'], $sumlen), ENT_QUOTES); + $summabbr = htmlspecialchars(abbreviate($row['summary'], 80), ENT_QUOTES); $prtext = $priority_text[$row['priority']]; $sttext = $status_text[$row['status']]; $sctext = $scope_text[$row['scope']]; @@ -976,7 +923,7 @@ switch ($op) print(""); print("

" - ."M = Machine, " + ."MACH = Machine, " ."OS = Operating System." ."

\n"); } @@ -1894,4 +1841,7 @@ switch ($op) break; } +// +// End of "$Id: str.php,v 1.5 2004/05/18 01:39:00 mike Exp $". +// ?>