Incorporate changes made for old version 5.2.4.4.
This commit is contained in:
@@ -232,3 +232,11 @@
|
||||
code from install.sh. This is best done using separate
|
||||
installers.
|
||||
|
||||
5.2.4.4 - 2025-12-19
|
||||
-Fixed bugs that caused crashes on the Scheduled Maintenance page
|
||||
that were caused by more strict behavior of php regarding mysql
|
||||
queries.
|
||||
- Fixed bug where some functions defined in functions.php were not
|
||||
treating the $today variable as global.
|
||||
- In install.php, if a previous installation was found, make upgrade
|
||||
the default choice.
|
||||
|
||||
@@ -721,7 +721,7 @@ function showlinklist($print) {
|
||||
|
||||
function nag($tech_id) {
|
||||
// nags the user if something is pending
|
||||
global $db;
|
||||
global $db, $today;
|
||||
// maintenance forms
|
||||
$mfpending=mysqli_num_rows(mysqli_query($db,"select maintformid from maintforms where mftech=\"$tech_id\" and pending=1"));
|
||||
if ($mfpending) {
|
||||
@@ -819,7 +819,7 @@ function get_upcoming_events() {
|
||||
// build array of upcoming events
|
||||
// takes no arguments
|
||||
// returns an array containing arrays of upcoming event data
|
||||
global $db;
|
||||
global $db, $today;
|
||||
$uceventsqry=mysqli_query($db,"select * from events where active_flag=\"1\" and (deferred_flag=\"0\" or (deferred_flag=\"1\" and deferred_date <= \"$today\"))");
|
||||
$ucevents=array();
|
||||
while ($uceventrow=mysqli_fetch_assoc($uceventsqry)) {
|
||||
|
||||
@@ -14,50 +14,50 @@ if (isset($_SESSION['login'])) {
|
||||
} else {
|
||||
$loggedin=false;
|
||||
}
|
||||
$techid=$_SESSION['login'];
|
||||
$techid=$_SESSION['login'] ?? NULL;
|
||||
$isadmin=dblookup($db,"techs","techid","admin",$techid);
|
||||
|
||||
$upcoming=$_REQUEST['upcoming'];
|
||||
$schedule=$_REQUEST['schedule'];
|
||||
$tasks=$_REQUEST['tasks'];
|
||||
$devices=$_REQUEST['devices'];
|
||||
$action=$_REQUEST['action'];
|
||||
$complete=$_REQUEST['complete'];
|
||||
$defer=$_REQUEST['defer'];
|
||||
$add=$_REQUEST['add'];
|
||||
$edit=$_REQUEST['edit'];
|
||||
$update=$_REQUEST['update'];
|
||||
$delete=$_REQUEST['delete'];
|
||||
$id=$_REQUEST['id'];
|
||||
$active_flag=$_REQUEST['active_flag'];
|
||||
$upcoming=$_REQUEST['upcoming'] ?? NULL;
|
||||
$schedule=$_REQUEST['schedule'] ?? NULL;
|
||||
$tasks=$_REQUEST['tasks'] ?? NULL;
|
||||
$devices=$_REQUEST['devices'] ?? NULL;
|
||||
$action=$_REQUEST['action'] ?? NULL;
|
||||
$complete=$_REQUEST['complete'] ?? NULL;
|
||||
$defer=$_REQUEST['defer'] ?? NULL;
|
||||
$add=$_REQUEST['add'] ?? NULL;
|
||||
$edit=$_REQUEST['edit'] ?? NULL;
|
||||
$update=$_REQUEST['update'] ?? NULL;
|
||||
$delete=$_REQUEST['delete'] ?? NULL;
|
||||
$id=$_REQUEST['id'] ?? NULL;
|
||||
$active_flag=$_REQUEST['active_flag'] ?? 0;
|
||||
|
||||
$devicename=$_REQUEST['devicename'];
|
||||
$devicedesc=$_REQUEST['devicedesc'];
|
||||
$group_flag=$_REQUEST['group_flag'];
|
||||
$members=$_REQUEST['members'];
|
||||
$devicename=$_REQUEST['devicename'] ?? NULL;
|
||||
$devicedesc=$_REQUEST['devicedesc'] ?? NULL;
|
||||
$group_flag=$_REQUEST['group_flag'] ?? 0;
|
||||
$members=$_REQUEST['members'] ?? [];
|
||||
|
||||
$weekdays_only=$_REQUEST['weekdays_only'];
|
||||
$nextdue_relative=$_REQUEST['nextdue_relative'];
|
||||
$taskname=$_REQUEST['taskname'];
|
||||
$taskdesc=$_REQUEST['taskdesc'];
|
||||
$frequency=$_REQUEST['frequency'];
|
||||
$period=$_REQUEST['period'];
|
||||
$refdoc_name=$_REQUEST['refdoc_name'];
|
||||
$refdoc_url=$_REQUEST['refdoc_url'];
|
||||
$weekdays_only=$_REQUEST['weekdays_only'] ?? NULL;
|
||||
$nextdue_relative=$_REQUEST['nextdue_relative'] ?? NULL;
|
||||
$taskname=$_REQUEST['taskname'] ?? NULL;
|
||||
$taskdesc=$_REQUEST['taskdesc'] ?? NULL;
|
||||
$frequency=$_REQUEST['frequency'] ?? NULL;
|
||||
$period=$_REQUEST['period'] ?? NULL;
|
||||
$refdoc_name=$_REQUEST['refdoc_name'] ?? NULL;
|
||||
$refdoc_url=$_REQUEST['refdoc_url'] ?? NULL;
|
||||
|
||||
$deferred_flag=$_REQUEST['deferred_flag'];
|
||||
$deferred_date=$_REQUEST['deferred_date'];
|
||||
$start_date=$_REQUEST['start_date'];
|
||||
$last_date=$_REQUEST['last_date'];
|
||||
$task=$_REQUEST['task'];
|
||||
$device=$_REQUEST['device'];
|
||||
$deferuntil=$_REQUEST['deferuntil'];
|
||||
$completedate=$_REQUEST['completedate'];
|
||||
$addlognote=$_REQUEST['addlognote'];
|
||||
$deferred_flag=$_REQUEST['deferred_flag'] ?? 0;
|
||||
$deferred_date=$_REQUEST['deferred_date'] ?? NULL;
|
||||
$start_date=$_REQUEST['start_date'] ?? NULL;
|
||||
$last_date=$_REQUEST['last_date'] ?? NULL;
|
||||
$task=$_REQUEST['task'] ?? NULL;
|
||||
$device=$_REQUEST['device'] ?? NULL;
|
||||
$deferuntil=$_REQUEST['deferuntil'] ?? NULL;
|
||||
$completedate=$_REQUEST['completedate'] ?? NULL;
|
||||
$addlognote=$_REQUEST['addlognote'] ?? NULL;
|
||||
|
||||
$logname=LOG_NAME;
|
||||
|
||||
$print=$_REQUEST['print'];
|
||||
$print=$_REQUEST['print'] ?? NULL;
|
||||
|
||||
if ($print) {
|
||||
$sbcolor=P_SIDEBAR_COLOR;
|
||||
@@ -126,6 +126,9 @@ if ($add) {
|
||||
}
|
||||
// run through the memberlist and modify the table
|
||||
foreach ($memberlist as $memberdev) {
|
||||
if ($start_date==NULL) $start_date=$today;
|
||||
if ($last_date==NULL) $last_date="0000-00-00";
|
||||
if ($deferred_date==NULL) $deferred_date="0000-00-00";
|
||||
$addqry=("insert into events(task,device,start_date,last_date,deferred_flag,deferred_date,active_flag)
|
||||
values(\"$task\",\"$memberdev\",\"$start_date\",\"$last_date\",\"$deferred_flag\",\"$deferred_date\",\"$active_flag\")");
|
||||
mysqli_query($db,$addqry);
|
||||
@@ -200,6 +203,9 @@ if ($edit) {
|
||||
$last_date=mysqli_real_escape_string($db,$last_date);
|
||||
$deferred_date=mysqli_real_escape_string($db,$deferred_date);
|
||||
// update the tasks table
|
||||
if ($start_date==NULL) $start_date=$today;
|
||||
if ($last_date==NULL) $last_date="0000-00-00";
|
||||
if ($deferred_date==NULL) $deferred_date="0000-00-00";
|
||||
mysqli_query($db,"update events
|
||||
set task=\"$task\",device=\"$device\",start_date=\"$start_date\",last_date=\"$last_date\",deferred_flag=\"$deferred_flag\",
|
||||
deferred_date=\"$deferred_date\",active_flag=\"$active_flag\"
|
||||
@@ -400,7 +406,7 @@ if ($action) {
|
||||
}
|
||||
if ($start_date=="0000-00-00") $start_date=$today;
|
||||
if ($last_date=="0000-00-00") $last_date="";
|
||||
if ($deferred_date=="0000-00-00") $deferred_date="";
|
||||
if ($deferred_date=="0000-00-00") $deferred_date=$tomorrow;
|
||||
$deferuntiltag="<input type=\"text\" name=\"deferred_date\" id=\"deferdatepicker\" size=\"10\" maxlength=\"10\" value=\"$deferred_date\" title=\"Format: YYYY-MM-DD\">";
|
||||
$startdatetag="<input type=\"text\" name=\"start_date\" id=\"startdatepicker\" size=\"10\" maxlength=\"10\" value=\"$start_date\" title=\"Format: YYYY-MM-DD\">";
|
||||
$lastdatetag="<input type=\"text\" name=\"last_date\" id=\"completedatepicker\" size=\"10\" maxlength=\"10\" value=\"$last_date\" title=\"Format: YYYY-MM-DD\">";
|
||||
|
||||
Reference in New Issue
Block a user