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 ) %]
ERROR: List number [% paramsloo.unrecognized %] unrecognized.
[% END %] + [% IF ( paramsloo.modifyfailure) %] +
ERROR: Shelf could not be renamed to [% paramsloo.modifyfailure %]. This name may not be unique for this type of list. Please check.
+ [% END %] + [% IF ( paramsloo.nothingdeleted) %] +
Warning: You could not delete any selected items from this shelf.
+ [% END %] + [% IF ( paramsloo.somedeleted) %] +
Warning: You could not delete all selected items from this shelf.
+ [% END %] [% END %] @@ -185,34 +229,19 @@ $(function() { [% IF ( viewshelf ) %]

Lists > [% shelfname |html %]

[% IF ( itemsloop ) %] -
- - -[% IF ( RequestOnOpac ) %] - [% UNLESS ( TagsEnabled ) %] |[% END %] -[% END %] -[% IF ( loggedinusername ) %] - [% IF ( TagsEnabled ) %] - - - [% END %][% END %] - - Download List - -Send List - -Print List - - [% IF ( manageshelf ) %] |
+
+ + Download List + +[% IF ( opacuserlogin ) %]Send List[% END %] + +Print List + + [% IF ( manageshelf ) %] | - -
+
+ +
@@ -220,8 +249,26 @@ $(function() {
- - +
+ | + Select titles to: + [% IF ( RequestOnOpac ) %] + + [% END %] + [% IF ( loggedinusername ) %] + [% IF ( TagsEnabled ) %] + + + [% END %] + [% END %] + [% IF ( loggedinusername && allowremovingitems ) %][% END %] +
+ [% IF ( manageshelf ) %] @@ -235,7 +282,7 @@ $(function() { [% ELSE %] [% END %] - [% UNLESS ( item_level_itypes ) %] @@ -258,6 +305,7 @@ $(function() { [% END %] [% IF ( itemsloo.title ) %][% itemsloo.title |html %][% ELSE %]No title[% END %] [% FOREACH subtitl IN itemsloo.subtitle %][% subtitl.subfield|html %][% END %] [% IF ( itemsloo.author ) %]by [% itemsloo.author %] + [% ELSE %]  [% END %] Publication: @@ -350,26 +398,25 @@ $(function() {
[% IF ( pagination_bar ) %]
[% pagination_bar %]
[% END %] [% ELSE %] -
This List is empty. You can add to your lists from the results of any search!
+
This List is empty. [% IF ( opacuserlogin ) %]You can add to your lists from the results of any search![% END %]
[% END %] [% END %] - [% IF ( manageshelf ) %] - - [% IF ( itemsloop ) %] + [% IF ( itemsloop && allowremovingitems ) %] + - - [% ELSE %] + + + [% ELSIF ( !itemsloop && manageshelf ) %]
- [% END %] - [% END %]
+ [% END %] [% IF ( edit ) %] @@ -390,11 +437,13 @@ $(function() {
  • + [% IF (OpacAllowPublicListCreation) %] + [% END %]
  • @@ -408,11 +457,13 @@ $(function() { [% UNLESS ( shelves ) %]

    Lists