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

(-)a/Koha/Recall.pm (-11 / +12 lines)
Lines 451-474 sub set_cancelled { Link Here
451
451
452
    # send notice to recaller to pick up item
452
    # send notice to recaller to pick up item
453
    my $letter = C4::Letters::GetPreparedLetter(
453
    my $letter = C4::Letters::GetPreparedLetter(
454
        module => 'circulation',
454
        module      => 'circulation',
455
        letter_code => 'RECALL_MANUAL_CANCEL',
455
        letter_code => 'RECALL_MANUAL_CANCEL',
456
        branchcode => $self->pickup_library_id,
456
        branchcode  => $self->pickup_library_id,
457
        lang => $self->patron->lang,
457
        lang        => $self->patron->lang,
458
        tables => {
458
        tables      => {
459
            biblio => $self->biblio_id,
459
            biblio    => $self->biblio_id,
460
            borrowers => $self->patron_id,
460
            borrowers => $self->patron_id,
461
            branches => $self->pickup_library_id,
461
            branches  => $self->pickup_library_id,
462
        },
462
        },
463
    );
463
    );
464
464
465
    my $messaging_preferences = C4::Members::Messaging::GetMessagingPreferences({ borrowernumber => $self->patron_id, message_name => 'Recall_Cancelled' });
465
    my $messaging_preferences = C4::Members::Messaging::GetMessagingPreferences(
466
        { borrowernumber => $self->patron_id, message_name => 'Recall_Cancelled' } );
466
    while ( my ( $transport, $letter_code ) = each %{ $messaging_preferences->{transports} } ) {
467
    while ( my ( $transport, $letter_code ) = each %{ $messaging_preferences->{transports} } ) {
467
        if ( $transport eq 'email' ){
468
        if ( $transport eq 'email' ) {
468
            C4::Message->enqueue($letter, $self->patron->unblessed, 'email');
469
            C4::Message->enqueue( $letter, $self->patron, 'email' );
469
        }
470
        }
470
        if ( $transport eq 'sms' ){
471
        if ( $transport eq 'sms' ) {
471
            C4::Message->enqueue($letter, $self->patron->unblessed, 'sms');
472
            C4::Message->enqueue( $letter, $self->patron, 'sms' );
472
        }
473
        }
473
    }
474
    }
474
475
(-)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