[Koha-patches] [PATCH] (bug #3745) fix deletion of borrowers rights detection

Michael Hafen mdhafen at tech.washk12.org
Mon Nov 2 17:28:23 CET 2009


Might be nice to have that user flag check as well as the
IndependantBranches check.  How about:

if ( $userenv->{flags} % 2 == 1 ) {
    $candeleteuser = 1;
} else {
    if ( C4::Auth::getuserflags( $userenv->{flags},
$userenv->{number} )->{borrowers} ) {
        $candeleteuser = 1;
    } else {
        $candeleteuser = 0;
    }
}
if ( C4::Context->preference("IndependantBranches") && !
( $userenv->{flags} % 2 == 1 ) ) {
    $candeleteuser  = ( $candeleteuser && $data->{'branchcode'} eq
$userenv->{branch} );
}

Thanks.

On Mon, 2009-11-02 at 16:42 +0100, Nahuel ANGELINETTI wrote:
> This patch fix the rights checking for borrower deletion.
> +my $candeleteuser;
> +my $userenv = C4::Context->userenv;
> +if($userenv->{flags} % 2 == 1){
> +    $candeleteuser = 1;
> +}elsif ( C4::Context->preference("IndependantBranches") ) {
> +    $candeleteuser = ( $data->{'branchcode'} eq $userenv->{branch} );
> +}else{
> +    if( C4::Auth::getuserflags( $userenv->{flags},$userenv->{number})->{borrowers} ) {
> +        $candeleteuser = 1;
> +    }else{
> +        $candeleteuser = 0;
> +    }
> +}
> +

-- 
Michael Hafen
Systems Analyst and Programmer
Washington County School District
Utah, USA

for Koha checkout
http://development.washk12.org/gitweb/
or
git://development.washk12.org/koha





More information about the Koha-patches mailing list