Bug 7731 - Library should be used instead of branch and site
[koha.git] / koha-tmpl / opac-tmpl / prog / en / modules / opac-suggestions.tt
1 [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog ›  
2 [% IF ( op_add ) %]Enter a new purchase suggestion[% END %]
3 [% IF ( op_else ) %]Purchase Suggestions[% END %]
4 [% INCLUDE 'doc-head-close.inc' %]
5 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
6 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
7 <script type="text/JavaScript" language="JavaScript">
8 //<![CDATA[
9 $.tablesorter.addParser({
10     id: 'articles', 
11     is: function(s) {return false;  }, 
12     format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, 
13     type: 'text' 
14 });
15
16        $(function() {
17                         $("#suggestt").tablesorter({
18                                 widgets : ['zebra'],
19                                 [% IF ( loggedinusername ) %]sortList: [[1,0]],[% ELSE %]sortList: [[0,0]],[% END %]
20                         headers: {
21                                 [% IF ( loggedinusername ) %]
22                                         [% IF ( OPACViewOthersSuggestions ) %]
23                                         0: { sorter: false },2: { sorter: 'articles' },2: {sorter: false },4: {sorter: false},5:{sorter:false}
24                                         [% ELSE %]
25                                         0: { sorter: false },2: { sorter: 'articles' },2: {sorter: false },3: {sorter: false},4:{sorter:false}
26                                         [% END %]
27                                 [% ELSE %]
28                                 [% IF ( OPACViewOthersSuggestions ) %]
29                                         0: { sorter: 'articles' },1: {sorter: false },3: {sorter: false},4:{sorter:false}
30                                         [% ELSE %]
31                                         0: { sorter: 'articles' },1: {sorter: false },2: {sorter: false},3:{sorter:false}
32                                         [% END %]
33                                 [% END %]
34                                 }
35                         }); 
36                         $("#CheckAll").click(function(){
37                         $(".checkboxed").checkCheckboxes();
38                         return false;
39                     });
40                     $("#CheckNone").click(function(){
41                         $(".checkboxed").unCheckCheckboxes();
42                         return false;
43                     }); 
44        });
45         
46       function Check(f) {
47                 var _alertString="";
48                 var alertString2;
49
50             if(f.title.value.length ==0){
51                         _alertString += _("- You must enter a Title") + "\n";
52                 }
53
54                 if (_alertString.length==0) {
55                         f.submit();
56                 } else {
57                         alertString2 = _("Form not submitted because of the following problem(s)");
58                         alertString2 += "\n------------------------------------------------------------------------------------\n\n";
59                         alertString2 += _alertString;
60                         alert(alertString2);
61                 }
62         }
63 //]]>
64 </script>
65 </head>
66 [% IF ( loggedinusername ) %]<body id="opac-usersuggestions">[% ELSE %]<body id="opac-suggestions">[% END %]
67
68 <div id="doc3" class="yui-t1">
69    <div id="bd">
70 [% INCLUDE 'masthead.inc' %]
71         <div id="yui-main">
72         <div class="yui-b"><div class="yui-g">
73 <div id="usersuggestions" class="container">
74 [% IF ( op_add ) %]
75     <h1>Enter a new purchase suggestion</h1>
76
77     <p>Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion</p>
78     <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>
79     <form action="/cgi-bin/koha/opac-suggestions.pl" method="post">
80    <fieldset class="rows"> <ol>
81     <li><label class="required" for="title">Title:</label><input type="text" id="title" name="title" size="50" maxlength="80" /></li>
82     <li><label for="author">Author:</label><input type="text" id="author" name="author" size="50" maxlength="80" /></li>
83     <li><label for="copyrightdate">Copyright Date:</label><input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" /></li>
84     <li><label for="isbn">Standard Number (ISBN, ISSN or Other):</label><input type="text" id="isbn" name="isbn" size="50" maxlength="80" /></li>
85     <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" /></li>
86     <li><label for="collectiontitle">Collection Title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" /></li>
87     <li><label for="place">Publication Place:</label><input type="text" id="place" name="place" size="50" maxlength="80" /></li>
88     <li><label for="itemtype">Item Type:</label><select name="itemtype" id="itemtype">
89             <option value="">Default</option>
90         [% FOREACH itemtypeloo IN itemtypeloop %]
91                         [% IF ( itemtypeloo.selected ) %]<option value="[% itemtypeloo.itemtype %]" selected="selected"> [% ELSE %]<option value="[% itemtypeloo.itemtype %]"> [% END %] [% itemtypeloo.description %]</option>
92         [% END %]
93         </select> </li>
94     [% IF ( branch_loop ) %]
95     <li><label for="branch">Library:</label>
96         <select name="branch" id="branch">
97         [% FOREACH branch_loo IN branch_loop %]
98             [% IF ( branch_loo.selected ) %]
99             <option value="[% branch_loo.value %]" selected="selected">[% branch_loo.branchname %]</option>
100             [% ELSE %]
101             <option value="[% branch_loo.value %]">[% branch_loo.branchname %]</option>
102             [% END %]
103         [% END %]
104         </select>
105     </li>
106     [% END %]
107     [% IF ( patron_reason_loop ) %]<li><label for="patronreason">Reason for suggestion: </label><select name="patronreason" id="patronreason"><option value="">-- Choose --</option>[% FOREACH patron_reason_loo IN patron_reason_loop %]
108            <option value="[% patron_reason_loo.authorised_value %]">[% patron_reason_loo.lib %]</option>
109     [% END %]</select></li>[% END %]
110     <li><label for="note">Notes:</label><textarea name="note" id="note" rows="5" cols="40"></textarea></li>
111     </ol></fieldset>
112         <fieldset class="action"><input type="hidden" name="suggestedby" value="[% 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>
113     </form>
114
115 [% END %]
116
117 [% IF ( op_else ) %]
118     <h1>[% UNLESS ( OPACViewOthersSuggestions ) %][% IF ( loggedinusername ) %]My [% END %][% END %]Purchase Suggestions</h1>
119
120     [% IF ( deleted ) %]<div class="dialog message">The selected suggestions have been deleted.</div>[% END %]
121     [% IF ( submitted ) %]<div class="dialog message">Your suggestion has been submitted.</div>[% END %]
122
123     [% IF ( suggestions_loop ) %]
124     [% IF ( OPACViewOthersSuggestions ) %]
125         <form action="/cgi-bin/koha/opac-suggestions.pl" method="get">
126     <table>
127         <tr>
128                 <th>
129                     Search for:
130                 </th>
131                 <td>
132                     <input type="text" name="title" value="[% title %]" />
133                 </td>
134                 <th>
135                 Suggested by:
136                 </th>
137                 <td>
138                     <select name="suggestedby">
139                         <option value="0">Anyone</option>
140                         <option value="1">Me</option>
141                     </select>
142                 </td>
143                 <th>
144                     <input type="submit" value="Search" />
145                 </th>
146         </tr>
147                 </table>
148             </form>[% END %]
149         <form action="/cgi-bin/koha/opac-suggestions.pl" method="post">
150             <input type="hidden" name="op" value="delete_confirm" />
151                         <div><span class="checkall"><a href="#" id="CheckAll">Select All</a></span>
152                 <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 %]
153 </div>
154                         <table id="suggestt" class="checkboxed">
155                         <thead><tr>
156             [% IF ( loggedinusername ) %]<th>&nbsp;</th>[% END %]
157             <th>Summary</th>
158             <th>Note</th>
159             [% IF ( OPACViewOthersSuggestions ) %]<th>Suggested For</th>[% END %]
160             <th>Managed by</th>
161             <th>Status</th>
162         </tr></thead>
163         <tbody>[% FOREACH suggestions_loo IN suggestions_loop %]
164             [% IF ( suggestions_loo.even ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
165 [% IF ( loggedinusername ) %]<td>
166     [% IF ( suggestions_loo.showcheckbox ) %]
167                     <input type="checkbox" name="delete_field" value="[% suggestions_loo.suggestionid %]" />
168     [% END %]
169                 </td>[% END %]
170                 <td>
171                     <p><strong>[% suggestions_loo.title |html %]</strong></p>
172                     <p>[% IF ( suggestions_loo.author ) %][% suggestions_loo.author %],[% END %]
173                         [% IF ( suggestions_loo.copyrightdate ) %] - [% suggestions_loo.copyrightdate %],[% END %] 
174                         [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode %][% END %]
175                         [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place %])[% END %]
176                         [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle %][% END %]
177                         [% IF ( suggestions_loo.itemtype ) %] - [% suggestions_loo.itemtype %][% END %]
178                     </p>
179                 </td>
180                 <td>
181                     [% suggestions_loo.note %]
182                 </td>
183                 [% IF ( OPACViewOthersSuggestions ) %]<td>
184                     [% IF ( suggestions_loo.branchcodesuggestedby ) %][% suggestions_loo.branchcodesuggestedby %][% ELSE %]&nbsp;[% END %]
185                 </td>[% END %]
186                 <td>
187                                         [% IF ( suggestions_loo.surnamemanagedby ) %][% suggestions_loo.surnamemanagedby %][% IF ( suggestions_loo.firstnamemanagedby ) %],[% END %] [% suggestions_loo.firstnamemanagedby %][% ELSE %]&nbsp;[% END %]
188                 </td>
189                 <td>
190                     [% IF ( suggestions_loo.ASKED ) %]Requested[% END %]
191                     [% IF ( suggestions_loo.CHECKED ) %]Checked by the library[% END %]
192                     [% IF ( suggestions_loo.ACCEPTED ) %]Accepted by the library[% END %]
193                     [% IF ( suggestions_loo.ORDERED ) %]Ordered by the library[% END %]
194                     [% IF ( suggestions_loo.REJECTED ) %]Suggestion declined [% END %]
195                     [% IF ( suggestions_loo.AVAILABLE ) %]Available in the library[% END %]
196                     [% IF ( suggestions_loo.reason ) %]([% suggestions_loo.reason %])[% END %]
197                 </td>
198             </tr>
199         [% END %]
200        </tbody>
201     </table> [% IF ( loggedinusername ) %]<fieldset class="action">
202                 <input type="submit" value="Delete Checked Items" />
203             </fieldset>
204         [% END %]
205         </form>
206     [% ELSE %]<p>There are no pending purchase suggestions.</p> [% IF ( loggedinusername ) %]<p><a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a></p>[% ELSE %][% IF ( AnonSuggestions ) %]<p><a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a></p>[% END %][% END %][% END %]
207         
208 [% END %]
209 </div>
210 </div>
211 </div>
212 </div>
213 <div class="yui-b">
214 <div id="leftmenus" class="container">
215 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
216 </div>
217 </div>
218 </div>
219 [% INCLUDE 'opac-bottom.inc' %]