@@ -, +, @@ like search results - List contents output has been modified so that the staff client can use XSLT-formatted data just as the OPAC can. As in the OPAC it depends on XSLTResultsDisplay being enabled. - A "toolbar" has been added which is similar to that in search results, offering the option to add items to a Cart, add them to a different list, place multiple holds, remove items from the list, or merge records. - This toolbar has been made to float on scroll like the one on the MARC edit page. - Library and shelving location have been added to the display of call numbers. Call numbers are linked to a search as they are in search results. - Edit links are included just as they are in search results. - Automatic focus on the add by barcode form has been removed so that the page doesn't jump to the bottom unnecessarily. - basket.js's "addMultiple" function has been modified so that it receives an array of checkboxes rather than looking for checkboxes in a specific form. This helps abstract its functionality for use on both search results and lists. results.tt is modified accordingly. - The page layout has been widened to make room for the increased amount of information on the page. - A new "merge" icon has been added to the default Bootstrap sprite. - View both public and private lists in the staff client. - View lists with and without contents. - Test the functionality of options in the toolbar: Add to cart, add to lists, place multiple holds, remove items, merge items. - Test with users with and without cataloging privileges to confirm that catalog-related controls are correctly shown or hidden. - Test with XSLTResultsDisplay set both to "default" and empty. - Since the staff client and OPAC use some of the same code, test that lists in the OPAC have not broken. - Since JavaScript was modified which affects both lists and search results, confirm that adding items to the Cart and Lists from search results hasn't been broken by this patch. --- C4/VirtualShelves/Page.pm | 24 ++- koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css | 6 - .../intranet-tmpl/prog/en/css/staff-global.css | 13 +- koha-tmpl/intranet-tmpl/prog/en/js/basket.js | 30 +-- .../prog/en/modules/catalogue/results.tt | 16 +- .../prog/en/modules/virtualshelves/shelves.tt | 224 +++++++++++++++----- .../prog/img/glyphicons-halflings-koha.png | Bin 26855 -> 27260 bytes 7 files changed, 232 insertions(+), 81 deletions(-) --- a/C4/VirtualShelves/Page.pm +++ a/C4/VirtualShelves/Page.pm @@ -237,7 +237,10 @@ sub shelfpage { # explicitly fetch this shelf my ($shelfnumber2,$shelfname,$owner,$category,$sorton) = GetShelf($shelfnumber); - $template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') ); + $template->param( + 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds'), + 'DisplayMultiPlaceHold' => C4::Context->preference('DisplayMultiPlaceHold'), + ); if (C4::Context->preference('TagsEnabled')) { $template->param(TagsEnabled => 1); foreach (qw(TagsShowOnList TagsInputOnList)) { @@ -259,9 +262,11 @@ sub shelfpage { for my $this_item (@$items) { my $biblionumber = $this_item->{'biblionumber'}; my $record = GetMarcBiblio($biblionumber); - $this_item->{XSLTBloc} = - XSLTParse4Display($biblionumber, $record, "OPACXSLTResultsDisplay") - if C4::Context->preference("OPACXSLTResultsDisplay") && $type eq 'opac'; + if (C4::Context->preference("OPACXSLTResultsDisplay") && $type eq 'opac') { + $this_item->{XSLTBloc} = XSLTParse4Display($biblionumber, $record, "OPACXSLTResultsDisplay"); + } elsif (C4::Context->preference("XSLTResultsDisplay") && $type eq 'intranet') { + $this_item->{XSLTBloc} = XSLTParse4Display($biblionumber, $record, "XSLTResultsDisplay"); + } # the virtualshelfcontents table does not store these columns nor are they retrieved from the items # and itemtypes tables, so I'm commenting them out for now to quiet the log -crn @@ -292,6 +297,17 @@ sub shelfpage { } } + if($type eq 'intranet'){ + # Build drop-down list for 'Add To:' menu... + my ($totalref, $pubshelves, $barshelves)= + C4::VirtualShelves::GetSomeShelfNames($loggedinuser,'COMBO',1); + $template->param( + addbarshelves => $totalref->{bartotal}, + addbarshelvesloop => $barshelves, + addpubshelves => $totalref->{pubtotal}, + addpubshelvesloop => $pubshelves, + ); + } push @paramsloop, { display => 'privateshelves' } if $category == 1; $showadd = 1; my $i = 0; --- a/koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css +++ a/koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css @@ -139,12 +139,6 @@ a.tagnum { .yui-gf .yui-u { width: 79.2%; } -/* Class to be added to toolbar when it starts being fixed at the top of the screen*/ -.floating { - -webkit-box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, .5); - box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, .5); - margin-top: 0; -} tr.active td { background-color: #FFFFCC; --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -2411,6 +2411,10 @@ video { background-position:-3px -166px; } +.icon-merge { + background-position:-48px -166px; +} + #toolbar .btn, #toolbar .dropdown-menu { font-size: 13px; @@ -2545,6 +2549,7 @@ a.disabled { .modal-header .closebtn{margin-top:2px;} .closebtn{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000000;text-shadow:0 1px 0 #ffffff;opacity:0.2;filter:alpha(opacity=20);}.closebtn:hover{color:#000000;text-decoration:none;cursor:pointer;opacity:0.4;filter:alpha(opacity=40);} button.closebtn{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none;} + .btn-group label, .btn-group select { font-size: 13px; @@ -2570,4 +2575,10 @@ fieldset.rows table.mceListBox { font-size: 140%; font-family : monospace; padding : .3em; -} +} + +/* Class to be added to toolbar when it starts being fixed at the top of the screen*/ +.floating { + -webkit-box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, .5); + box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, .5); +} --- a/koha-tmpl/intranet-tmpl/prog/en/js/basket.js +++ a/koha-tmpl/intranet-tmpl/prog/en/js/basket.js @@ -153,17 +153,17 @@ function SelectAll(){ } } -function addMultiple(){ +function addMultiple(biblist){ var c_value = ""; - if(document.bookbag_form.biblionumber.length > 0) { - for (var i=0; i < document.bookbag_form.biblionumber.length; i++) { - if (document.bookbag_form.biblionumber[i].checked) { - c_value = c_value + document.bookbag_form.biblionumber[i].value + "/"; + if(biblist.length > 0) { + for (var i=0; i < biblist.length; i++) { + if (biblist[i].checked) { + c_value = c_value + biblist[i].value + "/"; } } addSelRecords(c_value); } else { - c_value = c_value + document.bookbag_form.biblionumber.value + "/"; + c_value = c_value + biblist.value + "/"; addSelRecords(c_value); } } @@ -403,19 +403,19 @@ function addSelToShelf() { /// vShelfAdd() builds url string for multiple-biblio adds. -function vShelfAdd() { - bibs= new Array; - if(document.bookbag_form.biblionumber.length > 0) { - for (var i=0; i < document.bookbag_form.biblionumber.length; i++) { - if (document.bookbag_form.biblionumber[i].checked) { - bibs.push("biblionumber=" + document.bookbag_form.biblionumber[i].value); +function vShelfAdd(biblist) { + bibs = new Array(); + if(biblist.length > 0) { + for (var i=0; i < biblist.length; i++) { + if (biblist[i].checked) { + bibs.push("biblionumber=" + biblist[i].value); } } - if (bibs.length == 0) { showListsUpdate(MSG_NO_RECORD_SELECTED); } + if (bibs.length == 0) { showListsUpdate(MSG_NO_RECORD_SELECTED); } return bibs.join("&"); } else { - if (document.bookbag_form.biblionumber.checked) { - return "biblionumber=" + document.bookbag_form.biblionumber.value; + if (biblist.checked) { + return "biblionumber=" + biblist.value; } } } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -30,25 +30,27 @@ function Dopop(link) { newin=window.open(link,'popup','width=500,height=500,toolbar=false,scrollbars=yes,resizeable=yes'); } function cartList(){ + var checkboxes = $("#searchresults").find(":checkbox"); + var vshelf = vShelfAdd(checkboxes); if($("#addto").find("option:selected").attr("value") == "addtolist"){ var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s",""); - if (vShelfAdd()) { - Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&' + vShelfAdd()); + if (vshelf) { + Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&' + vshelf); } return false; } else if($("#addto").find("option:selected").attr("value") == "newlist"){ - if (vShelfAdd()) { - Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&' + vShelfAdd()); + if (vshelf) { + Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&' + vshelf); } return false; } else if($("#addto").find("option:selected").attr("value") == "morelists"){ - if (vShelfAdd()) { - Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?' + vShelfAdd()); + if (vshelf) { + Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?' + vshelf); } return false; } if($("#addto").find("option:selected").attr("value") == "addtocart"){ - addMultiple(); + addMultiple(checkboxes); return false; } } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -1,16 +1,19 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › [% IF ( viewshelf ) %]Lists › Contents of [% shelfname | html %][% ELSE %]Lists[% END %][% IF ( shelves ) %] › Create new list[% END %][% IF ( edit ) %] › Edit list [% shelfname | html %][% END %] [% INCLUDE 'doc-head-close.inc' %] - +[% IF ( viewshelf ) %] + + +[% END %] @@ -147,7 +237,7 @@ function placeHold () { [% IF ( viewshelf ) %]› Contents of [% shelfname | html %][% END %][% IF ( shelves ) %] › Create new list[% END %][% IF ( edit ) %] › Edit list [% shelfname | html %][% END %] -
+
[% INCLUDE 'virtualshelves-toolbar.inc' %] @@ -193,56 +283,67 @@ function placeHold () {
[% IF ( itemsloop ) %] -
+

Contents of [% shelfname | html %]

+
[% pagination_bar %]
+ -
- Contents of [% shelfname | html %] - - [% IF ( itemsloop ) %] -

| -

- [% END %] - - [% IF direction == 'asc' %] - [% SET new_direction = 'desc' %] - [% ELSE %] - [% SET direction = 'desc' %] - [% SET new_direction = 'asc' %] - [% END %] -
[% pagination_bar %]
- +[% IF direction == 'asc' %] + [% SET new_direction = 'desc' %] +[% ELSE %] + [% SET direction = 'desc' %] + [% SET new_direction = 'asc' %] +[% END %] + +
+ [% IF ( itemsloop ) %] +
| + + + | +   + [% IF ( CAN_user_reserveforothers && DisplayMultiPlaceHold ) %] +
+ [% END %] + [% IF ( allowremovingitems ) %] +
+ [% END %] + [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
[% END %] +
+ [% END %] +
+ +
[% IF ( itemsloop ) %][% END %] [% UNLESS ( item_level_itypes ) %][% END %] - [% FOREACH itemsloo IN itemsloop %] [% UNLESS ( loop.odd ) %] @@ -264,31 +365,58 @@ function placeHold () { [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %][% itemsloo.description %][% END %][% itemsloo.description %] [% END %] - [% END %] -
 Item type - Title + Title [% IF sort == 'title' %] - + [% direction %] sort [% ELSE %] - + [% END %] - Author + Author [% IF sort == 'author' %] - + [% direction %] sort [% ELSE %] - + [% END %] Date added - Call number + Call number [% IF sort == 'itemcallnumber' %] - + [% direction %] sort [% ELSE %] - + [% END %]  
- [% INCLUDE 'biblio-default-view.inc' biblionumber = itemsloo.biblionumber %] - [% itemsloo.title |html %][% FOREACH subtitl IN itemsloo.subtitle %] [% subtitl.subfield %][% END %] + [% IF ( itemsloo.XSLTBloc ) %] + [% itemsloo.XSLTBloc %] + [% ELSE %] + [% INCLUDE 'biblio-default-view.inc' biblionumber = itemsloo.biblionumber %] + [% itemsloo.title |html %][% FOREACH subtitl IN itemsloo.subtitle %] [% subtitl.subfield %][% END %] + [% END %] +

+ [% IF ( itemsloo.notforloan ) %] + No holds allowed + [% ELSE %] + [% IF ( itemsloo.ITEM_RESULTS.size ) %] + Holds + [% IF ( holdfor ) %] | Place hold for [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])[% END %] + [% ELSE %] + No holds allowed + [% END %] + [% END %] + [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] + | Edit record + [% END %] + [% IF ( CAN_user_editcatalogue_edit_items ) %] + | Edit items + [% END %] +

[% itemsloo.author %] [% itemsloo.dateadded %] - [% FOREACH result IN itemsloo.ITEM_RESULTS %][% result.itemcallnumber %][% UNLESS loop.last %], [% END %][% END %] +
    + [% FOREACH result IN itemsloo.ITEM_RESULTS %] +
  • [% result.holdingbranch %] [% IF ( result.location_intranet ) %] ([% result.location_intranet %]) [% END %] + [% IF ( result.itemcallnumber ) %] + [[% result.itemcallnumber %]] + [% END %] +
  • + [% END %] +
- [% UNLESS ( itemsloo.notforloan ) %] - Holds - [% END %] -
+ +
[% pagination_bar %]
+
[% IF ( itemsloop ) %] - - [% IF ( allowremovingitems ) %][% END %] - + [% IF ( CAN_user_reserveforothers && DisplayMultiPlaceHold ) %][% END %] + [% IF ( allowremovingitems ) %][% END %] + [% IF ( CAN_user_editcatalogue_edit_catalogue ) %][% END %] [% END %]
-
- + [% END %]
[% END %]