Bug 34478: Add missing op - members-update
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
c790129c7d
commit
e8d02c58d2
|
|
@ -205,7 +205,10 @@
|
|||
</div> <!-- /panel.panel-default -->
|
||||
[% END # /FOREACH pm %]
|
||||
</div> <!-- /#pending-updates -->
|
||||
<fieldset class="action"><input type="submit" class="btn btn-primary" value="Submit" /></fieldset>
|
||||
<fieldset class="action">
|
||||
<input type="hidden" name="op" value="cud-update" />
|
||||
<input type="submit" class="btn btn-primary" value="Submit" />
|
||||
</fieldset>
|
||||
</form>
|
||||
[% ELSE %]
|
||||
<div class="dialog message">
|
||||
|
|
|
|||
|
|
@ -29,36 +29,39 @@ my $query = CGI->new;
|
|||
|
||||
my ( $userid, $cookie, $sessionID, $flags ) = checkauth($query, 0, { borrowers => 'edit_borrowers' }, 'intranet');
|
||||
|
||||
my $op = $query->param('op') || q{};
|
||||
my $logged_in_user = Koha::Patrons->find({ userid => $userid });
|
||||
|
||||
my @params = $query->param;
|
||||
|
||||
foreach my $param (@params) {
|
||||
if ( $param =~ "^modify_" ) {
|
||||
my (undef, $borrowernumber) = split( /_/, $param );
|
||||
if ( $op eq 'cud-update' ) {
|
||||
foreach my $param (@params) {
|
||||
if ( $param =~ "^modify_" ) {
|
||||
my (undef, $borrowernumber) = split( /_/, $param );
|
||||
|
||||
my $patron = Koha::Patrons->find($borrowernumber);
|
||||
next unless $logged_in_user->can_see_patron_infos( $patron );
|
||||
my $patron = Koha::Patrons->find($borrowernumber);
|
||||
next unless $logged_in_user->can_see_patron_infos( $patron );
|
||||
|
||||
my $action = $query->param($param);
|
||||
my $action = $query->param($param);
|
||||
|
||||
if ( $action eq 'approve' ) {
|
||||
my $m = Koha::Patron::Modifications->find( { borrowernumber => $borrowernumber } );
|
||||
if ( $action eq 'approve' ) {
|
||||
my $m = Koha::Patron::Modifications->find( { borrowernumber => $borrowernumber } );
|
||||
|
||||
if ($query->param("unset_gna_$borrowernumber")) {
|
||||
# Unset gone no address
|
||||
# FIXME Looks like this could go to $m->approve
|
||||
my $patron = Koha::Patrons->find( $borrowernumber );
|
||||
$patron->gonenoaddress(undef)->store;
|
||||
if ($query->param("unset_gna_$borrowernumber")) {
|
||||
# Unset gone no address
|
||||
# FIXME Looks like this could go to $m->approve
|
||||
my $patron = Koha::Patrons->find( $borrowernumber );
|
||||
$patron->gonenoaddress(undef)->store;
|
||||
}
|
||||
|
||||
$m->approve() if $m;
|
||||
}
|
||||
|
||||
$m->approve() if $m;
|
||||
elsif ( $action eq 'deny' ) {
|
||||
my $m = Koha::Patron::Modifications->find( { borrowernumber => $borrowernumber } );
|
||||
$m->delete() if $m;
|
||||
}
|
||||
# elsif ( $action eq 'ignore' ) { }
|
||||
}
|
||||
elsif ( $action eq 'deny' ) {
|
||||
my $m = Koha::Patron::Modifications->find( { borrowernumber => $borrowernumber } );
|
||||
$m->delete() if $m;
|
||||
}
|
||||
# elsif ( $action eq 'ignore' ) { }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue