]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/opac/parts/hold_status.tt2
LP#1612274: Improve display of holds status in My Account
[Evergreen.git] / Open-ILS / src / templates / opac / parts / hold_status.tt2
1 [% BLOCK get_hold_status %]
2     <div>
3     [%
4         IF hold.hold.status == 4;
5             l("Available") | html;
6             IF ahr.shelf_expire_time;
7                 '<br/>';
8                 l('Expires [_1]',
9                     date.format(ctx.parse_datetime(ahr.shelf_expire_time), DATE_FORMAT)) | html;
10             END;
11
12         ELSIF hold.hold.status == 6;
13                l("Canceled [_1]",
14                   date.format(ctx.parse_datetime(ahr.cancel_time), DATE_FORMAT)) | html;
15
16         ELSIF hold.hold.status == 7;
17                l("Suspended") | html;
18                IF ahr.thaw_date;
19                    "<br/>";
20                    l("Activate On [_1]",
21                        date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT)) | html;
22                END;
23
24         ELSIF hold.hold.status == 9;
25                l("Fulfilled [_1]",
26                   date.format(ctx.parse_datetime(ahr.fulfillment_time), DATE_FORMAT))| html;
27
28         ELSIF hold.hold.estimated_wait AND hold.hold.estimated_wait > 0;
29             # estimated wait is delivered as seconds.
30             SET hwait = POSIX.ceil(hold.hold.estimated_wait / 86400);
31             l("Estimated wait: [quant,_1,day,days]", hwait) | html;
32
33         ELSIF hold.hold.status == 3 OR hold.hold.status == 8;
34             l("In Transit") | html;
35
36         ELSIF hold.hold.status < 3;
37             l("Waiting for copy") | html;
38         END
39     %]
40     </div>
41     <div>
42         [% # Only show the count for holds that have not been captured
43            IF hold.hold.status < 3 OR hold.hold.status == 7;
44              l('Hold #[_1] on [quant,_2, copy, copies]',
45               hold.hold.queue_position, hold.hold.potential_copies) | html;
46           END
47         %]
48     </div>
49 [% END %]
50