[Koha-patches] [PATCH] bug 3436: improve error messages in self-check

Galen Charlton galen.charlton at liblime.com
Wed Jul 22 23:43:43 CEST 2009


Improved the error messages displayed to users
by web-based self-checkout when a problem with
a loan occurs.

This changed was sponsored by the Plano Independent
School District.
---
 .../opac-tmpl/prog/en/modules/sco/sco-main.tmpl    |   35 +++++++++++++++++++-
 opac/sco/sco-main.pl                               |   16 ++++++---
 2 files changed, 45 insertions(+), 6 deletions(-)

diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl
index 132312f..3bfde99 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl
@@ -72,7 +72,40 @@ $(document).ready(function() {
 <!-- TMPL_IF NAME="impossible" --><!-- We tried to issue, but failed. -->
 <div class="dialog alert"><h3>Item cannot be checked out.</h3><p>Sorry, This item cannot be checked out at this station.  </p>
 <!-- TMPL_IF NAME="title" --><p>Title: <em><!-- TMPL_VAR NAME="title" escape="html" --></em> </p><!-- /TMPL_IF -->
-<p><em>Error type:</em> <!-- TMPL_VAR NAME="impossible" --></p>
+<p>
+   <!-- TMPL_IF NAME="circ_error_UNKNOWN_BARCODE" -->
+    <em>MESSAGE 1:</em> The system does not recognize this barcode.
+   <!-- TMPL_ELSIF NAME="circ_error_TOO_MANY" -->
+    <em>MESSAGE 2:</em> You have borrowed too many items and can't check out any more.
+   <!-- TMPL_ELSIF NAME="circ_error_ISSUED_TO_ANOTHER" -->
+    <em>MESSAGE 3:</em> This item is checked out to someone else.
+   <!-- TMPL_ELSIF NAME="circ_error_NO_MORE_RENEWALS" -->
+    <em>MESSAGE 4:</em> You cannot renew this item again.
+   <!-- TMPL_ELSIF NAME="circ_error_NOT_FOR_LOAN" -->
+    <em>MESSAGE 5:</em> This item is not for loan.
+   <!-- TMPL_ELSIF NAME="circ_error_DEBT" -->
+    <em>MESSAGE 6:</em> You owe the library <!-- TMPL_VAR NAME="amount" --> and cannot borrow.
+   <!-- TMPL_ELSIF NAME="circ_error_WTHDRAWN" -->
+    <em>MESSAGE 7:</em> This item has been withdrawn from the collection.
+   <!-- TMPL_ELSIF NAME="circ_error_RESTRICTED" -->
+    <em>MESSAGE 8:</em>
+   <!-- TMPL_ELSIF NAME="circ_error_RESERVED" -->
+    <em>MESSAGE 9:</em> This item is reserved for another patron.
+   <!-- TMPL_ELSIF NAME="circ_error_NOTSAMEBRANCH" -->
+    <em>MESSAGE 10:</em>
+   <!-- TMPL_ELSIF NAME="circ_error_EXPIRED" -->
+    <em>MESSAGE 11:</em> Your account has expired.
+   <!-- TMPL_ELSIF NAME="circ_error_DEBARRED" -->
+    <em>MESSAGE 12:</em> Your account has been suspended.
+   <!-- TMPL_ELSIF NAME="circ_error_CARD_LOST" -->
+    <em>MESSAGE 13:</em> This card has been declared lost.
+   <!-- TMPL_ELSIF NAME="circ_error_GNA" -->
+    <em>MESSAGE 14:</em>
+   <!-- TMPL_ELSIF NAME="circ_error_INVALID_DATE" -->
+    <em>MESSAGE 15:</em>
+   <!-- /TMPL_IF -->
+   Please see a member of the library staff.
+</p>
 <form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" method="post">
 <input type="hidden" name="op" value="login" />
 <input type="hidden" name="patronid" value="<!-- TMPL_VAR NAME="patronid" -->" />
diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl
index c2fc1f3..f496e3b 100755
--- a/opac/sco/sco-main.pl
+++ b/opac/sco/sco-main.pl
@@ -86,10 +86,14 @@ elsif ( $op eq "checkout" ) {
 
         # FIXME  we assume only one error.
         $template->param(
-            impossible => $issue_error,
-            title      => $item->{title},
-            hide_main  => 1,
+            impossible                => $issue_error,
+            "circ_error_$issue_error" => 1,
+            title                     => $item->{title},
+            hide_main                 => 1,
         );
+        if ($issue_error eq 'DEBT') {
+            $template->param(amount => $impossible->{DEBT});
+        }
         #warn "issue_error: " . $issue_error ;
         if ( $issue_error eq "NO_MORE_RENEWALS" ) {
             $return_only = 1;
@@ -114,9 +118,11 @@ elsif ( $op eq "checkout" ) {
         }
     } elsif ( $confirm_required && !$confirmed ) {
         #warn "failed confirmation";
+        my $issue_error = (keys %$needconfirm)[0];
         $template->param(
-            impossible => (keys %$needconfirm)[0],
-            hide_main  => 1,
+            impossible                => (keys %$needconfirm)[0],
+            "circ_error_$issue_error" => 1,
+            hide_main                 => 1,
         );
     } else {
         if ( $confirmed || $issuenoconfirm ) {    # we'll want to call getpatroninfo again to get updated issues.
-- 
1.5.6.5




More information about the Koha-patches mailing list