Remove SessionManager and placeholders. (Will be implemented in

JavaScript later.)
This commit is contained in:
Markus Birth 2017-02-06 23:36:30 +01:00
parent 608854b57d
commit 06d664ceb2
9 changed files with 16 additions and 64 deletions

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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

View File

@ -1,17 +0,0 @@
<?php
namespace Frs;
class SessionManager
{
public function __construct()
{
session_start();
}
public function storeFormData($form_type)
{
$skey = 'form_' . $form_type;
$_SESSION[$skey] = $_POST;
}
}