Incorporated changes for release 1.3.2
This commit is contained in:
@@ -8,9 +8,14 @@
|
||||
*/
|
||||
|
||||
include("common.php");
|
||||
if (array_key_exists('print',$_REQUEST)) {
|
||||
$print=true;
|
||||
} else {
|
||||
$print=false;
|
||||
}
|
||||
|
||||
// redirect to writeups.php on change cancel
|
||||
if ($_REQUEST['cancel']) {
|
||||
if (array_key_exists('cancel',$_REQUEST)) {
|
||||
$id=$_REQUEST['id'];
|
||||
header("Cache-Control:no-cache, must-revalidate");
|
||||
header("Pragma:no-cache");
|
||||
@@ -22,7 +27,6 @@ if ($_REQUEST['cancel']) {
|
||||
if (isset($_SESSION['userid'])) $userid=$_SESSION['userid'];
|
||||
|
||||
// import incoming arrays
|
||||
$print=$_REQUEST['print'];
|
||||
if ($print) {
|
||||
// if printer friendly was clicked, values will be passed in serialized
|
||||
// form as "all_parameters" so we need to load those into $incoming[]
|
||||
@@ -32,32 +36,42 @@ if ($print) {
|
||||
$incoming=arrayCopy($_REQUEST);
|
||||
}
|
||||
|
||||
// load variables from incoming array
|
||||
$usersave=$incoming['usersave'];
|
||||
$techsave=$incoming['techsave'];
|
||||
$useredit=$incoming['useredit'];
|
||||
$techedit=$incoming['techedit'];
|
||||
$id=$incoming['id'];
|
||||
$device=$incoming['device'];
|
||||
$discovered=$incoming['discovered'];
|
||||
$functional=$incoming['functional'];
|
||||
$reported_by=$incoming['reported_by'];
|
||||
$report_date=$incoming['report_date'];
|
||||
$report_time=$incoming['report_time'];
|
||||
$subsystem=$incoming['subsystem'];
|
||||
$discrepancy_text=$incoming['discrepancy_text'];
|
||||
$status=$incoming['status'];
|
||||
$action_by=$incoming['action_by'];
|
||||
$action_date=$incoming['action_date'];
|
||||
$action_time=$incoming['action_time'];
|
||||
$action_reason=$incoming['action_reason'];
|
||||
$action_text=$incoming['action_text'];
|
||||
$group=$incoming['group'];
|
||||
// extract incoming array keys into variables
|
||||
extract($incoming, EXTR_SKIP);
|
||||
/*
|
||||
* possible keys are:
|
||||
* usersave
|
||||
* techsave
|
||||
* useredit
|
||||
* techedit
|
||||
* id
|
||||
* device
|
||||
* discovered
|
||||
* functional
|
||||
* reported_by
|
||||
* report_date
|
||||
* report_time
|
||||
* subsystem
|
||||
* discrepancy_text
|
||||
* status
|
||||
* action_by
|
||||
* action_date
|
||||
* action_time
|
||||
* action_reason
|
||||
* action_text
|
||||
* group
|
||||
*/
|
||||
|
||||
if (!isset($usersave)) $usersave=false;
|
||||
if (!isset($techsave)) $techsave=false;
|
||||
if (!isset($useredit)) $useredit=false;
|
||||
if (!isset($techedit)) $techedit=false;
|
||||
if (!isset($group)) $group=[];
|
||||
|
||||
// assign variables from constants
|
||||
$appname=APP_NAME;
|
||||
|
||||
if ($print=="Printer Friendly") {
|
||||
if ($print) {
|
||||
$mbgcolor=P_MENUBG_COLOR;
|
||||
} else {
|
||||
$mbgcolor=MENUBG_COLOR;
|
||||
@@ -392,11 +406,11 @@ if ($useredit) {
|
||||
";
|
||||
$linkquery=mysqli_query($drs_db,"select * from links where writeupid=\"$id\"");
|
||||
// create an array of ids returned by group query
|
||||
$wugroups=array();
|
||||
$wugroups=[];
|
||||
while ($eachlink=mysqli_fetch_assoc($linkquery)) {
|
||||
$wugroups[]=$eachlink['linkgroup'];
|
||||
}
|
||||
mysqli_data_seek($wugroups,0);
|
||||
reset($wugroups);
|
||||
$grow=mysqli_query($drs_db,"select * from groups order by id asc");
|
||||
printf("<option value=\"%s\">%s</option>",0,"New group");
|
||||
while ($gitem=mysqli_fetch_assoc($grow)) {
|
||||
@@ -423,18 +437,22 @@ if ($useredit) {
|
||||
} else {
|
||||
echo "<tr></tr><td colspan=\"2\">Group Assignments:  ";
|
||||
$wustat=dblookup($drs_db,"writeups","id","status",$id);
|
||||
if ($wustat==2 && !$role) $allowuseredit="disabled";
|
||||
if ($wustat==2 && !$role) {
|
||||
$allowuseredit="disabled";
|
||||
} else {
|
||||
$allowuseredit=NULL;
|
||||
}
|
||||
// Group multi-select ********************
|
||||
echo "
|
||||
<select style=\"max-width:60%;\" name=\"groupshow\" id=\"ms-group\" multiple title=\"The groups this writeup is a member of.\">
|
||||
";
|
||||
$linkquery=mysqli_query($drs_db,"select * from links where writeupid=\"$id\"");
|
||||
// create an array of ids returned by group query
|
||||
$wugroups=array();
|
||||
$wugroups=[];
|
||||
while ($eachlink=mysqli_fetch_assoc($linkquery)) {
|
||||
$wugroups[]=$eachlink['linkgroup'];
|
||||
}
|
||||
mysqli_data_seek($wugroups,0);
|
||||
reset($wugroups);
|
||||
$grow=mysqli_query($drs_db,"select * from groups order by id asc");
|
||||
while ($gitem=mysqli_fetch_assoc($grow)) {
|
||||
if ($gitem["name"]=="") {
|
||||
@@ -598,7 +616,11 @@ if ($techedit) {
|
||||
</tr>
|
||||
";
|
||||
} else {
|
||||
if (!$role) $live="disabled";
|
||||
if (!$role) {
|
||||
$live="disabled";
|
||||
} else {
|
||||
$live=NULL;
|
||||
}
|
||||
echo "
|
||||
<td align=\"right\" valign=\"bottom\"><input $live type=\"submit\" name=\"techedit\" value=\"Edit this Action\"></td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user