@@ -, +, @@ the title detail page - Logged in as a user who can or can't edit items - Logged in as a user who can or can't perform batch item operations. - With the StaffDetailItemSelection system preference enabled or disabled. - With the SeparateHoldings system preference turned on or off. --- .../intranet-tmpl/prog/en/css/staff-global.css | 4 ++ .../prog/en/modules/catalogue/detail.tt | 81 ++++++++++++---------- 2 files changed, 48 insertions(+), 37 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -2860,3 +2860,7 @@ div.duration h5, div.blocks h5 { div.duration span, div.blocks div { display:block; } + +div[class$="_table_controls"] { + padding: .7em 0; +} --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -94,15 +94,6 @@ function verify_images() { } [% IF StaffDetailItemSelection %] - function selectAllItems(div) { - $("input[name='itemnumber'][type='checkbox']", div).attr('checked', 'checked'); - itemSelectionBuildActionLinks(div); - } - - function clearAllItems(div) { - $("input[name='itemnumber'][type='checkbox']", div).removeAttr('checked'); - itemSelectionBuildActionLinks(div); - } function itemSelectionBuildDeleteLink(div) { var itemnumbers = new Array(); @@ -114,9 +105,7 @@ function verify_images() { url += '&itemnumber=' + itemnumbers.join('&itemnumber='); url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]'; $('a.itemselection_action_delete').attr('href', url); - $('a.itemselection_action_delete').show(); } else { - $('a.itemselection_action_delete').hide(); return false; } return true @@ -132,15 +121,14 @@ function verify_images() { url += '&itemnumber=' + itemnumbers.join('&itemnumber='); url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]'; $('a.itemselection_action_modify').attr('href', url); - $('a.itemselection_action_modify').show(); } else { - $('a.itemselection_action_modify').hide(); return false; } return true; } - function itemSelectionBuildActionLinks(div) { + function itemSelectionBuildActionLinks(tab) { + var div = $("#" + tab); var delete_link_ok = itemSelectionBuildDeleteLink(div); var modify_link_ok = itemSelectionBuildModifyLink(div); if (modify_link_ok || delete_link_ok) { @@ -151,14 +139,31 @@ function verify_images() { } $(document).ready(function() { + $('table.items_table').each(function() { - var div = $(this).parent().parent(); + var div = $(this).parent().attr("id"); itemSelectionBuildActionLinks(div); }); + $("input[name='itemnumber'][type='checkbox']").change(function() { - var div = $(this).parents('table').parent().parent(); + var div = $(this).parents('table').parent().parent().attr("id"); itemSelectionBuildActionLinks(div); }); + + $(".SelectAll").on("click",function(e){ + e.preventDefault(); + var tab = $(this).data("tab"); + $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', true); + itemSelectionBuildActionLinks(tab); + }); + + $(".ClearAll").on("click",function(e){ + e.preventDefault(); + var tab = $(this).data("tab"); + $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false); + itemSelectionBuildActionLinks(tab); + }); + }); [% END %] @@ -236,7 +241,7 @@ function verify_images() { } $('#' + id + '_activate_filters') - .text(_("Deactivate filters")) + .html(' ' + _("Deactivate filters") ) .unbind('click') .click(function() { deactivate_filters(id); @@ -254,7 +259,7 @@ function verify_images() { filters_row.hide(); $('#' + id + '_activate_filters') - .text(_("Activate filters")) + .html(' ' + _("Activate filters") ) .unbind('click') .click(function() { activate_filters(id); @@ -288,7 +293,7 @@ function verify_images() { link = $('') .attr('href', '#') .attr('id', id + '_activate_filters'); - table.before(link); + $("." + id + "_table_controls").prepend(link); deactivate_filters(id); } [% IF Koha.Preference('AcquisitionDetails') %] @@ -561,19 +566,21 @@ function verify_images() { [% items_table_block_iter = 0 %] [% BLOCK items_table %] [% items_table_block_iter = items_table_block_iter + 1 %] - [% IF (StaffDetailItemSelection) %] - Select all | - Clear all - - | Actions: - [% IF CAN_user_tools_items_batchdel %] - Delete selected items - [% END %] - [% IF CAN_user_tools_items_batchmod %] - Modify selected items - [% END %] - - [% END %] +
+ [% IF (StaffDetailItemSelection) %] + | Select all | + Clear all + + | Actions: + [% IF CAN_user_tools_items_batchdel %] + Delete selected items + [% END %] + [% IF CAN_user_tools_items_batchmod %] + Modify selected items + [% END %] + + [% END %] +
@@ -597,7 +604,7 @@ function verify_images() { [% IF ( hostrecords ) %][% END %] [% IF ( analyze ) %][% END %] [% IF ( ShowCourseReserves ) %][% END %] - [% IF ( CAN_user_editcatalogue_edit_items ) %][% END %] + [% IF ( CAN_user_editcatalogue_edit_items ) %][% END %] @@ -803,9 +810,9 @@ function verify_images() { [% END %] [% IF CAN_user_editcatalogue_edit_items %] - [% END %] @@ -818,7 +825,7 @@ function verify_images() {
[% IF ( count ) %] [% IF ( showncount ) %] - [% PROCESS items_table items=itemloop %] + [% PROCESS items_table tab="holdings" items=itemloop %] [% END %] [% IF ( hiddencount ) %]

Show all items ([% hiddencount %] hidden) @@ -845,7 +852,7 @@ function verify_images() { [% IF (SeparateHoldings) %]

[% IF (otheritemloop.size) %] - [% PROCESS items_table items=otheritemloop %] + [% PROCESS items_table tab="otherholdings" items=otheritemloop %] [% ELSE %] No other items. [% END %] --
Host recordsUsed inCourse ReservesEdit 
+ [% UNLESS item.cannot_be_edited %] - Edit + Edit [% END %]