Bug 5928 :wr77152 : AllowPurchaseSuggestionBranchChoice sys pref
[koha_gimpoz] / koha-tmpl / opac-tmpl / prog / en / modules / opac-suggestions.tmpl
index 76101ab..6783bb3 100644 (file)
@@ -2,7 +2,8 @@
 <!-- TMPL_IF name="op_add" -->Enter a new purchase suggestion<!-- /TMPL_IF -->
 <!-- TMPL_IF name="op_else" -->Purchase Suggestions<!-- /TMPL_IF -->
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
-<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.pack.js"></script>
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
 <script type="text/JavaScript" language="JavaScript">
 //<![CDATA[
 $.tablesorter.addParser({
@@ -32,38 +33,93 @@ $.tablesorter.addParser({
                                <!-- /TMPL_IF -->
                                }
                        }); 
+                       $("#CheckAll").click(function(){
+                       $(".checkboxed").checkCheckboxes();
+                       return false;
+                   });
+                   $("#CheckNone").click(function(){
+                       $(".checkboxed").unCheckCheckboxes();
+                       return false;
+                   }); 
        });
+               
+      function Check(f) {
+               var _alertString="";
+               var alertString2;
+
+           if(f.title.value.length ==0){
+                       _alertString += _("- You must enter a Title") + "\n";
+               }
+
+               if (_alertString.length==0) {
+                       f.submit();
+               } else {
+                       alertString2 = _("Form not submitted because of the following problem(s)");
+                       alertString2 += "\n------------------------------------------------------------------------------------\n\n";
+                       alertString2 += _alertString;
+                       alert(alertString2);
+               }
+       }
 //]]>
 </script>
 </head>
-<body>
-<!-- TMPL_INCLUDE name="masthead.inc" -->
+<!-- TMPL_IF NAME="loggedinusername" --><body id="opac-usersuggestions"><!-- TMPL_ELSE --><body id="opac-suggestions"><!-- /TMPL_IF -->
 
 <div id="doc3" class="yui-t1">
    <div id="bd">
+<!-- TMPL_INCLUDE name="masthead.inc" -->
        <div id="yui-main">
        <div class="yui-b"><div class="yui-g">
-<div class="container">
+<div id="usersuggestions" class="container">
 <!-- TMPL_IF name="op_add" -->
     <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 purchase suggestion</p>
-    <p>No fields are mandatory. Enter whatever information you have. The "Notes" field can be used to provide any additional information.</p>
+    <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>
     <form action="/cgi-bin/koha/opac-suggestions.pl" method="post">
    <fieldset class="rows"> <ol>
-    <li><label for="title">Title:</label><input type="text" id="title" name="title" size="50" maxlentgh="80" /></li>
+    <li><label class="required" for="title">Title:</label><input type="text" id="title" name="title" size="50" maxlength="80" /></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="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">
+            <option value="">Default</option>
+        <!-- TMPL_LOOP name="itemtypeloop" -->
+                       <!-- TMPL_IF name="selected" --><option value="<!-- TMPL_VAR name="itemtype"-->" selected="selected"> <!--TMPL_ELSE--><option value="<!-- TMPL_VAR name="itemtype" -->"> <!--/TMPL_IF--> <!-- TMPL_VAR name="description" --></option>
+        <!-- /TMPL_LOOP -->
+        </select> </li>
+    <!-- TMPL_IF NAME="branch_loop" -->
+    <li><label for="branch">Branch:</label>
+        <select name="branch" id="branch"
+        <!-- TMPL_LOOP NAME="branch_loop" -->
+            <!-- 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>
+    <!-- /TMPL_IF -->
+    <!-- TMPL_IF NAME="patron_reason_loop" --><li><label for="patronreason">Reason for suggestion: </label><select name="patronreason" id="patronreason"><option value="">-- Choose --</option><!-- TMPL_LOOP NAME="patron_reason_loop" -->
+           <option value="<!-- TMPL_VAR NAME="authorised_value" -->"><!--TMPL_VAR NAME="lib" --></option>
+    <!-- /TMPL_LOOP --></select></li><!-- /TMPL_IF -->
     <li><label for="note">Notes:</label><textarea name="note" id="note" rows="5" cols="40"></textarea></li>
     </ol></fieldset>
