$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");
'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'
)
-
+
);
}
*/
public function modelAction( $actionData = false )
{
-
+trigger_error('********* WORKING IN formDisplay.php **********',E_USER_NOTICE);
$formId = false;
$formFields = false;
$haveForm = false;
// 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);
}
}
-
+trigger_error('Field Data = '.print_r($formFields,1), E_USER_NOTICE);
+
// Compile template data
$templateData = array(
'formId' => $formId,
<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>