@@ -, +, @@ --- .../prog/en/modules/circ/circulation.tmpl | 74 +++++++++----------- 1 files changed, 33 insertions(+), 41 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -73,18 +73,28 @@ var allcheckboxes = $(".checkboxed"); } ).attr( 'checked', false ); + // Clicking the table cell checks the checkbox inside it $("td").click(function(e){ if(e.target.tagName.toLowerCase() == 'td'){ - $(this).find("input:checkbox").each( function() { - $(this).attr('checked', !$(this).attr('checked')); - if($(this).attr('checked')){ - $(this).parent().siblings().find("input:checkbox").each(function(){ - if($(this).attr('checked')){ $(this).attr('checked',''); } - }); - } + $(this).find("input:checkbox:visible").each( function() { + if($(this).attr("checked")){ + $(this).attr("checked",''); + } else { + $(this).attr("checked","checked"); + radioCheckBox($(this)); + } }); - } + } }); + // prevent adjacent checkboxes from being checked simultaneously + function radioCheckBox(box){ + box.parents("td").siblings().find("input:checkbox:visible").each(function(){ + if($(this).attr("checked")){ + $(this).attr("checked",''); + } + }); + } + $("#messages ul").after(""+_("Add a new message")+""); $("#borrower_messages .cancel").click(function(){ $("#add_message_form").hide(); @@ -94,30 +104,12 @@ var allcheckboxes = $(".checkboxed"); $(this).hide(); $("#add_message_form").show(); }); + + $("input.radio").click(function(){ + radioCheckBox($(this)); + }); }); -function uncheck_sibling(me){ -nodename=me.getAttribute("name"); -if (nodename =="barcodes[]"){ - var Node=me.parentNode.previousSibling; - while (Node.nodeName!="TD"){Node=Node.previousSibling} - var Nodes=Node.childNodes; - for (var i=0;i " checked="checked" style="display: none;" /> - " checked="checked" /> + " checked="checked" /> - " /> + " /> @@ -724,7 +716,7 @@ No patron matched Checkin Failed - " onclick="uncheck_sibling(this);" /> + " /> " checked="checked" style="display: none;" /> @@ -760,17 +752,17 @@ No patron matched " checked="checked" style="display: none;" /> - " checked="checked" /> + " checked="checked" /> - " /> + " /> @@ -790,7 +782,7 @@ No patron matched Checkin Failed - " onclick="uncheck_sibling(this);" /> + " /> " checked="checked" style="display: none;" /> --