Bug 20045: Switch single-column templates to Bootstrap grid: Various
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / suggestion / suggestion.tt
1 [% USE Branches %]
2 [% USE AuthorisedValues %]
3 [% USE KohaDates %]
4 [% USE Price %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha &rsaquo; Acquisitions  &rsaquo;
8     [% IF ( op_save ) %]
9         [% IF ( suggestionid ) %]
10             Suggestions &rsaquo;  Edit suggestion #[% suggestionid %]
11         [% ELSE %]
12             Suggestions &rsaquo; Add suggestion
13         [% END %]
14     [% ELSIF ( op == 'show' ) %]
15            Suggestions &rsaquo; Show suggestion #[% suggestionid %]
16     [% ELSE %]
17         Suggestions management
18     [% END %]
19 </title>
20 [% INCLUDE 'doc-head-close.inc' %]
21 [% IF ( op_else ) %]
22     <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
23 [% END %]
24 [% IF ( op_else ) %]
25     <style type="text/css">
26         h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief ol { display : none; }
27         .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%; }
28     </style>
29 [% END %]
30 </head>
31
32 <body id="acq_suggestion" class="acq">
33 [% INCLUDE 'header.inc' %]
34 [% INCLUDE 'cat-search.inc' %]
35 <div id="breadcrumbs">
36     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo;
37     [% IF ( op_save ) %]
38         [% IF ( suggestionid ) %]
39             <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a> &rsaquo;  Edit suggestion #[% suggestionid %]
40         [% ELSE %]
41             <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a> &rsaquo; Add suggestion
42         [% END %]
43     [% ELSIF ( op == 'show' ) %]
44            <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a> &rsaquo; Show suggestion #[% suggestionid %]
45     [% ELSE %]
46         Suggestions management
47     [% END %]
48 </div>
49
50 [% IF ( op == 'show' ) %]
51 <div id="doc" class="yui-t7"> <!-- <div id="doc3" class="yui-t2"> -->
52 <div id="bd">
53     <div id="yui-main">
54     <div class="yui-b">
55
56     <div id="toolbar" class="btn-toolbar">
57         <a class="btn btn-default btn-sm" id="editsuggestion" href="suggestion.pl?op=edit&amp;suggestionid=[% suggestionid %]"><i class="fa fa-pencil"></i> Edit</a>
58         <a class="btn btn-default btn-sm deletesuggestion" href="suggestion.pl?op=delete&amp;edit_field=[% suggestionid %]"><i class="fa fa-trash"></i> Delete</a>
59     </div>
60
61     <fieldset class="rows">
62       <legend>Bibliographic information</legend>
63       <ol>
64             [% IF ( title ) %]
65                 <li>
66                     <span class="label">Title:</span>
67                     [% title |html %]
68                 </li>
69             [% END %]
70             [% IF ( author ) %]
71                 <li>
72                     <span class="label">Author:</span>
73                     [% author |html %]
74                 </li>
75             [% END %]
76             [% IF ( copyrightdate ) %]
77                 <li>
78                     <span class="label">Copyright date:</span>
79                     [% copyrightdate |html %]
80                 </li>
81             [% END %]
82             [% IF ( isbn ) %]
83                 <li>
84                     <span class="label">ISBN or ISSN or other standard number:</span>
85                     [% isbn |html %]
86                 </li>
87             [% END %]
88             [% IF ( publishercode ) %]
89                 <li>
90                     <span class="label">Publisher:</span>
91                     [% publishercode |html %]
92                 </li>
93             [% END %]
94             [% IF ( place ) %]
95                 <li>
96                     <span class="label">Publication place:</span>
97                     [% place |html %]
98                 </li>
99             [% END %]
100             [% IF ( collectiontitle ) %]
101                 <li>
102                     <span class="label">Collection title:</span>
103                     [% collectiontitle |html %]
104                 </li>
105             [% END %]
106             [% IF ( itemtype ) %]
107                 <li>
108                     <span class="label">Document type:</span>
109                     [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', itemtype, 0 ) %]
110                 </li>
111             [% END %]
112         [% IF ( patron_reason_loop ) %]
113           <li><span class="label">Reason for suggestion: </span>
114             [% FOREACH patron_reason_loo IN patron_reason_loop %]
115               [% IF patron_reason_loo.authorised_value == patronreason %][% patron_reason_loo.lib %][% END %]
116             [% END %]
117           </li>
118         [% END %]
119             [% IF ( note ) %]
120                 <li>
121                     <span class="label">Notes:</span>
122                     [% note |html %]
123                 </li>
124             [% END %]
125       </ol>
126     </fieldset>
127     <fieldset class="rows"> <legend>Suggestion management</legend>
128       <ol>
129         <li>
130           <span class="label">Status:</span>
131           [% SET status_found = 0 %]
132           [% IF ( STATUS == 'ASKED' ) %]
133               Pending
134               [% SET status_found = 1 %]
135           [% ELSIF ( STATUS == 'ACCEPTED' ) %]
136               Accepted
137               [% SET status_found = 1 %]
138           [% ELSIF ( STATUS == 'CHECKED' ) %]
139               Checked
140               [% SET status_found = 1 %]
141           [% ELSIF ( STATUS == 'REJECTED' ) %]
142               Rejected
143               [% SET status_found = 1 %]
144           [% ELSE %]
145               [% FOREACH s IN SuggestionStatuses %]
146                   [% IF STATUS == s.authorised_value %]
147                       [% s.lib %]
148                       [% SET status_found = 1 %]
149                   [% END %]
150               [% END %]
151           [% END %]
152
153         </li>
154         <li>
155           <table>
156             <thead><tr><th>&nbsp;</th><th>Date</th><th>By</th></tr></thead>
157             <tbody>
158             <tr>
159                 <th>Created by:</th>
160                 <td>[% suggesteddate | $KohaDates %]</td>
161                 <td>
162                     [% IF ( suggestedby_borrowernumber ) %]
163                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestedby_borrowernumber %]">[% suggestedby_surname %], [% suggestedby_firstname %] ([% suggestedby_cardnumber %])</a>
164                         [% Branches.GetName( suggestedby_branchcode ) %] ([% suggestedby_description %])
165                     [% END %]
166                 </td>
167             </tr>
168             <tr>
169                 <th>Managed by:</th>
170                 <td>[% manageddate | $KohaDates %]</td>
171                 <td>
172                         [% IF ( managedby_borrowernumber ) %]
173                             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% managedby_borrowernumber %]">[% managedby_surname %], [% managedby_firstname %] ([% suggestedby_cardnumber %])</a>
174                             [% Branches.GetName( managedby_branchcode ) %] ([% managedby_description %])
175                         [% END %]
176                 </td>
177             </tr>
178             <tr>
179                 <th>Accepted on:</th>
180                 <td>[% accepteddate | $KohaDates %]</td>
181                 <td>
182                     [% IF ( acceptedby_borrowernumber ) %]
183                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_borrowernumber %]">[% acceptedby_surname %], [% acceptedby_firstname %] ([% suggestedby_cardnumber %])</a>
184                         [% Branches.GetName( acceptedby_branchcode ) %] ([% acceptedby_description %])
185                     [% END %]
186                 </td>
187             </tr>
188             </tbody>
189         </table></li></ol>
190     </fieldset>
191     <fieldset class="rows"> <legend>Acquisition information</legend>
192       <ol>
193         <li>
194           <span class="label">Library:</span> [% Branches.GetName( branchcode ) %]
195         </li>
196         <li>
197           <span class="label">Fund:</span> [% budgetname %]
198         </li>
199         <li>
200           <span class="label">Copies:</span>[% quantity %]
201         </li>
202         <li>
203           <span class="label">Currency:</span>[% currency %]
204         </li>
205         <li>
206           <span class="label">Price:</span>[% price | $Price %]
207         </li>
208         <li>
209           <span class="label">Total</span>[% total | $Price %]
210         </li>
211       </ol>
212     </fieldset>
213
214     <fieldset class="action">
215         <a href="suggestion.pl">&lt;&lt; Back to suggestions</a>
216     </fieldset>
217
218     </div>
219     </div>
220 </div>
221 [% ELSE %]
222
223 [% IF ( op_save ) %]
224     <div class="main container-fluid">
225         <div class="row">
226             <div class="col-md-8 col-md-offset-2">
227 [% ELSE %]
228     <div id="doc3" class="yui-t2">
229         <div id="bd">
230             <div id="yui-main">
231                 <div class="yui-b">
232 [% END %]
233
234 [% IF ( op_save ) %]
235     <form id="add_edit" action="suggestion.pl" method="post" class="validated">
236     <input type="hidden" name="redirect" id="redirect" value="[% redirect %]" />
237     <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" />
238     [% IF ( suggestionid ) %]
239         <h1>Edit purchase suggestion #[% suggestionid %]</h1>
240         <input type="hidden" name="suggestionid" value="[% suggestionid %]"/>
241     [% ELSE %]
242         <h1>Enter a new purchase suggestion</h1>
243     [% END %]
244     <fieldset class="rows"> <legend>Bibliographic information</legend><ol>
245         <li>
246             <label for="title" class="required">Title:</label>
247             <input type="text" id="title" name="title" size="80" maxlength="255" value="[% title |html %]" required="required" class="required" />
248             <span class="required">Required</span>
249         </li>
250         <li><label for="author">Author:</label><input type="text" id="author" name="author" size="50" maxlength="80" value="[% author | html %]"/></li>
251         <li><label for="copyrightdate">Copyright date:</label><input type="text" id="copyrightdate" name="copyrightdate" size="4" maxlength="4" value="[% copyrightdate | html %]" /></li>
252         <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 | html %]"/></li>
253         <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" value="[% publishercode | html %]"/></li>
254         <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place | html %]"/></li>
255         <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle | html %]"/></li>
256         <li><label for="itemtype">Document type:</label>
257             [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, default=itemtype %]
258         </li>
259         [% IF patron_reason_loop %]
260             <li>
261                 <label for="patronreason">Reason for suggestion: </label>
262                 <select name="patronreason" id="patronreason">
263                     <option value=""> -- Choose -- </option>
264                     [% FOREACH patron_reason_loo IN patron_reason_loop %]
265                         [% IF patron_reason_loo.authorised_value == patronreason %]
266                             <option value="[% patron_reason_loo.authorised_value %]" selected="selected">[% patron_reason_loo.lib %]</option>
267                         [% ELSE %]
268                             <option value="[% patron_reason_loo.authorised_value %]">[% patron_reason_loo.lib %]</option>
269                         [% END %]
270                     [% END %]
271                 </select>
272             </li>
273         [% END %]
274         <li><label for="note">Notes:</label><textarea name="note" id="note" rows="5" cols="40">[% note %]</textarea></li>
275         </ol>
276     </fieldset>
277     <fieldset class="rows"> <legend>Suggestion management</legend>
278        <ol>
279             [% IF ( suggestionid ) %]
280                 <li>
281                     <label for="STATUS">Status:</label>
282                     <select id="STATUS" name="STATUS">
283                         <option value="">No Status</option>
284
285                         [% IF (statusselected_ASKED ) %]
286                             <option value="ASKED" selected="selected">Pending</option>
287                         [% ELSE %]
288                             <option value="ASKED">Pending</option>
289                         [% END %]
290
291                         [% IF (statusselected_ACCEPTED ) %]
292                             <option value="ACCEPTED" selected="selected">Accepted</option>
293                         [% ELSE %]
294                             <option value="ACCEPTED">Accepted</option>
295                         [% END %]
296
297                         [% IF (statusselected_CHECKED ) %]
298                             <option value="CHECKED" selected="selected">Checked</option>
299                         [% ELSE %]
300                             <option value="CHECKED">Checked</option>
301                         [% END %]
302
303                         [% IF ( statusselected_REJECTED ) %]
304                             <option value="REJECTED" selected="selected">Rejected</option>
305                         [% ELSE %]
306                             <option value="REJECTED">Rejected</option>
307                         [% END %]
308
309                         [% FOREACH s IN SuggestionStatuses %]
310                             [% IF s.authorised_value == selected_status %]
311                                 <option value="[% s.authorised_value %]" selected="selected">[% s.lib %]</option>
312                             [% ELSE %]
313                                 <option value="[% s.authorised_value %]">[% s.lib %]</option>
314                             [% END %]
315                         [% END %]
316                     </select>
317                 </li>
318                 <li>
319                     <label for="reason">Reason</label>
320                     <select class="select-reason" id="reason" name="reason">
321                         <option value=""> -- Choose a reason -- </option>
322                         [% FOREACH reasonsloo IN suggestion.reasonsloop %]
323                             [% IF (reasonsloo.lib == suggestion.reason) %]
324                                 <option value="[% reasonsloo.lib %]" selected="selected">[% reasonsloo.lib %]</option>
325                             [% ELSE %]
326                                 <option value="[% reasonsloo.lib %]">[% reasonsloo.lib %]</option>
327                             [% END %]
328                         [% END %]
329                         <option value="other">Others...</option>
330                     </select>
331
332                     <span id="other_reason" name="other_reason">
333                         [% IF other_reason %]
334                             <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/>
335                         [% ELSE %]
336                             <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
337                         [% END %]
338                         <a href="#back">Cancel</a>
339                     </span>
340                 </li>
341             [% END %]
342         <li><table>
343             <thead><tr><th>&nbsp;</th><th>Date</th><th>By</th></tr></thead>
344             <tbody>
345             <tr>
346                 <th><label for="suggesteddate">Created by:</label> </th>
347                 <td><input type="text" id="suggesteddate" name="suggesteddate" class="datepicker" size="10" maxlength="10" value="[% suggesteddate | $KohaDates %]"/>[% INCLUDE 'date-format.inc' %]</td>
348                 <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 %] ([% suggestedby_cardnumber %])</a>  [% Branches.GetName( suggestedby_branchcode ) %] ([% suggestedby_description %])[% END %]
349                 </td>
350             </tr>
351             <tr>
352                 <th><label for="managedon">Managed by:</label> </th>
353                 <td><input type="text" id="managedon" name="manageddate" class="datepicker" size="10" maxlength="10" value="[% manageddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]</td>
354                 <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 %] ([% suggestedby_cardnumber %])</a> [% Branches.GetName( managedby_branchcode ) %] ([% managedby_description %])[% END %]</td>
355             </tr>
356             <tr>
357                 <th><label for="accepteddate">Accepted on:</label> </th>
358                 <td><input type="text" id="accepteddate" name="accepteddate" class="datepicker" size="10" maxlength="10" value="[% accepteddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]</td>
359                 <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 %] ([% suggestedby_cardnumber %])</a> [% Branches.GetName( acceptedby_branchcode ) %] ([% acceptedby_description %])[% END %]</td>
360             </tr>
361             </tbody>
362         </table></li></ol>
363     </fieldset>
364     <fieldset class="rows"> <legend>Acquisition information</legend><ol>
365         <li><label for="branchcode">Library:</label>
366             <select name="branchcode" id="branchcode">
367                 <option value="">Any</option>
368                 [% IF branchfilter %]
369                     [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter ) %]
370                 [% ELSE %]
371                     [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
372                 [% END %]
373             </select>
374         </li>
375         <li><label for="budgetid">Fund:</label>
376             <select name="budgetid" id="budgetid">
377                 <option value="">Any</option>[% FOREACH budgetsloo IN budgetsloop %]
378                 [% 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 %]
379             </select>
380                 </li><li><label for="quantity">Copies:</label>
381             <input type="text" size="10" id="quantity" name="quantity" value="[% quantity %]" />
382                 </li>
383                 <li>
384                     <label for="currency">Currency:</label>
385                     [% FOREACH c IN currencies %]
386                         <input type="hidden" value="[% c.rate %]" id="currency_rate_[% c.currency %]" name="currency_rate_[% c.currency %]" />
387                         <input type="hidden" id="[% c.currency %]" name="[% c.currency %]" value="[% c.rate %]" />
388                     [% END %]
389
390                     <select name="currency" id="currency">
391                         [% FOREACH c IN currencies %]
392                             [% IF suggestionid and suggestion.currency == c.currency or not suggestionid and c.active %]
393                                 <option value="[% c.currency %]" selected="selected">[% c.currency %]</option>
394                             [% ELSIF not c.archived %]
395                                 <option value="[% c.currency %]">[% c.currency %]</option>
396                             [% END %]
397                         [% END %]
398                     </select>
399                 </li>
400                 <li><label for="price">Price:</label>
401             <input type="text" size="20" name="price" id="price" value="[% price %]" />
402                 </li><li><label for="total">Total: </label>
403                         <input type="text" readonly="readonly" id="total" name="total" size="10" value="[% total %]"/>
404                 </li></ol>
405     </fieldset><input type="hidden" id="returnsuggested" name="returnsuggested" value="[% IF ( returnsuggestedby ) %][% returnsuggestedby %][% ELSE %]noone[% END %]"/>
406     <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 %]
407     </fieldset>
408     </form>
409 [% END %]
410
411 [% IF ( op_else ) %]
412 <div id="toolbar" class="btn-toolbar">
413     <a class="btn btn-default btn-sm" id="newsuggestion" href="suggestion.pl?op=add"><i class="fa fa-plus"></i> New purchase suggestion</a>
414 </div>
415
416 <h1>Suggestions management</h1>
417
418
419 [% FOR m IN messages %]
420     <div class="dialog [% m.type %]">
421         [% SWITCH m.code %]
422         [% CASE 'already_exists' %]
423             The suggestion has not been added. A suggestion with this title already exists (<a href='/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% m.id %]&op=show'>suggestion #[% m.id %]</a>)
424         [% CASE %]
425             [% m.code %]
426         [% END %]
427     </div>
428 [% END %]
429
430 [% UNLESS ( notabs ) %]
431     <div id="suggestiontabs" class="toptabs">
432     <ul class="ui-tabs-nav">
433         [% FOREACH suggestion IN suggestions %]
434                 <li>
435             <a href="#[% suggestion.suggestiontype %]">
436             [% IF ( suggestion.suggestiontypelabel ) %]
437                 [% IF (suggestion.suggestiontypelabel == "Pending") %]Pending
438                 [% ELSIF (suggestion.suggestiontypelabel == "Accepted") %]Accepted
439                 [% ELSIF (suggestion.suggestiontypelabel == "Checked") %]Checked
440                 [% ELSIF (suggestion.suggestiontypelabel == "Rejected") %]Rejected
441                 [% ELSIF (suggestion.suggestiontypelabel == "Available") %]Available
442                 [% ELSIF (suggestion.suggestiontypelabel == "Ordered") %]Ordered
443                 [% ELSIF (suggestion.suggestiontypelabel == "Unknown") %]Status unknown
444                 [% ELSE %][% suggestion.suggestiontypelabel %][% END %]
445             [% ELSE %]
446                 [% IF ( suggestion.suggestiontype ) %]
447                     [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.suggestiontype ) %]
448                 [% ELSE %]
449                     No name
450                 [% END %]
451             [% END %]
452             ([% suggestion.suggestions_loop.size %])</a></li>
453
454         [% END %]
455     </ul>
456 [% END %]
457
458 [% FOREACH suggestion IN suggestions %]
459 <div id="[% suggestion.suggestiontype %]">
460 <form class="update_suggestions" name="f[% suggestion.suggestiontype %]" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype %]">
461
462 [% IF ( suggestion.suggestions_loop ) %]
463 <p><a id="CheckAll[% suggestion.suggestiontype %]" href="#">Check all</a> | <a id="UncheckAll[% suggestion.suggestiontype %]" href="#">Uncheck all</a></p>
464     <table id="[% suggestion.suggestiontype %]t" class="sorted">
465         <thead>
466             <tr>
467                 <th class="NoSort">&nbsp;</th>
468                 <th class="anti-the">Suggestion</th>
469                 <th>Suggested by - on</th>
470                 <th>Managed by - on</th>
471                 <th>Library</th>
472                 <th>Fund</th>
473                 <th>Status</th>
474                 <th class="NoSort">&nbsp;</th>
475             </tr>
476     </thead>
477         <tbody>
478             [% FOREACH suggestions_loo IN suggestion.suggestions_loop %]
479                 <tr>
480                 <td>
481                     <input type="checkbox" name="edit_field" value="[% suggestions_loo.suggestionid %]" />
482                 </td>
483                 <td>
484                     <a href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid %]&amp;op=show" title="suggestion" >
485                         [% suggestions_loo.title |html %][% IF ( suggestions_loo.author ) %], by [% suggestions_loo.author %][% END %]</a>
486                     <br />
487                     [% IF ( suggestions_loo.copyrightdate ) %]&copy; [% suggestions_loo.copyrightdate |html %] [% END %]
488                         [% IF ( suggestions_loo.volumedesc ) %]; Volume:<i>[% suggestions_loo.volumedesc |html %]</i> [% END %]
489                         [% IF ( suggestions_loo.isbn ) %]; ISBN:<i>[% suggestions_loo.isbn |html %]</i> [% END %][% IF ( suggestions_loo.publishercode ) %]; Published by [% suggestions_loo.publishercode |html %] [% END %][% IF ( suggestions_loo.publicationyear ) %] in <i>[% suggestions_loo.publicationyear |html %]</i> [% END %][% IF ( suggestions_loo.place ) %] in <i>[% suggestions_loo.place |html %]</i> [% END %][% IF ( suggestions_loo.collectiontitle ) %]; [% suggestions_loo.collectiontitle |html %] [% END %][% IF ( suggestions_loo.itemtype ) %]; [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 0 ) %] [% END %]<br />[% IF ( suggestions_loo.note ) %]<span class="note">[% suggestions_loo.note |html%]</span>[% END %]
490                 </td>
491                 <td>
492                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestions_loo.suggestedby %]">[% suggestions_loo.surnamesuggestedby %][% IF ( suggestions_loo.firstnamesuggestedby ) %], [% suggestions_loo.firstnamesuggestedby %][% END %] [% IF (suggestions_loo.cardnumbersuggestedby ) %]([% suggestions_loo.cardnumbersuggestedby %])[% END %]</a>
493                     [% IF ( suggestions_loo.suggesteddate ) %] - [% suggestions_loo.suggesteddate | $KohaDates %][% END %]
494                 </td>
495                 <td>
496                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestions_loo.suggestedby %]">[% suggestions_loo.surnamemanagedby %][% IF ( suggestions_loo.firstnamemanagedby ) %], [% suggestions_loo.firstnamemanagedby %][% END %]</a>
497                     [% IF ( suggestions_loo.manageddate ) %] - [% suggestions_loo.manageddate | $KohaDates %][% END %]
498                 </td>
499                 <td>
500                     [% Branches.GetName( suggestions_loo.branchcode ) %]
501                 </td>
502                 <td>
503                     [% suggestions_loo.budget_name %]
504                 </td>
505                 <td>
506                     [% IF ( suggestions_loo.ASKED ) %]
507                         Pending
508                     [% ELSIF ( suggestions_loo.ACCEPTED ) %]
509                         Accepted
510                     [% ELSIF ( suggestions_loo.ORDERED ) %]
511                         Ordered
512                     [% ELSIF ( suggestions_loo.REJECTED ) %]
513                         Rejected
514                     [% ELSIF ( suggestions_loo.CHECKED ) %]
515                         Checked
516                     [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS ) %]
517                         [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestions_loo.STATUS ) %]
518                     [% ELSE %]
519                         Status unknown
520                     [% END %]
521
522                     [% IF ( suggestions_loo.reason ) %]
523                         <br />([% suggestions_loo.reason %])
524                     [% END %]
525                 </td>
526                 <td class="actions">
527                     <a class="btn btn-xs btn-default" href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid %]&amp;op=edit"><i class="fa fa-pencil"></i> Edit</a>
528                     <a class="btn btn-default btn-xs deletesuggestion" href="suggestion.pl?op=delete&amp;edit_field=[% suggestions_loo.suggestionid %]"><i class="fa fa-trash"></i> Delete</a>
529                 </td>
530         </tr>
531         [% END %]</tbody>
532         </table>  <fieldset>
533     <div id="select-reason[% suggestion.suggestiontype %]">
534         <div id="status[% suggestion.suggestiontype %]">
535             <label for="STATUS[% suggestion.suggestiontype %]">Mark selected as: </label>
536             <select name="STATUS" id="STATUS[% suggestion.suggestiontype %]">
537                 <option value=""> -- Choose a status --</option>
538
539                 [% IF (statusselected_ASKED ) %]
540                     <option value="ASKED" selected="selected">Pending</option>
541                 [% ELSE %]
542                     <option value="ASKED">Pending</option>
543                 [% END %]
544
545                 [% IF (statusselected_ACCEPTED ) %]
546                     <option value="ACCEPTED" selected="selected">Accepted</option>
547                 [% ELSE %]
548                     <option value="ACCEPTED">Accepted</option>
549                 [% END %]
550
551                 [% IF (statusselected_CHECKED ) %]
552                     <option value="CHECKED" selected="selected">Checked</option>
553                 [% ELSE %]
554                     <option value="CHECKED">Checked</option>
555                 [% END %]
556
557                 [% IF ( statusselected_REJECTED ) %]
558                     <option value="REJECTED" selected="selected">Rejected</option>
559                 [% ELSE %]
560                     <option value="REJECTED">Rejected</option>
561                 [% END %]
562
563                 [% FOREACH s IN SuggestionStatuses %]
564                     <option value="[% s.authorised_value %]">[% s.lib %]</option>
565                 [% END %]
566             </select>
567
568             <label for="reason[% suggestion.suggestiontype %]">with this reason:</label>
569             <select id="reason[% suggestion.suggestiontype %]" name="reason[% suggestion.suggestiontype %]">
570                 <option value=""> -- Choose a reason -- </option>
571                 [% FOREACH reasonsloo IN suggestion.reasonsloop %]
572                     <option value="[% reasonsloo.lib %]">[% reasonsloo.lib %]</option>
573                 [% END %]
574                 <option value="other">Others...</option>
575             </select>
576
577             <span id="other_reason[% suggestion.suggestiontype %]">
578                 <input type="text" size="31" id="select-other_reason[% suggestion.suggestiontype %]" name="other_reason[% suggestion.suggestiontype %]" placeholder="please note your reason here..." />
579                 <a href="#back[% suggestion.suggestiontype %]">Cancel</a>
580             </span>
581
582             <strong style="padding: 0 1em;">OR:</strong>
583
584             <label for="[% suggestion.suggestiontype %]delete">Delete selected</label>
585             <input type="checkbox" name="op" id="[% suggestion.suggestiontype %]delete" />
586         </div>
587     </div>
588
589     <input type="hidden" name="branchcode" value="[% branchfilter %]" />
590     <input type="hidden" name="tabcode" value="[% suggestion.suggestiontype %]" />
591     <input type="hidden" name="op" value="change" />
592 </fieldset>
593         <fieldset class="action">
594     <input type="submit" value="Submit" /></fieldset>
595 </form>
596 [% ELSE %]
597     <b>No results.</b>
598 [% END %]
599 </div>
600 [% END %]
601     </div>
602 [% END %]
603 </div>
604 </div>
605
606       [% UNLESS ( op_save ) %] [% UNLESS ( op == 'show' ) %]<div class="yui-b">
607 <form name="suggestionfilter" action="suggestion.pl" method="get">
608 <fieldset class="brief"><ol style="display:block;"><li><label for="displayby">Organize by: </label>
609                 <select name="displayby" id="displayby" style="width:auto;">
610                     [% IF ( displayby == "STATUS" ) %]
611                         <option value="STATUS" selected="selected">Status</option>
612                     [% ELSE %]
613                         <option value="STATUS">Status</option>
614                     [% END %]
615                     [% IF ( displayby == "branchcode" ) %]
616                         <option value="branchcode" selected="selected">Library</option>
617                     [% ELSE %]
618                         <option value="branchcode">Library</option>
619                     [% END %]
620                     [% IF ( displayby == "itemtype" ) %]
621                         <option value="itemtype" selected="selected">Item type</option>
622                     [% ELSE %]
623                         <option value="itemtype">Item type</option>
624                     [% END %]
625                     [% IF ( displayby == "managedby" ) %]
626                         <option value="managedby" selected="selected">Managed by</option>
627                     [% ELSE %]
628                         <option value="managedby">Managed by</option>
629                     [% END %]
630                     [% IF ( displayby == "acceptedby" ) %]
631                         <option value="acceptedby" selected="selected">Accepted by</option>
632                     [% ELSE %]
633                         <option value="acceptedby">Accepted by</option>
634                     [% END %]
635                 </select> <input type="submit" value="Go" /></li></ol></fieldset>
636 <h4>Filter by: <a style="font-size:80%;font-weight:normal;" href="/cgi-bin/koha/suggestion/suggestion.pl">[clear]</a></h4>
637                 <div style="display:block;" id="limits">
638
639                                 <fieldset class="brief"><h4 class="local_collapse"><a href="#">Bibliographic information</a></h4>
640                    <ol> <li><label for="title"> Title:</label><input type="text" id="title" name="title" value="[% title |html %]" /></li>
641                     <li><label for="author"> Author:</label><input type="text" id="author" name="author" value="[% author | html %]" /></li>
642                     <li><label for="isbn"> ISBN:</label><input type="text" id="isbn"  name="isbn" value="[% isbn | html %]" /></li>
643                     <li><label for="publishercode"> Publisher:</label><input type="text" id="publishercode" name="publishercode" value="[% publishercode | html %]" /></li>
644                     <li><label for="copyrightdate_filter"> Copyright date:</label><input type="text" id="copyrightdate_filter" name="copyrightdate" value="[% copyrightdate | html %]" /></li>
645                     <li><label for="collectiontitle"> Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" value="[% collectiontitle | html %]" /></li><li><input type="submit" value="Go" /></li></ol>
646                 </fieldset>
647                                  <fieldset class="brief"><h4 class="local_collapse"><a href="#">Suggestion information</a></h4>
648                     <ol>
649                       <li>
650                           <label for="STATUS"> Status:</label>
651                           <select name="STATUS" id="STATUS">
652                               <option value="">Any</option>
653
654                               [% IF (statusselected_ASKED ) %]
655                                   <option value="ASKED" selected="selected">Pending</option>
656                               [% ELSE %]
657                                   <option value="ASKED">Pending</option>
658                               [% END %]
659
660                               [% IF (statusselected_ACCEPTED ) %]
661                                   <option value="ACCEPTED" selected="selected">Accepted</option>
662                               [% ELSE %]
663                                   <option value="ACCEPTED">Accepted</option>
664                               [% END %]
665
666                               [% IF (statusselected_CHECKED ) %]
667                                   <option value="CHECKED" selected="selected">Checked</option>
668                               [% ELSE %]
669                                   <option value="CHECKED">Checked</option>
670                               [% END %]
671
672                               [% IF ( statusselected_REJECTED ) %]
673                                   <option value="REJECTED" selected="selected">Rejected</option>
674                               [% ELSE %]
675                                   <option value="REJECTED">Rejected</option>
676                               [% END %]
677
678                               [% FOREACH s IN SuggestionStatuses %]
679                                   [% IF s.authorised_value == selected_status %]
680                                       <option value="[% s.authorised_value %]" selected="selected">[% s.lib %]</option>
681                                   [% ELSE %]
682                                       <option value="[% s.authorised_value %]">[% s.lib %]</option>
683                                   [% END %]
684                               [% END %]
685                           </select>
686                       </li>
687
688                     <li><label for="suggestedby"> Suggested by:</label><select id="suggestedby" name="suggestedby"><option value="">Any</option>
689 [% 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 %]
690                                                                      </select></li>
691                     <li>
692                         <label for="suggesteddate_from">Suggested date from:</label>
693                         <input type="text" id="suggesteddate_from" size="10" name="suggesteddate_from" value="[% suggesteddate_from %]" />
694                     </li>
695                     <li>
696                         <label for="suggesteddate_to">To:</label>
697                         <input type="text" id="suggesteddate_to" size="10" name="suggesteddate_to" value="[% suggesteddate_to %]" />
698                     </li>
699                     <li><label for="managedby"> Managed by:</label><select id="managedby" name="managedby"><option value="">Any</option>
700 [% 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 %]
701                                                                      </select></li>
702                     <li>
703                         <label for="manageddate_from">Management date from:</label>
704                         <input type="text" id="manageddate_from" size="10" name="manageddate_from" value="[% manageddate_from %]" />
705                     </li>
706                     <li>
707                         <label for="manageddate_to">To:</label>
708                         <input type="text" id="manageddate_to" size="10" name="manageddate_to" value="[% manageddate_to %]" />
709                     </li>
710                     <li><label for="acceptedby"> Accepted by:</label><select id="acceptedby" name="acceptedby"><option value="">Any</option>
711 [% 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 %]
712                                                       </select></li>
713                     <li>
714                         <label for="accepteddate_from">Accepted date from:</label>
715                         <input type="text" id="accepteddate_from" size="10" name="accepteddate_from" value="[% accepteddate_from %]" />
716                     </li>
717                     <li>
718                         <label for="accepteddate_to">To:</label>
719                         <input type="text" id="accepteddate_to" size="10" name="accepteddate_to" value="[% accepteddate_to %]" />
720                     </li>
721                     <li><input type="submit" value="Go" /></li></ol>
722                 </fieldset>
723
724                                 <fieldset class="brief"><h4 class="local_collapse"><a href="#">Acquisition information</a></h4>
725                     <ol><li><label for="budgetid"> Book fund:</label>
726                     <select name="budgetid" id="budgetid">
727                       <option value="__ANY__">Any</option>
728                       [% IF budgetid == '__NONE__' %]
729                           <option value="__NONE__" selected="selected">None</option>
730                       [% ELSE %]
731                           <option value="__NONE__">None</option>
732                       [% END %]
733                     [% FOREACH budgetid_loo IN budgetid_loop %]
734                         [% 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 %]
735                         [% END %]
736                     </select></li>
737                     <li><label for="branchcode">Library:</label>
738                     <select name="branchcode" id="branchcode">
739                         <option value="__ANY__">Any</option>
740                         [% IF branchfilter %]
741                             [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter ) %]
742                         [% ELSE %]
743                             [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
744                         [% END %]
745                     </select></li><li><input type="submit" value="Go" /></li></ol>
746                 </fieldset>
747     </div>
748             </form>
749         [% INCLUDE 'acquisitions-menu.inc' %]
750         </div>
751     [% END %]
752     [% END %]
753 </div>
754 [% END %]
755
756 [% MACRO jsinclude BLOCK %]
757     [% INCLUDE 'calendar.inc' %]
758     [% IF ( op == 'show' || op_else ) %]
759         <script type="text/javascript">
760             $(document).ready(function(){
761                 $(".deletesuggestion").on("click",function(){
762                     return confirm(_("Are you sure you want to delete this suggestion?"));
763                 });
764             });
765         </script>
766     [% END %]
767     [% IF ( op_else ) %]
768         [% INCLUDE 'datatables.inc' %]
769         <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min_[% KOHA_VERSION %].js"></script>
770         <script type="text/javascript">
771             /**
772             *  displayOther.
773             *  This function display the select or an textaera to write a reason.
774             */
775             function displayOther(id,show,hide){
776                 $("#"+hide+id).hide();
777                 $("#"+show+id).show();
778             }
779             $(document).ready(function() {
780                 $('#suggestiontabs').tabs({
781                     // Correct table sizing for tables hidden in tabs
782                     // http://www.datatables.net/examples/api/tabs_and_scrolling.html
783                     "activate": function(event, ui) {
784                         $( $.fn.dataTable.tables( true ) ).DataTable().columns.adjust();
785                     }
786                 });
787                 $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
788                     "aoColumnDefs": [
789                         { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
790                         { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
791                     ],
792                     "sPaginationType": "four_button"
793                 }));
794             [% FOREACH suggestion IN suggestions %]
795                 // functions for [% suggestion.suggestiontype %] interactions
796                 $("#CheckAll[% suggestion.suggestiontype %]").click(function(e){
797                     $("#[% suggestion.suggestiontype %]t").checkCheckboxes();
798                     e.preventDefault();
799                 });
800                 $("#UncheckAll[% suggestion.suggestiontype %]").click(function(e){
801                     $("#[% suggestion.suggestiontype %]t").unCheckCheckboxes();
802                     e.preventDefault();
803                 });
804                 $("#other_reason[% suggestion.suggestiontype %]").hide();
805                 $("#reason[% suggestion.suggestiontype %]").change(function(){
806                     if($(this).val() == "other"){
807                         $(this).hide();
808                         $("#other_reason[% suggestion.suggestiontype %]").show();
809                 }
810                 });
811                 $("#[% suggestion.suggestiontype %]delete").change(function(){
812                     if(this.checked){
813                         $("form[name='f[% suggestion.suggestiontype %]'] input[name=op]").attr("value","delete");
814                     } else {
815                         $("form[name='f[% suggestion.suggestiontype %]'] input[name=op]").attr("value","change");
816                     }
817                 });
818
819             [% END %]
820                 $("a[href*=back]").click(function(){
821                 var sid = $(this).attr("href").replace(/#back/,"");
822                     $("#reason"+sid).show().find("option[value='']").attr("selected","selected");
823                     $("#other_reason"+sid).hide();
824                 });
825                 $("h4.local_collapse a").click(function(){
826                     $(this).parent().parent().find("ol").toggle();
827                     return false;
828                 });
829                 // http://jqueryui.com/demos/datepicker/#date-range
830                 var dates = $( "#suggesteddate_from, #suggesteddate_to" ).datepicker({
831                     changeMonth: true,
832                     numberOfMonths: 1,
833                     onSelect: function( selectedDate ) {
834                         var option = this.id == "suggesteddate_from" ? "minDate" : "maxDate",
835                             instance = $( this ).data( "datepicker" );
836                             date = $.datepicker.parseDate(
837                                 instance.settings.dateFormat ||
838                                 $.datepicker._defaults.dateFormat,
839                                 selectedDate, instance.settings );
840                         dates.not( this ).datepicker( "option", option, date );
841                     }
842                 });
843                 var datesMD = $( "#manageddate_from, #manageddate_to" ).datepicker({
844                     changeMonth: true,
845                     numberOfMonths: 1,
846                     onSelect: function( selectedDate ) {
847                         var option = this.id == "manageddate_from" ? "minDate" : "maxDate",
848                             instance = $( this ).data( "datepicker" );
849                             date = $.datepicker.parseDate(
850                                 instance.settings.dateFormat ||
851                                 $.datepicker._defaults.dateFormat,
852                                 selectedDate, instance.settings );
853                         datesMD.not( this ).datepicker( "option", option, date );
854                     }
855                 });
856                 var datesAD = $( "#accepteddate_from, #accepteddate_to" ).datepicker({
857                     changeMonth: true,
858                     numberOfMonths: 1,
859                     onSelect: function( selectedDate ) {
860                         var option = this.id == "accepteddate_from" ? "minDate" : "maxDate",
861                             instance = $( this ).data( "datepicker" );
862                             date = $.datepicker.parseDate(
863                                 instance.settings.dateFormat ||
864                                 $.datepicker._defaults.dateFormat,
865                                 selectedDate, instance.settings );
866                         datesAD.not( this ).datepicker( "option", option, date );
867                     }
868                 });
869
870                 $("form.update_suggestions").on("submit", function(e){
871                     var form = this;
872                     var action_delete_selected = $(this).find("input[value='delete']").is(":checked");
873                     if ( action_delete_selected ) {
874                         var suggestions_to_delete = $(this).find("input[name='edit_field']:checked");
875                         if ( suggestions_to_delete.length == 0 ) {
876                             alert(_("Please select at least one suggestion to delete"));
877                             e.preventDefault();
878                             return false;
879                         } else if ( suggestions_to_delete.length == 1 ) {
880                             if ( ! confirm(_("Are you sure you want to delete this suggestion?")) ) {
881                                 e.preventDefault();
882                                 return false;
883                             }
884                         } else if ( suggestions_to_delete.length > 1 ) {
885                             if ( ! confirm(_("Are you sure you want to delete these suggestions?")) ) {
886                                 e.preventDefault();
887                                 return false;
888                             }
889                         }
890                     }
891                     return true;
892                 });
893             });
894         </script>
895     [% END %]
896     [% IF ( op_save )  %]
897         <script type="text/javascript">
898             $(document).ready(function(){
899                 calcNewsuggTotal();
900                 $("#quantity,#price,#currency").on("change",function(){
901                     calcNewsuggTotal();
902                 });
903
904                 [% IF other_reason %]
905                     $(".select-reason").hide();
906                     $(".select-reason").find("option[value='other']").attr("selected","selected");
907                     $("#other_reason").show();
908                 [% ELSE %]
909                     $("#other_reason").hide();
910                 [% END %]
911                 $(".select-reason").change(function(){
912                     if($(this).val() == "other"){
913                         $(this).hide();
914                         $("#other_reason").show();
915                     }
916                 });
917                 $("a[href*=back]").click(function(){
918                     $(".select-reason").show().find("option[value='']").attr("selected","selected");
919                     $("#other_reason").hide();
920                 });
921             });
922         </script>
923     [% END %]
924     <script type="text/javascript" src="[% interface %]/[% theme %]/js/acq_[% KOHA_VERSION %].js"></script>
925     <script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu_[% KOHA_VERSION %].js"></script>
926 [% END %]
927
928 [% INCLUDE 'intranet-bottom.inc' %]
929