]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/place_hold.tt2
LP#1053397 TPAC metarecord search and holds UI
[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     <form method="post">
9         <input type="hidden" name="hold_type" value="[% CGI.param('hold_type') | html %]" />
10         [%  
11             redirect = CGI.param('hold_source_page') || CGI.param('redirect_to') || CGI.referer;
12             # since we have to be logged in to get this far, return to a secure page
13             redirect = redirect.replace('^http:', 'https:') 
14         %]
15         <input type="hidden" name="redirect_to" value="[% redirect | html %]" />
16
17         [% IF ctx.is_staff %]
18         <p class="staff-hold">
19             <input type="radio" id="hold_usr_is_requestor_not"
20                 onchange="staff_hold_usr_input_disabler(this);"
21                 name="hold_usr_is_requestor" value="0"
22                 />
23             <label for="hold_usr_is_requestor_not">
24                 [% l("Place hold for patron by barcode:") %]
25             </label>
26             <input type="text" name="hold_usr" id="hold_usr_input" onchange="staff_hold_usr_barcode_changed();" onpaste="setTimeout(staff_hold_usr_barcode_changed,1);" onkeypress="return no_hold_submit(event)" autofocus /> <span id="patron_name"></span><span id="patron_usr_barcode_not_found" style="display: none">[% l('Patron barcode was not found') %]</span><br />
27             <input type="hidden" id="staff_barcode" value="[% ctx.staff_recipient.card.barcode | html %]"/>
28             <span>
29                 <input type="radio" id="hold_usr_is_requestor"
30                     onchange="staff_hold_usr_input_disabler(this);"
31                     name="hold_usr_is_requestor" value="1" />
32                 <label for="hold_usr_is_requestor">
33                     [% l("Place this hold for me ([_1] [_2])", ctx.user.first_given_name, ctx.user.family_name) | html %]
34                 </label>
35             </span>
36         </p>
37         [% END %]
38
39         <!-- loop through the holds and display status of request where appropriate -->
40         <table id='hold-items-list'>
41         [% FOR hdata IN ctx.hold_data;
42             attrs = {marc_xml => hdata.marc_xml};
43             PROCESS get_marc_attrs args=attrs %]
44             <tr>
45                 <td>
46                     <input type="hidden" name="hold_target" value="[% hdata.target.id | html %]" />
47                     <div class='hold-items-list-title'>[% attrs.title_extended | html %]</div>
48                     [% IF hdata.parts %]
49                         [% IF hdata.parts.size > 0 %]
50                         <div style='padding-left: 10px'>
51                             <span><label for='select_hold_part'>[%
52                                 hdata.part_required ? l('Select a Part:') : l('Select a Part (optional):')
53                             %]</label></span>
54                             <select id='select_hold_part' name='part'>
55                                 [% IF !hdata.part_required %]
56                                 <option selected='selected' value=''>[% l('- All Parts -') %]</option>
57                                 [% END %]
58                                 [% FOR part IN hdata.parts %]
59                                 <option value='[% part.id %]'>[% part.label | html %]</option>
60                                 [% END %]
61                             </select>
62                         </div>
63                         [% ELSE %]
64                         <input type='hidden' name='part' value=''/>
65                         [% END %]
66                     [% END %]
67                     [% IF NOT metarecords.disabled %]
68                         [% IF CGI.param('hold_type') == 'T' AND hdata.record.metarecord %]
69                             <a href="[% mkurl('', {hold_type => 'M', hold_target => hdata.record.metarecord.id}) %]">
70                                 [% l('Advanced Hold Options') %]</a>
71                         [% END %]
72                         [% IF hdata.metarecord_filters.formats.size OR # should this be size > 1
73                             hdata.metarecord_filters.langs.size > 1;
74                             PROCESS metarecord_hold_filters_selector hold_data=hdata;
75                         END;
76                     END %]
77                 </td>
78             </tr>
79         [% END %]
80         </table>
81
82         <p>
83             [%- org_select_id = 'pickup_lib'; -%]
84             <label for="[% org_select_id %]">[%l('Pickup location:') %]</label>
85             [% PROCESS "opac/parts/org_selector.tt2";
86                 INCLUDE build_org_selector name='pickup_lib' 
87                     value=ctx.default_pickup_lib id=org_select_id 
88                     can_have_vols_only=1 hold_pickup_lib=1 %]
89         </p>
90         <p>
91             [% l('Notify when hold is ready for pickup?') %]
92             <blockquote>
93                 <input type="checkbox" id="email_notify" name="email_notify" value="t"
94                     [% IF !ctx.user.email %]disabled="true"[% ELSIF ctx.default_email_notify %]checked="checked"[% END %]/>
95                     <label for="email_notify">[% l('Yes, by Email') %]</label><br/>
96                 <blockquote>
97                     [% IF !ctx.user.email and !ctx.is_staff; l('No configured Email address. See "My Account" for setting your Email address.');
98                      ELSE; l('Email Address:') %] <span name="email_address">[% ctx.user.email %]</span>[% END %]
99                 </blockquote>
100                 [%- IF allow_phone_notifications == 'true' %]
101                 <input type="checkbox" id="phone_notify_checkbox" name="phone_notify_checkbox"
102                     [% IF ctx.default_phone_notify %]checked="checked"[% END %]/>
103                     <label for="phone_notify_checkbox">[% l('Yes, by Phone') %]</label><br/>
104                 <blockquote>
105                     <label>[% l('Phone Number:') %]<input type="text" name="phone_notify" [% setting = 'opac.default_phone';
106                     IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]'
107                     [%- ELSIF ctx.user.day_phone; %] value='[% ctx.user.day_phone | html %]' [% END %]/></label>
108                 </blockquote>
109                 [%- END -%]
110                 [% IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1 %]
111                 <input type="checkbox" id="sms_notify_checkbox" name="sms_notify_checkbox"
112                     [% IF ctx.default_sms_notify %]checked="checked"[% END %]/>
113                     <label for="sms_notify_checkbox">[% l('Yes, by Text Messaging') %]</label><br/>
114                 <blockquote>
115                     [% INCLUDE "opac/parts/sms_carrier_selector.tt2" %]<br/>
116                     [% INCLUDE "opac/parts/sms_number_textbox.tt2" %]<br/>
117                 </blockquote>
118                 [% END %]
119             </blockquote>
120         </p>
121         <input id="place_hold_submit" type="submit" name="submit" value="[% l('Submit') %]" title="[% l('Submit') %]"
122             alt="[% l('Submit') %]" class="opac-button" />
123         <input type="reset" name="cancel" onclick="javascript:history.go(-1);"
124             value="[% l('Cancel') %]" id="holds_cancel" class="opac-button" />
125     </form>
126 </div>
127