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