-        <fieldset class="action"><input type="hidden" name="op" value="add_confirm" /><input type="submit" value="Submit Your Suggestion" /> <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a></fieldset>
+        <fieldset class="action"><input type="hidden" name="suggestedby" value="<!--TMPL_VAR Name="suggestedbyme"-->" /><input type="hidden" name="op" value="add_confirm" /><input type="submit" onclick="Check(this.form); return false;" value="Submit Your Suggestion" /> <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a></fieldset>
     </form>
 
 <!-- /TMPL_IF -->
 
 <!-- TMPL_IF name="op_else" -->
-    <h1><!-- TMPL_UNLESS NAME="OPACViewOthersSuggestions" -->My <!-- /TMPL_UNLESS -->Purchase Suggestions</h1>
+    <h1><!-- TMPL_UNLESS NAME="OPACViewOthersSuggestions" --><!-- TMPL_IF NAME="loggedinusername" -->My <!-- /TMPL_IF --><!-- /TMPL_UNLESS -->Purchase Suggestions</h1>
+
+    <!-- TMPL_IF NAME="deleted" --><div class="dialog message">The selected suggestions have been deleted.</div><!-- /TMPL_IF -->
+    <!-- TMPL_IF NAME="submitted" --><div class="dialog message">Your suggestion has been submitted.</div><!-- /TMPL_IF -->
+
     <!-- TMPL_IF NAME="suggestions_loop" -->
     <!-- TMPL_IF NAME="OPACViewOthersSuggestions" -->
        <form action="/cgi-bin/koha/opac-suggestions.pl" method="get">
