updated release notes for 3.14.0 beta
[koha.git] / koha-tmpl / opac-tmpl / prog / en / modules / opac-suggestions.tt
1 [% USE Koha %]
2 [% USE KohaAuthorisedValues %]
3 [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog ›
4 [% IF ( op_add ) %]Enter a new purchase suggestion[% END %]
5 [% IF ( op_else ) %]Purchase Suggestions[% END %]
6 [% INCLUDE 'doc-head-close.inc' %]
7 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
8 [% INCLUDE 'datatables.inc' %]
9 <script type="text/javascript">
10 //<![CDATA[
11 [% IF ( loggedinusername ) %]function enableCheckboxActions(){
12     // Enable/disable controls if checkboxes are checked
13     var checkedBoxes = $(".checkboxed input:checkbox:checked");
14     if ($(checkedBoxes).size()) {
15       $("#selections").html(_("With selected suggestions: "));
16       $("#selections-toolbar .links a").removeClass("disabled");
17     } else {
18       $("#selections").html(_("Select suggestions to: "));
19       $("#selections-toolbar .links a").addClass("disabled");
20     }
21 }[% END %]
22
23        $(function() {
24             $("#suggestt").dataTable($.extend(true, {}, dataTablesDefaults, {
25                 "aaSorting": [[ 1, "asc" ]],
26                 "aoColumnDefs": [
27                   [% IF ( loggedinusername ) %]{ "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }[% END %]
28                 ],
29                 "aoColumns": [
30                     [% IF ( loggedinusername ) %]null,[% END %]
31                     { "sType": "anti-the" },
32                     null,
33                     [% IF ( OPACViewOthersSuggestions ) %]null,[% END %]
34                     null,
35                     null
36                 ]
37             }));
38             [% IF ( loggedinusername ) %]$("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
39             $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
40             $("#CheckAll").click(function(){
41                 $(".checkboxed").checkCheckboxes();
42                 enableCheckboxActions();
43                 return false;
44             });
45             $("#CheckNone").click(function(){
46                 $(".checkboxed").unCheckCheckboxes();
47                 enableCheckboxActions();
48                 return false;
49             });
50             $(".cb").click(function(){
51               enableCheckboxActions();
52             });
53             $("#removeitems").html("<a href=\"#\" class=\"removeitems tag_hides disabled\">"+_("Delete")+"</a>")
54             .click(function(){
55               $("#myform").submit();
56               return false;
57             });
58             enableCheckboxActions();
59             [% END %]
60        });
61
62       function Check(f) {
63                 var _alertString="";
64                 var alertString2;
65
66             if(f.title.value.length ==0){
67                         _alertString += _("- You must enter a Title") + "\n";
68                 }
69
70                 if (_alertString.length==0) {
71                         f.submit();
72                 } else {
73                         alertString2 = _("Form not submitted because of the following problem(s)");
74                         alertString2 += "\n------------------------------------------------------------------------------------\n\n";
75                         alertString2 += _alertString;
76                         alert(alertString2);
77                 }
78         }
79 //]]>
80 </script>
81 </head>
82 [% IF ( loggedinusername ) %]<body id="opac-usersuggestions">[% ELSE %]<body id="opac-suggestions">[% END %]
83
84 <div id="doc3" class="yui-t1">
85    <div id="bd">
86 [% INCLUDE 'masthead.inc' %]
87         <div id="yui-main">
88         <div class="yui-b"><div class="yui-g">
89 <div id="usersuggestions" class="container">
90 [% IF ( op_add ) %]
91     <h1>Enter a new purchase suggestion</h1>
92
93     <p>Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion</p>
94     <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>
95     <form action="/cgi-bin/koha/opac-suggestions.pl" method="post">
96    <fieldset class="rows"> <ol>
97     <li><label class="required" for="title">Title:</label><input type="text" id="title" name="title" size="80" maxlength="255" /></li>
98     <li><label for="author">Author:</label><input type="text" id="author" name="author" size="50" maxlength="80" /></li>
99     <li><label for="copyrightdate">Copyright date:</label><input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" /></li>
100     <li><label for="isbn">Standard number (ISBN, ISSN or other):</label><input type="text" id="isbn" name="isbn" size="50" maxlength="80" /></li>
101     <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" /></li>
102     <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" /></li>
103     <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" /></li>
104     <li><label for="itemtype">Item type:</label><select name="itemtype" id="itemtype">
105             <option value="">Default</option>
106         [% FOREACH itemtypeloo IN itemtypeloop %]
107                         [% IF ( itemtypeloo.selected ) %]<option value="[% itemtypeloo.itemtype %]" selected="selected"> [% ELSE %]<option value="[% itemtypeloo.itemtype %]"> [% END %] [% itemtypeloo.description %]</option>
108         [% END %]
109         </select> </li>
110     [% IF ( branchloop ) %]
111     <li><label for="branch">Library:</label>
112         <select name="branch" id="branch">
113         [% FOREACH branchloo IN branchloop %]
114             [% IF ( branchloo.selected ) %]
115             <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
116             [% ELSE %]
117             <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
118             [% END %]
119         [% END %]
120         </select>
121     </li>
122     [% END %]
123     [% 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 %]
124            <option value="[% patron_reason_loo.authorised_value %]">[% patron_reason_loo.lib %]</option>
125     [% END %]</select></li>[% END %]
126     <li><label for="note">Notes:</label><textarea name="note" id="note" rows="5" cols="40"></textarea></li>
127     </ol></fieldset>
128         <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>
129     </form>
130
131 [% END %]
132
133 [% IF ( op_else ) %]
134     <h1>[% IF ( OPACViewOthersSuggestions ) %]Purchase suggestions[% ELSE %][% IF ( loggedinusername ) %]My purchase suggestions[% ELSE %]Purchase suggestions[% END %][% END %]</h1>
135
136     [% IF ( deleted ) %]<div class="dialog message">The selected suggestions have been deleted.</div>[% END %]
137     [% IF ( submitted ) %]<div class="dialog message">Your suggestion has been submitted.</div>[% END %]
138
139     [% IF ( suggestions_loop ) %]
140     [% IF ( OPACViewOthersSuggestions ) %]
141         <form action="/cgi-bin/koha/opac-suggestions.pl" method="get">
142     <table>
143         <tr>
144                 <th>
145                     Search for:
146                 </th>
147                 <td>
148                     <input type="text" name="title" value="[% title |html %]" />
149                 </td>
150                 <th>
151                 Suggested by:
152                 </th>
153                 <td>
154                     <select name="suggestedby">
155                         <option value="0">Anyone</option>
156                         <option value="1">Me</option>
157                     </select>
158                 </td>
159                 <th>
160                     <input type="submit" value="Search" />
161                 </th>
162         </tr>
163                 </table>
164             </form>[% END %]
165         <form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="myform">
166             <input type="hidden" name="op" value="delete_confirm" />
167             <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 %]
168 </div>
169           [% IF ( loggedinusername ) %]<div id="selections-toolbar" class="list-actions">
170                   <span class="checkall"></span> <span class="clearall"></span> <span class="sep">|</span>
171                   <span class="links"><span id="selections">Select suggestions to: </span>
172                   <span id="removeitems"></span>
173           </div>[% END %]
174                         <table id="suggestt" class="checkboxed">
175                         <thead><tr>
176             [% IF ( loggedinusername ) %]<th>&nbsp;</th>[% END %]
177             <th>Summary</th>
178             <th>Note</th>
179             [% IF ( OPACViewOthersSuggestions ) %]<th>Suggested for</th>[% END %]
180             <th>Managed by</th>
181             <th>Status</th>
182         </tr></thead>
183         <tbody>[% FOREACH suggestions_loo IN suggestions_loop %]
184             [% IF ( suggestions_loo.even ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
185 [% IF ( loggedinusername ) %]<td>
186     [% IF ( suggestions_loo.showcheckbox ) %]
187                     <input type="checkbox" class="cb" name="delete_field" value="[% suggestions_loo.suggestionid %]" />
188     [% END %]
189                 </td>[% END %]
190                 <td>
191                     <p><strong>[% suggestions_loo.title |html %]</strong></p>
192                     <p>[% IF ( suggestions_loo.author ) %][% suggestions_loo.author %],[% END %]
193                         [% IF ( suggestions_loo.copyrightdate ) %] - [% suggestions_loo.copyrightdate %],[% END %] 
194                         [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode %][% END %]
195                         [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place %])[% END %]
196                         [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle %][% END %]
197                         [% IF ( suggestions_loo.itemtype ) %] - [% suggestions_loo.itemtype %][% END %]
198                     </p>
199                 </td>
200                 <td>
201                     [% suggestions_loo.note %]
202                 </td>
203                 [% IF ( OPACViewOthersSuggestions ) %]<td>
204                     [% IF ( suggestions_loo.branchcodesuggestedby ) %][% suggestions_loo.branchcodesuggestedby %][% ELSE %]&nbsp;[% END %]
205                 </td>[% END %]
206                 <td>
207                                         [% IF ( suggestions_loo.surnamemanagedby ) %][% suggestions_loo.surnamemanagedby %][% IF ( suggestions_loo.firstnamemanagedby ) %],[% END %] [% suggestions_loo.firstnamemanagedby %][% ELSE %]&nbsp;[% END %]
208                 </td>
209                 <td>
210                     [% IF    ( suggestions_loo.ASKED ) %]Requested
211                     [% ELSIF ( suggestions_loo.CHECKED ) %]Checked by the library
212                     [% ELSIF ( suggestions_loo.ACCEPTED ) %]Accepted by the library
213                     [% ELSIF ( suggestions_loo.ORDERED ) %]Ordered by the library
214                     [% ELSIF ( suggestions_loo.REJECTED ) %]Suggestion declined
215                     [% ELSIF ( suggestions_loo.AVAILABLE ) %]Available in the library
216                     [% ELSE %] [% KohaAuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS, 1 ) %] [% END %]
217
218                     [% IF ( suggestions_loo.reason ) %]([% suggestions_loo.reason %])[% END %]
219                 </td>
220             </tr>
221         [% END %]
222        </tbody>
223     </table> [% IF ( loggedinusername ) %]<fieldset class="action">
224                 <input type="submit" value="Delete selected" />
225             </fieldset>
226         [% END %]
227         </form>
228     [% 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 %]
229         
230 [% END %]
231 </div>
232 </div>
233 </div>
234 </div>
235 <div class="yui-b">
236 <div id="leftmenus" class="container">
237 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
238 </div>
239 </div>
240 </div>
241 [% INCLUDE 'opac-bottom.inc' %]