Dec 3rd, 2009, 6:22 AM
Here was the solution -
001.Revise admin submission search so that it search searchable fields rather than columns.
1. In /global/code/submissions.php –
Above ft_get_submission_field_info function on line 1194, Add
2. In /admin/forms/submissions.php -
after line 121
add
3. In /admin/forms/submissions.php -
around line 127
change
to
002.Revise client submission search so that it search searchable fields rather than columns.
1. Completed in 001.1
2. In /client/forms/index.php -
after line 125
add
3. In /client/forms/index.php -
around line 130
change
to
001.Revise admin submission search so that it search searchable fields rather than columns.
1. In /global/code/submissions.php –
Above ft_get_submission_field_info function on line 1194, Add
Code:
/**
* RBD CUSTOM - Same as below, but modded to return field array of fields that are marked as 'searchable'
*
* This function is used for displaying and exporting the data. Basically it merges all information
* about a particular field from the view_fields table with the form_fields and field_options table,
* providing ALL information about a field in a single variable. This functionality is needed repeatedly
* on multiple pages throughout the script, hence the abstraction.
*
* It accepts the result of the ft_get_view_fields() function as the first parameter and an optional
* boolean to let it know whether to return ALL results or not.
*
* @param array $view_fields
* @param boolean $return_all_fields
*/
function ft_get_searchable_field_info($view_fields, $return_all_fields = false)
{
$display_fields = array();
foreach ($view_fields as $field)
{
$field_id = $field["field_id"];
if ($field['is_searchable'] == "yes" || $return_all_fields)
{
$curr_field_info = array('field_id' => $field_id,
'is_sortable' => $field['is_sortable'],
'field_title' => $field['field_title'],
'col_name' => $field['col_name'],
'list_order' => $field['list_order']);
$field_info = ft_get_form_field($field_id, true);
$curr_field_info["field_info"] = $field_info;
$display_fields[] = $curr_field_info;
}
}
return $display_fields;
}
2. In /admin/forms/submissions.php -
after line 121
Code:
$display_fields = ft_get_submission_field_info($view_info["fields"]);
add
Code:
$searchable_fields = ft_get_searchable_field_info($view_info["fields"]); //RBD CUSTOM 001.2
3. In /admin/forms/submissions.php -
around line 127
change
Code:
foreach ($display_fields
Code:
foreach ($searchable_fields
002.Revise client submission search so that it search searchable fields rather than columns.
1. Completed in 001.1
2. In /client/forms/index.php -
after line 125
Code:
$display_fields = ft_get_submission_field_info($view_info["fields"]);
Code:
$searchable_fields = ft_get_searchable_field_info($view_info["fields"]); //RBD CUSTOM 001.2
3. In /client/forms/index.php -
around line 130
change
Code:
foreach ($display_fields
Code:
foreach ($searchable_fields