Bug 22538: Add a noticeable alert about waiting holds
authorAgustin Moyano <agustinmoyano@theke.io>
Wed, 20 Mar 2019 03:16:05 +0000 (00:16 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 17 Apr 2019 12:25:25 +0000 (12:25 +0000)
In SCO, bug 21772 introduced holds information, but it lacked the
capability to attract atention when any of those holds was in waiting
status. Because SCO and opac-user uses the same include file for holds
table, this bug applies to both modules.

To test:
1) Have a patron with holds in waiting status and pending status.
2) Enable SCO module.
3) Holds tab label contains holds count, but doesn't inform that there
   is something that requires attention.
5) Holds tab content has no visual aid to recognize without reading
   effort which holds are in waiting status.
6) Apply this patch
   => SUCCESS: Holds tab label has a visual aid to indicate that
      something requires attention, and in
      holds table it's easy to recognize waiting holds without reading
      effort.
7) Sign off

Sponsored-by: Theke Solutions

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc
koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt
opac/sco/sco-main.pl

index 9673d5b..e96a73c 100644 (file)
                         <td class="status">
                             <span class="tdlabel">Status:</span>
                             [% IF ( HOLD.is_waiting ) %]
+                                <i class="fa fa-exclamation-circle text-warning"></i>
                                 [% IF ( HOLD.is_at_destination ) %]
                                     [% IF ( HOLD.found ) %]
                                         Item waiting at <b> [% HOLD.branch.branchname | html %]</b>
index 8f9e38d..e147cdd 100644 (file)
@@ -9,7 +9,11 @@
 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha [% END %] &rsaquo; Self checkout </title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta name="generator" content="Koha [% Version | html %]" /> <!-- leave this for stats -->
-<link rel="shortcut icon" href="[% IF ( Koha.Preference('OpacFavicon') ) %][% Koha.Preference('OpacFavicon') | url %][% ELSE %][% interface | html %]/[% theme | html %]/images/favicon.ico[% END %]" type="image/x-icon" />
+[% IF ( Koha.Preference('OpacFavicon') ) %]
+<link rel="shortcut icon" href="[% Koha.Preference('OpacFavicon') | url %]" type="image/x-icon" />
+[% ELSE %]
+<link rel="shortcut icon" href="[% interface | html %]/[% theme | html %]/images/favicon.ico" type="image/x-icon" />
+[% END %]
 [% Asset.css("lib/bootstrap/css/bootstrap.min.css") | $raw %]
 [% Asset.css("lib/jquery/jquery-ui.css") | $raw %]
 [% Asset.css("lib/font-awesome/css/font-awesome.min.css") | $raw %]
                         <div class="tabbable">
                             <ul class="nav nav-tabs">
                                 <li class="active"><a href="#checkouts-tab" data-toggle="tab">Checkouts ([% issues_count | html %])</a></li>
-                                <li><a href="#holds-tab" data-toggle="tab">Holds ([% HOLDS.count | html %])</a></li>
+                                <li>
+                                    <a href="#holds-tab" data-toggle="tab">
+                                        [% IF waiting_holds_count %]
+                                            <i class="fa fa-exclamation"></i>
+                                        [% END %]
+                                        Holds ([% HOLDS.count | html %])
+                                    </a>
+                                </li>
                                 <li><a href="#account-tab" data-toggle="tab">Fines and charges ([% total | $Price %])</a></li>
                             </ul>
                             <div class="tab-content">
index bbaaf70..de79489 100755 (executable)
@@ -283,6 +283,11 @@ if ($borrower) {
     my $accountlines = $account->lines;
 
     my $holds = $patron->holds;
+    my $waiting_holds_count = 0;
+
+    while(my $hold = $holds->next) {
+        $waiting_holds_count++ if $hold->is_waiting;
+    }
 
     $template->param(
         validuser => 1,
@@ -294,6 +299,7 @@ if ($borrower) {
         patronid => $patronid,
         patronlogin => $patronlogin,
         patronpw => $patronpw,
+        waiting_holds_count => $waiting_holds_count,
         noitemlinks => 1 ,
         borrowernumber => $borrower->{'borrowernumber'},
         SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'),