]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/main.tt2
TPAC: repair staff client End link for showing last record
[working/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 <form action="[% ctx.opac_root %]/myopac/main_payment_form" method="GET">
12     [% IF ctx.fines.circulation.size > 0 %]
13     <div id='myopac_circ_trans_div'>
14         <table width='100%' class='data_grid'>
15             <thead>
16                 <tr>
17                     <td colspan='10' style='padding: 6px'>
18                         <strong>[% l("Fines") %]</strong>
19                     </td>
20                 </tr>
21                 <tr>
22                     <td>[% l("Title") %]</td>
23                     <td>[% l("Author") %]</td>
24                     <td>[% l("Checkout Date") %]</td>
25                     <td>[% l("Due Date") %]</td>
26                     <td>[% l("Date Returned") %]</td>
27                     <td>[% l("Balance Owed") %]</td>
28                     [% IF myopac_cc_allowed %]
29                     <td nowrap="nowrap" style="white-space:nowrap;">
30                         <input id="pay_fines_box1" checked="checked"
31                             type="checkbox" onclick="select_all_checkboxes('xact', this.checked)"
32                             title="[% l('Click to (un)select all fines') %]" />
33                         <label for="pay_fines_box1">[% l('Pay Fines') %]</label>
34                     </td>
35                     [% END %]
36                 </tr>
37             </thead>
38             <tbody id='myopac_circ_trans_tbody'>
39                 [% FOR f IN ctx.fines.circulation;
40                     attrs = {marc_xml => f.marc_xml};
41                     IF f.marc_xml;
42                         PROCESS get_marc_attrs args=attrs;
43                     ELSIF f.xact.reservation;
44                         attrs.title = f.xact.reservation.target_resource_type.name;
45                     END %]
46                 <tr id='myopac_circ_trans_row'>
47                     <td>
48                         [% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id;
49                         IF recid; %]
50                         <a href="[% mkurl(ctx.opac_root _ '/record/' _ recid,
51                             {loc => ctx.search_ou}) %]">[% attrs.title | html %]</a>
52                         [% ELSE %]
53                         [% attrs.title | html %]
54                         [% END %]
55                     </td>
56                     <td>[%- author_query = attrs.author.replace('[,\.:;]', ''); %]
57                         <a href="[% mkurl(ctx.opac_root _ '/results',
58                             {qtype => 'author', query => author_query,
59                             loc => ctx.search_ou}) %]">[% attrs.author | html %]</a>
60                     </td>
61                     <td name='myopac_circ_trans_start'>
62                         [% ts = f.xact.circulation.xact_start || f.xact.reservation.start_time || 0;
63                         IF ts;
64                             date.format(ctx.parse_datetime(ts), DATE_FORMAT);
65                         END %]
66                     </td>
67                     <td name='myopac_circ_trans_due'>
68                         [% ts = f.xact.circulation.due_date || f.xact.reservation.end_time || 0;
69                         IF ts;
70                             date.format(ctx.parse_datetime(ts), DATE_FORMAT);
71                         END %]
72                     </td>
73                     <td name='myopac_circ_trans_finished'>
74                         [%  ts = f.xact.circulation.checkin_time || f.xact.reservation.return_time || 0;
75                             IF ts;
76                                 date.format(ctx.parse_datetime(ts), DATE_FORMAT);
77                             ELSE %]
78                             <!-- XXX TODO fines aren't really accruing
79                                 if circ has hit maxfines. more clarity
80                                 here? -->
81                             <span class="alert">[% l('(fines accruing)') %]</span>
82                         [%  END %]
83                     </td>
84                     <td>
85                         <strong class="alert">
86                             [% money(f.xact.balance_owed) %]
87                         </strong>
88                     </td>
89                     [% IF myopac_cc_allowed %]
90                     <td>
91                         <input type="checkbox" checked="checked" 
92                             title="[% l('Pay this fine') %]" name="xact"
93                             value="[% f.xact.id %]" />
94                     </td>
95                     [% END %]
96                 </tr>
97                 [% END %]
98             </tbody>
99         </table>
100     </div>
101     [% END %]
102
103     [% IF ctx.fines.grocery.size > 0 %]
104     <!-- Table for all non-circulation transactions -->
105     <div id='myopac_trans_div'>
106         <br/>
107         <hr class='opac-auto-013'  color="#dcdbdb" />
108         <br/>
109         <table width='100%' class='data_grid data_grid_center'
110             id='myopac_trans_table'>
111             <thead>
112                 <tr>
113                     <td colspan='8' style='padding: 6px'>
114                         <b>[% l("Other Fees") %]</b>
115                     </td>
116                 </tr>
117                 <tr>
118                     <td width='16%'>[% l("Transaction Start Time") %]</td>
119                     <td width='16%'>[% l("Last Payment Time") %]</td>
120                     <td width='16%'>[% l("Initial Amount Owed") %]</td>
121                     <td width='16%'>[% l("Total Amount Paid") %]</td>
122                     <td width='16%'>[% l("Balance Owed") %]</td>
123                     <td width='16%'>[% l("Billing Type") %]</td>
124                     [% IF myopac_cc_allowed %]
125                     <td width='4%' align="center" nowrap="nowrap"
126                         style="white-space:nowrap;">
127                         <input id="pay_fines_box2" checked="checked"
128                             type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"
129                             title="[% l('Click to (un)select all fines') %]" />
130                         <label for="pay_fines_box2">[% l("Pay Fines") %]</label>
131                     </td>
132                     [% END %]
133                 </tr>
134             </thead>
135             <tbody id='myopac_trans_tbody'>
136                 [% FOR f IN ctx.fines.grocery %]
137                 <tr id='myopac_trans_row'>
138                     <td>[% date.format(
139                             ctx.parse_datetime(f.xact.xact_start),
140                             DATE_FORMAT
141                     ) %]</td>
142                     <td>
143                         [%  IF f.xact.last_payment_ts;
144                                 date.format(
145                                     ctx.parse_datetime(
146                                         f.xact.last_payment_ts
147                                     ), DATE_FORMAT
148                                 );
149                             END %]
150                     </td>
151                     <td>[% money(f.xact.total_owed) %]</td>
152                     <td>[% money(f.xact.total_paid) %]</td>
153                     <td class="alert">
154                         <strong>
155                             [% money(f.xact.balance_owed) %]
156                         </strong>
157                     </td>
158                     <td>[% f.xact.last_billing_type %]</td>
159                     [% IF myopac_cc_allowed %]
160                     <td>
161                         <input type="checkbox" title='[% l("Pay this fine") %]'
162                             name="xact_misc" value="[% f.xact.id %]"
163                             checked="checked" />
164                     </td>
165                     [% END %]
166                 </tr>
167                 [% END %]
168             </tbody>
169         </table>
170     </div>
171     [% END %]
172     [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
173     <div>[% l('You have no current fines.') %]</div>
174     [% ELSIF myopac_cc_allowed %]
175     <div class="text-right pad-top-ten">
176         <input type="submit"
177             value="[% l('Pay selected fines') %]"
178             alt="[% l('Pay selected fines') %]"
179             title="[% l('Pay selected fines') %]"
180             class="opac-button" />
181     </div>
182     [% END %]
183 </form>
184 [% END %]