From 928db9a0727e335b4b69d2f2c9c015f52bcc81ad Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 4 May 2022 17:40:27 +0000 Subject: [PATCH] Bug 30937: Add a detail view for libraries This patch adds a view page for libraries, so that the user isn't required to edit the library to see information about it. To test, apply the patch and log into Koha as a user with permission to manage libraries. - In the list of libraries you should see that the library name in the first column is now a link. - When you click the link you should be taken to a view of all the information about the library. --- admin/branches.pl | 5 + .../prog/en/modules/admin/branches.tt | 155 +++++++++++++++++- 2 files changed, 158 insertions(+), 2 deletions(-) diff --git a/admin/branches.pl b/admin/branches.pl index 08a73f6571..134321a2bd 100755 --- a/admin/branches.pl +++ b/admin/branches.pl @@ -53,6 +53,11 @@ if ( $op eq 'add_form' ) { library => Koha::Libraries->find($branchcode), smtp_servers => Koha::SMTP::Servers->search, ); +} elsif ( $branchcode && $op eq 'view' ) { + my $library = Koha::Libraries->find($branchcode); + $template->param( + library => $library, + ); } elsif ( $op eq 'add_validate' ) { my @fields = qw( branchname diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt index eb3b8f92a3..5fdda101dd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt @@ -58,6 +58,16 @@ Libraries › Administration › Koha + [% ELSIF op == 'view' %] +
  • + Libraries +
  • +
  • + + [% library.branchname | html %] + +
  • + [% ELSE %]
  • @@ -117,9 +127,12 @@ Libraries › Administration › Koha [% END %] -[% IF op == 'list' %] +[% IF op == 'list' || op == 'view' %]
    New library + [% IF op == 'view' %] + Edit library + [% END %]
    [% END %] @@ -324,6 +337,141 @@ Libraries › Administration › Koha [% END %] [% END %] +[% IF op == 'view' %] +

    [% library.branchname | html %]

    +
    +
    +
    +
      +
    1. + Library code: + [% library.branchcode | html %] +
    2. +
    3. + Name: + [% library.branchname | html %] +
    4. +
    5. + Category: + [% category.categoryname | html %] +
    6. +
    7. + Address line 1: + [% library.branchaddress1 | html %] +
    8. +
    9. + Address line 2: + [% library.branchaddress2 | html %] +
    10. +
    11. + Address line 3: + [% library.branchaddress3 | html %] +
    12. +
    13. + City: + [% library.branchcity | html %] +
    14. +
    15. + State: + [% library.branchstate | html %] +
    16. +
    17. + ZIP/Postal code: + [% library.branchzip | html %] +
    18. +
    19. + Country: + [% library.branchcountry | html %] +
    20. +
    21. + Phone: + [% library.branchphone | html %] +
    22. +
    23. + Fax: + [% library.branchfax | html %] +
    24. +
    +
    +
    +
    +
    +
      +
    1. + Email: + [% IF ( library.branchemail ) %] + [% library.branchemail | html %] + [% END %] +
    2. +
    3. + ILL staff email: + [% IF ( library.branchillemail ) %] + [% library.branchillemail | html %] + [% END %] +
    4. +
    5. + Reply-To: + [% IF ( library.branchreplyto ) %] + [% library.branchreplyto | html %] + [% END %] +
    6. +
    7. + Return-Path: + [% library.branchreturnpath | html %] +
    8. +
    9. + SMTP server: + [% smtp_server.name | html %] +
    10. +
    11. + URL: + [% IF ( library.branchurl ) %] + [% library.branchurl | html %] + [% END %] +
    12. +
    13. + IP: + [% library.branchip | html %] +
    14. +
    15. + MARC organization code + [% library.marcorgcode | html %] +
    16. +
    17. + Notes: + [% library.branchnotes | html %] +
    18. +
    19. + Pickup location: + [% IF ( library.pickup_location ) %] + Yes + [% ELSE %] + No + [% END %] +
    20. +
    21. + Public: + [% IF ( library.public ) %] + Yes + [% ELSE %] + No + [% END %] +
    22. +
    +
    +
    +
    + [% IF ( library.opac_info ) %] +
    +
    +
    +

    OPAC information

    + [% library.opac_info | $raw %] +
    +
    + [% END %] +[% END %] + @@ -369,7 +517,10 @@ Libraries › Administration › Koha { "data": "name", "searchable": true, - "orderable": true + "orderable": true, + "render": function( data, type, row, meta ) { + return "" + row.name.escapeHtml() + ""; + } }, { "data": "library_id", -- 2.30.2