View | Details | Raw Unified | Return to bug 35508
Collapse All | Expand All

(-)a/members/memberentry.pl (-15 / +20 lines)
Lines 572-584 if ((!$nok) and $nodouble and ($op eq 'cud-insert' or $op eq 'cud-save')){ Link Here
572
        }
572
        }
573
    }
573
    }
574
574
575
    if ( $success ) {
575
    if ($success) {
576
        if (C4::Context->preference('ExtendedPatronAttributes') and $input->param('setting_extended_patron_attributes')) {
576
        if ( C4::Context->preference('ExtendedPatronAttributes')
577
            and $input->param('setting_extended_patron_attributes') )
578
        {
577
            my $existing_attributes = $patron->extended_attributes->filter_by_branch_limitations->unblessed;
579
            my $existing_attributes = $patron->extended_attributes->filter_by_branch_limitations->unblessed;
578
580
579
            my $needs_update = 1;
581
            my $needs_update = 1;
580
582
581
            # If there are an unqueunal number of new and old patron attributes they definietely need updated
583
            # If there are an unqueunal number of new and old patron attributes they definitely need updated
582
            if ( scalar @{$existing_attributes} == scalar @{$extended_patron_attributes} ) {
584
            if ( scalar @{$existing_attributes} == scalar @{$extended_patron_attributes} ) {
583
                my $seen = 0;
585
                my $seen = 0;
584
                for ( my $i = 0 ; $i <= scalar @{$extended_patron_attributes} ; $i++ ) {
586
                for ( my $i = 0 ; $i <= scalar @{$extended_patron_attributes} ; $i++ ) {
Lines 610-632 if ((!$nok) and $nodouble and ($op eq 'cud-insert' or $op eq 'cud-save')){ Link Here
610
                }
612
                }
611
            }
613
            }
612
614
613
                if ($needs_update) {
615
            if ($needs_update) {
614
                    $patron->extended_attributes->filter_by_branch_limitations->delete;
616
                $patron->extended_attributes->filter_by_branch_limitations->delete;
615
                    $patron->extended_attributes($extended_patron_attributes);
617
                $patron->extended_attributes($extended_patron_attributes);
616
                }
617
            }
618
            }
619
        }
618
620
619
        if ( $destination eq 'circ' and not C4::Auth::haspermission( C4::Context->userenv->{id}, { circulate => 'circulate_remaining_permissions' } ) ) {
621
        if (
622
            $destination eq 'circ'
623
            and not C4::Auth::haspermission(
624
                C4::Context->userenv->{id},
625
                { circulate => 'circulate_remaining_permissions' }
626
            )
627
            )
628
        {
620
            # If we want to redirect to circulation.pl and need to check if the logged in user has the necessary permission
629
            # If we want to redirect to circulation.pl and need to check if the logged in user has the necessary permission
621
            $destination = 'not_circ';
630
            $destination = 'not_circ';
622
        }
631
        }
623
        print scalar( $destination eq "circ" )
632
        print scalar( $destination eq "circ" )
624
          ? $input->redirect(
633
            ? $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber")
625
            "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber")
634
            : $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber");
626
          : $input->redirect(
635
        exit;    # You can only send 1 redirect!  After that, content or other headers don't matter.
627
            "/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber"
628
          );
629
        exit; # You can only send 1 redirect!  After that, content or other headers don't matter.
630
    }
636
    }
631
}
637
}
632
638
633
- 

Return to bug 35508