Fixed problem with cart ID that have a missing reg_request record. More improvements...
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 19 Dec 2017 13:43:40 +0000 (08:43 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 19 Dec 2017 13:43:40 +0000 (08:43 -0500)
classes/customFieldSupport.php
classes/data/dataCustomFieldsData.php
models/front/customFields/formDisplay.php
views/admin/customFields/index.html

index 86879cc..60007ee 100644 (file)
@@ -266,9 +266,11 @@ class GlmCustomFieldSupport extends GlmDataFieldsCustomFields
             $sep = ',';
         }
 
-        // Get any data already stored for these fid / record ID combination
-        $CustomFieldsData = new GlmDataFieldsCustomFieldsData($this->wpdb, $this->config);
-        $formUpdate = $CustomFieldsData->getList("field_id in ($fieldIds) AND record_id = $recordId");
+        // Get any data already stored for these field IDs / record ID combination
+        if ($fieldIds != '') {
+            $CustomFieldsData = new GlmDataFieldsCustomFieldsData($this->wpdb, $this->config);
+            $formUpdate = $CustomFieldsData->getList("field_id in ($fieldIds) AND record_id = $recordId");
+        }
 
         $this->wpdb->query("START TRANSACTION");
 
index ed91f98..8bfa5ee 100644 (file)
@@ -146,13 +146,38 @@ class GlmDataFieldsCustomFieldsData extends GlmDataAbstract
                 'use'      => 'a'
             ),
 
+            // Text data for text, textarea, and picklist fields
             'text_data' => array(
                 'field'    => 'text_data',
                 'type'     => 'text',
                 'required' => true,
                 'use'      => 'a'
+            ),
+            
+            // Data for Checkbox and other boolean fields
+            'checkbox_data' => array(
+                'field'    => 'checkbox_data',
+                'type'     => 'text',
+                'required' => true,
+                'use'      => 'a'
+            ),
+            
+            // Integer data
+            'integer_data' => array(
+                'field'    => 'integer_data',
+                'type'     => 'text',
+                'required' => true,
+                'use'      => 'a'
+            ),
+            
+            // Float data (money) 
+            'float_data' => array(
+                'field'    => 'float_data',
+                'type'     => 'text',
+                'required' => true,
+                'use'      => 'a'
             )
-
+            
         );
 
     }
index e0344ef..8c33ed7 100644 (file)
@@ -102,7 +102,7 @@ class GlmMembersFront_customFields_formDisplay extends GlmDataFieldsCustomFields
      */
     public function modelAction( $actionData = false )
     {
-
+trigger_error('********* WORKING IN formDisplay.php **********',E_USER_NOTICE);
         $formId     = false;
         $formFields = false;
         $haveForm   = false;
@@ -133,10 +133,11 @@ trigger_error('Form Display Submit Data '.print_r($actionData,1),E_USER_NOTICE);
                 // If there's a record ID
                 $recordId = ($actionData['request']['record-id'] - 0);
                 if ($recordId > 0) {
-trigger_error('recordId = '.$recordId,E_USER_NOTICE);                    
+trigger_error("fid = '$formId' AND record_id = $recordId",E_USER_NOTICE);   
+
                     // Try to get any stored data
                     $CustomFieldData = new GlmDataFieldsCustomFieldsData($this->wpdb, $this->config);
-                    $customFieldData = $CustomFieldData->getList("fid = '$formId' AND field_id = $recordId");
+                    $customFieldData = $CustomFieldData->getList("fid = '$formId' AND record_id = $recordId");
 trigger_error('Field Data = '.print_r($customFieldData,1), E_USER_NOTICE);                    
                     
                     
@@ -145,7 +146,8 @@ trigger_error('Field Data = '.print_r($customFieldData,1), E_USER_NOTICE);
             }
 
         }
-
+trigger_error('Field Data = '.print_r($formFields,1), E_USER_NOTICE); 
+        
         // Compile template data
         $templateData = array(
             'formId'        => $formId,
index 7f2bad8..1fcf1d9 100644 (file)
@@ -6,7 +6,8 @@
         <tr>
             <th class="glm-required">Field Name:</th>
             <td>
-                <input id="{$fid}_NewFieldName" type="text" name="field_name" class="glm-form-text-input-short"> (for reference - keep short)
+                <input id="{$fid}_NewFieldName" type="text" name="field_name" class="glm-form-text-input-short">
+                <br>(for reference - keep short)
             </td>
         </tr>
         <tr>
 <div id="{$fid}_NewOptionDialog" class="glm-dialog-box" style="width: 100%" title="Add a New Option">
     <table class="glm-admin-table" style="width: 100%">
         <tr>
-            <th class="glm-required" style="width: 20%; white-space: nowrap;">Option Name (for reference):</th>
-            <td><input id="{$fid}_NewOptionValue" type="text" name="option_value" class="glm-form-text-input-short"></td>
+            <th class="glm-required" style="width: 20%; white-space: nowrap;">Option Name:</th>
+            <td>
+                <input id="{$fid}_NewOptionValue" type="text" name="option_value" class="glm-form-text-input-short">
+                <br>(For reference - keep short)
+            </td>
         </tr>
         <tr>
             <th class="glm-required">Displayed Text:</th>
         <tr class="FieldRow_{$t.id}"><td colspan="4"">Prompt: {$t.field_prompt}</td></tr>
     {if $t.field_type=='picklist'}
         <tr class="FieldRow_{$t.id}">
-            <th style="text-align: left; padding-left: 2rem;">Option Value</th>
+            <th style="text-align: left; padding-left: 2rem;">Option Name</th>
             <th style="text-align: left;">Option Text</th>
             <th style="text-align: left;">Cost</th>
             <th style="text-align: left;">Default</th>