]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/opac/parts/place_hold.tt2
LP1423922: Quick staff option to place another hold
[Evergreen.git] / Open-ILS / src / templates / opac / parts / place_hold.tt2
1 [%  PROCESS "opac/parts/misc_util.tt2";
2     PROCESS "opac/parts/hold_error_messages.tt2";
3     PROCESS "opac/parts/metarecord_hold_filters.tt2";
4 %]
5
6 <div id='holds_box' class='canvas' style='margin-top: 6px;'>
7     <h1>[% l('Place Hold') %]</h1>
8
9     [% some_holds_allowed = -1 %]
10       
11     <form method="post">
12         <input type="hidden" name="hold_type" value="[% CGI.param('hold_type') | html %]" />
13         [%  
14             redirect = CGI.param('hold_source_page') || CGI.param('redirect_to') || CGI.referer;
15             # since we have to be logged in to get this far, return to a secure page
16             redirect = redirect.replace('^http:', 'https:') 
17         %]
18         <input type="hidden" name="redirect_to" value="[% redirect | html %]" />
19         <input type="hidden" name="hold_source_page" value="[% CGI.param('hold_source_page') | html %]" />
20
21         [% IF ctx.is_staff %]
22         <p class="staff-hold">
23             <input type="radio" id="hold_usr_is_requestor_not"
24                 onchange="staff_hold_usr_input_disabler(this);"
25                 name="hold_usr_is_requestor" value="0"
26                 />
27             <label for="hold_usr_is_requestor_not">
28                 [% l("Place hold for patron by barcode:") %]
29             </label>
30             <input type="text" name="hold_usr" id="hold_usr_input" 
31               value="[% CGI.param('usr_barcode') | html %]"
32               onchange="staff_hold_usr_barcode_changed();" 
33               onpaste="setTimeout(staff_hold_usr_barcode_changed,1);" 
34               onkeypress="return no_hold_submit(event)" autofocus /> 
35             <span id="patron_name"></span>
36             <span id="patron_usr_barcode_not_found" style="display: none">
37               [% l('Patron barcode was not found') %]
38             </span><br />
39             <input type="hidden" id="staff_barcode" 
40               value="[% ctx.staff_recipient.card.barcode | html %]"/>
41             <span>
42                 <input type="radio" id="hold_usr_is_requestor"
43                     onchange="staff_hold_usr_input_disabler(this);"
44                     name="hold_usr_is_requestor" value="1" />
45                 <label for="hold_usr_is_requestor">
46                     [% l("Place this hold for me ([_1] [_2])", ctx.user.first_given_name, ctx.user.family_name) | html %]
47                 </label>
48             </span>
49         </p>
50         [% END %]
51
52         <!-- loop through the holds and display status of request where appropriate -->
53         <table id='hold-items-list'>
54         [% FOR hdata IN ctx.hold_data;
55             attrs = {marc_xml => hdata.marc_xml};
56             PROCESS get_marc_attrs args=attrs;
57             this_hold_disallowed = 0;
58
59             IF CGI.param('hold_type') == 'M';
60               IF hdata.metarecord_filters.formats.size == 0;
61                 this_hold_disallowed = 1;
62                 # if this is the first hold and it's disallowed, 
63                 # assume all holds are, until we proven otherwise
64                 SET some_holds_allowed = 0 IF some_holds_allowed == -1;
65               ELSE; some_holds_allowed = 1; END;
66             END %]
67
68             <tr>
69                 <td>
70                     [% IF !this_hold_disallowed %]
71                     <input type="hidden" name="hold_target" value="[% hdata.target.id | html %]" />
72                     [% END %]
73                     <div class='hold-items-list-title'>[% attrs.title_extended | html %]</div>
74                     [% IF hdata.parts AND !this_hold_disallowed %]
75                         [% IF hdata.parts.size > 0 %]
76                         <div style='padding-left: 10px'>
77                             <span><label for='select_hold_part'>[%
78                                 hdata.part_required ? l('Select a Part:') : l('Select a Part (optional):')
79                             %]</label></span>
80                             <select id='select_hold_part' name='part'>
81                                 [% IF !hdata.part_required %]
82                                 <option selected='selected' value=''>[% l('- All Parts -') %]</option>
83                                 [% END %]
84                                 [% FOR part IN hdata.parts %]
85                                 <option value='[% part.id %]'>[% part.label | html %]</option>
86                                 [% END %]
87                             </select>
88                         </div>
89                         [% ELSE %]
90                         <input type='hidden' name='part' value=''/>
91                         [% END %]
92                     [% END %]
93                     [% IF NOT metarecords.disabled %]
94                         [% IF CGI.param('hold_type') == 'T' AND hdata.record.metarecord %]
95                             <a  id='advanced_hold_link'
96                                 href="[% mkurl('', {hold_type => 'M', hold_target => hdata.record.metarecord.id}) %]">
97                                 [% l('Advanced Hold Options') %]</a>
98                         [% END %]
99                         [% IF hdata.metarecord_filters.formats.size OR # should this be size > 1
100                             (hdata.metarecord_filters.langs.size && hdata.metarecord_filters.langs.size > 1);
101                             PROCESS metarecord_hold_filters_selector hold_data=hdata;
102                         END;
103                     END %]
104                 </td>
105             </tr>
106
107             [% IF this_hold_disallowed %]
108               <tr><td>
109                 <div class="mr_holds_no_formats">
110                 [% l('This item does not have any formats available for holds placement') %]
111                 </div>
112               </td></tr>
113             [% END %]
114
115             [%  IF !loop.last AND ctx.hold_data.size > 1 %]
116             <tr class="holds_item_row_separator"><td> </td></tr>
117             [% END %]
118
119         [% END %]
120         </table>
121
122         [% IF some_holds_allowed %]
123
124         <p>
125             [%- org_select_id = 'pickup_lib'; -%]
126             <label for="[% org_select_id %]">[%l('Pickup location:') %]</label>
127             [% PROCESS "opac/parts/org_selector.tt2";
128                 INCLUDE build_org_selector name='pickup_lib' 
129                     value=ctx.default_pickup_lib id=org_select_id 
130                     can_have_vols_only=1 hold_pickup_lib=1 %]
131         </p>
132         <p>
133             [% l('Notify when hold is ready for pickup?') %]
134             <blockquote>
135                 <input type="checkbox" id="email_notify" name="email_notify" value="t"
136                     [% IF !ctx.user.email %]disabled="true"[% ELSIF ctx.default_email_notify %]checked="checked"[% END %]/>
137                     <label for="email_notify">[% l('Yes, by Email') %]</label><br/>
138                 <blockquote>
139                     [% IF !ctx.user.email and !ctx.is_staff; l('No configured Email address. See "My Account" for setting your Email address.');
140                      ELSE; l('Email Address:') %] <span name="email_address">[% ctx.user.email %]</span>[% END %]
141                 </blockquote>
142                 [%- IF allow_phone_notifications == 'true' %]
143                 <input type="checkbox" id="phone_notify_checkbox" name="phone_notify_checkbox"
144                     [% IF ctx.default_phone_notify %]checked="checked"[% END %]/>
145                     <label for="phone_notify_checkbox">[% l('Yes, by Phone') %]</label><br/>
146                 <blockquote>
147                     <label>[% l('Phone Number:') %]<input type="text" name="phone_notify" [% setting = 'opac.default_phone';
148                     IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]'
149                     [%- ELSIF ctx.user.day_phone; %] value='[% ctx.user.day_phone | html %]' [% END %]/></label>
150                 </blockquote>
151                 [%- END -%]
152                 [% IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1 %]
153                 <input type="checkbox" id="sms_notify_checkbox" name="sms_notify_checkbox"
154                     [% IF ctx.default_sms_notify %]checked="checked"[% END %]/>
155                     <label for="sms_notify_checkbox">[% l('Yes, by Text Messaging') %]</label><br/>
156                 <blockquote>
157                     [% INCLUDE "opac/parts/sms_carrier_selector.tt2" %]<br/>
158                     [% INCLUDE "opac/parts/sms_number_textbox.tt2" %]<br/>
159                 </blockquote>
160                 [% END %]
161             </blockquote>
162         </p>
163         <input id="place_hold_submit" type="submit" name="submit" 
164             value="[% l('Submit') %]" title="[% l('Submit') %]"
165             alt="[% l('Submit') %]" class="opac-button" />
166         [% END # some_holds_allowed %]
167         <input type="reset" name="cancel" onclick="javascript:history.go(-1);"
168             value="[% l('Cancel') %]" id="holds_cancel" class="opac-button" />
169     </form>
170 </div>
171