Apply is_deleted in item suggestion search

This commit is contained in:
jekkos
2015-08-18 08:35:21 +02:00
parent 9f1485cfe5
commit 011caf375f
5 changed files with 12 additions and 8 deletions

View File

@@ -88,7 +88,7 @@ class Items extends Secure_area implements iData_controller
*/
function suggest()
{
$suggestions = $this->Item->get_search_suggestions($this->input->post('q'), $this->input->post('limit')/*, $this->input->post('is_deleted')*/); // TODO: is_deleted doesn't seem to be effective...
$suggestions = $this->Item->get_search_suggestions($this->input->post('q'), $this->input->post('limit'), $this->input->post('is_deleted'));
echo implode("\n",$suggestions);
}

View File

@@ -6,7 +6,11 @@ $(document).ready(function()
enable_select_all();
enable_checkboxes();
enable_row_selection();
enable_search('<?php echo site_url("$controller_name/suggest")?>','<?php echo $this->lang->line("common_confirm_search")?>');
enable_search('<?php echo site_url("$controller_name/suggest")?>','<?php echo $this->lang->line("common_confirm_search")?>', undefined, {
'is_deleted' : function () {
return $("#is_deleted").is(":checked") ? 1 : 0;
}
});
enable_delete('<?php echo $this->lang->line($controller_name."_confirm_delete")?>','<?php echo $this->lang->line($controller_name."_none_selected")?>');
enable_bulk_edit('<?php echo $this->lang->line($controller_name."_none_selected")?>');

View File

@@ -14564,7 +14564,7 @@ Date.fullYearStart = '20';
}
}
function enable_search(suggest_url,confirm_search_message,format_item)
function enable_search(suggest_url,confirm_search_message,format_item,extra_params)
{
if (!format_item) {
format_item = function(results) {
@@ -14580,7 +14580,7 @@ function enable_search(suggest_url,confirm_search_message,format_item)
$(this).attr('value','');
});
$("#search").autocomplete(suggest_url,{max:100,delay:10, selectFirst: false, formatItem : format_item});
$("#search").autocomplete(suggest_url,{max:100,delay:10, selectFirst: false, formatItem : format_item, extraParams: extra_params});
$("#search").result(function(event, data, formatted)
{
do_search(true);

View File

File diff suppressed because one or more lines are too long

View File

@@ -12,7 +12,7 @@ function checkbox_click(event)
}
}
function enable_search(suggest_url,confirm_search_message,format_item)
function enable_search(suggest_url,confirm_search_message,format_item,extra_params)
{
if (!format_item) {
format_item = function(results) {
@@ -28,7 +28,7 @@ function enable_search(suggest_url,confirm_search_message,format_item)
$(this).attr('value','');
});
$("#search").autocomplete(suggest_url,{max:100,delay:10, selectFirst: false, formatItem : format_item});
$("#search").autocomplete(suggest_url,{max:100,delay:10, selectFirst: false, formatItem : format_item, extraParams: extra_params});
$("#search").result(function(event, data, formatted)
{
do_search(true);