2 Commits
1.1.1 ... 1.2.0

Author SHA1 Message Date
39931c0ca5 Incorporated changes for release 1.1.2 2026-02-14 11:44:10 -05:00
16d1ff9bb8 Incorporated changes for release 1.1.1 2026-02-14 11:26:01 -05:00
46 changed files with 1170 additions and 629 deletions

View File

@@ -27,17 +27,46 @@ Changelog
back button in terminal mode.
- Added configurable help text for period effective selection.
- Changed Sim period effective from selection to yes/no radio buttons.
- Writeup groups page shows collapsed list of groups. Click the expand icon
to expand each group.
- Fixed bug where entries made on stale create page had inaccurate date/time.
- For logged in users, added the ability to select writeups directly on the
View All Writeups page and assign/create a group.
- On the Create New Writeup page, removed the default selections for Device,
Subsystem, and Period dropdowns, forcing user to make a selection.
- Writeup groups page shows collapsed list of groups. Click the expand
icon to expand each group.
- Fixed bug where entries made on stale create page had inaccurate
date/time.
- For logged in users, added the ability to select writeups directly on
the View All Writeups page and assign/create a group.
- On the Create New Writeup page, removed the default selections for
Device, Subsystem, and Period dropdowns, forcing user to make a
selection.
- Added a Today button to the View All Writeups page
- Changed the Period dropdowns on the Create, Search, and Group pages to show
the times instead of the period numbers. Period numbers are still shown
in the results tables with mouse hover showing times.
- Changed the Period dropdowns on the Create, Search, and Group pages to
show the times instead of the period numbers. Period numbers are
still shown in the results tables with mouse hover showing times.
- Moved all installation/upgrade functions to the install.sh script.
1.1.1 - 2020-04-09
- Fixed opendrs-update.sql to rename the trainers table.
- Fixed bug where the About page didn't show the version number.
- Fixed some grammar on the About page.
- Fixed hardcoded help text in groups.php to use constant from config.
- Added ID to searchable parameters in search.php.
- Added sort parameters to search results.
- Added a link for Admins to access the local Webmin to manage a terminal.
- For Raspberry Pi:
- In terminal setup, provided missing .profile and
.config/openbox/rc.xml files.
- In server setup, install mariadb-server since
mysql-server is obsolete.
- Changed startdrs.sh to re-enable ctrl keys for copy/paste, etc. Also
added chromium flags to prevent update popup.
- Added openbox keybindings to customer user's rc.xml to trap dangerous
chromium hotkey combinations and enable ctrl-alt-del reboot.
- Changed systemd ctrl-alt-del.target symlink to point to
reboot.target.
1.1.2 - 2021-04-28
- Added ability to export search results as a CSV file.
- Fixed bug in server-setup.sh that resulted in an incorrect install
location if the installation name was left at the default.
- Fixed bug in server-setup.sh that resulted in failure to set the
ownership of the installed server directory tree if the http
user and group names were left at the default.
- Updated and tested to support Raspberry Pi 4B hardware.

View File

@@ -14,7 +14,7 @@ follow the prompts.
4. Log in
Click on the Log In menu option on the main page. If this is a fresh
installation The initial user is drsadmin and the initial password
is OpenDRS-1. It is highly recommended that you changethis password
is OpenDRS-1. It is highly recommended that you change this password
to a strong one by going to the Manage Database page under the
Admin Functions menu. If this an upgrade, your current usernames and
passwords are unchanged.

View File

