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)
This commit is contained in:
Paul Poulain 2011-10-21 17:23:36 +02:00
parent 41b42dbe32
commit d019b4c63a
3 changed files with 7 additions and 15 deletions

View 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 | |

View File

@ -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");

View 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' );