Bugzilla – Attachment 136163 Details for
Bug 30937
Add a detail view for libraries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30937: Add a detail view for libraries
Bug-30937-Add-a-detail-view-for-libraries.patch (text/plain), 9.14 KB, created by
Jonathan Druart
on 2022-06-16 13:34:18 UTC
(
hide
)
Description:
Bug 30937: Add a detail view for libraries
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-06-16 13:34:18 UTC
Size:
9.14 KB
patch
obsolete
>From b593858b994e435aac61a48923d63d1ec85c22f4 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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. > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > 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 08a73f6571f..134321a2bd4 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 eb3b8f92a39..5fdda101ddd 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 > </a> > </li> > >+ [% ELSIF op == 'view' %] >+ <li> >+ <a href="/cgi-bin/koha/admin/branches.pl">Libraries</a> >+ </li> >+ <li> >+ <a href="#" aria-current="page"> >+ [% library.branchname | html %] >+ </a> >+ </li> >+ > [% ELSE %] > <li> > <a href="#" aria-current="page"> >@@ -117,9 +127,12 @@ Libraries › Administration › Koha > </div> > [% END %] > >-[% IF op == 'list' %] >+[% IF op == 'list' || op == 'view' %] > <div id="toolbar" class="btn-toolbar"> > <a class="btn btn-default" id="newbranch" href="/cgi-bin/koha/admin/branches.pl?op=add_form"><i class="fa fa-plus"></i> New library</a> >+ [% IF op == 'view' %] >+ <a class="btn btn-default" id="editbranch" href="/cgi-bin/koha/admin/branches.pl?op=add_form&branchcode=[% library.branchcode | uri %]"><i class="fa fa-pencil"></i> Edit library</a> >+ [% END %] > </div> > [% END %] > >@@ -324,6 +337,141 @@ Libraries › Administration › Koha > [% END %] > [% END %] > >+[% IF op == 'view' %] >+ <h1>[% library.branchname | html %]</h1> >+ <div class="row"> >+ <div class="col-sm-6"> >+ <div class="rows"> >+ <ol> >+ <li> >+ <span class="label">Library code: </span> >+ [% library.branchcode | html %] >+ </li> >+ <li> >+ <span class="label">Name: </span> >+ [% library.branchname | html %] >+ </li> >+ <li> >+ <span class="label">Category:</span> >+ [% category.categoryname | html %] >+ </li> >+ <li> >+ <span class="label">Address line 1: </span> >+ [% library.branchaddress1 | html %] >+ </li> >+ <li> >+ <span class="label">Address line 2: </span> >+ [% library.branchaddress2 | html %] >+ </li> >+ <li> >+ <span class="label">Address line 3: </span> >+ [% library.branchaddress3 | html %] >+ </li> >+ <li> >+ <span class="label">City: </span> >+ [% library.branchcity | html %] >+ </li> >+ <li> >+ <span class="label">State: </span> >+ [% library.branchstate | html %] >+ </li> >+ <li> >+ <span class="label">ZIP/Postal code: </span> >+ [% library.branchzip | html %] >+ </li> >+ <li> >+ <span class="label">Country: </span> >+ [% library.branchcountry | html %] >+ </li> >+ <li> >+ <span class="label">Phone: </span> >+ [% library.branchphone | html %] >+ </li> >+ <li> >+ <span class="label">Fax: </span> >+ [% library.branchfax | html %] >+ </li> >+ </ol> >+ </div> >+ </div> >+ <div class="col-sm-6"> >+ <div class="rows"> >+ <ol> >+ <li> >+ <span class="label">Email: </span> >+ [% IF ( library.branchemail ) %] >+ <a href="mailto:[% library.branchemail | url %]">[% library.branchemail | html %]</a> >+ [% END %] >+ </li> >+ <li> >+ <span class="label">ILL staff email: </span> >+ [% IF ( library.branchillemail ) %] >+ <a href="mailto:[% library.branchillemail | url %]">[% library.branchillemail | html %]</a> >+ [% END %] >+ </li> >+ <li> >+ <span class="label">Reply-To: </span> >+ [% IF ( library.branchreplyto ) %] >+ <a href="mailto:[% library.branchreplyto | url %]">[% library.branchreplyto | html %]</a> >+ [% END %] >+ </li> >+ <li> >+ <span class="label">Return-Path: </span> >+ [% library.branchreturnpath | html %] >+ </li> >+ <li> >+ <span class="label">SMTP server: </span> >+ [% smtp_server.name | html %] >+ </li> >+ <li> >+ <span class="label">URL: </span> >+ [% IF ( library.branchurl ) %] >+ <a href="[% library.branchurl | url %]" target="_blank">[% library.branchurl | html %]</a> >+ [% END %] >+ </li> >+ <li> >+ <span class="label">IP: </span> >+ [% library.branchip | html %] >+ </li> >+ <li> >+ <span class="label">MARC organization code</span> >+ [% library.marcorgcode | html %] >+ </li> >+ <li> >+ <span class="label">Notes: </span> >+ [% library.branchnotes | html %] >+ </li> >+ <li> >+ <span class="label">Pickup location: </span> >+ [% IF ( library.pickup_location ) %] >+ Yes >+ [% ELSE %] >+ No >+ [% END %] >+ </li> >+ <li> >+ <span class="label">Public: </span> >+ [% IF ( library.public ) %] >+ Yes >+ [% ELSE %] >+ No >+ [% END %] >+ </li> >+ </ol> >+ </div> <!-- /.rows --> >+ </div> <!-- /.col-sm-6 --> >+ </div> <!-- /.row --> >+ [% IF ( library.opac_info ) %] >+ <hr /> >+ <div class="row"> >+ <div class="col-sm-12"> >+ <h2>OPAC information</h2> >+ [% library.opac_info | $raw %] >+ </div> >+ </div> >+ [% END %] >+[% END %] >+ > </main> > </div> <!-- /.col-sm-10.col-sm-push-2 --> > >@@ -369,7 +517,10 @@ Libraries › Administration › Koha > { > "data": "name", > "searchable": true, >- "orderable": true >+ "orderable": true, >+ "render": function( data, type, row, meta ) { >+ return "<a href=\"/cgi-bin/koha/admin/branches.pl?op=view&branchcode=" + encodeURIComponent( row.library_id ) + "\">" + row.name.escapeHtml() + "</a>"; >+ } > }, > { > "data": "library_id", >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30937
:
135913
|
135914
| 136163 |
136164
|
136165