[Koha-patches] [PATCH 03/55] MT 2413 : Attention message only to display if there are some warnings

Henri-Damien LAURENT henridamien.laurent at biblibre.com
Wed Mar 10 22:25:45 CET 2010


From: Matthias Meusburger <matthias.meusburger at biblibre.com>

---
 circ/circulation.pl                                |   20 +++++++++++++-------
 .../prog/en/modules/circ/circulation.tmpl          |    3 ++-
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/circ/circulation.pl b/circ/circulation.pl
index 4cf77b2..927816f 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -246,6 +246,7 @@ if ($borrowernumber) {
             flagged  => "1",
             noissues => "1",
             expired     => format_date($borrower->{dateexpiry}),
+            warning     => 1,
             renewaldate => format_date("$renew_year-$renew_month-$renew_day")
         );
     }
@@ -256,9 +257,9 @@ if ($borrowernumber) {
     {
         # borrower card soon to expire warn librarian
         $template->param("warndeparture" => format_date($borrower->{dateexpiry}),
-        flagged       => "1",);
+        flagged       => "1", "warning" => 1);
         if (C4::Context->preference('ReturnBeforeExpiry')){
-            $template->param("returnbeforeexpiry" => 1);
+            $template->param("returnbeforeexpiry" => 1, "warning => 1");
         }
     }
     $template->param(
@@ -542,20 +543,21 @@ foreach my $flag ( sort keys %$flags ) {
             noissues => 'true',
         );
         if ( $flag eq 'GNA' ) {
-            $template->param( gna => 'true' );
+            $template->param( gna => 'true', warning => 1 );
         }
         elsif ( $flag eq 'LOST' ) {
-            $template->param( lost => 'true' );
+            $template->param( lost => 'true', warning => 1 );
         }
         elsif ( $flag eq 'DBARRED' ) {
-            $template->param( dbarred => 'true' );
+            $template->param( dbarred => 'true', warning => 1 );
         }
         elsif ( $flag eq 'CHARGES' ) {
             $template->param(
                 charges    => 'true',
                 chargesmsg => $flags->{'CHARGES'}->{'message'},
                 chargesamount => $flags->{'CHARGES'}->{'amount'},
-                charges_is_blocker => 1
+                charges_is_blocker => 1,
+		warning => 1
             );
         }
         elsif ( $flag eq 'CREDITS' ) {
@@ -563,6 +565,7 @@ foreach my $flag ( sort keys %$flags ) {
                 credits    => 'true',
                 creditsmsg => $flags->{'CREDITS'}->{'message'},
                 creditsamount => sprintf("%.02f", -($flags->{'CREDITS'}->{'amount'})), # from patron's pov
+		        warning => 1
             );
         }
     }
@@ -573,6 +576,7 @@ foreach my $flag ( sort keys %$flags ) {
                 flagged    => 1,
                 chargesmsg => $flags->{'CHARGES'}->{'message'},
                 chargesamount => $flags->{'CHARGES'}->{'amount'},
+		warning => 1
             );
         }
         elsif ( $flag eq 'CREDITS' ) {
@@ -580,13 +584,15 @@ foreach my $flag ( sort keys %$flags ) {
                 credits    => 'true',
                 creditsmsg => $flags->{'CREDITS'}->{'message'},
                 creditsamount => sprintf("%.02f", -($flags->{'CREDITS'}->{'amount'})), # from patron's pov
+		warning => 1
             );
         }
         elsif ( $flag eq 'ODUES' ) {
             $template->param(
                 odues    => 'true',
                 flagged  => 1,
-                oduesmsg => $flags->{'ODUES'}->{'message'}
+                oduesmsg => $flags->{'ODUES'}->{'message'},
+		warning => 1
             );
 
             my $items = $flags->{$flag}->{'itemlist'};
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
index d7a70fe..5b958ba 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
@@ -471,7 +471,8 @@ No patron matched <span class="ex"><!-- TMPL_VAR name="message" --></span>
         <div id="circmessages" class="circmessage attention">
 		<!-- /TMPL_IF -->
 
-		<h3><!-- TMPL_IF NAME="noissues" -->Cannot Check Out!<!-- TMPL_ELSE -->Attention:<!-- /TMPL_IF --></h3>
+		<h3><!-- TMPL_IF NAME="noissues" -->Cannot Check Out!<!-- TMPL_ELSE -->
+		   <!-- TMPL_IF NAME="warning" -->Attention:<!-- /TMPL_IF --><!-- /TMPL_IF --></h3>
 		<ul>
 
 			<!-- TMPL_IF NAME = "warndeparture" -->
-- 
1.6.3.3




More information about the Koha-patches mailing list