diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
index ce2e9702b3..2762234f09 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
@@ -1326,7 +1326,7 @@
let suggestionData = [% To.json(suggestions) | $raw %];
var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'suggestions', 'suggestions', 'json' ) | $raw %]
function loadDatatable(tabName) {
- let tabSuggestionData = suggestionData.find(s => s.suggestiontype === tabName)
+ let tabSuggestionData = suggestionData.find(s => s.suggestiontype === `${tabName}`)
$("#table_" + tabName).kohaTable(
{
sorting: [[4, "asc"]],
@@ -1479,7 +1479,7 @@
{
data: "status",
searchable: false,
- orderable: false,
+ orderable: true,
render: function (data, type, row, meta) {
if(row.status === 'ASKED') return '%s'.format(_("Pending"));
if(row.status === 'ACCEPTED') return '%s'.format(_("Accepted"));
diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl
index de37a7196f..39521c6495 100755
--- a/suggestion/suggestion.pl
+++ b/suggestion/suggestion.pl
@@ -456,14 +456,21 @@ if ( $op eq 'else' ) {
|| $search_params->{$f} eq '';
}
for my $bi (qw (title author isbn publishercode copyrightdate collectiontitle)) {
- $search_params->{$bi} = { 'LIKE' => "%" . $search_params->{$bi} . "%" } if $search_params->{$bi};
+ if ( $search_params->{$bi} ) {
+ $search_params->{"me.$bi"} = { 'like' => "%" . $search_params->{$bi} . "%" };
+ delete $search_params->{$bi};
+ }
}
$search_params->{archived} = 0 if !$filter_archived;
foreach my $key ( keys %$search_params ) {
if ( $key eq 'branchcode' ) {
- my $branch_param = delete $search_params->{$key};
- $search_params->{"me.branchcode"} = $branch_param;
+ if ( $displayby ne 'branchcode' ) {
+ my $branch_param = delete $search_params->{$key};
+ $search_params->{"me.branchcode"} = $branch_param;
+ } else {
+ delete $search_params->{$key};
+ }
}
}