From 6380c479b64ee78f6533312fc9c97530a843ac08 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 18 Nov 2019 15:50:55 +0100 Subject: [PATCH] Bug 23591: Display a new "Suggestion detail" tab on the bib detail page MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch adds a new "Suggestion detail" tab on the bibliographic detail page. It will help suggestion management. Test plan: - Create several suggestions for a given biblio - Go to the detail page of the bibliographic record and confirm that there is a new "Suggestion detail" tab with all the suggestions you created. Signed-off-by: Séverine QUEUNE Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- catalogue/detail.pl | 12 +++ .../prog/en/modules/catalogue/detail.tt | 79 +++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 85782ecc71..714e3bc012 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -246,6 +246,18 @@ if ( C4::Context->preference('AcquisitionDetails') ) { ); } +if ( C4::Context->preference('suggestion') ) { + my $suggestions = Koha::Suggestions->search( + { + biblionumber => $biblionumber, + }, + { + order_by => { -desc => 'suggesteddate' } + } + ); + $template->param( suggestions => $suggestions ); +} + if ( defined $dat->{'itemtype'} ) { $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }{imageurl} ); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 6ef518489b..388187f542 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -185,6 +185,7 @@ [% IF ( MARCNOTES || notes ) %]
  • Descriptions ([% ( MARCNOTES.size || 1 ) | html %])
  • [% END %] [% IF ( subscriptionsnumber ) %]
  • Subscriptions
  • [% END %] [% IF Koha.Preference('AcquisitionDetails') %]
  • Acquisition details
  • [% END %] +[% IF suggestions.count %]
  • Suggestion details
  • [% END %] [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
  • Editions
  • [% END %][% END %] [% IF ( LocalCoverImages ) %] [% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %] @@ -695,6 +696,74 @@ Note that permanent location is a code, and location may be an authval. [% END %] +[% IF suggestions.count %] +
    + + + + + + + + + + + + + + + [% FOREACH suggestion IN suggestions %] + + + + + + + + + + + [% END %] + +
     SuggestionSuggested by - onManaged by - onLast modification by - onLibraryFundStatus
    [% suggestion.suggestionid | html %] + + [% suggestion.title | html %][% IF ( suggestion.author ) %], by [% suggestion.author | html %][% END %] +
    + [% IF ( suggestion.copyrightdate ) %]© [% suggestion.copyrightdate | html %] [% END %] + [% IF ( suggestion.volumedesc ) %]; Volume:[% suggestion.volumedesc | html %] [% END %] + [% IF ( suggestion.isbn ) %]; ISBN:[% suggestion.isbn | html %] [% END %][% IF ( suggestion.publishercode ) %]; Published by [% suggestion.publishercode | html %] [% END %][% IF ( suggestion.publicationyear ) %] in [% suggestion.publicationyear | html %] [% END %][% IF ( suggestion.place ) %] in [% suggestion.place | html %] [% END %][% IF ( suggestion.collectiontitle ) %]; [% suggestion.collectiontitle | html %] [% END %][% IF ( suggestion.itemtype ) %]; [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestion.itemtype, 0 ) | html %] [% END %]
    [% IF ( suggestion.note ) %]
    [% suggestion.note | html %]
    [% END %] + [% IF suggestion.archived %]
    Archived[% END %] +
    + [% INCLUDE 'patron-title.inc' patron => suggestion.suggester %] + [% IF suggestion.suggesteddate %] - [% suggestion.suggesteddate | $KohaDates %][% END %] + + [% INCLUDE 'patron-title.inc' patron => suggestion.manager %] + [% IF suggestion.manageddate %] - [% suggestion.manageddate | $KohaDates %][% END %] + + [% INCLUDE 'patron-title.inc' patron => suggestion.last_modifier %] + [% IF suggestion.lastmodificationdate %] - [% suggestion.lastmodificationdate | $KohaDates %][% END %] + + [% Branches.GetName( suggestion.branchcode ) | html %] + + [% suggestion.fund.budget_name | html %] + + [% IF suggestion.STATUS == 'ASKED' %]Pending + [% ELSIF suggestion.STATUS == 'ACCEPTED' %]Accepted + [% ELSIF suggestion.STATUS == 'ORDERED' %]Ordered + [% ELSIF suggestion.STATUS == 'REJECTED' %]Rejected + [% ELSIF suggestion.STATUS == 'CHECKED' %]Checked + [% ELSIF suggestion.STATUS == 'AVAILABLE' %]Available + [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) %] + [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) | html %] + [% ELSE %]Status unknown + [% END %] + [% IF suggestion.reason %] +
    ([% suggestion.reason | html %]) + [% END %] +
    +
    +[% END %] + [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]

    Editions

    @@ -1065,6 +1134,16 @@ Note that permanent location is a code, and location may be an authval. ] }, columns_settings); [% END %] + + [% IF suggestions.count %] + $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, { + "aoColumnDefs": [ + { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, + { "sType": "anti-the", "aTargets" : [ "anti-the" ] } + ], + "sPaginationType": "full" + })); + [% END %] }); [% END %] -- 2.39.5