Bug 33430: (follow-up) Fix the data filtering from the left menu

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Matt Blenkinsop 2025-05-14 11:00:09 +01:00 committed by Katrin Fischer
parent b9c5a10a11
commit a0fec40b02
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 12 additions and 5 deletions

View File

@ -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 '<span>%s</span>'.format(_("Pending"));
if(row.status === 'ACCEPTED') return '<span>%s</span>'.format(_("Accepted"));

View File

@ -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};
}
}
}