1 Commits
1.4.2 ... 1.4.3

Author SHA1 Message Date
925332147a Incorporated changes for release 1.4.3 2026-02-24 21:01:33 -05:00
21 changed files with 57 additions and 170 deletions

View File

@@ -1,5 +1,5 @@
OpenDRS - Online Discrepancy Reporting System 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 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 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 in a trusted environment where anybody on the network can
create/edit writeups and search the database, with a login required create/edit writeups and search the database, with a login required
for everything else. for everything else.
- On the View Open Writeups and View All Writeups pages, replaced the - On the View All Writeups pages, replaced the "Last 7 days" and
"Last 30 days" button with a dropdown with more options. "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. - Changed the global font to a sans-serif font.
- For Raspberry Pi: - For Raspberry Pi:
- Removed the Raspberry Pi terminal setup from OpenDRS. Setting up - Removed the Raspberry Pi terminal setup from OpenDRS. Setting up
@@ -168,3 +170,13 @@ Changelog
"View Open Writeups" page. "View Open Writeups" page.
- Removed open, closed, and deferred constant definitions from common.php - Removed open, closed, and deferred constant definitions from common.php
since only one was ever used, and that in only one place. 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.

View File

@@ -2,7 +2,7 @@
/* /*
boilerplate.php boilerplate.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2024 Rod Wright Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */

View File

@@ -3,7 +3,7 @@
/* /*
db.php db.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2024 Rod Wright Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */

View File

@@ -1,5 +1,5 @@
OpenDRS - Online Discrepancy Reporting System 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 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 it under the terms of the GNU General Public License as published by
@@ -170,3 +170,13 @@ Changelog
"View Open Writeups" page. "View Open Writeups" page.
- Removed open, closed, and deferred constant definitions from common.php - Removed open, closed, and deferred constant definitions from common.php
since only one was ever used, and that in only one place. 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.

View File

@@ -2,7 +2,7 @@
/* /*
about.php about.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2024 Rod Wright Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */
@@ -79,7 +79,7 @@ echo "
OpenDRS $drs_version Discrepancy Reporting System OpenDRS $drs_version Discrepancy Reporting System
</h3><br> </h3><br>
<p>This program is licensed under the terms of the <a href=\"gpl.php\">GNU General Public License</a>. Click on the link <p>This program is licensed under the terms of the <a href=\"gpl.php\">GNU General Public License</a>. 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.
</p> </p>
<p> <p>
OpenDRS is a simple online maintenance tracking/discrepancy reporting application. It allows anyone with a web browser to create, OpenDRS is a simple online maintenance tracking/discrepancy reporting application. It allows anyone with a web browser to create,

View File

@@ -2,7 +2,7 @@
/* /*
changelog.php changelog.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2024 Rod Wright Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */

View File

