Bug 16125: Remove the flagged boolean in circ/circulation.tt
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 23 Mar 2016 16:04:47 +0000 (16:04 +0000)
committerBrendan A Gallagher <brendan@bywatersolutions.com>
Thu, 24 Mar 2016 15:38:49 +0000 (15:38 +0000)
Before 15632, flagged was passed in any cases: GetMessages returned an
arrayref, so:
  my $bor_messages_loop = GetMessages( $borrowernumber, 'B', $branch );
  if($bor_messages_loop){ $template->param(flagged => 1 ); }
set 'flagged'.

It seems that this variable is not needed as it's always set.

Test plan:
Confirm that the "Add a new message" link is always displayed (even if
no message exist).
Note that a "Attention" is displayed but should not, that already
existed before bug 15632.

Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
circ/circulation.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

index 75799bd..e527b7e 100755 (executable)
@@ -288,7 +288,6 @@ if ($borrowernumber) {
     {
         #borrowercard expired, no issues
         $template->param(
-            flagged  => "1",
             noissues => ($force_allow_issue) ? 0 : "1",
             forceallow => $force_allow_issue,
             expired => "1",
@@ -301,7 +300,6 @@ if ($borrowernumber) {
     {
         # borrower card soon to expire warn librarian
         $template->param( "warndeparture" => $borrower->{dateexpiry} ,
-                          flagged         => "1"
                         );
         if (C4::Context->preference('ReturnBeforeExpiry')){
             $template->param("returnbeforeexpiry" => 1);
@@ -470,7 +468,6 @@ if ($borrowernumber) {
 #title
 my $flags = $borrower->{'flags'};
 foreach my $flag ( sort keys %$flags ) {
-    $template->param( flagged=> 1);
     $flags->{$flag}->{'message'} =~ s#\n#<br />#g;
     if ( $flags->{$flag}->{'noissues'} ) {
         $template->param(
@@ -563,10 +560,6 @@ my $patron_messages = Koha::Patron::Messages->search(
     }
 );
 
-if( $librarian_messages->count or $patron_messages->count ) {
-    $template->param(flagged => 1)
-}
-
 my $fast_cataloging = 0;
 if (defined getframeworkinfo('FA')) {
     $fast_cataloging = 1 
index eaae5d7..57e5cf2 100644 (file)
@@ -409,7 +409,7 @@ $(document).ready(function() {
 </form>
 
 [% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
-    [% UNLESS flagged && noissues %]
+    [% UNLESS noissues %]
         <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber %]&borrowernumber=[% borrowernumber %]'"><i class="fa fa-times-circle"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
     [% END %]
 [% END %]
@@ -607,12 +607,7 @@ No patron matched <span class="ex">[% message %]</span>
 [% END %]
 
 [% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
-[% IF ( flagged ) %]
 <div class="yui-u first">
-[% ELSE %]
-<div>
-
-[% END %]
 
 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
     <input type="hidden" name="restoreduedatespec" />
@@ -638,7 +633,7 @@ No patron matched <span class="ex">[% message %]</span>
     [% END %]
     <button type="submit" class="btn">Check out</button>
 
-    [% UNLESS flagged and noissues %]
+    [% UNLESS noissues %]
         <div class="date-select">
             [% IF NEEDSCONFIRMATION %]
                 <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
@@ -713,7 +708,6 @@ No patron matched <span class="ex">[% message %]</span>
     <div class="yui-u">
 [% END %]
 
-    [% IF flagged %]
         [% IF ( noissues ) %]
             [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
                 <div id="circmessages" class="circmessage attention">
@@ -862,9 +856,6 @@ No patron matched <span class="ex">[% message %]</span>
         </ul>
     </div>
 
-     <!-- /If flagged -->[% END %]
-
-       
 </div>
 </div>