Bug 18251: (QA follow-up) Add alerts for all SCO actions
authorNick Clemens <nick@bywatersolutions.com>
Mon, 20 Mar 2017 14:48:21 +0000 (10:48 -0400)
committerroot <root@f1ebe1bec408>
Tue, 26 Feb 2019 13:18:28 +0000 (13:18 +0000)
To test:

Add sound alerts for sco-alert-warning
Test various actions (return,renew) and verify success/failure notices
and sounds
Note additional classes (return,renew,issue) to allow for more
specificity of sounds alerts

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt
opac/sco/sco-main.pl

index a67033e..14f543a 100644 (file)
@@ -39,6 +39,7 @@
 
                     [% IF ( impossible ) %]<!-- We tried to issue, but failed. -->
                         <div class="alert">
+                            <span class="sco-alert-warning noissue"></span>
                             <h3>Item cannot be checked out.</h3>
                             <p>Sorry, this item cannot be checked out at this station.</p>
                             [% IF ( title ) %]
 
                     [% IF ( confirm ) %]<!-- We need to confirm the issue.. -->
                         <div class="alert"><h3>Please confirm the checkout:</h3>
+                            <span class="sco-alert-warning confirm"></span>
                             [% IF ( confirm_renew_issue ) %]
                                 <p>This item is already checked out to you.</p>
                             [% END %]
                     [% IF ( nopermission ) %]
                         <!-- This is what is displayed if user doesn't have permission -->
                         <div class="alert">
+                        <span class="sco-alert-warning nopermission"></span>
                             <h3>Access denied</h3>
                             <p>Sorry, this self-checkout station has lost authentication.  Please contact the administrator to resolve this problem.</p>
                         </div>
                     [% IF ( different_ip ) %]
                         <!-- This is what is displayed if user doesn't have permission -->
                         <div class="alert">
+                            <span class="sco-alert-warning sessionlost"></span>
                             <h3>Session lost</h3>
                             <p>You are accessing self-checkout from a different IP address! please log in again.</p>
                         </div>
                     [% IF ( invalid_username_or_password ) %]
                         <!-- This is what is displayed if user doesn't have permission -->
                         <div class="alert">
+                            <span class="sco-alert-warning notfound"></span>
                             <h3>Record not found</h3>
                             <p>Your userid was not found in the database.  Please try again.</p>
                         </div>
                     [% END %]
 
                     [% IF ( issued ) %]
-                    <span class="sco-alert-success"></span>
+                    <span class="sco-alert-success issue"></span>
                     <div class="alert alert-info">
                         <p>Item checked out</p>
                     </div>
+                    [% ELSIF ( renewed ) %]
+                    <span class="sco-alert-success renew"></span>
+                    <div class="alert alert-info">
+                        <p>Item renewed</p>
+                    </div>
+                    [% ELSIF ( returned == 0 ) %]
+                    <span class="sco-alert-warning return"></span>
+                    <div class="alert alert-info">
+                        <p>Item not checked in: please see circulation staff for assistance</p>
+                    </div>
+                    [% ELSIF ( returned == 1 ) %]
+                    <span class="sco-alert-success return"></span>
+                    <div class="alert alert-info">
+                        <p>Item checked in</p>
+                    </div>
                     [% END %]
 
 
index 16e598d..bbe0e90 100755 (executable)
@@ -124,10 +124,12 @@ my $return_only = 0;
 #warn "issuer cardnumber: " .   $issuer->{cardnumber};
 #warn "patron cardnumber: " . $borrower->{cardnumber};
 if ($op eq "logout") {
+    $template->param( loggedout => 1 );
     $query->param( patronid => undef, patronlogin => undef, patronpw => undef );
 }
 elsif ( $op eq "returnbook" && $allowselfcheckreturns ) {
     my ($doreturn) = AddReturn( $barcode, $branch );
+    $template->param( returned => $doreturn );
 }
 elsif ( $patron and $op eq "checkout" ) {
     my $impossible  = {};
@@ -177,6 +179,7 @@ elsif ( $patron and $op eq "checkout" ) {
             #warn "renewing";
             AddRenewal( $borrower->{borrowernumber}, $item->{itemnumber} );
             push @newissueslist, $barcode;
+            $template->param( renewed => 1 );
         } else {
             #warn "renew confirmation";
             $template->param(