@@ -, +, @@ --- acqui/newordersuggestion.pl | 16 +++++++++------- .../prog/en/modules/acqui/newordersuggestion.tt | 10 ++++++++++ 2 files changed, 19 insertions(+), 7 deletions(-) --- a/acqui/newordersuggestion.pl +++ a/acqui/newordersuggestion.pl @@ -128,19 +128,21 @@ if ( $op eq 'connectDuplicate' ) { } # getting all suggestions. -my $suggestions_loop = - &SearchSuggestion( - { managedby => $borrowernumber, - author => $author, - title => $title, - publishercode => $publishercode, - STATUS => 'ACCEPTED'}); +my $suggestions_loop = SearchSuggestion( + { + author => $author, + title => $title, + publishercode => $publishercode, + STATUS => 'ACCEPTED' + } +); my $vendor = GetBookSellerFromId($booksellerid); $template->param( suggestions_loop => $suggestions_loop, basketno => $basketno, booksellerid => $booksellerid, name => $vendor->{'name'}, + loggedinuser => $borrowernumber, "op_$op" => 1, ); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt @@ -8,10 +8,17 @@ $(document).ready(function() { var suggestionst = $("#suggestionst").dataTable($.extend(true, {}, dataTablesDefaults, { "aoColumnDefs": [ + { "aTargets": [ 0 ], "bVisible": false, "bSearchable": false }, { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, ], "sPaginationType": "four_button" } ) ); + $("#show_only_mine").on('click', function(){ + suggestionst.fnFilter('^[% loggedinuser %]$', 0, true); + }); + $("#show_all").on('click', function(){ + suggestionst.fnFilter('', 0 ); + }); }); //]]> @@ -30,9 +37,11 @@

Suggestions

[% IF ( suggestions_loop ) %] + Show only mine | Show all suggestions + @@ -42,6 +51,7 @@ [% FOREACH suggestions_loo IN suggestions_loop %] +
Mine Suggestion Suggested by Accepted by
[% suggestions_loo.managedby %]

[% suggestions_loo.title |html %] - [% suggestions_loo.author %]

--