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

(-)a/installer/data/mysql/atomicupdate/add-system-preference-EmailOverduesNoEmail.perl (+9 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if ( CheckVersion($DBversion ) ) {
3
    $dbh->do(q{
4
            INSERT IGNORE INTO systempreferences (`variable`,`value`,`options`,`explanation`,`type`)
5
            VALUES ('EmailOverduesNoEmail','0','','Set mail sending to staff for patron has overdues but no email address', 'YesNo')
6
            });
7
8
    NewVersion( $DBversion,'20076','Add system preference EmailOverduesNoEmail');
9
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 193-198 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
193
('ElasticsearchCrossFields', '1', '', 'Enable "cross_fields" option for searches using Elastic search.', 'YesNo'),
193
('ElasticsearchCrossFields', '1', '', 'Enable "cross_fields" option for searches using Elastic search.', 'YesNo'),
194
('EmailAddressForSuggestions','','',' If you choose EmailAddressForSuggestions you have to enter a valid email address: ','free'),
194
('EmailAddressForSuggestions','','',' If you choose EmailAddressForSuggestions you have to enter a valid email address: ','free'),
195
('emailLibrarianWhenHoldIsPlaced','0',NULL,'If ON, emails the librarian whenever a hold is placed','YesNo'),
195
('emailLibrarianWhenHoldIsPlaced','0',NULL,'If ON, emails the librarian whenever a hold is placed','YesNo'),
196
('EmailOverduesNoEmail','0',NULL,'Set mail sending to staff for patron has overdues but no email address','YesNo'),
196
('EmailPurchaseSuggestions','0','0|EmailAddressForSuggestions|BranchEmailAddress|KohaAdminEmailAddress','Choose email address that new purchase suggestions will be sent to: ','Choice'),
197
('EmailPurchaseSuggestions','0','0|EmailAddressForSuggestions|BranchEmailAddress|KohaAdminEmailAddress','Choose email address that new purchase suggestions will be sent to: ','Choice'),
197
('EnableAdvancedCatalogingEditor','0','','Enable the Rancor advanced cataloging editor','YesNo'),
198
('EnableAdvancedCatalogingEditor','0','','Enable the Rancor advanced cataloging editor','YesNo'),
198
('EnableBorrowerFiles','0',NULL,'If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo'),
199
('EnableBorrowerFiles','0',NULL,'If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (+8 lines)
Lines 76-81 Administration: Link Here
76
              choices:
76
              choices:
77
                  1: "The logged-in library"
77
                  1: "The logged-in library"
78
                  0: "All libraries"
78
                  0: "All libraries"
79
80
        -
81
            - pref: EmailOverduesNoEmail
82
              choices:
83
                  1: "Don't send"
84
                  0: "Send"
85
            - "mail to staff for patron has overdues but no email address"
86
79
    Login options:
87
    Login options:
80
        -
88
        -
81
            - "Inactivity timeout in seconds to automatically log out users: "
89
            - "Inactivity timeout in seconds to automatically log out users: "
(-)a/misc/cronjobs/overdue_notices.pl (-20 / +23 lines)
Lines 368-373 if (@branchcodes) { Link Here
368
        my $branch_word = scalar @branches > 1 ? 'branches' : 'branch';
368
        my $branch_word = scalar @branches > 1 ? 'branches' : 'branch';
369
    $verbose and warn "$branch_word @branches have overdue rules\n";
369
    $verbose and warn "$branch_word @branches have overdue rules\n";
370
370
371
371
    } else {
372
    } else {
372
    
373
    
373
        $verbose and warn "No active overduerules for $branchcodes_word  '@branchcodes'\n";
374
        $verbose and warn "No active overduerules for $branchcodes_word  '@branchcodes'\n";
Lines 841-865 END_SQL Link Here
841
        }
842
        }
842
        $content .= join( "\n", @output_chunks );
843
        $content .= join( "\n", @output_chunks );
843
844
844
        my $attachment = {
845
        my $EmailOverduesNoEmail = C4::Context->preference('EmailOverduesNoEmail');
845
            filename => defined $csvfilename ? 'attachment.csv' : 'attachment.txt',
846
        if ( $EmailOverduesNoEmail == 0) {
846
            type => 'text/plain',
847
            my $attachment = {
847
            content => $content, 
848
                filename => defined $csvfilename ? 'attachment.csv' : 'attachment.txt',
848
        };
849
                type => 'text/plain',
849
850
                content => $content,
850
        my $letter = {
851
            };
851
            title   => 'Overdue Notices',
852
852
            content => 'These messages were not sent directly to the patrons.',
853
            my $letter = {
853
        };
854
                title   => 'Overdue Notices',
854
855
                content => 'These messages were not sent directly to the patrons.',
855
        C4::Letters::EnqueueLetter(
856
            };
856
            {   letter                 => $letter,
857
857
                borrowernumber         => undef,
858
            C4::Letters::EnqueueLetter(
858
                message_transport_type => 'email',
859
                {   letter                 => $letter,
859
                attachments            => [$attachment],
860
                    borrowernumber         => undef,
860
                to_address             => $branch_email_address,
861
                    message_transport_type => 'email',
861
            }
862
                    attachments            => [$attachment],
862
        ) unless $test_mode;
863
                    to_address             => $branch_email_address,
864
                }
865
            ) unless $test_mode;
866
        }
863
    }
867
    }
864
868
865
}
869
}
866
- 

Return to bug 20076