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

(-)a/C4/Letters.pm (+6 lines)
Lines 1615-1620 sub _get_tt_params { Link Here
1615
            plural   => 'patron_modifications',
1615
            plural   => 'patron_modifications',
1616
            fk       => 'verification_token',
1616
            fk       => 'verification_token',
1617
        },
1617
        },
1618
        illrequests => {
1619
            module   => 'Koha::Illrequests',
1620
            singular => 'illrequest',
1621
            plural   => 'illrequests',
1622
            pk       => 'illrequest_id'
1623
        }
1618
    };
1624
    };
1619
1625
1620
    foreach my $table ( keys %$tables ) {
1626
    foreach my $table ( keys %$tables ) {
(-)a/Koha/Illrequest.pm (-4 / +6 lines)
Lines 1290-1296 attempts to submit the email. Link Here
1290
1290
1291
sub generic_confirm {
1291
sub generic_confirm {
1292
    my ( $self, $params ) = @_;
1292
    my ( $self, $params ) = @_;
1293
    my $library = Koha::Libraries->find($params->{current_branchcode})
1293
    my $branch = Koha::Libraries->find($params->{current_branchcode})
1294
        || die "Invalid current branchcode. Are you logged in as the database user?";
1294
        || die "Invalid current branchcode. Are you logged in as the database user?";
1295
    if ( !$params->{stage}|| $params->{stage} eq 'init' ) {
1295
    if ( !$params->{stage}|| $params->{stage} eq 'init' ) {
1296
        # Get the message body from the notice definition
1296
        # Get the message body from the notice definition
Lines 1328-1335 sub generic_confirm { Link Here
1328
            "No target email addresses found. Either select at least one partner or check your ILL partner library records.")
1328
            "No target email addresses found. Either select at least one partner or check your ILL partner library records.")
1329
          if ( !$to );
1329
          if ( !$to );
1330
        # Create the from, replyto and sender headers
1330
        # Create the from, replyto and sender headers
1331
        my $from = $branch->branchemail;
1331
        my $from = $branch->branchillemail || $branch->branchemail;
1332
        my $replyto = $branch->inbound_ill_address;
1332
        my $replyto = $branch->branchreplyto || $from;
1333
        Koha::Exceptions::Ill::NoLibraryEmail->throw(
1333
        Koha::Exceptions::Ill::NoLibraryEmail->throw(
1334
            "Your library has no usable email address. Please set it.")
1334
            "Your library has no usable email address. Please set it.")
1335
          if ( !$from );
1335
          if ( !$from );
Lines 1343-1349 sub generic_confirm { Link Here
1343
        $letter->{title} = $params->{subject};
1343
        $letter->{title} = $params->{subject};
1344
        $letter->{content} = $params->{body};
1344
        $letter->{content} = $params->{body};
1345
1345
1346
        # Send the email
1346
        # Queue the notice
1347
        my $params = {
1347
        my $params = {
1348
            letter                 => $letter,
1348
            letter                 => $letter,
1349
            borrowernumber         => $self->borrowernumber,
1349
            borrowernumber         => $self->borrowernumber,
Lines 1501-1511 sub send_staff_notice { Link Here
1501
    # Try and get an address to which to send staff notices
1501
    # Try and get an address to which to send staff notices
1502
    my $branch = Koha::Libraries->find($self->branchcode);
1502
    my $branch = Koha::Libraries->find($self->branchcode);
1503
    my $to_address = $branch->inbound_ill_address;
1503
    my $to_address = $branch->inbound_ill_address;
1504
    my $from_address = $branch->inbound_ill_address;
1504
1505
1505
    my $params = {
1506
    my $params = {
1506
        letter                 => $letter,
1507
        letter                 => $letter,
1507
        borrowernumber         => $self->borrowernumber,
1508
        borrowernumber         => $self->borrowernumber,
1508
        message_transport_type => 'email',
1509
        message_transport_type => 'email',
1510
        from_address           => $from_address
1509
    };
1511
    };
1510
1512
1511
    if ($to_address) {
1513
    if ($to_address) {
(-)a/api/v1/swagger/definitions/library.json (+4 lines)
Lines 48-53 Link Here
48
      "type": ["string", "null"],
48
      "type": ["string", "null"],
49
      "description": "the primary email address of the library"
49
      "description": "the primary email address of the library"
50
    },
50
    },
51
    "illemail": {
52
      "type": ["string", "null"],
53
      "description": "the ILL staff email address of the library"
54
    },
51
    "reply_to_email": {
55
    "reply_to_email": {
52
      "type": ["string", "null"],
56
      "type": ["string", "null"],
53
      "description": "the email to be used as a Reply-To"
57
      "description": "the email to be used as a Reply-To"
(-)a/installer/data/mysql/atomicupdate/bug_22818_add_ill_notices.perl (-10 / +10 lines)
Lines 7-22 if( CheckVersion( $DBversion ) ) { Link Here
7
    $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('ILLDefaultStaffEmail', '', 'Fallback email address for staff ILL notices to be sent to in the absence of a branch address', NULL, 'Free'); | );
7
    $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('ILLDefaultStaffEmail', '', 'Fallback email address for staff ILL notices to be sent to in the absence of a branch address', NULL, 'Free'); | );
8
    $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('ILLSendStaffNotices', NULL, 'Send these ILL notices to staff', NULL, 'multiple'); | );
8
    $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('ILLSendStaffNotices', NULL, 'Send these ILL notices to staff', NULL, 'multiple'); | );
9
    # Add new notices
9
    # Add new notices
10
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PICKUP_READY', '', 'ILL request ready for pickup', 0, "Interlibrary loan request ready for pickup", "Dear [% borrowers.firstname %] [% borrowers.surname %],\n\nThe Interlibrary loans request number [% illrequests.illrequest_id %] you placed for:\n\n- [% ill_bib_title %] - [% ill_bib_author %]\n\nis ready for pick up from [% branches.branchname %].\n\nKind Regards\n\n[% branches.branchname %]\n[% branches.branchaddress1 %]\n[% branches.branchaddress2 %]\n[% branches.branchaddress3 %]\n[% branches.branchcity %]\n[% branches.branchstate %]\n[% branches.branchzip %]\n[% branches.branchphone %]\n[% branches.branchillemail %]\n[% branches.branchemail %]", 'email', 'default'); | );
10
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PICKUP_READY', '', 'ILL request ready for pickup', 0, "Interlibrary loan request ready for pickup", "Dear [% borrower.firstname %] [% borrower.surname %],\n\nThe Interlibrary loans request number [% illrequest.illrequest_id %] you placed for:\n\n- [% ill_bib_title %] - [% ill_bib_author %]\n\nis ready for pick up from [% branch.branchname %].\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'email', 'default'); | );
11
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_UNAVAIL', '', 'ILL request unavailable', 0, "Interlibrary loan request unavailable", "Dear [% borrowers.firstname %] [% borrowers.surname %],\n\nThe Interlibrary loans request number [% illrequests.illrequest_id %] you placed for\n\n- [% ill_bib_title %] - [% ill_bib_author %]\n\nis unfortunately unavailable.\n\nKind Regards\n\n[% branches.branchname %]\n[% branches.branchaddress1 %]\n[% branches.branchaddress2 %]\n[% branches.branchaddress3 %]\n[% branches.branchcity %]\n[% branches.branchstate %]\n[% branches.branchzip %]\n[% branches.branchphone %]\n[% branches.branchillemail %]\n[% branches.branchemail %]", 'email', 'default'); | );
11
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_UNAVAIL', '', 'ILL request unavailable', 0, "Interlibrary loan request unavailable", "Dear [% borrower.firstname %] [% borrower.surname %],\n\nThe Interlibrary loans request number [% illrequest.illrequest_id %] you placed for\n\n- [% ill_bib_title %] - [% ill_bib_author %]\n\nis unfortunately unavailable.\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'email', 'default'); | );
12
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_CANCEL', '', 'ILL request cancelled', 0, "Interlibrary loan request cancelled", "The patron for interlibrary loans request [% illrequests.illrequest_id %], with the following details, has requested cancellation of this ILL request:\n\n[% ill_full_metadata %]", 'email', 'default'); | );
12
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_CANCEL', '', 'ILL request cancelled', 0, "Interlibrary loan request cancelled", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has requested cancellation of this ILL request:\n\n[% ill_full_metadata %]", 'email', 'default'); | );
13
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_MODIFIED', '', 'ILL request modified', 0, "Interlibrary loan request modified", "The patron for interlibrary loans request [% illrequests.illrequest_id %], with the following details, has modified this ILL request:\n\n[% ill_full_metadata %]", 'email', 'default'); | );
13
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_MODIFIED', '', 'ILL request modified', 0, "Interlibrary loan request modified", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has modified this ILL request:\n\n[% ill_full_metadata %]", 'email', 'default'); | );
14
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PARTNER_REQ', '', 'ILL request to partners', 0, "Interlibrary loan request to partners", "Dear Sir/Madam,\n\nWe would like to request an interlibrary loan for a title matching the following description:\n\n[% ill_full_metadata %]\n\nPlease let us know if you are able to supply this to us.\n\nKind Regards\n\n[% branches.branchname %]\n[% branches.branchaddress1 %]\n[% branches.branchaddress2 %]\n[% branches.branchaddress3 %]\n[% branches.branchcity %]\n[% branches.branchstate %]\n[% branches.branchzip %]\n[% branches.branchphone %]\n[% branches.branchillemail %]\n[% branches.branchemail %]", 'email', 'default'); | );
14
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PARTNER_REQ', '', 'ILL request to partners', 0, "Interlibrary loan request to partners", "Dear Sir/Madam,\n\nWe would like to request an interlibrary loan for a title matching the following description:\n\n[% ill_full_metadata %]\n\nPlease let us know if you are able to supply this to us.\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'email', 'default'); | );
15
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PICKUP_READY', '', 'ILL request ready for pickup', 0, "Interlibrary loan request ready for pickup", "Dear [% borrowers.firstname %] [% borrowers.surname %],\n\nThe Interlibrary loans request number [% illrequests.illrequest_id %] you placed for:\n\n- [% ill_bib_title %] - [% ill_bib_author %]\n\nis ready for pick up from [% branches.branchname %].\n\nKind Regards\n\n[% branches.branchname %]\n[% branches.branchaddress1 %]\n[% branches.branchaddress2 %]\n[% branches.branchaddress3 %]\n[% branches.branchcity %]\n[% branches.branchstate %]\n[% branches.branchzip %]\n[% branches.branchphone %]\n[% branches.branchillemail %]\n[% branches.branchemail %]", 'sms', 'default'); | );
15
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PICKUP_READY', '', 'ILL request ready for pickup', 0, "Interlibrary loan request ready for pickup", "Dear [% borrower.firstname %] [% borrower.surname %],\n\nThe Interlibrary loans request number [% illrequest.illrequest_id %] you placed for:\n\n- [% ill_bib_title %] - [% ill_bib_author %]\n\nis ready for pick up from [% branch.branchname %].\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'sms', 'default'); | );
16
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_UNAVAIL', '', 'ILL request unavailable', 0, "Interlibrary loan request unavailable", "Dear [% borrowers.firstname %] [% borrowers.surname %],\n\nThe Interlibrary loans request number [% illrequests.illrequest_id %] you placed for\n\n- [% ill_bib_title %] - [% ill_bib_author %]\n\nis unfortunately unavailable.\n\nKind Regards\n\n[% branches.branchname %]\n[% branches.branchaddress1 %]\n[% branches.branchaddress2 %]\n[% branches.branchaddress3 %]\n[% branches.branchcity %]\n[% branches.branchstate %]\n[% branches.branchzip %]\n[% branches.branchphone %]\n[% branches.branchillemail %]\n[% branches.branchemail %]", 'sms', 'default'); | );
16
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_UNAVAIL', '', 'ILL request unavailable', 0, "Interlibrary loan request unavailable", "Dear [% borrower.firstname %] [% borrower.surname %],\n\nThe Interlibrary loans request number [% illrequest.illrequest_id %] you placed for\n\n- [% ill_bib_title %] - [% ill_bib_author %]\n\nis unfortunately unavailable.\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'sms', 'default'); | );
17
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_CANCEL', '', 'ILL request cancelled', 0, "Interlibrary loan request cancelled", "The patron for interlibrary loans request [% illrequests.illrequest_id %], with the following details, has requested cancellation of this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); | );
17
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_CANCEL', '', 'ILL request cancelled', 0, "Interlibrary loan request cancelled", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has requested cancellation of this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); | );
18
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_MODIFIED', '', 'ILL request modified', 0, "Interlibrary loan request modified", "The patron for interlibrary loans request [% illrequests.illrequest_id %], with the following details, has modified this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); | );
18
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_MODIFIED', '', 'ILL request modified', 0, "Interlibrary loan request modified", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has modified this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default'); | );
19
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PARTNER_REQ', '', 'ILL request to partners', 0, "Interlibrary loan request to partners", "Dear Sir/Madam,\n\nWe would like to request an interlibrary loan for a title matching the following description:\n\n[% ill_full_metadata %]\n\nPlease let us know if you are able to supply this to us.\n\nKind Regards\n\n[% branches.branchname %]\n[% branches.branchaddress1 %]\n[% branches.branchaddress2 %]\n[% branches.branchaddress3 %]\n[% branches.branchcity %]\n[% branches.branchstate %]\n[% branches.branchzip %]\n[% branches.branchphone %]\n[% branches.branchillemail %]\n[% branches.branchemail %]", 'sms', 'default'); | );
19
    $dbh->do( q| INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PARTNER_REQ', '', 'ILL request to partners', 0, "Interlibrary loan request to partners", "Dear Sir/Madam,\n\nWe would like to request an interlibrary loan for a title matching the following description:\n\n[% ill_full_metadata %]\n\nPlease let us know if you are able to supply this to us.\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'sms', 'default'); | );
20
    # Add patron messaging preferences
20
    # Add patron messaging preferences
21
    $dbh->do( q| INSERT IGNORE INTO message_attributes (message_name, takes_days) VALUES ('Ill_ready', 0); | );
21
    $dbh->do( q| INSERT IGNORE INTO message_attributes (message_name, takes_days) VALUES ('Ill_ready', 0); | );
22
    my $ready_id = $dbh->{mysql_insertid};
22
    my $ready_id = $dbh->{mysql_insertid};
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc (-2 / +2 lines)
Lines 25-32 Link Here
25
            [% ELSE %]
25
            [% ELSE %]
26
                Item checkout
26
                Item checkout
27
            [% END %]
27
            [% END %]
28
          [% ELSIF ( messaging_preference.Ill_ready ) %]Interlibrary loan ready
28
          [% ELSIF ( Koha.Preference('ILLModule') && messaging_preference.Ill_ready ) %]Interlibrary loan ready
29
          [% ELSIF ( messaging_preference.Ill_unavailable ) %]Interlibrary loan unavailable
29
          [% ELSIF ( Koha.Preference('ILLModule') && messaging_preference.Ill_unavailable ) %]Interlibrary loan unavailable
30
          [% ELSE %]Unknown [% END %]</td>
30
          [% ELSE %]Unknown [% END %]</td>
31
      [% IF ( messaging_preference.takes_days ) %]
31
      [% IF ( messaging_preference.takes_days ) %]
32
      <td>
32
      <td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt (-2 / +2 lines)
Lines 536-543 Link Here
536
                                                [% ELSIF ( prefs.Hold_Filled ) %]Hold filled
536
                                                [% ELSIF ( prefs.Hold_Filled ) %]Hold filled
537
                                                [% ELSIF ( prefs.Item_Check_in ) %]Item check-in
537
                                                [% ELSIF ( prefs.Item_Check_in ) %]Item check-in
538
                                                [% ELSIF ( prefs.Item_Checkout ) %]Item checkout
538
                                                [% ELSIF ( prefs.Item_Checkout ) %]Item checkout
539
                                                [% ELSIF ( prefs.Ill_ready ) %]Interlibrary loan ready
539
                                                [% ELSIF ( Koha.Preference('ILLModule') && prefs.Ill_ready ) %]Interlibrary loan ready
540
                                                [% ELSIF ( prefs.Ill_unavailable ) %]Interlibrary loan unavailable
540
                                                [% ELSIF ( Koha.Preference('ILLModule') && prefs.Ill_unavailable ) %]Interlibrary loan unavailable
541
                                                [% ELSE %]Unknown
541
                                                [% ELSE %]Unknown
542
                                                [% END %]:
542
                                                [% END %]:
543
                                                <strong>[% transport.transport | html %]</strong><br />
543
                                                <strong>[% transport.transport | html %]</strong><br />
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt (-3 / +2 lines)
Lines 66-73 Link Here
66
                                                    [% ELSE %]
66
                                                    [% ELSE %]
67
                                                        Item checkout
67
                                                        Item checkout
68
                                                    [% END %]
68
                                                    [% END %]
69
                                                [% ELSIF ( messaging_preference.Ill_ready ) %]Interlibrary loan ready
69
                                                [% ELSIF ( Koha.Preference( 'ILLModule' ) && messaging_preference.Ill_ready ) %]Interlibrary loan ready
70
                                                [% ELSIF ( messaging_preference.Ill_unavailable ) %]Interlibrary loan unavailable
70
                                                [% ELSIF ( Koha.Preference( 'ILLModule' ) && messaging_preference.Ill_unavailable ) %]Interlibrary loan unavailable
71
                                                [% ELSE %]Unknown [% END %]</td>
71
                                                [% ELSE %]Unknown [% END %]</td>
72
                                            [% IF ( messaging_preference.takes_days ) %]
72
                                            [% IF ( messaging_preference.takes_days ) %]
73
                                                <td><select class="input-mini" name="[% messaging_preference.message_attribute_id | html %]-DAYS">
73
                                                <td><select class="input-mini" name="[% messaging_preference.message_attribute_id | html %]-DAYS">
74
- 

Return to bug 22818