Bug 9307 - Allow libraries to add/edit status for suggestion management.
[koha_fer] / koha-tmpl / intranet-tmpl / prog / en / modules / suggestion / suggestion.tt
index 47ee96a..c1f54e3 100644 (file)
@@ -1,21 +1,31 @@
-[% INCLUDE 'doc-head-open.inc' %]<title>Koha &rsaquo; Acquisitions  &rsaquo;
-[% IF ( op_save ) %][% IF ( suttesionid ) %]Edit purchase suggestion #[% suggestionid %][% ELSE %]Enter a new purchase suggestion[% END %][% ELSE %]Suggestions Management[% END %]</title>
+[% USE KohaAuthorisedValues %]
+[% USE KohaBranchName %]
+[% INCLUDE 'doc-head-open.inc' %]
+<title>Koha &rsaquo; Acquisitions  &rsaquo;
+    [% IF ( op_save ) %]
+        [% IF ( suggestionid) %]
+            [% IF ( op == 'show' ) %]
+                Show purchase suggestion #[% suggestionid %]
+            [% ELSE %]
+                Edit purchase suggestion #[% suggestionid %]
+            [% END %]
+        [% ELSE %]
+            Enter a new purchase suggestion
+        [% END %]
+    [% ELSE %]
+        Suggestions management
+    [% END %]
+</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'calendar.inc' %]
-[% IF ( op_else ) %] <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+[% IF ( op_else ) %]
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+[% INCLUDE 'datatables-strings.inc' %]
+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
 <script type="text/javascript">
 // <![CDATA[
