@@ -, +, @@ $ docker exec -ti koha_db_1 bash $ mysql -ppassword > SET GLOBAL general_log_file='/var/log/mysql/mycustom.log'; > SET GLOBAL log_output = 'FILE'; > SET GLOBAL general_log = 'ON'; > \q $ tail -f /var/log/mysql/mycustom.log | grep suggestions --- acqui/newordersuggestion.pl | 4 ++-- .../en/modules/acqui/newordersuggestion.tt | 2 +- .../modules/members/purchase-suggestions.tt | 2 +- .../prog/en/modules/suggestion/suggestion.tt | 6 +++--- .../bootstrap/en/modules/opac-suggestions.tt | 6 +++--- members/purchase-suggestions.pl | 5 ++++- opac/opac-suggestions.pl | 4 ++-- suggestion/suggestion.pl | 20 +++++++++++-------- 8 files changed, 28 insertions(+), 21 deletions(-) --- a/acqui/newordersuggestion.pl +++ a/acqui/newordersuggestion.pl @@ -128,7 +128,7 @@ if ( $op eq 'connectDuplicate' ) { ConnectSuggestionAndBiblio( $suggestionid, $duplicateNumber ); } -my $suggestions = Koha::Suggestions->search_limited( +my $suggestions = [ Koha::Suggestions->search_limited( { ( $author ? ( author => $author ) : () ), ( $title ? ( title => $title ) : () ), @@ -136,7 +136,7 @@ my $suggestions = Koha::Suggestions->search_limited( STATUS => 'ACCEPTED' }, { prefetch => ['managedby', 'suggestedby'] }, -); +)->as_list ]; my $vendor = Koha::Acquisition::Booksellers->find( $booksellerid ); $template->param( --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt @@ -41,7 +41,7 @@

Suggestions

- [% IF suggestions.count %] + [% IF suggestions.size %] Show only mine | Show all suggestions --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt @@ -42,7 +42,7 @@ New purchase suggestion - [% IF suggestions.count %] + [% IF suggestions.size %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -707,7 +707,7 @@ No name [% END %] [% END %] - ([% suggestion.suggestions.count| html %]) + ([% suggestion.suggestions.size| html %]) [% END # /FOREACH suggestion %] @@ -717,7 +717,7 @@
- [% IF suggestion.suggestions.count %] + [% IF suggestion.suggestions.size %]

Check all | Uncheck all

@@ -1310,7 +1310,7 @@ columns_settings = [% TablesSettings.GetColumns( 'acqui', 'suggestions', 'suggestions', 'json' ) | $raw %] [% FOREACH suggestion IN suggestions %] - [% IF suggestion.suggestions.count %] + [% IF suggestion.suggestions.size %] KohaTable("table_[% loop.count| html %]", { "sorting": [[ 3, "asc" ]], "autoWidth": false, --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt @@ -293,7 +293,7 @@ [% IF ( deleted ) %]
The selected suggestions have been deleted.
[% END %] - [% IF suggestions.count OR title_filter %] + [% IF suggestions.size > 0 OR title_filter %] [% SET can_delete_suggestion = 0 %]
@@ -321,7 +321,7 @@
[% END %] - [% IF suggestions.count %] + [% IF suggestions.size > 0 %] [% SET can_delete_suggestion = 0 %]
@@ -470,7 +470,7 @@

New purchase suggestion

[% END %] [% END %] - [% END # / IF suggestions.count %] + [% END # / IF suggestions.size %] [% END # IF op_else %]
--- a/members/purchase-suggestions.pl +++ a/members/purchase-suggestions.pl @@ -48,7 +48,10 @@ $template->param( suggestionsview => 1, ); -my $suggestions = Koha::Suggestions->search_limited( { suggestedby => $borrowernumber }, { prefetch => 'managedby' } ); +my $suggestions = [ + Koha::Suggestions->search_limited( { suggestedby => $borrowernumber }, + { prefetch => 'managedby' } )->as_list +]; $template->param( suggestions => $suggestions ); --- a/opac/opac-suggestions.pl +++ a/opac/opac-suggestions.pl @@ -210,7 +210,7 @@ if ( $op eq "add_confirm" ) { $op = 'else'; } -my $suggestions = Koha::Suggestions->search_limited( +my $suggestions = [ Koha::Suggestions->search_limited( { $suggestion->{suggestedby} ? ( suggestedby => $suggestion->{suggestedby} ) @@ -219,7 +219,7 @@ my $suggestions = Koha::Suggestions->search_limited( ? ( title => $title_filter ) : (), } -); +)->as_list ]; if ( $op eq "delete_confirm" ) { my @delete_field = $input->multi_param("delete_field"); --- a/suggestion/suggestion.pl +++ a/suggestion/suggestion.pl @@ -397,14 +397,18 @@ if ($op=~/else/) { } } } - my $suggestions = Koha::Suggestions->search_limited( { %$suggestion_ref, archived => $filter_archived } ); - - push @allsuggestions,{ - "suggestiontype"=>$criteriumvalue||"suggest", - "suggestiontypelabel"=>GetCriteriumDesc($criteriumvalue,$displayby)||"", - 'suggestions' => $suggestions, - 'reasonsloop' => $reasonsloop, - } if $suggestions->count; + my @suggestions = + Koha::Suggestions->search_limited( + { %$suggestion_ref, archived => $filter_archived } )->as_list; + + push @allsuggestions, + { + "suggestiontype" => $criteriumvalue || "suggest", + "suggestiontypelabel" => GetCriteriumDesc( $criteriumvalue, $displayby ) || "", + 'suggestions' => \@suggestions, + 'reasonsloop' => $reasonsloop, + } + if scalar @suggestions > 0; delete $$suggestion_ref{$displayby} unless $definedvalue; } --