3 Commits

Author SHA1 Message Date
925332147a Incorporated changes for release 1.4.3 2026-02-24 21:01:33 -05:00
97249aa600 Incorporated changes for release 1.4.2 2026-02-24 20:55:46 -05:00
89f7506fa7 Incorporated changes for release 1.4.1 2026-02-24 20:50:13 -05:00
21 changed files with 130 additions and 167 deletions

View File

@@ -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
@@ -156,3 +158,25 @@ Changelog
- Removed the Raspberry Pi server setup from OpenDRS. Setting up
a Raspberry Pi as an OpenDRS server is easily accomplished by
the OpenDRS installer.
1.4.1 - 2024-06-18
- Updated the installer script (install.sh) to check for and install the
package supplying uuidgen. If uuidgen is not present, the mysql
user would be created with a blank password.
1.4.2 - 2024-06-27
- Fixed bug introduced in version 1.4.1 in writeups.php where open
writeups prior to the current day weren't displayed on the
"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.

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
@@ -158,3 +158,25 @@ Changelog
- Removed the Raspberry Pi server setup from OpenDRS. Setting up
a Raspberry Pi as an OpenDRS server is easily accomplished by
the OpenDRS installer.
1.4.1 - 2024-06-18
- Updated the installer script (install.sh) to check for and install the
package supplying uuidgen. If uuidgen is not present, the mysql
user would be created with a blank password.
1.4.2 - 2024-06-27
- Fixed bug introduced in version 1.4.1 in writeups.php where open
writeups prior to the current day weren't displayed on the
"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.

View File

@@ -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
</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
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>
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
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2024 Rod Wright
Copyright (C) 2025 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/

View File

@@ -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
*/
@@ -40,9 +40,6 @@ $functional_no_short=FUNCTIONAL_NO_SHORT;
$access_mode=ACCESS_MODE;
// define some other constants
define("STAT_OPEN",1);
define("STAT_CLOSED",2);
define("STAT_DEFERRED",3);
define("ADMIN",2);
define("USER",1);
@@ -386,8 +383,7 @@ function sidemenu($printable=true) {
echo "
<br>
<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?view=1\" title=\"View all writeups for a date range\">View All 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=\"groups.php\" title=\"View writeup groups\">Writeup Groups</a></td></tr>
<tr><td align=\"center\"><a href=\"search.php\">Search Writeups</a></td></tr>
</table>

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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 "
<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=".STAT_OPEN." 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) {
// grab some important global variables
@@ -431,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);
@@ -492,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 "<br>";
banner($print);

View File

@@ -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.0"
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
@@ -330,6 +331,43 @@ else
fi
fi
echo ""
echo " Checking for uuidgen installation..."
echo ""
if uuidgen 2>&1
then
echo ""
echo "uuidgen is installed. Continuing."
echo ""
else
echo ""
echo ""
echo "OpenDRS requires uuidgen, but it doesn't seem to be installed."
echo -n "Install it now? [Y/n]: "
read reqinstall
if [ "$reqinstall" = "N" -o "$reqinstall" = "n" ]
then
echo "OpenDRS requires uuidgen, but you have elected not to install it."
echo "Installation cannot continue."
exit 1
else
echo ""
echo "###################################################################"
echo ""
echo "Proceeding with uuidgen installation"
echo ""
echo "###################################################################"
sleep 3
apt-get install -y uuid-runtime
echo ""
echo "###################################################################"
echo ""
echo "Finished with uuidgen installation"
echo ""
echo "###################################################################"
sleep 3
fi
fi
echo ""
echo ""
echo "Finished checking for and installing prerequisites..."
echo ""
@@ -389,7 +427,7 @@ then
# apply database updates
mysql -u"$curr_username" -f -D $curr_dbname < opendrs-update.sql >/dev/null 2>&1
# apply updates to existing db.php
./opendrs-update.sh $install_path
bash ./opendrs-update.sh $install_path
# copy distribution to install location
echo "Installing distribution . . ."
cp -R distfiles/* $install_path

View File

@@ -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'),

View File

@@ -249,5 +249,19 @@ WHERE NOT EXISTS
SELECT `name` FROM `config` WHERE `name` = "access_mode"
) LIMIT 1
;
-- --------------------------------------
-- ---------- version 1.4.1 -------------
-- Update version number
UPDATE config SET value="1.4.1",defaultvalue="1.4.1" WHERE name="drs_version";
-- --------------------------------------
-- ---------- version 1.4.2 -------------
-- Update version number
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";
-- --------------------------------------