i18n and repaired holds estimated wait calculation.
authorberick <berick@esilibrary.com>
Mon, 14 Mar 2011 20:43:57 +0000 (16:43 -0400)
committerberick <berick@esilibrary.com>
Mon, 14 Mar 2011 20:43:57 +0000 (16:43 -0400)
Open-ILS/web/templates/default/opac/myopac/holds.tt2
Open-ILS/web/templates/default/opac/parts/header.tt2

index fc56d54..79e3044 100644 (file)
                             [%
                                 IF hold.hold.status == 4;
                                     l("Available");
-                                ELSIF hold.hold.estimated_wait;
-                                    l("Estimated wait (days): ");
-                                    hold.hold.estimated_wait;
+                                ELSIF hold.hold.estimated_wait AND hold.hold.estimated_wait > 0;
+                                    # estimated wait is delivered as seconds.
+                                    SET hwait = POSIX.ceil(hold.hold.estimated_wait / 86400);
+                                    l("Estimated wait: [quant,_1,day,days]", hwait);
                                 ELSIF hold.hold.status == 3;
                                     l("In Transit");
                                 ELSIF hold.hold.status < 3;
index ca33722..b09ae69 100644 (file)
@@ -2,6 +2,7 @@
     USE date;
     USE CGI = CGIUTF8;
     USE EGI18N;
+    USE POSIX;
     SET DATE_FORMAT = l('%m/%d/%Y');
 
     # Don't wrap in l() here; do that where this format string is actually used.