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

(-)a/Koha/Recall.pm (-11 / +12 lines)
Lines 456-479 sub set_cancelled { Link Here
456
456
457
    # send notice to recaller to pick up item
457
    # send notice to recaller to pick up item
458
    my $letter = C4::Letters::GetPreparedLetter(
458
    my $letter = C4::Letters::GetPreparedLetter(
459
        module => 'circulation',
459
        module      => 'circulation',
460
        letter_code => 'RECALL_MANUAL_CANCEL',
460
        letter_code => 'RECALL_MANUAL_CANCEL',
461
        branchcode => $self->pickup_library_id,
461
        branchcode  => $self->pickup_library_id,
462
        lang => $self->patron->lang,
462
        lang        => $self->patron->lang,
463
        tables => {
463
        tables      => {
464
            biblio => $self->biblio_id,
464
            biblio    => $self->biblio_id,
465
            borrowers => $self->patron_id,
465
            borrowers => $self->patron_id,
466
            branches => $self->pickup_library_id,
466
            branches  => $self->pickup_library_id,
467
        },
467
        },
468
    );
468
    );
469
469
470
    my $messaging_preferences = C4::Members::Messaging::GetMessagingPreferences({ borrowernumber => $self->patron_id, message_name => 'Recall_Cancelled' });
470
    my $messaging_preferences = C4::Members::Messaging::GetMessagingPreferences(
471
        { borrowernumber => $self->patron_id, message_name => 'Recall_Cancelled' } );
471
    while ( my ( $transport, $letter_code ) = each %{ $messaging_preferences->{transports} } ) {
472
    while ( my ( $transport, $letter_code ) = each %{ $messaging_preferences->{transports} } ) {
472
        if ( $transport eq 'email' ){
473
        if ( $transport eq 'email' ) {
473
            C4::Message->enqueue($letter, $self->patron->unblessed, 'email');
474
            C4::Message->enqueue( $letter, $self->patron, 'email' );
474
        }
475
        }
475
        if ( $transport eq 'sms' ){
476
        if ( $transport eq 'sms' ) {
476
            C4::Message->enqueue($letter, $self->patron->unblessed, 'sms');
477
            C4::Message->enqueue( $letter, $self->patron, 'sms' );
477
        }
478
        }
478
    }
479
    }
479
480
(-)a/installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_message_attributes.pl (-4 / +6 lines)
Lines 1-12 Link Here
1
use Modern::Perl;
1
use Modern::Perl;
2
2
3
return {
3
return {
4
    bug_number => "30295",
4
    bug_number  => "30295",
5
    description => "Adding message attributes for RECALL_MANUAL_CANCEL",
5
    description => "Adding message attributes for RECALL_MANUAL_CANCEL",
6
    up => sub {
6
    up          => sub {
7
        my ($args) = @_;
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
9
10
        $dbh->do(q{ INSERT IGNORE INTO message_attributes (message_attribute_id, message_name, takes_days) VALUES (14, 'Recall_Cancelled', 0) });
10
        $dbh->do(
11
            q{ INSERT IGNORE INTO message_attributes (message_attribute_id, message_name, takes_days) VALUES (14, 'Recall_Cancelled', 0) }
12
        );
11
    },
13
    },
12
};
14
};
(-)a/installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_message_transports.pl (-4 / +6 lines)
Lines 1-12 Link Here
1
use Modern::Perl;
1
use Modern::Perl;
2
2
3
return {
3
return {
4
    bug_number => "30295",
4
    bug_number  => "30295",
5
    description => "Adding message transports for RECALL_MANUAL_CANCEL notice",
5
    description => "Adding message transports for RECALL_MANUAL_CANCEL notice",
6
    up => sub {
6
    up          => sub {
7
        my ($args) = @_;
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
9
10
        $dbh->do(q{ INSERT IGNORE INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code, branchcode) VALUES (14, "email", 0, "circulation", "RECALL_MANUAL_CANCEL", null), (14, "sms", 0, "circulation", "RECALL_MANUAL_CANCEL", null) });
10
        $dbh->do(
11
            q{ INSERT IGNORE INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code, branchcode) VALUES (14, "email", 0, "circulation", "RECALL_MANUAL_CANCEL", null), (14, "sms", 0, "circulation", "RECALL_MANUAL_CANCEL", null) }
12
        );
11
    },
13
    },
12
};
14
};
(-)a/installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_notice.pl (-6 / +7 lines)
Lines 1-13 Link Here
1
use Modern::Perl;
1
use Modern::Perl;
2
2
3
return {
3
return {
4
    bug_number => "30295",
4
    bug_number  => "30295",
5
    description => "Add RECALL_MANUAL_CANCEL email and sms notice",
5
    description => "Add RECALL_MANUAL_CANCEL email and sms notice",
6
    up => sub {
6
    up          => sub {
7
        my ($args) = @_;
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
9
10
        $dbh->do(q{ INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES ('circulation','RECALL_MANUAL_CANCEL','','Recall has been cancelled','0','Recall has been cancelled','Dear [% borrower.firstname %] [% borrower.surname %],
10
        $dbh->do(
11
            q{ INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES ('circulation','RECALL_MANUAL_CANCEL','','Recall has been cancelled','0','Recall has been cancelled','Dear [% borrower.firstname %] [% borrower.surname %],
11
12
12
We regret to inform you that the item you have recalled cannot be provided. Your recall was cancelled.
13
We regret to inform you that the item you have recalled cannot be provided. Your recall was cancelled.
13
14
Lines 19-24 We regret to inform you that the item you have recalled cannot be provided. Your Link Here
19
20
20
Title: [% biblio.title %]
21
Title: [% biblio.title %]
21
Author: [% biblio.author %]
22
Author: [% biblio.author %]
22
Location: [% branch.branchname %]','email') });
23
Location: [% branch.branchname %]','email') }
24
        );
23
    },
25
    },
24
};
26
};
25
- 

Return to bug 30295