rename settings to event config and implement mvc pattern on it

This commit is contained in:
msquare 2016-09-27 17:49:13 +02:00
parent 45bbf95972
commit 031fc3057c
8 changed files with 448 additions and 215 deletions

View File

@ -1,16 +1,19 @@
-- phpMyAdmin SQL Dump -- phpMyAdmin SQL Dump
-- version 4.0.4.1 -- version 4.5.2
-- http://www.phpmyadmin.net -- http://www.phpmyadmin.net
-- --
-- Host: localhost -- Host: localhost
-- Erstellungszeit: 25. Aug 2015 um 15:29 -- Erstellungszeit: 27. Sep 2016 um 17:48
-- Server Version: 5.6.12 -- Server-Version: 10.1.10-MariaDB
-- PHP-Version: 5.5.3 -- PHP-Version: 7.0.4
SET FOREIGN_KEY_CHECKS=0;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00"; SET time_zone = "+00:00";
--
-- Datenbank: `engelsystem`
--
-- -------------------------------------------------------- -- --------------------------------------------------------
-- --
@ -18,14 +21,29 @@ SET time_zone = "+00:00";
-- --
DROP TABLE IF EXISTS `AngelTypes`; DROP TABLE IF EXISTS `AngelTypes`;
CREATE TABLE IF NOT EXISTS `AngelTypes` ( CREATE TABLE `AngelTypes` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL,
`name` varchar(50) NOT NULL DEFAULT '', `name` varchar(50) NOT NULL DEFAULT '',
`restricted` int(1) NOT NULL, `restricted` int(1) NOT NULL,
`description` text NOT NULL, `description` text NOT NULL,
PRIMARY KEY (`id`), `requires_driver_license` tinyint(1) NOT NULL
UNIQUE KEY `Name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `EventConfig`
--
DROP TABLE IF EXISTS `EventConfig`;
CREATE TABLE `EventConfig` (
`event_name` varchar(255) DEFAULT NULL,
`buildup_start_date` int(11) DEFAULT NULL,
`event_start_date` int(11) DEFAULT NULL,
`event_end_date` int(11) DEFAULT NULL,
`teardown_end_date` int(11) DEFAULT NULL,
`event_welcome_msg` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- -------------------------------------------------------- -- --------------------------------------------------------
@ -34,14 +52,11 @@ CREATE TABLE IF NOT EXISTS `AngelTypes` (
-- --
DROP TABLE IF EXISTS `GroupPrivileges`; DROP TABLE IF EXISTS `GroupPrivileges`;
CREATE TABLE IF NOT EXISTS `GroupPrivileges` ( CREATE TABLE `GroupPrivileges` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL,
`group_id` int(11) NOT NULL, `group_id` int(11) NOT NULL,
`privilege_id` int(11) NOT NULL, `privilege_id` int(11) NOT NULL
PRIMARY KEY (`id`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
KEY `group_id` (`group_id`,`privilege_id`),
KEY `privilege_id` (`privilege_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=259 ;
-- --
-- Daten für Tabelle `GroupPrivileges` -- Daten für Tabelle `GroupPrivileges`
@ -74,6 +89,7 @@ INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES
(235, -4, 27), (235, -4, 27),
(239, -4, 28), (239, -4, 28),
(236, -4, 32), (236, -4, 32),
(218, -4, 39),
(258, -3, 31), (258, -3, 31),
(247, -2, 3), (247, -2, 3),
(246, -2, 4), (246, -2, 4),
@ -100,10 +116,9 @@ INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES
-- --
DROP TABLE IF EXISTS `Groups`; DROP TABLE IF EXISTS `Groups`;
CREATE TABLE IF NOT EXISTS `Groups` ( CREATE TABLE `Groups` (
`Name` varchar(35) NOT NULL, `Name` varchar(35) NOT NULL,
`UID` int(11) NOT NULL, `UID` int(11) NOT NULL
PRIMARY KEY (`UID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --
@ -126,14 +141,12 @@ INSERT INTO `Groups` (`Name`, `UID`) VALUES
-- --
DROP TABLE IF EXISTS `LogEntries`; DROP TABLE IF EXISTS `LogEntries`;
CREATE TABLE IF NOT EXISTS `LogEntries` ( CREATE TABLE `LogEntries` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL,
`timestamp` int(11) NOT NULL, `timestamp` int(11) NOT NULL,
`nick` text NOT NULL, `nick` text NOT NULL,
`message` text NOT NULL, `message` text NOT NULL
PRIMARY KEY (`id`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
KEY `timestamp` (`timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- -------------------------------------------------------- -- --------------------------------------------------------
@ -142,18 +155,14 @@ CREATE TABLE IF NOT EXISTS `LogEntries` (
-- --
DROP TABLE IF EXISTS `Messages`; DROP TABLE IF EXISTS `Messages`;
CREATE TABLE IF NOT EXISTS `Messages` ( CREATE TABLE `Messages` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL,
`Datum` int(11) NOT NULL, `Datum` int(11) NOT NULL,
`SUID` int(11) NOT NULL DEFAULT '0', `SUID` int(11) NOT NULL DEFAULT '0',
`RUID` int(11) NOT NULL DEFAULT '0', `RUID` int(11) NOT NULL DEFAULT '0',
`isRead` char(1) NOT NULL DEFAULT 'N', `isRead` char(1) NOT NULL DEFAULT 'N',
`Text` text NOT NULL, `Text` text NOT NULL
PRIMARY KEY (`id`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Fuers interen Communikationssystem';
KEY `Datum` (`Datum`),
KEY `SUID` (`SUID`),
KEY `RUID` (`RUID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Fuers interen Communikationssystem' AUTO_INCREMENT=1 ;
-- -------------------------------------------------------- -- --------------------------------------------------------
@ -162,17 +171,13 @@ CREATE TABLE IF NOT EXISTS `Messages` (
-- --
DROP TABLE IF EXISTS `NeededAngelTypes`; DROP TABLE IF EXISTS `NeededAngelTypes`;
CREATE TABLE IF NOT EXISTS `NeededAngelTypes` ( CREATE TABLE `NeededAngelTypes` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL,
`room_id` int(11) DEFAULT NULL, `room_id` int(11) DEFAULT NULL,
`shift_id` int(11) DEFAULT NULL, `shift_id` int(11) DEFAULT NULL,
`angel_type_id` int(11) NOT NULL, `angel_type_id` int(11) NOT NULL,
`count` int(11) NOT NULL, `count` int(11) NOT NULL
PRIMARY KEY (`id`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
KEY `room_id` (`room_id`,`angel_type_id`),
KEY `shift_id` (`shift_id`),
KEY `angel_type_id` (`angel_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- -------------------------------------------------------- -- --------------------------------------------------------
@ -181,16 +186,14 @@ CREATE TABLE IF NOT EXISTS `NeededAngelTypes` (
-- --
DROP TABLE IF EXISTS `News`; DROP TABLE IF EXISTS `News`;
CREATE TABLE IF NOT EXISTS `News` ( CREATE TABLE `News` (
`ID` int(11) NOT NULL AUTO_INCREMENT, `ID` int(11) NOT NULL,
`Datum` int(11) NOT NULL, `Datum` int(11) NOT NULL,
`Betreff` varchar(150) NOT NULL DEFAULT '', `Betreff` varchar(150) NOT NULL DEFAULT '',
`Text` text NOT NULL, `Text` text NOT NULL,
`UID` int(11) NOT NULL DEFAULT '0', `UID` int(11) NOT NULL DEFAULT '0',
`Treffen` tinyint(4) NOT NULL DEFAULT '0', `Treffen` tinyint(4) NOT NULL DEFAULT '0'
PRIMARY KEY (`ID`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
KEY `UID` (`UID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- -------------------------------------------------------- -- --------------------------------------------------------
@ -199,16 +202,13 @@ CREATE TABLE IF NOT EXISTS `News` (
-- --
DROP TABLE IF EXISTS `NewsComments`; DROP TABLE IF EXISTS `NewsComments`;
CREATE TABLE IF NOT EXISTS `NewsComments` ( CREATE TABLE `NewsComments` (
`ID` bigint(11) NOT NULL AUTO_INCREMENT, `ID` bigint(11) NOT NULL,
`Refid` int(11) NOT NULL DEFAULT '0', `Refid` int(11) NOT NULL DEFAULT '0',
`Datum` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `Datum` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`Text` text NOT NULL, `Text` text NOT NULL,
`UID` int(11) NOT NULL DEFAULT '0', `UID` int(11) NOT NULL DEFAULT '0'
PRIMARY KEY (`ID`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
KEY `Refid` (`Refid`),
KEY `UID` (`UID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- -------------------------------------------------------- -- --------------------------------------------------------
@ -217,13 +217,11 @@ CREATE TABLE IF NOT EXISTS `NewsComments` (
-- --
DROP TABLE IF EXISTS `Privileges`; DROP TABLE IF EXISTS `Privileges`;
CREATE TABLE IF NOT EXISTS `Privileges` ( CREATE TABLE `Privileges` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL,
`name` varchar(128) NOT NULL, `name` varchar(128) NOT NULL,
`desc` varchar(1024) NOT NULL, `desc` varchar(1024) NOT NULL
PRIMARY KEY (`id`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=39 ;
-- --
-- Daten für Tabelle `Privileges` -- Daten für Tabelle `Privileges`
@ -266,7 +264,8 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES
(35, 'shifts_json_export', 'Export shifts in JSON format'), (35, 'shifts_json_export', 'Export shifts in JSON format'),
(36, 'angeltypes', 'View angeltypes'), (36, 'angeltypes', 'View angeltypes'),
(37, 'user_angeltypes', 'Join angeltypes.'), (37, 'user_angeltypes', 'Join angeltypes.'),
(38, 'shifttypes', 'Administrate shift types'); (38, 'shifttypes', 'Administrate shift types'),
(39, 'admin_event_config', 'Allow editing event config');
-- -------------------------------------------------------- -- --------------------------------------------------------
@ -275,16 +274,13 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES
-- --
DROP TABLE IF EXISTS `Questions`; DROP TABLE IF EXISTS `Questions`;
CREATE TABLE IF NOT EXISTS `Questions` ( CREATE TABLE `Questions` (
`QID` bigint(20) NOT NULL AUTO_INCREMENT, `QID` bigint(20) NOT NULL,
`UID` int(11) NOT NULL DEFAULT '0', `UID` int(11) NOT NULL DEFAULT '0',
`Question` text NOT NULL, `Question` text NOT NULL,
`AID` int(11) DEFAULT NULL, `AID` int(11) DEFAULT NULL,
`Answer` text, `Answer` text
PRIMARY KEY (`QID`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Fragen und Antworten';
KEY `UID` (`UID`),
KEY `AID` (`AID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Fragen und Antworten' AUTO_INCREMENT=1 ;
-- -------------------------------------------------------- -- --------------------------------------------------------
@ -293,16 +289,21 @@ CREATE TABLE IF NOT EXISTS `Questions` (
-- --
DROP TABLE IF EXISTS `Room`; DROP TABLE IF EXISTS `Room`;
CREATE TABLE IF NOT EXISTS `Room` ( CREATE TABLE `Room` (
`RID` int(11) NOT NULL AUTO_INCREMENT, `RID` int(11) NOT NULL,
`Name` varchar(35) NOT NULL DEFAULT '', `Name` varchar(35) NOT NULL DEFAULT '',
`Man` text, `Man` text,
`FromPentabarf` char(1) NOT NULL DEFAULT 'N', `FromPentabarf` char(1) NOT NULL DEFAULT 'N',
`show` char(1) NOT NULL DEFAULT 'Y', `show` char(1) NOT NULL DEFAULT 'Y',
`Number` int(11) DEFAULT NULL, `Number` int(11) DEFAULT NULL
PRIMARY KEY (`RID`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
UNIQUE KEY `Name` (`Name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; --
-- Daten für Tabelle `Room`
--
INSERT INTO `Room` (`RID`, `Name`, `Man`, `FromPentabarf`, `show`, `Number`) VALUES
(1, 'Testraum', NULL, '', 'Y', 0);
-- -------------------------------------------------------- -- --------------------------------------------------------
@ -311,20 +312,15 @@ CREATE TABLE IF NOT EXISTS `Room` (
-- --
DROP TABLE IF EXISTS `ShiftEntry`; DROP TABLE IF EXISTS `ShiftEntry`;
CREATE TABLE IF NOT EXISTS `ShiftEntry` ( CREATE TABLE `ShiftEntry` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL,
`SID` int(11) NOT NULL DEFAULT '0', `SID` int(11) NOT NULL DEFAULT '0',
`TID` int(11) NOT NULL DEFAULT '0', `TID` int(11) NOT NULL DEFAULT '0',
`UID` int(11) NOT NULL DEFAULT '0', `UID` int(11) NOT NULL DEFAULT '0',
`Comment` text, `Comment` text,
`freeload_comment` text, `freeload_comment` text,
`freeloaded` tinyint(1) NOT NULL, `freeloaded` tinyint(1) NOT NULL
PRIMARY KEY (`id`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
KEY `TID` (`TID`),
KEY `UID` (`UID`),
KEY `SID` (`SID`,`TID`),
KEY `freeloaded` (`freeloaded`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- -------------------------------------------------------- -- --------------------------------------------------------
@ -333,8 +329,8 @@ CREATE TABLE IF NOT EXISTS `ShiftEntry` (
-- --
DROP TABLE IF EXISTS `Shifts`; DROP TABLE IF EXISTS `Shifts`;
CREATE TABLE IF NOT EXISTS `Shifts` ( CREATE TABLE `Shifts` (
`SID` int(11) NOT NULL AUTO_INCREMENT, `SID` int(11) NOT NULL,
`title` text, `title` text,
`shifttype_id` int(11) NOT NULL, `shifttype_id` int(11) NOT NULL,
`start` int(11) NOT NULL, `start` int(11) NOT NULL,
@ -345,14 +341,8 @@ CREATE TABLE IF NOT EXISTS `Shifts` (
`created_by_user_id` int(11) DEFAULT NULL, `created_by_user_id` int(11) DEFAULT NULL,
`created_at_timestamp` int(11) NOT NULL, `created_at_timestamp` int(11) NOT NULL,
`edited_by_user_id` int(11) DEFAULT NULL, `edited_by_user_id` int(11) DEFAULT NULL,
`edited_at_timestamp` int(11) NOT NULL, `edited_at_timestamp` int(11) NOT NULL
PRIMARY KEY (`SID`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
UNIQUE KEY `PSID` (`PSID`),
KEY `RID` (`RID`),
KEY `shifttype_id` (`shifttype_id`),
KEY `created_by_user_id` (`created_by_user_id`),
KEY `edited_by_user_id` (`edited_by_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=133 ;
-- -------------------------------------------------------- -- --------------------------------------------------------
@ -361,14 +351,12 @@ CREATE TABLE IF NOT EXISTS `Shifts` (
-- --
DROP TABLE IF EXISTS `ShiftTypes`; DROP TABLE IF EXISTS `ShiftTypes`;
CREATE TABLE IF NOT EXISTS `ShiftTypes` ( CREATE TABLE `ShiftTypes` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL,
`name` varchar(255) NOT NULL, `name` varchar(255) NOT NULL,
`angeltype_id` int(11) DEFAULT NULL, `angeltype_id` int(11) DEFAULT NULL,
`description` text NOT NULL, `description` text NOT NULL
PRIMARY KEY (`id`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
KEY `angeltype_id` (`angeltype_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
-- --
-- Daten für Tabelle `ShiftTypes` -- Daten für Tabelle `ShiftTypes`
@ -384,8 +372,8 @@ INSERT INTO `ShiftTypes` (`id`, `name`, `angeltype_id`, `description`) VALUES
-- --
DROP TABLE IF EXISTS `User`; DROP TABLE IF EXISTS `User`;
CREATE TABLE IF NOT EXISTS `User` ( CREATE TABLE `User` (
`UID` int(11) NOT NULL AUTO_INCREMENT, `UID` int(11) NOT NULL,
`Nick` varchar(23) NOT NULL DEFAULT '', `Nick` varchar(23) NOT NULL DEFAULT '',
`Name` varchar(23) DEFAULT NULL, `Name` varchar(23) DEFAULT NULL,
`Vorname` varchar(23) DEFAULT NULL, `Vorname` varchar(23) DEFAULT NULL,
@ -415,22 +403,15 @@ CREATE TABLE IF NOT EXISTS `User` (
`got_voucher` int(11) NOT NULL, `got_voucher` int(11) NOT NULL,
`arrival_date` int(11) DEFAULT NULL, `arrival_date` int(11) DEFAULT NULL,
`planned_arrival_date` int(11) NOT NULL, `planned_arrival_date` int(11) NOT NULL,
`planned_departure_date` int(11) DEFAULT NULL, `planned_departure_date` int(11) DEFAULT NULL
PRIMARY KEY (`UID`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
UNIQUE KEY `Nick` (`Nick`),
KEY `api_key` (`api_key`),
KEY `password_recovery_token` (`password_recovery_token`),
KEY `force_active` (`force_active`),
KEY `arrival_date` (`arrival_date`,`planned_arrival_date`),
KEY `planned_departure_date` (`planned_departure_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
-- --
-- Daten für Tabelle `User` -- Daten für Tabelle `User`
-- --
INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `email_shiftinfo`, `jabber`, `Size`, `Passwort`, `password_recovery_token`, `Gekommen`, `Aktiv`, `force_active`, `Tshirt`, `color`, `Sprache`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`, `api_key`, `got_voucher`, `arrival_date`, `planned_arrival_date`, `planned_departure_date`) VALUES INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `email_shiftinfo`, `jabber`, `Size`, `Passwort`, `password_recovery_token`, `Gekommen`, `Aktiv`, `force_active`, `Tshirt`, `color`, `Sprache`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`, `api_key`, `got_voucher`, `arrival_date`, `planned_arrival_date`, `planned_departure_date`) VALUES
(1, 'admin', 'Gates', 'Bill', 42, '', '-', '', 'admin@example.com', 1, '', 'XL', '$6$rounds=5000$hjXbIhoRTH3vKiRa$Wl2P2iI5T9iRR.HHu/YFHswBW0WVn0yxCfCiX0Keco9OdIoDK6bIAADswP6KvMCJSwTGdV8PgA8g8Xfw5l8BD1', NULL, 1, 1, 0, 1, 2, 'de_DE.UTF-8', 'L', 1439759300, '0000-00-00 00:00:00', '', '', '', '038850abdd1feb264406be3ffa746235', 3, 1439490478, 1436964455, 1440161255); (1, 'admin', 'Gates', 'Bill', 42, '', '-', '', 'admin@example.com', 1, '', 'XL', '$6$rounds=5000$hjXbIhoRTH3vKiRa$Wl2P2iI5T9iRR.HHu/YFHswBW0WVn0yxCfCiX0Keco9OdIoDK6bIAADswP6KvMCJSwTGdV8PgA8g8Xfw5l8BD1', NULL, 1, 1, 0, 1, 0, 'de_DE.UTF-8', 'L', 1474990948, '0000-00-00 00:00:00', '', '', '', '038850abdd1feb264406be3ffa746235', 0, 1439490478, 1436964455, 1440161255);
-- -------------------------------------------------------- -- --------------------------------------------------------
@ -439,18 +420,37 @@ INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`
-- --
DROP TABLE IF EXISTS `UserAngelTypes`; DROP TABLE IF EXISTS `UserAngelTypes`;
CREATE TABLE IF NOT EXISTS `UserAngelTypes` ( CREATE TABLE `UserAngelTypes` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL,
`user_id` int(11) NOT NULL, `user_id` int(11) NOT NULL,
`angeltype_id` int(11) NOT NULL, `angeltype_id` int(11) NOT NULL,
`confirm_user_id` int(11) DEFAULT NULL, `confirm_user_id` int(11) DEFAULT NULL,
`coordinator` tinyint(1) NOT NULL, `coordinator` tinyint(1) NOT NULL
PRIMARY KEY (`id`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
KEY `user_id` (`user_id`,`angeltype_id`,`confirm_user_id`),
KEY `angeltype_id` (`angeltype_id`), -- --------------------------------------------------------
KEY `confirm_user_id` (`confirm_user_id`),
KEY `coordinator` (`coordinator`) --
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=21 ; -- Tabellenstruktur für Tabelle `UserDriverLicenses`
--
DROP TABLE IF EXISTS `UserDriverLicenses`;
CREATE TABLE `UserDriverLicenses` (
`user_id` int(11) NOT NULL,
`has_car` tinyint(1) NOT NULL,
`has_license_car` tinyint(1) NOT NULL,
`has_license_3_5t_transporter` tinyint(1) NOT NULL,
`has_license_7_5t_truck` tinyint(1) NOT NULL,
`has_license_12_5t_truck` tinyint(1) NOT NULL,
`has_license_forklift` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Daten für Tabelle `UserDriverLicenses`
--
INSERT INTO `UserDriverLicenses` (`user_id`, `has_car`, `has_license_car`, `has_license_3_5t_transporter`, `has_license_7_5t_truck`, `has_license_12_5t_truck`, `has_license_forklift`) VALUES
(1, 1, 1, 1, 1, 1, 1);
-- -------------------------------------------------------- -- --------------------------------------------------------
@ -459,14 +459,11 @@ CREATE TABLE IF NOT EXISTS `UserAngelTypes` (
-- --
DROP TABLE IF EXISTS `UserGroups`; DROP TABLE IF EXISTS `UserGroups`;
CREATE TABLE IF NOT EXISTS `UserGroups` ( CREATE TABLE `UserGroups` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL,
`uid` int(11) NOT NULL, `uid` int(11) NOT NULL,
`group_id` int(11) NOT NULL, `group_id` int(11) NOT NULL
PRIMARY KEY (`id`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
KEY `uid` (`uid`,`group_id`),
KEY `group_id` (`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=20 ;
-- --
-- Daten für Tabelle `UserGroups` -- Daten für Tabelle `UserGroups`
@ -479,6 +476,241 @@ INSERT INTO `UserGroups` (`id`, `uid`, `group_id`) VALUES
(2, 1, -4), (2, 1, -4),
(1, 1, -2); (1, 1, -2);
--
-- Indizes der exportierten Tabellen
--
--
-- Indizes für die Tabelle `AngelTypes`
--
ALTER TABLE `AngelTypes`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `Name` (`name`);
--
-- Indizes für die Tabelle `GroupPrivileges`
--
ALTER TABLE `GroupPrivileges`
ADD PRIMARY KEY (`id`),
ADD KEY `group_id` (`group_id`,`privilege_id`),
ADD KEY `privilege_id` (`privilege_id`);
--
-- Indizes für die Tabelle `Groups`
--
ALTER TABLE `Groups`
ADD PRIMARY KEY (`UID`);
--
-- Indizes für die Tabelle `LogEntries`
--
ALTER TABLE `LogEntries`
ADD PRIMARY KEY (`id`),
ADD KEY `timestamp` (`timestamp`);
--
-- Indizes für die Tabelle `Messages`
--
ALTER TABLE `Messages`
ADD PRIMARY KEY (`id`),
ADD KEY `Datum` (`Datum`),
ADD KEY `SUID` (`SUID`),
ADD KEY `RUID` (`RUID`);
--
-- Indizes für die Tabelle `NeededAngelTypes`
--
ALTER TABLE `NeededAngelTypes`
ADD PRIMARY KEY (`id`),
ADD KEY `room_id` (`room_id`,`angel_type_id`),
ADD KEY `shift_id` (`shift_id`),
ADD KEY `angel_type_id` (`angel_type_id`);
--
-- Indizes für die Tabelle `News`
--
ALTER TABLE `News`
ADD PRIMARY KEY (`ID`),
ADD KEY `UID` (`UID`);
--
-- Indizes für die Tabelle `NewsComments`
--
ALTER TABLE `NewsComments`
ADD PRIMARY KEY (`ID`),
ADD KEY `Refid` (`Refid`),
ADD KEY `UID` (`UID`);
--
-- Indizes für die Tabelle `Privileges`
--
ALTER TABLE `Privileges`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `name` (`name`);
--
-- Indizes für die Tabelle `Questions`
--
ALTER TABLE `Questions`
ADD PRIMARY KEY (`QID`),
ADD KEY `UID` (`UID`),
ADD KEY `AID` (`AID`);
--
-- Indizes für die Tabelle `Room`
--
ALTER TABLE `Room`
ADD PRIMARY KEY (`RID`),
ADD UNIQUE KEY `Name` (`Name`);
--
-- Indizes für die Tabelle `ShiftEntry`
--
ALTER TABLE `ShiftEntry`
ADD PRIMARY KEY (`id`),
ADD KEY `TID` (`TID`),
ADD KEY `UID` (`UID`),
ADD KEY `SID` (`SID`,`TID`),
ADD KEY `freeloaded` (`freeloaded`);
--
-- Indizes für die Tabelle `Shifts`
--
ALTER TABLE `Shifts`
ADD PRIMARY KEY (`SID`),
ADD UNIQUE KEY `PSID` (`PSID`),
ADD KEY `RID` (`RID`),
ADD KEY `shifttype_id` (`shifttype_id`),
ADD KEY `created_by_user_id` (`created_by_user_id`),
ADD KEY `edited_by_user_id` (`edited_by_user_id`);
--
-- Indizes für die Tabelle `ShiftTypes`
--
ALTER TABLE `ShiftTypes`
ADD PRIMARY KEY (`id`),
ADD KEY `angeltype_id` (`angeltype_id`);
--
-- Indizes für die Tabelle `User`
--
ALTER TABLE `User`
ADD PRIMARY KEY (`UID`),
ADD UNIQUE KEY `Nick` (`Nick`),
ADD KEY `api_key` (`api_key`),
ADD KEY `password_recovery_token` (`password_recovery_token`),
ADD KEY `force_active` (`force_active`),
ADD KEY `arrival_date` (`arrival_date`,`planned_arrival_date`),
ADD KEY `planned_departure_date` (`planned_departure_date`);
--
-- Indizes für die Tabelle `UserAngelTypes`
--
ALTER TABLE `UserAngelTypes`
ADD PRIMARY KEY (`id`),
ADD KEY `user_id` (`user_id`,`angeltype_id`,`confirm_user_id`),
ADD KEY `angeltype_id` (`angeltype_id`),
ADD KEY `confirm_user_id` (`confirm_user_id`),
ADD KEY `coordinator` (`coordinator`);
--
-- Indizes für die Tabelle `UserDriverLicenses`
--
ALTER TABLE `UserDriverLicenses`
ADD PRIMARY KEY (`user_id`);
--
-- Indizes für die Tabelle `UserGroups`
--
ALTER TABLE `UserGroups`
ADD PRIMARY KEY (`id`),
ADD KEY `uid` (`uid`,`group_id`),
ADD KEY `group_id` (`group_id`);
--
-- AUTO_INCREMENT für exportierte Tabellen
--
--
-- AUTO_INCREMENT für Tabelle `AngelTypes`
--
ALTER TABLE `AngelTypes`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT für Tabelle `GroupPrivileges`
--
ALTER TABLE `GroupPrivileges`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=259;
--
-- AUTO_INCREMENT für Tabelle `LogEntries`
--
ALTER TABLE `LogEntries`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `Messages`
--
ALTER TABLE `Messages`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `NeededAngelTypes`
--
ALTER TABLE `NeededAngelTypes`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `News`
--
ALTER TABLE `News`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `NewsComments`
--
ALTER TABLE `NewsComments`
MODIFY `ID` bigint(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `Privileges`
--
ALTER TABLE `Privileges`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;
--
-- AUTO_INCREMENT für Tabelle `Questions`
--
ALTER TABLE `Questions`
MODIFY `QID` bigint(20) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `Room`
--
ALTER TABLE `Room`
MODIFY `RID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT für Tabelle `ShiftEntry`
--
ALTER TABLE `ShiftEntry`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT für Tabelle `Shifts`
--
ALTER TABLE `Shifts`
MODIFY `SID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT für Tabelle `ShiftTypes`
--
ALTER TABLE `ShiftTypes`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT für Tabelle `User`
--
ALTER TABLE `User`
MODIFY `UID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT für Tabelle `UserAngelTypes`
--
ALTER TABLE `UserAngelTypes`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT für Tabelle `UserGroups`
--
ALTER TABLE `UserGroups`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
-- --
-- Constraints der exportierten Tabellen -- Constraints der exportierten Tabellen
-- --
@ -556,10 +788,15 @@ ALTER TABLE `UserAngelTypes`
ADD CONSTRAINT `userangeltypes_ibfk_2` FOREIGN KEY (`angeltype_id`) REFERENCES `AngelTypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `userangeltypes_ibfk_2` FOREIGN KEY (`angeltype_id`) REFERENCES `AngelTypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `userangeltypes_ibfk_3` FOREIGN KEY (`confirm_user_id`) REFERENCES `User` (`UID`) ON DELETE SET NULL ON UPDATE CASCADE; ADD CONSTRAINT `userangeltypes_ibfk_3` FOREIGN KEY (`confirm_user_id`) REFERENCES `User` (`UID`) ON DELETE SET NULL ON UPDATE CASCADE;
--
-- Constraints der Tabelle `UserDriverLicenses`
--
ALTER TABLE `UserDriverLicenses`
ADD CONSTRAINT `userdriverlicenses_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `User` (`UID`) ON DELETE CASCADE ON UPDATE CASCADE;
-- --
-- Constraints der Tabelle `UserGroups` -- Constraints der Tabelle `UserGroups`
-- --
ALTER TABLE `UserGroups` ALTER TABLE `UserGroups`
ADD CONSTRAINT `usergroups_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `Groups` (`UID`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `usergroups_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `Groups` (`UID`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `usergroups_ibfk_2` FOREIGN KEY (`uid`) REFERENCES `User` (`UID`) ON DELETE CASCADE ON UPDATE CASCADE; ADD CONSTRAINT `usergroups_ibfk_2` FOREIGN KEY (`uid`) REFERENCES `User` (`UID`) ON DELETE CASCADE ON UPDATE CASCADE;
SET FOREIGN_KEY_CHECKS=1;

View File

@ -1,32 +0,0 @@
-- drivers license information
CREATE TABLE IF NOT EXISTS `UserDriverLicenses` (
`user_id` int(11) NOT NULL,
`has_car` tinyint(1) NOT NULL,
`has_license_car` tinyint(1) NOT NULL,
`has_license_3_5t_transporter` tinyint(1) NOT NULL,
`has_license_7_5t_truck` tinyint(1) NOT NULL,
`has_license_12_5t_truck` tinyint(1) NOT NULL,
`has_license_forklift` tinyint(1) NOT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `UserDriverLicenses`
ADD CONSTRAINT `userdriverlicenses_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `User` (`UID`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `AngelTypes` ADD `requires_driver_license` BOOLEAN NOT NULL;
-- ---------------------------------------------------------------------------------
-- Settings table
DROP TABLE IF EXISTS `Settings`;
CREATE TABLE IF NOT EXISTS `Settings` (
`event_name` varchar(255) DEFAULT NULL,
`buildup_start_date` int(11) DEFAULT NULL,
`event_start_date` int(11) DEFAULT NULL,
`event_end_date` int(11) DEFAULT NULL,
`teardown_end_date` int(11) DEFAULT NULL,
`event_welcome_msg` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
-- Added privilege for Admin Settings
INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES (39, 'admin_settings', 'Settings Page for Admin');
INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES (218, -4, 39);

View File

@ -1,10 +1,15 @@
<?php <?php
function admin_settings_title() { function event_config_title() {
return _("Settings"); return _("Event config");
} }
function admin_settings() { function event_config_edit_controller() {
global $privileges;
if (! in_array('admin_event_config', $privileges))
redirect('?');
$event_name = null; $event_name = null;
$event_welcome_msg = null; $event_welcome_msg = null;
$buildup_start_date = null; $buildup_start_date = null;
@ -12,9 +17,9 @@ function admin_settings() {
$event_end_date = null; $event_end_date = null;
$teardown_end_date = null; $teardown_end_date = null;
$settings_source = Settings(); $settings_source = EventConfig();
if ($settings_source === false) if ($settings_source === false)
engelsystem_error('Unable to load settings.'); engelsystem_error('Unable to load event config.');
if ($settings_source != null) { if ($settings_source != null) {
$event_name = $settings_source['event_name']; $event_name = $settings_source['event_name'];
$buildup_start_date = $settings_source['buildup_start_date']; $buildup_start_date = $settings_source['buildup_start_date'];
@ -54,41 +59,21 @@ function admin_settings() {
$ok &= $result->isOk(); $ok &= $result->isOk();
if ($ok) { if ($ok) {
$result = Settings_update($event_name, $buildup_start_date, $event_start_date, $event_end_date, $teardown_end_date, $event_welcome_msg); $result = EventConfig_update($event_name, $buildup_start_date, $event_start_date, $event_end_date, $teardown_end_date, $event_welcome_msg);
if ($result === false) if ($result === false)
engelsystem_error("Unable to update settings."); engelsystem_error("Unable to update event config.");
engelsystem_log("Changed event config: $event_name, $event_welcome_msg, $buildup_start_date, $event_start_date, $event_end_date, $teardown_end_date");
success(_("Settings saved.")); success(_("Settings saved."));
redirect(page_link_to('admin_settings')); redirect(page_link_to('admin_settings'));
} }
} }
return page_with_title(admin_settings_title(), [ return [
msg(), event_config_title(),
form([ EventConfig_edit_view($event_name, $event_welcome_msg, $buildup_start_date, $event_start_date, $event_end_date, $teardown_end_date)
div('row', [ ];
div('col-md-6', [
form_text('event_name', _("Event Name"), $event_name),
form_info('', _("Event Name is shown on the start page.")),
form_textarea('event_welcome_msg', _("Event Welcome Message"), $event_welcome_msg),
form_info('', _("Welcome message is shown after successful registration. You can use markdown."))
]),
div('col-md-3', [
form_date('buildup_start_date', _("Buildup date"), $buildup_start_date),
form_date('event_start_date', _("Event start date"), $event_start_date)
]),
div('col-md-3', [
form_date('teardown_end_date', _("Teardown end date"), $teardown_end_date),
form_date('event_end_date', _("Event end date"), $event_end_date)
])
]),
div('row', [
div('col-md-6', [
form_submit('submit', _("Save"))
])
])
])
]);
} }
?>
?>

View File

@ -11,6 +11,7 @@ require_once realpath(__DIR__ . '/../includes/sys_page.php');
require_once realpath(__DIR__ . '/../includes/sys_template.php'); require_once realpath(__DIR__ . '/../includes/sys_template.php');
require_once realpath(__DIR__ . '/../includes/model/AngelType_model.php'); require_once realpath(__DIR__ . '/../includes/model/AngelType_model.php');
require_once realpath(__DIR__ . '/../includes/model/EventConfig_model.php');
require_once realpath(__DIR__ . '/../includes/model/LogEntries_model.php'); require_once realpath(__DIR__ . '/../includes/model/LogEntries_model.php');
require_once realpath(__DIR__ . '/../includes/model/Message_model.php'); require_once realpath(__DIR__ . '/../includes/model/Message_model.php');
require_once realpath(__DIR__ . '/../includes/model/NeededAngelTypes_model.php'); require_once realpath(__DIR__ . '/../includes/model/NeededAngelTypes_model.php');
@ -22,9 +23,9 @@ require_once realpath(__DIR__ . '/../includes/model/UserAngelTypes_model.php');
require_once realpath(__DIR__ . '/../includes/model/UserDriverLicenses_model.php'); require_once realpath(__DIR__ . '/../includes/model/UserDriverLicenses_model.php');
require_once realpath(__DIR__ . '/../includes/model/UserGroups_model.php'); require_once realpath(__DIR__ . '/../includes/model/UserGroups_model.php');
require_once realpath(__DIR__ . '/../includes/model/User_model.php'); require_once realpath(__DIR__ . '/../includes/model/User_model.php');
require_once realpath(__DIR__ . '/../includes/model/Settings_model.php');
require_once realpath(__DIR__ . '/../includes/view/AngelTypes_view.php'); require_once realpath(__DIR__ . '/../includes/view/AngelTypes_view.php');
require_once realpath(__DIR__ . '/../includes/view/EventConfig_view.php');
require_once realpath(__DIR__ . '/../includes/view/Questions_view.php'); require_once realpath(__DIR__ . '/../includes/view/Questions_view.php');
require_once realpath(__DIR__ . '/../includes/view/Rooms_view.php'); require_once realpath(__DIR__ . '/../includes/view/Rooms_view.php');
require_once realpath(__DIR__ . '/../includes/view/Shifts_view.php'); require_once realpath(__DIR__ . '/../includes/view/Shifts_view.php');
@ -35,6 +36,7 @@ require_once realpath(__DIR__ . '/../includes/view/UserDriverLicenses_view.php')
require_once realpath(__DIR__ . '/../includes/view/User_view.php'); require_once realpath(__DIR__ . '/../includes/view/User_view.php');
require_once realpath(__DIR__ . '/../includes/controller/angeltypes_controller.php'); require_once realpath(__DIR__ . '/../includes/controller/angeltypes_controller.php');
require_once realpath(__DIR__ . '/../includes/controller/event_config_controller.php');
require_once realpath(__DIR__ . '/../includes/controller/rooms_controller.php'); require_once realpath(__DIR__ . '/../includes/controller/rooms_controller.php');
require_once realpath(__DIR__ . '/../includes/controller/shifts_controller.php'); require_once realpath(__DIR__ . '/../includes/controller/shifts_controller.php');
require_once realpath(__DIR__ . '/../includes/controller/shifttypes_controller.php'); require_once realpath(__DIR__ . '/../includes/controller/shifttypes_controller.php');

View File

@ -3,8 +3,8 @@
/** /**
* Get settings. * Get settings.
*/ */
function Settings() { function EventConfig() {
$settings = sql_select("SELECT * FROM `Settings` LIMIT 1"); $settings = sql_select("SELECT * FROM `EventConfig` LIMIT 1");
if ($settings === false) if ($settings === false)
return false; return false;
if (count($settings) > 0) if (count($settings) > 0)
@ -22,9 +22,9 @@ function Settings() {
* @param int $teardown_end_date * @param int $teardown_end_date
* @param string $event_welcome_msg * @param string $event_welcome_msg
*/ */
function Settings_update($event_name, $buildup_start_date, $event_start_date, $event_end_date, $teardown_end_date, $event_welcome_msg) { function EventConfig_update($event_name, $buildup_start_date, $event_start_date, $event_end_date, $teardown_end_date, $event_welcome_msg) {
if (Settings() == null) { if (Settings() == null) {
return sql_query("INSERT INTO `Settings` SET return sql_query("INSERT INTO `EventConfig` SET
`event_name`=" . sql_null($event_name) . ", `event_name`=" . sql_null($event_name) . ",
`buildup_start_date`=" . sql_null($buildup_start_date) . ", `buildup_start_date`=" . sql_null($buildup_start_date) . ",
`event_start_date`=" . sql_null($event_start_date) . ", `event_start_date`=" . sql_null($event_start_date) . ",
@ -32,7 +32,7 @@ function Settings_update($event_name, $buildup_start_date, $event_start_date, $e
`teardown_end_date`=" . sql_null($teardown_end_date) . ", `teardown_end_date`=" . sql_null($teardown_end_date) . ",
`event_welcome_msg`=" . sql_null($event_welcome_msg)); `event_welcome_msg`=" . sql_null($event_welcome_msg));
} }
return sql_query("UPDATE `Settings` SET return sql_query("UPDATE `EventConfig` SET
`event_name`=" . sql_null($event_name) . ", `event_name`=" . sql_null($event_name) . ",
`buildup_start_date`=" . sql_null($buildup_start_date) . ", `buildup_start_date`=" . sql_null($buildup_start_date) . ",
`event_start_date`=" . sql_null($event_start_date) . ", `event_start_date`=" . sql_null($event_start_date) . ",

View File

@ -126,7 +126,7 @@ function make_navigation() {
"admin_groups" => admin_groups_title(), "admin_groups" => admin_groups_title(),
"admin_import" => admin_import_title(), "admin_import" => admin_import_title(),
"admin_log" => admin_log_title(), "admin_log" => admin_log_title(),
"admin_settings" => admin_settings_title() "admin_event_config" => event_config_title()
); );
foreach ($admin_pages as $page => $title) foreach ($admin_pages as $page => $title)

View File

@ -0,0 +1,41 @@
<?php
/**
* Render edit page for event config.
* @param string $event_name The event name
* @param string $event_welcome_msg The welcome message
* @param date $buildup_start_date
* @param date $event_start_date
* @param date $event_end_date
* @param date $teardown_end_date
*/
function EventConfig_edit_view($event_name, $event_welcome_msg, $buildup_start_date, $event_start_date, $event_end_date, $teardown_end_date) {
return page_with_title(admin_settings_title(), [
msg(),
form([
div('row', [
div('col-md-6', [
form_text('event_name', _("Event Name"), $event_name),
form_info('', _("Event Name is shown on the start page.")),
form_textarea('event_welcome_msg', _("Event Welcome Message"), $event_welcome_msg),
form_info('', _("Welcome message is shown after successful registration. You can use markdown."))
]),
div('col-md-3', [
form_date('buildup_start_date', _("Buildup date"), $buildup_start_date),
form_date('event_start_date', _("Event start date"), $event_start_date)
]),
div('col-md-3', [
form_date('teardown_end_date', _("Teardown end date"), $teardown_end_date),
form_date('event_end_date', _("Event end date"), $event_end_date)
])
]),
div('row', [
div('col-md-6', [
form_submit('submit', _("Save"))
])
])
])
]);
}
?>

View File

@ -2,19 +2,20 @@
require_once realpath(__DIR__ . '/../includes/engelsystem_provider.php'); require_once realpath(__DIR__ . '/../includes/engelsystem_provider.php');
$free_pages = array( $free_pages = array(
'stats', 'admin_event_config',
'shifts_json_export_all',
'user_password_recovery',
'api',
'credits',
'angeltypes', 'angeltypes',
'api',
'atom',
'credits',
'ical',
'login',
'shifts',
'shifts_json_export',
'shifts_json_export_all',
'stats',
'users', 'users',
'user_driver_licenses', 'user_driver_licenses',
'ical', 'user_password_recovery'
'shifts_json_export',
'shifts',
'atom',
'login'
); );
// Gewünschte Seite/Funktion // Gewünschte Seite/Funktion
@ -63,6 +64,8 @@ if (isset($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && (i
list($title, $content) = user_driver_licenses_controller(); list($title, $content) = user_driver_licenses_controller();
} elseif ($p == "shifttypes") { } elseif ($p == "shifttypes") {
list($title, $content) = shifttypes_controller(); list($title, $content) = shifttypes_controller();
} elseif ($p == "admin_event_config") {
list($title, $content) = event_config_edit_controller();
} elseif ($p == "news") { } elseif ($p == "news") {
$title = news_title(); $title = news_title();
$content = user_news(); $content = user_news();
@ -133,9 +136,6 @@ if (isset($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && (i
} elseif ($p == "admin_log") { } elseif ($p == "admin_log") {
$title = admin_log_title(); $title = admin_log_title();
$content = admin_log(); $content = admin_log();
} elseif ($p == "admin_settings") {
$title = admin_settings_title();
$content = admin_settings();
} elseif ($p == "credits") { } elseif ($p == "credits") {
require_once realpath(__DIR__ . '/../includes/pages/guest_credits.php'); require_once realpath(__DIR__ . '/../includes/pages/guest_credits.php');
$title = credits_title(); $title = credits_title();