[Koha-patches] [biblibre/3.2_community] Revised for biblibre/3.2_community: Reformat of suggestions management interface (Bug 3844)

Owen Leonard oleonard at myacpl.org
Wed Jan 20 22:21:17 CET 2010


Changes and fixes include:

- Moving filters forms into left-hand sidebar
- Making filter forms collapsed by default (click to show)
- Converting "check all" to text link to match similar controls on other pages
- Correcting case of tab labels
- Fixing display of custom reason field
- Converting radio buttons to drop-down for more compact display
- Table-sorter column exclusions
- Markup corrections
---
 .../prog/en/modules/suggestion/suggestion.tmpl     |  268 +++++++++++---------
 suggestion/suggestion.pl                           |    9 +-
 2 files changed, 150 insertions(+), 127 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl
index aad488a..35eeb10 100755
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl
@@ -1,7 +1,8 @@
-<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><title><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo;  
-<!-- TMPL_IF name="op_save" --><!-- TMPL_IF name="suttesionid" -->Edit purchase suggestion #<!-- TMPL_VAR name="suggestionid" --><!--TMPL_ELSE-->Enter a new purchase suggestion<!-- /TMPL_IF --><!--TMPL_ELSE-->Suggestions<!-- /TMPL_IF --></title>
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><title>Koha &rsaquo; Acquisitions  &rsaquo;
+<!-- TMPL_IF name="op_save" --><!-- TMPL_IF name="suttesionid" -->Edit purchase suggestion #<!-- TMPL_VAR name="suggestionid" --><!--TMPL_ELSE-->Enter a new purchase suggestion<!-- /TMPL_IF --><!--TMPL_ELSE-->Suggestions Management<!-- /TMPL_IF --></title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 <!--TMPL_IF Name="op_else"--> <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
 <script type="text/JavaScript">
 // <![CDATA[
 