@@ -2,7 +2,7 @@
/* /*
common.php common.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2024 Rod Wright Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */
@@ -383,8 +383,7 @@ function sidemenu($printable=true) {
echo " echo "
<br> <br>
<table style=\"table-layout:fixed;width:210px;\" bgcolor=\"#$mbgcolor\" border=\"1\" width=\"100%\"> <table style=\"table-layout:fixed;width:210px;\" bgcolor=\"#$mbgcolor\" border=\"1\" width=\"100%\">
<tr><td align=\"center\"><a href=\"writeups.php\" title=\"View open writeups\">View Open Writeups</a></td></tr> <tr><td align=\"center\"><a href=\"writeups.php\" title=\"View writeups\">View Writeups</a></td></tr>
<tr><td align=\"center\"><a href=\"writeups.php?view=1\" title=\"View all writeups for a date range\">View All Writeups</a></td></tr>
<tr><td align=\"center\"><a href=\"groups.php\" title=\"View writeup groups\">Writeup Groups</a></td></tr> <tr><td align=\"center\"><a href=\"groups.php\" title=\"View writeup groups\">Writeup Groups</a></td></tr>
<tr><td align=\"center\"><a href=\"search.php\">Search Writeups</a></td></tr> <tr><td align=\"center\"><a href=\"search.php\">Search Writeups</a></td></tr>
</table> </table>

View File

@@ -2,7 +2,7 @@
/* /*
config.php config.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2024 Rod Wright Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */

View File

@@ -2,7 +2,7 @@
/* /*
create.php create.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2024 Rod Wright Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */

View File

@@ -2,7 +2,7 @@
/* /*
dbadmin.php dbadmin.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2024 Rod Wright Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */

View File

@@ -2,7 +2,7 @@
/* /*
gpl.php gpl.php
OpenMTS Online Maintenance Tracking System OpenMTS Online Maintenance Tracking System
Copyright (C) 2024 Rod Wright Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */

View File

@@ -2,7 +2,7 @@
/* /*
groups.php groups.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2024 Rod Wright Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */

View File

@@ -2,7 +2,7 @@
/* /*
login.php login.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2024 Rod Wright Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */

View File

@@ -2,7 +2,7 @@
/* /*
profile.php profile.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2024 Rod Wright Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */

View File

@@ -2,7 +2,7 @@
/* /*
search.php search.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2024 Rod Wright Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */

View File

@@ -2,7 +2,7 @@
/* /*
settings.php settings.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2024 Rod Wright Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */

View File

@@ -2,7 +2,7 @@
/* /*
writeupdetail.php writeupdetail.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2024 Rod Wright Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */

View File

@@ -2,7 +2,7 @@
/* /*
writeups.php writeups.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2024 Rod Wright Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */
@@ -51,8 +51,6 @@ extract($incoming, EXTR_SKIP);
* end_date * end_date
* showtoday * showtoday
* showyesterday * showyesterday
* show7day
* show30day
* showdays * showdays
* viewtype * viewtype
* togroup * togroup
@@ -73,128 +71,6 @@ if ($print) {
$role=dblookup($drs_db,"users","id","role",$userid); $role=dblookup($drs_db,"users","id","role",$userid);
// define local functions // 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 "
<form method=post action=\"writeups.php\">
";
if ($print) {
echo "
Open writeups between&nbsp;&nbsp; $start_date and $end_date
";
} else {
echo "
<input type=\"submit\" name=\"showtoday\" value=\"Today\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"showyesterday\" value=\"Yesterday\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"show7day\" value=\"Last 7 Days\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"show30day\" value=\"Last 30 Days\"><br><br>
";
}
echo "
</form>
";
$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 "
<font color=\"red\">As of $now</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size=\"-1\">Newest at top</font><br>
<table border=\"1\" cellpadding=\"5\" style=\"width:100%;\">
<tr>
<th style=\"width:1%;\">ID</th>
<th style=\"width:100px;\">Date</th>
<th style=\"width:1%;\">$discovered_term_short</th>
<th style=\"width:1%;\">$device_term</th>
<th style=\"width:1%;\">Subsystem</th>
<th style=\"width:1%;\">Reported by</th>
<th>Discrepancy</th>
<th style=\"width:1%;\">$functional_term_short</th>
</tr>
";
while ($tablerow = mysqli_fetch_assoc($writeup)) {
// determine effective icon
if($tablerow["functional"]==1) {
$funcind="<img src=\"icons/tick.png\" border=\"0\" title=\"$functional_yes\" alt=\"$functional_yes_short\">";
} else {
$funcind="<img src=\"icons/cross.png\" border=\"0\" title=\"$functional_no\" alt=\"$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."<div align=\"right\"><a href=\"groups.php?group=$member_group\"><img src=\"icons/block.png\" alt=\"GRP\" title=\"$imgtitle\"></a></div>";
} else {
$disc_txt=$disc_txt."<div align=\"right\"><a href=\"writeupdetail.php?id={$tablerow['id']}\"><img src=\"icons/block.png\" alt=\"GRP\" title=\"Member of $group_count groups. Click here to view.\"></a></div>";
}
}
// print table row
printf(
"<tr>
<td align=\"center\" valign=\"top\"><a href=\"writeupdetail.php?id=%s\" title=\"View or change details of this writeup\">%s</a></td>
<td valign=\"top\">%s</td>
<td valign=\"top\"><font title=\"%s\">%s</font></td>
<td valign=\"top\">%s</td>
<td valign=\"top\"><font title=\"%s\">%s</td>
<td valign=\"top\">%s</td>
<td valign=\"top\">%s</td>
<td align=\"center\" valign=\"top\">%s</td>
</tr>\n",
$tablerow["id"],$tablerow["id"],
$tablerow["report_date"],
$whendiscdesc, $whendiscname,
$dname,
$ssdesc, $ssname,
$tablerow["reported_by"],
$disc_txt,
$funcind
);
}
echo "</table>\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 "<b>No open writeups for $datespec.</b>";
}
}
function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$role) { function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$role) {
// grab some important global variables // 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]; $start_date=mysqli_fetch_row(mysqli_query($drs_db,"select date_sub(curdate(),interval 1 day)"))[0];
$end_date=$start_date; $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 != "") { if (isset($showdays) && $showdays != "") {
$minmaxqry=mysqli_query($drs_db,"select min(report_date),max(report_date) from writeups"); $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";
$pgtitle="Recent Writeups";
} else {
$pgtitle="Open Writeups";
}
framework("begin","$appname",$pgtitle,$print); framework("begin","$appname",$pgtitle,$print);
@@ -500,13 +364,10 @@ if (isset($addtogroup)) {
} }
if (!isset($viewtype)) $viewtype="summary"; if (!isset($viewtype)) $viewtype="summary";
if (isset($view)) {
// show writeup table // show writeup table
viewtable($start_date,$end_date,$print,$drs_db,$viewtype,$role); viewtable($start_date,$end_date,$print,$drs_db,$viewtype,$role);
} else {
// show open table
opentable($incoming,$start_date,$end_date,$print,$drs_db,$viewtype);
}
echo "<br>"; echo "<br>";
banner($print); banner($print);

View File

@@ -2,12 +2,12 @@
# install.sh # install.sh
# OpenDRS Online Discrepancy Reporting System # OpenDRS Online Discrepancy Reporting System
# Copyright (C) 2024 Rod Wright # Copyright (C) 2025 Rod Wright
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
DRS_VERSION="1.4.2" DRS_VERSION="1.4.3"
DOC_ROOT="/var/www" DOC_ROOT="/var/www"
INSTALL_LOC="opendrs" INSTALL_LOC="opendrs"
APACHE_USER="www-data" APACHE_USER="www-data"
@@ -21,6 +21,7 @@ if [[ $EUID -ne 0 ]]; then
exit 1 exit 1
fi fi
echo "Preparing for OpenDRS installation or upgrade. Please stand by..."
# Prevent unattended-upgrades from interfering # Prevent unattended-upgrades from interfering
restart_uu=false restart_uu=false

View File

@@ -69,7 +69,7 @@ CREATE TABLE `config` (
LOCK TABLES `config` WRITE; LOCK TABLES `config` WRITE;
/*!40000 ALTER TABLE `config` DISABLE KEYS */; /*!40000 ALTER TABLE `config` DISABLE KEYS */;
INSERT INTO `config` VALUES 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'), (5,'app_name','OpenDRS - Discrepancy Reporting System','OpenDRS Discrepancy Reporting System'),
(6,'banner','1','1'), (6,'banner','1','1'),
(7,'background_color','0B3144','0B3144'), (7,'background_color','0B3144','0B3144'),

View File

@@ -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"; 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";
-- --------------------------------------