Bug 15288: Error pages: Code duplication removal and better translatability
authorMarc Véron <veron@veron.ch>
Wed, 2 Dec 2015 08:49:02 +0000 (09:49 +0100)
committerBrendan A Gallagher <brendan@bywatersolutions.com>
Wed, 27 Jan 2016 05:57:34 +0000 (05:57 +0000)
This patch changes the 400, 401, 402, 403, 404, 500 error pages to be handled
by only one template for staff and only one template for OPAC.

Additionally it removes a translatability issues due to sentence splitings by html tags.

To test:
- Apply patch
- Trigger 404 error for staff and for OPAC by calling a page that does not exist
- Try to trigger other error pages and/or carefully review code changes
  in the *.pl files
- Review koha-tmpl/opac-tmpl/bootstrap/en/modules/errors/errorpage.tt and
  koha-tmpl/intranet-tmpl/prog/en/modules/errorpage.tt

(Amended to fix a typo)
(Amended for comment #6)
(Amended to cover OPAC error pages as well)

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>

21 files changed:
errors/400.pl
errors/401.pl
errors/402.pl
errors/403.pl
errors/404.pl
errors/500.pl
koha-tmpl/intranet-tmpl/prog/en/modules/errors/400.tt [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/errors/401.tt [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/errors/402.tt [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/errors/403.tt [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/errors/405.tt [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/errors/500.tt [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/errors/errorpage.tt [moved from koha-tmpl/intranet-tmpl/prog/en/modules/errors/404.tt with 77% similarity]
koha-tmpl/opac-tmpl/bootstrap/en/modules/errors/404.tt [deleted file]
koha-tmpl/opac-tmpl/bootstrap/en/modules/errors/errorpage.tt [new file with mode: 0644]
opac/errors/400.pl
opac/errors/401.pl
opac/errors/402.pl
opac/errors/403.pl
opac/errors/404.pl
opac/errors/500.pl

index 23dc5ae..7c947db 100755 (executable)
@@ -27,12 +27,15 @@ my $query = CGI->new;
 my $admin = C4::Context->preference('KohaAdminEmailAddress');
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
-        template_name   => 'errors/400.tt',
+        template_name   => 'errors/errorpage.tt',
         query           => $query,
         type            => 'intranet',
         authnotrequired => 1,
         debug           => 1,
     }
 );
-$template->param( admin => $admin );
+$template->param (
+    admin => $admin,
+    errno => 400,
+);
 output_with_http_headers $query, $cookie, $template->output, 'html', '400 Bad Request';
index 88c88d8..fcd2d88 100755 (executable)
@@ -26,12 +26,15 @@ my $query = CGI->new;
 my $admin = C4::Context->preference('KohaAdminEmailAddress');
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
-        template_name   => 'errors/401.tt',
+        template_name   => 'errors/errorpage.tt',
         query           => $query,
         type            => 'intranet',
         authnotrequired => 1,
         debug           => 1,
     }
 );
-$template->param( admin => $admin );
+$template->param (
+    admin => $admin,
+    errno => 401,
+);
 output_with_http_headers $query, $cookie, $template->output, 'html', '401 Unauthorized';
index 552398b..1a9f3a6 100755 (executable)
@@ -27,12 +27,15 @@ my $query = CGI->new;
 my $admin = C4::Context->preference('KohaAdminEmailAddress');
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
-        template_name   => 'errors/402.tt',
+        template_name   => 'errors/errorpage.tt',
         query           => $query,
         type            => 'intranet',
         authnotrequired => 1,
         debug           => 1,
     }
 );
-$template->param( admin => $admin );
+$template->param (
+    admin => $admin,
+    errno => 402,
+);
 output_with_http_headers $query, $cookie, $template->output, 'html', '402 Payment Required';
index 11918c3..3a46f68 100755 (executable)
@@ -27,12 +27,15 @@ my $query = CGI->new;
 my $admin = C4::Context->preference('KohaAdminEmailAddress');
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
-        template_name   => 'errors/403.tt',
+        template_name   => 'errors/errorpage.tt',
         query           => $query,
         type            => 'intranet',
         authnotrequired => 1,
         debug           => 1,
     }
 );
-$template->param( admin => $admin );
+$template->param (
+    admin => $admin,
+    errno => 403,
+);
 output_with_http_headers $query, $cookie, $template->output, 'html', '403 Forbidden';
