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

(-)a/C4/Circulation.pm (-12 / +19 lines)
Lines 2257-2262 sub AddReturn { Link Here
2257
                item     => $item->unblessed,
2257
                item     => $item->unblessed,
2258
                borrower => $patron->unblessed,
2258
                borrower => $patron->unblessed,
2259
                branch   => $branch,
2259
                branch   => $branch,
2260
                issue    => $issue
2260
            });
2261
            });
2261
        }
2262
        }
2262
2263
Lines 3520-3527 B<Example>: Link Here
3520
3521
3521
sub SendCirculationAlert {
3522
sub SendCirculationAlert {
3522
    my ($opts) = @_;
3523
    my ($opts) = @_;
3523
    my ($type, $item, $borrower, $branch) =
3524
    my ($type, $item, $borrower, $branch, $issue) =
3524
        ($opts->{type}, $opts->{item}, $opts->{borrower}, $opts->{branch});
3525
        ($opts->{type}, $opts->{item}, $opts->{borrower}, $opts->{branch}, $opts->{issue});
3525
    my %message_name = (
3526
    my %message_name = (
3526
        CHECKIN  => 'Item_Check_in',
3527
        CHECKIN  => 'Item_Check_in',
3527
        CHECKOUT => 'Item_Checkout',
3528
        CHECKOUT => 'Item_Checkout',
Lines 3531-3537 sub SendCirculationAlert { Link Here
3531
        borrowernumber => $borrower->{borrowernumber},
3532
        borrowernumber => $borrower->{borrowernumber},
3532
        message_name   => $message_name{$type},
3533
        message_name   => $message_name{$type},
3533
    });
3534
    });
3534
    my $issues_table = ( $type eq 'CHECKOUT' || $type eq 'RENEWAL' ) ? 'issues' : 'old_issues';
3535
3536
3537
    my $tables = {
3538
        items => $item->{itemnumber},
3539
        biblio      => $item->{biblionumber},
3540
        biblioitems => $item->{biblionumber},
3541
        borrowers   => $borrower,
3542
        branches    => $branch,
3543
    };
3544
3545
    if( $type eq 'CHECKIN' ){
3546
        $tables->{old_issues} = $issue->issue_id;
3547
    } else {
3548
        $tables->{issues} = $item->{itemnumber};
3549
    }
3535
3550
3536
    my $schema = Koha::Database->new->schema;
3551
    my $schema = Koha::Database->new->schema;
3537
    my @transports = keys %{ $borrower_preferences->{transports} };
3552
    my @transports = keys %{ $borrower_preferences->{transports} };
Lines 3549-3562 sub SendCirculationAlert { Link Here
3549
            branchcode => $branch,
3564
            branchcode => $branch,
3550
            message_transport_type => $mtt,
3565
            message_transport_type => $mtt,
3551
            lang => $borrower->{lang},
3566
            lang => $borrower->{lang},
3552
            tables => {
3567
            tables => $tables,
3553
                $issues_table => $item->{itemnumber},
3554
                'items'       => $item->{itemnumber},
3555
                'biblio'      => $item->{biblionumber},
3556
                'biblioitems' => $item->{biblionumber},
3557
                'borrowers'   => $borrower,
3558
                'branches'    => $branch,
3559
            }
3560
        ) or next;
3568
        ) or next;
3561
3569
3562
        C4::Context->dbh->do(q|LOCK TABLE message_queue READ|) unless $do_not_lock;
3570
        C4::Context->dbh->do(q|LOCK TABLE message_queue READ|) unless $do_not_lock;
3563
- 

Return to bug 29062