diff --git a/BUGS b/BUGS
index 39f47d2..26132e5 100644
--- a/BUGS
+++ b/BUGS
@@ -1,4 +1,5 @@
BUGS
1. Adding a reference to a note using the magnifying glass icon is possible even if not logged in. This results in a blank tech and shift.
-SOMEWHAT FIXED. If not logged in and the partview argument is not 1, redirects to login page. (This is not the optimal solution. There needs to be a specific view only state.)
+SOMEWHAT FIXED. If not logged in and the partview argument is not 1, redirects to login page. (This is not the optimal solution. There
+needs to be a specific view only state.)
diff --git a/CHANGELOG b/CHANGELOG
index 28ba9c0..b1224f3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,6 @@
CHANGELOG
OpenLog Online Logbook
- Copyright (C) 2025 Rod Wright
+ Copyright (C) 2026 Rod Wright
SPDX-License-Identifier: GPL-2.0
@@ -244,3 +244,41 @@
5.2.5 - 2026-02-10
This is just a version number bump to get on a major-minor-patch
scheme. There are no code changes for this release.
+
+5.3.0 - 2026-02-20
+ - Moved the template Create/Copy/Edit/Delete/Rename functionality to
+ its own page to make it less confusing and to fix some strange
+ behavior.
+ - Added global templates which can be used by anyone but can only be
+ created, modified, or deleted by administrators. This makes it
+ easier to employ standardized templates.
+ - Changed the character encoding of the database to utf8mb4 to enable
+ using emojis in text fields.
+ - Changed the insert link functionality. There are now two fields, link
+ text, and URL. The full URL string will now not be displayed in the
+ note, since it frequently was too long and deformed the table,
+ causing the user to have to scroll right to see the entire note. If
+ a URL is entered in the URL field and no link text is entered in the
+ link text field, the link will show up as just the last part of the
+ URL. For example, "http://somewhere.com/myfile.pdf" will show as
+ "myfile.pdf" in the note text. If text is entered in the link text
+ field, that is what will show as the clickable link in the note text.
+ NOTE: URLs in previously entered notes will not automatically be
+ converted.
+ - Changed the flag handling code to no longer dynamically create flag_
+ tables in the database to track assignments. This is now done using
+ a flagmap table.
+ NOTE: The database will be modified to support this and the
+ importation of the previous data will take some time during
+ installation.
+ - References will no longer be stored in the lognotes table with the note.
+ There is now a reflinks table that stores the link information.
+ NOTE: The database will be modified to support this and the
+ importation of the previous data will take some time during
+ installation.
+ - Various code cleanups to prevent php warnings in the logs if logging
+ is enabled.
+ - Validate all date and time fields to prevent user entered invalid date
+ formats from crashing php.
+ - Fixed profile page to automatically refresh page to show the results
+ when a user changes their color preferences.
diff --git a/INSTALL b/INSTALL
index c7ced63..6ba22bf 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,35 +1,33 @@
INSTALL
OpenLog Online Logbook
- Copyright (C) 2025 Rod Wright
+ Copyright (C) 2026 Rod Wright
SPDX-License-Identifier: GPL-2.0
-
Installation of OpenLog is straightforward.
1. Gather the required information.
-You'll need to know how to configure your web server. This means where
-you want to put the files to be served and any configuration required to
-allow clients to reach them. You'll also need to know the username and
-password of the MySQL administrator.
+ You'll need to know how to configure your web server. This means where
+ you want to put the files to be served and any configuration required to
+ allow clients to reach them. You'll also need to know the username and
+ password of the MySQL administrator.
2. Unpack
-Unpack the distribution in a convenient place (such as /tmp or My Documents).
-A directory will be created called OpenLog-x.x.x.
+ Unpack the distribution in a convenient place (such as /tmp or My Documents).
+ A directory will be created called OpenLog-x.x.x.
3. Review License
-Change to the openlog-x.x.x directory and review the LICENSE file.
+ Change to the openlog-x.x.x directory and review the LICENSE file.
4. Run the install script
-If installing on a Linux or Unix based system, type ./install.sh at a
-command prompt. If installing on a Windows based system, double click
-install.bat. Follow the prompts.
+ If installing on a Linux or Unix based system, type ./install.sh at a
+ command prompt. If installing on a Windows based system, double click
+ install.bat. Follow the prompts.
5. Check and set Configuration
-Click on the Administration menu option on the main page to adjust the initial
-settings. You will need to log in as OpenLogAdmin. The initial default password
-is "OpenLog-1". From the Administration page, you can click on the links at the
-top to add techs, subjects, shifts, etc.
-
-7. Start using OpenLog.
+ Click on the Administration menu option on the main page to adjust the initial
+ settings. You will need to log in as OpenLogAdmin. The initial default password
+ is "OpenLog-1". From the Administration page, you can click on the links at the
+ top to add techs, subjects, shifts, etc.
+6. Start using OpenLog.
diff --git a/README.md b/README.md
index e69de29..cec85a9 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1,52 @@
+# OpenLog #
+
+OpenLog is an online logbook application. It allows anyone with a web browser to read, enter, and search for notes on any subject.
+
+The available shifts, employees, and subjects are easily configured. Notes can be referred to other notes and the entire chain of referenced notes can be displayed in a single page. This makes it convenient to track ongoing projects or actions on a particular piece of equipment over a long period of time.
+
+Version 5.0 adds parts tracking functionality. Notes can have parts change information associated with them and maintenance/repair forms can be generated for parts. Parts related functions can be disabled to reduce clutter if they are not needed.
+
+Version 5.1 adds scheduled maintenance functionality, which can also be disabled if not needed. Notes, parts, and maintenance forms can be searched for based on a number of criteria.
+
+The look and feel of the OpenLog pages are easily changed. Settings that affect all users can be changed in the Administration menu. Each user can personalize his or her own settings in the My Profile menu.
+
+No browser specific HTML is used in OpenLog, so it should be useable in any browser, and it has been tested using Google Chrome, Mozilla Firefox, Microsoft Internet Explorer, and Edge.
+
+## Prerequisites ##
+
+- Linux - The installer is written to automate installation on Debian based Linux servers, but OpenLog itself should run on any current Linux distribution, albeit installation will need to be accomplished manually.
+- Apache2 - Current development is using version 2.4.65
+- MySQL or MariaDB - Current development is using MariaDB version 11.8.3
+- php - Current development is using version 8.4.11
+
+## Installation ##
+
+> [!NOTE]
+> These instructions are used to either install a new instance of OpenLog or upgrade an existing one.
+
+1. Unzip the OpenLog-x.x.x.tar.gz file you've downloaded into a convenient place.
+2. `cd OpenLog-x.x.x`
+3. `sudo ./install.sh`
+
+* The installer will check for installation of the required packages and prompt for their installation if not found.
+* You'll then be prompted for the webserver's install location. The default should work for standard installations.
+* You'll then be prompted for the installation location of this instance of OpenLog. You should come up with a unique name.
+* If this directory already exists and contains an instance of OpenLog, you will be prompted to cancel the process or upgrade this instance.
+ * If you choose to upgrade, your OpenLog instance will be upgraded and you're done.
+* If this directory does not exist, it will be created and a new instance will be installed. You can have multiple instances of OpenLog running under different names in different directories. For example, if you wanted to create an Operations Log, you could enter `opslog`.
+ * In the Operations Log example referred to above, you could enter `OpsLog` or `Operations Log`.
+ * You'll br prompted for the name of the database to be created. You should choose something appropriate, like `opslog` for the example given.
+ * Next, you'll be prompted to enable the apache2 configuration for this instance.
+ *The new instance will now be installed and accessible. You will be given some important information.
+ > [!IMPORTANT]
+ > The default login credentials for the initial admin user are:
+ > login: `OpenLogAdmin`
+ > password: `OpenLog-1`
+ > Make note of these credentials, otherwise you will not be able to login and configure your new installation.
+ >
+ > It is highly recommended that you change the OpenLogAdmin user password and/or create your own admin user (with a secure password) and disable this default account after logging in for the first time.
+
+
+## History ##
+
+OpenLog was written to replace a creaky old inefficient error prone Access database which had in turn replaced stacks of paper logbooks. Now, with some improvements and over 15 years and 44000 notes later in a production environment, it's still going strong.
diff --git a/TODO.txt b/TODO.txt
index 3d54569..f5e5795 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,15 +1,15 @@
TODO.txt
1. Create a weblink hot button on the add logbook entry page to insert a weblink. DONE
-2. Allow admins to create global templates.
+2. Allow admins to create global templates. DONE
3. Create a way to restore the global page colors. (db change reqd)
4. Pick a logbook subject to associate with a scheduled task to populate for the logbook entry. (db change reqd)
5. Add info messages to scheduled task page edits.
6. Allow scheduled tasks to be completed as a group instead of having to complete each member.
7. Implement popup calendars for date entry fields. DONE
-8. Improve template management interface. It can be confusing. It needs its own page.
-9. Remove refs from templates. (db change reqd)
-10. Replace dynamic flag_ table creation with a flagassignment table. (db change reqd)
+8. Improve template management interface. It can be confusing. It needs its own page. DONE
+9. Remove refs from templates. (db change reqd) DONE
+10. Replace dynamic flag_ table creation with a flagassignment table. (db change reqd) DONE
11. allow partids to be autogenerated if user doesn't supply one (db change reqd)
12. If there are no flags, don't offer to set them on reference chain
13. make some flags immutable so they won't be synced on reference chain.
diff --git a/VERSION.txt b/VERSION.txt
index 462faf7..03f488b 100644
--- a/VERSION.txt
+++ b/VERSION.txt
@@ -1 +1 @@
-5.2.5
+5.3.0
diff --git a/database-initial.sql b/database-initial.sql
index 951c5cf..0ca4ab8 100644
--- a/database-initial.sql
+++ b/database-initial.sql
@@ -1,607 +1,942 @@
--- MariaDB dump 10.19 Distrib 10.6.18-MariaDB, for debian-linux-gnu (x86_64)
+/*M!999999\- enable the sandbox mode */
+-- MariaDB dump 10.19-11.8.3-MariaDB, for debian-linux-gnu (x86_64)
--
--- Host: localhost Database: ol521
+-- Host: localhost Database: openlog
-- ------------------------------------------------------
--- Server version 10.6.18-MariaDB-0ubuntu0.22.04.1
+-- Server version 11.8.3-MariaDB-0+deb13u1 from Debian
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8mb4 */;
-/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
-/*!40103 SET TIME_ZONE='+00:00' */;
-/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
-/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
-/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */
+;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */
+;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */
+;
+/*!40101 SET NAMES utf8mb4 */
+;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */
+;
+/*!40103 SET TIME_ZONE='+00:00' */
+;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */
+;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */
+;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */
+;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */
+;
--
-- Table structure for table `banners`
--
DROP TABLE IF EXISTS `banners`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `banners` (
- `bannerid` int(11) NOT NULL AUTO_INCREMENT,
- `bannername` tinytext DEFAULT NULL,
- `bannercolor` tinytext DEFAULT NULL,
- `textcolor` tinytext DEFAULT NULL,
- PRIMARY KEY (`bannerid`)
-) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `bannerid` int(11) NOT NULL AUTO_INCREMENT,
+ `bannername` tinytext DEFAULT NULL,
+ `bannercolor` tinytext DEFAULT NULL,
+ `textcolor` tinytext DEFAULT NULL,
+ PRIMARY KEY (`bannerid`)
+) ENGINE = InnoDB AUTO_INCREMENT = 6 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `banners`
--
LOCK TABLES `banners` WRITE;
-/*!40000 ALTER TABLE `banners` DISABLE KEYS */;
-INSERT INTO `banners` VALUES
-(1,'no banner','#000000','#000000'),
-(2,'UNCLASSIFIED','#009900','#FFFFFF'),
-(3,'CONFIDENTIAL','#000099','#FFFFFF'),
-(4,'SECRET','#990000','#FFFFFF'),
-(5,'TOP SECRET','#FF6600','#FFFFFF');
-/*!40000 ALTER TABLE `banners` ENABLE KEYS */;
+/*!40000 ALTER TABLE `banners` DISABLE KEYS */
+;
+set autocommit = 0;
+
+INSERT INTO
+ `banners`
+VALUES (
+ 1,
+ 'no banner',
+ '#000000',
+ '#000000'
+ ),
+ (
+ 2,
+ 'UNCLASSIFIED',
+ '#009900',
+ '#FFFFFF'
+ ),
+ (
+ 3,
+ 'CONFIDENTIAL',
+ '#000099',
+ '#FFFFFF'
+ ),
+ (
+ 4,
+ 'SECRET',
+ '#990000',
+ '#FFFFFF'
+ ),
+ (
+ 5,
+ 'TOP SECRET',
+ '#FF6600',
+ '#FFFFFF'
+ );
+/*!40000 ALTER TABLE `banners` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `configs`
--
DROP TABLE IF EXISTS `configs`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `configs` (
- `confid` int(11) NOT NULL AUTO_INCREMENT,
- `confname` text DEFAULT NULL,
- `confvalue` text DEFAULT NULL,
- PRIMARY KEY (`confid`),
- UNIQUE (`confname`)
-) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `confid` int(11) NOT NULL AUTO_INCREMENT,
+ `confname` text DEFAULT NULL,
+ `confvalue` text DEFAULT NULL,
+ PRIMARY KEY (`confid`),
+ UNIQUE KEY `confname` (`confname`) USING HASH
+) ENGINE = InnoDB AUTO_INCREMENT = 33 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `configs`
--
LOCK TABLES `configs` WRITE;
-/*!40000 ALTER TABLE `configs` DISABLE KEYS */;
-INSERT INTO `configs` VALUES
-(1,'ol_version','5.2.5'),
-(2,'log_name','OpenLog'),
-(3,'banner','1'),
-(4,'background_color','#003333'),
-(5,'p_background_color','#FFFFFF'),
-(6,'sidebar_color','#336666'),
-(7,'p_sidebar_color','#FFFFFF'),
-(8,'menubg_color','#000000'),
-(9,'p_menubg_color','#FFFFFF'),
-(10,'text_color','#FFFFFF'),
-(11,'p_text_color','#000000'),
-(12,'link_color','#00FF00'),
-(13,'p_link_color','#000000'),
-(14,'vlink_color','#00FF00'),
-(15,'p_vlink_color','#000000'),
-(16,'heading_color','#00FFFF'),
-(17,'p_heading_color','#000000'),
-(18,'footer_message','Please report bugs to software@thermionic.net.'),
-(19,'show_ts','1'),
-(20,'url_chunk_size','70'),
-(21,'tech_alpha','1'),
-(22,'subj_alpha','1'),
-(23,'unix_server_session_dir','/tmp/openlog/openlog/sessions'),
-(24,'win_server_session_dir','c:\\Windows\\Temp\\openlog\\\\openlog\\sessions'),
-(25,'session_ttl_days','30'),
-(26,'log_style','1'),
-(27,'uid_text','Part ID Number'),
-(28,'parts_functions','1'),
-(29,'schedmaint_functions','1'),
-(30,'log_errors','0');
-/*!40000 ALTER TABLE `configs` ENABLE KEYS */;
+/*!40000 ALTER TABLE `configs` DISABLE KEYS */
+;
+set autocommit = 0;
+
+INSERT INTO
+ `configs`
+VALUES (1, 'ol_version', '5.3.0'),
+ (2, 'log_name', 'OpenLog'),
+ (3, 'banner', '1'),
+ (
+ 4,
+ 'background_color',
+ '#003333'
+ ),
+ (
+ 5,
+ 'p_background_color',
+ '#FFFFFF'
+ ),
+ (6, 'sidebar_color', '#336666'),
+ (
+ 7,
+ 'p_sidebar_color',
+ '#FFFFFF'
+ ),
+ (8, 'menubg_color', '#000000'),
+ (
+ 9,
+ 'p_menubg_color',
+ '#FFFFFF'
+ ),
+ (10, 'text_color', '#FFFFFF'),
+ (11, 'p_text_color', '#000000'),
+ (12, 'link_color', '#00FF00'),
+ (13, 'p_link_color', '#000000'),
+ (14, 'vlink_color', '#00FF00'),
+ (
+ 15,
+ 'p_vlink_color',
+ '#000000'
+ ),
+ (
+ 16,
+ 'heading_color',
+ '#00FFFF'
+ ),
+ (
+ 17,
+ 'p_heading_color',
+ '#000000'
+ ),
+ (
+ 18,
+ 'footer_message',
+ 'Please report bugs to software@thermionic.net.'
+ ),
+ (19, 'show_ts', '1'),
+ (20, 'url_chunk_size', '70'),
+ (21, 'tech_alpha', '1'),
+ (22, 'subj_alpha', '1'),
+ (
+ 23,
+ 'unix_server_session_dir',
+ '/tmp/openlog/openlog/sessions'
+ ),
+ (
+ 24,
+ 'win_server_session_dir',
+ 'c:\\Windows\\Temp\\openlog\\\\openlog\\sessions'
+ ),
+ (25, 'session_ttl_days', '30'),
+ (26, 'log_style', '1'),
+ (
+ 27,
+ 'uid_text',
+ 'Part ID Number'
+ ),
+ (28, 'parts_functions', '1'),
+ (
+ 29,
+ 'schedmaint_functions',
+ '1'
+ ),
+ (30, 'log_errors', '0');
+/*!40000 ALTER TABLE `configs` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `customs`
--
DROP TABLE IF EXISTS `customs`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `customs` (
- `customid` int(11) NOT NULL AUTO_INCREMENT,
- `customtech` int(11) DEFAULT NULL,
- `customconfnum` int(11) DEFAULT NULL,
- `customconfvalue` text DEFAULT NULL,
- PRIMARY KEY (`customid`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `customid` int(11) NOT NULL AUTO_INCREMENT,
+ `customtech` int(11) DEFAULT NULL,
+ `customconfnum` int(11) DEFAULT NULL,
+ `customconfvalue` text DEFAULT NULL,
+ PRIMARY KEY (`customid`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `customs`
--
LOCK TABLES `customs` WRITE;
-/*!40000 ALTER TABLE `customs` DISABLE KEYS */;
-/*!40000 ALTER TABLE `customs` ENABLE KEYS */;
+/*!40000 ALTER TABLE `customs` DISABLE KEYS */
+;
+set autocommit = 0;
+/*!40000 ALTER TABLE `customs` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `devicegroups`
--
DROP TABLE IF EXISTS `devicegroups`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `devicegroups` (
- `groupid` int(11) NOT NULL AUTO_INCREMENT,
- `groupdevice` int(11) DEFAULT NULL,
- `memberdevice` int(11) DEFAULT NULL,
- PRIMARY KEY (`groupid`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `groupid` int(11) NOT NULL AUTO_INCREMENT,
+ `groupdevice` int(11) DEFAULT NULL,
+ `memberdevice` int(11) DEFAULT NULL,
+ PRIMARY KEY (`groupid`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `devicegroups`
--
LOCK TABLES `devicegroups` WRITE;
-/*!40000 ALTER TABLE `devicegroups` DISABLE KEYS */;
-/*!40000 ALTER TABLE `devicegroups` ENABLE KEYS */;
+/*!40000 ALTER TABLE `devicegroups` DISABLE KEYS */
+;
+set autocommit = 0;
+/*!40000 ALTER TABLE `devicegroups` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `devices`
--
DROP TABLE IF EXISTS `devices`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `devices` (
- `deviceid` int(11) NOT NULL AUTO_INCREMENT,
- `devicename` tinytext DEFAULT NULL,
- `devicedesc` text DEFAULT NULL,
- `group_flag` int(11) DEFAULT NULL,
- `active_flag` int(11) DEFAULT NULL,
- PRIMARY KEY (`deviceid`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `deviceid` int(11) NOT NULL AUTO_INCREMENT,
+ `devicename` tinytext DEFAULT NULL,
+ `devicedesc` text DEFAULT NULL,
+ `group_flag` int(11) DEFAULT NULL,
+ `active_flag` int(11) DEFAULT NULL,
+ PRIMARY KEY (`deviceid`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `devices`
--
LOCK TABLES `devices` WRITE;
-/*!40000 ALTER TABLE `devices` DISABLE KEYS */;
-/*!40000 ALTER TABLE `devices` ENABLE KEYS */;
+/*!40000 ALTER TABLE `devices` DISABLE KEYS */
+;
+set autocommit = 0;
+/*!40000 ALTER TABLE `devices` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `events`
--
DROP TABLE IF EXISTS `events`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `events` (
- `eventid` int(11) NOT NULL AUTO_INCREMENT,
- `task` int(11) DEFAULT NULL,
- `device` int(11) DEFAULT NULL,
- `start_date` date DEFAULT NULL,
- `last_date` date DEFAULT NULL,
- `deferred_flag` int(11) DEFAULT NULL,
- `deferred_date` date DEFAULT NULL,
- `active_flag` int(11) DEFAULT NULL,
- PRIMARY KEY (`eventid`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `eventid` int(11) NOT NULL AUTO_INCREMENT,
+ `task` int(11) DEFAULT NULL,
+ `device` int(11) DEFAULT NULL,
+ `start_date` date DEFAULT NULL,
+ `last_date` date DEFAULT NULL,
+ `deferred_flag` int(11) DEFAULT NULL,
+ `deferred_date` date DEFAULT NULL,
+ `active_flag` int(11) DEFAULT NULL,
+ PRIMARY KEY (`eventid`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `events`
--
LOCK TABLES `events` WRITE;
-/*!40000 ALTER TABLE `events` DISABLE KEYS */;
-/*!40000 ALTER TABLE `events` ENABLE KEYS */;
+/*!40000 ALTER TABLE `events` DISABLE KEYS */
+;
+set autocommit = 0;
+/*!40000 ALTER TABLE `events` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
+--
+-- Table structure for table `flagmap`
+--
+
+DROP TABLE IF EXISTS `flagmap`;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
+CREATE TABLE `flagmap` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `flagid` int(11) NOT NULL,
+ `lognoteid` int(11) DEFAULT NULL,
+ `maintformid` int(11) DEFAULT NULL,
+ `notetemplateid` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
+
+--
+-- Dumping data for table `flagmap`
+--
+
+LOCK TABLES `flagmap` WRITE;
+/*!40000 ALTER TABLE `flagmap` DISABLE KEYS */
+;
+set autocommit = 0;
+/*!40000 ALTER TABLE `flagmap` ENABLE KEYS */
+;
+UNLOCK TABLES;
+
+commit;
+
--
-- Table structure for table `flags`
--
DROP TABLE IF EXISTS `flags`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `flags` (
- `flagid` int(11) NOT NULL AUTO_INCREMENT,
- `flagname` tinytext DEFAULT NULL,
- `flagsym` tinytext DEFAULT NULL,
- `flagcolor` tinytext DEFAULT NULL,
- `status` int(11) NOT NULL,
- PRIMARY KEY (`flagid`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `flagid` int(11) NOT NULL AUTO_INCREMENT,
+ `flagname` tinytext DEFAULT NULL,
+ `flagsym` tinytext DEFAULT NULL,
+ `flagcolor` tinytext DEFAULT NULL,
+ `status` int(11) NOT NULL,
+ PRIMARY KEY (`flagid`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `flags`
--
LOCK TABLES `flags` WRITE;
-/*!40000 ALTER TABLE `flags` DISABLE KEYS */;
-/*!40000 ALTER TABLE `flags` ENABLE KEYS */;
+/*!40000 ALTER TABLE `flags` DISABLE KEYS */
+;
+set autocommit = 0;
+/*!40000 ALTER TABLE `flags` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `links`
--
DROP TABLE IF EXISTS `links`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `links` (
- `linkid` int(11) NOT NULL AUTO_INCREMENT,
- `linkpriority` int(11) NOT NULL,
- `displaytxt` text DEFAULT NULL,
- `urltxt` text DEFAULT NULL,
- `status` int(11) NOT NULL,
- PRIMARY KEY (`linkid`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `linkid` int(11) NOT NULL AUTO_INCREMENT,
+ `linkpriority` int(11) NOT NULL,
+ `displaytxt` text DEFAULT NULL,
+ `urltxt` text DEFAULT NULL,
+ `status` int(11) NOT NULL,
+ PRIMARY KEY (`linkid`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `links`
--
LOCK TABLES `links` WRITE;
-/*!40000 ALTER TABLE `links` DISABLE KEYS */;
-/*!40000 ALTER TABLE `links` ENABLE KEYS */;
+/*!40000 ALTER TABLE `links` DISABLE KEYS */
+;
+set autocommit = 0;
+/*!40000 ALTER TABLE `links` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `lognotes`
--
DROP TABLE IF EXISTS `lognotes`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `lognotes` (
- `lognoteid` int(11) NOT NULL AUTO_INCREMENT,
- `date` date DEFAULT NULL,
- `time` time DEFAULT NULL,
- `shift` int(11) NOT NULL,
- `tech` int(11) NOT NULL,
- `subject` int(11) NOT NULL,
- `lognote` text DEFAULT NULL,
- `refs` tinytext DEFAULT NULL,
- PRIMARY KEY (`lognoteid`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `lognoteid` int(11) NOT NULL AUTO_INCREMENT,
+ `date` date DEFAULT NULL,
+ `time` time DEFAULT NULL,
+ `shift` int(11) NOT NULL,
+ `tech` int(11) NOT NULL,
+ `subject` int(11) NOT NULL,
+ `lognote` text DEFAULT NULL,
+ PRIMARY KEY (`lognoteid`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `lognotes`
--
LOCK TABLES `lognotes` WRITE;
-/*!40000 ALTER TABLE `lognotes` DISABLE KEYS */;
-/*!40000 ALTER TABLE `lognotes` ENABLE KEYS */;
+/*!40000 ALTER TABLE `lognotes` DISABLE KEYS */
+;
+set autocommit = 0;
+/*!40000 ALTER TABLE `lognotes` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `logpartactions`
--
DROP TABLE IF EXISTS `logpartactions`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `logpartactions` (
- `lpactionid` int(11) NOT NULL AUTO_INCREMENT,
- `lpactionname` tinytext DEFAULT NULL,
- `status` int(11) DEFAULT NULL,
- PRIMARY KEY (`lpactionid`)
-) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `lpactionid` int(11) NOT NULL AUTO_INCREMENT,
+ `lpactionname` tinytext DEFAULT NULL,
+ `status` int(11) DEFAULT NULL,
+ PRIMARY KEY (`lpactionid`)
+) ENGINE = InnoDB AUTO_INCREMENT = 7 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `logpartactions`
--
LOCK TABLES `logpartactions` WRITE;
-/*!40000 ALTER TABLE `logpartactions` DISABLE KEYS */;
-INSERT INTO `logpartactions` VALUES
-(1,'removed',1),
-(2,'installed',1),
-(3,'repaired',1),
-(4,'replaced',1),
-(5,'incoming',1),
-(6,'outgoing',1);
-/*!40000 ALTER TABLE `logpartactions` ENABLE KEYS */;
+/*!40000 ALTER TABLE `logpartactions` DISABLE KEYS */
+;
+set autocommit = 0;
+
+INSERT INTO
+ `logpartactions`
+VALUES (1, 'removed', 1),
+ (2, 'installed', 1),
+ (3, 'repaired', 1),
+ (4, 'replaced', 1),
+ (5, 'incoming', 1),
+ (6, 'outgoing', 1);
+/*!40000 ALTER TABLE `logpartactions` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `logparts`
--
DROP TABLE IF EXISTS `logparts`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `logparts` (
- `logpartid` int(11) NOT NULL AUTO_INCREMENT,
- `lognoteid` int(11) DEFAULT NULL,
- `partid` int(11) DEFAULT NULL,
- `action` int(11) DEFAULT NULL,
- PRIMARY KEY (`logpartid`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `logpartid` int(11) NOT NULL AUTO_INCREMENT,
+ `lognoteid` int(11) DEFAULT NULL,
+ `partid` int(11) DEFAULT NULL,
+ `action` int(11) DEFAULT NULL,
+ PRIMARY KEY (`logpartid`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `logparts`
--
LOCK TABLES `logparts` WRITE;
-/*!40000 ALTER TABLE `logparts` DISABLE KEYS */;
-/*!40000 ALTER TABLE `logparts` ENABLE KEYS */;
+/*!40000 ALTER TABLE `logparts` DISABLE KEYS */
+;
+set autocommit = 0;
+/*!40000 ALTER TABLE `logparts` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `maintactions`
--
DROP TABLE IF EXISTS `maintactions`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `maintactions` (
- `maintactionid` int(11) NOT NULL AUTO_INCREMENT,
- `actiondate` date DEFAULT NULL,
- `actiontime` time DEFAULT NULL,
- `maintformnum` int(11) NOT NULL,
- `actiontech` int(11) NOT NULL,
- `action` text DEFAULT NULL,
- PRIMARY KEY (`maintactionid`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `maintactionid` int(11) NOT NULL AUTO_INCREMENT,
+ `actiondate` date DEFAULT NULL,
+ `actiontime` time DEFAULT NULL,
+ `maintformnum` int(11) NOT NULL,
+ `actiontech` int(11) NOT NULL,
+ `action` text DEFAULT NULL,
+ PRIMARY KEY (`maintactionid`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `maintactions`
--
LOCK TABLES `maintactions` WRITE;
-/*!40000 ALTER TABLE `maintactions` DISABLE KEYS */;
-/*!40000 ALTER TABLE `maintactions` ENABLE KEYS */;
+/*!40000 ALTER TABLE `maintactions` DISABLE KEYS */
+;
+set autocommit = 0;
+/*!40000 ALTER TABLE `maintactions` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `maintforms`
--
DROP TABLE IF EXISTS `maintforms`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `maintforms` (
- `maintformid` int(11) NOT NULL AUTO_INCREMENT,
- `mfdate` date DEFAULT NULL,
- `mftime` time DEFAULT NULL,
- `mftech` int(11) DEFAULT NULL,
- `mfpart` int(11) NOT NULL,
- `mfpartloc` text DEFAULT NULL,
- `mfmalfunction` text DEFAULT NULL,
- `nha` tinytext DEFAULT NULL,
- `repord` tinytext DEFAULT NULL,
- `lognoteid` int(11) DEFAULT NULL,
- `pending` int(11) DEFAULT NULL,
- PRIMARY KEY (`maintformid`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `maintformid` int(11) NOT NULL AUTO_INCREMENT,
+ `mfdate` date DEFAULT NULL,
+ `mftime` time DEFAULT NULL,
+ `mftech` int(11) DEFAULT NULL,
+ `mfpart` int(11) NOT NULL,
+ `mfpartloc` text DEFAULT NULL,
+ `mfmalfunction` text DEFAULT NULL,
+ `nha` tinytext DEFAULT NULL,
+ `repord` tinytext DEFAULT NULL,
+ `lognoteid` int(11) DEFAULT NULL,
+ `pending` int(11) DEFAULT NULL,
+ PRIMARY KEY (`maintformid`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `maintforms`
--
LOCK TABLES `maintforms` WRITE;
-/*!40000 ALTER TABLE `maintforms` DISABLE KEYS */;
-/*!40000 ALTER TABLE `maintforms` ENABLE KEYS */;
+/*!40000 ALTER TABLE `maintforms` DISABLE KEYS */
+;
+set autocommit = 0;
+/*!40000 ALTER TABLE `maintforms` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `notetemplates`
--
DROP TABLE IF EXISTS `notetemplates`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `notetemplates` (
- `templateid` int(11) NOT NULL AUTO_INCREMENT,
- `templatename` tinytext DEFAULT NULL,
- `shift` int(11) NOT NULL,
- `tech` int(11) NOT NULL,
- `subject` int(11) NOT NULL,
- `lognote` text DEFAULT NULL,
- `refs` tinytext DEFAULT NULL,
- PRIMARY KEY (`templateid`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `templateid` int(11) NOT NULL AUTO_INCREMENT,
+ `templatename` tinytext DEFAULT NULL,
+ `shift` int(11) NOT NULL,
+ `tech` int(11) NOT NULL,
+ `subject` int(11) NOT NULL,
+ `lognote` text DEFAULT NULL,
+ `refs` tinytext DEFAULT NULL,
+ PRIMARY KEY (`templateid`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `notetemplates`
--
LOCK TABLES `notetemplates` WRITE;
-/*!40000 ALTER TABLE `notetemplates` DISABLE KEYS */;
-/*!40000 ALTER TABLE `notetemplates` ENABLE KEYS */;
+/*!40000 ALTER TABLE `notetemplates` DISABLE KEYS */
+;
+set autocommit = 0;
+/*!40000 ALTER TABLE `notetemplates` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `parts`
--
DROP TABLE IF EXISTS `parts`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `parts` (
- `partid` int(11) NOT NULL AUTO_INCREMENT,
- `uid` tinytext DEFAULT NULL,
- `partnum` tinytext DEFAULT NULL,
- `sernum` tinytext DEFAULT NULL,
- `partname` tinytext DEFAULT NULL,
- PRIMARY KEY (`partid`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `partid` int(11) NOT NULL AUTO_INCREMENT,
+ `uid` tinytext DEFAULT NULL,
+ `partnum` tinytext DEFAULT NULL,
+ `sernum` tinytext DEFAULT NULL,
+ `partname` tinytext DEFAULT NULL,
+ PRIMARY KEY (`partid`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `parts`
--
LOCK TABLES `parts` WRITE;
-/*!40000 ALTER TABLE `parts` DISABLE KEYS */;
-/*!40000 ALTER TABLE `parts` ENABLE KEYS */;
+/*!40000 ALTER TABLE `parts` DISABLE KEYS */
+;
+set autocommit = 0;
+/*!40000 ALTER TABLE `parts` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
+--
+-- Table structure for table `reflinks`
+--
+
+DROP TABLE IF EXISTS `reflinks`;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
+CREATE TABLE `reflinks` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `noteid` int(11) DEFAULT NULL,
+ `templateid` int(11) DEFAULT NULL,
+ `target` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
+
+--
+-- Dumping data for table `reflinks`
+--
+
+LOCK TABLES `reflinks` WRITE;
+/*!40000 ALTER TABLE `reflinks` DISABLE KEYS */
+;
+set autocommit = 0;
+/*!40000 ALTER TABLE `reflinks` ENABLE KEYS */
+;
+UNLOCK TABLES;
+
+commit;
+
--
-- Table structure for table `shifts`
--
DROP TABLE IF EXISTS `shifts`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `shifts` (
- `shiftid` int(11) NOT NULL AUTO_INCREMENT,
- `shiftname` tinytext DEFAULT NULL,
- `status` int(11) NOT NULL,
- PRIMARY KEY (`shiftid`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `shiftid` int(11) NOT NULL AUTO_INCREMENT,
+ `shiftname` tinytext DEFAULT NULL,
+ `status` int(11) NOT NULL,
+ PRIMARY KEY (`shiftid`)
+) ENGINE = InnoDB AUTO_INCREMENT = 2 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `shifts`
--
LOCK TABLES `shifts` WRITE;
-/*!40000 ALTER TABLE `shifts` DISABLE KEYS */;
-INSERT INTO `shifts` VALUES
-(1,'First Shift',1);
-/*!40000 ALTER TABLE `shifts` ENABLE KEYS */;
+/*!40000 ALTER TABLE `shifts` DISABLE KEYS */
+;
+set autocommit = 0;
+
+INSERT INTO `shifts` VALUES (1, 'First Shift', 1);
+/*!40000 ALTER TABLE `shifts` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `styles`
--
DROP TABLE IF EXISTS `styles`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `styles` (
- `styleid` int(11) NOT NULL AUTO_INCREMENT,
- `styletype` tinytext DEFAULT NULL,
- `stylename` tinytext DEFAULT NULL,
- PRIMARY KEY (`styleid`)
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `styleid` int(11) NOT NULL AUTO_INCREMENT,
+ `styletype` tinytext DEFAULT NULL,
+ `stylename` tinytext DEFAULT NULL,
+ PRIMARY KEY (`styleid`)
+) ENGINE = InnoDB AUTO_INCREMENT = 3 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `styles`
--
LOCK TABLES `styles` WRITE;
-/*!40000 ALTER TABLE `styles` DISABLE KEYS */;
-INSERT INTO `styles` VALUES
-(1,'logdisplay','classic'),
-(2,'logdisplay','clean');
-/*!40000 ALTER TABLE `styles` ENABLE KEYS */;
+/*!40000 ALTER TABLE `styles` DISABLE KEYS */
+;
+set autocommit = 0;
+
+INSERT INTO
+ `styles`
+VALUES (1, 'logdisplay', 'classic'),
+ (2, 'logdisplay', 'clean');
+/*!40000 ALTER TABLE `styles` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `subjects`
--
DROP TABLE IF EXISTS `subjects`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `subjects` (
- `subjectid` int(11) NOT NULL AUTO_INCREMENT,
- `subjectname` tinytext DEFAULT NULL,
- `status` int(11) NOT NULL,
- PRIMARY KEY (`subjectid`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `subjectid` int(11) NOT NULL AUTO_INCREMENT,
+ `subjectname` tinytext DEFAULT NULL,
+ `status` int(11) NOT NULL,
+ PRIMARY KEY (`subjectid`)
+) ENGINE = InnoDB AUTO_INCREMENT = 2 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `subjects`
--
LOCK TABLES `subjects` WRITE;
-/*!40000 ALTER TABLE `subjects` DISABLE KEYS */;
-INSERT INTO `subjects` VALUES
-(1,'Miscellaneous',1);
-/*!40000 ALTER TABLE `subjects` ENABLE KEYS */;
+/*!40000 ALTER TABLE `subjects` DISABLE KEYS */
+;
+set autocommit = 0;
+
+INSERT INTO `subjects` VALUES (1, 'Miscellaneous', 1);
+/*!40000 ALTER TABLE `subjects` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `tasks`
--
DROP TABLE IF EXISTS `tasks`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `tasks` (
- `taskid` int(11) NOT NULL AUTO_INCREMENT,
- `taskname` tinytext DEFAULT NULL,
- `taskdesc` text DEFAULT NULL,
- `frequency` int(11) DEFAULT NULL,
- `period` tinytext DEFAULT NULL,
- `weekdays_only` int(11) DEFAULT NULL,
- `nextdue_relative` int(11) DEFAULT NULL,
- `refdoc_name` tinytext DEFAULT NULL,
- `refdoc_url` tinytext DEFAULT NULL,
- `active_flag` int(11) DEFAULT NULL,
- PRIMARY KEY (`taskid`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `taskid` int(11) NOT NULL AUTO_INCREMENT,
+ `taskname` tinytext DEFAULT NULL,
+ `taskdesc` text DEFAULT NULL,
+ `frequency` int(11) DEFAULT NULL,
+ `period` tinytext DEFAULT NULL,
+ `weekdays_only` int(11) DEFAULT NULL,
+ `nextdue_relative` int(11) DEFAULT NULL,
+ `refdoc_name` tinytext DEFAULT NULL,
+ `refdoc_url` tinytext DEFAULT NULL,
+ `active_flag` int(11) DEFAULT NULL,
+ PRIMARY KEY (`taskid`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `tasks`
--
LOCK TABLES `tasks` WRITE;
-/*!40000 ALTER TABLE `tasks` DISABLE KEYS */;
-/*!40000 ALTER TABLE `tasks` ENABLE KEYS */;
+/*!40000 ALTER TABLE `tasks` DISABLE KEYS */
+;
+set autocommit = 0;
+/*!40000 ALTER TABLE `tasks` ENABLE KEYS */
+;
UNLOCK TABLES;
+commit;
+
--
-- Table structure for table `techs`
--
DROP TABLE IF EXISTS `techs`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+/*!40101 SET @saved_cs_client = @@character_set_client */
+;
+/*!40101 SET character_set_client = utf8mb4 */
+;
CREATE TABLE `techs` (
- `techid` int(11) NOT NULL AUTO_INCREMENT,
- `techname` tinytext DEFAULT NULL,
- `admin` int(11) DEFAULT NULL,
- `shift` int(11) DEFAULT NULL,
- `techpass` text DEFAULT NULL,
- `status` int(11) NOT NULL,
- PRIMARY KEY (`techid`)
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
+ `techid` int(11) NOT NULL AUTO_INCREMENT,
+ `techname` tinytext DEFAULT NULL,
+ `admin` int(11) DEFAULT NULL,
+ `shift` int(11) DEFAULT NULL,
+ `techpass` text DEFAULT NULL,
+ `status` int(11) NOT NULL,
+ PRIMARY KEY (`techid`)
+) ENGINE = InnoDB AUTO_INCREMENT = 3 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
+/*!40101 SET character_set_client = @saved_cs_client */
+;
--
-- Dumping data for table `techs`
--
LOCK TABLES `techs` WRITE;
-/*!40000 ALTER TABLE `techs` DISABLE KEYS */;
-INSERT INTO `techs` VALUES
-(1,'OpenLogAdmin',1,1,'$2y$10$6eCxUFNzoAkycMJpZ.zvaOfoByYhqi0YicQbut3XGc/TRxyxiUwcm',1);
-/*!40000 ALTER TABLE `techs` ENABLE KEYS */;
+/*!40000 ALTER TABLE `techs` DISABLE KEYS */
+;
+set autocommit = 0;
+
+INSERT INTO
+ `techs`
+VALUES (
+ 1,
+ 'OpenLogAdmin',
+ 1,
+ 1,
+ '$2y$10$6eCxUFNzoAkycMJpZ.zvaOfoByYhqi0YicQbut3XGc/TRxyxiUwcm',
+ 1
+ );
+/*!40000 ALTER TABLE `techs` ENABLE KEYS */
+;
UNLOCK TABLES;
-/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
-/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
-/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
-/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+commit;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */
+;
--- Dump completed on 2024-07-09 14:36:00
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */
+;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */
+;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */
+;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */
+;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */
+;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */
+;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */
+;
+
+-- Dump completed on 2026-02-19 14:18:01
\ No newline at end of file
diff --git a/database-update.sh b/database-update.sh
index cc37f86..45e45c2 100755
--- a/database-update.sh
+++ b/database-update.sh
@@ -6,6 +6,19 @@
# SPDX-License-Identifier: GPL-2.0
+function spinner() {
+ local pid="$1"
+ local delay="0.1"
+ local spinstr='|/-\\'
+ local i=0
+
+ while ps -p "$pid" > /dev/null; do
+ i=$(( (i+1) % 4 ))
+ printf "\r[%c]" "${spinstr:$i:1}"
+ sleep "$delay"
+ done
+ printf "\r \r" # Clear the spinner line
+}
if [[ $1 == "" ]]
then
@@ -37,3 +50,97 @@ margs="--defaults-extra-file=$mysql_opt_file"
# ---------- version 5.2.5 ------------
# Nothing to do
# -------------------------------------
+
+# ---------- version 5.3.0 ------------
+#
+echo "Started database updates for OpenLog version 5.3.0..."
+
+# Import old flag data from old scheme to new flagmap table
+if [[ $(mysql $margs -e "select count(*) from flagmap") == 0 ]]
+then
+ echo "Importing flag data from old scheme to new flagmap table."
+ echo "This may take some time..."
+ (
+ for flagnumber in $(mysql $margs -e "select flagid from flags")
+ do
+ flag_x=$(mysql $margs -s -e "show tables like 'flag_$flagnumber'")
+ if [[ -n "$flag_x" ]]
+ then
+ for tgtid in $(mysql $margs -e "select id from flag_$flagnumber")
+ do
+ target=$(mysql $margs -e "select target from flag_$flagnumber where id=$tgtid")
+ if [[ $target == "lognotes" ]]
+ then
+ mysql $margs -e "insert into flagmap(flagid,lognoteid) values($flagnumber,$tgtid)"
+ elif [[ $target == "maintforms" ]]
+ then
+ mysql $margs -e "insert into flagmap(flagid,maintformid) values($flagnumber,$tgtid)"
+ elif [[ $target == "notetemplates" ]]
+ then
+ mysql $margs -e "insert into flagmap(flagid,notetemplateid) values($flagnumber,$tgtid)"
+ fi
+
+ done
+ mysql $margs -e "drop table flag_$flagnumber"
+ fi
+ done
+ ) &
+ task_pid=$!
+ spinner $task_pid
+ echo "...done."
+fi
+
+# Import reference chain data into new reflinks table
+if [[ $(mysql $margs -e "select count(*) from reflinks") == 0 ]]
+then
+ echo "Importing lognote reference chain data into new reflinks table."
+ echo "This may take some time..."
+ (
+ for note in $(mysql $margs -e "select lognoteid from lognotes where refs!=''")
+ do
+ refstring=$(mysql $margs -e "select refs from lognotes where lognoteid=$note")
+ oldifs=$IFS
+ IFS=', '
+ for target in $refstring
+ do
+ target=$(echo "$target" | xargs)
+ mysql $margs -e "insert into reflinks(noteid,target) values($note,$target)"
+ done
+ IFS=$oldifs
+ done
+ ) &
+ task_pid=$!
+ spinner $task_pid
+ echo "...done."
+ echo "Importing template reference chain data into new reflinks table."
+ echo "This may take some time..."
+ (
+ for template in $(mysql $margs -e "select templateid from notetemplates where refs!=''")
+ do
+ refstring=$(mysql $margs -e "select refs from notetemplates where templateid=$template")
+ oldifs=$IFS
+ IFS=', '
+ for target in $refstring
+ do
+ target=$(echo "$target" | xargs)
+ mysql $margs -e "insert into reflinks(templateid,target) values($template,$target)"
+ done
+ IFS=$oldifs
+ done
+ ) &
+ task_pid=$!
+ spinner $task_pid
+ echo "...done."
+ mysql $margs -e "alter table lognotes drop column refs" >/dev/null 2>&1
+ mysql $margs -e "alter table notetemplates drop column refs" >/dev/null 2>&1
+fi
+
+# Convert database to utf8mb4/utf8mb4_unicode_ci
+echo "Converting database to utf8mb4 encoding..."
+mysql $margs -e "ALTER DATABASE CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci"
+for table in $(mysql $margs -e "show tables")
+do
+ mysql $margs -e "ALTER TABLE $table CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
+done
+echo "...done."
+# -------------------------------------
diff --git a/database-update.sql b/database-update.sql
index 20326fb..a5d096e 100644
--- a/database-update.sql
+++ b/database-update.sql
@@ -2,56 +2,85 @@
-- ---------- version 5.2.1 -------------
-- Make confname a unique column
-ALTER TABLE configs ADD UNIQUE(confname);
+ALTER TABLE configs ADD UNIQUE (confname);
-- Delete db name, user, and password configs
-DELETE FROM configs where confname="ol_dbname";
-DELETE FROM configs where confname="ol_dbuser";
-DELETE FROM configs where confname="ol_dbpass";
+DELETE FROM configs where confname = "ol_dbname";
+
+DELETE FROM configs where confname = "ol_dbuser";
+
+DELETE FROM configs where confname = "ol_dbpass";
-- Add config option for server side error logging
-INSERT IGNORE INTO configs(confname,confvalue) values('log_errors','0')
+INSERT IGNORE INTO
+ configs (confname, confvalue)
+values ('log_errors', '0')
-- Update version number
-UPDATE configs SET confvalue="5.2.1" WHERE confname="ol_version";
+UPDATE configs SET confvalue = "5.2.1" WHERE confname = "ol_version";
-- --------------------------------------
-- ---------- version 5.2.2 -------------
-- Update version number
-UPDATE configs SET confvalue="5.2.2" WHERE confname="ol_version";
+UPDATE configs SET confvalue = "5.2.2" WHERE confname = "ol_version";
-- --------------------------------------
-- ---------- version 5.2.3 -------------
-- Update version number
-UPDATE configs SET confvalue="5.2.3" WHERE confname="ol_version";
+UPDATE configs SET confvalue = "5.2.3" WHERE confname = "ol_version";
-- --------------------------------------
-- ---------- version 5.2.4 -------------
-- Update version number
-UPDATE configs SET confvalue="5.2.4" WHERE confname="ol_version";
+UPDATE configs SET confvalue = "5.2.4" WHERE confname = "ol_version";
-- --------------------------------------
-- ---------- version 5.2.4.1 -----------
-- Update version number
-UPDATE configs SET confvalue="5.2.4.1" WHERE confname="ol_version";
+UPDATE configs SET confvalue = "5.2.4.1" WHERE confname = "ol_version";
-- --------------------------------------
-- ---------- version 5.2.4.2 -----------
-- Update version number
-UPDATE configs SET confvalue="5.2.4.2" WHERE confname="ol_version";
+UPDATE configs SET confvalue = "5.2.4.2" WHERE confname = "ol_version";
-- --------------------------------------
-- ---------- version 5.2.4.3 -----------
-- Update version number
-UPDATE configs SET confvalue="5.2.4.3" WHERE confname="ol_version";
+UPDATE configs SET confvalue = "5.2.4.3" WHERE confname = "ol_version";
-- --------------------------------------
-- ---------- version 5.2.4.4 -----------
-- Update version number
-UPDATE configs SET confvalue="5.2.4.4" WHERE confname="ol_version";
+UPDATE configs SET confvalue = "5.2.4.4" WHERE confname = "ol_version";
-- --------------------------------------
-- ---------- version 5.2.5 -------------
-- Update version number
-UPDATE configs SET confvalue="5.2.5" WHERE confname="ol_version";
+UPDATE configs SET confvalue = "5.2.5" WHERE confname = "ol_version";
-- --------------------------------------
+
+-- ---------- version 5.3.0 -------------
+-- Update version number
+UPDATE configs SET confvalue = "5.3.0" WHERE confname = "ol_version";
+
+-- Create the flagmap table
+CREATE TABLE IF NOT EXISTS `flagmap` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `flagid` int(11) NOT NULL,
+ `lognoteid` int(11) DEFAULT NULL,
+ `maintformid` int(11) DEFAULT NULL,
+ `notetemplateid` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
+
+-- Create the reflinks table
+CREATE TABLE IF NOT EXISTS `reflinks` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `noteid` int(11) DEFAULT NULL,
+ `templateid` int(11) DEFAULT NULL,
+ `target` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
+
+-- --------------------------------------
\ No newline at end of file
diff --git a/db.php.template b/db.php.template
index 084f062..147da5c 100644
--- a/db.php.template
+++ b/db.php.template
@@ -3,7 +3,7 @@
/*
db.php
OpenLog Online Logbook
- Copyright (C) 2025 Rod Wright
+ Copyright (C) 2026 Rod Wright
SPDX-License-Identifier: GPL-2.0
*/
@@ -14,10 +14,10 @@
** DO NOT EDIT **
************************************************************************
*/
-$appname="APPNAME";
-$dbname="DBNAME";
-$username="DBUSER";
-$dbpass="DBPASS";
+$appname = "APPNAME";
+$dbname = "DBNAME";
+$username = "DBUSER";
+$dbpass = "DBPASS";
function dberrmsg($dbname) {
echo "
@@ -34,7 +34,7 @@ function dberrmsg($dbname) {
exit();
}
-$db=@mysqli_connect("localhost",$username,$dbpass,$dbname);
+$db = @mysqli_connect("localhost",$username,$dbpass,$dbname);
if (mysqli_errno($db)) {
dberrmsg($dbname);
}
diff --git a/default-apache.conf b/default-apache.conf
new file mode 100644
index 0000000..d6cb9d2
--- /dev/null
+++ b/default-apache.conf
@@ -0,0 +1,13 @@
+# _APPNAME_ default Apache configuration
+
+Alias /_BASEURL_ _DOCROOTIN_/_BASEURL_
+
+