[Patches] [PATCH] Bug 6328 Fixes for comment 35

koha-patchbot at kohaaloha.com koha-patchbot at kohaaloha.com
Fri Nov 4 19:52:42 NZDT 2011


From: Paul Poulain <paul.poulain at biblibre.com>
Date: Fri, 21 Oct 2011 17:23:36 +0200
Subject: [PATCH] Bug 6328 Fixes for comment 35

* correctly indenting with tab the debarrcomment field
* setdebar.pl is called without status parameter, thus it is not working anymore. It's fixed & some dead code has been removed. To test : debar someone, then go to patron detail page and click "lift debarment"
* the test function had not been updated. The fix define a debarment date of 2099-12-31 (no limit)
---
 C4/Auth_with_ldap.pm                               |    2 +-
 members/setdebar.pl                                |   18 +++++-------------
 t/db_dependent/lib/KohaTest/Members/DebarMember.pm |    2 +-
 3 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm
index 80bbc14..e871706 100644
--- a/C4/Auth_with_ldap.pm
+++ b/C4/Auth_with_ldap.pm
@@ -357,7 +357,7 @@ C4::Auth - Authenticates Koha users
 		| gonenoaddress       | tinyint(1)   | YES  |     | NULL    |                |
 		| lost                | tinyint(1)   | YES  |     | NULL    |                |
 		| debarred            | date         | YES  |     | NULL    |                |
-        | debarredcomment     | varchar(255) | YES  |     | NULL    |                |
+		| debarredcomment     | varchar(255) | YES  |     | NULL    |                |
 		| contactname         | mediumtext   | YES  |     | NULL    |                |
 		| contactfirstname    | text         | YES  |     | NULL    |                |
 		| contacttitle        | text         | YES  |     | NULL    |                |
diff --git a/members/setdebar.pl b/members/setdebar.pl
index b12ab57..bc0bafb 100755
--- a/members/setdebar.pl
+++ b/members/setdebar.pl
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # Copyright 2000-2002 Katipo Communications
+# Parts copyright 2011 BibLibre
 #
 # This file is part of Koha.
 #
@@ -40,22 +41,13 @@ $flagsrequired->{borrowers} = 1;
 my ( $loggedinuser, $cookie, $sessionID ) =
   checkauth( $input, 0, $flagsrequired );
 
-my $destination    = $input->param("destination") || '';
-my $cardnumber     = $input->param("cardnumber");
 my $borrowernumber = $input->param('borrowernumber');
-my $status         = $input->param('status');
 
 my $dbh = C4::Context->dbh;
 my $sth =
-  $dbh->prepare("Update borrowers set debarred = ? where borrowernumber = ?");
-$sth->execute( $status, $borrowernumber );
+  $dbh->prepare("Update borrowers set debarred = NULL where borrowernumber = ?");
+$sth->execute( $borrowernumber );
 $sth->finish;
 
-if ( $destination eq "circ" ) {
-    print $input->redirect(
-        "/cgi-bin/koha/circ/circulation.pl?findborrower=".$cardnumber);
-}
-else {
-    print $input->redirect(
-        "/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber");
-}
+print $input->redirect(
+    "/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber");
diff --git a/t/db_dependent/lib/KohaTest/Members/DebarMember.pm b/t/db_dependent/lib/KohaTest/Members/DebarMember.pm
index 9e27d66..bf61b8a 100644
--- a/t/db_dependent/lib/KohaTest/Members/DebarMember.pm
+++ b/t/db_dependent/lib/KohaTest/Members/DebarMember.pm
@@ -21,7 +21,7 @@ sub simple_usage : Test( 6 ) {
     ok(     ! $details->{'flags'}->{'DBARRED'},          'this member is NOT debarred' );
 
     # Now, let's debar this member and see what happens
-    my $success = C4::Members::DebarMember( $self->{'memberid'} );
+    my $success = C4::Members::DebarMember( $self->{'memberid'}, '2099-12-31' );
 
     ok( $success, 'we were able to debar the member' );
     
-- 
1.7.5.4




More information about the Patches mailing list