-
-    function yuiToolbar() {
-        new YAHOO.widget.Button("newsuggestion");
-    }
-$.tablesorter.addParser({
-    id: 'articles',
-    is: function(s) {return false;  },
-    format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); },
-    type: 'text'
-});
 /**
 *  displayOther.
 *  This function display the select or an textaera to write a reason.
@@ -25,28 +35,33 @@ function displayOther(id,show,hide){
        $("#"+show+id).show();
 }
 $(document).ready(function() {
-    yuiToolbar();
-    $('#suggestiontabs > ul').tabs({
-        select: function(ui) {
-            $("#loadingtab").show();
-        },
-        show: function(ui) {
-            $("#loadingtab").hide();
+    $('#suggestiontabs').tabs({
+        // Correct table sizing for tables hidden in tabs
+        // http://www.datatables.net/examples/api/tabs_and_scrolling.html
+        "show": function(event, ui) {
+            var oTable = $('div.dataTables_wrapper>table', ui.panel).dataTable();
+            if ( oTable.length > 0 ) {
+                oTable.fnAdjustColumnSizing();
+            }
         }
-        });
-    $.tablesorter.defaults.widgets = ['zebra'];
-
+    });
+    $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "aoColumnDefs": [
+            { "aTargets": [ 0, -1, -2 ], "bSortable": false, "bSearchable": false },
+        ],
+        "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
+        "iDisplayLength": 20,
+        "sPaginationType": "four_button"
+    }));
 [% FOREACH suggestion IN suggestions %]
 // functions for [% suggestion.suggestiontype %] interactions
-    $("#[% suggestion.suggestiontype %]t").tablesorter({[% IF ( dateformat == 'metric' ) %]
-    dateFormat: 'uk',[% END %]
-    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[% suggestion.suggestiontype %]").click(function(){
+    $("#CheckAll[% suggestion.suggestiontype %]").click(function(e){
                $("#[% suggestion.suggestiontype %]t").checkCheckboxes();
+        e.preventDefault();
     });
-    $("#UncheckAll[% suggestion.suggestiontype %]").click(function(){
+    $("#UncheckAll[% suggestion.suggestiontype %]").click(function(e){
                $("#[% suggestion.suggestiontype %]t").unCheckCheckboxes();
+        e.preventDefault();
        });
        $("#other_reason[% suggestion.suggestiontype %]").hide();
     $("input[name*=other_reason[% suggestion.suggestiontype %]]").focus(function(){ $(this).val(""); });
@@ -70,15 +85,56 @@ $(document).ready(function() {
            $("#reason"+sid).show().find("option[value='']").attr("selected","selected");
                $("#other_reason"+sid).hide();
     });
-       $("h4.collapse a").click(function(){
-               $(this).parent().parent().find("ol").toggle();
+    $("h4.local_collapse a").click(function(){
+        $(this).parent().parent().find("ol").toggle();
+        return false;
+    });
+    // http://jqueryui.com/demos/datepicker/#date-range
+    var dates = $( "#suggesteddate_from, #suggesteddate_to" ).datepicker({
+        changeMonth: true,
+        numberOfMonths: 1,
+        onSelect: function( selectedDate ) {
+            var option = this.id == "suggesteddate_from" ? "minDate" : "maxDate",
+                instance = $( this ).data( "datepicker" );
+                date = $.datepicker.parseDate(
+                    instance.settings.dateFormat ||
+                    $.datepicker._defaults.dateFormat,
+                    selectedDate, instance.settings );
+            dates.not( this ).datepicker( "option", option, date );
+        }
+    });
+    var datesMD = $( "#manageddate_from, #manageddate_to" ).datepicker({
+        changeMonth: true,
+        numberOfMonths: 1,
+        onSelect: function( selectedDate ) {
+            var option = this.id == "manageddate_from" ? "minDate" : "maxDate",
+                instance = $( this ).data( "datepicker" );
+                date = $.datepicker.parseDate(
+                    instance.settings.dateFormat ||
+                    $.datepicker._defaults.dateFormat,
+                    selectedDate, instance.settings );
+            datesMD.not( this ).datepicker( "option", option, date );
+        }
+    });
+    var datesAD = $( "#accepteddate_from, #accepteddate_to" ).datepicker({
+        changeMonth: true,
+        numberOfMonths: 1,
+        onSelect: function( selectedDate ) {
+            var option = this.id == "accepteddate_from" ? "minDate" : "maxDate",
+                instance = $( this ).data( "datepicker" );
+                date = $.datepicker.parseDate(
+                    instance.settings.dateFormat ||
+                    $.datepicker._defaults.dateFormat,
+                    selectedDate, instance.settings );
+            datesAD.not( this ).datepicker( "option", option, date );
+        }
     });
 });
 // ]]>
 </script>
 <style type="text/css">
-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; } .note { -moz-border-radius: 3px; border-radius:3px; background: transparent url("/intranet-tmpl/prog/img/famfamfam/silk/comment.png") top left no-repeat; padding : 1px 3px 1px 18px; font-size : 90%; }
+h4.local_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; } .note { -moz-border-radius: 3px; border-radius:3px; background: transparent url("[% interface %]/[% theme %]/img/famfamfam/silk/comment.png") top left no-repeat; padding : 1px 3px 1px 18px; font-size : 90%; }
 </style>[% ELSE %]
 <script type="text/javascript">
 // <![CDATA[
@@ -88,10 +144,133 @@ $(document).ready(function() { calcNewsuggTotal(); });
 [% END %]
 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
 </head>
-<body>
+<body id="acq_suggestion" class="acq">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE '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; [% IF ( op_save ) %] <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a> &rsaquo; [% IF ( suggestionid ) %]Suggestion edit #[% suggestionid %][% ELSE %]New purchase suggestion[% END %][% ELSE %]Suggestions Management[% END %] </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;
+    [% IF ( op_save ) %]
+        <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a> &rsaquo;
+        [% IF ( op == 'show' ) %]
+            Show suggestion #[% suggestionid %]
+        [% ELSE %]
+            Suggestion edit #[% suggestionid %]
+        [% END %]
+    [% ELSE %]
+        Suggestions management
+    [% END %]
+</div>
+
+[% IF ( op == 'show' ) %]
+<div id="doc" class="yui-t7"> <!-- <div id="doc3" class="yui-t2"> -->
+<div id="bd">
+    <div id="yui-main">
+    <div class="yui-b">
+
+    <fieldset class="rows">
+      <legend>Bibliographic information</legend>
+      <ol>
+        <li><span class="label">Title:</span>[% title |html %]</li>
+        <li><span class="label">Author:</span>[% author %]</li>
+        <li><span class="label">Copyright date:</span>[% copyrightdate %]</li>
+        <li><span class="label">ISBN or ISSN or other standard number:</span>[% isbn %]</li>
+        <li><span class="label">Publisher:</span>[% publishercode %]</li>
+        <li><span class="label">Publication place:</span>[% place %]</li>
+        <li><span class="label">Collection title:</span>[% collectiontitle %]</li>
+        <li><span class="label">Document type:</span>
+            [% FOREACH itemtypeloo IN itemtypeloop %]
+                [% IF ( itemtypeloo.selected ) %][% itemtypeloo.description %][% END %]
+            [% END %]
+        </li>
+        [% IF ( patron_reason_loop ) %]
+          <li><span class="label">Reason for suggestion: </span>
+            [% FOREACH patron_reason_loo IN patron_reason_loop %]
+              [% IF ( patron_reason_loo.selected ) %][% patron_reason_loo.lib %][% END %]
+            [% END %]
+          </li>
+        [% END %]
+        <li><span class="label">Notes:</span>[% note %]</li>
+      </ol>
+    </fieldset>
+    <fieldset class="rows"> <legend>Suggestion management</legend>
+      <ol>
+        <li>
+          <span class="label">Status:</span>
+          [% SET status_found = 0 %]
+          [% IF ( STATUS == 'ASKED' ) %]
+              Pending
+              [% SET status_found = 1 %]
+          [% ELSIF ( STATUS == 'ACCEPTED' ) %]
+              Accepted
+              [% SET status_found = 1 %]
+          [% ELSIF ( STATUS == 'CHECKED' ) %]
+              Checked
+              [% SET status_found = 1 %]
+          [% ELSIF ( STATUS == 'REJECTED' ) %]
+              Rejected
+              [% SET status_found = 1 %]
+          [% ELSE %]
+              [% FOREACH s IN SuggestionStatuses %]
+                  [% IF STATUS == s.authorised_value %]
+                      [% s.lib %]
+                      [% SET status_found = 1 %]
+                  [% END %]
+              [% END %]
+          [% END %]
+
+        </li>
+        <li>
+          <table>
+            <thead><tr><th>&nbsp;</th><th>Date</th><th>By</th></tr></thead>
+            <tbody>
+            <tr>
+                <th><span class="label">Suggestion creation</span> </th>
+                <td>[% suggesteddate %]</td>
+                <td>[% IF ( suggestedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestedby_borrowernumber %]">[% suggestedby_surname %], [% suggestedby_firstname %]</a>  [% suggestedby_branchcode | $KohaBranchName %] ([% suggestedby_description %])[% END %]
+                </td>
+            </tr>
+            <tr>
+                <th><span class="label">Suggestion management</span> </th>
+                <td>[% manageddate %]</td>
+                <td>[% IF ( managedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% managedby_borrowernumber %]">[% managedby_surname %], [% managedby_firstname %]</a> [% managedby_branchcode | $KohaBranchName %] ([% managedby_description %])[% END %]</td>
+            </tr>
+            <tr>
+                <th><span class="label">Suggestion accepted</span> </th>
+                <td>[% accepteddate %]</td>
+                <td>[% IF ( acceptedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_borrowernumber %]">[% acceptedby_surname %], [% acceptedby_firstname %]</a> [% acceptedby_branchcode | $KohaBranchName %] ([% acceptedby_description %])[% END %]</td>
+            </tr>
+            </tbody>
+        </table></li></ol>
+    </fieldset>
+    <fieldset class="rows"> <legend>Acquisition information</legend>
+      <ol>
+        <li>
+          <span class="label">Library:</span> [% branchname %]
+        </li>
+        <li>
+          <span class="label">Fund:</span> [% budgetname %]
+        </li>
+        <li>
+          <span class="label">Copies:</span>[% quantity %]
+        </li>
+        <li>
+          <span class="label">Currency:</span>[% currency %]
+        </li>
+        <li>
+          <span class="label">Price:</span>[% price %]
+        </li>
+        <li>
+          <span class="label">Total</span>[% total %]
+        </li>
+      </ol>
+    </fieldset>
+
+    <a class="cancel" href="suggestion.pl">&lt;&lt;Back to the list</a>
+
+    </div>
+    </div>
+</div>
+[% ELSE %]
 
 [% IF ( op_save ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
 <div id="bd">
@@ -106,14 +285,14 @@ $(document).ready(function() { calcNewsuggTotal(); });
         <h1>Enter a new purchase suggestion</h1>
     [% END %]
     <fieldset class="rows"> <legend>Bibliographic information</legend><ol>
-        <li><label for="title">Title:</label><input type="text" id="title" name="title" size="50" maxlength="80" value="[% title |html %]"/></li>
+        <li><label for="title">Title:</label><input type="text" id="title" name="title" size="80" maxlength="255" value="[% title |html %]"/></li>
         <li><label for="author">Author:</label><input type="text" id="author" name="author" size="50" maxlength="80" value="[% author %]"/></li>
         <li><label for="copyrightdate">Copyright date:</label><input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" value="[% 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="[% isbn %]"/></li>
         <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode %]"/></li>
-        <li><label for="place">Publication Place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place %]"/></li>
-        <li><label for="collectiontitle">Collection Title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle %]"/></li>
-        <li><label for="itemtype">Document Type:</label>
+        <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place %]"/></li>
+        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle %]"/></li>
+        <li><label for="itemtype">Document type:</label>
             <select id="itemtype" name="itemtype" >
             [% FOREACH itemtypeloo IN itemtypeloop %]
                 [% IF ( itemtypeloo.selected ) %]<option selected="selected" value="[% itemtypeloo.itemtype %]">[% ELSE %]<option value="[% itemtypeloo.itemtype %]">[% END %]
@@ -129,34 +308,64 @@ $(document).ready(function() { calcNewsuggTotal(); });
     </fieldset>
     <fieldset class="rows"> <legend>Suggestion management</legend>
        <ol>
-            [% IF ( suggestionid ) %]<li><label for="status">Status:</label><select id="STATUS" name="STATUS"><option value="">No Status</option>
-                [% IF (statusselected_ASKED ) %]<option value="ASKED" selected="selected">Pending</option> 
-                [% ELSE %]<option value="ASKED">Pending</option>[% END %]
-                [% IF (statusselected_ACCEPTED ) %]<option value="ACCEPTED" selected="selected">Accepted</option>
-                [% ELSE %]<option value="ACCEPTED">Accepted</option>[% END %]
-                [% IF (statusselected_CHECKED ) %]<option value="CHECKED" selected="selected">Checked</option>
-                [% ELSE %]<option value="CHECKED">Checked</option>[% END %]
-                [% IF ( statusselected_REJECTED ) %]<option value="REJECTED" selected="selected">Rejected</option>
-                [% ELSE %]<option value="REJECTED">Rejected</option>[% END %]
-            </select></li>[% END %]
+            [% IF ( suggestionid ) %]
+                <li>
+                    <label for="status">Status:</label>
+                    <select id="STATUS" name="STATUS">
+                        <option value="">No Status</option>
+
+                        [% IF (statusselected_ASKED ) %]
+                            <option value="ASKED" selected="selected">Pending</option>
+                        [% ELSE %]
+                            <option value="ASKED">Pending</option>
+                        [% END %]
+
+                        [% IF (statusselected_ACCEPTED ) %]
+                            <option value="ACCEPTED" selected="selected">Accepted</option>
+                        [% ELSE %]
+                            <option value="ACCEPTED">Accepted</option>
+                        [% END %]
+
+                        [% IF (statusselected_CHECKED ) %]
+                            <option value="CHECKED" selected="selected">Checked</option>
+                        [% ELSE %]
+                            <option value="CHECKED">Checked</option>
+                        [% END %]
+
+                        [% IF ( statusselected_REJECTED ) %]
+                            <option value="REJECTED" selected="selected">Rejected</option>
+                        [% ELSE %]
+                            <option value="REJECTED">Rejected</option>
+                        [% END %]
+
+                        [% FOREACH s IN SuggestionStatuses %]
+                            [% IF s.authorised_value == selected_status %]
+                                <option value="[% s.authorised_value %]" selected="selected">[% s.lib %]</option>
+                            [% ELSE %]
+                                <option value="[% s.authorised_value %]">[% s.lib %]</option>
+                            [% END %]
+                        [% END %]
+                    </select>
+                </li>
+            [% END %]
         <li><table>
             <thead><tr><th>&nbsp;</th><th>Date</th><th>By</th></tr></thead>
             <tbody>
             <tr>
                 <th><label for="suggesteddate">Suggestion creation</label> </th>
                 <td><input type="text" id="suggesteddate" name="suggesteddate" size="10" maxlength="10" value="[% suggesteddate %]"/></td>
-                <td><input type="hidden" id="suggestedby" name="suggestedby" value="[% suggestedby %]"/>[% IF ( suggestedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestedby_borrowernumber %]">[% suggestedby_surname %], [% suggestedby_firstname %]</a>  [% suggestedby_branchcode %] ([% suggestedby_description %])[% END %]
+                <td><input type="hidden" id="suggestedby" name="suggestedby" value="[% suggestedby %]"/>[% IF ( suggestedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestedby_borrowernumber %]">[% suggestedby_surname %], [% suggestedby_firstname %]</a>  [% suggestedby_branchcode | $KohaBranchName %] ([% suggestedby_description %])[% END %]
                 </td>
             </tr>
             <tr>
                 <th><label for="managedon">Suggestion management</label> </th>
                 <td><input type="text" id="managedon" name="manageddate" size="10" maxlength="10" value="[% manageddate %]" /></td>
-                <td><input type="hidden" id="managedby" name="managedby" value="[% managedby %]"/>[% IF ( managedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% managedby_borrowernumber %]">[% managedby_surname %], [% managedby_firstname %]</a> [% managedby_branchcode %] ([% managedby_description %])[% END %]</td>
+                <td><input type="hidden" id="managedby" name="managedby" value="[% managedby %]"/>[% IF ( managedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% managedby_borrowernumber %]">[% managedby_surname %], [% managedby_firstname %]</a> [% managedby_branchcode | $KohaBranchName %] ([% managedby_description %])[% END %]</td>
             </tr>
             <tr>
-                <th><label for="accepteddate">Suggestion Accepted</label> </th>
+                <th><label for="accepteddate">Suggestion accepted</label> </th>
                 <td><input type="text" id="accepteddate" name="accepteddate" size="10" maxlength="10" value="[% accepteddate %]" /></td>
-                <td><input type="hidden" id="acceptedby" name="acceptedby" value="[% acceptedby %]"/>[% IF ( acceptedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_borrowernumber %]">[% acceptedby_surname %], [% acceptedby_firstname %]</a> [% acceptedby_branchcode %] ([% acceptedby_description %])[% END %]</td>
+                <td><input type="hidden" id="acceptedby" name="acceptedby" value="[% acceptedby %]"/>[% IF ( acceptedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_borrowernumber %]">[% acceptedby_surname %], [% acceptedby_firstname %]</a> [% acceptedby_branchcode | $KohaBranchName %] ([% acceptedby_description %])[% END %]</td>
             </tr>
             </tbody>
         </table></li></ol>
@@ -164,11 +373,11 @@ $(document).ready(function() { calcNewsuggTotal(); });
     <fieldset class="rows"> <legend>Acquisition information</legend><ol>
         <li><label for="branchcode">Library:</label>
             <select name="branchcode" id="branchcode">
-                <option value="">Any</option>[% FOREACH branchloo IN branchloop %]
+                <option value="__ANY__">Any</option>[% FOREACH branchloo IN branchloop %]
                 [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %][% END %]
             </select>
         </li>
-        <li><label for="budgetid">Budget:</label>
+        <li><label for="budgetid">Fund:</label>
             <select name="budgetid" id="budgetid">
                 <option value="">Any</option>[% FOREACH budgetsloo IN budgetsloop %]
                 [% IF ( budgetsloo.selected ) %]<option value="[% budgetsloo.budget_id %]" selected="selected">[% budgetsloo.budget_name %]</option>[% ELSE %]<option value="[% budgetsloo.budget_id %]">[% budgetsloo.budget_name %]</option>[% END %][% END %]
@@ -185,41 +394,52 @@ $(document).ready(function() { calcNewsuggTotal(); });
             </select>
                 </li><li><label for="price">Price:</label>
                        <input type="text" size="20" name="price" id="price" value="[% price %]" onchange="calcNewsuggTotal();" />
-                </li><li><label for="total">Total</label>
+                </li><li><label for="total">Total</label>
                        <input type="text" readonly="readonly" id="total" name="total" size="10" value="[% total %]"/>
                 </li></ol>
     </fieldset><input type="hidden" id="returnsuggested" name="returnsuggested" value="[% IF ( returnsuggestedby ) %][% returnsuggestedby %][% ELSE %]noone[% END %]"/>
-    <fieldset class="action"><input type="hidden" name="op" value="[% op %]" />[% IF ( suggestionid ) %]<input type="submit" value="Save" /> <a class="cancel" href="[% IF ( returnsuggestedby ) %]/cgi-bin/koha/members/moremember.pl?borrowernumber=[% returnsuggestedby %]#suggestions[% ELSE %]suggestion.pl?suggestionid=[% suggestionid %][% END %]">Cancel</a>[% ELSE %]<input type="submit" value="Submit Your Suggestion" /> <a class="cancel" href="suggestion.pl">Cancel</a>[% END %]
+    <fieldset class="action"><input type="hidden" name="op" value="[% op %]" />[% IF ( suggestionid ) %]<input type="submit" value="Save" /> <a class="cancel" href="[% IF ( returnsuggestedby ) %]/cgi-bin/koha/members/moremember.pl?borrowernumber=[% returnsuggestedby %]#suggestions[% ELSE %]suggestion.pl[% END %]">Cancel</a>[% ELSE %]<input type="submit" value="Submit Your Suggestion" /> <a class="cancel" href="suggestion.pl">Cancel</a>[% END %]
     </fieldset>
     </form>
 [% END %]
 
 [% IF ( op_else ) %]
-    <div id="toolbar">
-    <ul class="toolbar">
-    <li> <a id="newsuggestion" href="suggestion.pl?op=add">New purchase suggestion</a></li>
-    </ul></div>
+<div id="toolbar" class="btn-toolbar">
+    <a class="btn btn-small" id="newsuggestion" href="suggestion.pl?op=add"><i class="icon-plus"></i> New purchase suggestion</a>
+</div>
 
-<h1>Suggestions Management</h1>
+<h1>Suggestions management</h1>
 
 [% UNLESS ( notabs ) %]
-<div id="sorting" class="overlay">Sorting...</div>
-<div id="loadingtab" class="overlay">Loading tab...</div>
-<div id="suggestiontabs" class="toptabs">
-<ul class="ui-tabs-nav">
-[% FOREACH suggestion IN suggestions %]
-[% IF ( suggestion.first ) %]<li class="ui-tabs-selected">[% ELSE %]<li>[% END %]<a href="suggestion.pl#[% suggestion.suggestiontype %]">[% IF ( suggestion.suggestiontypelabel ) %]
-    [% IF (suggestion.suggestiontypelabel == "Pending") %]Pending
-    [% ELSIF (suggestion.suggestiontypelabel == "Accepted") %]Accepted
-    [% ELSIF (suggestion.suggestiontypelabel == "Checked") %]Checked
-    [% ELSIF (suggestion.suggestiontypelabel == "Rejected") %]Rejected
-    [% ELSIF (suggestion.suggestiontypelabel == "Available") %]Available
-    [% ELSIF (suggestion.suggestiontypelabel == "Ordered") %]Ordered[% ELSE %]
-    [% suggestion.suggestiontypelabel %][% END %]
-    [% ELSE %]No name[% END %] ([% suggestion.suggestionscount %])</a></li>
-[% END %]
+    <div id="suggestiontabs" class="toptabs">
+    <ul class="ui-tabs-nav">
+        [% FOREACH suggestion IN suggestions %]
+            [% IF ( suggestion.first ) %]
+                <li class="ui-tabs-selected">
+            [% ELSE %]
+                <li>
+            [% END %]
+
+            <a href="#[% suggestion.suggestiontype %]">
+            [% IF ( suggestion.suggestiontypelabel ) %]
+                [% IF (suggestion.suggestiontypelabel == "Pending") %]Pending
+                [% ELSIF (suggestion.suggestiontypelabel == "Accepted") %]Accepted
+                [% ELSIF (suggestion.suggestiontypelabel == "Checked") %]Checked
+                [% ELSIF (suggestion.suggestiontypelabel == "Rejected") %]Rejected
+                [% ELSIF (suggestion.suggestiontypelabel == "Available") %]Available
+                [% ELSIF (suggestion.suggestiontypelabel == "Ordered") %]Ordered
+                [% ELSE %][% suggestion.suggestiontypelabel %][% END %]
+            [% ELSE %]
+                [% IF ( suggestion.suggestiontype ) %]
+                    [% KohaAuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.suggestiontype ) %]
+                [% ELSE %]
+                    No name
+                [% END %]
+            [% END %]
+            ([% suggestion.suggestions_loop.size %])</a></li>
+
+        [% END %]
     </ul>
-    </div>
 [% END %]
 
 [% FOREACH suggestion IN suggestions %]
@@ -227,15 +447,15 @@ $(document).ready(function() { calcNewsuggTotal(); });
 <form name="f[% suggestion.suggestiontype %]" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype %]">
 
 [% IF ( suggestion.suggestions_loop ) %]
-<p><a id="CheckAll[% suggestion.suggestiontype %]" href="#">Check All</a> | <a id="UncheckAll[% suggestion.suggestiontype %]" href="#">Uncheck All</a></p>
-    <table id="[% suggestion.suggestiontype %]t">
+<p><a id="CheckAll[% suggestion.suggestiontype %]" href="#">Check all</a> | <a id="UncheckAll[% suggestion.suggestiontype %]" href="#">Uncheck all</a></p>
+    <table id="[% suggestion.suggestiontype %]t" class="sorted">
         <thead>
             <tr><th>&nbsp;</th>
             <th>Suggestion</th>
-            <th>Suggested by /on</th>
-            <th>Managed by /on</th>
+            <th>Suggested by on</th>
+            <th>Managed by on</th>
             <th>Library</th>
-            <th>Budget</th>
+            <th>Fund</th>
             <th>Status</th></tr>
     </thead>
         <tbody>
@@ -245,9 +465,9 @@ $(document).ready(function() { calcNewsuggTotal(); });
                     <input type="checkbox" name="edit_field" value="[% suggestions_loo.suggestionid %]" />
                 </td>
                 <td>
-                    <a href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid %]&amp;op=edit" title="suggestion" >
-                        [% suggestions_loo.title |html %][% IF ( suggestions_loo.author ) %], by [% suggestions_loo.author %][% END %]
-                    </a>
+                    <a href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid %]&amp;op=show" title="suggestion" >
+                        [% suggestions_loo.title |html %][% IF ( suggestions_loo.author ) %], by [% suggestions_loo.author %][% END %]</a>
+                    [<a href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid %]&amp;op=edit" title="suggestion" >edit</a>]
                     <br />
                     [% IF ( suggestions_loo.copyrightdate ) %]&copy; [% suggestions_loo.copyrightdate %] [% END %]
                         [% IF ( suggestions_loo.volumedesc ) %]; Volume:<i>[% suggestions_loo.volumedesc %]</i> [% END %]
@@ -255,48 +475,95 @@ $(document).ready(function() { calcNewsuggTotal(); });
                 </td>
                 <td>
                     [% IF ( suggestions_loo.emailsuggestedby ) %]<a href="mailto:[% suggestions_loo.emailsuggestedby %]">[% END %][% suggestions_loo.surnamesuggestedby %][% IF ( suggestions_loo.firstnamesuggestedby ) %], [% suggestions_loo.firstnamesuggestedby %][% END %] [% IF ( suggestions_loo.emailsuggestedby ) %]</a>[% END %]
-                    [% IF ( suggestions_loo.suggesteddate ) %] / [% suggestions_loo.suggesteddate %][% END %]
+                    [% IF ( suggestions_loo.suggesteddate ) %] - [% suggestions_loo.suggesteddate %][% END %]
                 </td>
                 <td>
                     [% IF ( suggestions_loo.emailmanagedby ) %]<a href="mailto:[% suggestions_loo.emailmanagedby %]">[% END %][% suggestions_loo.surnamemanagedby %][% IF ( suggestions_loo.firstnamemanagedby ) %], [% suggestions_loo.firstnamemanagedby %][% END %] [% IF ( suggestions_loo.emailmanagedby ) %]</a>[% END %]
-                    [% IF ( suggestions_loo.manageddate ) %], [% suggestions_loo.manageddate %][% END %]
+                    [% IF ( suggestions_loo.manageddate ) %] - [% suggestions_loo.manageddate %][% END %]
                 </td>
                 <td>
-                    [% suggestions_loo.branchcode %]
+                    [% suggestions_loo.branchcode | $KohaBranchName %]
                 </td>
                 <td>
                     [% suggestions_loo.budget_name %]
                 </td>
                 <td>
-                    [% IF ( suggestions_loo.ASKED ) %]Pending[% END %] [% IF ( suggestions_loo.ACCEPTED ) %]Accepted[% END %] [% IF ( suggestions_loo.ORDERED ) %]Ordered[% END %] [% IF ( suggestions_loo.REJECTED ) %]Rejected[% END %] [% IF ( suggestions_loo.CHECKED ) %]Checked[% END %] [% IF ( suggestions_loo.reason ) %]<br />([% suggestions_loo.reason %])[% END %]
+                    [% IF ( suggestions_loo.ASKED ) %]
+                        Pending
+                    [% ELSIF ( suggestions_loo.ACCEPTED ) %]
+                        Accepted
+                    [% ELSIF ( suggestions_loo.ORDERED ) %]
+                        Ordered
+                    [% ELSIF ( suggestions_loo.REJECTED ) %]
+                        Rejected
+                    [% ELSIF ( suggestions_loo.CHECKED ) %]
+                        Checked
+                    [% ELSIF KohaAuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS ) %]
+                        [% KohaAuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS ) %]
+                    [% END %]
+
+                    [% IF ( suggestions_loo.reason ) %]
+                        <br />([% suggestions_loo.reason %])
+                    [% END %]
                 </td>
         </tr>
         [% END %]</tbody>
         </table>  <fieldset>
     <div id="select-reason[% suggestion.suggestiontype %]">
         <div id="status[% suggestion.suggestiontype %]">
-       <label for="STATUS[% suggestion.suggestiontype %]">Mark selected as: </label><select name="STATUS" id="STATUS[% suggestion.suggestiontype %]">
-       <option value=""> -- Choose a status --</option>
-    [% IF (statusselected_ASKED ) %]<option value="ASKED" selected="selected">Pending</option> 
-    [% ELSE %]<option value="ASKED">Pending</option>[% END %]
-    [% IF (statusselected_ACCEPTED ) %]<option value="ACCEPTED" selected="selected">Accepted</option>
-    [% ELSE %]<option value="ACCEPTED">Accepted</option>[% END %]
-    [% IF (statusselected_CHECKED ) %]<option value="CHECKED" selected="selected">Checked</option>
-    [% ELSE %]<option value="CHECKED">Checked</option>[% END %]
-    [% IF ( statusselected_REJECTED ) %]<option value="REJECTED" selected="selected">Rejected</option>
-    [% ELSE %]<option value="REJECTED">Rejected</option>[% END %]
-       </select>
-    <label for="reason[% suggestion.suggestiontype %]">with this reason:</label>                 <select id="reason[% suggestion.suggestiontype %]" name="reason[% suggestion.suggestiontype %]">
-                    <option value=""> -- Choose a reason -- </option>
-                        [% FOREACH reasonsloo IN suggestion.reasonsloop %]
-                        <option value="[% reasonsloo.lib %]">[% reasonsloo.lib %]</option>
-                        [% END %]
-                    <option value="other">Others...</option>
-                    </select>   <span id="other_reason[% suggestion.suggestiontype %]">
-            <input type="text" size="31" id="select-other_reason[% suggestion.suggestiontype %]" name="other_reason[% suggestion.suggestiontype %]" value="please note your reason here..." /> <a href="#back[% suggestion.suggestiontype %]">Cancel</a>
-        </span> <strong style="padding: 0 1em;">OR:</strong> <label for="[% suggestion.suggestiontype %]delete">Delete selected</label> <input type="checkbox" name="op" id="[% suggestion.suggestiontype %]delete" />
-        </div>
+            <label for="STATUS[% suggestion.suggestiontype %]">Mark selected as: </label>
+            <select name="STATUS" id="STATUS[% suggestion.suggestiontype %]">
+                <option value=""> -- Choose a status --</option>
+
+                [% IF (statusselected_ASKED ) %]
+                    <option value="ASKED" selected="selected">Pending</option>
+                [% ELSE %]
+                    <option value="ASKED">Pending</option>
+                [% END %]
+
+                [% IF (statusselected_ACCEPTED ) %]
+                    <option value="ACCEPTED" selected="selected">Accepted</option>
+                [% ELSE %]
+                    <option value="ACCEPTED">Accepted</option>
+                [% END %]
+
+                [% IF (statusselected_CHECKED ) %]
+                    <option value="CHECKED" selected="selected">Checked</option>
+                [% ELSE %]
+                    <option value="CHECKED">Checked</option>
+                [% END %]
+
+                [% IF ( statusselected_REJECTED ) %]
+                    <option value="REJECTED" selected="selected">Rejected</option>
+                [% ELSE %]
+                    <option value="REJECTED">Rejected</option>
+                [% END %]
+
+                [% FOREACH s IN SuggestionStatuses %]
+                    <option value="[% s.authorised_value %]">[% s.lib %]</option>
+                [% END %]
+            </select>
+
+            <label for="reason[% suggestion.suggestiontype %]">with this reason:</label>
+            <select id="reason[% suggestion.suggestiontype %]" name="reason[% suggestion.suggestiontype %]">
+                <option value=""> -- Choose a reason -- </option>
+                [% FOREACH reasonsloo IN suggestion.reasonsloop %]
+                    <option value="[% reasonsloo.lib %]">[% reasonsloo.lib %]</option>
+                [% END %]
+                <option value="other">Others...</option>
+            </select>
+
+            <span id="other_reason[% suggestion.suggestiontype %]">
+                <input type="text" size="31" id="select-other_reason[% suggestion.suggestiontype %]" name="other_reason[% suggestion.suggestiontype %]" value="please note your reason here..." />
+                <a href="#back[% suggestion.suggestiontype %]">Cancel</a>
+            </span>
+
+            <strong style="padding: 0 1em;">OR:</strong>
+
+            <label for="[% suggestion.suggestiontype %]delete">Delete selected</label>
+            <input type="checkbox" name="op" id="[% suggestion.suggestiontype %]delete" />
         </div>
+    </div>
 
 
     <input type="hidden" name="tabcode" value="[% suggestion.suggestiontype %]" />
@@ -306,144 +573,120 @@ $(document).ready(function() { calcNewsuggTotal(); });
     <input type="submit" value="Submit" /></fieldset>
 </form>
 [% ELSE %]
-    <b>No Results.</b>
+    <b>No results.</b>
 [% END %]
 </div>
 [% END %]
+    </div>
 [% END %]
 </div>
 </div>
 
-      [% UNLESS ( op_save ) %] <div class="yui-b">
+      [% UNLESS ( op_save ) %] [% UNLESS ( op == 'show' ) %]<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="STATUS">Status</option>
                     <option value="branchcode">Library</option>
-                    <option value="itemtype">Item Type</option>
+                    <option value="itemtype">Item type</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>
+                               <fieldset class="brief"><h4 class="local_collapse"><a href="#">Bibliographic information</a></h4>
                    <ol> <li><label for="title"> Title:</label><input type="text" id="title" name="title" value="[% title |html %]" /></li>
                     <li><label for="author"> Author:</label><input type="text" id="author" name="author" value="[% author %]" /></li>
                     <li><label for="isbn"> ISBN:</label><input type="text" id="isbn"  name="isbn" value="[% isbn %]" /></li>
                     <li><label for="publishercode"> Publisher:</label><input type="text" id="publishercode" name="publishercode" value="[% publishercode %]" /></li>
-                    <li><label for="publicationyear"> Publication year:</label><input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear %]" /></li>
-                    <li><label for="collectiontitle"> Collection Title:</label><input type="text" id="collectiontitle" name="collectiontitle" value="[% collectiontitle %]" /></li><li><input type="submit" value="Go" /></li></ol>
+                    <li><label for="copyrightdate_filter"> Copyright date:</label><input type="text" id="copyrightdate_filter" name="copyrightdate" value="[% copyrightdate %]" /></li>
+                    <li><label for="collectiontitle"> Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" value="[% collectiontitle %]" /></li><li><input type="submit" value="Go" /></li></ol>
                 </fieldset>
-                                <fieldset class="brief"><h4 class="collapse"><a href="#">Suggestion information</a></h4>
+                                <fieldset class="brief"><h4 class="local_collapse"><a href="#">Suggestion information</a></h4>
                     <ol>
-                      <li><label for="status"> Status:</label><select name="STATUS" id="STATUS"><option value="">Any</option>
-                        [% IF (statusselected_ASKED ) %]<option value="ASKED" selected="selected">Pending</option> 
-                        [% ELSE %]<option value="ASKED">Pending</option>[% END %]
-                        [% IF (statusselected_ACCEPTED ) %]<option value="ACCEPTED" selected="selected">Accepted</option>
-                        [% ELSE %]<option value="ACCEPTED">Accepted</option>[% END %]
-                        [% IF (statusselected_CHECKED ) %]<option value="CHECKED" selected="selected">Checked</option>
-                        [% ELSE %]<option value="CHECKED">Checked</option>[% END %]
-                        [% IF ( statusselected_REJECTED ) %]<option value="REJECTED" selected="selected">Rejected</option>
-                        [% ELSE %]<option value="REJECTED">Rejected</option>[% END %]
-                      </select></li>
-                    <li><label for="suggestedby"> Suggested By:</label><select id="suggestedby" name="suggestedby"><option value="">Any</option>
+                      <li>
+                          <label for="STATUS"> Status:</label>
+                          <select name="STATUS" id="STATUS">
+                              <option value="">Any</option>
+
+                              [% IF (statusselected_ASKED ) %]
+                                  <option value="ASKED" selected="selected">Pending</option>
+                              [% ELSE %]
+                                  <option value="ASKED">Pending</option>
+                              [% END %]
+
+                              [% IF (statusselected_ACCEPTED ) %]
+                                  <option value="ACCEPTED" selected="selected">Accepted</option>
+                              [% ELSE %]
+                                  <option value="ACCEPTED">Accepted</option>
+                              [% END %]
+
+                              [% IF (statusselected_CHECKED ) %]
+                                  <option value="CHECKED" selected="selected">Checked</option>
+                              [% ELSE %]
+                                  <option value="CHECKED">Checked</option>
+                              [% END %]
+
+                              [% IF ( statusselected_REJECTED ) %]
+                                  <option value="REJECTED" selected="selected">Rejected</option>
+                              [% ELSE %]
+                                  <option value="REJECTED">Rejected</option>
+                              [% END %]
+
+                              [% FOREACH s IN SuggestionStatuses %]
+                                  [% IF s.authorised_value == selected_status %]
+                                      <option value="[% s.authorised_value %]" selected="selected">[% s.lib %]</option>
+                                  [% ELSE %]
+                                      <option value="[% s.authorised_value %]">[% s.lib %]</option>
+                                  [% END %]
+                              [% END %]
+                          </select>
+                      </li>
+
+                    <li><label for="suggestedby"> Suggested by:</label><select id="suggestedby" name="suggestedby"><option value="">Any</option>
 [% FOREACH suggestedby_loo IN suggestedby_loop %][% IF ( suggestedby_loo.selected ) %]<option value="[% suggestedby_loo.code %]" selected="selected">[% suggestedby_loo.desc %]</option>[% ELSE %]<option value="[% suggestedby_loo.code %]">[% suggestedby_loo.desc %]</option>[% END %][% END %]
                                                                      </select></li>
-                    <li><label for="suggesteddate_from"> Suggested on:</label>[% suggesteddate %]
+                    <li><label for="suggesteddate_from"> Suggested on:</label>
                         <table class="invis">
                         <tr>
-                        <td>from :</td><td><input type="text" id="suggesteddate_from" name="suggesteddate_from" style="width:80px;" /><img src="[% themelang %]/lib/calendar/cal.gif" id="suggesteddate_from_button" alt="Show Calendar" />
-                        <script language="JavaScript" type="text/javascript">
-                            Calendar.setup(
-                            {
-                                inputField : "suggesteddate_from",
-                                ifFormat : "[% DHTMLcalendar_dateformat %]",
-                                //ifFormat : "%Y-%m-%d", 
-                                button : "suggesteddate_from_button"
-                            });
-                        </script></td>
+                        <td><label for="suggesteddate_from">from:</label></td><td><input type="text" id="suggesteddate_from" name="suggesteddate_from" value="[% suggesteddate_from %]" style="width:76px;" /></td>
                         </tr>
                         <tr>
-                        <td>to :</td><td><input type="text" id="suggesteddate_to" name="suggesteddate_to" style="width:80px;" /><img src="[% themelang %]/lib/calendar/cal.gif" id="suggesteddate_to_button" alt="Show Calendar" />
-                        <script language="JavaScript" type="text/javascript">
-                            Calendar.setup(
-                            {
-                                inputField : "suggesteddate_to",
-                                ifFormat : "[% DHTMLcalendar_dateformat %]",
-                                //ifFormat : "%Y-%m-%d", 
-                                button : "suggesteddate_to_button"
-                            });
-                        </script></td>
+                        <td><label for="suggesteddate_to">to:</label></td><td><input type="text" id="suggesteddate_to" name="suggesteddate_to" value="[% suggesteddate_to %]" style="width:76px;" /></td>
                         </tr>
                         </table>
                     </li>
                     <li><label for="managedby"> Managed by:</label><select id="managedby" name="managedby"><option value="">Any</option>
 [% FOREACH managedby_loo IN managedby_loop %][% IF ( managedby_loo.selected ) %]<option value="[% managedby_loo.code %]" selected="selected">[% managedby_loo.desc %]</option>[% ELSE %]<option value="[% managedby_loo.code %]">[% managedby_loo.desc %]</option>[% END %][% END %]
                                                                      </select></li>
-                    <li><label for="manageddate_from"> Management date:</label>[% manageddate %]
+                    <li><label for="manageddate_from"> Management date:</label>
                         <table class="invis">
                         <tr>
-                        <td>from :</td><td><input type="text" id="manageddate_from" name="manageddate_from" style="width:80px;" /><img src="[% themelang %]/lib/calendar/cal.gif" id="manageddate_from_button" alt="Show Calendar" />
-                        <script language="JavaScript" type="text/javascript">
-                            Calendar.setup(
-                            {
-                                inputField : "manageddate_from",
-                                ifFormat : "[% DHTMLcalendar_dateformat %]",
-                                //ifFormat : "%Y-%m-%d", 
-                                button : "manageddate_from_button"
-                            });
-                        </script></td>
+                        <td><label for="manageddate_from">from:</label></td><td><input type="text" id="manageddate_from" name="manageddate_from" value="[% manageddate_from %]" style="width:76px;" /></td>
                         </tr>
                         <tr>
-                        <td>to :</td><td><input type="text" id="manageddate_to" name="manageddate_to" style="width:80px;" /><img src="[% themelang %]/lib/calendar/cal.gif" id="manageddate_to_button" alt="Show Calendar" />
-                        <script language="JavaScript" type="text/javascript">
-                            Calendar.setup(
-                            {
-                                inputField : "manageddate_to",
-                                ifFormat : "[% DHTMLcalendar_dateformat %]",
-                                //ifFormat : "%Y-%m-%d", 
-                                button : "manageddate_to_button"
-                            });
-                        </script></td>
+                        <td><label for="manageddate_to">to:</label></td><td><input type="text" id="manageddate_to" name="manageddate_to" value="[% manageddate_to %]" style="width:76px;" /></td>
                         </tr>
                         </table>
                     </li>
                     <li><label for="acceptedby"> Accepted by:</label><select id="acceptedby" name="acceptedby"><option value="">Any</option>
 [% FOREACH acceptedby_loo IN acceptedby_loop %][% IF ( acceptedby_loo.selected ) %] <option value="[% acceptedby_loo.code %]" selected="selected">[% acceptedby_loo.desc %]</option>[% ELSE %]<option value="[% acceptedby_loo.code %]">[% acceptedby_loo.desc %]</option>[% END %][% END %]
                                                      </select></li>
-                    <li><label for="accepteddate_from"> Accepted on:</label>[% accepteddate %]
+                    <li><label for="accepteddate_from"> Accepted on:</label>
                         <table class="invis">
                         <tr>
-                        <td>from :</td><td><input type="text" id="accepteddate_from" name="accepteddate_from" style="width:80px;" /><img src="[% themelang %]/lib/calendar/cal.gif" id="accepteddate_from_button" alt="Show Calendar" />
-                        <script language="JavaScript" type="text/javascript">
-                            Calendar.setup(
-                            {
-                                inputField : "accepteddate_from",
-                                ifFormat : "[% DHTMLcalendar_dateformat %]",
-                                //ifFormat : "%Y-%m-%d", 
-                                button : "accepteddate_from_button"
-                            });
-                        </script></td>
+                        <td><label for="accepteddate_from">from:</label></td><td><input type="text" id="accepteddate_from" name="accepteddate_from" value="[% accepteddate_from %]" style="width:76px;" /></td>
                         </tr>
                         <tr>
-                        <td>to :</td><td><input type="text" id="accepteddate_to" name="accepteddate_to" style="width:80px;" /><img src="[% themelang %]/lib/calendar/cal.gif" id="accepteddate_to_button" alt="Show Calendar" />
-                        <script language="JavaScript" type="text/javascript">
-                            Calendar.setup(
-                            {
-                                inputField : "accepteddate_to",
-                                ifFormat : "[% DHTMLcalendar_dateformat %]",
-                                //ifFormat : "%Y-%m-%d", 
-                                button : "accepteddate_to_button"
-                            });
-                        </script></td>
+                        <td><label for="accepteddate_to">to:</label></td><td><input type="text" id="accepteddate_to" name="accepteddate_to" value="[% accepteddate_to %]" style="width:76px;" /></td>
                         </tr>
                         </table>
                     </li>
                     <li><input type="submit" value="Go" /></li></ol>
                 </fieldset>
 
-                               <fieldset class="brief"><h4 class="collapse"><a href="#">Acquisition information</a></h4>
+                               <fieldset class="brief"><h4 class="local_collapse"><a href="#">Acquisition information</a></h4>
                     <ol><li><label for="budgetid"> Book fund:</label>
                     <select name="budgetid" id="budgetid"><option value="">Any</option>[% FOREACH budgetid_loo IN budgetid_loop %]
                         [% IF ( budgetid_loo.selected ) %] <option value="[% budgetid_loo.code %]" selected="selected">[% budgetid_loo.desc %]</option>[% ELSE %]<option value="[% budgetid_loo.code %]">[% budgetid_loo.desc %]</option>[% END %]
@@ -451,14 +694,17 @@ $(document).ready(function() { calcNewsuggTotal(); });
                     </select></li>
                     <li><label for="branchcode"> For:</label>
                     <select name="branchcode" id="branchcode">
-                        <option value="">Any</option>[% FOREACH branchloo IN branchloop %]
+                        <option value="__ANY__">Any</option>[% FOREACH branchloo IN branchloop %]
                             [% IF ( branchloo.selected ) %] <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %] <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
                             [% END %]
                     </select></li><li><input type="submit" value="Go" /></li></ol>
                 </fieldset>
     </div>
             </form>
-        </div>[% END %]
+        </div>
+    [% END %]
+    [% END %]
 </div>
+[% END %]
 [% INCLUDE 'intranet-bottom.inc' %]