index e7e0071..57191f1 100755 (executable)
@@ -27,12 +27,15 @@ my $query = CGI->new;
 my $admin = C4::Context->preference('KohaAdminEmailAddress');
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
-        template_name   => 'errors/404.tt',
+        template_name   => 'errors/errorpage.tt',
         query           => $query,
         type            => 'intranet',
         authnotrequired => 1,
         debug           => 1,
     }
 );
-$template->param( admin => $admin );
+$template->param (
+    admin => $admin,
+    errno => 404,
+);
 output_with_http_headers $query, $cookie, $template->output, 'html', '404 Not Found';
index 9fb6e0c..0008faf 100755 (executable)
@@ -27,12 +27,15 @@ my $query = CGI->new;
 my $admin = C4::Context->preference('KohaAdminEmailAddress');
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
-        template_name   => 'errors/500.tt',
+        template_name   => 'errors/errorpage.tt',
         query           => $query,
         type            => 'intranet',
         authnotrequired => 1,
         debug           => 1,
     }
 );
-$template->param( admin => $admin );
+$template->param (
+    admin => $admin,
+    errno => 500,
+);
 output_with_http_headers $query, $cookie, $template->output, 'html', '500 Internal Server Error';
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/errors/400.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/errors/400.tt
deleted file mode 100644 (file)
index 350f629..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-[% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Error</title>
-[% INCLUDE 'doc-head-close.inc' %]
-</head>
-<body id="err_400" class="err">
-
-[% INCLUDE 'header.inc' %]
-[% INCLUDE 'cat-search.inc' %]
-
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; Error 400</div>
-
-<div id="doc" class="yui-t7">
-   
-   <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b"><div class="yui-g">
-    <h1>An error has occurred!</h1>
-    <h2>Error 400</h2>
-    <ul style="margin-bottom: 1em; padding-bottom: 1em; border-bottom: 1px solid #CCC;">
-    <li>This error means that the link was broken and that the page doesn't exist</li> 
-    <li>To report this error, you can <a href="mailto:[% admin %]">email the Koha administrator</a>.</li>
-    <li>Use top menu bar to navigate to another part of Koha.</li>
-    </ul>
-</div>
-
-</div>
-</div>
-
-[% INCLUDE 'intranet-bottom.inc' %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/errors/401.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/errors/401.tt
deleted file mode 100644 (file)
index 5c0d3cf..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-[% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Error 401</title>
-[% INCLUDE 'doc-head-close.inc' %]
-</head>
-<body id="err_401" class="err">
-
-[% INCLUDE 'header.inc' %]
-[% INCLUDE 'cat-search.inc' %]
-
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; Error 401</div>
-
-<div id="doc" class="yui-t7">
-   
-   <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b"><div class="yui-g">
-    <h1>An error has occurred!</h1>
-    <h2>Error 401</h2>
-    <ul style="margin-bottom: 1em; padding-bottom: 1em; border-bottom: 1px solid #CCC;">
-        <li>This error means that you aren't authorized to view this page.</li>
-        <li>Please <a href="/cgi-bin/koha/mainpage.pl">log in</a> and try again.
-        <li>To report this error, you can <a href="mailto:[% admin %]">email the Koha administrator</a>.</li>
-        <li>Use top menu bar to navigate to another part of Koha.</li>
-    </ul>
-</div>
-
-</div>
-</div>
-
-[% INCLUDE 'intranet-bottom.inc' %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/errors/402.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/errors/402.tt
deleted file mode 100644 (file)
index 8656499..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-[% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Error 402</title>
-[% INCLUDE 'doc-head-close.inc' %]
-</head>
-<body id="err_402" class="err">
-
-[% INCLUDE 'header.inc' %]
-[% INCLUDE 'cat-search.inc' %]
-
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; Error 402</div>
-
-<div id="doc" class="yui-t7">
-   
-   <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b"><div class="yui-g">
-    <h1>An error has occurred!</h1>
-    <h2>Error 402</h2>
-    <ul style="margin-bottom: 1em; padding-bottom: 1em; border-bottom: 1px solid #CCC;">
-        <li>This error means that the link was broken and that the page doesn't exist</li>     
-        <li>To report this error, you can <a href="mailto:[% admin %]">email the Koha administrator</a>.</li>
-        <li>Use top menu bar to navigate to another part of Koha.</li>
-    </ul>
-</div>
-
-</div>
-</div>
-
-[% INCLUDE 'intranet-bottom.inc' %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/errors/403.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/errors/403.tt
deleted file mode 100644 (file)
index 6ed5c3a..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-[% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Error 403</title>
-[% INCLUDE 'doc-head-close.inc' %]
-</head>
-<body id="err_403" class="err">
-
-[% INCLUDE 'header.inc' %]
-[% INCLUDE 'cat-search.inc' %]
-
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; Error 403</div>
-
-<div id="doc" class="yui-t7">
-   
-   <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b"><div class="yui-g">
-    <h1>An error has occurred!</h1>
-    <h2>Error 403</h2>
-    <ul style="margin-bottom: 1em; padding-bottom: 1em; border-bottom: 1px solid #CCC;">
-    <li>This error means that you are forbidden to view this page.</li>
-    <li>To report this error, you can <a href="mailto:[% admin %]">email the Koha administrator</a>.</li>
-    <li>Use top menu bar to navigate to another part of Koha.</li>
-    </ul>
-</div>
-
-</div>
-</div>
-
-[% INCLUDE 'intranet-bottom.inc' %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/errors/405.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/errors/405.tt
deleted file mode 100644 (file)
index f4948d0..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-[% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Error 405</title>
-[% INCLUDE 'doc-head-close.inc' %]
-</head>
-<body id="err_405" class="err">
-
-[% INCLUDE 'header.inc' %]
-[% INCLUDE 'cat-search.inc' %]
-
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; Error 405</div>
-
-<div id="doc" class="yui-t7">
-   
-   <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b"><div class="yui-g">
-    <h1>An error has occurred!</h1>
-    <h2>Error 405</h2>
-    <ul style="margin-bottom: 1em; padding-bottom: 1em; border-bottom: 1px solid #CCC;">
-        <li>This error means that the link was broken and that the page doesn't exist</li>     
-        <li>To report this error, you can <a href="mailto:[% admin %]">email the Koha administrator</a>.</li>
-        <li>Use top menu bar to navigate to another part of Koha.</li>
-    </ul>
-</div>
-
-</div>
-</div>
-
-[% INCLUDE 'intranet-bottom.inc' %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/errors/500.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/errors/500.tt
deleted file mode 100644 (file)
index bab01b6..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-[% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Error 500</title>
-[% INCLUDE 'doc-head-close.inc' %]
-</head>
-<body id="err_500" class="err">
-
-[% INCLUDE 'header.inc' %]
-[% INCLUDE 'cat-search.inc' %]
-
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; Error 500</div>
-
-<div id="doc" class="yui-t7">
-   
-   <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b"><div class="yui-g">
-    <h1>An error has occurred!</h1>
-    <h2>Error 500</h2>
-    <ul style="margin-bottom: 1em; padding-bottom: 1em; border-bottom: 1px solid #CCC;">
-        <li>In Koha this typically means that the Koha team is working on new features</li>    
-        <li>Wait while system maintenance is being done or <a href="mailto:[% admin %]">email the Koha administrator</a>.</li>
-        <li>Use top menu bar to navigate to another part of Koha.</li>
-    </ul>
-</div>
-
-</div>
-</div>
-
-[% INCLUDE 'intranet-bottom.inc' %]
@@ -1,21 +1,21 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Error 404</title>
+<title>Koha &rsaquo; Error [% errno %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
-<body id="err_404" class="err">
+<body id="err_[% errno %]" class="err">
 
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'cat-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; Error 404</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; Error [% errno %]</div>
 
 <div id="doc" class="yui-t7">
-   
+
    <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b"><div class="yui-g">
+        <div id="yui-main">
+        <div class="yui-b"><div class="yui-g">
     <h1>An error has occurred!</h1>
-    <h3><em>Error 404</em></h3>
+    <h2><em>Error [% errno %]</em></h2>
         <h3>This message may have been caused by any of the following reasons:</h3>
         <ul style="padding-bottom: 0.5em;">
             <li>You made use of an external link to an item that is no longer available</li>
@@ -26,7 +26,7 @@
         <h3>What's next?</h3>
         <ul style="margin-bottom: 1em; padding-bottom: 1em; border-bottom: 1px solid #CCC;">
             <li>Use top menu bar to navigate to another part of Koha.</li>
-            <li>To report a broken link or any other issue, please send an <a href="mailto:[% admin %]">email to the Koha Administrator</a></li>
+            <li>To report a broken link or any other issue, please contact the Koha Administrator. <a href="mailto:[% admin %]">Send email</a></li>
     </ul>
 </div>
 
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/errors/404.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/errors/404.tt
deleted file mode 100644 (file)
index 232ecd1..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-[% INCLUDE 'doc-head-open.inc' %]
-<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo;  An error has occurred</title>
-[% INCLUDE 'doc-head-close.inc' %]
-[% BLOCK cssinclude %][% END %]
-</head>
-<body id="error404" class="error">
-[% INCLUDE 'masthead.inc' %]
-
-    <div class="main">
-        <ul class="breadcrumb">
-            <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
-            <li><a href="#">Error 404</a></li>
-        </ul>
-
-        <div class="container-fluid">
-            <div class="row-fluid">
-                [% IF ( OpacNav || OpacNavBottom ) %]
-                    <div class="span2">
-                        <div id="navigation">
-                            [% INCLUDE 'navigation.inc' %]
-                        </div>
-                    </div>
-                    <div class="span10">
-                [% ELSE %]
-                    <div class="span12">
-                [% END %]
-                    <div id="errormsg404">
-                        <h3>Sorry, the requested page is not available</h3>
-                        <p><em>Error 404</em></p>
-                        <h3>This message can have following reasons</h3>
-                        <ul>
-                            <li>You made use of an external link to a catalog item that is no longer available</li>
-                            <li>You followed an outdated link e.g. from a search engine or a bookmark</li>
-                            <li>You tried to access a page that needs authentification</li>
-                            <li>An internal link in our catalog home page is broken and the page does not exist</li>
-                        </ul>
-                        <h3>What's next?</h3>
-                        <ul>
-                            <li>You can search our catalog using the search form at the top of this page</li>
-                            <li>You can navigate to the <a href="/cgi-bin/koha/opac-main.pl"><b>catalog main page</b></a></li>
-                        </ul>
-                        <h3>Report broken links</h3>
-                        <ul>
-                            <li>To report a broken link or any other issue please send an <a href="mailto:[% admin %]">email to the Koha Administrator</a></li>
-                        </ul>
-                    </div> <!-- / #errormsg404 -->
-                </div> <!-- / .span10/12 -->
-            </div> <!-- / .row-fluid -->
-        </div> <!-- / .container-fluid -->
-    </div> <!-- / .main -->
-
-[% INCLUDE 'opac-bottom.inc' %]
-[% BLOCK jsinclude %]
-[% END %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/errors/errorpage.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/errors/errorpage.tt
new file mode 100644 (file)
index 0000000..63ede2d
--- /dev/null
@@ -0,0 +1,81 @@
+NCLUDE 'doc-head-open.inc' %]
+<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo;  An error has occurred</title>
+[% INCLUDE 'doc-head-close.inc' %]
+[% BLOCK cssinclude %][% END %]
+</head>
+<body id="error[% errno %]" class="error">
+[% INCLUDE 'masthead.inc' %]
+
+    <div class="main">
+        <ul class="breadcrumb">
+            <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
+            <li><a href="#">Error [% errno %]</a></li>
+        </ul>
+
+        <div class="container-fluid">
+            <div class="row-fluid">
+                [% IF ( OpacNav || OpacNavBottom ) %]
+                    <div class="span2">
+                        <div id="navigation">
+                            [% INCLUDE 'navigation.inc' %]
+                        </div>
+                    </div>
+                    <div class="span10">
+                [% ELSE %]
+                    <div class="span12">
+                [% END %]
+                    <div id="errormsg[% errno %]">
+                        <h3>Sorry, the requested page is not available</h3>
+                        <h4>Error [% errno %]</h4>
+                        <h3>This message can have following reason(s)</h3>
+                        <ul>
+                            [% IF ( errno == 400 ) %]
+                                <li>Koha is pointed an invalid link.</li>
+                            [% END %]
+
+                            [% IF ( errno == 401 ) %]
+                                <li>You are trying to access a link that you're not authorized to see.</li>
+                                <li>Try logging in to the catalog.</li>
+                            [% END %]
+
+                            [% IF ( errno == 402 ) %]
+                               <li>Koha is pointed an invalid link.</li>
+                            [% END %]
+
+                            [% IF ( errno == 403 ) %]
+                                <li>You are forbidden for some reason to see this page.</li>
+                            [% END %]
+
+                            [% IF ( errno == 404 ) %]
+                                <li>You made use of an external link to a catalog item that is no longer available.</li>
+                                <li>You followed an outdated link e.g. from a search engine or a bookmark.</li>
+                                <li>You tried to access a page that needs authentification.</li>
+                                <li>An internal link in our catalog home page is broken and the page does not exist.</li>
+                            [% END %]
+                            [% IF ( errno == 500 ) %]
+                                <li>An error occurred while try to process your request.</li>
+                            [% END %]
+                        </ul>
+                        <h3>What's next?</h3>
+                        <ul>
+                            [% IF ( errno == 401 ) %]
+                                <li>Try logging in to the catalog.</li>
+                            [% END %]
+                            <li>You can use the menu and links at the top of the page</li>
+                            <li>You can search our catalog using the search form at the top of this page.</li>
+                            <li><a href="/cgi-bin/koha/opac-main.pl">Return to the catalog home page.</a></li>
+                        </ul>
+                        <h3>Report issues and broken links</h3>
+                        <ul>
+                            <li>To report this error, please contact the Koha Administrator.
+                                    <a href="mailto:[% admin %]">Send email</a>.</li>
+                        </ul>
+                    </div> <!-- / #errormsg[% errno %] -->
+                </div> <!-- / .span10/12 -->
+            </div> <!-- / .row-fluid -->
+        </div> <!-- / .container-fluid -->
+    </div> <!-- / .main -->
+
+[% INCLUDE 'opac-bottom.inc' %]
+[% BLOCK jsinclude %]
+[% END %]
index 9fcdcb5..d2009c5 100755 (executable)
@@ -28,12 +28,15 @@ my $query = new CGI;
 my $admin = C4::Context->preference('KohaAdminEmailAddress');
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
-        template_name   => "errors/400.tt",
+        template_name   => "errors/errorpage.tt",
         query           => $query,
         type            => "opac",
         authnotrequired => 1,
         debug           => 1,
     }
 );
-$template->param( admin => $admin );
+$template->param (
+    admin => $admin,
+    errno => 400,
+);
 output_with_http_headers $query, $cookie, $template->output, 'html', '400 Bad Request';
index 395d47f..2c1d60e 100755 (executable)
@@ -28,12 +28,15 @@ my $query = new CGI;
 my $admin = C4::Context->preference('KohaAdminEmailAddress');
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
-        template_name   => "errors/401.tt",
+        template_name   => "errors/errorpage.tt",
         query           => $query,
         type            => "opac",
         authnotrequired => 1,
         debug           => 1,
     }
 );
-$template->param( admin => $admin );
+$template->param (
+    admin => $admin,
+    errno => 401,
+);
 output_with_http_headers $query, $cookie, $template->output, 'html', '401 Unauthorized';
index 5d084b4..492495e 100755 (executable)
@@ -28,12 +28,15 @@ my $query = new CGI;
 my $admin = C4::Context->preference('KohaAdminEmailAddress');
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
-        template_name   => "errors/402.tt",
+        template_name   => "errors/errorpage.tt",
         query           => $query,
         type            => "opac",
         authnotrequired => 1,
         debug           => 1,
     }
 );
-$template->param( admin => $admin );
+$template->param (
+    admin => $admin,
+    errno => 402,
+);
 output_with_http_headers $query, $cookie, $template->output, 'html', '402 Payment Required';
index 753dd37..8e502bb 100755 (executable)
@@ -28,12 +28,15 @@ my $query = new CGI;
 my $admin = C4::Context->preference('KohaAdminEmailAddress');
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
-        template_name   => "errors/403.tt",
+        template_name   => "errors/errorpage.tt",
         query           => $query,
         type            => "opac",
         authnotrequired => 1,
         debug           => 1,
     }
 );
-$template->param( admin => $admin );
+$template->param (
+    admin => $admin,
+    errno => 403,
+);
 output_with_http_headers $query, $cookie, $template->output, 'html', '403 Forbidden';
index 3ce9105..3a4e044 100755 (executable)
@@ -28,12 +28,15 @@ my $query = new CGI;
 my $admin = C4::Context->preference('KohaAdminEmailAddress');
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
-        template_name   => "errors/404.tt",
+        template_name   => "errors/errorpage.tt",
         query           => $query,
         type            => "opac",
         authnotrequired => 1,
         debug           => 1,
     }
 );
-$template->param( admin => $admin );
+$template->param (
+    admin => $admin,
+    errno => 404,
+);
 output_html_with_http_headers $query, $cookie, $template->output, '404 Not Found';
index 1459752..50fa33e 100755 (executable)
@@ -28,12 +28,15 @@ my $query = new CGI;
 my $admin = C4::Context->preference('KohaAdminEmailAddress');
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
-        template_name   => "errors/500.tt",
+        template_name   => "errors/errorpage.tt",
         query           => $query,
         type            => "opac",
         authnotrequired => 1,
         debug           => 1,
     }
 );
-$template->param( admin => $admin );
+$template->param (
+    admin => $admin,
+    errno => 500,
+);
 output_with_http_headers $query, $cookie, $template->output, 'html', '500 Internal Server Error';