From 36b7239f40984ef0f2e4ef888b56831b689b24c4 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Sun, 15 Apr 2012 11:03:31 +0200 Subject: [PATCH] Bug 7733 - HidePatronName not working on moredetail Patch implements HidePatronName system preference for 'Checkout status' on moredetail (tab items from staff detail page). Also adds some new 'if' statements, so 'Serial enumeration' and 'Paid for?' are only shown when they are not empty. Silences warns in the logs. To test: - Toggle system preference for an issued item and check name/cardnumber are displayed correctly. - Check serial enumeration and Paid for? show when not empty. Signed-off-by: Nicole C. Engard Signed-off-by: Paul Poulain --- catalogue/moredetail.pl | 12 ++++++++ .../prog/en/modules/catalogue/moredetail.tt | 28 +++++++++++++++---- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index 9d5465b910..ca7d13cfe9 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -62,6 +62,8 @@ if($query->cookie("holdfor")){ ); } +my $hidepatronname = C4::Context->preference("HidePatronName"); + # get variables my $biblionumber=$query->param('biblionumber'); @@ -172,6 +174,15 @@ foreach my $item (@items){ } else { $item->{'issue'}= 0; } + + unless ($hidepatronname) { + if ( $item->{'borrowernumber'} ) { + my $curr_borrower = GetMember('borrowernumber' => $item->{'borrowernumber'} ); + $item->{borrowerfirstname} = $curr_borrower->{'firstname'}; + $item->{borrowersurname} = $curr_borrower->{'surname'}; + } + } + } $template->param(count => $data->{'count'}, subscriptionsnumber => $subscriptionsnumber, @@ -188,6 +199,7 @@ $template->param( itemnumber => $itemnumber, z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)), subtitle => $subtitle, + hidepatronname => $hidepatronname, ); $template->param(ONLY_ONE => 1) if ( $itemnumber && $showncount != @items ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt index dce6872598..afd2a6de17 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -69,7 +69,23 @@
  1. Current location: [% ITEM_DAT.holdingbranchname %] 
  2. -
  3. Checkout status: [% IF ( ITEM_DAT.issue ) %]Checked out to [% ITEM_DAT.cardnumber %][% IF ( ITEM_DAT.lastreneweddate ) %], Last renewed [% ITEM_DAT.lastreneweddate | $KohaDates %][% END %], Due back on [% ITEM_DAT.datedue | $KohaDates %][% ELSE %]Not checked out [% END %]
  4. +
  5. Checkout status: + [% IF ( ITEM_DAT.issue ) %]Checked out to + [% IF ( hidepatronname ) %] + [% ITEM_DAT.cardnumber %], + [% ELSE %] + [% ITEM_DAT.borrowerfirstname %] [% ITEM_DAT.borrowersurname %], + [% END %] + [% IF ( ITEM_DAT.lastreneweddate ) %] + Last renewed [% ITEM_DAT.lastreneweddate | $KohaDates %], + [% END %] + [% IF ( ITEM_DAT.datedue ) %] + Due back on [% ITEM_DAT.datedue | $KohaDates %] + [% ELSE %] + Not checked out + [% END %] + [% END %] +  
  6. Current renewals: [% ITEM_DAT.renewals %] 
  7. [% IF ( ITEM_DAT.itemlostloop ) %]
  8. Lost status: @@ -183,14 +199,14 @@
  9. Total checkouts:[% IF ( ITEM_DAT.issues ) %][% ITEM_DAT.issues %][% ELSE %]0[% END %] (View item's checkout history)
  10. -
  11. Last seen: [% ITEM_DAT.datelastseen | $KohaDates %] 
  12. -
  13. Last borrowed: [% ITEM_DAT.datelastborrowed | $KohaDates %] 
  14. +
  15. Last seen:[% IF ( ITEM_DAT.datelastseen ) %][% ITEM_DAT.datelastseen | $KohaDates %] [%END %] 
  16. +
  17. Last borrowed:[% IF (ITEM_DAT.datelastborrowed ) %][% ITEM_DAT.datelastborrowed | $KohaDates %][% END %] 
  18. [% IF ( ITEM_DAT.card0 ) %]
  19. Last borrower: [% ITEM_DAT.card0 %] 
  20. [% END %] [% IF ( ITEM_DAT.card1 ) %]
  21. Previous borrower: [% ITEM_DAT.card1 %] 
  22. [% END %] [% IF ( ITEM_DAT.card2 ) %]
  23. Previous borrower: [% ITEM_DAT.card2 %] 
  24. [% END %] -
  25. Paid for?: [% ITEM_DAT.paidfor %] 
  26. -
  27. Serial enumeration: [% ITEM_DAT.enumchron %] 
  28. -
  29. Public note: + [% IF ( ITEM_DAT.paidfor ) %]
  30. Paid for?: [% ITEM_DAT.paidfor %] 
  31. [% END %] + [% IF ( ITEM_DAT.enumchron ) %]
  32. Serial enumeration: [% ITEM_DAT.enumchron %] 
  33. [% END %] +
  34. Public note: [% IF ( CAN_user_editcatalogue_edit_items ) %]
    -- 2.39.5