From 06d664ceb2e7db9e86b1ae2d7eea495cb348493a Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Mon, 6 Feb 2017 23:36:30 +0100 Subject: [PATCH] Remove SessionManager and placeholders. (Will be implemented in JavaScript later.) --- definitions/bus.json | 9 +++------ definitions/event.json | 6 ++---- definitions/flight.json | 6 ++---- definitions/hotel.json | 6 ++---- definitions/rentalcar.json | 6 ++---- definitions/restaurant.json | 6 ++---- definitions/train.json | 9 +++------ index.php | 15 --------------- lib/Frs/SessionManager.php | 17 ----------------- 9 files changed, 16 insertions(+), 64 deletions(-) delete mode 100644 lib/Frs/SessionManager.php diff --git a/definitions/bus.json b/definitions/bus.json index 53245d5..640e506 100644 --- a/definitions/bus.json +++ b/definitions/bus.json @@ -202,22 +202,19 @@ "title": "Name on Ticket", "type": "text", "required": false, - "group": 4, - "default": "USER_NAME" + "group": 4 }, "underName_name": { "title": "Name on Reservation", "type": "text", "required": false, - "group": 5, - "default": "USER_NAME" + "group": 5 }, "underName_email": { "title": "Email address", "type": "email", "required": false, - "group": 5, - "default": "USER_EMAIL" + "group": 5 }, "url": { "title": "Booking URL", diff --git a/definitions/event.json b/definitions/event.json index 22272b3..e081411 100644 --- a/definitions/event.json +++ b/definitions/event.json @@ -260,15 +260,13 @@ "title": "Ticket holder", "type": "text", "required": true, - "group": 3, - "default": "USER_NAME" + "group": 3 }, "underName_email": { "title": "Email address", "type": "email", "required": false, - "group": 3, - "default": "USER_EMAIL" + "group": 3 }, "url": { "title": "Reservation URL", diff --git a/definitions/flight.json b/definitions/flight.json index aee839f..d112086 100644 --- a/definitions/flight.json +++ b/definitions/flight.json @@ -235,15 +235,13 @@ "title": "Name on Reservation", "type": "text", "required": true, - "group": 5, - "default": "USER_NAME" + "group": 5 }, "underName_email": { "title": "Email address", "type": "email", "required": false, - "group": 5, - "default": "USER_EMAIL" + "group": 5 }, "url": { "title": "Booking URL", diff --git a/definitions/hotel.json b/definitions/hotel.json index f01e072..09235dc 100644 --- a/definitions/hotel.json +++ b/definitions/hotel.json @@ -187,15 +187,13 @@ "title": "Name on Reservation", "type": "text", "required": true, - "group": 2, - "default": "USER_NAME" + "group": 2 }, "underName_email": { "title": "Email address", "type": "email", "required": false, - "group": 2, - "default": "USER_EMAIL" + "group": 2 }, "url": { "title": "Booking URL", diff --git a/definitions/rentalcar.json b/definitions/rentalcar.json index 6333a8b..4a232c7 100644 --- a/definitions/rentalcar.json +++ b/definitions/rentalcar.json @@ -237,15 +237,13 @@ "title": "Name on Reservation", "type": "text", "required": true, - "group": 2, - "default": "USER_NAME" + "group": 2 }, "underName_email": { "title": "Email address", "type": "email", "required": false, - "group": 2, - "default": "USER_EMAIL" + "group": 2 }, "url": { "title": "Booking URL", diff --git a/definitions/restaurant.json b/definitions/restaurant.json index 06f545c..82e32b9 100644 --- a/definitions/restaurant.json +++ b/definitions/restaurant.json @@ -161,15 +161,13 @@ "title": "Name on Reservation", "type": "text", "required": true, - "group": 2, - "default": "USER_NAME" + "group": 2 }, "underName_email": { "title": "Email address", "type": "email", "required": false, - "group": 2, - "default": "USER_EMAIL" + "group": 2 }, "url": { "title": "Booking URL", diff --git a/definitions/train.json b/definitions/train.json index 72c8578..280c8b0 100644 --- a/definitions/train.json +++ b/definitions/train.json @@ -223,22 +223,19 @@ "title": "Name on Ticket", "type": "text", "required": false, - "group": 4, - "default": "USER_NAME" + "group": 4 }, "underName_name": { "title": "Name on Reservation", "type": "text", "required": false, - "group": 5, - "default": "USER_NAME" + "group": 5 }, "underName_email": { "title": "Email address", "type": "email", "required": false, - "group": 5, - "default": "USER_EMAIL" + "group": 5 }, "url": { "title": "Booking URL", diff --git a/index.php b/index.php index 2358cef..ee0eb52 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,6 @@ require_once __DIR__ . '/vendor' . '/autoload.php'; use \Frs\FieldDefinition; -use \Frs\SessionManager; use \Frs\Output\HtmlOutput; use \Frs\Output\MailOutput; use \Frs\Output\Transport\StdoutTransport; @@ -12,8 +11,6 @@ use \Frs\Output\Transport\GScriptTransport; $stdout = new StdoutTransport(); $ho = new HtmlOutput($stdout, dirname(__FILE__) . '/templates'); -$sm = new SessionManager(); - $action = ''; if (isset($_GET['action'])) { $action = $_GET['action']; @@ -28,10 +25,7 @@ switch ($action) { break; case 'send': - // Store input in session, in case something happens - $sm->storeFormData($_POST['form_type']); echo 'This would send the mail...'; - //$mt = new MailTransport($sm); $mt = new GScriptTransport(); $mo = new MailOutput($mt, dirname(__FILE__) . '/templates'); $form_type = $_REQUEST['form_type']; @@ -68,16 +62,7 @@ switch ($action) { $ho->setTemplate($action . '_html'); $skey = 'form_' . $action; - $placeholders = array( - 'USER_NAME' => '', - 'USER_EMAIL' => '', - ); $fd = new FieldDefinition($action); - $fd->setPlaceholders($placeholders); - if (isset($_SESSION[$skey])) { - $fd->setFieldValues($_SESSION[$skey]); - } - $by_group = $fd->getGroups(); // Convert hash to list for Mustache compatibility diff --git a/lib/Frs/SessionManager.php b/lib/Frs/SessionManager.php deleted file mode 100644 index 8c73d49..0000000 --- a/lib/Frs/SessionManager.php +++ /dev/null @@ -1,17 +0,0 @@ -