diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt index 71ba2e7737..469141e61e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt @@ -12,6 +12,17 @@ $.tablesorter.addParser({ format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, type: 'text' }); +[% IF ( loggedinusername ) %]function enableCheckboxActions(){ + // Enable/disable controls if checkboxes are checked + var checkedBoxes = $(".checkboxed input:checkbox:checked"); + if ($(checkedBoxes).size()) { + $("#selections").html(_("With selected suggestions: ")); + $("#selections-toolbar .links a").removeClass("disabled"); + } else { + $("#selections").html(_("Select suggestions to: ")); + $("#selections-toolbar .links a").addClass("disabled"); + } +}[% END %] $(function() { $("#suggestt").tablesorter({ @@ -32,17 +43,29 @@ $.tablesorter.addParser({ [% END %] [% END %] } - }); - $("#CheckAll").click(function(){ - $(".checkboxed").checkCheckboxes(); - return false; - }); - $("#CheckNone").click(function(){ - $(".checkboxed").unCheckCheckboxes(); - return false; - }); + }); + [% IF ( loggedinusername ) %]$("span.clearall").html(""+_('Clear all')+"<\/a>"); + $("span.checkall").html(""+_('Select all')+"<\/a>"); + $("#CheckAll").click(function(){ + $(".checkboxed").checkCheckboxes(); + enableCheckboxActions(); + return false; + }); + $("#CheckNone").click(function(){ + $(".checkboxed").unCheckCheckboxes(); + enableCheckboxActions(); + return false; + }); + $(".cb").click(function(){ + enableCheckboxActions(); + }); + $("#removeitems").html(""+_("Delete")+"") + .click(function(){ + $("#myform").submit(); + return false; + });[% END %] }); - + function Check(f) { var _alertString=""; var alertString2; @@ -115,7 +138,7 @@ $.tablesorter.addParser({ [% END %] [% IF ( op_else ) %] -