2004-05-17 02:14:54 +00:00
|
|
|
<?php
|
2004-05-18 01:39:00 +00:00
|
|
|
//
|
2004-05-19 00:57:33 +00:00
|
|
|
// "$Id: str.php,v 1.7 2004/05/19 00:57:33 mike Exp $"
|
2004-05-18 01:39:00 +00:00
|
|
|
//
|
|
|
|
// Software Trouble Report page...
|
|
|
|
//
|
|
|
|
// Contents:
|
|
|
|
//
|
|
|
|
// notify_creator() - Notify creator of a STR of changes...
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
// Include necessary headers...
|
|
|
|
//
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
include_once "phplib/html.php";
|
2004-05-17 03:23:06 +00:00
|
|
|
include_once "phplib/common.php";
|
2004-05-18 01:39:00 +00:00
|
|
|
include_once "phplib/str.php";
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
|
2004-05-18 01:39:00 +00:00
|
|
|
//
|
2004-05-17 02:14:54 +00:00
|
|
|
// String definitions for various things...
|
2004-05-18 01:39:00 +00:00
|
|
|
//
|
|
|
|
|
2004-05-17 02:14:54 +00:00
|
|
|
$managers = array(
|
|
|
|
"mike" => "Michael Sweet <mike@easysw.com>"
|
|
|
|
);
|
|
|
|
|
|
|
|
$messages = array(
|
|
|
|
"Fixed in CVS" =>
|
|
|
|
"Fixed in CVS - the anonymous CVS repository will be updated at "
|
|
|
|
."midnight EST.",
|
|
|
|
"Old STR" =>
|
|
|
|
"This STR has not been updated by the submitter for two or more weeks "
|
|
|
|
."and has been closed as required by the Mini-XML Configuration Management "
|
|
|
|
."Plan. If the issue still requires resolution, please re-submit a new "
|
|
|
|
."STR.",
|
|
|
|
"Unresolvable" =>
|
|
|
|
"We are unable to resolve this problem with the information provided. "
|
|
|
|
."If you discover new information, please file a new STR referencing "
|
|
|
|
."this one."
|
|
|
|
);
|
|
|
|
|
|
|
|
$subsystems = array(
|
|
|
|
"Build Files",
|
|
|
|
"Config Files",
|
|
|
|
"Core API",
|
|
|
|
"Documentation",
|
|
|
|
"Multiple",
|
|
|
|
"mxmldoc",
|
|
|
|
"Sample Programs",
|
|
|
|
"Web Site"
|
|
|
|
);
|
|
|
|
|
|
|
|
$versions = array(
|
|
|
|
"2.0cvs",
|
|
|
|
"1.3",
|
|
|
|
"1.2",
|
|
|
|
"1.1.2",
|
|
|
|
"1.1.1",
|
|
|
|
"1.1",
|
|
|
|
"1.0",
|
|
|
|
"Web Site"
|
|
|
|
);
|
|
|
|
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
//
|
2004-05-18 01:39:00 +00:00
|
|
|
// 'notify_creator()' - Notify creator of a STR of changes...
|
2004-05-17 20:28:52 +00:00
|
|
|
//
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
function
|
|
|
|
notify_creator($id, // I - STR #
|
|
|
|
$what = "updated", // I - Reason for notification
|
|
|
|
$contents = "") // I - Notification message
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
|
|
|
global $priority_long;
|
|
|
|
global $scope_long;
|
|
|
|
global $status_long;
|
2004-05-19 00:57:33 +00:00
|
|
|
global $PHP_SELF, $EMAIL, $PROJECT;
|
2004-05-17 20:28:52 +00:00
|
|
|
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
$result = db_query("SELECT * FROM str WHERE id = $id");
|
|
|
|
if ($result)
|
|
|
|
{
|
|
|
|
$contents = wordwrap($contents);
|
|
|
|
$row = db_next($result);
|
2004-05-17 03:23:06 +00:00
|
|
|
$prtext = $priority_long[$row['priority']];
|
|
|
|
$sttext = $status_long[$row['status']];
|
|
|
|
$sctext = $scope_long[$row['scope']];
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($row['subsystem'] != "")
|
|
|
|
$subsystem = $row['subsystem'];
|
2004-05-17 02:14:54 +00:00
|
|
|
else
|
|
|
|
$subsystem = "Unassigned";
|
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($row['fix_version'] != "")
|
|
|
|
$fix_version = $row['fix_version'];
|
2004-05-17 02:14:54 +00:00
|
|
|
else
|
|
|
|
$fix_version = "Unassigned";
|
|
|
|
|
2004-05-17 21:00:42 +00:00
|
|
|
if ($row['create_user'] != $row['modify_user'] &&
|
|
|
|
$row['create_user'] != $manager)
|
2004-05-19 00:57:33 +00:00
|
|
|
mail($row['create_user'], "$PROJECT STR #$id $what",
|
2004-05-17 02:14:54 +00:00
|
|
|
"Your software trouble report #$id has been $what. You can check\n"
|
|
|
|
."the status of the report and add additional comments and/or files\n"
|
|
|
|
."at the following URL:\n"
|
|
|
|
."\n"
|
2004-05-17 20:28:52 +00:00
|
|
|
." $PHP_SELF?L$id\n"
|
2004-05-17 02:14:54 +00:00
|
|
|
."\n"
|
2004-05-17 03:23:06 +00:00
|
|
|
." Summary: $row[summary]\n"
|
|
|
|
." Version: $row[str_version]\n"
|
2004-05-17 02:14:54 +00:00
|
|
|
." Status: $sttext\n"
|
|
|
|
." Priority: $prtext\n"
|
|
|
|
." Scope: $sctext\n"
|
|
|
|
." Subsystem: $subsystem\n"
|
|
|
|
."Fix Version: $fix_version\n"
|
|
|
|
."\n$contents"
|
|
|
|
."________________________________________________________________\n"
|
2004-05-19 00:57:33 +00:00
|
|
|
."Thank you for using the $PROJECT Software Trouble Report page!",
|
2004-05-17 02:14:54 +00:00
|
|
|
"From: noreply@easysw.com\r\n");
|
|
|
|
|
|
|
|
$ccresult = db_query("SELECT email FROM strcc WHERE str_id = $id");
|
|
|
|
if ($ccresult)
|
|
|
|
{
|
|
|
|
while ($ccrow = db_next($ccresult))
|
|
|
|
{
|
2004-05-19 00:57:33 +00:00
|
|
|
mail($ccrow->email, "$PROJECT STR #$id $what",
|
2004-05-17 02:14:54 +00:00
|
|
|
"Software trouble report #$id has been $what. You can check\n"
|
|
|
|
."the status of the report and add additional comments and/or files\n"
|
|
|
|
."at the following URL:\n"
|
|
|
|
."\n"
|
2004-05-17 20:28:52 +00:00
|
|
|
." $PHP_SELF?L$id\n"
|
2004-05-17 02:14:54 +00:00
|
|
|
."\n"
|
2004-05-17 03:23:06 +00:00
|
|
|
." Summary: $row[summary]\n"
|
|
|
|
." Version: $row[str_version]\n"
|
2004-05-17 02:14:54 +00:00
|
|
|
." Status: $sttext\n"
|
|
|
|
." Priority: $prtext\n"
|
|
|
|
." Scope: $sctext\n"
|
|
|
|
." Subsystem: $subsystem\n"
|
|
|
|
."Fix Version: $fix_version\n"
|
|
|
|
."\n$contents"
|
|
|
|
."________________________________________________________________\n"
|
2004-05-19 00:57:33 +00:00
|
|
|
."Thank you for using the $PROJECT Software Trouble Report page!",
|
2004-05-17 02:14:54 +00:00
|
|
|
"From: noreply@easysw.com\r\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
db_free($ccresult);
|
|
|
|
}
|
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($row['manager_email'] != "")
|
|
|
|
$manager = $row['manager_email'];
|
2004-05-17 02:14:54 +00:00
|
|
|
else
|
2004-05-19 00:57:33 +00:00
|
|
|
$manager = "$EMAIL";
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 21:00:42 +00:00
|
|
|
if ($row['modify_user'] != $manager)
|
2004-05-19 00:57:33 +00:00
|
|
|
mail($manager, "$PROJECT STR #$id $what",
|
2004-05-17 02:14:54 +00:00
|
|
|
"The software trouble report #$id assigned to you has been $what.\n"
|
|
|
|
."You can manage the report and add additional comments and/or files\n"
|
|
|
|
."at the following URL:\n"
|
|
|
|
."\n"
|
2004-05-17 20:28:52 +00:00
|
|
|
." $PHP_SELF?L$id\n"
|
2004-05-17 02:14:54 +00:00
|
|
|
."\n"
|
2004-05-17 03:23:06 +00:00
|
|
|
." Summary: $row[summary]\n"
|
|
|
|
." Version: $row[str_version]\n"
|
2004-05-17 02:14:54 +00:00
|
|
|
." Status: $sttext\n"
|
|
|
|
." Priority: $prtext\n"
|
|
|
|
." Scope: $sctext\n"
|
|
|
|
." Subsystem: $subsystem\n"
|
|
|
|
."Fix Version: $fix_version\n"
|
|
|
|
."\n$contents",
|
|
|
|
"From: noreply@easysw.com\r\n");
|
|
|
|
|
|
|
|
db_free($result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get command-line options...
|
|
|
|
//
|
|
|
|
// Usage: str.php [operation] [options]
|
|
|
|
//
|
|
|
|
// Operations:
|
|
|
|
//
|
|
|
|
// B = Batch update selected STRs
|
|
|
|
// L = List all STRs
|
|
|
|
// L# = List STR #
|
|
|
|
// M# = Modify STR #
|
|
|
|
// T# = Post text for STR #
|
|
|
|
// F# = Post file for STR #
|
|
|
|
// N = Post new STR
|
|
|
|
// U# = Update notification for STR #
|
|
|
|
//
|
|
|
|
// Options:
|
|
|
|
//
|
|
|
|
// I# = Set first STR
|
|
|
|
// P# = Set priority filter
|
|
|
|
// S# = Set status filter
|
|
|
|
// C# = Set scope filter
|
|
|
|
// E# = Set email filter
|
|
|
|
// Qtext = Set search text
|
|
|
|
|
|
|
|
$priority = 0;
|
|
|
|
$status = -2;
|
|
|
|
$scope = 0;
|
|
|
|
$search = "";
|
|
|
|
$index = 0;
|
|
|
|
$femail = 0;
|
|
|
|
|
|
|
|
if ($argc)
|
|
|
|
{
|
|
|
|
$op = $argv[0][0];
|
|
|
|
$id = (int)substr($argv[0], 1);
|
|
|
|
|
|
|
|
if ($op != 'L' && $op != 'M' && $op != 'T' && $op != 'F' &&
|
|
|
|
$op != 'N' && $op != 'U' && $op != 'B')
|
|
|
|
{
|
|
|
|
html_header("STR Error");
|
|
|
|
print("<p>Bad command '$op'!</p>\n");
|
|
|
|
html_footer();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
if (($op == 'M' || $op == 'B') && !$LOGIN_USER)
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
|
|
|
html_header("STR Error");
|
|
|
|
print("<p>The '$op' command is not available to you!</p>\n");
|
|
|
|
html_footer();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (($op == 'M' || $op == 'T' || $op == 'F') && !$id)
|
|
|
|
{
|
|
|
|
html_header("STR Error");
|
|
|
|
print("<p>Command '$op' requires an STR number!</p>\n");
|
|
|
|
html_footer();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($op == 'N' && $id)
|
|
|
|
{
|
|
|
|
html_header("STR Error");
|
|
|
|
print("<p>Command '$op' cannot have an STR number!</p>\n");
|
|
|
|
html_footer();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
for ($i = 1; $i < $argc; $i ++)
|
|
|
|
{
|
|
|
|
$option = substr($argv[$i], 1);
|
|
|
|
|
|
|
|
switch ($argv[$i][0])
|
|
|
|
{
|
|
|
|
case 'P' : // Set priority filter
|
|
|
|
$priority = (int)$option;
|
|
|
|
break;
|
|
|
|
case 'S' : // Set status filter
|
|
|
|
$status = (int)$option;
|
|
|
|
break;
|
|
|
|
case 'C' : // Set scope filter
|
|
|
|
$scope = (int)$option;
|
|
|
|
break;
|
|
|
|
case 'Q' : // Set search text
|
|
|
|
$search = $option;
|
|
|
|
$i ++;
|
|
|
|
while ($i < $argc)
|
|
|
|
{
|
|
|
|
$search .= " $argv[$i]";
|
|
|
|
$i ++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'I' : // Set first STR
|
|
|
|
$index = (int)$option;
|
|
|
|
if ($index < 0)
|
|
|
|
$index = 0;
|
|
|
|
break;
|
|
|
|
case 'E' : // Show only problem reports matching the current email
|
|
|
|
$femail = (int)$option;
|
|
|
|
break;
|
|
|
|
default :
|
|
|
|
html_header("STR Error");
|
|
|
|
print("<p>Bad option '$argv[$i]'!</p>\n");
|
|
|
|
html_footer();
|
|
|
|
exit();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$op = 'L';
|
|
|
|
$id = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($REQUEST_METHOD == "POST")
|
|
|
|
{
|
2004-05-17 03:23:06 +00:00
|
|
|
if (array_key_exists("FPRIORITY", $_POST))
|
|
|
|
$priority = (int)$_POST["FPRIORITY"];
|
|
|
|
if (array_key_exists("FSTATUS", $_POST))
|
|
|
|
$status = (int)$_POST["FSTATUS"];
|
|
|
|
if (array_key_exists("FSCOPE", $_POST))
|
|
|
|
$scope = (int)$_POST["FSCOPE"];
|
|
|
|
if (array_key_exists("FEMAIL", $_POST))
|
|
|
|
$femail = (int)$_POST["FEMAIL"];
|
|
|
|
if (array_key_exists("SEARCH", $_POST))
|
|
|
|
$search = $_POST["SEARCH"];
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$options = "+P$priority+S$status+C$scope+I$index+E$femail+Q" . urlencode($search);
|
|
|
|
|
|
|
|
// B = Batch update selected STRs
|
|
|
|
// L = List all STRs
|
|
|
|
// L# = List STR #
|
|
|
|
// M# = Modify STR #
|
|
|
|
// T# = Post text for STR #
|
|
|
|
// F# = Post file for STR #
|
|
|
|
// N = Post new STR
|
|
|
|
// U# = Update notification for STR #
|
|
|
|
|
|
|
|
switch ($op)
|
|
|
|
{
|
|
|
|
case 'B' : // Batch update selected STRs
|
|
|
|
if ($REQUEST_METHOD != "POST")
|
|
|
|
{
|
|
|
|
header("Location: $PHP_SELF?L$options");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
if (array_key_exists("STATUS", $_POST) &&
|
|
|
|
($_POST["STATUS"] != "" ||
|
|
|
|
$_POST["PRIORITY"] != "" ||
|
|
|
|
$_POST["MANAGER_EMAIL"] != "" ||
|
|
|
|
$_POST["MESSAGE"] != ""))
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
|
|
|
$time = time();
|
2004-05-17 03:23:06 +00:00
|
|
|
$manager_email = db_escape($_POST["MANAGER_EMAIL"]);
|
2004-05-17 21:00:42 +00:00
|
|
|
$modify_user = db_escape($_COOKIE["FROM"]);
|
2004-05-17 03:23:06 +00:00
|
|
|
$message = $_POST["MESSAGE"];
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
if ($message != "")
|
|
|
|
{
|
2004-05-17 03:23:06 +00:00
|
|
|
$contents = db_escape($messages[$message]);
|
2004-05-17 02:14:54 +00:00
|
|
|
$mailmsg = $messages[$message] . "\n\n";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$contents = "";
|
|
|
|
$mailmsg = "";
|
|
|
|
}
|
|
|
|
|
2004-05-17 21:00:42 +00:00
|
|
|
$query = "modify_date = $time, modify_user = '$modify_user'";
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($_POST["STATUS"] != "")
|
|
|
|
$query .= ", status = $_POST[STATUS]";
|
|
|
|
if ($_POST["PRIORITY"] != "")
|
|
|
|
$query .= ", priority = $_POST[PRIORITY]";
|
2004-05-17 02:14:54 +00:00
|
|
|
if ($manager_email != "")
|
|
|
|
$query .= ", manager_email = '$manager_email'";
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
db_query("BEGIN TRANSACTION");
|
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
reset($_POST);
|
|
|
|
while (list($key, $val) = each($_POST))
|
2004-05-17 02:14:54 +00:00
|
|
|
if (substr($key, 0, 3) == "ID_")
|
|
|
|
{
|
|
|
|
$id = (int)substr($key, 3);
|
|
|
|
|
|
|
|
db_query("UPDATE str SET $query WHERE id = $id");
|
|
|
|
|
|
|
|
if ($contents != "")
|
|
|
|
{
|
2004-05-17 20:28:52 +00:00
|
|
|
db_query("INSERT INTO strtext VALUES(NULL,$id,1,'$contents',"
|
2004-05-17 21:00:42 +00:00
|
|
|
."$time,'$modify_user')");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
notify_creator($id, "updated", $mailmsg);
|
|
|
|
}
|
|
|
|
}
|
2004-05-17 20:28:52 +00:00
|
|
|
|
|
|
|
db_query("COMMIT TRANSACTION");
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
header("Location: $PHP_SELF?L$options");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'L' : // List (all) STR(s)
|
|
|
|
if ($id)
|
|
|
|
{
|
|
|
|
html_header("STR #$id");
|
|
|
|
|
|
|
|
$result = db_query("SELECT * FROM str WHERE id = $id");
|
|
|
|
if (db_count($result) != 1)
|
|
|
|
{
|
|
|
|
print("<p><b>Error:</b> STR #$id was not found!</p>\n");
|
|
|
|
html_footer();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
$row = db_next($result);
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
html_start_links(1);
|
2004-05-17 21:00:42 +00:00
|
|
|
html_link("Return to Support", "$PHP_SELF?L$options");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($row['status'] >= $STR_STATUS_ACTIVE)
|
2004-05-17 20:28:52 +00:00
|
|
|
{
|
|
|
|
html_link("Post Text", "$PHP_SELF?T$id$options");
|
|
|
|
html_link("Post File", "$PHP_SELF?F$id$options");
|
|
|
|
}
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
if ($LOGIN_USER)
|
|
|
|
html_link("Modify STR", "$PHP_SELF?M$id$options");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
html_end_links();
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 21:00:42 +00:00
|
|
|
print("<h1>STR #$id</h1>\n");
|
|
|
|
|
|
|
|
$create_user = sanitize_email($row['create_user']);
|
2004-05-17 03:23:06 +00:00
|
|
|
$manager_email = sanitize_email($row['manager_email']);
|
|
|
|
$subsystem = $row['subsystem'];
|
|
|
|
$summary = htmlspecialchars($row['summary'], ENT_QUOTES);
|
|
|
|
$prtext = $priority_long[$row['priority']];
|
|
|
|
$sttext = $status_long[$row['status']];
|
|
|
|
$sctext = $scope_long[$row['scope']];
|
|
|
|
$str_version = $row['str_version'];
|
|
|
|
$fix_version = $row['fix_version'];
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
if ($manager_email == "")
|
|
|
|
$manager_email = "<i>Unassigned</i>";
|
|
|
|
|
|
|
|
if ($subsystem == "")
|
|
|
|
$subsystem = "<i>Unassigned</i>";
|
|
|
|
|
|
|
|
if ($fix_version == "")
|
|
|
|
$fix_version = "<i>Unassigned</i>";
|
|
|
|
|
|
|
|
print("<p><table width='100%' cellpadding='5' cellspacing='0' border='0'>\n");
|
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($row['master_id'] > 0)
|
2004-05-17 02:14:54 +00:00
|
|
|
print("<tr><th align='right'>Duplicate Of:</th>"
|
2004-05-17 03:23:06 +00:00
|
|
|
."<td><a href='$PHP_SELF?L$row[master_id]$options'>STR "
|
|
|
|
."#$row[master_id]</a></td></tr>\n");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
if (!$row['is_published'])
|
2004-05-17 02:14:54 +00:00
|
|
|
print("<tr><TH ALIGN='CENTER' COLSPAN='2'>This STR is "
|
|
|
|
."currently hidden from public view.</td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>Status:</th><td>$sttext</td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>Priority:</th><td>$prtext</td></tr>\n");
|
|
|
|
print("<tr><th align='right'>Scope:</th><td>$sctext</td></tr>\n");
|
|
|
|
print("<tr><th align='right'>Subsystem:</th><td>$subsystem</td></tr>\n");
|
|
|
|
print("<tr><th align='right'>Summary:</th><td>$summary</td></tr>\n");
|
|
|
|
print("<tr><th align='right'>Version:</th><td>$str_version</td></tr>\n");
|
2004-05-17 21:00:42 +00:00
|
|
|
print("<tr><th align='right'>Created By:</th><td>$create_user</td></tr>\n");
|
2004-05-17 02:14:54 +00:00
|
|
|
print("<tr><th align='right'>Assigned To:</th><td>$manager_email</td></tr>\n");
|
|
|
|
print("<tr><th align='right'>Fix Version:</th><td>$fix_version</td></tr>\n");
|
|
|
|
|
2004-05-17 21:00:42 +00:00
|
|
|
if (array_key_exists("FROM", $_COOKIE))
|
2004-05-17 03:23:06 +00:00
|
|
|
$email = htmlspecialchars($_COOKIE["FROM"]);
|
2004-05-17 02:14:54 +00:00
|
|
|
else
|
|
|
|
$email = "";
|
|
|
|
|
|
|
|
print("<tr><th align='right' valign='top'>Update Notification:</th><td>"
|
|
|
|
."<form method='POST' action='$PHP_SELF?U$id$options'>"
|
|
|
|
."<input type='text' size='40' maxsize='128' name='EMAIL' value='$email'>"
|
|
|
|
."<input type='submit' value='Change Notification Status'>"
|
|
|
|
."<br /><input type='radio' name='NOTIFICATION' checked value='ON'>Receive EMails "
|
|
|
|
."<input type='radio' name='NOTIFICATION' value='OFF'>Don't Receive EMails"
|
|
|
|
."</form>"
|
|
|
|
."</td></tr>\n");
|
|
|
|
print("</table></p>\n");
|
|
|
|
|
|
|
|
db_free($result);
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
print("<hr noshade/><p><b>Trouble Report Files:</b></p>\n");
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($row['status'] >= $STR_STATUS_ACTIVE)
|
2004-05-17 20:28:52 +00:00
|
|
|
{
|
|
|
|
html_start_links();
|
|
|
|
html_link("Post File", "$PHP_SELF?F$id$options");
|
|
|
|
html_end_links();
|
|
|
|
}
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
$result = db_query("SELECT * FROM strfile WHERE "
|
|
|
|
."str_id = $id AND is_published = 1");
|
|
|
|
|
|
|
|
if (db_count($result) == 0)
|
|
|
|
print("<p><i>No files</i></p>\n");
|
|
|
|
else
|
|
|
|
{
|
2004-05-17 20:28:52 +00:00
|
|
|
html_start_table(array("Name/Time/Date", "Filename"));
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
while ($row = db_next($result))
|
|
|
|
{
|
2004-05-17 21:00:42 +00:00
|
|
|
$date = date("M d, Y", $row['create_date']);
|
|
|
|
$time = date("H:m", $row['create_date']);
|
|
|
|
$email = sanitize_email($row['create_user']);
|
2004-05-17 03:23:06 +00:00
|
|
|
$filename = htmlspecialchars($row['filename']);
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
html_start_row();
|
|
|
|
print("<td align='center' valign='top'>$email<br />$time $date</td>"
|
2004-05-17 02:14:54 +00:00
|
|
|
."<td align='center' valign='top'>"
|
2004-05-17 20:28:52 +00:00
|
|
|
."<a href='strfiles/$id/$filename'>$filename</a></td>");
|
|
|
|
html_end_row();
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
2004-05-17 20:28:52 +00:00
|
|
|
|
|
|
|
html_end_table();
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
db_free($result);
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
print("<hr noshade/><p><b>Trouble Report Dialog:</b></p>\n");
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($row['status'] >= $STR_STATUS_ACTIVE)
|
2004-05-17 20:28:52 +00:00
|
|
|
{
|
|
|
|
html_start_links();
|
|
|
|
html_link("Post Text", "$PHP_SELF?T$id$options");
|
|
|
|
html_end_links();
|
|
|
|
}
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
$result = db_query("SELECT * FROM strtext WHERE "
|
|
|
|
."str_id = $id AND is_published = 1");
|
|
|
|
|
|
|
|
if (db_count($result) == 0)
|
|
|
|
print("<p><i>No text</i></p>\n");
|
|
|
|
else
|
|
|
|
{
|
2004-05-17 20:28:52 +00:00
|
|
|
html_start_table(array("Name/Time/Date", "Text"));
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
while ($row = db_next($result))
|
|
|
|
{
|
2004-05-17 21:00:42 +00:00
|
|
|
$date = date("M d, Y", $row['create_date']);
|
|
|
|
$time = date("H:m", $row['create_date']);
|
|
|
|
$email = sanitize_email($row['create_user']);
|
2004-05-17 03:23:06 +00:00
|
|
|
$contents = quote_text($row['contents']);
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
html_start_row();
|
|
|
|
print("<td align='center' valign='top'>$email<br />$time $date</td>"
|
|
|
|
."<td valign='top'><tt>$contents</tt></td>");
|
|
|
|
html_end_row();
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
2004-05-17 20:28:52 +00:00
|
|
|
|
|
|
|
html_end_table();
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
db_free($result);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-05-17 21:00:42 +00:00
|
|
|
html_header("Support");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
html_start_links(1);
|
|
|
|
html_link("Post New Software Trouble Report", "$PHP_SELF?N$options'");
|
|
|
|
html_end_links();
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 21:00:42 +00:00
|
|
|
print("<h1>Support</h1>\n");
|
|
|
|
|
2004-05-17 02:14:54 +00:00
|
|
|
print("<form method='POST' action='$PHP_SELF'><p align='center'>"
|
|
|
|
."Search Words: <input type='text' size='60' name='SEARCH' value='$search'>"
|
|
|
|
."<input type='submit' value='Search STRs'></p>\n");
|
|
|
|
|
|
|
|
print("<p align='center'>Priority: <select name='FPRIORITY'>");
|
|
|
|
print("<option value='0'>Don't Care</option>");
|
|
|
|
for ($i = 1; $i <= 5; $i ++)
|
|
|
|
{
|
|
|
|
print("<option value='$i'");
|
|
|
|
if ($priority == $i)
|
|
|
|
print(" selected");
|
|
|
|
print(">$priority_text[$i]</option>");
|
|
|
|
}
|
|
|
|
print("</select>\n");
|
|
|
|
|
|
|
|
print("Status: <select name='FSTATUS'>");
|
|
|
|
print("<option value='0'>Don't Care</option>");
|
|
|
|
if ($status == -1)
|
|
|
|
print("<option value='-1' selected>Closed</option>");
|
|
|
|
else
|
|
|
|
print("<option value='-1'>Closed</option>");
|
|
|
|
if ($status == -2)
|
|
|
|
print("<option value='-2' selected>Open</option>");
|
|
|
|
else
|
|
|
|
print("<option value='-2'>Open</option>");
|
|
|
|
for ($i = 1; $i <= 5; $i ++)
|
|
|
|
{
|
|
|
|
print("<option value='$i'");
|
|
|
|
if ($status == $i)
|
|
|
|
print(" selected");
|
|
|
|
print(">$status_text[$i]</option>");
|
|
|
|
}
|
|
|
|
print("</select>\n");
|
|
|
|
|
|
|
|
print("Scope: <select name='FSCOPE'>");
|
|
|
|
print("<option value='0'>Don't Care</option>");
|
|
|
|
for ($i = 1; $i <= 3; $i ++)
|
|
|
|
{
|
|
|
|
print("<option value='$i'");
|
|
|
|
if ($scope == $i)
|
|
|
|
print(" selected");
|
|
|
|
print(">$scope_text[$i]</option>");
|
|
|
|
}
|
|
|
|
print("</select>\n");
|
|
|
|
|
2004-05-17 21:00:42 +00:00
|
|
|
if (array_key_exists("FROM", $_COOKIE))
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
|
|
|
print("Show: <select name='FEMAIL'>");
|
|
|
|
print("<option value='0'");
|
|
|
|
if (!$femail)
|
|
|
|
print(" selected");
|
|
|
|
print(">All</option>");
|
|
|
|
print("<option value='1'");
|
|
|
|
if ($femail)
|
|
|
|
print(" selected");
|
2004-05-17 20:28:52 +00:00
|
|
|
if ($LOGIN_USER)
|
2004-05-17 02:14:54 +00:00
|
|
|
print(">Mine + Unassigned</option>");
|
|
|
|
else
|
|
|
|
print(">Only Mine</option>");
|
|
|
|
print("</select>\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
print("</p></form>\n");
|
2004-05-17 20:28:52 +00:00
|
|
|
print("<hr noshade/>\n");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
$query = "";
|
|
|
|
$prefix = "WHERE ";
|
|
|
|
|
|
|
|
if ($priority > 0)
|
|
|
|
{
|
|
|
|
$query .= "${prefix}priority = $priority";
|
|
|
|
$prefix = " AND ";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($status > 0)
|
|
|
|
{
|
|
|
|
$query .= "${prefix}status = $status";
|
|
|
|
$prefix = " AND ";
|
|
|
|
}
|
|
|
|
else if ($status == -1) // Show closed
|
|
|
|
{
|
|
|
|
$query .= "${prefix}status <= $STR_STATUS_UNRESOLVED";
|
|
|
|
$prefix = " AND ";
|
|
|
|
}
|
|
|
|
else if ($status == -2) // Show open
|
|
|
|
{
|
|
|
|
$query .= "${prefix}status >= $STR_STATUS_ACTIVE";
|
|
|
|
$prefix = " AND ";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($scope > 0)
|
|
|
|
{
|
|
|
|
$query .= "${prefix}scope = $scope";
|
|
|
|
$prefix = " AND ";
|
|
|
|
}
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
if (!$LOGIN_USER)
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
|
|
|
$query .= "${prefix}is_published = 1";
|
|
|
|
$prefix = " AND ";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($femail)
|
|
|
|
{
|
2004-05-17 21:00:42 +00:00
|
|
|
if (array_key_exists("FROM", $_COOKIE))
|
|
|
|
$email = db_escape($_COOKIE["FROM"]);
|
|
|
|
else
|
|
|
|
$email = "";
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
if ($LOGIN_USER)
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
2004-05-17 21:00:42 +00:00
|
|
|
$query .= "${prefix}(manager_email = '' OR manager_email = '$email')";
|
2004-05-17 02:14:54 +00:00
|
|
|
$prefix = " AND ";
|
|
|
|
}
|
2004-05-17 21:00:42 +00:00
|
|
|
else if ($email != "")
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
2004-05-17 21:00:42 +00:00
|
|
|
$query .= "${prefix}create_user = '$email'";
|
2004-05-17 02:14:54 +00:00
|
|
|
$prefix = " AND ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($search)
|
|
|
|
{
|
|
|
|
$search_string = str_replace("'", " ", $search);
|
|
|
|
$search_string = str_replace("\"", " ", $search_string);
|
|
|
|
$search_string = str_replace("\\", " ", $search_string);
|
|
|
|
$search_string = str_replace("%20", " ", $search_string);
|
|
|
|
$search_string = str_replace("%27", " ", $search_string);
|
|
|
|
$search_string = str_replace(" ", " ", $search_string);
|
|
|
|
$search_words = explode(' ', $search_string);
|
|
|
|
|
|
|
|
// Loop through the array of words, adding them to the
|
|
|
|
$query .= "${prefix}(";
|
|
|
|
$prefix = "";
|
|
|
|
$next = " OR";
|
|
|
|
$logic = "";
|
|
|
|
|
|
|
|
reset($search_words);
|
|
|
|
while ($keyword = current($search_words))
|
|
|
|
{
|
|
|
|
next($search_words);
|
2004-05-17 03:23:06 +00:00
|
|
|
$keyword = db_escape(ltrim(rtrim($keyword)));
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
if (strcasecmp($keyword, 'or') == 0)
|
|
|
|
{
|
|
|
|
$next = ' OR';
|
|
|
|
if ($prefix != '')
|
|
|
|
$prefix = ' OR';
|
|
|
|
}
|
|
|
|
else if (strcasecmp($keyword, 'and') == 0)
|
|
|
|
{
|
|
|
|
$next = ' AND';
|
|
|
|
if ($prefix != '')
|
|
|
|
$prefix = ' AND';
|
|
|
|
}
|
|
|
|
else if (strcasecmp($keyword, 'not') == 0)
|
|
|
|
{
|
|
|
|
$logic = ' NOT';
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ($keyword == (int)$keyword)
|
|
|
|
$idsearch = " OR id = " . (int)$keyword;
|
|
|
|
else
|
|
|
|
$idsearch = "";
|
|
|
|
|
|
|
|
$query .= "$prefix$logic (summary LIKE \"%$keyword%\"$idsearch"
|
|
|
|
." OR subsystem LIKE \"%$keyword%\""
|
|
|
|
." OR str_version LIKE \"%$keyword%\""
|
|
|
|
." OR fix_version LIKE \"%$keyword%\""
|
|
|
|
." OR manager_email LIKE \"%$keyword%\""
|
2004-05-17 21:00:42 +00:00
|
|
|
." OR create_user LIKE \"%$keyword%\")";
|
2004-05-17 02:14:54 +00:00
|
|
|
$prefix = $next;
|
|
|
|
$logic = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$query .= ")";
|
|
|
|
}
|
|
|
|
|
|
|
|
$result = db_query("SELECT * FROM str $query "
|
|
|
|
."ORDER BY status DESC, priority DESC, scope DESC, "
|
|
|
|
."modify_date");
|
|
|
|
$count = db_count($result);
|
|
|
|
|
|
|
|
if ($count == 0)
|
|
|
|
{
|
|
|
|
print("<p>No STRs found.</p>\n");
|
|
|
|
|
|
|
|
if (($priority || $status || $scope) && $search != "")
|
|
|
|
print("<p>[ <a href='$PHP_SELF?L+S0+Q" . urlencode($search)
|
|
|
|
."'>Search for \"<i>$search</i>\" in all STRs</a> ]</p>\n");
|
|
|
|
|
|
|
|
html_footer();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($index >= $count)
|
2004-05-19 00:57:33 +00:00
|
|
|
$index = $count - ($count % $PAGE_MAX);
|
2004-05-17 02:14:54 +00:00
|
|
|
if ($index < 0)
|
|
|
|
$index = 0;
|
|
|
|
|
|
|
|
$start = $index + 1;
|
2004-05-19 00:57:33 +00:00
|
|
|
$end = $index + $PAGE_MAX;
|
2004-05-17 02:14:54 +00:00
|
|
|
if ($end > $count)
|
|
|
|
$end = $count;
|
|
|
|
|
2004-05-19 00:57:33 +00:00
|
|
|
$prev = $index - $PAGE_MAX;
|
2004-05-17 02:14:54 +00:00
|
|
|
if ($prev < 0)
|
|
|
|
$prev = 0;
|
2004-05-19 00:57:33 +00:00
|
|
|
$next = $index + $PAGE_MAX;
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
print("<p>$count STR(s) found, showing $start to $end:</p>\n");
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
if ($LOGIN_USER)
|
2004-05-17 02:14:54 +00:00
|
|
|
print("<form method='POST' action='$PHP_SELF?B$options'>\n");
|
|
|
|
|
2004-05-19 00:57:33 +00:00
|
|
|
if ($count > $PAGE_MAX)
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
2004-05-17 20:28:52 +00:00
|
|
|
print("<p><table border='0' cellspacing='0' cellpadding='0' "
|
|
|
|
."width='100%'>\n");
|
|
|
|
|
|
|
|
print("<tr><td>");
|
2004-05-17 02:14:54 +00:00
|
|
|
if ($index > 0)
|
2004-05-17 20:28:52 +00:00
|
|
|
print("[ <a href='$PHP_SELF?L+P$priority+S$status+C$scope+I$prev+"
|
|
|
|
."E$femail+Q"
|
|
|
|
. urlencode($search)
|
2004-05-19 00:57:33 +00:00
|
|
|
."'>Previous $PAGE_MAX</a> ]");
|
2004-05-17 20:28:52 +00:00
|
|
|
print("</td><td align='right'>");
|
2004-05-17 02:14:54 +00:00
|
|
|
if ($end < $count)
|
2004-05-18 19:58:35 +00:00
|
|
|
{
|
2004-05-19 00:57:33 +00:00
|
|
|
$next_count = min($PAGE_MAX, $count - $end);
|
2004-05-17 20:28:52 +00:00
|
|
|
print("[ <a href='$PHP_SELF?L+P$priority+S$status+C$scope+I$next+"
|
|
|
|
."E$femail+Q"
|
|
|
|
. urlencode($search)
|
2004-05-18 19:58:35 +00:00
|
|
|
."'>Next $next_count</a> ]");
|
|
|
|
}
|
2004-05-17 02:14:54 +00:00
|
|
|
print("</td></tr>\n");
|
2004-05-17 20:28:52 +00:00
|
|
|
print("</table></p>\n");
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
html_start_table(array("Id", "Priority", "Status", "Scope",
|
|
|
|
"Summary", "Version", "Last Updated",
|
|
|
|
"Assigned To"));
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
db_seek($result, $index);
|
2004-05-19 00:57:33 +00:00
|
|
|
for ($i = 0; $i < $PAGE_MAX && $row = db_next($result); $i ++)
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
2004-05-17 03:23:06 +00:00
|
|
|
$date = date("M d, Y", $row['modify_date']);
|
|
|
|
$summary = htmlspecialchars($row['summary'], ENT_QUOTES);
|
2004-05-18 01:39:00 +00:00
|
|
|
$summabbr = htmlspecialchars(abbreviate($row['summary'], 80), ENT_QUOTES);
|
2004-05-17 03:23:06 +00:00
|
|
|
$prtext = $priority_text[$row['priority']];
|
|
|
|
$sttext = $status_text[$row['status']];
|
|
|
|
$sctext = $scope_text[$row['scope']];
|
2004-05-18 19:58:35 +00:00
|
|
|
$link = "<a href='$PHP_SELF?L$row[id]$options' "
|
|
|
|
."alt='STR #$row[id]: $summary'>";
|
2004-05-17 03:23:06 +00:00
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
html_start_row();
|
|
|
|
|
2004-05-19 00:57:33 +00:00
|
|
|
if ($row['is_published'] == 0)
|
|
|
|
$summabbr .= " <img src='images/private.gif' width='16' height='16' "
|
|
|
|
."border='0' align='middle' alt='Private'/>";
|
|
|
|
|
2004-05-17 02:14:54 +00:00
|
|
|
print("<td nowrap>");
|
2004-05-17 20:28:52 +00:00
|
|
|
if ($LOGIN_USER)
|
2004-05-17 03:23:06 +00:00
|
|
|
print("<input type='checkbox' name='ID_$row[id]'>");
|
2004-05-18 19:58:35 +00:00
|
|
|
print("$link$row[id]</a></td>"
|
|
|
|
."<td align='center'>$link$prtext</a></td>"
|
|
|
|
."<td align='center'>$link$sttext</a></td>"
|
|
|
|
."<td align='center'>$link$sctext</a></td>"
|
|
|
|
."<td align='center'>$link$summabbr</a></td>"
|
|
|
|
."<td align='center'>$link$row[str_version]</a></td>"
|
|
|
|
."<td align='center'>$link$date</a></td>");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
if ($row['manager_email'] != "")
|
|
|
|
$email = sanitize_email($row['manager_email']);
|
|
|
|
else
|
|
|
|
$email = "<i>Unassigned</i>";
|
|
|
|
|
2004-05-18 19:58:35 +00:00
|
|
|
print("<td align='center'>$link$email</a></td>");
|
2004-05-17 20:28:52 +00:00
|
|
|
|
|
|
|
html_end_row();
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
if ($row['status'] >= $STR_STATUS_PENDING)
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
|
|
|
$textresult = db_query("SELECT * FROM strtext "
|
2004-05-17 03:23:06 +00:00
|
|
|
."WHERE str_id = $row[id] "
|
2004-05-17 02:14:54 +00:00
|
|
|
."ORDER BY id DESC LIMIT 1");
|
|
|
|
if ($textresult && db_count($textresult) > 0)
|
|
|
|
{
|
|
|
|
$textrow = db_next($textresult);
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
html_start_row();
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 21:00:42 +00:00
|
|
|
$email = sanitize_email($textrow['create_user']);
|
2004-05-17 20:28:52 +00:00
|
|
|
$contents = abbreviate(quote_text($textrow['contents']), 128);
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
print("<td align='center' valign='top' colspan='2'>$email</td>"
|
2004-05-17 20:28:52 +00:00
|
|
|
."<td valign='top' colspan='6' width='100%'>"
|
|
|
|
."<tt>$contents</tt></td>");
|
|
|
|
|
|
|
|
html_end_row();
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
db_free($textresult);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
db_free($result);
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
if ($LOGIN_USER)
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
2004-05-17 20:28:52 +00:00
|
|
|
html_start_row("header");
|
|
|
|
print("<th colspan='8'>");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
print("Status: <select name='STATUS'>"
|
|
|
|
."<option value=''>No Change</option>");
|
|
|
|
for ($i = 1; $i <= 5; $i ++)
|
|
|
|
print("<option value='$i'>$status_text[$i]</option>");
|
|
|
|
print("</select>\n");
|
|
|
|
|
|
|
|
print("Priority: <select name='PRIORITY'>"
|
|
|
|
."<option value=''>No Change</option>");
|
|
|
|
for ($i = 1; $i <= 5; $i ++)
|
|
|
|
print("<option value='$i'>$priority_text[$i]</option>");
|
|
|
|
print("</select>\n");
|
|
|
|
|
|
|
|
print("Assigned To: <select name='MANAGER_EMAIL'>"
|
|
|
|
."<option value=''>No Change</option>");
|
|
|
|
reset($managers);
|
|
|
|
while (list($key, $val) = each($managers))
|
|
|
|
{
|
|
|
|
$temail = htmlspecialchars($val, ENT_QUOTES);
|
|
|
|
$temp = sanitize_email($val);
|
|
|
|
print("<option value='$temail'>$temp</option>");
|
|
|
|
}
|
|
|
|
print("</select>\n");
|
|
|
|
|
|
|
|
print("<br />Text: <select name='MESSAGE'>"
|
|
|
|
."<option value=''>No Message</option>");
|
|
|
|
reset($messages);
|
|
|
|
while (list($key, $val) = each($messages))
|
|
|
|
{
|
|
|
|
$temp = abbreviate($val);
|
|
|
|
print("<option value='$key'>$temp</option>");
|
|
|
|
}
|
|
|
|
print("</select>\n");
|
|
|
|
|
|
|
|
print("<input type='submit' value='Modify Selected STRs'>");
|
2004-05-17 20:28:52 +00:00
|
|
|
print("</th>\n");
|
|
|
|
html_end_row();
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
2004-05-17 20:28:52 +00:00
|
|
|
|
|
|
|
html_end_table();
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-19 00:57:33 +00:00
|
|
|
if ($count > $PAGE_MAX)
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
2004-05-17 20:28:52 +00:00
|
|
|
print("<p><table border='0' cellspacing='0' cellpadding='0' "
|
|
|
|
."width='100%'>\n");
|
|
|
|
|
|
|
|
print("<tr><td>");
|
2004-05-17 02:14:54 +00:00
|
|
|
if ($index > 0)
|
2004-05-17 20:28:52 +00:00
|
|
|
print("[ <a href='$PHP_SELF?L+P$priority+S$status+C$scope+I$prev+"
|
|
|
|
."E$femail+Q"
|
|
|
|
. urlencode($search)
|
2004-05-19 00:57:33 +00:00
|
|
|
."'>Previous $PAGE_MAX</a> ]");
|
2004-05-17 20:28:52 +00:00
|
|
|
print("</td><td align='right'>");
|
2004-05-17 02:14:54 +00:00
|
|
|
if ($end < $count)
|
2004-05-18 19:58:35 +00:00
|
|
|
{
|
2004-05-19 00:57:33 +00:00
|
|
|
$next_count = min($PAGE_MAX, $count - $end);
|
2004-05-17 20:28:52 +00:00
|
|
|
print("[ <a href='$PHP_SELF?L+P$priority+S$status+C$scope+I$next+"
|
|
|
|
."E$femail+Q"
|
|
|
|
. urlencode($search)
|
2004-05-18 19:58:35 +00:00
|
|
|
."'>Next $next_count</a> ]");
|
|
|
|
}
|
2004-05-17 02:14:54 +00:00
|
|
|
print("</td></tr>\n");
|
2004-05-17 20:28:52 +00:00
|
|
|
print("</table></p>\n");
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
if ($LOGIN_USER)
|
2004-05-17 02:14:54 +00:00
|
|
|
print("</form>");
|
|
|
|
|
|
|
|
print("<p>"
|
2004-05-18 01:39:00 +00:00
|
|
|
."MACH = Machine, "
|
2004-05-17 02:14:54 +00:00
|
|
|
."OS = Operating System."
|
|
|
|
."</p>\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
html_footer();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'M' : // Modify STR
|
|
|
|
if ($REQUEST_METHOD == "POST")
|
|
|
|
{
|
2004-05-17 03:23:06 +00:00
|
|
|
if (array_key_exists("STATUS", $_POST))
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
|
|
|
$time = time();
|
2004-05-17 03:23:06 +00:00
|
|
|
$master_id = (int)$_POST["MASTER_ID"];
|
|
|
|
$summary = db_escape($_POST["SUMMARY"]);
|
|
|
|
$subsystem = db_escape($_POST["SUBSYSTEM"]);
|
2004-05-17 21:00:42 +00:00
|
|
|
$create_user = db_escape($_POST["CREATE_EMAIL"]);
|
2004-05-17 03:23:06 +00:00
|
|
|
$manager_email = db_escape($_POST["MANAGER_EMAIL"]);
|
2004-05-17 21:00:42 +00:00
|
|
|
$modify_user = db_escape($_COOKIE["FROM"]);
|
2004-05-17 03:23:06 +00:00
|
|
|
$contents = db_escape(trim($_POST["CONTENTS"]));
|
|
|
|
$message = $_POST["MESSAGE"];
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
db_query("UPDATE str SET "
|
|
|
|
."master_id = $master_id, "
|
2004-05-17 03:23:06 +00:00
|
|
|
."is_published = $_POST[IS_PUBLISHED], "
|
|
|
|
."status = $_POST[STATUS], "
|
|
|
|
."priority = $_POST[PRIORITY], "
|
|
|
|
."scope = $_POST[SCOPE], "
|
2004-05-17 02:14:54 +00:00
|
|
|
."summary = '$summary', "
|
|
|
|
."subsystem = '$subsystem', "
|
2004-05-17 03:23:06 +00:00
|
|
|
."str_version = '$_POST[STR_VERSION]', "
|
|
|
|
."fix_version = '$_POST[FIX_VERSION]', "
|
2004-05-17 21:00:42 +00:00
|
|
|
."create_user = '$create_user', "
|
2004-05-17 02:14:54 +00:00
|
|
|
."manager_email = '$manager_email', "
|
|
|
|
."modify_date = $time, "
|
2004-05-17 21:00:42 +00:00
|
|
|
."modify_user = '$modify_user' "
|
2004-05-17 02:14:54 +00:00
|
|
|
."WHERE id = $id");
|
|
|
|
|
|
|
|
if ($contents != "")
|
|
|
|
{
|
2004-05-17 20:28:52 +00:00
|
|
|
db_query("INSERT INTO strtext VALUES(NULL,$id,1,'$contents',"
|
2004-05-17 21:00:42 +00:00
|
|
|
."$time,'$modify_user')");
|
2004-05-17 03:23:06 +00:00
|
|
|
$contents = trim($_POST["CONTENTS"]) . "\n\n";
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($message != "")
|
|
|
|
{
|
2004-05-17 03:23:06 +00:00
|
|
|
$contents = db_escape($messages[$message]);
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
db_query("INSERT INTO strtext VALUES(NULL,$id,1,'$contents',"
|
2004-05-17 21:00:42 +00:00
|
|
|
."$time,'$modify_user')");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
$contents = $messages[$message] . "\n\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
header("Location: $PHP_SELF?L$id$options");
|
|
|
|
|
|
|
|
notify_creator($id, "updated", $contents);
|
|
|
|
}
|
2004-05-17 03:23:06 +00:00
|
|
|
else if (array_key_exists("FILE_ID", $_POST))
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
|
|
|
db_query("UPDATE strfile SET "
|
2004-05-17 03:23:06 +00:00
|
|
|
."is_published = $_POST[IS_PUBLISHED] "
|
|
|
|
."WHERE id = $_POST[FILE_ID]");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
header("Location: $PHP_SELF?M$id$options");
|
|
|
|
}
|
2004-05-17 03:23:06 +00:00
|
|
|
else if (array_key_exists("TEXT_ID", $_POST))
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
|
|
|
db_query("UPDATE strtext SET "
|
2004-05-17 03:23:06 +00:00
|
|
|
."is_published = $_POST[IS_PUBLISHED] "
|
|
|
|
."WHERE id = $_POST[TEXT_ID]");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
header("Location: $PHP_SELF?M$id$options");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
header("Location: $PHP_SELF?M$id$options");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-05-17 21:00:42 +00:00
|
|
|
html_header("Modify STR #$id");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
html_start_links(1);
|
2004-05-17 21:00:42 +00:00
|
|
|
html_link("Return to Support", "$PHP_SELF?L$options");
|
2004-05-17 20:28:52 +00:00
|
|
|
html_link("Return to STR #$id", "$PHP_SELF?L$id$options");
|
|
|
|
html_link("Post Text", "$PHP_SELF?T$id$options");
|
|
|
|
html_link("Post File", "$PHP_SELF?F$id$options");
|
|
|
|
html_end_links();
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 21:00:42 +00:00
|
|
|
print("<h1>Modify STR #$id</h1>\n");
|
|
|
|
|
2004-05-17 02:14:54 +00:00
|
|
|
$result = db_query("SELECT * FROM str WHERE id = $id");
|
|
|
|
if (db_count($result) != 1)
|
|
|
|
{
|
|
|
|
print("<p><b>Error:</b> STR #$id was not found!</p>\n");
|
|
|
|
html_footer();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
$row = db_next($result);
|
|
|
|
|
2004-05-17 21:00:42 +00:00
|
|
|
$create_user = htmlspecialchars($row['create_user']);
|
2004-05-17 03:23:06 +00:00
|
|
|
$manager_email = htmlspecialchars($row['manager_email']);
|
|
|
|
$summary = htmlspecialchars($row['summary'], ENT_QUOTES);
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
print("<form method='POST' action='$PHP_SELF?M$id$options'>"
|
|
|
|
."<p><table width='100%' cellpadding='5' cellspacing='0' border='0'>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>Duplicate Of:</th>"
|
|
|
|
."<td><input type='text' name='MASTER_ID' "
|
2004-05-17 03:23:06 +00:00
|
|
|
."value='$row[master_id]' size='6'></td></tr>\n");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
print("<tr><th align='right'>Published:</th><td>");
|
|
|
|
print("<select name='IS_PUBLISHED'>");
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($row['is_published'])
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
|
|
|
print("<option value='0'>No</option>");
|
|
|
|
print("<option value='1' selected>Yes</option>");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
print("<option value='0' selected>No</option>");
|
|
|
|
print("<option value='1'>Yes</option>");
|
|
|
|
}
|
|
|
|
print("</select></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>Status:</th><td>");
|
|
|
|
print("<select name='STATUS'>");
|
|
|
|
for ($i = 1; $i <= 5; $i ++)
|
|
|
|
{
|
|
|
|
print("<option value='$i'");
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($row['status'] == $i)
|
2004-05-17 02:14:54 +00:00
|
|
|
print(" selected");
|
|
|
|
print(">$status_long[$i]</option>");
|
|
|
|
}
|
|
|
|
print("</select>\n");
|
|
|
|
print("</td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>Priority:</th><td>");
|
|
|
|
print("<select name='PRIORITY'>");
|
|
|
|
for ($i = 1; $i <= 5; $i ++)
|
|
|
|
{
|
|
|
|
print("<option value='$i'");
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($row['priority'] == $i)
|
2004-05-17 02:14:54 +00:00
|
|
|
print(" selected");
|
|
|
|
print(">$priority_long[$i]</option>");
|
|
|
|
}
|
|
|
|
print("</select></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>Scope:</th><td>");
|
|
|
|
print("<select name='SCOPE'>");
|
|
|
|
for ($i = 1; $i <= 3; $i ++)
|
|
|
|
{
|
|
|
|
print("<option value='$i'");
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($row['scope'] == $i)
|
2004-05-17 02:14:54 +00:00
|
|
|
print(" selected");
|
|
|
|
print(">$scope_long[$i]</option>");
|
|
|
|
}
|
|
|
|
print("</select></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>Subsystem:</th>"
|
|
|
|
."<td><select name='SUBSYSTEM'>"
|
|
|
|
."<option value=''>Unassigned</option>");
|
|
|
|
|
|
|
|
reset($subsystems);
|
|
|
|
while (list($key, $val) = each($subsystems))
|
|
|
|
{
|
|
|
|
print("<option value='$val'");
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($row['subsystem'] == $val)
|
2004-05-17 02:14:54 +00:00
|
|
|
print(" selected");
|
|
|
|
print(">$val</option>");
|
|
|
|
}
|
|
|
|
print("</select></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>Summary:</th>"
|
|
|
|
."<td><input type='text' name='SUMMARY' size='72' "
|
|
|
|
."value='$summary'></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>Version:</th>"
|
|
|
|
."<td><input type='text' name='STR_VERSION' size='16' maxsize='16' "
|
2004-05-17 03:23:06 +00:00
|
|
|
."value='$row[str_version]'></td></tr>\n");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
print("<tr><th align='right'>Created By:</th>"
|
|
|
|
."<td><input type='text' name='CREATE_EMAIL' maxsize='128' "
|
2004-05-17 21:00:42 +00:00
|
|
|
."value='$create_user' size='40'></td></tr>\n");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
print("<tr><th align='right'>Assigned To:</th>"
|
|
|
|
."<td><select name='MANAGER_EMAIL'>"
|
|
|
|
."<option value=''>Unassigned</option>");
|
|
|
|
|
|
|
|
reset($managers);
|
|
|
|
while (list($key, $val) = each($managers))
|
|
|
|
{
|
|
|
|
$temail = htmlspecialchars($val, ENT_QUOTES);
|
|
|
|
$temp = sanitize_email($val);
|
|
|
|
|
|
|
|
print("<option value='$temail'");
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($row['manager_email'] == $val)
|
2004-05-17 02:14:54 +00:00
|
|
|
print(" selected");
|
|
|
|
print(">$temp</option>");
|
|
|
|
}
|
|
|
|
print("</select></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>Fix Version:</th>"
|
|
|
|
."<td><select name='FIX_VERSION'>"
|
|
|
|
."<option value=''>Unassigned</option>"
|
|
|
|
."<option>Not Applicable</option>");
|
|
|
|
|
|
|
|
reset($versions);
|
|
|
|
while (list($key, $val) = each($versions))
|
|
|
|
{
|
|
|
|
print("<option value='$val'");
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($row['fix_version'] == $val)
|
2004-05-17 02:14:54 +00:00
|
|
|
print(" selected");
|
|
|
|
print(">$val</option>");
|
|
|
|
}
|
|
|
|
print("</select></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right' valign='top'>Text:</th><td>");
|
|
|
|
|
|
|
|
print("<select name='MESSAGE'>"
|
|
|
|
."<option value=''>--- Pick a Standard Message ---</option>");
|
|
|
|
|
|
|
|
reset($messages);
|
|
|
|
while (list($key, $val) = each($messages))
|
|
|
|
{
|
|
|
|
$temp = abbreviate($val, 72);
|
|
|
|
print("<option value='$key'>$temp</option>");
|
|
|
|
}
|
|
|
|
print("</select><br />\n");
|
|
|
|
|
|
|
|
print("<textarea name='CONTENTS' COLS='72' ROWS='12' WRAP='VIRTUAL'>"
|
|
|
|
."</textarea></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><TH ALIGN='CENTER' COLSPAN='2'>"
|
|
|
|
."<INPUT type='SUBMIT' value='Update Trouble Report'></th></tr>\n");
|
|
|
|
print("</table></p></form>\n");
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
print("<hr noshade/><p><b>Trouble Report Files:</b> "
|
2004-05-17 02:14:54 +00:00
|
|
|
."[ <a href='$PHP_SELF?F$id$options'>Post File</a> ]"
|
|
|
|
."</p>\n");
|
|
|
|
|
|
|
|
$result = db_query("SELECT * FROM strfile WHERE str_id = $id");
|
|
|
|
|
|
|
|
if (db_count($result) == 0)
|
|
|
|
print("<p><i>No files</i></p>\n");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
print("<p><table width='100%' border='0' cellpadding='5' "
|
|
|
|
."cellspacing='0'>\n"
|
2004-05-17 03:23:06 +00:00
|
|
|
."<tr class='header'><th>Name/Time/Date</th>"
|
2004-05-17 02:14:54 +00:00
|
|
|
."<th>Filename</th></tr>\n");
|
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
$line = 0;
|
2004-05-17 02:14:54 +00:00
|
|
|
while ($row = db_next($result))
|
|
|
|
{
|
2004-05-17 21:00:42 +00:00
|
|
|
$date = date("M d, Y", $row['create_date']);
|
|
|
|
$time = date("H:m", $row['create_date']);
|
|
|
|
$email = sanitize_email($row['create_user']);
|
2004-05-17 03:23:06 +00:00
|
|
|
$filename = htmlspecialchars($row['filename']);
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
print("<tr class='data$line'>"
|
2004-05-17 02:14:54 +00:00
|
|
|
."<td align='center' valign='top'>$email<br />$time $date<br />"
|
|
|
|
."<form method='POST' action='$PHP_SELF?M$id$options'>"
|
2004-05-17 03:23:06 +00:00
|
|
|
."<input type='hidden' name='FILE_ID' value='$row[id]'>");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($row['is_published'])
|
2004-05-17 02:14:54 +00:00
|
|
|
print("<input type='hidden' name='IS_PUBLISHED' value='0'>"
|
|
|
|
."<input type='submit' value='Hide'>");
|
|
|
|
else
|
|
|
|
print("<input type='hidden' name='IS_PUBLISHED' value='1'>"
|
|
|
|
."<input type='submit' value='Show'>");
|
|
|
|
|
|
|
|
print("</form></td>"
|
|
|
|
."<td align='center' valign='top'>"
|
|
|
|
."<a href='strfiles/$id/$filename'>$filename</a></td>"
|
|
|
|
."</tr>\n");
|
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
$line = 1 - $line;
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
|
|
|
print("</table></p>\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
db_free($result);
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
print("<hr noshade/><p><b>Trouble Report Dialog:</b> "
|
2004-05-17 02:14:54 +00:00
|
|
|
."[ <a href='$PHP_SELF?T$id$options'>Post Text</a> ]"
|
|
|
|
."</p>\n");
|
|
|
|
|
|
|
|
$result = db_query("SELECT * FROM strtext WHERE "
|
|
|
|
."str_id = $id");
|
|
|
|
|
|
|
|
if (db_count($result) == 0)
|
|
|
|
print("<p><i>No text</i></p>\n");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
print("<p><table width='100%' border='0' cellpadding='5' "
|
|
|
|
."cellspacing='0'>\n"
|
2004-05-17 03:23:06 +00:00
|
|
|
."<tr class='header'><th>Name/Time/Date</th>"
|
2004-05-17 02:14:54 +00:00
|
|
|
."<th>Text</th></tr>\n");
|
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
$line = 0;
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
while ($row = db_next($result))
|
|
|
|
{
|
2004-05-17 21:00:42 +00:00
|
|
|
$date = date("M d, Y", $row['create_date']);
|
|
|
|
$time = date("H:m", $row['create_date']);
|
|
|
|
$email = sanitize_email($row['create_user']);
|
2004-05-17 03:23:06 +00:00
|
|
|
$contents = quote_text($row['contents']);
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
print("<tr class='data$line'>"
|
2004-05-17 02:14:54 +00:00
|
|
|
."<td align='center' valign='top'>$email<br />$time $date<br />"
|
|
|
|
."<form method='POST' action='$PHP_SELF?M$id$options'>"
|
2004-05-17 03:23:06 +00:00
|
|
|
."<input type='hidden' name='TEXT_ID' value='$row[id]'>");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
if ($row['is_published'])
|
2004-05-17 02:14:54 +00:00
|
|
|
print("<input type='hidden' name='IS_PUBLISHED' value='0'>"
|
|
|
|
."<input type='submit' value='Hide'>");
|
|
|
|
else
|
|
|
|
print("<input type='hidden' name='IS_PUBLISHED' value='1'>"
|
|
|
|
."<input type='submit' value='Show'>");
|
|
|
|
|
|
|
|
print("</form></td>"
|
|
|
|
."<td valign='top'><tt>$contents</tt></td>"
|
|
|
|
."</tr>\n");
|
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
$line = 1 - $line;
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
|
|
|
print("</table></p>\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
db_free($result);
|
|
|
|
|
|
|
|
html_footer();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'T' : // Post text for STR #
|
|
|
|
if ($REQUEST_METHOD == "POST")
|
|
|
|
{
|
2004-05-17 03:23:06 +00:00
|
|
|
$contents = $_POST["CONTENTS"];
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
if (array_key_exists("EMAIL", $_POST))
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
2004-05-17 03:23:06 +00:00
|
|
|
$email = $_POST["EMAIL"];
|
2004-05-17 02:14:54 +00:00
|
|
|
setcookie("FROM", "$email", time() + 57600, $PHP_SELF, $SERVER_NAME);
|
|
|
|
}
|
2004-05-17 03:23:06 +00:00
|
|
|
else if (array_key_exists("FROM", $_COOKIE))
|
|
|
|
$email = $_COOKIE["FROM"];
|
2004-05-17 02:14:54 +00:00
|
|
|
else
|
|
|
|
$email = "";
|
|
|
|
|
|
|
|
if (ereg("Anonymous.*", $email))
|
|
|
|
$email = "";
|
|
|
|
|
|
|
|
if ($email != "" && $contents != "")
|
|
|
|
$havedata = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-05-17 21:00:42 +00:00
|
|
|
if (array_key_exists("FROM", $_COOKIE))
|
|
|
|
$email = $_COOKIE["FROM"];
|
2004-05-17 02:14:54 +00:00
|
|
|
else
|
2004-05-17 21:00:42 +00:00
|
|
|
$email = "";
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
$contents = "";
|
|
|
|
|
|
|
|
if (ereg("Anonymous.*", $email))
|
|
|
|
$email = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($REQUEST_METHOD == "POST" && $havedata)
|
|
|
|
{
|
|
|
|
$time = time();
|
2004-05-17 03:23:06 +00:00
|
|
|
$temail = db_escape($email);
|
|
|
|
$tcontents = db_escape($contents);
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
db_query("INSERT INTO strtext VALUES(NULL,$id,1,'$tcontents',"
|
|
|
|
."$time,'$temail')");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 21:00:42 +00:00
|
|
|
db_query("UPDATE str SET modify_date=$time, modify_user='$temail' "
|
2004-05-17 02:14:54 +00:00
|
|
|
."WHERE id = $id");
|
|
|
|
db_query("UPDATE str SET status=$STR_STATUS_PENDING WHERE "
|
|
|
|
."id = $id AND status >= $STR_STATUS_ACTIVE AND "
|
|
|
|
."status < $STR_STATUS_NEW");
|
|
|
|
|
|
|
|
header("Location: $PHP_SELF?L$id$options");
|
|
|
|
|
|
|
|
notify_creator($id, "updated", "$contents\n\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
html_header("Post Text For STR #$id");
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
html_start_links(1);
|
|
|
|
html_link("Return to STR #$id", "$PHP_SELF?L$id$options");
|
|
|
|
html_end_links();
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 21:00:42 +00:00
|
|
|
print("<h1>Post Text for STR #$id</h1>\n");
|
|
|
|
|
2004-05-17 02:14:54 +00:00
|
|
|
if ($REQUEST_METHOD == "POST")
|
|
|
|
{
|
|
|
|
print("<p><b>Error:</b> Please fill in the fields marked in "
|
|
|
|
."<b><font color='red'>bold red</font></b> below and resubmit "
|
2004-05-17 20:28:52 +00:00
|
|
|
."your trouble report.</p><hr noshade/>\n");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
$hstart = "<font color='red'>";
|
|
|
|
$hend = "</font>";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-05-17 20:28:52 +00:00
|
|
|
print("<hr noshade/>\n");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
$hstart = "";
|
|
|
|
$hend = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
print("<form method='POST' action='$PHP_SELF?T$id$options'>"
|
|
|
|
."<p><table width='100%' cellpadding='5' cellspacing='0' border='0'>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>");
|
|
|
|
if ($email != "")
|
|
|
|
print("EMail:</th><td>");
|
|
|
|
else
|
|
|
|
print("${hstart}EMail:$hend</th><td>");
|
|
|
|
|
|
|
|
$temp = htmlspecialchars($email);
|
|
|
|
print("<input type='text' name='EMAIL' value='$temp' size='40' "
|
|
|
|
."maxsize='128'></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right' valign='top'>");
|
|
|
|
if ($contents != "")
|
|
|
|
print("Text:</th><td>");
|
|
|
|
else
|
|
|
|
print("${hstart}Text:$hend</th><td>");
|
|
|
|
|
|
|
|
$temp = htmlspecialchars($contents);
|
|
|
|
print("<textarea name='CONTENTS' cols='72' rows='12' wrap='virtual'>"
|
|
|
|
."$temp</textarea></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='center' colspan='2'>"
|
|
|
|
."<input type='submit' value='Post Text to Trouble Report'></th></tr>\n");
|
|
|
|
print("</table></p></form>\n");
|
|
|
|
html_footer();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'F' : // Post file for STR #
|
|
|
|
if ($REQUEST_METHOD == "POST")
|
|
|
|
{
|
2004-05-17 03:23:06 +00:00
|
|
|
if (array_key_exists("EMAIL", $_POST))
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
2004-05-17 03:23:06 +00:00
|
|
|
$email = $_POST["EMAIL"];
|
2004-05-17 02:14:54 +00:00
|
|
|
setcookie("FROM", "$email", time() + 57600, $PHP_SELF, $SERVER_NAME);
|
|
|
|
}
|
2004-05-17 03:23:06 +00:00
|
|
|
else if (array_key_exists("FROM", $_COOKIE))
|
|
|
|
$email = $_COOKIE["FROM"];
|
2004-05-17 02:14:54 +00:00
|
|
|
else
|
|
|
|
$email = "";
|
|
|
|
|
|
|
|
if (ereg("Anonymous.*", $email))
|
|
|
|
$email = "";
|
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
if (array_key_exists("STRFILE", $_FILES))
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
2004-05-17 03:23:06 +00:00
|
|
|
$filename = $_FILES['STRFILE']['name'];
|
2004-05-17 02:14:54 +00:00
|
|
|
if ($filename[0] == '.' || $filename[0] == '/')
|
|
|
|
$filename = "";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
$filename = "";
|
|
|
|
|
|
|
|
if ($email != "" && $filename != "")
|
|
|
|
$havedata = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-05-17 21:00:42 +00:00
|
|
|
if (array_key_exists("FROM", $_COOKIE))
|
|
|
|
$email = $_COOKIE["FROM"];
|
2004-05-17 02:14:54 +00:00
|
|
|
else
|
2004-05-17 21:00:42 +00:00
|
|
|
$email = "";
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
$filename = "";
|
|
|
|
|
|
|
|
if (ereg("Anonymous.*", $email))
|
|
|
|
$email = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($REQUEST_METHOD == "POST" && $havedata)
|
|
|
|
{
|
|
|
|
$time = time();
|
2004-05-17 03:23:06 +00:00
|
|
|
$temail = db_escape($email);
|
|
|
|
$tmp_name = $_FILES['STRFILE']['tmp_name'];
|
|
|
|
$name = $_FILES['STRFILE']['name'];
|
|
|
|
$tname = db_escape($name);
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
$infile = fopen($tmp_name, "rb");
|
|
|
|
|
|
|
|
if (!$infile)
|
|
|
|
{
|
|
|
|
html_header("Error");
|
|
|
|
print("<p><b>Error!</b> Unable to open file attachment!</p>\n");
|
|
|
|
html_footer();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
mkdir("strfiles/$id");
|
|
|
|
$outfile = fopen("strfiles/$id/$name", "wb");
|
|
|
|
|
|
|
|
if (!$outfile)
|
|
|
|
{
|
|
|
|
html_header("Error");
|
|
|
|
print("<p><b>Error!</b> Unable to save file attachment!</p>\n");
|
|
|
|
html_footer();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
while ($data = fread($infile, 8192))
|
|
|
|
fwrite($outfile, $data);
|
|
|
|
|
|
|
|
fclose($infile);
|
|
|
|
fclose($outfile);
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
db_query("INSERT INTO strfile VALUES(NULL,$id,1,'$tname',"
|
|
|
|
."$time,'$temail')");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 21:00:42 +00:00
|
|
|
db_query("UPDATE str SET modify_date=$time, modify_user='$temail' "
|
2004-05-17 02:14:54 +00:00
|
|
|
."WHERE id = $id");
|
|
|
|
db_query("UPDATE str SET status=$STR_STATUS_PENDING WHERE "
|
|
|
|
."id = $id AND status >= $STR_STATUS_ACTIVE AND "
|
|
|
|
."status < $STR_STATUS_NEW");
|
|
|
|
|
|
|
|
header("Location: $PHP_SELF?L$id$options");
|
|
|
|
|
|
|
|
notify_creator($id, "updated", "Added file $name\n\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
html_header("Post File For STR #$id");
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
html_start_links(1);
|
|
|
|
html_link("Return to STR #$id", "$PHP_SELF?L$id$options");
|
|
|
|
html_end_links();
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 21:00:42 +00:00
|
|
|
print("<h1>Post File For STR #$id</h1>\n");
|
|
|
|
|
2004-05-17 02:14:54 +00:00
|
|
|
if ($REQUEST_METHOD == "POST")
|
|
|
|
{
|
|
|
|
print("<p><b>Error:</b> Please fill in the fields marked in "
|
|
|
|
."<b><font color='red'>bold red</font></b> below and resubmit "
|
2004-05-17 20:28:52 +00:00
|
|
|
."your trouble report.</p><hr noshade/>\n");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
$hstart = "<font color='red'>";
|
|
|
|
$hend = "</font>";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-05-17 20:28:52 +00:00
|
|
|
print("<hr noshade/>\n");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
$hstart = "";
|
|
|
|
$hend = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
print("<form method='POST' action='$PHP_SELF?F$id$options' "
|
|
|
|
."enctype='multipart/form-data'>"
|
|
|
|
."<input type='hidden' name='MAX_FILE_SIZE' value='10000000'>");
|
|
|
|
|
|
|
|
print("<p><table width='100%' cellpadding='5' cellspacing='0' "
|
|
|
|
."border='0'>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>");
|
|
|
|
if ($email != "")
|
|
|
|
print("EMail:</th><td>");
|
|
|
|
else
|
|
|
|
print("${hstart}EMail:$hend</th><td>");
|
|
|
|
|
|
|
|
$temp = htmlspecialchars($email);
|
|
|
|
print("<input type='text' name='EMAIL' value='$temp' size='40' "
|
|
|
|
."maxsize='128'></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right' valign='top'>");
|
2004-05-17 03:23:06 +00:00
|
|
|
if (array_key_exists("STRFILE", $_FILES))
|
2004-05-17 02:14:54 +00:00
|
|
|
print("File:</th><td>");
|
|
|
|
else
|
|
|
|
print("${hstart}File:$hend</th><td>");
|
|
|
|
|
|
|
|
print("<input name='STRFILE' type='FILE'></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='center' colspan='2'>"
|
|
|
|
."<input type='submit' value='Post File to Trouble Report'></th></tr>\n");
|
|
|
|
print("</table></p></form>\n");
|
|
|
|
html_footer();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'N' : // Post new STR
|
|
|
|
$havedata = 0;
|
|
|
|
|
|
|
|
if ($REQUEST_METHOD == "POST")
|
|
|
|
{
|
2004-05-17 03:23:06 +00:00
|
|
|
$npriority = $_POST["PRIORITY"];
|
|
|
|
$nscope = $_POST["SCOPE"];
|
|
|
|
$summary = $_POST["SUMMARY"];
|
|
|
|
$version = $_POST["VERSION"];
|
|
|
|
$contents = $_POST["CONTENTS"];
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
if (array_key_exists("EMAIL", $_POST))
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
2004-05-17 03:23:06 +00:00
|
|
|
$email = $_POST["EMAIL"];
|
2004-05-17 20:28:52 +00:00
|
|
|
setcookie("FROM", "$email", time() + 90 * 86400, "/");
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
2004-05-17 03:23:06 +00:00
|
|
|
else if (array_key_exists("FROM", $_COOKIE))
|
|
|
|
$email = $_COOKIE["FROM"];
|
2004-05-17 02:14:54 +00:00
|
|
|
else
|
|
|
|
$email = "";
|
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
if (array_key_exists("STRFILE", $_FILES))
|
2004-05-17 02:14:54 +00:00
|
|
|
{
|
2004-05-17 03:23:06 +00:00
|
|
|
$filename = $_FILES['STRFILE']['name'];
|
2004-05-17 02:14:54 +00:00
|
|
|
if ($filename[0] == '.' || $filename[0] == '/')
|
|
|
|
$filename = "";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
$filename = "";
|
|
|
|
|
|
|
|
if ($npriority && $nscope && $summary != "" && $email != "" &&
|
|
|
|
$version != "" && $contents != "")
|
|
|
|
$havedata = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-05-17 20:28:52 +00:00
|
|
|
if (array_key_exists("FROM", $_COOKIE))
|
|
|
|
$email = $_COOKIE["FROM"];
|
2004-05-17 02:14:54 +00:00
|
|
|
else
|
2004-05-17 20:28:52 +00:00
|
|
|
$email = "";
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
$npriority = 0;
|
|
|
|
$nscope = 0;
|
|
|
|
$summary = "";
|
|
|
|
$version = "";
|
|
|
|
$contents = "";
|
|
|
|
$filename = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ereg("Anonymous.*", $email))
|
|
|
|
$email = "";
|
|
|
|
|
|
|
|
if ($REQUEST_METHOD == "POST" && $havedata)
|
|
|
|
{
|
|
|
|
$time = time();
|
2004-05-17 03:23:06 +00:00
|
|
|
$temail = db_escape($email);
|
|
|
|
$tsummary = db_escape($summary);
|
|
|
|
$tcontents = db_escape($contents);
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
db_query("INSERT INTO str VALUES(NULL,0,"
|
|
|
|
."$_POST[IS_PUBLISHED],$STR_STATUS_NEW,"
|
2004-05-17 02:14:54 +00:00
|
|
|
."$npriority,$nscope,'$tsummary','','$version','','',"
|
|
|
|
."$time,'$temail',$time,'$temail')");
|
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
$id = db_insert_id();
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
db_query("INSERT INTO strtext VALUES(NULL,$id,1,'$tcontents',"
|
|
|
|
."$time,'$temail')");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
if ($filename != "")
|
|
|
|
{
|
2004-05-17 03:23:06 +00:00
|
|
|
$tmp_name = $_FILES['STRFILE']['tmp_name'];
|
|
|
|
$name = $_FILES['STRFILE']['name'];
|
|
|
|
$tname = db_escape($name);
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
$infile = fopen($tmp_name, "rb");
|
|
|
|
|
|
|
|
if (!$infile)
|
|
|
|
{
|
|
|
|
html_header("Error");
|
|
|
|
print("<p><b>Error!</b> Unable to open file attachment!</p>\n");
|
|
|
|
html_footer();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
mkdir("strfiles/$id");
|
|
|
|
$outfile = fopen("strfiles/$id/$name", "wb");
|
|
|
|
|
|
|
|
if (!$outfile)
|
|
|
|
{
|
|
|
|
html_header("Error");
|
|
|
|
print("<p><b>Error!</b> Unable to save file attachment!</p>\n");
|
|
|
|
html_footer();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
while ($data = fread($infile, 8192))
|
|
|
|
fwrite($outfile, $data);
|
|
|
|
|
|
|
|
fclose($infile);
|
|
|
|
fclose($outfile);
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
db_query("INSERT INTO strfile VALUES(NULL,$id,1,'$tname',"
|
|
|
|
."$time,'$temail')");
|
2004-05-17 02:14:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
header("Location: $PHP_SELF?L$id$options");
|
|
|
|
notify_creator($id, "created", "$contents\n\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-05-17 21:00:42 +00:00
|
|
|
html_header("Post New Software Trouble Report");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
html_start_links(1);
|
2004-05-17 21:00:42 +00:00
|
|
|
html_link("Return to Support", "$PHP_SELF?L$options");
|
2004-05-17 20:28:52 +00:00
|
|
|
html_end_links();
|
2004-05-17 02:14:54 +00:00
|
|
|
|
2004-05-17 21:00:42 +00:00
|
|
|
print("<h1>Post New Software Trouble Report</h1>\n");
|
|
|
|
|
2004-05-17 02:14:54 +00:00
|
|
|
if ($REQUEST_METHOD == "POST")
|
|
|
|
{
|
|
|
|
print("<p><b>Error:</b> Please fill in the fields marked in "
|
|
|
|
."<b><font color='red'>bold red</font></b> below and resubmit "
|
2004-05-17 20:28:52 +00:00
|
|
|
."your trouble report.</p><hr noshade/>\n");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
$hstart = "<font color='red'>";
|
|
|
|
$hend = "</font>";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-05-17 03:23:06 +00:00
|
|
|
print("<p>Please use this form to report all bugs and request "
|
2004-05-19 00:57:33 +00:00
|
|
|
."features in the $PROJECT software. Be sure to include "
|
2004-05-17 03:23:06 +00:00
|
|
|
."the operating system, compiler, sample programs and/or "
|
|
|
|
."files, and any other information you can about your "
|
2004-05-17 20:28:52 +00:00
|
|
|
."problem. <i>Thank you</i> for helping us to improve "
|
2004-05-19 00:57:33 +00:00
|
|
|
."$PROJECT!</p><hr noshade/>\n");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
$hstart = "";
|
|
|
|
$hend = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
print("<form method='POST' action='$PHP_SELF?N$options' "
|
|
|
|
."enctype='multipart/form-data'>"
|
|
|
|
."<input type='hidden' name='MAX_FILE_SIZE' value='10000000'>");
|
|
|
|
|
|
|
|
print("<p><table width='100%' cellpadding='5' cellspacing='0' "
|
|
|
|
."border='0'>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>Security Advisory:</th><td>"
|
|
|
|
."<select name='IS_PUBLISHED'>"
|
|
|
|
."<option value='1' selected>No, make this STR publicly available.</option>"
|
|
|
|
."<option value='0'>Yes, hide this STR from public view.</option>"
|
|
|
|
."</select></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>Status:</th><td>5 - New</td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right' valign='top'>");
|
|
|
|
if ($npriority > 0)
|
|
|
|
print("Priority:</th><td nowrap>");
|
|
|
|
else
|
|
|
|
print("${hstart}Priority:$hend</th><td nowrap>");
|
|
|
|
for ($i = 1; $i <= 5; $i ++)
|
|
|
|
{
|
|
|
|
print("<input type='radio' name='PRIORITY' value='$i'");
|
|
|
|
if ($npriority == $i)
|
|
|
|
print(" checked");
|
|
|
|
print(">$priority_long[$i]<br />");
|
|
|
|
}
|
|
|
|
print("</td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right' valign='top'>");
|
|
|
|
if ($nscope > 0)
|
|
|
|
print("Scope:</th><td>");
|
|
|
|
else
|
|
|
|
print("${hstart}Scope:$hend</th><td>");
|
|
|
|
for ($i = 1; $i <= 3; $i ++)
|
|
|
|
{
|
|
|
|
print("<input type='radio' name='SCOPE' value='$i'");
|
|
|
|
if ($nscope == $i)
|
|
|
|
print(" checked");
|
|
|
|
print(">$scope_long[$i]<br />");
|
|
|
|
}
|
|
|
|
print("</td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>Subsystem:</th><td><i>Unassigned</i></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>");
|
|
|
|
if ($summary != "")
|
|
|
|
print("Summary:</th><td>");
|
|
|
|
else
|
|
|
|
print("${hstart}Summary:$hend</th><td>");
|
|
|
|
|
|
|
|
$temp = htmlspecialchars($summary, ENT_QUOTES);
|
|
|
|
print("<input type='text' name='SUMMARY' size='72' value='$temp'></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>");
|
|
|
|
if ($version != "")
|
|
|
|
print("Version:</th><td>");
|
|
|
|
else
|
|
|
|
print("${hstart}Version:$hend</th><td>");
|
|
|
|
|
|
|
|
print("<select name='VERSION'>"
|
|
|
|
."<option value=''>Select a Version Number</option>");
|
|
|
|
|
|
|
|
reset($versions);
|
|
|
|
while (list($key, $val) = each($versions))
|
|
|
|
{
|
|
|
|
print("<option value='$val'");
|
|
|
|
if ($version == $val)
|
|
|
|
print(" selected");
|
|
|
|
print(">$val</option>");
|
|
|
|
}
|
|
|
|
|
|
|
|
print("</select></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>");
|
|
|
|
if ($email != "")
|
|
|
|
print("EMail:</th><td>");
|
|
|
|
else
|
|
|
|
print("${hstart}EMail:$hend</th><td>");
|
|
|
|
|
|
|
|
$temp = htmlspecialchars($email);
|
|
|
|
print("<input type='text' name='EMAIL' value='$temp' size='40' "
|
|
|
|
."maxsize='128'></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>Assigned To:</th><td><i>Unassigned</i></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right'>Fix Version:</th><td><i>Unassigned</i></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right' valign='top'>");
|
|
|
|
if ($contents != "")
|
|
|
|
print("Detailed Description of Problem:</th><td>");
|
|
|
|
else
|
|
|
|
print("${hstart}Detailed Description of Problem:$hend</th><td>");
|
|
|
|
|
|
|
|
$temp = htmlspecialchars($contents);
|
|
|
|
print("<textarea name='CONTENTS' cols='72' rows='12' wrap='virtual'>"
|
|
|
|
."$temp</textarea></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='right' valign='top'>File:</th><td>");
|
|
|
|
|
|
|
|
print("<input name='STRFILE' type='FILE'></td></tr>\n");
|
|
|
|
|
|
|
|
print("<tr><th align='center' colspan='2'>"
|
|
|
|
."<input type='submit' value='Submit Trouble Report'></th></tr>\n");
|
|
|
|
print("</table></p></form>\n");
|
|
|
|
html_footer();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'U' : // Update notification status
|
|
|
|
// EMAIL and NOTIFICATION variables hold status; add/delete from strcc...
|
|
|
|
$havedata = 0;
|
|
|
|
|
|
|
|
if ($REQUEST_METHOD != "POST")
|
|
|
|
{
|
|
|
|
html_header("STR Error");
|
|
|
|
print("<p>The '$op' command requires a POST request!\n");
|
|
|
|
html_footer();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
2004-05-17 03:23:06 +00:00
|
|
|
$notification = $_POST["NOTIFICATION"];
|
|
|
|
$email = $_POST["EMAIL"];
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
if (($notification != "ON" && $notification != "OFF") || $email == "")
|
|
|
|
{
|
|
|
|
html_header("STR Error");
|
|
|
|
print("<p>Please press your browsers back button and enter an "
|
|
|
|
."EMail address and choose whether to receive notification "
|
|
|
|
."messages.</p>\n");
|
|
|
|
html_footer();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
setcookie("FROM", "$email", time() + 57600, $PHP_SELF, $SERVER_NAME);
|
|
|
|
|
2004-05-17 20:28:52 +00:00
|
|
|
$result = db_query("SELECT * FROM carboncopy WHERE "
|
|
|
|
."url = 'str.php?L$id' AND email = '$email'");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
html_header("STR #$id Notifications");
|
|
|
|
|
2004-05-17 21:00:42 +00:00
|
|
|
html_start_links();
|
|
|
|
html_link("Return to STR #$id", "$PHP_SELF?L$id$options");
|
|
|
|
html_end_links();
|
|
|
|
|
|
|
|
print("<h1>STR #$id Notifications</h1>\n");
|
|
|
|
|
2004-05-17 02:14:54 +00:00
|
|
|
if ($notification == "ON")
|
|
|
|
{
|
|
|
|
if ($result && db_count($result) > 0)
|
|
|
|
print("<p>Your email address has already been added to the "
|
|
|
|
."notification list for STR #$id!</p>\n");
|
|
|
|
else
|
|
|
|
{
|
2004-05-17 20:28:52 +00:00
|
|
|
db_query("INSERT INTO carboncopy VALUES(NULL,'str.php?L$id','$email')");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
print("<p>Your email address has been added to the notification list "
|
|
|
|
."for STR #$id.</p>\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ($result && db_count($result) > 0)
|
|
|
|
{
|
2004-05-17 20:28:52 +00:00
|
|
|
db_query("DELETE FROM carboncopy WHERE "
|
|
|
|
."url = 'str.php?L$id' AND email = '$email'");
|
2004-05-17 02:14:54 +00:00
|
|
|
|
|
|
|
print("<p>Your email address has been removed from the notification list "
|
|
|
|
."for STR #$id.</p>\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
print("<p>Your email address is not on the notification list for "
|
|
|
|
."STR #$id!</p>\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($result)
|
|
|
|
db_free($result);
|
|
|
|
|
|
|
|
html_footer();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2004-05-18 01:39:00 +00:00
|
|
|
//
|
2004-05-19 00:57:33 +00:00
|
|
|
// End of "$Id: str.php,v 1.7 2004/05/19 00:57:33 mike Exp $".
|
2004-05-18 01:39:00 +00:00
|
|
|
//
|
2004-05-17 02:14:54 +00:00
|
|
|
?>
|