X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;ds=sidebyside;f=koha-tmpl%2Fopac-tmpl%2Fprog%2Fen%2Fmodules%2Fopac-shelves.tt;h=9e201d0152c4d0214d6a428237911a93a8b7a6ab;hb=c4d21bcbfebb5bf8a8d1a877a01a528237fd5b7a;hp=bf44771357190308b6884a3f2b3c848a7d89fb03;hpb=a7f7aeb138b8275448937102cb7a46cf49530aef;p=koha_gimpoz diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt index bf44771357..9e201d0152 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt @@ -6,10 +6,11 @@ var MSG_NO_TAG_SPECIFIED = _("No tag was specified."); var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?"); var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to delete this list?"); +var MSG_NO_RECORD_SELECTED = _("Please select one or more items"); [% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %] function holdSelections() { - var checkedBoxes = $(":checkbox:checked"); + var checkedBoxes = $("input:checkbox:checked"); if ($(checkedBoxes).size() == 0) { alert(MSG_NO_RECORD_SELECTED); } else { @@ -63,33 +64,51 @@ function tagAdded() { return false; }[% END %][% END %][% END %] +function enableCheckboxActions(){ + // Enable/disable controls if checkboxes are checked + var checkedBoxes = $(".checkboxed input:checkbox:checked"); + if ($(checkedBoxes).size()) { + $("#selections").html(_("With selected titles: ")); + $("#selections-toolbar .links a").removeClass("disabled"); + } else { + $("#selections").html(_("Select titles to: ")); + $("#selections-toolbar .links a").addClass("disabled"); + } +} + $(function() { [% IF ( opacbookbag ) %]$(".addtocart").show();[% END %] - $("span.clearall").html(""+_('Clear All')+"<\/a>|"); - $("span.checkall").html(""+_('Select All')+"<\/a>"); + $("span.clearall").html(""+_('Clear all')+"<\/a>"); + $("span.checkall").html(""+_('Select all')+"<\/a>"); $("a.print").show(); - [% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %]$("#placehold").html(""+_('Place Hold')+"<\/a>"); - $("#toolbar a.hold").click(function(){ + [% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %]$("#placehold").html(""+_('Place hold')+"<\/a>"); + $("#selections-toolbar a.hold").click(function(){ holdSelections(); return false; });[% END %][% END %] $("#CheckAll").click(function(){ $(".checkboxed").checkCheckboxes(); + enableCheckboxActions(); return false; }); $("#CheckNone").click(function(){ $(".checkboxed").unCheckCheckboxes(); + enableCheckboxActions(); return false; }); + $(".cb").click(function(){ + enableCheckboxActions(); + }); + [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %] $("#addtags").click(function(){ tagSelected(); return false; }); - $("#addtags").html(""+_("Tag")+"<\/a> |"); + $("#addtags").html(""+_("Tag")+"<\/a> "); $(".tagbutton").click(KOHA.Tags.add_tag_button); [% IF ( loggedinusername ) %] @@ -112,6 +131,22 @@ $(function() { }); [% END %] [% END %][% END %][% END %] + [% IF ( loggedinusername && allowremovingitems ) %] + $("#myform").submit(function(){ + var checkedBoxes = $(".checkboxed input:checkbox:checked"); + if ($(checkedBoxes).size()) { + return confirmDelete(MSG_REMOVE_FROM_LIST); + } else { + alert(MSG_NO_RECORD_SELECTED); + return false; + } + }); + $("#removeitems").html(""+_("Remove from list")+"") + .click(function(){ + $("#myform").submit(); + return false; + }); + [% END %] [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %] }); function Check(f) { @@ -175,6 +210,15 @@ $(function() { [% IF ( paramsloo.unrecognized ) %]
[% END %] + [% IF ( paramsloo.modifyfailure) %] + + [% END %] + [% IF ( paramsloo.nothingdeleted) %] + + [% END %] + [% IF ( paramsloo.somedeleted) %] + + [% END %] [% END %] @@ -185,34 +229,19 @@ $(function() { [% IF ( viewshelf ) %][% IF ( shelvesloo.viewcategory1 ) %]Private[% END %] [% IF ( shelvesloo.viewcategory2 ) %]Public[% END %] - [% IF ( shelvesloo.viewcategory3 ) %]Open[% END %] | [% IF ( shelvesloo.mine ) %] @@ -579,7 +628,9 @@ $(function() { |