@@ -79,7 +135,7 @@ $.tablesorter.addParser({
                 Suggested by:
                 </th>
                 <td>
-                    <select name="suggestedbyme">
+                    <select name="suggestedby">
                         <option value="0">Anyone</option>
                         <option value="1">Me</option>
                     </select>
@@ -92,38 +148,47 @@ $.tablesorter.addParser({
             </form><!-- /TMPL_IF -->
         <form action="/cgi-bin/koha/opac-suggestions.pl" method="post">
             <input type="hidden" name="op" value="delete_confirm" />
-                       <table id="suggestt">
+                       <div><span class="checkall"><a href="#" id="CheckAll">Select All</a></span>
+               <span class="clearall"><a href="#" id="CheckNone">Clear All</a></span> | <!-- TMPL_IF NAME="loggedinusername" --><a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a><!-- TMPL_ELSE --><!-- TMPL_IF NAME="AnonSuggestions" --><a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a><!-- /TMPL_IF --><!-- /TMPL_IF -->
+</div>
+                       <table id="suggestt" class="checkboxed">
                        <thead><tr>
             <!-- TMPL_IF NAME="loggedinusername" --><th>&nbsp;</th><!-- /TMPL_IF -->
             <th>Summary</th>
             <th>Note</th>
-            <!-- TMPL_IF NAME="OPACViewOthersSuggestions" --><th>Suggested by</th><!-- /TMPL_IF -->
+            <!-- TMPL_IF NAME="OPACViewOthersSuggestions" --><th>Suggested For</th><!-- /TMPL_IF -->
             <th>Managed by</th>
             <th>Status</th>
         </tr></thead>
         <tbody><!-- TMPL_LOOP NAME="suggestions_loop" -->
             <!-- TMPL_IF name="even" --><tr><!-- TMPL_ELSE --><tr class="highlight"><!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="loggedinusername" --><td>
+    <!-- TMPL_IF NAME="showcheckbox" -->
                     <input type="checkbox" name="delete_field" value="<!--TMPL_VAR name="suggestionid" -->" />
+    <!-- /TMPL_IF -->
                 </td><!-- /TMPL_IF -->
                 <td>
-                    <p><strong><!-- TMPL_VAR NAME="title" --></strong></p>
+                    <p><strong><!-- TMPL_VAR NAME="title" escape="html" --></strong></p>
                     <p><!-- TMPL_IF name="author" --><!-- TMPL_VAR NAME="author" -->,<!-- /TMPL_IF -->
                         <!-- TMPL_IF name="copyrightdate" --> - <!-- TMPL_VAR NAME="copyrightdate" -->,<!-- /TMPL_IF --> 
                         <!-- TMPL_IF name="publishercode" --> - <!-- TMPL_VAR name="publishercode" --><!-- /TMPL_IF -->
+                        <!-- TMPL_IF name="place" -->(<!-- TMPL_VAR name="place" -->)<!-- /TMPL_IF -->
+                        <!-- TMPL_IF name="collectiontitle" --> , <!-- TMPL_VAR name="collectiontitle" --><!-- /TMPL_IF -->
+                        <!-- TMPL_IF name="itemtype" --> - <!-- TMPL_VAR name="itemtype" --><!-- /TMPL_IF -->
                     </p>
                 </td>
                 <td>
                     <!-- TMPL_VAR name="note" -->
                 </td>
                 <!-- TMPL_IF NAME="OPACViewOthersSuggestions" --><td>
-                    <!-- TMPL_VAR name="surnamesuggestedby" --><!-- TMPL_IF name="firstnamesuggestedby" -->,<!-- /TMPL_IF --> <!-- TMPL_VAR name="firstnamesuggestedby" -->
+                    <!-- TMPL_IF NAME="branchcodesuggestedby" --><!-- TMPL_VAR name="branchcodesuggestedby" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF -->
                 </td><!-- /TMPL_IF -->
                 <td>
-                                       <!-- TMPL_VAR name="surnamemanagedby" --><!-- TMPL_IF name="firstnamemanagedby" -->,<!-- /TMPL_IF --> <!-- TMPL_VAR name="firstnamemanagedby" -->
+                                       <!-- TMPL_IF NAME="surnamemanagedby" --><!-- TMPL_VAR name="surnamemanagedby" --><!-- TMPL_IF name="firstnamemanagedby" -->,<!-- /TMPL_IF --> <!-- TMPL_VAR name="firstnamemanagedby" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF -->
                 </td>
                 <td>
                     <!-- TMPL_IF name="ASKED" -->Requested<!-- /TMPL_IF -->
+                    <!-- TMPL_IF name="CHECKED" -->Checked by the library<!-- /TMPL_IF -->
                     <!-- TMPL_IF name="ACCEPTED" -->Accepted by the library<!-- /TMPL_IF -->
                     <!-- TMPL_IF name="ORDERED" -->Ordered by the library<!-- /TMPL_IF -->
                     <!-- TMPL_IF name="REJECTED" -->Suggestion declined <!-- /TMPL_IF -->
@@ -138,16 +203,15 @@ $.tablesorter.addParser({
             </fieldset>
         <!-- /TMPL_IF -->
         </form>
-    <!-- TMPL_ELSE --><p>There are no pending purchase suggestions.</p><!-- /TMPL_IF -->
+    <!-- TMPL_ELSE --><p>There are no pending purchase suggestions.</p> <!-- TMPL_IF NAME="loggedinusername" --><p><a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a></p><!-- TMPL_ELSE --><!-- TMPL_IF NAME="AnonSuggestions" --><p><a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a></p><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
        
-       <!-- TMPL_IF NAME="loggedinusername" --><a href="/cgi-bin/koha/opac-suggestions.pl?op=add">Add a purchase suggestion</a><!-- TMPL_ELSE --><!-- TMPL_IF NAME="AnonSuggestions" --><a href="/cgi-bin/koha/opac-suggestions.pl?op=add">Add a purchase suggestion</a><!-- /TMPL_IF --><!-- /TMPL_IF -->
 <!-- /TMPL_IF -->
 </div>
 </div>
 </div>
 </div>
 <div class="yui-b">
-<div class="container">
+<div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
 <!-- TMPL_INCLUDE name="usermenu.inc" -->
 </div>