@@ -18,7 +19,10 @@ $.tablesorter.addParser({
 *  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() {
     yuiToolbar();
     $('#suggestiontabs > ul').tabs({
@@ -32,40 +36,57 @@ $(document).ready(function() {
     $.tablesorter.defaults.widgets = ['zebra'];
 
 <!--TMPL_LOOP Name="suggestions"-->
+// functions for <!--TMPL_VAR Name="suggestiontype"--> interactions
     $("#<!--TMPL_VAR Name="suggestiontype"-->t").tablesorter({<!-- TMPL_IF EXPR="dateformat eq 'metric'" -->
     dateFormat: 'uk',<!-- /TMPL_IF -->
-    headers: {0:{sorter: false}, 1: { sorter: 'articles' },2:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}, 8:{sorter: false},9:{sorter: false},10:{sorter: false}}
+    headers: {0:{sorter: false}, 1: { sorter: 'articles' },5:{sorter: false},6:{sorter: false},7:{sorter: false}, 8:{sorter: false},9:{sorter: false},10:{sorter: false}}
     });
     $("#CheckAll<!--TMPL_VAR Name="suggestiontype"-->").click(function(){
-        $("#<!--TMPL_VAR Name="suggestiontype"-->t :checkbox").attr('checked', $("#CheckAll<!--TMPL_VAR Name="suggestiontype"-->").is(':checked'));
+		$("#<!--TMPL_VAR Name="suggestiontype"-->t").checkCheckboxes();
     });
-    $("div[id*=other_reason<!--TMPL_VAR Name="suggestiontype"-->]").hide();
+    $("#UncheckAll<!--TMPL_VAR Name="suggestiontype"-->").click(function(){
+		$("#<!--TMPL_VAR Name="suggestiontype"-->t").unCheckCheckboxes();
+	});
+	$("#other_reason<!--TMPL_VAR Name="suggestiontype"-->").hide();
     $("input[name*=other_reason<!--TMPL_VAR Name="suggestiontype"-->]").focus(function(){ $(this).val(""); });
-    $("select[name*=reason<!--TMPL_VAR Name="suggestiontype"-->]").change(function(){
-    if($(this).children("[selected]").val() == "other"){
-    displayOther($(this).attr("name").replace(/reason/,""),"other_reason<!--TMPL_VAR Name="suggestiontype"-->","select-reason<!--TMPL_VAR Name="suggestiontype"-->");
+    $("#reason<!--TMPL_VAR Name="suggestiontype"-->").change(function(){
+	    if($(this).val() == "other"){
+			$(this).hide();
+			$("#other_reason<!-- TMPL_VAR NAME="suggestiontype" -->").show();
     }
     });
+	$("#<!-- TMPL_VAR NAME="suggestiontype" -->delete").change(function(){
+		if(this.checked){
+			$("form[name='f<!-- TMPL_VAR NAME="suggestiontype" -->'] input[name=op]").attr("value","delete");
+		} else {
+			$("form[name='f<!-- TMPL_VAR NAME="suggestiontype" -->'] input[name=op]").attr("value","change");
+		}
+	});
+
 <!--/TMPL_LOOP-->
     $("a[href*=back]").click(function(){
     var sid = $(this).attr("href").replace(/#back/,"");
-    displayOther(sid,"select-reason","other_reason");
-    $("#reason"+sid).find("option[value='']").attr("selected","selected");
+	    $("#reason"+sid).show().find("option[value='']").attr("selected","selected");
+		$("#other_reason"+sid).hide();
+    });
+	$("h4.collapse a").click(function(){
+		$(this).parent().parent().find("ol").toggle();
     });
 }); 
 // ]]>
 </script>
 <style type="text/css">
-.overlay { top: 180px; left: 50%; position: absolute; margin-left: -100px; width: 200px; text-align: center; display: none; margin-top: -10px; background: #eeffd4; padding : .5em; color: #000; }
+h4.collapse a { font-size : 80%; text-decoration: none; } fieldset.brief ol { display : none; }
+.overlay { top: 180px; left: 50%; position: absolute; margin-left: -100px; width: 200px; text-align: center; display: none; margin-top: -10px; background: #eeffd4; padding: .5em; color: #000; }
 </style>
 <!--/TMPL_IF-->
 </head>
 <body>              
 <!-- TMPL_INCLUDE name="header.inc" -->
 <!-- TMPL_INCLUDE NAME="cat-search.inc" -->
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <!-- TMPL_IF name="op_save" --><!-- TMPL_IF name="suggestionid" -->Suggestion edit #<!-- TMPL_VAR name="suggestionid" --><!--TMPL_ELSE-->New purchase suggestion<!-- /TMPL_IF --><!--TMPL_ELSE-->Suggestions<!-- /TMPL_IF --> </div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <!-- TMPL_IF name="op_save" --> <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a> &rsaquo; <!-- TMPL_IF name="suggestionid" -->Suggestion edit #<!-- TMPL_VAR name="suggestionid" --><!--TMPL_ELSE-->New purchase suggestion<!-- /TMPL_IF --><!--TMPL_ELSE-->Suggestions Management<!-- /TMPL_IF --> </div>
 
-<div id="doc3" class="yui-t2">
+<!-- TMPL_IF name="op_save" --><div id="doc" class="yui-t7"><!-- TMPL_ELSE --><div id="doc3" class="yui-t2"><!-- /TMPL_IF -->
 <div id="bd">
     <div id="yui-main">
     <div class="yui-b">
@@ -78,15 +99,15 @@ $(document).ready(function() {
         <h1>Enter a new purchase suggestion</h1>
     <!--/TMPL_IF-->    
     <fieldset class="rows"> <legend>Bibliographic information</legend><ol>
-        <li><label for="title">Title:</label> <input type="text" id="title" name="title" size="50" maxlentgh="80" value="<!--TMPL_VAR Name="title"-->"/></li>
-        <li><label for="author">Author:</label> <input type="text" id="author" name="author" size="50" maxlength="80" value="<!--TMPL_VAR Name="author"-->"/></li>
-        <li><label for="copyrightdate">Copyright date:</label> <input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" value="<!--TMPL_VAR Name="copyrightdate"-->" /></li>
-        <li><label for="isbn">ISBN or ISSN or other standard number:</label> <input type="text" id="isbn" name="isbn" size="50" maxlength="80" value="<!--TMPL_VAR Name="isbn"-->"/></li>
-        <li><label for="publishercode">Publisher:</label ><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="<!--TMPL_VAR Name="publishercode"-->"/></li>
-        <li><label for="place">Publication Place:</label> <input type="text" id="place" name="place" size="50" maxlength="80" value="<!--TMPL_VAR Name="place"-->"/></li>
-        <li><label for="collectiontitle">Collection Title:</label> <input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="<!--TMPL_VAR Name="collectiontitle"-->"/></li>
-        <li><label for="itemtype">Document Type :</label>
-            <select name="itemtype" >
+        <li><label for="title">Title:</label><input type="text" id="title" name="title" size="50" maxlength="80" value="<!--TMPL_VAR Name="title"-->"/></li>
+        <li><label for="author">Author:</label><input type="text" id="author" name="author" size="50" maxlength="80" value="<!--TMPL_VAR Name="author"-->"/></li>
+        <li><label for="copyrightdate">Copyright date:</label><input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" value="<!--TMPL_VAR Name="copyrightdate"-->" /></li>
+        <li><label for="isbn">ISBN or ISSN or other standard number:</label><input type="text" id="isbn" name="isbn" size="50" maxlength="80" value="<!--TMPL_VAR Name="isbn"-->"/></li>
+        <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="<!--TMPL_VAR Name="publishercode"-->"/></li>
+        <li><label for="place">Publication Place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="<!--TMPL_VAR Name="place"-->"/></li>
+        <li><label for="collectiontitle">Collection Title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="<!--TMPL_VAR Name="collectiontitle"-->"/></li>
+        <li><label for="itemtype">Document Type:</label>
+            <select id="itemtype" name="itemtype" >
             <!--TMPL_LOOP Name="itemtypeloop"-->
                 <!--TMPL_IF Name="selected"--><option selected="selected" value="<!--TMPL_VAR Name="code" -->"><!--TMPL_ELSE--><option value="<!--TMPL_VAR Name="code" -->"><!--/TMPL_IF-->
                 <!-- TMPL_IF name="imageurl"--><img border="0" src="<!--TMPL_VAR Name="imageurl" -->" alt="<!--TMPL_VAR Name="description" -->" /><!-- /TMPL_IF -->
@@ -94,41 +115,40 @@ $(document).ready(function() {
             <!--/TMPL_LOOP-->
             </select>
         </li>
-        <li><label for="note">Notes:</label><textarea name="note" id="note" rows="5" cols="40" value="<!--TMPL_VAR Name="note"-->"></textarea></li>
+        <li><label for="note">Notes:</label><textarea name="note" id="note" rows="5" cols="40"><!--TMPL_VAR Name="note"--></textarea></li>
         </ol>
     </fieldset>
-    <fieldset class="rows"> <legend>Suggestion management</legend><ol>
-        <!--TMPL_IF Name="suggestionid"-->
-            <li><label for="status"> status :</label><select name="status"><option value="">No Status</option>
+    <fieldset class="rows"> <legend>Suggestion management</legend>
+       <ol>
+            <!--TMPL_IF Name="suggestionid"--><li><label for="status">Status:</label><select id="status" name="status"><option value="">No Status</option>
                 <!-- TMPL_LOOP name="status_loop" -->
                     <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="code" -->" selected="selected"><!-- TMPL_VAR name="desc" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="desc" --></option><!-- /TMPL_IF -->
                 <!-- /TMPL_LOOP -->
-            </select>
-        <!--/TMPL_IF-->
-        <table>
-            <thead><th>&nbsp;</th><th>date</th><th>by</th></thead>
+            </select></li><!--/TMPL_IF-->
+        <li><table>
+            <thead><tr><th>&nbsp;</th><th>Date</th><th>By</th></tr></thead>
             <tbody>
             <tr>
-                <td>Suggestion Creation </td>
-                <td><input type="text" id="suggesteddate" name="suggesteddate" size="10" maxlentgh="10" value="<!--TMPL_VAR Name="suggesteddate"-->"/></td>
-                <td><input type="hidden" id="suggestedby" name="suggestedby" value="<!--TMPL_VAR Name="suggestedby"-->"/><!-- TMPL_IF NAME="suggestedby_borrowernumber" --><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="suggestedby_borrowernumber" -->"><!--TMPL_VAR Name="suggestedby_surname"-->, <!-- TMPL_VAR NAME="suggestedby_firstname" --></a>  <!-- TMPL_VAR NAME="suggestedby_branchcode" --> (<!-- TMPL_VAR NAME="suggestedby_description" -->)<!-- /TMPL_IF -->
+                <th><label for="suggesteddate">Suggestion creation</label> </th>
+                <td><input type="text" id="suggesteddate" name="suggesteddate" size="10" maxlength="10" value="<!--TMPL_VAR Name="suggesteddate"-->"/></td>
+                <td><input type="hidden" id="suggestedby" name="suggestedby" value="<!--TMPL_VAR Name="suggestedby"-->"/><!--TMPL_VAR Name="suggestedbyinformation"-->
                 </td>
             </tr>
             <tr>
-                <td>Suggestion Management </td>
+                <th><label for="managedon">Suggestion management</label> </th>
                 <td><input type="text" id="managedon" name="manageddate" size="10" maxlength="10" value="<!--TMPL_VAR Name="manageddate"-->" /></td>
-                <td><input type="hidden" id="managedby" name="managedby" value="<!--TMPL_VAR Name="managedby"-->"/><!-- TMPL_IF NAME="managedby_borrowernumber" --><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="managedby_borrowernumber" -->"><!--TMPL_VAR Name="managedby_surname"-->, <!-- TMPL_VAR NAME="managedby_firstname" --></a> <!-- TMPL_VAR NAME="managedby_branchcode" --> (<!-- TMPL_VAR NAME="managedby_description" -->)<!-- /TMPL_IF --></td>
+                <td><input type="hidden" id="managedby" name="managedby" value="<!--TMPL_VAR Name="managedby"-->"/><!--TMPL_VAR Name="managedbyinformation"--></td>
             </tr>
             <tr>
-                <td>Suggestion Accepted </td>
+                <th><label for="accepteddate">Suggestion Accepted</label> </th>
                 <td><input type="text" id="accepteddate" name="accepteddate" size="10" maxlength="10" value="<!--TMPL_VAR Name="accepteddate"-->" /></td>
-                <td><input type="hidden" id="acceptedby" name="acceptedby" value="<!--TMPL_VAR Name="acceptedby"-->"/><!-- TMPL_IF NAME="acceptedby_borrowernumber" --><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="acceptedby_borrowernumber" -->"><!--TMPL_VAR Name="acceptedby_surname"-->, <!-- TMPL_VAR NAME="acceptedby_firstname" --></a> <!-- TMPL_VAR NAME="acceptedby_branchcode" --> (<!-- TMPL_VAR NAME="acceptedby_description" -->)<!-- /TMPL_IF --></td>
+                <td><input type="hidden" id="acceptedby" name="acceptedby" value="<!--TMPL_VAR Name="acceptedby"-->"/><!--TMPL_VAR Name="acceptedbyinformation"--></td>
             </tr>
             </tbody>
-        </table>
+        </table></li></ol>
     </fieldset>
     <fieldset class="rows"> <legend>Acquisition information</legend><ol>
-        <li><label for="branchcode">Branch:</label> 
+        <li><label for="branchcode">Branchcode:</label> 
             <select name="branchcode" id="branchcode">
                 <option value="">Any</option><!-- TMPL_LOOP name="branchloop" -->
                 <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_VAR name="branchname" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="branchname" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
@@ -139,9 +159,9 @@ $(document).ready(function() {
                 <option value="">Any</option><!-- TMPL_LOOP name="budgetsloop" -->
                 <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="budget_id" -->" selected="selected"><!-- TMPL_VAR name="budget_name" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="budget_id" -->"><!-- TMPL_VAR name="budget_name" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
             </select>
-    	</li>
+		</li></ol>
     </fieldset>
-    <fieldset class="action"><input type="hidden" name="op" value="<!--TMPL_VAR Name="op"-->" /><!--TMPL_IF Name="suggestionid"--><input type="submit" value="Save" /><a class="action" href="suggestion.pl?suggestionid=<!--TMPL_VAR Name="suggestionid"-->">Cancel</a><!--TMPL_ELSE--><input type="submit" value="Submit Your Suggestion" /><a class="action" href="add.pl">Cancel</a><!--/TMPL_IF-->
+    <fieldset class="action"><input type="hidden" name="op" value="<!--TMPL_VAR Name="op"-->" /><!--TMPL_IF Name="suggestionid"--><input type="submit" value="Save" /> <a class="cancel" href="suggestion.pl?suggestionid=<!--TMPL_VAR Name="suggestionid"-->">Cancel</a><!--TMPL_ELSE--><input type="submit" value="Submit Your Suggestion" /> <a class="cancel" href="suggestion.pl">Cancel</a><!--/TMPL_IF-->
     </fieldset>
     </form>
 <!-- /TMPL_IF -->
@@ -151,61 +171,9 @@ $(document).ready(function() {
     <ul class="toolbar">
     <li> <a id="newsuggestion" href="suggestion.pl?op=add">New purchase suggestion</a></li>
     </ul></div>
-<!--Filter block-->
-    <form name="suggestionfilter" action="suggestion.pl" method="get">
-<a onclick="javascript:if (document.getElementsByName('limits')[0].style.display=='none'){document.getElementsByName('limits')[0].style.display='block';} else {document.getElementsByName('limits')[0].style.display='none';}">Filters</a>
-                <div style="display:none;" name="limits">
-                <fieldset><legend> Bibliographic information : </legend>
-                    <label for="title"> Title :</label><input type="text" name="title" value="<!-- TMPL_VAR name="title"-->" />
-                    <label for="author"> Author :</label><input type="text" name="author" value="<!-- TMPL_VAR name="author"-->" />
-                    <label for="isbn"> ISBN :</label><input type="text" name="isbn" value="<!-- TMPL_VAR name="isbn"-->" /><br/>
-                    <label for="publishercode"> Publisher :</label><input type="text" name="publishercode" value="<!-- TMPL_VAR name="publishercode"-->" />
-                    <label for="publicationyear"> Publication year :</label><input type="text" name="publicationyear" value="<!-- TMPL_VAR name="publicationyear"-->" />
-                    <label for="collectiontitle"> Collection Title :</label><input type="text" name="collectiontitle" value="<!-- TMPL_VAR name="collectiontitle"-->" />
-                </fieldset>
-                <fieldset><legend> Suggestion information: </legend>
-                    <label for="status"> Status :</label><select name="status"><option value="">Any</option>
-<!-- TMPL_LOOP name="status_loop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="code" -->" selected="selected"><!-- TMPL_VAR name="desc" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="desc" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
-                                                          </select><br/>
-                    <label for="suggestedby"> Suggested By :</label><select name="suggestedby"><option value="">Any</option>
-<!-- TMPL_LOOP name="suggestedby_loop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="code" -->" selected="selected"><!-- TMPL_VAR name="desc" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="desc" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
-                                                                     </select>
-                    <label for="suggesteddate"> Suggested on :</label><!--TMPL_VAR Name="suggesteddate"--><br/>
-                    <label for="managedby"> Management user :</label><select name="suggestionmanagedby"><option value="">Any</option>
-<!-- TMPL_LOOP name="suggestionmanagedby_loop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="code" -->" selected="selected"><!-- TMPL_VAR name="desc" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="desc" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
-                                                                     </select>
-                    <label for="manageddate"> Management date :</label><!--TMPL_VAR Name="manageddate"--><br/>
-                    <label for="acceptedby"> Accepted by :</label><select name="suggestionacceptedby"><option value="">Any</option>
-<!-- TMPL_LOOP name="suggestionacceptedby_loop" --><!-- TMPL_IF NAME="selected" --> <option value="<!-- TMPL_VAR name="code" -->" selected="selected"><!-- TMPL_VAR name="desc" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="desc" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
-		                                      </select>
-                    <label for="accepteddate"> Accepted on:</label><!--TMPL_VAR Name="accepteddate"-->
-                </fieldset>
-                <fieldset ><legend> Acquistion information :</legend>
-                    <label for="bookfundid"> Book Fund :</label>
-                    <select name="bookfundid"><option value="">Any</option><!-- TMPL_LOOP name="bookfundsloop" -->
-                        <!-- TMPL_IF NAME="selected" --> <option value="<!-- TMPL_VAR name="bookfundid" -->" selected="selected"><!-- TMPL_VAR name="bookfundname" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="bookfundid" -->"><!-- TMPL_VAR name="bookfundname" --></option><!-- /TMPL_IF -->
-                        <!-- /TMPL_LOOP -->
-                    </select>
-                    <label for="branchcode"> For :</label>
-                    <select name="branchcode" id="branchcode">
-                        <option value="">Any</option><!-- TMPL_LOOP name="branchloop" -->
-                            <!-- TMPL_IF NAME="selected" --> <option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_VAR name="branchname" --></option><!-- TMPL_ELSE --> <option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="branchname" --></option><!-- /TMPL_IF -->
-                            <!-- /TMPL_LOOP -->
-                    </select>
-                </fieldset>
-                </div>
-                <label for="displayby">Organize By</label>
-                <select name="displayby" id="displayby">
-                    <option value="">No tabs</option>
-                    <option value="STATUS">Status</option>
-                    <option value="branchcode">Library</option>
-                    <option value="itemtype">Item Type</option>
-                    <option value="sort1">Sort1</option>
-                    <option value="managedby">Managed by</option>
-                    <option value="acceptedby">Accepted by</option>
-                </select><br/>
-                <input type="submit" value="Search" />
-            </form>
+
+<h1>Suggestions Management</h1>
+
 <!--TMPL_UNLESS Name="notabs"-->        
 <div id="sorting" class="overlay">Sorting...</div>
 <div id="loadingtab" class="overlay">Loading tab...</div>
@@ -223,16 +191,16 @@ $(document).ready(function() {
 <form name="f<!--TMPL_VAR Name="suggestiontype"-->" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#<!--TMPL_VAR Name="suggestiontype"-->">
 
 <!-- TMPL_IF NAME="suggestions_loop" -->
-    <table id="<!--TMPL_VAR Name="suggestiontype"-->t" >
+<p><a id="CheckAll<!--TMPL_VAR Name="suggestiontype"-->" href="#">Check All</a> | <a id="UncheckAll<!--TMPL_VAR Name="suggestiontype"-->" href="#">Uncheck All</a></p>
+    <table id="<!--TMPL_VAR Name="suggestiontype"-->t">
         <thead>
-            <th><input type="checkbox" id="CheckAll<!--TMPL_VAR Name="suggestiontype"-->" >Check <!--TMPL_IF Name="notabs"-->All <!--TMPL_ELSE-->tab <!--/TMPL_IF--></th>
+            <tr><th>&nbsp;</th>
             <th>Suggestion</th>
-	    <th>Note</th>
             <th>Suggested by /on</th>
             <th>Managed by /on</th>
             <th>For</th>
             <th>Budget</th>
-            <th>Status</th>
+            <th>Status</th></tr>
     </thead>
         <tbody>
             <!-- TMPL_LOOP NAME="suggestions_loop" -->
@@ -241,22 +209,21 @@ $(document).ready(function() {
                     <input type="checkbox" name="edit_field" value="<!--TMPL_VAR name="suggestionid" -->" />
                 </td>
                 <td>
-                    <a href="suggestion.pl?suggestionid=<!-- TMPL_VAR NAME="suggestionid" -->&op=edit" title="suggestion" >
+                    <a href="suggestion.pl?suggestionid=<!-- TMPL_VAR NAME="suggestionid" -->&amp;op=edit" title="suggestion" >
                         <!-- TMPL_VAR NAME="title" --><!-- TMPL_IF NAME="author" -->, by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF -->
                     </a>
                     <br />
                     <!-- TMPL_IF name="copyrightdate" -->&copy; <!-- TMPL_VAR name="copyrightdate" --> <!-- /TMPL_IF -->
                         <!-- TMPL_IF name="volumedesc" -->; Volume:<i><!-- TMPL_VAR name="volumedesc" --></i> <!-- /TMPL_IF -->
-                        <!-- TMPL_IF name="isbn" -->; ISBN :<i><!-- TMPL_VAR name="isbn" --></i> <!-- /TMPL_IF --><!-- TMPL_IF name="publishercode" -->; Published by <!-- TMPL_VAR name="publishercode" --> <!-- /TMPL_IF --><!-- TMPL_IF name="publicationyear" --> in <i><!-- TMPL_VAR name="publicationyear" --></i> <!-- /TMPL_IF --><!-- TMPL_IF name="place" --> in <i><!-- TMPL_VAR name="place" --></i> <!-- /TMPL_IF --><!-- TMPL_IF name="collectiontitle" -->;<!-- TMPL_VAR name="collectiontitle" --> <!-- /TMPL_IF --><!-- TMPL_IF name="itemtype" -->;<!-- TMPL_VAR name="itemtype" --> <!-- /TMPL_IF --><br /><!-- TMPL_IF name="note" --><!-- TMPL VAR NAME="note" --><!-- /TMPL_IF -->
+                        <!-- TMPL_IF name="isbn" -->; ISBN:<i><!-- TMPL_VAR name="isbn" --></i> <!-- /TMPL_IF --><!-- TMPL_IF name="publishercode" -->; Published by <!-- TMPL_VAR name="publishercode" --> <!-- /TMPL_IF --><!-- TMPL_IF name="publicationyear" --> in <i><!-- TMPL_VAR name="publicationyear" --></i> <!-- /TMPL_IF --><!-- TMPL_IF name="place" --> in <i><!-- TMPL_VAR name="place" --></i> <!-- /TMPL_IF --><!-- TMPL_IF name="collectiontitle" -->;<!-- TMPL_VAR name="collectiontitle" --> <!-- /TMPL_IF --><!-- TMPL_IF name="itemtype" -->;<!-- TMPL_VAR name="itemtype" --> <!-- /TMPL_IF --><br /><!-- TMPL_IF name="note" --><!-- TMPL VAR NAME="note" --><!-- /TMPL_IF -->
                 </td>
-		 <td><!-- TMPL_VAR NAME="note" --></td>
                 <td>
                     <!--TMPL_IF Name="emailsuggestedby"--><a href="mailto:<!-- TMPL_VAR name="emailsuggestedby" -->"><!--/TMPL_IF--><!-- TMPL_VAR name="surnamesuggestedby" --><!-- TMPL_IF name="firstnamesuggestedby" -->, <!-- TMPL_VAR name="firstnamesuggestedby" --><!-- /TMPL_IF --> <!--TMPL_IF Name="emailsuggestedby"--></a><!--/TMPL_IF-->
                     <!--TMPL_IF Name="suggesteddate"--><br/><!-- TMPL_VAR name="suggesteddate" --><!--/TMPL_IF-->
                 </td>
                 <td>
                     <!--TMPL_IF Name="emailmanagedby"--><a href="mailto:<!-- TMPL_VAR name="emailmanagedby" -->"><!--/TMPL_IF--><!-- TMPL_VAR name="surnamemanagedby" --><!-- TMPL_IF name="firstnamemanagedby" -->, <!-- TMPL_VAR name="firstnamemanagedby" --><!-- /TMPL_IF --> <!--TMPL_IF Name="emailmanagedby"--></a><!--/TMPL_IF-->
-                    <!--TMPL_IF Name="manageddate"--><br/><!-- TMPL_VAR name="manageddate" --><!--/TMPL_IF-->
+                    <!--TMPL_IF Name="manageddate"-->, <!-- TMPL_VAR name="manageddate" --><!--/TMPL_IF-->
                 </td>
                 <td>
                     <!-- TMPL_VAR name="branchcode" -->
@@ -271,29 +238,28 @@ $(document).ready(function() {
         <!-- /TMPL_LOOP --></tbody>
         </table>  <fieldset>
     <div id="select-reason<!-- TMPL_VAR NAME="suggestiontype" -->">
-    <label for="reason<!-- TMPL_VAR NAME="suggestiontype" -->">Choose a reason for all marked entries:</label>                 <select id="reason<!-- TMPL_VAR NAME="suggestiontype" -->" name="reason<!-- TMPL_VAR NAME="suggestiontype" -->">
+        <div id="status<!-- TMPL_VAR NAME="suggestiontype" -->">
+	<label for="STATUS<!-- TMPL_VAR NAME="suggestiontype" -->">Mark selected as: </label><select name="STATUS" id="STATUS<!-- TMPL_VAR NAME="suggestiontype" -->">
+	<option value=""> -- Choose a status --</option>
+	<option value="ACCEPTED">Accepted</option>
+	<option value="CHECKED">Checked</option>
+	<option value="REJECTED">Rejected</option>
+	</select>
+    <label for="reason<!-- TMPL_VAR NAME="suggestiontype" -->">with this reason:</label>                 <select id="reason<!-- TMPL_VAR NAME="suggestiontype" -->" name="reason<!-- TMPL_VAR NAME="suggestiontype" -->">
                     <option value=""> -- Choose a reason -- </option>
                         <!--TMPL_LOOP Name="reasonsloop"-->
                         <option value="<!--TMPL_VAR Name="lib" -->"><!--TMPL_VAR Name="lib" --></option>
                         <!--/TMPL_LOOP-->
                     <option value="other">Others...</option>
-                    </select>  
-    </div>
-        <div id="other_reason<!-- TMPL_VAR NAME="suggestiontype" -->">
-        <label for="other_reason<!-- TMPL_VAR NAME="suggestiontype" -->">Enter a reason for all marked entries:</label>
+                    </select>   <span id="other_reason<!-- TMPL_VAR NAME="suggestiontype" -->">
             <input type="text" size="31" id="select-other_reason<!-- TMPL_VAR NAME="suggestiontype" -->" name="other_reason<!-- TMPL_VAR NAME="suggestiontype" -->" value="please note your reason here..." /> <a href="#back<!-- TMPL_VAR NAME="suggestiontype" -->">Cancel</a>
+        </span> <strong style="padding: 0 1em;">OR:</strong> <label for="<!-- TMPL_VAR NAME="suggestiontype" -->delete">Delete selected</label> <input type="checkbox" name="op" id="<!-- TMPL_VAR NAME="suggestiontype" -->delete" />
         </div>
-        <div id="status<!-- TMPL_VAR NAME="suggestiontype" -->">
-        <input type="radio" name="STATUS" value="ACCEPTED">Accept
-        <input type="radio" name="STATUS" value="CHECKED">Check
-        <input type="radio" name="STATUS" value="REJECTED">Reject
-        </div>
-        <div id="action<!-- TMPL_VAR NAME="suggestiontype" -->">
-        <input type="checkbox" onclick="javascript:if (this.checked){document.f<!-- TMPL_VAR NAME="suggestiontype" -->.op.value='delete';}else{document.f<!-- TMPL_VAR NAME="suggestiontype" -->.op.value='change'}"/> Delete
         </div>
 
-    <input type="hidden" name="tabcode" value="<!-- TMPL_VAR NAME="suggestiontype" -->"/>
-    <input type="hidden" name="op" value="change"/>
+
+    <input type="hidden" name="tabcode" value="<!-- TMPL_VAR NAME="suggestiontype" -->" />
+    <input type="hidden" name="op" value="change" />
 </fieldset>
         <fieldset class="action">
     <input type="submit" value="Submit" /></fieldset>
@@ -303,8 +269,66 @@ $(document).ready(function() {
 <!-- /TMPL_IF -->
 </div>
 <!--/TMPL_LOOP-->
-    </div>
-    </div>
+<!-- /TMPL_IF -->
+</div>
+</div>
+
+      <!-- TMPL_UNLESS name="op_save" --> <div class="yui-b">
+<form name="suggestionfilter" action="suggestion.pl" method="get">
+<fieldset class="brief"><ol style="display:block;"><li><label for="displayby">Organize by: </label>
+                <select name="displayby" id="displayby" style="width:auto;">
+                    <option value="">No tabs</option>
+                    <option value="STATUS">Status</option>
+                    <option value="branchcode">Library</option>
+                    <option value="itemtype">Item Type</option>
+                    <option value="sort1">Sort1</option>
+                    <option value="managedby">Managed by</option>
+                    <option value="acceptedby">Accepted by</option>
+                </select> <input type="submit" value="Go" /></li></ol></fieldset>
+<h4>Filter by: <a style="font-size:80%;font-weight:normal;" href="/cgi-bin/koha/suggestion/suggestion.pl">[clear]</a></h4>
+                <div style="display:block;" id="limits">
+
+				<fieldset class="brief"><h4 class="collapse"><a href="#">Bibliographic information</a></h4>
+                   <ol> <li><label for="title"> Title:</label><input type="text" id="title" name="title" value="<!-- TMPL_VAR name="title"-->" /></li>
+                    <li><label for="author"> Author:</label><input type="text" id="author" name="author" value="<!-- TMPL_VAR name="author"-->" /></li>
+                    <li><label for="isbn"> ISBN:</label><input type="text" id="isbn"  name="isbn" value="<!-- TMPL_VAR name="isbn"-->" /></li>
+                    <li><label for="publishercode"> Publisher:</label><input type="text" id="publishercode" name="publishercode" value="<!-- TMPL_VAR name="publishercode"-->" /></li>
+                    <li><label for="publicationyear"> Publication year:</label><input type="text" id="publicationyear" name="publicationyear" value="<!-- TMPL_VAR name="publicationyear"-->" /></li>
+                    <li><label for="collectiontitle"> Collection Title:</label><input type="text" id="collectiontitle" name="collectiontitle" value="<!-- TMPL_VAR name="collectiontitle"-->" /></li><li><input type="submit" value="Go" /></li></ol>
+                </fieldset>
+				 <fieldset class="brief"><h4 class="collapse"><a href="#">Suggestion information</a></h4>
+                    <ol><li><label for="status"> Status:</label><select name="status" id="status"><option value="">Any</option>
+<!-- TMPL_LOOP name="status_loop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="code" -->" selected="selected"><!-- TMPL_VAR name="desc" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="desc" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
+                                                          </select></li>
+                    <li><label for="suggestedby"> Suggested By:</label><select id="suggestedby" name="suggestedby"><option value="">Any</option>
+<!-- TMPL_LOOP name="suggestedby_loop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="code" -->" selected="selected"><!-- TMPL_VAR name="desc" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="desc" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
+                                                                     </select></li>
+                    <li><label for="suggesteddate"> Suggested on:</label><!--TMPL_VAR Name="suggesteddate"--></li>
+                    <li><label for="suggestionmanagedby"> Managed by:</label><select id="suggestionmanagedby" name="suggestionmanagedby"><option value="">Any</option>
+<!-- TMPL_LOOP name="suggestionmanagedby_loop" --><!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="code" -->" selected="selected"><!-- TMPL_VAR name="desc" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="desc" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
+                                                                     </select></li>
+                    <li><label for="manageddate"> Management date:</label><!--TMPL_VAR Name="manageddate"--></li>
+                    <li><label for="suggestionacceptedby"> Accepted by:</label><select id="suggestionacceptedby" name="suggestionacceptedby"><option value="">Any</option>
+<!-- TMPL_LOOP name="suggestionacceptedby_loop" --><!-- TMPL_IF NAME="selected" --> <option value="<!-- TMPL_VAR name="code" -->" selected="selected"><!-- TMPL_VAR name="desc" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="desc" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
+		                                      </select></li>
+                    <li><label for="accepteddate"> Accepted on:</label><!--TMPL_VAR Name="accepteddate"--></li><li><input type="submit" value="Go" /></li></ol>
+                </fieldset>
 
+				<fieldset class="brief"><h4 class="collapse"><a href="#">Acquistion information</a></h4>
+                    <ol><li><label for="bookfundid"> Book fund:</label>
+                    <select name="bookfundid" id="bookfundid"><option value="">Any</option><!-- TMPL_LOOP name="bookfundsloop" -->
+                        <!-- TMPL_IF NAME="selected" --> <option value="<!-- TMPL_VAR name="bookfundid" -->" selected="selected"><!-- TMPL_VAR name="bookfundname" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="bookfundid" -->"><!-- TMPL_VAR name="bookfundname" --></option><!-- /TMPL_IF -->
+                        <!-- /TMPL_LOOP -->
+                    </select></li>
+                    <li><label for="branchcode"> For:</label>
+                    <select name="branchcode" id="branchcode">
+                        <option value="">Any</option><!-- TMPL_LOOP name="branchloop" -->
+                            <!-- TMPL_IF NAME="selected" --> <option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_VAR name="branchname" --></option><!-- TMPL_ELSE --> <option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="branchname" --></option><!-- /TMPL_IF -->
+                            <!-- /TMPL_LOOP -->
+                    </select></li><li><input type="submit" value="Go" /></li></ol>
+                </fieldset>
+    </div>
+            </form>
+        </div><!-- /TMPL_UNLESS -->
 </div>
-<!--TMPL_INCLUDE Name="intranet-bottom.inc"-->
+<!--TMPL_INCLUDE NAME="intranet-bottom.inc"-->
diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl
index 36bdcbc..9811cc8 100755
--- a/suggestion/suggestion.pl
+++ b/suggestion/suggestion.pl
@@ -50,7 +50,7 @@ sub Init{
 
 sub GetCriteriumDesc{
     my ($criteriumvalue,$displayby)=@_;
-    return ($criteriumvalue eq 'ASKED'?"pending":lc $criteriumvalue) if ($displayby =~/status/i);
+    return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))) if ($displayby =~/status/i);
     return (GetBranchName($criteriumvalue)) if ($displayby =~/branchcode/);
     return (GetSupportName($criteriumvalue)) if ($displayby =~/itemtype/);
     if ($displayby =~/managedby/||$displayby =~/acceptedby/){
@@ -163,7 +163,7 @@ if ($op=~/else/) {
         
         next if ($definedvalue && $$suggestion_ref{$displayby} ne $criteriumvalue);
         $$suggestion_ref{$displayby}=$criteriumvalue;
-        warn $$suggestion_ref{$displayby}."=$criteriumvalue; $displayby";
+#        warn $$suggestion_ref{$displayby}."=$criteriumvalue; $displayby";
     
         my $suggestions = &SearchSuggestion($suggestion_ref);
         foreach (@$suggestions){
@@ -180,7 +180,7 @@ if ($op=~/else/) {
                             "suggestiontypelabel"=>GetCriteriumDesc($criteriumvalue,$displayby)||"",
                             "suggestionscount"=>scalar(@$suggestions),             
                             'suggestions_loop'=>$suggestions,
-	                    'reasonsloop'     => $reasonsloop,
+                            'reasonsloop'     => $reasonsloop,
                             };
 
         delete $$suggestion_ref{$displayby} unless $definedvalue;
@@ -190,12 +190,11 @@ if ($op=~/else/) {
         "displayby"=> $displayby,
         "notabs"=> $displayby eq "",
         suggestions       => \@allsuggestions,
-    
     );
 }
 
 foreach my $element qw(managedby suggestedby){
-    $debug || warn $$suggestion_ref{$element};
+#    $debug || warn $$suggestion_ref{$element};
     if ($$suggestion_ref{$element}){
         my $member=GetMember(borrowernumber=>$$suggestion_ref{$element});
         $template->param(
-- 
1.6.3.3




More information about the Koha-patches mailing list