@@ -2,10 +2,15 @@
# server-setup.sh
# OpenDRS Online Discrepancy Reporting System
# Copyright (C) 2018 Rod Wright
# Copyright (C) 2021 Rod Wright
# SPDX-License-Identifier: GPL-2.0
inst_name="OpenDRS"
docroot_path="/var/www"
apache_user="www-data"
apache_group="www-data"
echo ""
echo ""
echo ""
@@ -25,19 +30,36 @@ fi
echo "It looks like you have. Continuing."
echo ""
echo ""
echo "Updating Raspbian..."
echo "Updating Raspberry Pi OS..."
sleep 10
apt update && apt dist-upgrade -y
echo "...done."
echo ""
echo ""
echo ""
echo ""
apt update && apt dist-upgrade -y
echo ""
echo ""
echo ""
echo ""
echo "...done."
sleep 10
echo ""
echo ""
echo ""
echo ""
echo "IMPORTANT!: Be sure to make note of usernames and passwords you provide below."
echo "You will need them later."
echo ""
echo "Installing required server packages. Select apache2 as the web server to configure"
echo "automatically. Choose Yes when prompted to install phpmyadmin database and allow it to"
echo "generate a random password(leave the field blank)."
echo -n "Press enter to continue."
read continueok
sleep 10
apt install -y apache2 php php-mcrypt mysql-server phpmyadmin
echo ""
echo ""
echo ""
echo ""
apt install -y apache2 php php-mcrypt mariadb-server phpmyadmin uuid-runtime
cp etc/apache2/mods-available/alias.conf /etc/apache2/mods-available
service apache2 restart
echo "...done."
@@ -47,38 +69,200 @@ echo "Configuring the mysql installation. Accept the defaults at the following p
echo "Remember the password you set here. You'll need it during the OpenDRS install."
echo -n "Press enter to proceed."
read continueok
echo ""
echo ""
echo ""
echo ""
mysql_secure_installation
mysql mysql -e "update user set plugin='';flush privileges;"
echo ""
echo ""
echo "Installing OpenDRS."
DRS_VERSION="1.1.0"
install_path="/var/www/opendrs-$DRS_VERSION"
httpd_user_group="www-data:www-data"
new_link_name="/var/www/opendrs"
# This is a fresh install
operation="installed"
# prompt for mysql information
bad_mysql_adm=1
while [ $bad_mysql_adm -eq 1 ]
do
admintestdb="drsadm`date +%Y%m%d`"
echo "We need to know the username and password of a MySQL administrator"
echo "to be able to create the database and user for OpenDRS. Note that this"
echo "is not necessarily the same as the login and password for the computer."
echo -n "MySQL admin username: "
read mysql_adm_user
echo ""
echo -n "MySQL admin password: "
read -s mysql_adm_pass
export MYSQL_PWD="$mysql_adm_pass"
mysql -u"$mysql_adm_user" -e "create database $admintestdb;drop database $admintestdb"
if [ $? -eq 0 ]
then
bad_mysql_adm=0
else
echo "ERROR: Either the username/password you supplied were incorrect or the user"
echo -n "is not a MySQL administrator. Try again? [Y/N]: "
read admtry
if [ "$admtry" != "Y" -o "$admtry" != "y" ]
then
exit
fi
fi
done
echo ""
echo "What would you like to call this installation of OpenDRS? If you accept"
echo "the default, it will be called $inst_name. If you will be running multiple"
echo "instances of OpenDRS on this server, you should choose a distinctive name."
echo -n "Installation name [$inst_name]: "
read inst_name_in
if [ "$inst_name_in" != "" ]
then
inst_name=$inst_name_in
fi
echo ""
echo ""
echo ""
echo ""
# Create initial database
db_create_fail=1
while [ $db_create_fail -eq 1 ]
do
name_valid=0
while [ $name_valid -eq 0 ]
do
echo "What would you like to call the database for this installation of OpenDRS?"
echo "If you accept the default or make it blank, it will be $inst_name."
echo "Spaces or special characters are not allowed in the name."
echo -n "database name [$inst_name]: "
read new_db_name
if [ "$new_db_name" = "" ]
then
new_db_name=$inst_name
fi
echo $new_db_name|egrep -q "\W"
if [ $? -eq 0 ]
then
echo "The name you entered seems to contain whitespace or special"
echo "characters. Try again or just accept the default."
else
name_valid=1
fi
done
echo ""
export MYSQL_PWD="$mysql_adm_pass"
mysql -u"$mysql_adm_user" -e "create database $new_db_name"
if [ $? -eq 0 ]
then
db_create_fail=0
else
echo "An error was encountered when trying to create the database."
echo "This probably means the database already exists."
echo -n "Try again with a different database name? [Y/N]: "
read dbcreatetry
if [ "$dbcreatetry" != "Y" -o "$dbcreatetry" != "y" ]
then
exit
fi
fi
done
# Create user and give rights to database
drs_user="$new_db_name-user"
drs_pass=`uuidgen`
export MYSQL_PWD="$mysql_adm_pass"
mysql -u"$mysql_adm_user" -e "create user if not exists '$drs_user'@'localhost' identified by '$drs_pass'"
mysql -u"$mysql_adm_user" -e "grant all on $new_db_name.* to '$drs_user'@'localhost'"
mysql -u"$mysql_adm_user" -e "flush privileges"
# Populate initial database
mysql -u"$mysql_adm_user" $new_db_name < ../opendrs-initial.sql
# Set the installation name
export MYSQL_PWD="$drs_pass"
mysql -u"$drs_user" $new_db_name -e "update config set value=\"$inst_name\",defaultvalue=\"$inst_name\" where name=\"app_name\""
# Create install path
echo ""
echo ""
echo ""
echo ""
echo "Creating installation directory . . ."
echo ""
echo ""
echo ""
echo ""
echo "Installing to $docroot_path/$inst_name"
sleep 10
install_path=$docroot_path/$inst_name
mkdir $install_path
# Create db.php if it doesn't exist
if [ ! -f "$install_path/db.php" ]
then
cp ../db.php.template $install_path/db.php
sed -i "s/DBNAME/$new_db_name/g" $install_path/db.php
sed -i "s/DBUSER/$drs_user/g" $install_path/db.php
sed -i "s/DBPASS/$drs_pass/g" $install_path/db.php
fi
# copy distribution to install location
echo "Installing distribution . . ."
cp -Rv ../distfiles/* $install_path
ln -s $install_path/writeups.php $install_path/index.php
echo ""
echo ""
echo ""
echo ""
# set ownership
echo "In order to set the ownership correctly, we need to know the user and"
echo "group that the webserver expects its files to be owned by. This is"
echo "usually not the root account. Refer to the ownership of other files in"
echo "your webserver's document tree to see what this should be."
echo "Enter the user and group separated by a colon (username:groupname)."
echo "Enter the user:group of the OpenDRS installation"
echo -n "directory [$apache_user:$apache_group] :"
read httpd_user_group_in
if [ "$http_user_group_in" != "" ]
then
http_user_group=$http_user_group_in
fi
echo ""
echo "Setting file ownership . . ."
chown -R $httpd_user_group $install_path
ln -s $install_path $new_link_name
cp etc/apache2/conf-available/opendrs.conf /etc/apache2/conf-available
cp etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available
a2enconf opendrs
echo "DRS_SERVER=\"http://localhost\"" > /etc/drs.conf
service apache2 restart
echo ""
echo "Server configuration is now complete. "
echo "Once the reboot is complete you will need to do the final installation of OpenDRS through"
echo "the browser. You will need the password you set during the mysql installation above."
# tell user to launch web browser to continue
echo ""
echo ""
echo "It is highly recommended that after rebooting, you press ctrl-alt-F2,"
echo "log in as pi, then create new users for yourself and any other"
echo "administrators using the cloneuser command (cloneuser pi newlogin)."
echo ""
echo "OpenDRS has been installed."
echo "# OpenDRS default Apache configuration" > /etc/apache2/conf-available/$inst_name.conf
echo "" >> /etc/apache2/conf-available/$inst_name.conf
echo "Alias /$inst_name $install_path" >> /etc/apache2/conf-available/$inst_name.conf
echo "" >> /etc/apache2/conf-available/$inst_name.conf
echo "<Directory $install_path>" >> /etc/apache2/conf-available/$inst_name.conf
echo " Options FollowSymLinks" >> /etc/apache2/conf-available/$inst_name.conf
echo " DirectoryIndex index.php" >> /etc/apache2/conf-available/$inst_name.conf
echo "</Directory>" >> /etc/apache2/conf-available/$inst_name.conf
a2enconf $inst_name
service apache2 reload
echo "OpenDRS server setup is complete."
echo ""
echo "Once the reboot is complete you will need to do the final installation of $inst_name through"
echo "the browser. You will need the mysql username and password you set during the mysql installation above."
echo ""
echo ""
echo -n "Press enter to reboot now."
read rebootok
reboot
echo "Once the final install is done, you will need to log in to $inst_name to configure it."
echo "IMPORTANT: The default login credentials for the initial admin user are:"
echo ""
echo "login: drsadmin"
echo "password: OpenDRS-1"
echo ""
echo "REMEMBER THESE CREDENTIALS. Otherwise, you will not be able to log in and"
echo "configure your new installation."
echo "It is highly recommended that you change the initial password to something"
echo "secure after logging in for the first time."
echo "DRS_SERVER=\"http://localhost/$inst_name\"" > /etc/drs.conf

View File

@@ -2,7 +2,7 @@
# terminal-setup.sh
# OpenDRS Online Maintenance Tracking System
# Copyright (C) 2018 Rod Wright
# Copyright (C) 2021 Rod Wright
# SPDX-License-Identifier: GPL-2.0
@@ -15,7 +15,7 @@ echo ""
echo ""
echo "You should have already completed the following steps:"
echo ""
echo "1. Created a Raspbian Lite SD card from the latest release."
echo "1. Created a Raspberry Pi OS Lite SD card from the latest release."
echo "2. Installed the card in a Raspberry Pi, booted it, and logged in as pi."
echo "3. Ran sudo raspi-config and :"
echo " a. Set a strong password for the pi user."
@@ -30,29 +30,48 @@ echo " f. Reboot when prompted and logged back in as pi."
echo "4. Transferred the OpenDRS distribution package to /home/pi on the"
echo " Raspberry Pi and extracted it."
echo "5. Changed directory to RPiSetup in the the extracted distribution directory."
echo "6. Ran sudo ./terminal-setup.sh (this file)."
echo ""
echo "If you have completed these steps, press enter to continue. If not,"
echo -n "press ctrl-c to quit."
read continueok
echo ""
echo ""
echo "Updating Raspbian..."
echo ""
echo ""
echo "Updating Raspberry Pi OS..."
sleep 10
echo ""
echo ""
echo ""
echo ""
apt update && apt dist-upgrade -y
echo ""
echo ""
echo ""
echo ""
echo "...done."
sleep 10
echo ""
echo ""
echo "Copying files..."
chmod +x usr/local/bin/*
cp usr/local/bin/* /usr/local/bin
cp etc/apt/sources.list.d/* /etc/apt/sources.list.d
cp lib/systemd/system/getty@tty1.service /lib/systemd/system
rm /lib/systemd/system/ctrl-alt-del.target
ln -s /dev/null /lib/systemd/system/ctrl-alt-del.target
echo ""
echo ""
echo ""
echo ""
echo "...done."
sleep 10
echo ""
echo ""
echo "Installing required terminal packages..."
sleep 10
echo ""
echo ""
echo ""
echo ""
wget http://www.webmin.com/jcameron-key.asc
apt-key add jcameron-key.asc
rm jcameron-key.asc
@@ -70,6 +89,10 @@ cd brlaser-master
cmake . && make && make install
cd ..
myhn=`hostname`
echo ""
echo ""
echo ""
echo ""
echo "Drivers have been installed for the Brother HL-L2300D printer that may come"
echo "with the terminal."
echo "After the terminal is set up and working, you can use another network"
@@ -80,41 +103,45 @@ read continueok
echo ""
echo ""
echo "Creating customer user..."
cloneuser pi customer
sleep 10
echo ""
echo ""
echo ""
echo ""
cloneuser `who am i | awk '{print $1}'` customer
mkdir -p /home/customer/.config/openbox
cp home/customer/.profile /home/customer
cp home/customer/.config/openbox/rc.xml /home/customer/.config/openbox
chown -R customer:customer /home/customer/.config /home/customer/.profile
echo ""
echo ""
echo ""
echo ""
echo "...done."
echo ""
echo ""
echo "This terminal will need to communicate with an OpenDRS server. If"
echo "you intend to host the server directly on this terminal, accept the"
echo "default URL shown. Otherwise, enter the server URL."
echo -n "[http://localhost] :"
echo "you intend to host the server directly on this terminal, leave this"
echo -n "blank. Otherwise, enter the server URL :"
read server_url
if [[ $server_url == "" ]]
then
server_url="http://localhost"
fi
echo "DRS_SERVER=\"$server_url\"" > /etc/drs.conf
echo ""
echo ""
echo "Terminal configuration is now complete. "
echo ""
echo ""
echo "If this Raspberry Pi will also be used as the OpenDRS server, you will need"
echo "to run the server-setup.sh script in this same directory."
echo "Would you like to do that now? enter Y if so, or press enter to leave this"
echo -n "as a terminal only and reboot :"
read serverchoice
if [[ $serverchoice == "Y" || $serverchoice == "y" ]]
then
conftype="Server/Terminal"
touch /etc/drs.conf
./server-setup.sh
else
conftype="Terminal"
echo "DRS_SERVER=\"$server_url\"" > /etc/drs.conf
fi
echo "It is highly recommended that after rebooting, you press ctrl-alt-F2,"
echo "log in as pi, then create new users for yourself and any other"
echo "administrators using the cloneuser command (cloneuser pi newlogin)."
echo ""
echo ""
echo "$conftype configuration is now complete. "
echo ""
echo ""
echo "It is highly recommended that after rebooting, you run ssh pi@$HOSTNAME"
echo "from another computer on the network, then create new users for"
echo "yourself and any other administrators using the cloneuser command"
echo "(cloneuser pi <new username>)."
echo ""
echo ""
echo "Setup complete."

View File

@@ -2,17 +2,27 @@
SRC=$1
DEST=$2
if [ $# -ne 2 ]; then
echo "Usage: cloneuser source_user destination_user"
exit 1
fi
if ! grep -q $SRC /etc/passwd ;then echo "Source user doesn't exist!"; exit 1; fi
if grep -q $DEST /etc/passwd ;then echo "Destination user already exists!"; exit 1; fi
SRC_GROUPS=`id -Gn ${SRC}`
SRC_SHELL=$(awk -F : -v name=${SRC} '(name == $1) { print $7 }' /etc/passwd)
RAND_PW=`date +%s | sha256sum | base64 | head -c 32 ; echo`
echo "Creating user $DEST"
useradd --shell ${SRC_SHELL} --create-home ${DEST}
echo "Creating user $DEST with a random password"
useradd --shell ${SRC_SHELL} --password ${RAND_PW} --create-home ${DEST}
for grp in ${SRC_GROUPS};do
if [ "$grp" != "$SRC" ]; then
echo "Adding user $DEST to group $grp."
usermod -a -G $grp ${DEST}
fi
done
passwd ${DEST}
echo "Finished. Please set an actual password for $DEST if you want them to be able to log in."

View File

@@ -7,18 +7,16 @@ openbox-session &
xset s off
xset +dpms
xset dpms 0 600 1800
#xset dpms force off
while true
do
killall chromium-browser
rm -rf ~/.{config,cache}/chromium/
# start browser in your web site: here, just plain old localhost
# -test-type will ignore any warnings and
# start browser to DRS Server
# --test-type will ignore any warnings and
# --ignore-certificate-errors will allow you to kiosk any https-page without displaying certificate errors
chromium-browser -test-type --ignore-certificate-errors --kiosk --no-first-run --incognito $DRS_SERVER &
chromium-browser --test-type --ignore-certificate-errors --kiosk --no-first-run --check-for-update-interval=1 --simulate-upgrade --incognito $DRS_SERVER &
sleep 10
@@ -27,8 +25,8 @@ do
pgrep chromium-browse
if [ "$?" -eq "1" ]
then
# here you could execute something that is supposed to happen after the browser was accidentally quit
chromium-browser -test-type --ignore-certificate-errors --kiosk --no-first-run --incognito $DRS_SERVER &
# relaunch browser if it terminates
chromium-browser --test-type --ignore-certificate-errors --kiosk --no-first-run --check-for-update-interval=1 --simulate-upgrade --incognito $DRS_SERVER &
fi
sleep 1
done

View File

@@ -1,6 +1,6 @@
Raspberry Pi setup
1. Create Raspbian Lite SD card from the most recent stable release.
1. Create Raspberry Pi OS Lite SD card from the most recent stable release.
2. Insert SD card in Raspberry Pi and boot.
@@ -8,24 +8,24 @@ Raspberry Pi setup
4. sudo raspi-config and:
a. Use option 1 to set a strong password for the default user (pi).
a. Set a strong password for the default user (pi).
b. Use option 2 Network Options to:
1. Set the desired hostname.
2. Set WiFi SSID and passphrase if using WiFi for networking.
b. Set the desired hostname.
c. Use option 4 Localisation Options to:
1. Set locale.
c. Set Wireless LAN SSID and passphrase if using WiFi for networking.
c. Use Localisation Options to:
1. Set locale to en_US.UTF-8 UTF-8.
2. Set timezone.
3. Set keyboard layout (IMPORTANT! Raspbian is made in England, so
unless that's the kind of keyboard you have, the default layout
will make your symbols come out wrong!).
4. Set WiFi country.
3. Set keyboard layout (IMPORTANT! Raspberry Pi OS is made in
England, so unless that's the kind of keyboard you have, the
default layout will make your symbols come out wrong!).
4. Set WLAN country.
d. Use option 5 Interfacing Options to enable SSH server.
d. Use Interfacing Options to enable SSH server.
e. If you have black borders on the sides of the screen, use option 7
Advanced Options to select No for Overscan compensation.
e. If you have black borders on the sides of the screen, use Display
Underscan option to change Overscan compensation.
f. When you've finished, tab down to highlight Finish and hit enter.

View File

@@ -2,7 +2,7 @@
/*
boilerplate.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
Copyright (C) 2020 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
@@ -48,7 +48,7 @@ if ($print=="Printer Friendly") {
$mbgcolor=MENUBG_COLOR;
}
$role=dblookup($mts_db,"users","id","role",$userid);
$role=dblookup($drs_db,"users","id","role",$userid);
framework("begin","$appname","Boilerplate Page",$print);

View File

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

View File

@@ -1,5 +1,5 @@
OpenDRS - Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
Copyright (C) 2020 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
@@ -27,17 +27,46 @@ Changelog
back button in terminal mode.
- Added configurable help text for period effective selection.
- Changed Sim period effective from selection to yes/no radio buttons.
- Writeup groups page shows collapsed list of groups. Click the expand icon
to expand each group.
- Fixed bug where entries made on stale create page had inaccurate date/time.
- For logged in users, added the ability to select writeups directly on the
View All Writeups page and assign/create a group.
- On the Create New Writeup page, removed the default selections for Device,
Subsystem, and Period dropdowns, forcing user to make a selection.
- Writeup groups page shows collapsed list of groups. Click the expand
icon to expand each group.
- Fixed bug where entries made on stale create page had inaccurate
date/time.
- For logged in users, added the ability to select writeups directly on
the View All Writeups page and assign/create a group.
- On the Create New Writeup page, removed the default selections for
Device, Subsystem, and Period dropdowns, forcing user to make a
selection.
- Added a Today button to the View All Writeups page
- Changed the Period dropdowns on the Create, Search, and Group pages to show
the times instead of the period numbers. Period numbers are still shown
in the results tables with mouse hover showing times.
- Changed the Period dropdowns on the Create, Search, and Group pages to
show the times instead of the period numbers. Period numbers are
still shown in the results tables with mouse hover showing times.
- Moved all installation/upgrade functions to the install.sh script.
1.1.1 - 2020-04-09
- Fixed opendrs-update.sql to rename the trainers table.
- Fixed bug where the About page didn't show the version number.
- Fixed some grammar on the About page.
- Fixed hardcoded help text in groups.php to use constant from config.
- Added ID to searchable parameters in search.php.
- Added sort parameters to search results.
- Added a link for Admins to access the local Webmin to manage a terminal.
- For Raspberry Pi:
- In terminal setup, provided missing .profile and
.config/openbox/rc.xml files.
- In server setup, install mariadb-server since
mysql-server is obsolete.
- Changed startdrs.sh to re-enable ctrl keys for copy/paste, etc. Also
added chromium flags to prevent update popup.
- Added openbox keybindings to customer user's rc.xml to trap dangerous
chromium hotkey combinations and enable ctrl-alt-del reboot.
- Changed systemd ctrl-alt-del.target symlink to point to
reboot.target.
1.1.2 - 2021-04-28
- Added ability to export search results as a CSV file.
- Fixed bug in server-setup.sh that resulted in an incorrect install
location if the installation name was left at the default.
- Fixed bug in server-setup.sh that resulted in failure to set the
ownership of the installed server directory tree if the http
user and group names were left at the default.
- Updated and tested to support Raspberry Pi 4B hardware.

View File

@@ -14,7 +14,7 @@ follow the prompts.
4. Log in
Click on the Log In menu option on the main page. If this is a fresh
installation The initial user is drsadmin and the initial password
is OpenDRS-1. It is highly recommended that you changethis password
is OpenDRS-1. It is highly recommended that you change this password
to a strong one by going to the Manage Database page under the
Admin Functions menu. If this an upgrade, your current usernames and
passwords are unchanged.

View File

@@ -2,7 +2,7 @@
/*
about.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
Copyright (C) 2020 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
@@ -39,6 +39,7 @@ if ($print) {
// assign variables from constants
$appname=APP_NAME;
$drs_version=DRS_VERSION;
if ($print=="Printer Friendly") {
$sbcolor=P_SIDEBAR_COLOR;
@@ -72,7 +73,7 @@ echo "<br>";
echo "
<h3 align=\"center\">
OpenDRS $version Discrepancy Reporting System
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) 2018 by Rod Wright.
@@ -119,7 +120,7 @@ server.</td>
<tr>
<td><a href=\"http://p.yusukekamiyamane.com\" target=\"_blank\"><img src=\"images/Kamiyamane.png\"
border=0></a></td><td><b>Fugue<br>Icons</b></td><td>The icons used in OpenDRS are from the Fugue Icon set created by Yusuke Kamiyamane. The entire set is available at
<a href=\"http://p.yusukekamiyamane.com/\" target=\"_blank\">p.yusukekamiyamane.com</a>, and are licensed under a
<a href=\"http://p.yusukekamiyamane.com/\" target=\"_blank\">p.yusukekamiyamane.com</a>, and is licensed under the
<a href=\"http://creativecommons.org/licenses/by/3.0/legalcode\" target=\"_blank\">Creative Commons Attribution 3.0 License</a>.</td>
</tr>

View File

@@ -2,7 +2,7 @@
/*
common.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
Copyright (C) 2020 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
@@ -357,7 +357,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\"><font size=\"+1\"><b>View Open Writeups</b></font></a></td></tr>
<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=\"groups.php\" title=\"View writeup groups\">Writeup Groups</a></td></tr>
<tr><td align=\"center\"><a href=\"search.php\">Search Writeups</a></td></tr>
@@ -374,6 +374,7 @@ function sidemenu($printable=true) {
<tr><td align=\"center\"><b>Admin Functions</b></td></tr>
<tr><td align=\"center\"><a href=\"config.php\" title=\"Control global settings. Must be an administrator.\">Global Settings</a></td></tr>
<tr><td align=\"center\"><a href=\"dbadmin.php\" title=\"Manage the database. Must be an administrator.\">Manage Database</a></td></tr>
<tr><td align=\"center\"><a href=\"https://localhost:10000\" title=\"Webmin for managing a terminal. Webmin must be running on localhost.\">Manage Terminal</a></td></tr>
</table>
<br>
";
@@ -806,5 +807,4 @@ function group_table($groupid,$role=false,$mode="view",$selection="none",$expand
}
?>

View File

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

View File

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

View File

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

View File

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

View File

@@ -2,7 +2,7 @@
/*
groups.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
Copyright (C) 2020 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
@@ -490,8 +490,7 @@ if ($action=="add") {
";
// Period effective cell ************
echo "
Sim period effective? &nbsp; <img src=\"icons/question.png\" title=\"If maintenance issues prevented the training objectives from being achieved and you will have to come back and redo the same training, answer Non-effective.
Otherwise, answer Effective. \"><br>
Sim period effective? &nbsp; <img src=\"icons/question.png\" title=\"" . PERIOD_EFF_HELP_TXT . "\"><br>
";
if ($search) {
$effstate=$nefstate="";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 481 B

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

@@ -2,7 +2,7 @@
/*
writeups.php
OpenDRS Online Discrepancy Reporting System
Copyright (C) 2018 Rod Wright
Copyright (C) 2020 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
@@ -58,7 +58,6 @@ function opentable($start_date,$end_date,$print,$drs_db,$viewtype="summary") {
";
if ($print) {
echo "
<form method=post action=\"writeups.php\">
Open writeups between&nbsp;&nbsp; $start_date and $end_date
";
} else {
@@ -175,20 +174,27 @@ function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$rol
echo "
<form method=post action=\"writeups.php\">
<input type=\"hidden\" name=\"view\" value=\"1\">
Writeups between&nbsp;&nbsp;
<input type=\"text\" name=\"start_date\" size=\"10\" value=\"$start_date\" id=\"startdatepicker\" title=\"Format: YYYY-MM-DD\">&nbsp;&nbsp; and &nbsp;&nbsp;
<input type=\"text\" name=\"end_date\" size=\"10\" value=\"$end_date\" id=\"enddatepicker\" title=\"Format: YYYY-MM-DD\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
";
if(!$print) {
echo "
<input type=\"submit\" name=\"update\" value=\"Update\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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>
<input type=\"submit\" name=\"show30day\" value=\"Last 30 Days\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
";
}
echo "
Writeups between&nbsp;&nbsp;
<input type=\"text\" name=\"start_date\" size=\"10\" value=\"$start_date\" id=\"startdatepicker\" title=\"Format: YYYY-MM-DD\">&nbsp;&nbsp; and &nbsp;&nbsp;
<input type=\"text\" name=\"end_date\" size=\"10\" value=\"$end_date\" id=\"enddatepicker\" title=\"Format: YYYY-MM-DD\"><br><br>
";
if(!$print) {
echo "
<input type=\"radio\" $summarystat name=\"viewtype\" value=\"summary\" id=\"summaryview\" ><label for=\"summaryview\" title=\"Show one writeup per line with minimal detail.\">Results in summary view</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $detailstat name=\"viewtype\" value=\"detail\" id=\"detailview\"><label for=\"detailview\" title=\"Show each writeup's full details.\">Results in detail view</label>
<br><br>";
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"submit\" name=\"update\" value=\"Update\">
<br><br>
";
}
$writeup=mysqli_query($drs_db,"select * from writeups where report_date between \"$start_date\" and \"$end_date\" order by report_date desc,period desc,report_time desc");
if (mysqli_num_rows($writeup)) {
@@ -306,7 +312,7 @@ function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$rol
if ($role) {
echo "
<br><br>
<button name=\"addtogroup\" value=\"addtogroup\" type=\"submit\">Add selected to group:</button>&nbsp;&nbsp;&nbsp;<select name=\"togroup\" id=\"sel-togroup\">
Add selected to group:&nbsp;&nbsp;&nbsp;<select name=\"togroup\" id=\"sel-togroup\">
<option value=\"newgroup\">New group</option>
";
$tgrow=mysqli_query($drs_db,"select id,name from groups order by id asc");
@@ -315,6 +321,7 @@ function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$rol
}
echo "
</select>
&nbsp;&nbsp;&nbsp;<button name=\"addtogroup\" value=\"addtogroup\" type=\"submit\">Submit</button>
";
}
} else {

View File

@@ -2,12 +2,12 @@
# install.sh
# OpenDRS Online Discrepancy Reporting System
# Copyright (C) 2018 Rod Wright
# Copyright (C) 2021 Rod Wright
# SPDX-License-Identifier: GPL-2.0
DRS_VERSION="1.1.0"
DRS_VERSION="1.1.2"
DOC_ROOT="/var/www"
INSTALL_LOC="opendrs"
APACHE_USER="www-data"
@@ -42,15 +42,6 @@ echo ""
echo -n "Enter name of OpenDRS installation directory [$INSTALL_LOC] :"
read install_loc_in
echo ""
echo "In order to set the ownership correctly, we need to know the user and"
echo "group that the webserver expects its files to be owned by. This is"
echo "usually not the root account. Refer to the ownership of other files in"
echo "your webserver's document tree to see what this should be."
echo "Enter the user and group separated by a colon (username:groupname)."
echo "Enter the user:group of the OpenDRS installation"
echo -n "directory [$APACHE_USER:$APACHE_GROUP] :"
read httpd_user_group
echo ""
if [ "$doc_root_in" = "" ]
then
doc_root_in=$DOC_ROOT
@@ -59,10 +50,6 @@ if [ "$install_loc_in" = "" ]
then
install_loc_in=$INSTALL_LOC
fi
if [ "$httpd_user_group" = "" ]
then
httpd_user_group="$APACHE_USER:$APACHE_GROUP"
fi
install_path="$doc_root_in/$install_loc_in"
if [ -d "$install_path" ]
then
@@ -90,22 +77,36 @@ then
curr_dbname=`grep dbname $install_path/db.php | head -1 | cut -d "\"" -f2`
curr_username=`grep username $install_path/db.php | head -1 | cut -d "\"" -f2`
curr_dbpass=`grep dbpass $install_path/db.php | head -1 | cut -d "\"" -f2`
mysqldump -u"$curr_username" -p"$curr_dbpass" $curr_dbname > $curr_dbname-`date +%Y-%m-%d_%H:%M:%S`-backup.sql
export MYSQL_PWD="$curr_dbpass"
mysqldump -u"$curr_username" $curr_dbname > $curr_dbname-`date +%Y-%m-%d_%H:%M:%S`-backup.sql
# back up existing installation
echo "Backing up current installation to the package directory."
cp -R $install_path $install_loc_in-`date +%Y-%m-%d_%H:%M:%S`-backup
# delete all existing installation files except db.php
find $install_path/ -mindepth 1 -not -name 'db.php' -delete
# apply database updates
mysql -u"$curr_username" -p"$curr_dbpass" $curr_dbname < opendrs-update.sql
mysql -u"$curr_username" $curr_dbname < opendrs-update.sql >/dev/null 2>&1
# apply updates to existing db.php
./opendrs-update.sh $install_path
# copy distribution to install location
echo "Installing distribution . . ."
cp -R distfiles/* $install_path
# set ownership
echo "In order to set the ownership correctly, we need to know the user and"
echo "group that the webserver expects its files to be owned by. This is"
echo "usually not the root account. Refer to the ownership of other files in"
echo "your webserver's document tree to see what this should be."
echo "Enter the user and group separated by a colon (username:groupname)."
echo "Enter the user:group of the OpenDRS installation"
echo -n "directory [$APACHE_USER:$APACHE_GROUP] :"
read httpd_user_group
if [ "$httpd_user_group" = "" ]
then
httpd_user_group="$APACHE_USER:$APACHE_GROUP"
fi
echo ""
echo "Setting file ownership . . ."
chown -R $httpd_user_group $install_path
chown -R $httpd_user_group $install_path
else
echo "Cancelling installation"
exit
@@ -138,7 +139,8 @@ else
echo ""
echo -n "MySQL admin password: "
read -s mysql_adm_pass
mysql -u"$mysql_adm_user" -p"$mysql_adm_pass" -e "create database $admintestdb;drop database $admintestdb" 2>/dev/null
export MYSQL_PWD="$mysql_adm_pass"
mysql -u"$mysql_adm_user" -e "create database $admintestdb;drop database $admintestdb"
if [ $? -eq 0 ]
then
bad_mysql_adm=0
@@ -171,8 +173,13 @@ else
echo "distinctive name."
echo -n "database name [opendrs]: "
read new_db_name
if [ "$new_db_name" = "" ]
then
new_db_name=opendrs
fi
echo ""
mysql -u"$mysql_adm_user" -p"$mysql_adm_pass" -e "create database $new_db_name" 2>/dev/null
export MYSQL_PWD="$mysql_adm_pass"
mysql -u"$mysql_adm_user" -e "create database $new_db_name"
if [ $? -eq 0 ]
then
db_create_fail=0
@@ -191,15 +198,17 @@ else
# Create user and give rights to database
drs_user="$new_db_name`date +%Y%m%d%H%M%S`"
drs_pass=`uuidgen`
mysql -u"$mysql_adm_user" -p"$mysql_adm_pass" -e "create user if not exists '$drs_user'@'localhost' identified by '$drs_pass'" 2>/dev/null
mysql -u"$mysql_adm_user" -p"$mysql_adm_pass" -e "grant all on $new_db_name.* to '$drs_user'@'localhost'"
mysql -u"$mysql_adm_user" -p"$mysql_adm_pass" -e "flush privileges"
export MYSQL_PWD="$mysql_adm_pass"
mysql -u"$mysql_adm_user" -e "create user if not exists '$drs_user'@'localhost' identified by '$drs_pass'"
mysql -u"$mysql_adm_user" -e "grant all on $new_db_name.* to '$drs_user'@'localhost'"
mysql -u"$mysql_adm_user" -e "flush privileges"
# Populate initial database
mysql -u"$mysql_adm_user" -p"$mysql_adm_pass" $new_db_name < opendrs-initial.sql 2>/dev/null
mysql -u"$mysql_adm_user" $new_db_name < opendrs-initial.sql
# Set the installation name
mysql -u"$drs_user" -p"$drs_pass" $new_db_name -e "update config set value=\"$new_inst_name\",defaultvalue=\"$new_inst_name\" where name=\"app_name\""
export MYSQL_PWD="$drs_pass"
mysql -u"$drs_user" $new_db_name -e "update config set value=\"$new_inst_name\",defaultvalue=\"$new_inst_name\" where name=\"app_name\""
# Create install path
echo "Creating installation directory . . ."
@@ -219,8 +228,21 @@ else
cp -Rv distfiles/* $install_path
# set ownership
echo "In order to set the ownership correctly, we need to know the user and"
echo "group that the webserver expects its files to be owned by. This is"
echo "usually not the root account. Refer to the ownership of other files in"
echo "your webserver's document tree to see what this should be."
echo "Enter the user and group separated by a colon (username:groupname)."
echo "Enter the user:group of the OpenDRS installation"
echo -n "directory [$APACHE_USER:$APACHE_GROUP] :"
read httpd_user_group
if [ "$httpd_user_group" = "" ]
then
httpd_user_group="$APACHE_USER:$APACHE_GROUP"
fi
echo ""
echo "Setting file ownership . . ."
chown -R $httpd_user_group $install_path
chown -R $httpd_user_group $install_path
fi
echo ""

View File

@@ -63,7 +63,7 @@ CREATE TABLE `config` (
LOCK TABLES `config` WRITE;
/*!40000 ALTER TABLE `config` DISABLE KEYS */;
INSERT INTO `config` VALUES (1,'drs_version','1.1.0','1.1.0'),(5,'app_name','OpenDRS - Discrepancy Reporting System','OpenDRS Discrepancy Reporting System'),(6,'banner','1','1'),(7,'background_color','0B3144','0B3144'),(8,'p_background_color','FFFFFF','FFFFFF'),(11,'menubg_color','000000','000000'),(12,'p_menubg_color','FFFFFF','FFFFFF'),(13,'text_color','FFFFFF','FFFFFF'),(14,'p_text_color','000000','000000'),(15,'link_color','79EFEA','79EFEA'),(16,'p_link_color','000000','000000'),(17,'vlink_color','79EFEA','79EFEA'),(18,'p_vlink_color','000000','000000'),(19,'heading_color','5AE2B3','5AE2B3'),(20,'p_heading_color','000000','000000'),(21,'footer_message','Please report bugs to Rod Wright (software@rodsplace.net)','Please report bugs to Rod Wright (software@rodsplace.net)'),(26,'unix_server_session_dir','/tmp/opendrs/opendrs/sessions','/tmp/opendrs/opendrs/sessions'),(27,'win_server_session_dir','c:\\Windows\\Temp\\opendrs\\opendrs\\sessions','c:\\Windows\\Temp\\opendrs\\opendrs\\sessions'),(28,'session_ttl_days','30','30'),(29,'period_eff_help_txt','If maintenance issues prevented the training objectives from being achieved and you will have to come back and redo the same training, answer Non-effective. Otherwise, answer Effective.','If maintenance issues prevented the training objectives from being achieved and you will have to come back and redo the same training, answer Non-effective. Otherwise, answer Effective.');
INSERT INTO `config` VALUES (1,'drs_version','1.1.2','1.1.2'),(5,'app_name','OpenDRS - Discrepancy Reporting System','OpenDRS Discrepancy Reporting System'),(6,'banner','1','1'),(7,'background_color','0B3144','0B3144'),(8,'p_background_color','FFFFFF','FFFFFF'),(11,'menubg_color','000000','000000'),(12,'p_menubg_color','FFFFFF','FFFFFF'),(13,'text_color','FFFFFF','FFFFFF'),(14,'p_text_color','000000','000000'),(15,'link_color','79EFEA','79EFEA'),(16,'p_link_color','000000','000000'),(17,'vlink_color','79EFEA','79EFEA'),(18,'p_vlink_color','000000','000000'),(19,'heading_color','5AE2B3','5AE2B3'),(20,'p_heading_color','000000','000000'),(21,'footer_message','Please report bugs to Rod Wright (software@rodsplace.net)','Please report bugs to Rod Wright (software@rodsplace.net)'),(26,'unix_server_session_dir','/tmp/opendrs/opendrs/sessions','/tmp/opendrs/opendrs/sessions'),(27,'win_server_session_dir','c:\\Windows\\Temp\\opendrs\\opendrs\\sessions','c:\\Windows\\Temp\\opendrs\\opendrs\\sessions'),(28,'session_ttl_days','30','30'),(29,'period_eff_help_txt','If maintenance issues prevented the training objectives from being achieved and you will have to come back and redo the same training, answer Non-effective. Otherwise, answer Effective.','If maintenance issues prevented the training objectives from being achieved and you will have to come back and redo the same training, answer Non-effective. Otherwise, answer Effective.');
/*!40000 ALTER TABLE `config` ENABLE KEYS */;
UNLOCK TABLES;

