From 925332147a112e4da87d9a8a6db4e11320cfdb6b Mon Sep 17 00:00:00 2001 From: Rod Wright Date: Tue, 24 Feb 2026 21:01:33 -0500 Subject: [PATCH] Incorporated changes for release 1.4.3 --- CHANGELOG | 18 ++++- boilerplate.php | 2 +- db.php.template | 2 +- distfiles/CHANGELOG | 12 ++- distfiles/about.php | 4 +- distfiles/changelog.php | 2 +- distfiles/common.php | 5 +- distfiles/config.php | 2 +- distfiles/create.php | 2 +- distfiles/dbadmin.php | 2 +- distfiles/gpl.php | 2 +- distfiles/groups.php | 2 +- distfiles/login.php | 2 +- distfiles/profile.php | 2 +- distfiles/search.php | 2 +- distfiles/settings.php | 2 +- distfiles/writeupdetail.php | 2 +- distfiles/writeups.php | 151 ++---------------------------------- install.sh | 5 +- opendrs-initial.sql | 2 +- opendrs-update.sql | 4 + 21 files changed, 57 insertions(+), 170 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ea7ece4..d1809b4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,5 @@ OpenDRS - Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -146,8 +146,10 @@ Changelog in a trusted environment where anybody on the network can create/edit writeups and search the database, with a login required for everything else. - - On the View Open Writeups and View All Writeups pages, replaced the - "Last 30 days" button with a dropdown with more options. + - On the View All Writeups pages, replaced the "Last 7 days" and + "Last 30 days" buttons with a dropdown with more options, including + future dates so that OpenDRS can be more useful for things like + preventive maintenance. - Changed the global font to a sans-serif font. - For Raspberry Pi: - Removed the Raspberry Pi terminal setup from OpenDRS. Setting up @@ -168,3 +170,13 @@ Changelog "View Open Writeups" page. - Removed open, closed, and deferred constant definitions from common.php since only one was ever used, and that in only one place. + +1.4.3 - 2025-02-27 + - Poorly documented changes in the previous three versions resulted + in confusion about when the date range selection dropdown should + appear on the View Open Writeups and View All Writeups pages. + Since the View Open Writeups page seemed redundant (all that info + was available on the View All Writeups page) removed the View + Open Writeups page entirely. The writeups page now shows all + writeups for the selected date range, or today if no dates are + specified. diff --git a/boilerplate.php b/boilerplate.php index 449b2d0..0006ed6 100644 --- a/boilerplate.php +++ b/boilerplate.php @@ -2,7 +2,7 @@ /* boilerplate.php OpenDRS Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright SPDX-License-Identifier: GPL-2.0 */ diff --git a/db.php.template b/db.php.template index 8c068d8..cd2010e 100644 --- a/db.php.template +++ b/db.php.template @@ -3,7 +3,7 @@ /* db.php OpenDRS Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright SPDX-License-Identifier: GPL-2.0 */ diff --git a/distfiles/CHANGELOG b/distfiles/CHANGELOG index 5695c33..d1809b4 100644 --- a/distfiles/CHANGELOG +++ b/distfiles/CHANGELOG @@ -1,5 +1,5 @@ OpenDRS - Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -170,3 +170,13 @@ Changelog "View Open Writeups" page. - Removed open, closed, and deferred constant definitions from common.php since only one was ever used, and that in only one place. + +1.4.3 - 2025-02-27 + - Poorly documented changes in the previous three versions resulted + in confusion about when the date range selection dropdown should + appear on the View Open Writeups and View All Writeups pages. + Since the View Open Writeups page seemed redundant (all that info + was available on the View All Writeups page) removed the View + Open Writeups page entirely. The writeups page now shows all + writeups for the selected date range, or today if no dates are + specified. diff --git a/distfiles/about.php b/distfiles/about.php index 235e382..d3ee03a 100644 --- a/distfiles/about.php +++ b/distfiles/about.php @@ -2,7 +2,7 @@ /* about.php OpenDRS Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright SPDX-License-Identifier: GPL-2.0 */ @@ -79,7 +79,7 @@ echo " OpenDRS $drs_version Discrepancy Reporting System

