From srdjan at catalyst.net.nz Mon Sep 2 02:18:06 2013 From: srdjan at catalyst.net.nz (Srdjan) Date: Mon, 2 Sep 2013 12:18:06 +1200 Subject: [Koha-patches] [PATCH] Bug 5904: ysearch.pl members improvements (Independent branches behaviour) Message-ID: <1378081086-8033-1-git-send-email-srdjan@catalyst.net.nz> From: Jonathan Druart Test plan: - Add a staff user foo in a library A - Add a staff user bar in a library B - log in as foo and try to search 'bar' - Switch on (Prevent) the new pref IndependentBranches - the search returns no result - log in as a superlibrarian - Check that you are allow to search all patrons. Signed-off-by: Srdjan --- circ/ysearch.pl | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/circ/ysearch.pl b/circ/ysearch.pl index 8a48c51..4a3663e 100755 --- a/circ/ysearch.pl +++ b/circ/ysearch.pl @@ -44,13 +44,23 @@ if ($auth_status ne "ok") { } my $dbh = C4::Context->dbh; -my $sql = qq(SELECT surname, firstname, cardnumber, address, city, zipcode, country - FROM borrowers - WHERE surname LIKE ? - OR firstname LIKE ? - OR cardnumber LIKE ? - ORDER BY surname, firstname - LIMIT 10); +my $sql = q( + SELECT surname, firstname, cardnumber, address, city, zipcode, country + FROM borrowers + WHERE ( surname LIKE ? + OR firstname LIKE ? + OR cardnumber LIKE ? ) +); +if (C4::Context->preference("IndependentBranches")){ + if ( C4::Context->userenv + && (C4::Context->userenv->{flags} % 2) !=1 + && C4::Context->userenv->{'branch'} + ){ + $sql .= " AND borrowers.branchcode =" . $dbh->quote(C4::Context->userenv->{'branch'}); + } +} + +$sql .= q( ORDER BY surname, firstname LIMIT 10); my $sth = $dbh->prepare( $sql ); $sth->execute("$query%", "$query%", "$query%"); @@ -68,4 +78,4 @@ while ( my $rec = $sth->fetchrow_hashref ) { "}"; $i++; } -print "]"; \ No newline at end of file +print "]"; -- 1.8.1.2 From srdjan at catalyst.net.nz Mon Sep 2 07:46:14 2013 From: srdjan at catalyst.net.nz (Srdjan) Date: Mon, 2 Sep 2013 17:46:14 +1200 Subject: [Koha-patches] [PATCH] Bug 10727 : Replace carriage return with
when printing hold notices Message-ID: <1378100774-12267-1-git-send-email-srdjan@catalyst.net.nz> From: Sophie Meynieux This patch replaces carriage return with
in the content of hold notices for printing. This is necessary to convert html file into well formatted pdf file. Test plan : - checkin an item reserved by a borrower that has not activated email notification - verify in message_queue table that you've got a new HOLD_PRINT notice with status 'pending' - run gather_print_notices.pl Without the patch, the script generates a html file without
tags. If you run printoverdues.sh , the text in the resulting pdf file is all on one line With the patch, the script generates a html file with
tags and pdf file created by printoverdues.sh is well formatted. Signed-off-by: Srdjan --- misc/cronjobs/gather_print_notices.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl index 286b035..2d05557 100755 --- a/misc/cronjobs/gather_print_notices.pl +++ b/misc/cronjobs/gather_print_notices.pl @@ -69,6 +69,14 @@ my $today = C4::Dates->new(); my @all_messages = @{ GetPrintMessages() }; exit unless (@all_messages); +## carriage return replaced by
as output is html +foreach my $message (@all_messages) { + local $_ = $message->{'content'}; + s/\n/
/g; + s/\r//g; + $message->{'content'} = $_; +} + my $OUTPUT; if ($split) { -- 1.8.1.2 From srdjan at catalyst.net.nz Mon Sep 2 08:02:51 2013 From: srdjan at catalyst.net.nz (Srdjan) Date: Mon, 2 Sep 2013 18:02:51 +1200 Subject: [Koha-patches] [PATCH] Bug 10720 : substitution term in overdue notices shouldn't be removed if they don't match. It prevents use of html in notices to use with css Message-ID: <1378101771-14652-1-git-send-email-srdjan@catalyst.net.nz> From: Sophie Meynieux Test plan : - define an overdue notice containing some valid substitution terms + some valid html tags ( or
Without patch, your html tags are missing in your html file With the patch, they are present and can be used with a css to generate a formatted pdf file. If you add some invalid substitution term, with the patch, they are still in the final letter, but the warn in the log helps you to correct your notice template. Signed-off-by: Srdjan --- misc/cronjobs/overdue_notices.pl | 2 -- 1 file changed, 2 deletions(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 0f263c4..00e2e5b 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -568,8 +568,6 @@ END_SQL if (@misses) { $verbose and warn "The following terms were not matched and replaced: \n\t" . join "\n\t", @misses; } - $letter->{'content'} =~ s/\<[^<>]*?\>//g; # Now that we've warned about them, remove them. - $letter->{'content'} =~ s/\<[^<>]*?\>//g; # 2nd pass for the double nesting. if ( !$nomail && scalar @emails_to_use ) { C4::Letters::EnqueueLetter( -- 1.8.1.2 From tomascohen at gmail.com Mon Sep 2 20:19:25 2013 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Mon, 2 Sep 2013 15:19:25 -0300 Subject: [Koha-patches] [PATCH] Bug 7813: Ability to delete local cover images Message-ID: <1378145965-21723-1-git-send-email-tomascohen@gmail.com> This patch adds the ability to delete local cover images from the detail page. It adds a 'x' button to trigger the deletion. It occurs using a new SVC script called cover_images that accepts the following parameters: - action - biblionumber (used for checking imagenumber validity) - imagenumber (repeatable) It then deletes all valid images passed and returns a JSON object containing the imagenumbers and the deletion status (1/0). The operation is triggered using jQuery.ajax, and with the response the corresponding images get deleted. Note: currently one image is deleted at a time, but the code is there to be used. To test: - Open the detail page fr a biblionumber containing one or more cover images, go to its images tab. - Apply the patch, reload the page, go to the images tab. - Thumbnails should look better than before ;-) - An 'X' button should show below each cover. - Clicking the 'X' button should trigger an alert message asking for confirmation. a) Cancel: nothing happens, reload the page and check nothing got deleted. b) Accept: the deleted image should be gone, reload the page to check it doesn't exist anymore and is not a browser/DOM manipulation trick. - Signoff Note: check having more cover images than those that fit the width and see it wraps fine. Any comments are welcome, this is WIP. Thanks To+ P.S. I chose not to implement every possible action on the svc script, but another bug could be filled for more improvements. Sponsored-by: Universidad Nacional de Cordoba --- .../intranet-tmpl/prog/en/css/staff-global.css | 4 + .../prog/en/modules/catalogue/detail.tt | 46 ++++++++++-- svc/cover_images | 78 ++++++++++++++++++++ 3 files changed, 121 insertions(+), 7 deletions(-) create mode 100755 svc/cover_images diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index 9d4446c..308e3a0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -1398,6 +1398,10 @@ li.email { margin : auto; } +.thumbnails > li { + list-style-type: none; +} + #searchresults ul li { font-size : 90%; list-style : url(../../img/item-bullet.gif); 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 1011224..117a232 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -52,11 +52,36 @@ function verify_images() { }); } - $(document).ready(function() { + function removeLocalImage(imagenumber) { + + $.ajax({ + url: "/cgi-bin/koha/svc/cover_images?action=delete&biblionumber=" + [% biblionumber %] + "&imagenumber=" + imagenumber, + success: function(data) { + $(data).each( function(i) { + if ( this.deleted == 1 ) { + $('#imagenumber-' + this.imagenumber).remove(); + } + }); + } + }); + + } + + $(document).ready(function() { $('#bibliodetails').tabs(); $('#search-form').focus(); + $('.thumbnails > li > a > span').click(function() { + var result = confirm(_("Are you sure you want to delete this cover image?")); + + if ( result == true ) { + var imagenumber = $(this).parent().parent().attr('id').split('-')[1]; + removeLocalImage(imagenumber); + } + + return false; + }); + }); - }); [% IF ( AmazonCoverImages ) %]$(window).load(function() { verify_images(); });[% END %] @@ -693,15 +718,22 @@ function verify_images() { [% IF ( LocalCoverImages ) %]
[% IF ( localimages.0 ) %] -

Click on an image to view it in the image viewer

+

Click on an image to view it in the image viewer

+
    [% FOREACH image IN localimages %] -[% IF image %] - -[% END %] + [% IF image %] +
  • + + + × + +
  • + [% END %] [% END %] +
[% ELSE %] [% IF ( CAN_user_tools_upload_local_cover_images ) %] -

No images have been uploaded for this bibliographic record yet. Please upload one.

+

No images have been uploaded for this bibliographic record yet. Please upload one.

[% END %] [% END %]
diff --git a/svc/cover_images b/svc/cover_images new file mode 100755 index 0000000..c644e1a --- /dev/null +++ b/svc/cover_images @@ -0,0 +1,78 @@ +#!/usr/bin/perl + +# Copyright 2013 Universidad Nacional de Cordoba +# Tomas Cohen Arazi +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +use Modern::Perl; + +use CGI; +use C4::Auth qw/check_cookie_auth/; +use C4::Images; +use JSON qw/to_json/; + +my $input = new CGI; + +my ( $auth_status, $sessionID ) = + check_cookie_auth( + $input->cookie('CGISESSID'), + { tools => 'upload_local_cover_images' } ); + +if ( $auth_status ne "ok" ) { + exit 0; +} + +my $action = $input->param('action'); +my $biblionumber = $input->param('biblionumber'); +my @imagenumbers = $input->param('imagenumber'); + +# Array to store the reponse JSON +my $response = []; + +if ( $action eq "delete" ) { + # Build a hash of valid imagenumbers fr the given biblionumber + my %valid_imagenumbers = map {$_ => 1} ListImagesForBiblio($biblionumber); + + foreach my $imagenumber ( @imagenumbers ) { + if ( exists( $valid_imagenumbers{ $imagenumber } ) ) { + DelImage($imagenumber); + push @$response, { + imagenumber => $imagenumber, + deleted => 1 + }; + } else { + push @$response, { + imagenumber => $imagenumber, + deleted => 0, + error => "MSG_INVALID_IMAGENUMBER" + }; + } + } +} else { + # invalid action + exit 0; +} + +binmode STDOUT, ":encoding(UTF-8)"; +print $input->header( + -type => 'application/json', + -charset => 'UTF-8' +); + +print to_json( $response ); + -- 1.7.9.5 From tomascohen at gmail.com Mon Sep 9 16:08:07 2013 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Mon, 9 Sep 2013 11:08:07 -0300 Subject: [Koha-patches] [PATCH] Bug 9735: Unit tests for get_template_and_user (cookies handling) Message-ID: <1378735687-21220-1-git-send-email-tomascohen@gmail.com> Galen found a case where the cookies array was not built flat. I add a unit test for that (check the cookie array is flat) and also test the cookies output of get_template_and_user so we are sure the &language= parameter is correctly handled. Regards To+ Sponsored-by: Universidad Nacional de Cordoba --- t/db_dependent/Auth.t | 100 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 97 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t index 08b6849..814bb5f 100644 --- a/t/db_dependent/Auth.t +++ b/t/db_dependent/Auth.t @@ -3,13 +3,107 @@ # This Koha test module is a stub! # Add more tests here!!! -use strict; -use warnings; +use Modern::Perl; -use Test::More tests => 1; +use CGI; +use Test::MockModule; +use List::MoreUtils qw/all any none/; +use Test::More tests => 4; +use C4::Members; BEGIN { use_ok('C4::Auth'); } +my $dbh = C4::Context->dbh; +# Start transaction +$dbh->{AutoCommit} = 0; +$dbh->{RaiseError} = 1; + + +# get_template_and_user tests + +{ # Tests for the language URL parameter + + sub MockedCheckauth { + my ($query,$authnotrequired,$flagsrequired,$type) = @_; + # return vars + my $userid = 'cobain'; + my $sessionID = 234; + # we don't need to bother about permissions for this test + my $flags = { + superlibrarian => 1, acquisition => 0, + borrow => 0, borrowers => 0, + catalogue => 1, circulate => 0, + coursereserves => 0, editauthorities => 0, + editcatalogue => 0, management => 0, + parameters => 0, permissions => 0, + plugins => 0, reports => 0, + reserveforothers => 0, serials => 0, + staffaccess => 0, tools => 0, + updatecharges => 0 + }; + + my $session_cookie = $query->cookie( + -name => 'CGISESSID', + -value => 'nirvana', + -HttpOnly => 1 + ); + + return ( $userid, $session_cookie, $sessionID, $flags ); + } + + # Mock checkauth, build the scenario + my $auth = new Test::MockModule( 'C4::Auth' ); + $auth->mock( 'checkauth', \&MockedCheckauth ); + + # Make sure 'EnableOpacSearchHistory' is set + C4::Context->set_preference('EnableOpacSearchHistory',1); + # Enable es-ES for the OPAC and staff interfaces + C4::Context->set_preference('opaclanguages','en,es-ES'); + C4::Context->set_preference('language','en,es-ES'); + + # we need a session cookie and have some anonymous search history + $ENV{"SERVER_PORT"} = 80; + $ENV{"HTTP_COOKIE"} = 'CGISESSID=nirvana; KohaOpacRecentSearches=%255B%257B%2522time%2522%253A1378313124%252C%2522query_cgi%2522%253A%2522idx%253D%2526q%253Dhistory%2526branch_group_limit%253D%2522%252C%2522total%2522%253A3%252C%2522query_desc%2522%253A%2522kw%252Cwrdl%253A%2520history%252C%2520%2522%257D%252C%257B%2522time%2522%253A1378313137%252C%2522query_cgi%2522%253A%2522idx%253D%2526q%253D%2525D8%2525B9%2525D8%2525B1%2525D8%2525A8%2525D9%25258A%25252F%2525D8%2525B9%2525D8%2525B1%2525D8%2525A8%2525D9%252589%2526branch_group_limit%253D%2522%252C%2522total%2522%253A2%252C%2522query_desc%2522%253A%2522kw%252Cwrdl%253A%2520%25D8%25B9%25D8%25B1%25D8%25A8%25D9%258A%252F%25D8%25B9%25D8%25B1%25D8%25A8%25D9%2589%252C%2520%2522%257D%255D'; + + my $query = new CGI; + $query->param('language','es-ES'); + + my ( $template, $loggedinuser, $cookies ) = get_template_and_user( + { + template_name => "about.tmpl", + query => $query, + type => "opac", + authnotrequired => 1, + flagsrequired => { catalogue => 1 }, + debug => 1 + } + ); + + ok ( ( all { ref($_) eq 'CGI::Cookie' } @$cookies ), + 'BZ9735: the cookies array is flat' ); + + # new query, with non-existent language (we only have en and es-ES) + $query->param('language','tomas'); + + ( $template, $loggedinuser, $cookies ) = get_template_and_user( + { + template_name => "about.tmpl", + query => $query, + type => "opac", + authnotrequired => 1, + flagsrequired => { catalogue => 1 }, + debug => 1 + } + ); + + ok( ( none { $_->name eq 'KohaOpacLanguage' and $_->value eq 'tomas' } @$cookies ), + 'BZ9735: invalid language, it is not set'); + + ok( ( any { $_->name eq 'KohaOpacLanguage' and $_->value eq 'en' } @$cookies ), + 'BZ9735: invalid language, then default to en'); +} + +$dbh->rollback; -- 1.7.9.5 From oleonard at myacpl.org Mon Sep 9 18:05:31 2013 From: oleonard at myacpl.org (Owen Leonard) Date: Mon, 9 Sep 2013 12:05:31 -0400 Subject: [Koha-patches] [PATCH] Bug 10836 - New layout for placing holds in the OPAC Message-ID: <1378742731-10334-1-git-send-email-oleonard@myacpl.org> This patch changes the layout of the OPAC's place hold screen, eliminating the table in favor of a more flexible, open display. To test, place single and multiple holds under various conditions: - Items which are not available to be place on hold - With OpacHoldNotes on and off - With OPACItemHolds on and off - With OPACAllowHoldDateInFuture on and off - With IndependentBranches on and off - With JavaScript disabled Test setting hold notes, holding specific copies, and setting hold start dates. When setting a hold start date and hold expiration date, the two datepickers should work together to prevent invalid date combinations (dates after today, expiration dates which precede the start date). --- koha-tmpl/opac-tmpl/prog/en/css/opac.css | 36 +- .../opac-tmpl/prog/en/includes/date-format.inc | 1 + .../opac-tmpl/prog/en/modules/opac-reserve.tt | 422 ++++++++++---------- 3 files changed, 247 insertions(+), 212 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/prog/en/includes/date-format.inc diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css index 0311bdd..7d40ba9 100644 --- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css +++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css @@ -104,7 +104,7 @@ fieldset.rows li.radio { fieldset.rows li.radio label { float : none; width : auto; - margin : 0 0 0 1em; + margin : 0 .5em; } fieldset.rows ol.radio label { @@ -3016,15 +3016,6 @@ a.reviewlink,a.reviewlink:visited { float:left; padding: 0.1em 0; } -.notesrow label { - font-weight: bold; -} -.notesrow span { - display: block; -} -.notesrow textarea { - width: 100%; -} .thumbnail-shelfbrowser span { margin: 0px auto; @@ -3063,3 +3054,28 @@ padding: 0.1em 0; display: block; overflow: auto; } + +.holdrow { + clear : both; + padding:1em; + border-bottom:1px solid #CCC; + margin-bottom:.5em; +} +.holdrow fieldset { + border : 0; + margin : 0; +} +.hold-options { + clear : both; +} +.toggle-hold-options { + background-color: #eee; + clear : both; + display : block; + font-weight : bold; + margin: 1em 0; + padding: .5em; +} +.copiesrow { + clear : both; +} diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/date-format.inc b/koha-tmpl/opac-tmpl/prog/en/includes/date-format.inc new file mode 100644 index 0000000..53dae71 --- /dev/null +++ b/koha-tmpl/opac-tmpl/prog/en/includes/date-format.inc @@ -0,0 +1 @@ +[% IF ( dateformat == "us" ) %](MM/DD/YYYY)[% ELSIF ( dateformat == "metric" ) %](DD/MM/YYYY)[% ELSE %](YYYY-MM-DD)[% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt index d1fdbc6..46005ed 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt @@ -33,7 +33,6 @@ }); // Hides all 'specific copy' table rows on load. $(".copiesrow").hide(); - $(".notesrow").hide(); // Insert reasons for forced hold notes $(".forcenotesreason").each(function(){ @@ -44,22 +43,37 @@ } }); - $("#place_on_hdr").show(); - $(".place_on_type").show(); + $("#place_on_hdr,.place_on_type,.toggle-hold-options").show(); + $(".hold-options").hide(); + $(".holddatefrom,.holddateto").prop("readOnly", true); + + $(".date-format").each(function(){ + if($(this).hasClass("to")){ var op = "to"; } + if($(this).hasClass("from")){ var op = "from"; } + var bibNum = $(this).data("biblionumber"); + $(this).html("" + _("Clear date") + ""); + }); + + $(".clear-date").on("click",function(e){ + e.preventDefault(); + var fieldID = this.id.replace("clear",""); + var op = $(this).data("op"); + $("#" + op + fieldID).val(""); + }); // Replace non-JS single-selection with multi-selection capability. $(".reserve_mode").val("multi"); $(".confirm_nonjs").remove(); $(".confirmjs_hold").each(function(){ var bib = $(this).attr("title"); - var html = ""; + var html = " "; $(this).html(html); }); $(".confirmjs_nohold").each(function(){ var bib = $(this).attr("title"); - var html = ""; + var html = ""; $(this).html(html); }); @@ -115,12 +129,6 @@ $(".copiesrow").hide(); }); - // Show or hide holds notes - $(".shownotes").click(function(){ - biblioNum = suffixOf($(this).attr("id"), "_"); - $("#notesrow_"+biblioNum).toggle(); - }); - // When 'Place Hold' button is clicked $(".placehold").click(function(){ var biblionumbers = ""; @@ -170,6 +178,43 @@ return true; }); + $(".toggle-hold-options").on("click",function(e){ + e.preventDefault(); + toggleLink = $(this); + var optionsID = this.id.replace("toggle-hold-options-",""); + var copiesRow = $("#copiesrow_"+optionsID) + $("#hold-options-"+optionsID).toggle(0, function() { + if( copiesRow.is(':visible') ){ + $("#reqany_"+optionsID).prop("checked",true); + copiesRow.hide(); + } + toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options")); + }); + }); + + + + + +[% FOREACH bibitemloo IN bibitemloop %] + [% IF ( bibitemloo.holdable ) %] + // http://jqueryui.com/demos/datepicker/#date-range + var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({ + minDate: 1, + changeMonth: true, + numberOfMonths: 1, + onSelect: function( selectedDate ) { + var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate", + instance = $( this ).data( "datepicker" ); + date = $.datepicker.parseDate( + instance.settings.dateFormat || + $.datepicker._defaults.dateFormat, + selectedDate, instance.settings ); + dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date ); + } + }); + [% END %] +[% END %] }); // ]]> @@ -255,209 +300,181 @@
- - [% UNLESS ( none_available ) %] - - - [% UNLESS ( item_level_itypes ) %] - - [% END %] - [% IF showholds && showpriority %] - - [% ELSIF showholds %] - - [% ELSIF showpriority %] - - [% END %] - [% IF ( reserve_in_future ) %] - - [% END %] - - [% IF ( OpacHoldNotes ) %][% END %] - [% IF ( OPACItemHolds ) %] - - [% END %] - [% UNLESS ( singleBranchMode ) %] - [% IF ( choose_branch ) %] - - [% END %] - [% END %] - [% ELSE %][% END %] [% FOREACH bibitemloo IN bibitemloop %] - - [% IF ( bibitemloo.holdable ) %] - - [% ELSE %] - [% UNLESS ( none_available ) %][% END %] - [% END %] - [% IF ( bibitemloo.holdable ) %] - [% IF ( bibitemloo.holdable ) %] - - [% UNLESS ( item_level_itypes ) %] - + [% UNLESS ( singleBranchMode ) %] + [% IF ( bibitemloo.holdable ) %] + [% IF ( choose_branch ) %] +
  • + + [% UNLESS ( bibitemloo.holdable ) %] + + [% ELSE %] + + [% END %] +
  • + [% END %] + [% END %] + [% END %] + + +
    +
      + [% IF ( reserve_in_future ) %] +
    • + + [% INCLUDE 'date-format.inc' %] +
    • + [% END %] + + [% END %] + [% IF ( bibitemloo.holdable ) %] +
    • + + + [% INCLUDE 'date-format.inc' %] +
    • [% END %] - [% IF showholds || showpriority %] -
    + + [% IF ( OpacHoldNotes && bibitemloo.holdable ) %] +
  • +
    + + + + +
    +
  • [% END %] - [% IF ( reserve_in_future ) %] - [% END %] - - [% END %] - [% IF ( bibitemloo.holdable ) %][% END %] - - [% IF ( OpacHoldNotes ) %][% IF ( bibitemloo.holdable ) %][% END %][% END %] - - [% IF ( bibitemloo.holdable ) %] - - [% IF ( OPACItemHolds ) %] - - - [% END %][% END %] - - [% UNLESS ( singleBranchMode ) %] + [% IF ( bibitemloo.holdable ) %] - [% IF ( choose_branch ) %] - - [% END %] - [% END %] - [% END %] - + + [% IF ( OPACItemHolds ) %] + + +
  • + [% UNLESS ( bibitemloo.holdable ) %] + + [% ELSE %] + + [% END %] - [% IF ( OpacHoldNotes ) %] - [% IF ( bibitemloo.holdable ) %] -
  • - - - - [% END %] - [% END %] + + [% UNLESS ( bibitemloo.holdable ) %] + + [% ELSE %] + + [% END %] + + + [% END %] + [% END %] + + + +
    [% IF ( OPACItemHolds ) %] [% IF ( bibitemloo.holdable ) %] - - - - + + [% END %] + [% END %] [% END %] -
    HoldTitleItem typeHolds and priorityHoldsPriorityHold starts on dateHold not needed afterNotesPickup location
    Title
    - - - - - - - -  [% ELSE %][% END %] - [% bibitemloo.title |html %][% IF ( bibitemloo.subtitle ) %] [% FOREACH subtitl IN bibitemloo.subtitle %][% subtitl.subfield %][% END %][% END %] - [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %] +
    - [% UNLESS ( bibitemloo.holdable ) %] +

    - [% IF ( bibitemloo.already_reserved ) %] -

    You have already requested this title.
    + [% IF ( bibitemloo.holdable ) %] + + + + + + + [% ELSE %] - [% UNLESS ( bibitemloo.bib_available ) %] -
    No available items.
    - [% ELSE %] - [% IF ( bibitemloo.already_patron_possession ) %] -
    This title cannot be requested because it's already in your possession.
    + [% END %] + + [% bibitemloo.title |html %][% IF ( bibitemloo.subtitle ) %] [% FOREACH subtitl IN bibitemloo.subtitle %][% subtitl.subfield %][% END %][% END %] + [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]

    + + + + + [% UNLESS ( bibitemloo.holdable ) %] + [% IF ( bibitemloo.already_reserved ) %] +
    You have already requested this title.
    [% ELSE %] -
    This title cannot be requested.
    + [% UNLESS ( bibitemloo.bib_available ) %] +
    No available items.
    + [% ELSE %] + [% IF ( bibitemloo.already_patron_possession ) %] +
    This title cannot be requested because it's already in your possession.
    + [% ELSE %] +
    This title cannot be requested.
    + [% END %] + [% END %] [% END %] - [% END %] [% END %] + [% IF ( bibitemloo.holdable ) %] +
    +
      + + [% UNLESS ( item_level_itypes ) %] +
    • + Item type: + [% IF ( bibitemloo.imageurl ) %][% END %] + [% bibitemloo.description %] +
    • + [% END %] + [% IF showholds || showpriority %] +
    • + Holds and priority: + [% IF showpriority %] [% bibitemloo.rank %] [% END %] + [% IF showholds && showpriority %] out of [% END %] + [% IF showholds %] [% bibitemloo.reservecount %] [% END %] +
    • + [% END %] + - [% END %] -
    - [% IF ( bibitemloo.imageurl ) %][% END %] - [% bibitemloo.description %] - - [% IF showpriority %] [% bibitemloo.rank %] [% END %] - [% IF showholds && showpriority %] out of [% END %] - [% IF showholds %] [% bibitemloo.reservecount %] [% END %] - - - -

    - Clear date

    -
    - -

    - Clear date

    -
    - [% UNLESS ( bibitemloo.holdable ) %] - - [% ELSE %] - - [% END %] -
      -   - - - -
      - + +
    @@ -530,18 +547,19 @@ [% END %]
    Select a specific copy:
    Copy
    -
    + [% END %]
    [% UNLESS ( message ) %] [% UNLESS ( none_available ) %] - + [% END %] [% END %] -- 1.7.9.5 From oleonard at myacpl.org Mon Sep 9 18:34:57 2013 From: oleonard at myacpl.org (Owen Leonard) Date: Mon, 9 Sep 2013 12:34:57 -0400 Subject: [Koha-patches] [PATCH] Bug 10730 - Use DataTables on the tag review page Message-ID: <1378744497-11188-1-git-send-email-oleonard@myacpl.org> This patch enhances the tags review page in the staff client by adding DataTables sorting to the table of tags. It also converts the tag list page (list.tt) to use the new DataTables include introduced by Bug 10649. To test, apply the patch and view the tags review page for various categories: Pending, approved, rejected, all. The table should be sortable by status, term, weight, and date. Sorting by date should work correctly regardless of date format preference. Title sorting on the tag list page should work correctly. --- .../intranet-tmpl/prog/en/modules/tags/list.tt | 4 +- .../intranet-tmpl/prog/en/modules/tags/review.tt | 108 ++++++++++++-------- tags/review.pl | 3 - 3 files changed, 67 insertions(+), 48 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt index 3e49787..5749ceb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt @@ -2,9 +2,7 @@ Koha › Tools › Tags › [% IF ( do_it ) %]Review › [% ELSE %]Review tags[% END %] [% INCLUDE 'doc-head-close.inc' %] - -[% INCLUDE 'datatables-strings.inc' %] - +[% INCLUDE 'datatables.inc' %]