]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/main.tt2
LP1981628 follow-up to the follow-up
[Evergreen.git] / Open-ILS / src / templates / opac / myopac / main.tt2
1 [%  PROCESS "opac/parts/header.tt2";
2     PROCESS "opac/parts/misc_util.tt2";
3     WRAPPER "opac/parts/myopac/main_base.tt2";
4     myopac_page = "main";
5     myopac_main_page = "main";
6     myopac_cc_allowed = 0;
7     IF (ctx.fines.grocery.size OR ctx.fines.circulation.size) AND ctx.get_org_setting(ctx.user.home_ou, 'credit.payments.allow') == 1;
8         myopac_cc_allowed = 1;
9     END;
10     neg_or_zero = 0;
11     FOR f IN ctx.fines.circulation;
12         IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END;
13     END;
14     FOR f IN ctx.fines.grocery;
15         IF f.xact.balance_owed <= 0; neg_or_zero = neg_or_zero + 1; END;
16     END;
17     IF neg_or_zero > 0; myopac_cc_allowed = 0; END
18 %]
19 <h3 class="sr-only">[% l('My Account Summary') %]</h3>
20 [%  IF myopac_cc_allowed;
21     # http://www.w3.org/TR/WCAG20-TECHS/H32.html
22     # avoid forms w/ no submit action %]
23 <form action="[% ctx.opac_root %]/myopac/main_payment_form#payment" method="get" id="selected_fines">
24 [% END %]
25
26     [% IF ctx.fines.circulation.size > 0 %]
27     <div id='myopac_circ_trans_div'>
28       <!--moved tables heading to outside of the table itself - took internal styling -->
29         <div class="header_middle">
30            <span class="acct_fines_header">
31            <!-- Different heading when not able to pay -->
32              [% IF myopac_cc_allowed %]
33                 [% l("Pay Selected Circulation Charges") %]
34             [% ELSE %] 
35                 [% l("Circulation Charges") %]
36              [% END %]
37            </span>
38            
39         </div>
40     
41         <table id="acct_fines_main_header" class="table_no_border_space table_no_cell_pad" title="[% l('Items Checked Out') %]">
42             <thead>
43                
44                 <tr>
45
46                    [% IF myopac_cc_allowed %]
47                     <th nowrap="nowrap" style="white-space:nowrap;">
48                         <input id="pay_fines_box1" checked="checked"
49                             type="checkbox" onclick="select_all_checkboxes('xact', this.checked)"
50                             title="[% l('Click to (un)select all charges') %]" />
51                     </th>
52                     [% END %]
53                     <th>[% l("Owed") %]</th>
54                     <th class="mobile_hide">[% l("Billing Type") %]</th>
55                     <th>[% l("Title") %]</th>
56                     <th class='mobile_hide'>[% l("Checkout") %]</th> 
57                     <th>[% l(" Due ") %]</th> 
58                     <th>
59                        <span class="mobile_hide">[% l(" Returned/Renewed") %]</span>
60                        <span class="mobile_view">[% l(" Returned&#42;") %]</span>
61                     </th>
62                     
63                 </tr>
64             </thead>
65             <tbody id='myopac_circ_trans_tbody'>
66                 [% FOR f IN ctx.fines.circulation;
67                     attrs = {marc_xml => f.marc_xml};
68                     IF f.marc_xml;
69                         PROCESS get_marc_attrs args=attrs;
70                     ELSIF f.xact.reservation;
71                         attrs.title = f.xact.reservation.target_resource_type.name;
72                     END %]
73                 <tr id='myopac_circ_trans_row'>
74                     [% IF myopac_cc_allowed %]
75                     <td>
76                         <input type="checkbox" checked="checked" 
77                             title="[% l('Pay this fine') %]" name="xact"
78                             value="[% f.xact.id %]" />
79                     </td>
80                     [% END %]
81                     
82                     <td>
83                         <strong class="alert">
84                             [% money(f.xact.balance_owed)%]
85                         </strong>
86                     </td>
87                     
88                     <td class="mobile_hide">
89                        [% f.xact.last_billing_type %]
90                     </td>
91
92                     <td>
93                         [% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id;
94                         IF recid; %]
95                         <a href="[% mkurl(ctx.opac_root _ '/record/' _ recid,
96                             {loc => ctx.search_ou}) %]">[% attrs.title | html %]</a>
97                         [% ELSE %]
98                         [% attrs.title | html %]
99                         [% END %]
100                     </td>
101                     
102                    <td name='myopac_circ_trans_start' class='mobile_hide'>
103                         [% ts = f.xact.circulation.xact_start || f.xact.reservation.start_time || 0;
104                         IF ts;
105                             date.format(ctx.parse_datetime(ts), DATE_FORMAT);
106                         END %]
107                     </td>
108                     
109                     <td name='myopac_circ_trans_due' >
110                         [% ts = f.xact.circulation.due_date || f.xact.reservation.end_time || 0;
111                            due_org = f.xact.circulation.circ_lib || f.xact.reservation.pickup_lib;
112                         IF ts;
113                             date.format(ctx.parse_datetime(ts, due_org), DATE_FORMAT);
114                         END %]
115                     </td>
116                     
117                     <td name='myopac_circ_trans_finished' >
118                         [%  ts = f.xact.circulation.checkin_time || f.xact.reservation.return_time || 0;
119                             IF ts;
120                                 date.format(ctx.parse_datetime(ts), DATE_FORMAT);
121                             ELSE %]
122                             <!-- XXX TODO fines aren't really accruing
123                                 if circ has hit maxfines. more clarity
124                                 here? --> 
125                             <span class="alert">[% l('(fines accruing)') %]</span>
126                         [%  END %]
127                     </td>
128                    
129                 </tr>
130                 [% END %]
131             </tbody>
132         </table>
133         <!-- Disclaimer for mobile -->
134         <span class="mobile_view cc_disclaimer"> <strong>&#42;</strong>Items may have been renewed. </span>
135     </div>
136     [% END %]
137
138     [% IF ctx.fines.grocery.size > 0 %]
139     <!-- Table for all non-circulation transactions -->
140     <div id='myopac_trans_div'>
141      <br/><br/>
142       <div class="header_middle">
143         <span class="acct_fines_header">
144
145          [% IF myopac_cc_allowed %]
146                 [% l("Pay Selected Other Charges") %]
147              [% ELSE %]
148                 [% l("Other Charges") %]
149              [% END %]
150
151         </span>
152         </div>
153         
154          <table id="acct_fees_main_header" class="table_no_border_space table_no_cell_pad"title="[% l('Other Fines and Fees') %]">
155             <thead>
156                 <tr>
157                 
158                      [% IF myopac_cc_allowed %]
159                     <th  nowrap="nowrap" style="white-space:nowrap;">
160                         <input id="pay_fines_box2" checked="checked"
161                             type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"
162                             title="[% l('Click to (un)select all fines') %]" />
163                     </th>
164                     [% END %]
165                     <th >[% l("Owed") %]</th>
166                     <th >[% l("Billing Type") %]</th>
167                     <th >[% l("Note") %]</th>
168                     <th >[% l("Date") %]</th>
169                     
170
171                 </tr>
172             </thead>
173             <tbody id='myopac_trans_tbody'>
174                 [% FOR f IN ctx.fines.grocery %]
175                 <tr id='myopac_trans_row'>
176                 
177                    [% IF myopac_cc_allowed %]
178                     <td >
179                         <input type="checkbox" title='[% l("Pay this fine") %]'
180                             name="xact_misc" value="[% f.xact.id %]"
181                             checked="checked" />
182                     </td>
183                     [% END %]
184                     
185                     <td class="alert">
186                         <strong>
187                             [% money(f.xact.balance_owed) %]
188                         </strong>
189                     </td>
190                     
191                     <td>[% f.xact.last_billing_type %]</td>
192                     
193                     <td>
194                        [% f.xact.last_billing_note %]
195                     </td>
196                     
197                     <td>[% date.format(
198                             ctx.parse_datetime(f.xact.xact_start),
199                             DATE_FORMAT
200                     ) %]</td>
201
202                 </tr>
203                 [% END %]
204             </tbody>
205         </table>
206    
207     </div>
208     [% END %]
209     [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
210     <div>[% l('You have no current fines.') %]</div>
211     [% ELSIF myopac_cc_allowed %]
212         [% IF neg_or_zero > 0 %]
213             <div class="text-left pad-top-ten">[% l('There are negative bills on your account that must be resolved before you are able to make a payment. Please contact your library for assistance.') %]
214         [% ELSE %]
215             <div class="text-left pad-top-ten">
216                 <input type="submit"
217                     value="[% l('Pay selected charges') %]"
218                     title="[% l('Pay selected charges') %]"
219                     class="opac-button" />
220             </div>
221         [% END %]
222     [% END %]
223 [% IF myopac_cc_allowed %]
224 </form>
225 [% END %]
226
227 [% END %]