This program is licensed under the terms of the GNU General Public License. Click on the link -or see the LICENSE file in the distribution to read it. OpenDRS is Copyright (C) 2024 by Rod Wright. +or see the LICENSE file in the distribution to read it. OpenDRS is Copyright (C) 2025 by Rod Wright.

OpenDRS is a simple online maintenance tracking/discrepancy reporting application. It allows anyone with a web browser to create, diff --git a/distfiles/changelog.php b/distfiles/changelog.php index 1d4f101..fd76dcc 100644 --- a/distfiles/changelog.php +++ b/distfiles/changelog.php @@ -2,7 +2,7 @@ /* changelog.php OpenDRS Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright SPDX-License-Identifier: GPL-2.0 */ diff --git a/distfiles/common.php b/distfiles/common.php index cb5e7f7..5ea0e1e 100644 --- a/distfiles/common.php +++ b/distfiles/common.php @@ -2,7 +2,7 @@ /* common.php OpenDRS Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright SPDX-License-Identifier: GPL-2.0 */ @@ -383,8 +383,7 @@ function sidemenu($printable=true) { echo "
- - +
View Open Writeups
View All Writeups
View Writeups
Writeup Groups
Search Writeups
diff --git a/distfiles/config.php b/distfiles/config.php index ff7f741..98cd0d2 100644 --- a/distfiles/config.php +++ b/distfiles/config.php @@ -2,7 +2,7 @@ /* config.php OpenDRS Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright SPDX-License-Identifier: GPL-2.0 */ diff --git a/distfiles/create.php b/distfiles/create.php index d705074..fb5f9cb 100644 --- a/distfiles/create.php +++ b/distfiles/create.php @@ -2,7 +2,7 @@ /* create.php OpenDRS Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright SPDX-License-Identifier: GPL-2.0 */ diff --git a/distfiles/dbadmin.php b/distfiles/dbadmin.php index 1cc6eff..2921931 100644 --- a/distfiles/dbadmin.php +++ b/distfiles/dbadmin.php @@ -2,7 +2,7 @@ /* dbadmin.php OpenDRS Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright SPDX-License-Identifier: GPL-2.0 */ diff --git a/distfiles/gpl.php b/distfiles/gpl.php index bbf4d6e..a2a5237 100644 --- a/distfiles/gpl.php +++ b/distfiles/gpl.php @@ -2,7 +2,7 @@ /* gpl.php OpenMTS Online Maintenance Tracking System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright SPDX-License-Identifier: GPL-2.0 */ diff --git a/distfiles/groups.php b/distfiles/groups.php index c2d2d99..3b94d67 100644 --- a/distfiles/groups.php +++ b/distfiles/groups.php @@ -2,7 +2,7 @@ /* groups.php OpenDRS Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright SPDX-License-Identifier: GPL-2.0 */ diff --git a/distfiles/login.php b/distfiles/login.php index 091f1b8..6b125d6 100644 --- a/distfiles/login.php +++ b/distfiles/login.php @@ -2,7 +2,7 @@ /* login.php OpenDRS Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright SPDX-License-Identifier: GPL-2.0 */ diff --git a/distfiles/profile.php b/distfiles/profile.php index b170c6b..1f4c26d 100644 --- a/distfiles/profile.php +++ b/distfiles/profile.php @@ -2,7 +2,7 @@ /* profile.php OpenDRS Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright SPDX-License-Identifier: GPL-2.0 */ diff --git a/distfiles/search.php b/distfiles/search.php index 5ba9ff8..1ea48fe 100644 --- a/distfiles/search.php +++ b/distfiles/search.php @@ -2,7 +2,7 @@ /* search.php OpenDRS Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright SPDX-License-Identifier: GPL-2.0 */ diff --git a/distfiles/settings.php b/distfiles/settings.php index 39d2e4b..faa1385 100644 --- a/distfiles/settings.php +++ b/distfiles/settings.php @@ -2,7 +2,7 @@ /* settings.php OpenDRS Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright SPDX-License-Identifier: GPL-2.0 */ diff --git a/distfiles/writeupdetail.php b/distfiles/writeupdetail.php index cb00eca..3b9c8f8 100644 --- a/distfiles/writeupdetail.php +++ b/distfiles/writeupdetail.php @@ -2,7 +2,7 @@ /* writeupdetail.php OpenDRS Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright SPDX-License-Identifier: GPL-2.0 */ diff --git a/distfiles/writeups.php b/distfiles/writeups.php index 7ad682b..9e3b87c 100644 --- a/distfiles/writeups.php +++ b/distfiles/writeups.php @@ -2,7 +2,7 @@ /* writeups.php OpenDRS Online Discrepancy Reporting System - Copyright (C) 2024 Rod Wright + Copyright (C) 2025 Rod Wright SPDX-License-Identifier: GPL-2.0 */ @@ -51,8 +51,6 @@ extract($incoming, EXTR_SKIP); * end_date * showtoday * showyesterday - * show7day - * show30day * showdays * viewtype * togroup @@ -73,128 +71,6 @@ if ($print) { $role=dblookup($drs_db,"users","id","role",$userid); // define local functions -function opentable($incoming,$start_date,$end_date,$print,$drs_db,$viewtype="summary") { - // grab some important global variables - global $device_term; - global $discovered_term, $discovered_term_short, $disc_drop_data; - global $functional_term, $functional_term_short; - global $functional_yes, $functional_no; - global $functional_yes_short, $functional_no_short; - - // show date range selector - echo " -

- "; - if ($print) { - echo " - Open writeups between   $start_date and $end_date - "; - } else { - echo " -        -        -        -

- "; - } - echo " -
- "; - $writeup=mysqli_query($drs_db,"select * from writeups where status=1 and report_date between \"$start_date\" and \"$end_date\" order by report_date desc,report_time desc"); - if (mysqli_num_rows($writeup)) { - $now=date("H:i l"); - echo " - As of $now      Newest at top
- - - - - - - - - - - - "; - while ($tablerow = mysqli_fetch_assoc($writeup)) { - // determine effective icon - if($tablerow["functional"]==1) { - $funcind="\"$functional_yes_short\""; - } else { - $funcind="\"$functional_no_short\""; - } - - // convert device number to name - $dname=dblookup($drs_db,"devices","id","name",$tablerow["device"]); - - // convert subsystem number to name - $ssname=dblookup($drs_db,"subsystems","id","name",$tablerow["subsystem"]); - - // convert subsystem number to description - $ssdesc=dblookup($drs_db,"subsystems","id","description",$tablerow["subsystem"]); - - // determine values for when discovered - $whendiscdesc=mysqli_fetch_row(mysqli_query($drs_db,"select whendiscovereddesc from discovered where id=\"{$tablerow['discovered']}\""))[0]; - $whendiscname=mysqli_fetch_row(mysqli_query($drs_db,"select whendiscoveredname from discovered where id=\"{$tablerow['discovered']}\""))[0]; - - $disc_txt="{$tablerow['discrepancy_text']}"; - - // determine if this is a member of a group - $member_qry=mysqli_query($drs_db,"select linkgroup from links where writeupid=\"{$tablerow['id']}\""); - $is_member=mysqli_num_rows($member_qry); - if ($is_member) { - $group_count=$is_member; - $member_group=mysqli_fetch_row($member_qry)[0]; - $member_group_name=dblookup($drs_db,"groups","id","name",$member_group); - if ($member_group_name) { - $imgtitle="Member of group: $member_group_name"; - } else { - $imgtitle="Member of group ID: $member_group"; - } - if ($group_count == 1) { - $disc_txt=$disc_txt."
\"GRP\"
"; - } else { - $disc_txt=$disc_txt."
\"GRP\"
"; - } - } - - // print table row - printf( - " - - - - - - - - - \n", - $tablerow["id"],$tablerow["id"], - $tablerow["report_date"], - $whendiscdesc, $whendiscname, - $dname, - $ssdesc, $ssname, - $tablerow["reported_by"], - $disc_txt, - $funcind - ); - } - echo "
IDDate$discovered_term_short$device_termSubsystemReported byDiscrepancy$functional_term_short
%s%s%s%s%s%s%s%s
\n"; - } else { - if (array_key_exists('showyesterday',$incoming)) { - $datespec="yesterday"; - } elseif (array_key_exists('show7day',$incoming)) { - $datespec="the last 7 days"; - } elseif (array_key_exists('show30day',$incoming)) { - $datespec="the last 30 days"; - } else { - $datespec="today"; - } - echo "No open writeups for $datespec."; - } -} function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$role) { // grab some important global variables @@ -407,14 +283,6 @@ if (isset($showyesterday)) { $start_date=mysqli_fetch_row(mysqli_query($drs_db,"select date_sub(curdate(),interval 1 day)"))[0]; $end_date=$start_date; } -if (isset($show7day)) { - $start_date=mysqli_fetch_row(mysqli_query($drs_db,"select date_sub(curdate(),interval 7 day)"))[0]; - $end_date=$today; -} -if (isset($show30day)) { - $start_date=mysqli_fetch_row(mysqli_query($drs_db,"select date_sub(curdate(),interval 30 day)"))[0]; - $end_date=$today; -} if (isset($showdays) && $showdays != "") { $minmaxqry=mysqli_query($drs_db,"select min(report_date),max(report_date) from writeups"); @@ -439,11 +307,7 @@ if (isset($showdays) && $showdays != "") { } } -if (isset($view)) { - $pgtitle="Recent Writeups"; -} else { - $pgtitle="Open Writeups"; -} +$pgtitle="Recent Writeups"; framework("begin","$appname",$pgtitle,$print); @@ -500,13 +364,10 @@ if (isset($addtogroup)) { } if (!isset($viewtype)) $viewtype="summary"; -if (isset($view)) { - // show writeup table - viewtable($start_date,$end_date,$print,$drs_db,$viewtype,$role); -} else { - // show open table - opentable($incoming,$start_date,$end_date,$print,$drs_db,$viewtype); -} + +// show writeup table +viewtable($start_date,$end_date,$print,$drs_db,$viewtype,$role); + echo "
"; banner($print); diff --git a/install.sh b/install.sh index e7b7f2e..00018a9 100644 --- a/install.sh +++ b/install.sh @@ -2,12 +2,12 @@ # install.sh # OpenDRS Online Discrepancy Reporting System -# Copyright (C) 2024 Rod Wright +# Copyright (C) 2025 Rod Wright # SPDX-License-Identifier: GPL-2.0 -DRS_VERSION="1.4.2" +DRS_VERSION="1.4.3" DOC_ROOT="/var/www" INSTALL_LOC="opendrs" APACHE_USER="www-data" @@ -21,6 +21,7 @@ if [[ $EUID -ne 0 ]]; then exit 1 fi +echo "Preparing for OpenDRS installation or upgrade. Please stand by..." # Prevent unattended-upgrades from interfering restart_uu=false diff --git a/opendrs-initial.sql b/opendrs-initial.sql index 71466e9..eef8b31 100644 --- a/opendrs-initial.sql +++ b/opendrs-initial.sql @@ -69,7 +69,7 @@ CREATE TABLE `config` ( LOCK TABLES `config` WRITE; /*!40000 ALTER TABLE `config` DISABLE KEYS */; INSERT INTO `config` VALUES -(1,'drs_version','1.4.0','1.4.0'), +(1,'drs_version','1.4.3','1.4.3'), (5,'app_name','OpenDRS - Discrepancy Reporting System','OpenDRS Discrepancy Reporting System'), (6,'banner','1','1'), (7,'background_color','0B3144','0B3144'), diff --git a/opendrs-update.sql b/opendrs-update.sql index 11bf9ce..bad751f 100644 --- a/opendrs-update.sql +++ b/opendrs-update.sql @@ -261,3 +261,7 @@ UPDATE config SET value="1.4.1",defaultvalue="1.4.1" WHERE name="drs_version"; UPDATE config SET value="1.4.2",defaultvalue="1.4.2" WHERE name="drs_version"; -- -------------------------------------- +-- ---------- version 1.4.3 ------------- +-- Update version number +UPDATE config SET value="1.4.3",defaultvalue="1.4.3" WHERE name="drs_version"; +-- --------------------------------------