]> git.koha-community.org Git - koha.git/blob - koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt
Bug 19287: Add ability to mark an item 'Lost' from 'Holds to pull' list
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / pendingreserves.tt
1 [% USE Asset %]
2 [% USE Koha %]
3 [% USE KohaDates %]
4 [% USE ColumnsSettings %]
5 [% USE AuthorisedValues %]
6 [%- USE Branches -%]
7 [%- USE ItemTypes -%]
8 [% SET footerjs = 1 %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Koha &rsaquo; Circulation &rsaquo; Holds to pull</title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 [% Asset.css("css/datatables.css") %]
13 </head>
14
15 <body id="circ_pendingreserves" class="circ">
16 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'circ-search.inc' %]
18
19
20 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; Holds to pull</div>
21
22 <div id="doc3" class="yui-t2">
23
24    <div id="bd">
25     <div id="yui-main">
26     <div class="yui-b">
27         [% FOR m IN messages %]
28             <div class="dialog [% m.type %]">
29                 [% SWITCH m.code %]
30                 [% CASE 'letter_enqueued' %]
31                     <span>The notice has been correctly enqueued.</span>
32                 [% CASE 'no_email_address' %]
33                     <span>The patron does not have an email address defined.</span>
34                 [% CASE 'no_template_notice' %]
35                     <span>There is no notice template with a code 'CANCEL_HOLD_ON_LOST' defined in your system.</span>
36                 [% CASE 'hold_cancelled' %]
37                     <span>The hold has been correctly cancelled.</span>
38                 [% CASE 'hold_placed_at_biblio_level' %]
39                     <span>The hold has been placed at biblio level. It is not possible to mark it as lost.</span>
40                 [% CASE %]
41                     [% m.code %]
42                 [% END %]
43             </div>
44         [% END %]
45
46 <h2>Holds to pull placed between [% from | $KohaDates %] and [% to | $KohaDates %]</h2>
47 <h3>Reported on [% todaysdate | $KohaDates %]</h3>
48 <p>The following holds have not been filled. Please retrieve them and check them in.</p>
49 <div class="searchresults">
50     [% IF ( reserveloop ) %]
51     <table id="holdst">
52     <thead>
53         <tr>
54         <th>Pull this many items</th>
55         <th>Items available</th>
56         <th>Patrons with holds</th>
57         <th>First patron</td>
58         <th class="anti-the">Title</th>
59         <th class="string-sort">Libraries</th>
60         <th>Available call numbers</th>
61         <th>Available copy numbers</th>
62         <th>Available enumeration</th>
63         <th class="string-sort">Available itypes</th>
64         <th class="string-sort">Available locations</th>
65         <th class="title-string">Earliest hold date</th>
66         <th>Action</th>
67         </tr>
68     </thead>
69     <tbody>
70         [% FOREACH reserveloo IN reserveloop %]
71         <tr>
72         [% IF ( reserveloo.borrowernumber ) %]
73             <td><p><b>[% reserveloo.pullcount %]</b></p></td>
74             <td>[% reserveloo.count %]</td>
75             <td>[% reserveloo.rcount %]</td>
76             <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserveloo.borrowernumber %]">[% reserveloo.firstname %] [%reserveloo.surname %]</a></td>
77             <td>
78             <p>
79                 [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %]
80                 [% reserveloo.title |html %] [% FOREACH s IN reserveloo.subtitle %] [% s %][% END %]</a></p>
81                 [% IF ( reserveloo.author ) %]<p> by [% reserveloo.author %]</p>[% END %]
82             </td>
83         [% ELSE %]
84             <td>"</td>
85             <td>"</td>
86             <td>"</td>
87             <td>"</td>
88             <td>"</td>
89         [% END %]
90         <td>
91             [% FOREACH holdingbranch IN reserveloo.holdingbranches %]
92                 [% Branches.GetName ( holdingbranch ) %]<br>
93             [% END %]
94         </td>
95         <td><p>[% reserveloo.itemcallnumber %]</p></td>
96         <td><p>[% reserveloo.copyno %]</p></td>
97         <td><p>[% reserveloo.enumchron %]</p></td>
98         <td>
99         [% FOREACH itype IN reserveloo.itypes %]
100             [% ItemTypes.GetDescription( itype ) %]
101         [% END %]
102         </td>
103         <td>
104         [% FOREACH loc IN reserveloo.locations %]
105             [% AuthorisedValues.GetByCode('LOC', loc) %]<br>
106         [% END %]
107         </td>
108         <td>
109             <span title="[% reserveloo.reservedate %]">[% reserveloo.reservedate | $KohaDates %] in [% Branches.GetName ( reserveloo.branch ) %]</span>
110         </td>
111         <td>
112             <form name="cancelReserve" action="/cgi-bin/koha/circ/pendingreserves.pl" method="post">
113                 <input type="hidden" name="op" value="cancel_reserve" />
114                 <input type="hidden" name="reserve_id" value="[% reserveloo.reserve_id %]" />
115                 [% IF reserveloo.holdingbranch != reserveloo.homebranch %]
116                     <input type="submit" value="Cancel hold and return to : [% Branches.GetName( reserveloo.homebranch ) %]" />
117                 [% ELSE %]
118                     <input type="submit" value="Cancel hold" />
119                 [% END %]
120             </form>
121
122         [% IF Koha.Preference('CanMarkHoldsToPullAsLost') != 'do_not_allow' %]
123             <form name="cancelReserve" action="/cgi-bin/koha/circ/pendingreserves.pl" method="post">
124                 <input type="hidden" name="reserve_id" value="[% reserveloo.reserve_id %]" />
125                 [% IF Koha.Preference('CanMarkHoldsToPullAsLost') == 'allow' %]
126                     <input type="hidden" name="op" value="mark_as_lost" />
127                     <input type="submit" value="Mark item as lost" />
128                 [% ELSIF Koha.Preference('CanMarkHoldsToPullAsLost') == 'allow_and_notify' %]
129                     <input type="hidden" name="op" value="mark_as_lost_and_notify" />
130                     <input type="submit" value="Mark item as lost and notify the patron" />
131                 [% END %]
132             </form>
133         [% END %]
134         </tr>
135         [% END %]
136     </tbody>
137     <tfoot>
138         <tr>
139         <td><input type="text" class="filter" data-column_num="0" placeholder="Pull this many items" style="width:95%"/></td>
140         <td><input type="text" class="filter" data-column_num="1" placeholder="Items available" style="width:95%"/></td>
141         <td><input type="text" class="filter" data-column_num="2" placeholder="Patron holds" style="width:95%"/></td>
142         <td><input type="text" class="filter" data-column_num="3" placeholder="Patron name" style="width:95%"/></td>
143         <td><input type="text" class="filter" data-column_num="4" placeholder="Title" style="width:95%"/></td>
144         <td id="homebranchfilter"></td>
145         <td><input type="text" class="filter" data-column_num="6" placeholder="Call number" style="width:95%"/></td>
146         <td><input type="text" class="filter" data-column_num="7" placeholder="Available copy" style="width:95%"/></td>
147         <td><input type="text" class="filter" data-column_num="8" placeholder="Available enumeration" style="width:95%"/></td>
148         <td id="itypefilter"></td>
149         <td id="locationfilter"></td>
150         <td></td>
151         <td></td>
152         </tr>
153     </tfoot>
154     </table>
155     [% ELSE %]
156         <b>No items found.</b>
157     [% END %]
158 </div>
159
160 </div>
161 </div>
162 <div class="yui-b">
163 <div id="filters">
164
165 <form action="/cgi-bin/koha/circ/pendingreserves.pl" method="post" >
166 <fieldset class="brief">
167 <h4>Refine results</h4>
168 <ol>
169 <li>
170 <label for="from">
171     Start date:
172 </label>
173 <input type="text" size="10" id="from" name="from" value="[% from | $KohaDates %]" class="datepickerfrom" />
174 </li>
175 <li><label for="to">
176     End date:
177 </label>
178 <input type="text" size="10" id="to" name="to" value="[% to | $KohaDates %]" class="datepickerto" />
179 </li>
180 </ol>
181
182 [% IF ( HoldsToPullEndDate ) %]
183     <p><i>(Inclusive, default is [% HoldsToPullStartDate %] days ago to [% HoldsToPullEndDate %] days ahead. Set other date ranges as needed.)</i></p>
184 [% ELSE %]
185     <p><i>(Inclusive, default is [% HoldsToPullStartDate %] days ago to today. Set other date ranges as needed.)</i></p>
186 [% END %]
187
188 <fieldset class="action"><input type="submit" name="run_report" value="Submit" class="submit"/></fieldset>
189 </fieldset>
190 </form>
191
192 </div>
193 </div>
194 </div>
195
196 [% MACRO jsinclude BLOCK %]
197     [% INCLUDE 'calendar.inc' %]
198     [% INCLUDE 'datatables.inc' %]
199     [% INCLUDE 'columns_settings.inc' %]
200     <script type="text/javascript">
201         $(document).ready(function() {
202           var columns_settings = [% ColumnsSettings.GetColumns('circ', 'holds', 'holds-to-pull', 'json') %];
203           var holdst = KohaTable("holdst", {
204             "aoColumnDefs": [
205                 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
206                 { "sType": "title-string", "aTargets" : [ "title-string" ] },
207                 { "sType": "string", "aTargets": [ "string-sort" ] } //Target columns that use <br> separators and pull-down menus.
208             ],
209             "sPaginationType": "full_numbers"
210           }, columns_settings);
211           holdst.fnAddFilters("filter");
212           [%# add separateData function to cleanse jQuery select lists by breaking apart strings glued with BR tags and then de-duplicating any repeated library codes %]
213           function separateData ( ColumnData ){
214             var cD = ColumnData;
215             var new_array = new Array();
216             for ( j=0 ; j<cD.length ; j++ ) {
217                 var split_array = cD[j].split(/<br>/gi);
218                 for ( k=0 ; k<split_array.length ; k++ ){
219                     var str = $.trim(split_array[k].replace(/[\n\r]/g, ''));
220                     if ($.inArray(str, new_array) == -1 && str.length > 0 ) {
221                         new_array.push(str);
222                     }
223                 }
224             }
225             new_array.sort();
226             return new_array;
227           }
228           [%# add SeparateData function into createSelect function, so that it does the createSelect on clean data %]
229           function createSelect( data ) {
230               data = separateData(data);
231               var r='<select style="width:99%"><option value="">' + _("None") + '</option>', i, len=data.length;
232               for ( i=0 ; i<len ; i++ ) {
233                   r += '<option value="'+data[i]+'">'+data[i]+'</option>';
234               }
235               return r+'</select>';
236           }
237           $("#homebranchfilter").each( function () {
238               $(this).html( createSelect( holdst.fnGetColumnData(5) ) );
239               $('select', this).change( function () {
240                   var filter_value = $(this).val();
241                   holdst.fnFilter( filter_value, 5, true );
242               });
243           });
244           $("#itypefilter").each( function () {
245               $(this).html( createSelect( holdst.fnGetColumnData(9) ) );
246               $('select', this).change( function () {
247                   holdst.fnFilter( $(this).val(), 9 );
248               });
249           });
250           $("#locationfilter").each( function () {
251               $(this).html( createSelect( holdst.fnGetColumnData(10) ) );
252               $('select', this).change( function () {
253                   holdst.fnFilter( $(this).val(), 10 );
254               });
255           });
256         });
257     </script>
258 [% END %]
259
260 [% INCLUDE 'intranet-bottom.inc' %]