Fix for Bug 4073, Add globally template variable for dateformat setting
authorOwen Leonard <oleonard@myacpl.org>
Thu, 28 Jan 2010 14:48:54 +0000 (09:48 -0500)
committerGalen Charlton <gmcharlt@gmail.com>
Tue, 2 Feb 2010 23:37:37 +0000 (18:37 -0500)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
C4/Auth.pm

index ea10d16..90ce2b8 100755 (executable)
@@ -324,6 +324,18 @@ sub get_template_and_user {
            }
        }
 
+    if(C4::Context->preference('dateformat')){
+        if(C4::Context->preference('dateformat') eq "metric"){
+            $template->param(dateformat_metric => 1);
+        } elsif(C4::Context->preference('dateformat') eq "us"){
+            $template->param(dateformat_us => 1);
+        } else {
+            $template->param(dateformat_iso => 1);
+        }
+    } else {
+        $template->param(dateformat_iso => 1);
+    }
+
     # these template parameters are set the same regardless of $in->{'type'}
     $template->param(
             "BiblioDefaultView".C4::Context->preference("BiblioDefaultView")         => 1,