From 9cc74e265bffd29557d4a25b918e753571b844cc Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 23 Apr 2008 12:03:57 -0500 Subject: [PATCH] Revised suggestions management interface, allows setting of one reason for all suggestions in a particular category (pending/accepted/rejected). Signed-off-by: Joshua Ferraro --- .../en/modules/suggestion/acceptorreject.tmpl | 129 ++++++++++-------- 1 file changed, 70 insertions(+), 59 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorreject.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorreject.tmpl index e1a9c1db9b..f749034703 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorreject.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorreject.tmpl @@ -14,43 +14,42 @@ * displayOther. * This function display the select or an textaera to write a reason. */ - function displayOther(id,show,hide) { - $("#"+hide+id).hide(); - $("#"+show+id).show(); - } + function displayOther(id,show,hide) {$("#"+hide+id).hide(); $("#"+show+id).show(); } $(document).ready(function() { - $('#suggestiontabs > ul').tabs({ - select: function(ui) { - $("#loadingtab").show(); - }, - show: function(ui) { - $("#loadingtab").hide(); - } - }); - $("#acceptedt").tablesorter({ - headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}} - }); - $("#acceptedt").bind("sortStart",function() { - $("#sorting").show(); - }).bind("sortEnd",function() { - $("#sorting").hide(); - }); - $("#pendingt").tablesorter({ - headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}} - }); - $("#pendingt").bind("sortStart",function() { - $("#sorting").show(); - }).bind("sortEnd",function() { - $("#sorting").hide(); - }); - $("#rejectedt").tablesorter({ - headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}} - }); - $("#rejectedt").bind("sortStart",function() { - $("#sorting").show(); - }).bind("sortEnd",function() { - $("#sorting").hide(); - }); + $('#suggestiontabs > ul').tabs({ + select: function(ui) { + $("#loadingtab").show(); + }, + show: function(ui) { + $("#loadingtab").hide(); + } + }); + $.tablesorter.defaults.widgets = ['zebra']; + $("#acceptedt").tablesorter({ + headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}} + }); + $("#acceptedt").bind("sortStart",function() { + $("#sorting").show(); + }).bind("sortEnd",function() { + $("#sorting").hide(); + }); + $("#pendingt").tablesorter({ + headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}} + }); + $("#pendingt").bind("sortStart",function() { + $("#sorting").show(); + }).bind("sortEnd",function() { + $("#sorting").hide(); + }); + $("#rejectedt").tablesorter({ + headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}} + }); + $("#rejectedt").bind("sortStart",function() { + $("#sorting").show(); + }).bind("sortEnd",function() { + $("#sorting").hide(); + }); + $("div[id*=other-reason]").hide(); $("input[name*=other-reason]").focus(function(){ $(this).val(""); }); $("select[name*=reason]").change(function(){ @@ -63,23 +62,34 @@ displayOther(sid,"select-reason","other-reason"); $("#reason"+sid).find("option[value='']").attr("selected","selected"); }); + $("a[href=#markall]").click(function(){ + if($(this).attr("id").indexOf("markallop") > -1){ + // select each identical option, clear each input + var selectedOp = $(this).prev().find("option:selected").val(); + var container = $(this).attr("id").replace(/markallop/,""); + $("#"+container+" div[id*=other-reason]").hide(); + $("#"+container+" div[id*=select-reason]").show(); + $("#"+container+" select[name*=reason]").not("select[name*=all]").children().each(function(){ + if($(this).val() == selectedOp){ $(this).attr("selected","selected"); } + }); + } else { + // set each input value, deselect options + var inputText = $(this).prev().val(); + var container = $(this).attr("id").replace(/markalltext/,""); + // hide all selects + $("#"+container+" input[name*=other-reason]").not("input[name*=all]").each(function(){ + // show all text inputs and populate + $(this).val(inputText).parent("div").show(); + $("div[class=select"+container+"]").hide(); + }); + + } + }); }); // ]]> - @@ -106,9 +116,9 @@
"> -
" method="post" action="/cgi-bin/koha/suggestion/acceptorreject.pl"> +" method="post" action="/cgi-bin/koha/suggestion/acceptorreject.pl#"> - " > + " /> @@ -152,11 +162,12 @@ + " value="" /> -
"> +
" class="select"> No reasons defined in authorised values
"> - " value="please note your reason here..." /> + " value="please note your reason here..." />

">back to list

- " name="" type="radio" value="ACCEPTED" disabled="disabled" /> + " name="" type="radio" value="ACCEPTED" readonly="readonly" checked="checked" /> " name="" type="radio" value="ACCEPTED" /> @@ -181,7 +192,7 @@ - " name="" type="radio" value="REJECTED" disabled="disabled" /> + " name="" type="radio" value="REJECTED" readonly="readonly" checked="checked" /> " name="" type="radio" value="REJECTED" /> @@ -205,9 +216,9 @@
all"> - - all" name="other-reasonall" value="please note your reason here..." /> -
+ + all" name="other-reasonall" value="please note your reason here..." /> ">Mark all with this reason all">Cancel +
-- 2.39.5