summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-04-19 14:04:17 +0200
committerJonas Smedegaard <dr@jones.dk>2017-04-19 14:04:17 +0200
commit4bdc3db9c4e7f720d3ed1a6d214f2cac9448fe57 (patch)
tree1e0b3dcb73ed19195fbde4a0072a671557068c9e
parentade6a3d8e21fefa07781a2e4c954c0ab858182d7 (diff)
Change into booking request form.HEADmaster
-rwxr-xr-xbook/index.cgi (renamed from footer.cgi)76
1 files changed, 60 insertions, 16 deletions
diff --git a/footer.cgi b/book/index.cgi
index d308e86..7b8339c 100755
--- a/footer.cgi
+++ b/book/index.cgi
@@ -5,13 +5,13 @@ use CGI::FormBuilder;
my $docroot = '../build/html';
# TODO: check if protocol-agnostic URL works
-my $webroot = 'https://stadsvandring.dk/form';
-my $req_path = $docroot . '/index.tmpl';
-my $ack_path = $docroot . '/thanks/index.html';
+my $webroot = 'https://stadsvandring.dk/book-form';
+my $req_path = $docroot . '/book/index.tmpl';
+my $ack_path = $docroot . '/book/thanks/index.html';
my $webmaster = 'webmaster@stadsvandring.dk';
-my $frontdesk = 'info@stadsvandring.dk';
-my $helpdesk = 'hostmaster@stadsvandring.dk';
+my $frontdesk = 'stadsvandring@stadsvandring.dk';
+my $helpdesk = 'webmaster@stadsvandring.dk';
# Set this to 1 for a separate confirmation page
my ($confirm) = 1;
@@ -20,12 +20,19 @@ my ($confirm) = 1;
my $valid_email = '/^[+_A-Za-z0-9-]+(\.[+_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(\.[_A-Za-z0-9-]+)$/';
my $form = CGI::FormBuilder->new(
- lang => 'en',
- title => 'stadsvandring contact form',
+ lang => 'sv',
+ title => 'Din næste stadsvandring',
method => 'POST',
fields => [qw/
+ requests
+ places
+ time
+ size
name
+ org
email
+ addr
+ misc
/],
validate => {
email => $valid_email,
@@ -34,19 +41,56 @@ my $form = CGI::FormBuilder->new(
required => [qw/
name
email
+ requests
/],
- messages => ':en_US',
- submit => ['Submit'],
+ messages => ':sv_SE',
+# submit => ['Submit'],
action => $webroot, #avoids loosing submitted values when redirected from other site
);
$form->field(
+ name => 'requests',
+ label => 'Önskemål om tur',
+ type => 'textarea',
+ rows => 3,
+);
+$form->field(
+ name => 'places',
+ label => 'Önskemål om start och– slut på turenlokalitet',
+ type => 'textarea',
+ rows => 3,
+);
+$form->field(
+ name => 'time',
+ label => 'Datum och tid',
+);
+$form->field(
+ name => 'size',
+ label => 'Gruppstorlek',
+);
+$form->field(
name => 'name',
- placeholder => 'Name',
+ label => 'Namn',
+);
+$form->field(
+ name => 'org',
+ label => 'Företag eller institution',
);
$form->field(
name => 'email',
- placeholder => 'Email',
+ label => 'Mailadress',
+);
+$form->field(
+ name => 'addr',
+ label => 'Adress och telefonnummer',
+ type => 'textarea',
+ rows => 3,
+);
+$form->field(
+ name => 'misc',
+ label => 'Andra upplysningar om gruppen och andra önskemål om turen',
+ type => 'textarea',
+ rows => 6,
);
my ($form_required_text) = $form->{opt}{messages}{form_required_text};
@@ -54,14 +98,14 @@ my ($mail_from) = $webmaster;
my ($mail_to, $mail_subject);
if ($form->submitted) {
- $infostring = "Thanks for your interest in stadsvandring.dk!";
+ $infostring = "Tak for din booking-ansøgning ved stadsvandring.dk - du vil snarest blive kontaktet!";
if ($form->validate) {
$mail_to = $frontdesk;
- $mail_subject = 'stadsvandring.dk contact form';
+ $mail_subject = 'stadsvandring.dk booking-ansøgning';
} else {
$mail_to = "$frontdesk, $helpdesk";
- $mail_subject = 'ERROR in stadsvandring.dk contact form';
- $infostring .= "\n<P>NB! There was an error in one or more of the fields. The info was sent anyway, but you are adviced to go back, check that all fields are properly filed out, and then send again.";
+ $mail_subject = 'FEL i stadsvandring.dk booking-ansökan';
+ $infostring .= "\n<P>NB! Det var en FEL i en eller flere af telterne. Din ansökan blev sendt alligevel, men vi anbefaler at du checker igen at blanketten er korrekt udfyldt og sender den igen.";
$confirm = 0;
};
# Abuse subject to add additional headers
@@ -73,7 +117,7 @@ if ($form->submitted) {
subject => "$mail_subject",
);
if ($confirm) {
- $infostring .= "\n<P>The following info has been submitted:";
+ $infostring .= "\n<P>Følgende informationer blev sendt:";
$form->{opt}{messages}{form_confirm_text} = "$infostring";
print $form->confirm(
header => 1,