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