Bug 10552: make several sysprefs available to the OPAC login page
[koha.git] / koha-tmpl / opac-tmpl / prog / en / modules / opac-suggestions.tt
index 3f3aa34..a17372f 100644 (file)
@@ -1,10 +1,12 @@
-[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog ›  
+[% USE Koha %]
+[% USE KohaAuthorisedValues %]
+[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog ›
 [% IF ( op_add ) %]Enter a new purchase suggestion[% END %]
 [% IF ( op_else ) %]Purchase Suggestions[% END %]
 [% INCLUDE 'doc-head-close.inc' %]
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
-<script type="text/JavaScript" language="JavaScript">
+<script type="text/javascript">
 //<![CDATA[
 $.tablesorter.addParser({
     id: 'articles', 
@@ -12,6 +14,17 @@ $.tablesorter.addParser({
     format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, 
     type: 'text' 
 });
+[% IF ( loggedinusername ) %]function enableCheckboxActions(){
+    // Enable/disable controls if checkboxes are checked
+    var checkedBoxes = $(".checkboxed input:checkbox:checked");
+    if ($(checkedBoxes).size()) {
+      $("#selections").html(_("With selected suggestions: "));
+      $("#selections-toolbar .links a").removeClass("disabled");
+    } else {
+      $("#selections").html(_("Select suggestions to: "));
+      $("#selections-toolbar .links a").addClass("disabled");
+    }
+}[% END %]
 
        $(function() {
                        $("#suggestt").tablesorter({
@@ -32,17 +45,31 @@ $.tablesorter.addParser({
                                        [% END %]
                                [% END %]
                                }
-                       }); 
-                       $("#CheckAll").click(function(){
-                       $(".checkboxed").checkCheckboxes();
-                       return false;
-                   });
-                   $("#CheckNone").click(function(){
-                       $(".checkboxed").unCheckCheckboxes();
-                       return false;
-                   }); 
+            });
+            [% IF ( loggedinusername ) %]$("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
+            $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
+            $("#CheckAll").click(function(){
+                $(".checkboxed").checkCheckboxes();
+                enableCheckboxActions();
+                return false;
+            });
+            $("#CheckNone").click(function(){
+                $(".checkboxed").unCheckCheckboxes();
+                enableCheckboxActions();
+                return false;
+            });
+            $(".cb").click(function(){
+              enableCheckboxActions();
+            });
+            $("#removeitems").html("<a href=\"#\" class=\"removeitems tag_hides disabled\">"+_("Delete")+"</a>")
+            .click(function(){
+              $("#myform").submit();
+              return false;
+            });
+            enableCheckboxActions();
+            [% END %]
        });
-               
+
       function Check(f) {
                var _alertString="";
                var alertString2;
@@ -75,30 +102,30 @@ $.tablesorter.addParser({
     <h1>Enter a new purchase suggestion</h1>
 
     <p>Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion</p>
-    <p>Only the title is required, but the more information you enter the easier it will be for the librarians to find title you're requesting. The "Notes" field can be used to provide any additional information.</p>
+    <p>Only the title is required, but the more information you enter the easier it will be for the librarians to find the title you're requesting. The "Notes" field can be used to provide any additional information.</p>
     <form action="/cgi-bin/koha/opac-suggestions.pl" method="post">
    <fieldset class="rows"> <ol>
-    <li><label class="required" for="title">Title:</label><input type="text" id="title" name="title" size="50" maxlength="80" /></li>
+    <li><label class="required" for="title">Title:</label><input type="text" id="title" name="title" size="80" maxlength="255" /></li>
     <li><label for="author">Author:</label><input type="text" id="author" name="author" size="50" maxlength="80" /></li>
     <li><label for="copyrightdate">Copyright Date:</label><input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" /></li>
     <li><label for="isbn">Standard Number (ISBN, ISSN or Other):</label><input type="text" id="isbn" name="isbn" size="50" maxlength="80" /></li>
     <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" /></li>
-    <li><label for="collectiontitle">Collection Title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" /></li>
-    <li><label for="place">Publication Place:</label><input type="text" id="place" name="place" size="50" maxlength="80" /></li>
-    <li><label for="itemtype">Item Type:</label><select name="itemtype" id="itemtype">
+    <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" /></li>
+    <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" /></li>
+    <li><label for="itemtype">Item type:</label><select name="itemtype" id="itemtype">
             <option value="">Default</option>
         [% FOREACH itemtypeloo IN itemtypeloop %]
                        [% IF ( itemtypeloo.selected ) %]<option value="[% itemtypeloo.itemtype %]" selected="selected"> [% ELSE %]<option value="[% itemtypeloo.itemtype %]"> [% END %] [% itemtypeloo.description %]</option>
         [% END %]
         </select> </li>
-    [% IF ( branch_loop ) %]
-    <li><label for="branch">Branch:</label>
+    [% IF ( branchloop ) %]
+    <li><label for="branch">Library:</label>
         <select name="branch" id="branch">
-        [% FOREACH branch_loo IN branch_loop %]
-            [% IF ( branch_loo.selected ) %]
-            <option value="[% branch_loo.value %]" selected="selected">[% branch_loo.branchname %]</option>
+        [% FOREACH branchloo IN branchloop %]
+            [% IF ( branchloo.selected ) %]
+            <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
             [% ELSE %]
-            <option value="[% branch_loo.value %]">[% branch_loo.branchname %]</option>
+            <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
             [% END %]
         [% END %]
         </select>
@@ -115,7 +142,7 @@ $.tablesorter.addParser({
 [% END %]
 
 [% IF ( op_else ) %]
-    <h1>[% UNLESS ( OPACViewOthersSuggestions ) %][% IF ( loggedinusername ) %]My [% END %][% END %]Purchase Suggestions</h1>
+    <h1>[% IF ( OPACViewOthersSuggestions ) %]Purchase suggestions[% ELSE %][% IF ( loggedinusername ) %]My purchase suggestions[% ELSE %]Purchase suggestions[% END %][% END %]</h1>
 
     [% IF ( deleted ) %]<div class="dialog message">The selected suggestions have been deleted.</div>[% END %]
     [% IF ( submitted ) %]<div class="dialog message">Your suggestion has been submitted.</div>[% END %]
@@ -129,7 +156,7 @@ $.tablesorter.addParser({
                     Search for:
                 </th>
                 <td>
-                    <input type="text" name="title" value="[% title %]" />
+                    <input type="text" name="title" value="[% title |html %]" />
                 </td>
                 <th>
                 Suggested by:
@@ -146,17 +173,21 @@ $.tablesorter.addParser({
         </tr>
                </table>
             </form>[% END %]
-        <form action="/cgi-bin/koha/opac-suggestions.pl" method="post">
+        <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="myform">
             <input type="hidden" name="op" value="delete_confirm" />
-                       <div><span class="checkall"><a href="#" id="CheckAll">Select All</a></span>
-               <span class="clearall"><a href="#" id="CheckNone">Clear All</a></span> | [% IF ( loggedinusername ) %]<a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a>[% ELSE %][% IF ( AnonSuggestions ) %]<a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a>[% END %][% END %]
+            <div id="toolbar" class="list-actions">[% IF ( loggedinusername ) %]<a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a>[% ELSE %][% IF ( AnonSuggestions ) %]<a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a>[% END %][% END %]
 </div>
+          [% IF ( loggedinusername ) %]<div id="selections-toolbar" class="list-actions">
+                  <span class="checkall"></span> <span class="clearall"></span> <span class="sep">|</span>
+                  <span class="links"><span id="selections">Select suggestions to: </span>
+                  <span id="removeitems"></span>
+          </div>[% END %]
                        <table id="suggestt" class="checkboxed">
                        <thead><tr>
             [% IF ( loggedinusername ) %]<th>&nbsp;</th>[% END %]
             <th>Summary</th>
             <th>Note</th>
-            [% IF ( OPACViewOthersSuggestions ) %]<th>Suggested For</th>[% END %]
+            [% IF ( OPACViewOthersSuggestions ) %]<th>Suggested for</th>[% END %]
             <th>Managed by</th>
             <th>Status</th>
         </tr></thead>
@@ -164,7 +195,7 @@ $.tablesorter.addParser({
             [% IF ( suggestions_loo.even ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
 [% IF ( loggedinusername ) %]<td>
     [% IF ( suggestions_loo.showcheckbox ) %]
-                    <input type="checkbox" name="delete_field" value="[% suggestions_loo.suggestionid %]" />
+                    <input type="checkbox" class="cb" name="delete_field" value="[% suggestions_loo.suggestionid %]" />
     [% END %]
                 </td>[% END %]
                 <td>
@@ -187,19 +218,21 @@ $.tablesorter.addParser({
                                        [% IF ( suggestions_loo.surnamemanagedby ) %][% suggestions_loo.surnamemanagedby %][% IF ( suggestions_loo.firstnamemanagedby ) %],[% END %] [% suggestions_loo.firstnamemanagedby %][% ELSE %]&nbsp;[% END %]
                 </td>
                 <td>
-                    [% IF ( suggestions_loo.ASKED ) %]Requested[% END %]
-                    [% IF ( suggestions_loo.CHECKED ) %]Checked by the library[% END %]
-                    [% IF ( suggestions_loo.ACCEPTED ) %]Accepted by the library[% END %]
-                    [% IF ( suggestions_loo.ORDERED ) %]Ordered by the library[% END %]
-                    [% IF ( suggestions_loo.REJECTED ) %]Suggestion declined [% END %]
-                    [% IF ( suggestions_loo.AVAILABLE ) %]Available in the library[% END %]
+                    [% IF    ( suggestions_loo.ASKED ) %]Requested
+                    [% ELSIF ( suggestions_loo.CHECKED ) %]Checked by the library
+                    [% ELSIF ( suggestions_loo.ACCEPTED ) %]Accepted by the library
+                    [% ELSIF ( suggestions_loo.ORDERED ) %]Ordered by the library
+                    [% ELSIF ( suggestions_loo.REJECTED ) %]Suggestion declined
+                    [% ELSIF ( suggestions_loo.AVAILABLE ) %]Available in the library
+                    [% ELSE %] [% KohaAuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS, 1 ) %] [% END %]
+
                     [% IF ( suggestions_loo.reason ) %]([% suggestions_loo.reason %])[% END %]
                 </td>
             </tr>
         [% END %]
        </tbody>
     </table> [% IF ( loggedinusername ) %]<fieldset class="action">
-                <input type="submit" value="Delete Checked Items" />
+                <input type="submit" value="Delete selected" />
             </fieldset>
         [% END %]
         </form>
@@ -212,8 +245,7 @@ $.tablesorter.addParser({
 </div>
 <div class="yui-b">
 <div id="leftmenus" class="container">
-[% INCLUDE 'navigation.inc' %]
-[% INCLUDE 'usermenu.inc' %]
+[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
 </div>
 </div>
 </div>