View File

@@ -1,22 +1,41 @@
# opendrs-update.sql
-- opendrs-update.sql
# ---------- version 1.1.0 -------------
# Update version number
update config set name="drs_version" where name="mts_version";
update config set value="1.1.0",defaultvalue="1.1.0" where name="drs_version";
-- ---------- version 1.1.0 -------------
-- Update version number
UPDATE config SET name="drs_version" WHERE name="mts_version";
UPDATE config SET value="1.1.0",defaultvalue="1.1.0" WHERE name="drs_version";
# Add period_eff_help_txt to config table
insert into config(name,value,defaultvalue)
select * from
(select 'period_eff_help_txt',
'If maintenance issues prevented the training objectives from being achieved and you will have to come back and redo the same training, answer Non-effective. Otherwise, answer Effective.' as wval,
'If maintenance issues prevented the training objectives from being achieved and you will have to come back and redo the same training, answer Non-effective. Otherwise, answer Effective.' as dval
-- Add period_eff_help_txt to config table
INSERT INTO config(name,value,defaultvalue)
SELECT * FROM
(SELECT 'period_eff_help_txt',
'If maintenance issues prevented the training objectives from being achieved and you will have to come back and redo the same training, answer Non-effective. Otherwise, answer Effective.' AS wval,
'If maintenance issues prevented the training objectives from being achieved and you will have to come back and redo the same training, answer Non-effective. Otherwise, answer Effective.' AS dval
)
as tmp
where not exists
AS tmp
WHERE NOT EXISTS
(
select name from config where name = 'period_eff_help_txt'
) limit 1
SELECT name FROM config WHERE name = 'period_eff_help_txt'
) LIMIT 1
;
# ---------------------------------------
-- --------------------------------------
-- ---------- version 1.1.1 -------------
-- Update version number
UPDATE config SET value="1.1.1",defaultvalue="1.1.1" WHERE name="drs_version";
-- Rename the trainers table to devices
RENAME TABLE trainers TO devices;
-- Update default app name
UPDATE config SET defaultvalue="OpenDRS Discrepancy Reporting System" WHERE name="app_name";
-- Update default session directories
UPDATE config SET defaultvalue="/tmp/opendrs/opendrs/sessions" WHERE name="unix_server_session_dir";
UPDATE config SET defaultvalue="c:\Windows\Temp\opendrs\opendrs\sessions" WHERE name="win_server_session_dir";
-- --------------------------------------
-- ---------- version 1.1.2 -------------
-- Update version number
UPDATE config SET value="1.1.2",defaultvalue="1.1.2" WHERE name="drs_version";
-- --------------------------------------