Update forms
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 2 May 2014 17:57:12 +0000 (17:57 +0000)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 2 May 2014 17:57:12 +0000 (17:57 +0000)
create new form for Temp storage

Toolkit/Contacts/ServiceRequest.php
Toolkit/Contacts/TempStorageQuickLaunch.php [new file with mode: 0755]

index 9002324..ceb02b0 100755 (executable)
@@ -79,7 +79,7 @@ class Toolkit_Contacts_ServiceRequest
         .listing {display:none;}
         </style>
         <div id="form-success-top">
-            Thank you for requesting the ENewsetter.
+            Thank you for requesting Service.
         </div>';
     //    {{{    configureConstats()
 
@@ -273,11 +273,11 @@ class Toolkit_Contacts_ServiceRequest
         $serTypes = array(
             ''       => '',
             'group1' => '<span>Yes</span>',
-            'Anticipated Arrival Date' => 'Anticipated Arrival Date',
+            'Yes - Anticipated Arrival Date' => 'Anticipated Arrival Date',
             'group2' => '<span>No</span>',
-            'Date vessel will be delivered to CM facility'
+            'No - Date vessel will be delivered to CM facility'
                 => 'Date vessel will be delivered to CM facility',
-            'Desired Completion Date'  => 'Desired Completion Date',
+            'No - Desired Completion Date'  => 'Desired Completion Date',
         );
         $e[] = array(
             'type'    => 'select3',
@@ -289,34 +289,34 @@ class Toolkit_Contacts_ServiceRequest
         $workTypes = array(
             ''       => '',
             'group1' => '<span>Cleaning and Upkeep</span>',
-            'Wash & Vacuum' => 'Wash & Vacuum',
-            'Deck & Hull Wax Only' => 'Deck & Hull Wax Only',
-            'Paint Bottom (with anti-fouling paint)'
-                => 'Paint Bottom (with anti-fouling paint)',
-            'Clear & Oil Teak' => 'Clear & Oil Teak',
-            'Repair Navigation Lights, Blower, bilge pump, etc. (please specify below)'
-                => 'Repair Navigation Lights, Blower, bilge pump, etc. (please specify below)',
-            'Check Fire Extinguisher & Replace if Necessary'
-                => 'Check Fire Extinguisher & Replace if Necessary',
-            'Detail Cabin (Larger Vessels)' => 'Detail Cabin (Larger Vessels)',
+                'Cleaning and Upkeep - Wash & Vacuum' => 'Wash & Vacuum',
+                'Cleaning and Upkeep - Deck & Hull Wax Only' => 'Deck & Hull Wax Only',
+                'Cleaning and Upkeep - Paint Bottom (with anti-fouling paint)'
+                    => 'Paint Bottom (with anti-fouling paint)',
+                'Cleaning and Upkeep - Clear & Oil Teak' => 'Clear & Oil Teak',
+                'Cleaning and Upkeep - Repair Navigation Lights, Blower, bilge pump, etc. (please specify below)'
+                    => 'Repair Navigation Lights, Blower, bilge pump, etc. (please specify below)',
+                'Cleaning and Upkeep - Check Fire Extinguisher & Replace if Necessary'
+                    => 'Check Fire Extinguisher & Replace if Necessary',
+                'Cleaning and Upkeep - Detail Cabin (Larger Vessels)' => 'Detail Cabin (Larger Vessels)',
             'group2' => '<span>Engine</span>',
-            'Basic Check (Hoses, Steering, Battery, Fuel Tanks, etc.)'
-                => 'Basic Check (Hoses, Steering, Battery, Fuel Tanks, etc.)',
-            'Complete Ignition Tune-Up (Cap, Rotor, Plugs & Wires - if necessary)'
-                => 'Complete Ignition Tune-Up (Cap, Rotor, Plugs & Wires - if necessary)',
-            'Change Engine Oil & Filter (and water separator if necessary)'
-                => 'Change Engine Oil & Filter (and water separator if necessary)',
-            'Extensive Test run (15 to 20 minutes)'
-                => 'Extensive Test run (15 to 20 minutes)',
+                'Engine - Basic Check (Hoses, Steering, Battery, Fuel Tanks, etc.)'
+                    => 'Basic Check (Hoses, Steering, Battery, Fuel Tanks, etc.)',
+                'Engine - Complete Ignition Tune-Up (Cap, Rotor, Plugs & Wires - if necessary)'
+                    => 'Complete Ignition Tune-Up (Cap, Rotor, Plugs & Wires - if necessary)',
+                'Engine - Change Engine Oil & Filter (and water separator if necessary)'
+                    => 'Change Engine Oil & Filter (and water separator if necessary)',
+                'Engine - Extensive Test run (15 to 20 minutes)'
+                    => 'Extensive Test run (15 to 20 minutes)',
             'group2' => '<span>Outdrive & Gearcase</span>',
-            'Lube U-Joints'  => 'Lube U-Joints',
-            'Change Water impellor'  => 'Change Water impellor',
-            'Check Trim & Tilt'  => 'Check Trim & Tilt',
-            'Check Boots'  => 'Check Boots',
-            'Weld Skeg'  => 'Weld Skeg',
-            'Replace Anodes'  => 'Replace Anodes',
-            'Replace Upper Seals'  => 'Replace Upper Seals',
-            'Replace Lower Seals'  => 'Replace Lower Seals',
+                'Outdrive & Gearcase - Lube U-Joints'  => 'Lube U-Joints',
+                'Outdrive & Gearcase - Change Water impellor'  => 'Change Water impellor',
+                'Outdrive & Gearcase - Check Trim & Tilt'  => 'Check Trim & Tilt',
+                'Outdrive & Gearcase - Check Boots'  => 'Check Boots',
+                'Outdrive & Gearcase - Weld Skeg'  => 'Weld Skeg',
+                'Outdrive & Gearcase - Replace Anodes'  => 'Replace Anodes',
+                'Outdrive & Gearcase - Replace Upper Seals'  => 'Replace Upper Seals',
+                'Outdrive & Gearcase - Replace Lower Seals'  => 'Replace Lower Seals',
         );
         $e[] = array(
             'type'    => 'select3',
@@ -325,40 +325,6 @@ class Toolkit_Contacts_ServiceRequest
             'display' => 'Work Requested',
             'opts'    => $workTypes
         );
-        //if ($this->hasContactDB) {
-            //$e[] = array(
-                //'type'    => 'advcheckbox',
-                //'req'     => false,
-                //'name'    => 'mail_ok',
-                //'display' => '',
-                //'opts'    => 'Yes, I would like to receive Email Newsletters',
-                //'val'     => array(0, 1)
-            //);
-            //if (defined("MEMBERS_DB") && MEMBERS_DB) {
-                //$e[] = array(
-                    //'type'    => 'advcheckbox',
-                    //'req'     => false,
-                    //'name'    => 'members',
-                    //'display' => '',
-                    //'opts'    => 'Yes, I would like to receive information via e-mail from '.SITENAME.' Members',
-                    //'val'     => array(0, 1)
-                //);
-            //}
-        //}
-        //if (is_array($this->interestsGroups)) {
-            //foreach ($this->interestsGroups as $group => $gData) {
-                //$this->myGroups[] = $gData;
-                //$e[] = array(
-                    //'type'       => 'group',
-                    //'req'        => false,
-                    //'name'       => 'interest['.$group.']',
-                    //'group'         => $gData,
-                    //'label'      => $group,
-                    //'seperator'  => ' ',
-                    //'appendName' => true
-                //);
-            //}
-        //}
         $e[] = array(
             'type'    => 'textarea',
             'req'     => false,
diff --git a/Toolkit/Contacts/TempStorageQuickLaunch.php b/Toolkit/Contacts/TempStorageQuickLaunch.php
new file mode 100755 (executable)
index 0000000..149bfac
--- /dev/null
@@ -0,0 +1,309 @@
+<?php
+//    vim:set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker syntax=php:
+
+/**
+ * File Doc Comment
+ *
+ * PHP version 5
+ *
+ * @category Toolkit
+ * @package  Contacts
+ * @author   Jamie Kahgee <jamie.kahgee@gmail.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @version  CVS: $Id: ContactUs.php,v 1.36 2010/07/14 23:33:15 jamie Exp $
+ * @link     http://demo.gaslightmedia.com
+ */
+
+/**
+ * Error codes for Toolkit_Contacts_ContactUs
+ *
+ * Codes are mapped to textual messaged by errorMessage() method,
+ * if you add a new code be sure to add a new message for it to errorMessage()
+ *
+ * @see Toolkit_Contacts_ContactUs::errorMessage()
+ */
+
+/**
+ * GLM Contact Us form
+ *
+ * This form handles rendering and processing the contact us form.
+ * Controls the email functionality of the form, whether the client
+ * has a contact DB to store contact records and how to insert/update
+ * submitted form values.
+ *
+ * @category  Toolkit
+ * @package   Contacts
+ * @author    Jamie Kahgee <jamie.kahgee@gmail.com>
+ * @copyright 2009 Jamie Kahgee
+ * @license   http://www.gaslightmedia.com Gaslightmedia
+ * @link      http://demo.gaslightmedia.com
+ * @see       Toolkit_FormBuilder
+ */
+class Toolkit_Contacts_TempStorageQuickLaunch
+    extends Toolkit_Contacts_ContactUs
+{
+    /**
+     * Contact type to be inserted into the DB as when the form is submitted
+     *
+     * This property is only valid when the [hasContactDB] property is set
+     * to true.
+     *
+     * N.B.
+     * If you subclass this class out to other forms that are
+     * inserted into the contact db, be sure to make each one of their
+     * contactType properties unique.  We don't check for duplicates.
+     *
+     * @var string
+     * @access protected
+     */
+    protected $contactType = '2';
+    /**
+     * Email subject and <h1> header in email
+     *
+     * It gets set in the constructor if you leave empty here, but you
+     * can set it to something different here to override that if you desire.
+     *
+     * @var    string
+     * @access protected
+     */
+    public $subject = "ENews Signup Form from website";
+    /**
+     * Message to display if the form is successfully submitted
+     *
+     * @var    string
+     * @access protected
+     */
+    protected $successMsg = '
+        <style type="text/css">
+        #category {display:none;}
+        .listing {display:none;}
+        </style>
+        <div id="form-success-top">
+            Thank you for requesting Temporary Storage & Quick Launch.
+        </div>';
+    //    {{{    configureConstats()
+
+    /**
+     * Class constructor
+     *
+     * @param object $pdo         PHP Data Object
+     * @param string $formName    Form's name.
+     * @param string $method      (optional)Form's method defaults to 'POST'
+     * @param string $action      (optional)Form's action
+     * @param string $target      (optional)Form's target defaults to '_self'
+     * @param mixed  $attributes  (optional)Extra attributes for <form> tag
+     * @param bool   $trackSubmit (optional)Whether to track if the form was
+     *                              submitted by adding a special hidden field
+     *
+     * @author Jamie Kahgee <jamie.kahgee@gmail.com>
+     * @access public
+     * @link   http://pear.php.net/package/HTML_QuickForm/docs/latest/HTML_QuickForm/HTML_QuickForm.html
+     * @see    HTML_QuickForm
+     */
+    public function __construct(
+        PDO $pdo,
+        $formName,
+        $method = 'post',
+        $action = '',
+        $target = '',
+        $attributes = null,
+        $trackSubmit = false
+    ) {
+        parent::__construct(
+            $pdo,
+            $formName,
+            $method,
+            $action,
+            $target,
+            $attributes,
+            $trackSubmit
+        );
+        $this->email = ENEWS_EMAIL;
+    }
+
+    /**
+     * Constant variables for the form
+     *
+     * These values won't get overridden by POST or GET vars
+     *
+     * @return void
+     * @access public
+     */
+    public function configureConstants()
+    {
+        $constants = array(
+            'user_agent' => $_SERVER['HTTP_USER_AGENT'],
+            'remote_addr' => $_SERVER['REMOTE_ADDR'],
+            'mail_ok' => 1
+        );
+        $this->setupConstants($constants);
+    }
+
+    //    }}}
+    //    {{{    configureElements()
+
+    /**
+     * Form element definitions
+     *
+     * @return void
+     * @access public
+     */
+    public function configureElements()
+    {
+        $e = array();
+        if ($this->hasContactDB) {
+            $this->setInterestFields();
+            //    Grouped Elements are defined here.
+            $this->interestsGroups =& $this->getInterestFields();
+        }
+
+        //    All Elements are created here.  This includes group element definitions.
+        $e[] = array(
+            'type' => 'hidden',
+            'req'  => false,
+            'name' => 'user_agent'
+        );
+        $e[] = array(
+            'type' => 'hidden',
+            'req'  => false,
+            'name' => 'remote_addr'
+        );
+        $e[] = array(
+            'type'    => 'header',
+            'name'    => 'firstHdr_rmv',
+            'display' => ''
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => true,
+            'name'    => 'fname',
+            'display' => 'First Name'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => true,
+            'name'    => 'lname',
+            'display' => 'Last Name'
+        );
+        $e[] = array(
+            'type'    => 'tel',
+            'req'     => true,
+            'name'    => 'phone',
+            'display' => 'Home Phone'
+        );
+        $e[] = array(
+            'type'    => 'tel',
+            'req'     => true,
+            'name'    => 'mobile_phone',
+            'display' => 'Mobile Phone'
+        );
+        $e[] = array(
+            'type'    => 'email',
+            'req'     => true,
+            'name'    => 'email',
+            'display' => 'Email'
+        );
+        $e[] = array(
+            'type'    => 'email',
+            'req'     => true,
+            'name'    => 'email_rmv',
+            'display' => 'Verify Email'
+        );
+        if ($this->tableName == 'customer') {
+            $add1 = 'add1';
+            $add2 = 'add2';
+        } else {
+            $add1 = 'address';
+            $add2 = 'address2';
+        }
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => true,
+            'name'    => $add1,
+            'display' => 'Address 1'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => $add2,
+            'display' => 'Address 2'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => true,
+            'name'    => 'city',
+            'display' => 'City'
+        );
+        $e[] = array(
+            'type'    => 'select',
+            'req'     => true,
+            'name'    => 'state',
+            'display' => 'State/Province',
+            'opts'    => $GLOBALS['states']
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => true,
+            'name'    => 'zip',
+            'display' => 'ZIP/Postal Code'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => true,
+            'name'    => 'name_of_vessel',
+            'display' => 'Name of Vessel'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => true,
+            'name'    => 'make_and_model_of_vessel',
+            'display' => 'Make and Model of Vessel'
+        );
+        //$servTypes = array(
+            //''                 => 'Select Engine Type',
+            //'group1'           => '<span>Outboard</span>',
+            //'Mercury'          => 'Mercury',
+            //'Evinrude / Johnson' => 'Evinrude / Johnson',
+            //'group2'           => '<span>Stern Drive</span>',
+            //'Mercruiser'       => 'Mercruiser',
+            //'group3'           => '<span>Sail Boats</span>',
+            //'N/A'              => 'Not Applicable'
+        //);
+        //$e[] = array(
+            //'type'    => 'select3',
+            //'req'     => true,
+            //'name'    => 'service_required',
+            //'display' => 'Service Required',
+            //'opts'    => $servTypes
+        //);
+        $e[] = array(
+            'type'    => 'textarea',
+            'req'     => false,
+            'name'    => 'comments',
+            'display' => 'Additional Issues, Comments or Directions'
+        );
+        $e[] = array(
+            'type'    => 'CAPTCHA_Image',
+            'req'     => false,
+            'name'    => 'captcha_question',
+            'display' => 'Verification code',
+            'opts'    => $this->captchaOptions
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => true,
+            'name'    => 'captcha_rmv',
+            'display' => 'Enter verification code'
+        );
+        $e[] = array(
+            'type'    => 'submit',
+            'req'     => false,
+            'name'    => 'submit_rmv',
+            'display' => 'Submit Form'
+        );
+
+        $this->setupElements($e);
+    }
+
+    //    }}}
+}