diff --git a/CHANGELOG b/CHANGELOG index b2478da..ea7ece4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -162,3 +162,9 @@ Changelog 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. diff --git a/distfiles/CHANGELOG b/distfiles/CHANGELOG index 3f764e3..5695c33 100644 --- a/distfiles/CHANGELOG +++ b/distfiles/CHANGELOG @@ -163,3 +163,10 @@ Changelog - 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. diff --git a/distfiles/common.php b/distfiles/common.php index bb77b63..cb5e7f7 100644 --- a/distfiles/common.php +++ b/distfiles/common.php @@ -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); diff --git a/distfiles/writeups.php b/distfiles/writeups.php index 1e9eec8..7ad682b 100644 --- a/distfiles/writeups.php +++ b/distfiles/writeups.php @@ -100,7 +100,7 @@ function opentable($incoming,$start_date,$end_date,$print,$drs_db,$viewtype="sum echo " "; - $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"); + $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 " @@ -407,6 +407,14 @@ 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"); diff --git a/install.sh b/install.sh index 4aeb574..e7b7f2e 100644 --- a/install.sh +++ b/install.sh @@ -7,7 +7,7 @@ # SPDX-License-Identifier: GPL-2.0 -DRS_VERSION="1.4.0" +DRS_VERSION="1.4.2" DOC_ROOT="/var/www" INSTALL_LOC="opendrs" APACHE_USER="www-data" @@ -426,7 +426,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 diff --git a/opendrs-update.sql b/opendrs-update.sql index b387de2..11bf9ce 100644 --- a/opendrs-update.sql +++ b/opendrs-update.sql @@ -249,5 +249,15 @@ 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"; +-- -------------------------------------- +