From 7aef17aa608a3cfd743c73e1ae1b1fa6c7034c16 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 3 Apr 2017 00:35:08 +0200 Subject: Adapt to omni-presence. --- form.cgi | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/form.cgi b/form.cgi index 005fd5e..16242c3 100755 --- a/form.cgi +++ b/form.cgi @@ -5,14 +5,14 @@ use CGI::FormBuilder; my $build_path = '../build'; # TODO: check if protocol-agnostic URL works -my $webroot = 'http://bynu.biks.dk/feedback/'; -my $req_path = $build_path . '/html/feedback/index.html'; -my $ack_path = $build_path . '/html/feedback/tak/index.html'; +my $webroot = 'https://omni-presence.dk/contact/'; +my $req_path = $build_path . '/html/contact/index.html'; +my $ack_path = $build_path . '/html/contact/thanks/index.html'; -my $webmaster = 'info@byvandring.nu'; -#my $frontdesk = 'info@byvandring.nu'; -my $frontdesk = 'siri@jones.dk'; -my $helpdesk = 'siri@jones.dk'; +my $webmaster = 'webmaster@couchdesign.dk'; +#my $frontdesk = 'info@omni-presence.dk'; +my $frontdesk = 'anniqalewis@gmail.com'; +my $helpdesk = 'dr@jones.dk'; # Set this to 1 for a separate confirmation page my ($confirm) = 1; @@ -21,39 +21,37 @@ 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 => 'da', - title => 'Feedback til Byvandring.nu', + lang => 'en', + title => 'Omni-presence contact form', method => 'POST', fields => [qw/ - kommentar - postnr + comment + zip email /], validate => { - postnr => INT, + zip => INT, email => $valid_email, _email => $valid_email, #fake check to silence warning of variable used only once }, required => [qw/ - kommentar + comment /], - messages => ':da_DK', - submit => ['Send oplysningerne'], + messages => ':en_US', + submit => ['Send the info'], action => $webroot, #avoids loosing submitted values when redirected from other site ); $form->field( - name => 'postnr', - label => 'Postnummer', + name => 'zip', + label => 'Postal nummer', size => 5, - comment => '(hvis du har lyst)' ); $form->field( name => 'email', - comment => '(hvis du vil kontaktes igen)' ); $form->field( - name => 'kommentar', + name => 'comment', type => 'textarea', rows => 3, ); @@ -63,14 +61,14 @@ my ($mail_from) = $webmaster; my ($mail_to, $mail_subject); if ($form->submitted) { - $infostring = "Tak for din feedback!"; + $infostring = "Thanks for your interest in omni-presence!"; if ($form->validate) { $mail_to = $frontdesk; - $mail_subject = 'Feedback til Byvandring.nu'; + $mail_subject = 'Omni-presence contact form'; } else { $mail_to = "$frontdesk, $helpdesk"; - $mail_subject = 'FEJL ved feedback til Byvandring.nu'; - $infostring .= "\n

OBS! Der var fejl i et eller flere af felterne. Informationerne er sendt uanset, men det anbefales at gå tilbage, checke at alle felter er udfyldt korrekt, og derefter sende igen."; + $mail_subject = 'ERROR in omni-presence contact form'; + $infostring .= "\n

NB! There was an error in one or more of the fields. The info was sent anyway, but you are afviced to go back, check that all fields are properly filed out, and then send again."; $confirm = 0; }; # Abuse subject to add additional headers @@ -82,7 +80,7 @@ if ($form->submitted) { subject => "$mail_subject", ); if ($confirm) { - $infostring .= "\n

Følgende informationer er blevet sendt:"; + $infostring .= "\n

The following info has been submitted:"; $form->{opt}{messages}{form_confirm_text} = "$infostring"; print $form->confirm( header => 1, -- cgit v1.2.3