Bugzilla – Attachment 51740 Details for
Bug 16577
Improve call number browser plugin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16577 - Improve call number browser plugin
Bug-16577---Improve-call-number-browser-plugin.patch (text/plain), 9.15 KB, created by
Owen Leonard
on 2016-05-24 16:35:20 UTC
(
hide
)
Description:
Bug 16577 - Improve call number browser plugin
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2016-05-24 16:35:20 UTC
Size:
9.15 KB
patch
obsolete
>From 66dea3b4960353e58de243d33765dd5631fe165c Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 24 May 2016 12:06:57 -0400 >Subject: [PATCH] Bug 16577 - Improve call number browser plugin >Content-Type: text/plain; charset="utf-8" > >This patch makes several markup and style improvements to the call >number browser plugin added by Bug 13364. Some of the changes: > >- The size of the pop-up window has been increased slightly for a less > cramped display. >- Page structure has been updated to match similar pop-up windows. >- Page structure has been improved to further accommodate the option of > viewing the call number browser as a full page rather than a pop-up > window (although as far as I can tell it is not linked to in this mode > anywhere). >- Row highlighting has been updated so that page styles are not being > passed explicitly by the script. Highlight colors have been changed to > make things more readable. >- DataTables-related markup has been removed because it was not being > used. It doesn't make sense to re-order table rows when the purpose of > the table is to display call number order. > >To test, apply the patch and edit a framework so that the item call >number field uses the 'cn_browser.pl' plugin. > >- Create or edit an item in cataloging. >- Enter an existing call number into the call number field. > - Click the '...' link next to the call number. > - In the call number browser pop-up, verify that items matching your > call number are highlighted in red. > - Verify that the new 'Close' button at the bottom of the page works > correctly. >- Enter a call number which doesn't exist in the call number field > - Click the '...' link to trigger the browser. > - Verify that there is a row highlighted in green marking the sort > order of the call number you chose. >- Navigate directly to > /cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=cn_browser.pl > - The page should appear like a normal full page, with header search, > breadcrumbs, etc. Performing a search for call numbers should work > like it did in the pop-up context. >--- > cataloguing/value_builder/cn_browser.pl | 12 +-- > .../cataloguing/value_builder/cn_browser.tt | 108 +++++++++++++-------- > 2 files changed, 74 insertions(+), 46 deletions(-) > >diff --git a/cataloguing/value_builder/cn_browser.pl b/cataloguing/value_builder/cn_browser.pl >index 9599666..4c8f314 100755 >--- a/cataloguing/value_builder/cn_browser.pl >+++ b/cataloguing/value_builder/cn_browser.pl >@@ -15,7 +15,7 @@ sub plugin_javascript { > > function Clic$function_name(i) { > q = document.getElementById('$field_number'); >- window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=cn_browser.pl&popup&q=\"+q.value,\"cnbrowser\",\"width=500,height=400,toolbar=false,scrollbars=yes\"); >+ window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=cn_browser.pl&popup&q=\"+q.value,\"cnbrowser\",\"width=750,height=400,toolbar=false,scrollbars=yes\"); > } > > //]]> >@@ -90,11 +90,11 @@ sub plugin { > $sth->execute($cn_sort); > while ( my $data = $sth->fetchrow_hashref ) { > if ( $data->{itemcallnumber} eq $q ) { >- $data->{background} = 'red'; >+ $data->{duplicate} = 1; > $red = 1; > } elsif ( ( GetClassSort( undef, undef, $data->{itemcallnumber} ) lt $cn_sort_q ) && !$green && !$red ) { > if ( $#cn != -1 ) { >- unshift @cn, { 'background' => 'green' }; >+ unshift @cn, { 'duplicate' => 0 }; > $globalGreen = 1; > } > $green = 1; >@@ -121,10 +121,10 @@ sub plugin { > > while ( my $data = $sth->fetchrow_hashref ) { > if ( $data->{itemcallnumber} eq $q ) { >- $data->{background} = 'red'; >+ $data->{duplicate} = 1; > $red = 1; > } elsif ( ( GetClassSort( undef, undef, $data->{itemcallnumber} ) gt $cn_sort_q ) && !$green && !$red && !$globalGreen ) { >- push @cn, { 'background' => 'green' }; >+ push @cn, { 'duplicate' => 0 }; > $green = 1; > } > push @cn, $data; >@@ -132,7 +132,7 @@ sub plugin { > $rows_gt = $sth->rows; > > if ( !$green && !$red && !$globalGreen ) { >- push @cn, { 'background' => 'green' }; >+ push @cn, { 'duplicate' => 0 }; > } > > $sth->finish; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt >index b1a3142..5664d8d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt >@@ -1,61 +1,89 @@ > [% INCLUDE 'doc-head-open.inc' %] >-<title>Koha › Tools</title> >+<title>Koha › Cataloging › Call number browser</title> > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> > [% INCLUDE 'doc-head-close.inc' %] >-[% INCLUDE 'datatables.inc' %] >+<style type="text/css">#custom-doc { width:46.23em;*width:45.04em;min-width:700px; margin:auto;margin-top: .4em; text-align:left; } >+ tr.duplicate td, tr.duplicate:nth-child(2n+1) td { background-color: #ff9090; } >+ tr.available td, tr.available:nth-child(2n+1) td { background-color: #bcdb89; } >+</style> > </head> > <body id="cat_cn_browser" class="cat"> >-[% UNLESS ( popup ) %] >-[% INCLUDE 'header.inc' %] >-[% INCLUDE 'cat-search.inc' %] >+[% IF ( popup ) %] >+ <div id="custom-doc" class="yui-t7"> >+ <div id="bd"> >+[% ELSE %] >+ [% INCLUDE 'header.inc' %] >+ [% INCLUDE 'cat-search.inc' %] >+ <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a> › Call number browser</div> >+ <div id="doc" class="yui-t7"> >+ <div id="bd"> >+ <div id="yui-main"> > [% END %] > >-<script language="JavaScript"> >-$(document).ready(function() >-{ >- $("#cn_browser_table").DataTable({"paging": false, "bFilter": false, "info": false, "bSort": false}); >- $("#cn_browser_submit").click(function(){ >- window.location.href='/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=cn_browser.pl&popup&q='+$("#cn_browser_input").val(); >- return false; >- }); >-} >+<h1>Call number browser</h1> > >-); >-</script> >- >-<h1 style="text-align:center">Call numbers browser</h1> >- >-<div style="margin:auto;text-align:center;"> >- <form method="get" action="cn_browser.pl"> >- <label for="searchcn">Search call number:</label> >+<form method="get" action="/cgi-bin/koha/cataloguing/plugin_launcher.pl"> >+ <input type="hidden" name="plugin_name" value="cn_browser.pl" /> >+ [% IF ( popup ) %] >+ <input type="hidden" name="popup" /> >+ [% END %] >+ <p> >+ <label for="cn_browser_input">Search call number:</label> > <input type="text" id="cn_browser_input" name="q" value="[% q %]" /> >- <input id="cn_browser_submit" type="submit" value="Search" /> >- </form> >-</div> >-<br /> >+ <input type="submit" value="Search" /> >+ </p> >+</form> > >+[% IF ( cn_loop ) %] > <table id="cn_browser_table"> > <thead><tr> >- <th>Call Number</th> >+ <th>Call number</th> > <th>Title</th> >- <th>Branch</th> >+ <th>Library</th> > </tr></thead> > <tbody> > [% FOREACH cn_loo IN cn_loop %] >- <tr> >- <td style="background:[% cn_loo.background %];">[% cn_loo.itemcallnumber %]</td> >- <td style="background:[% cn_loo.background %];"> >- <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% cn_loo.biblionumber %]"> >- [% cn_loo.title %] [% cn_loo.subtitle %] [% cn_loo.subtitle2 %] >- [% IF ( cn_loo.author ) %] >- <span>by</span> [% cn_loo.author %] >- [% END %] >- </a> >- </td> >- <td style="background:[% cn_loo.background %];">[% cn_loo.branchname %]</td> >+ [% IF ( cn_loo.duplicate == 0 ) %] >+ <tr class="available"> >+ [% ELSIF ( cn_loo.duplicate == 1 ) %] >+ <tr class="duplicate"> >+ [% ELSE %] >+ <tr> >+ [% END %] >+ [% IF ( cn_loo.duplicate == 0 ) %] >+ <td><pre>[% q %]</pre></td> >+ <td> Call number is not in use </td> >+ <td> </td> >+ [% ELSE %] >+ <td>[% cn_loo.itemcallnumber %]</td> >+ <td> >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% cn_loo.biblionumber %]"> >+ [% cn_loo.title %] [% cn_loo.subtitle %] [% cn_loo.subtitle2 %] >+ [% IF ( cn_loo.author ) %] >+ <span>by</span> [% cn_loo.author %] >+ [% END %] >+ </a> >+ </td> >+ <td>[% cn_loo.branchname %]</td> >+ [% END %] > </tr> > [% END %] > </tbody> > </table> >+[% ELSE %] >+ [% IF ( q ) %] >+ <div class="dialog message">No results found for [% q %]</div> >+ [% END %] >+[% END %] >+ >+[% IF ( popup ) %] >+ <div id="closewindow"><a href="#" class="btn btn-default close">Close</a></div> >+ </div> >+ </div> >+ [% INCLUDE 'popup-bottom.inc' %] >+[% ELSE %] >+ </div> >+ </div> >+ [% INCLUDE 'intranet-bottom.inc' %] >+[% END %] > >-<br /> >-- >2.1.4
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 16577
:
51740
|
51895
|
52283
|
52284