Bug 6328 Fixes for comment 35
authorPaul Poulain <paul.poulain@biblibre.com>
Fri, 21 Oct 2011 15:23:36 +0000 (17:23 +0200)
committerPaul Poulain <paul.poulain@biblibre.com>
Fri, 25 Nov 2011 13:00:47 +0000 (14:00 +0100)
* 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
members/setdebar.pl
t/db_dependent/lib/KohaTest/Members/DebarMember.pm

index a2e346c..4749d72 100644 (file)
@@ -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    |                |
index b12ab57..bc0bafb 100755 (executable)
@@ -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");
index 9e27d66..bf61b8a 100644 (file)
@@ -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' );