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

(-)a/C4/Letters.pm (-1 / +18 lines)
Lines 42-48 BEGIN { Link Here
42
	$VERSION = 3.01;
42
	$VERSION = 3.01;
43
	@ISA = qw(Exporter);
43
	@ISA = qw(Exporter);
44
	@EXPORT = qw(
44
	@EXPORT = qw(
45
	&GetLetters &getletter &addalert &getalert &delalert &findrelatedto &SendAlerts GetPrintMessages
45
	&GetLetters &getletter &addalert &getalert &delalert &findrelatedto &SendAlerts &GetPrintMessages &DelEmptyMessages
46
	);
46
	);
47
}
47
}
48
48
Lines 710-715 ENDSQL Link Here
710
    return $sth->fetchall_arrayref({});
710
    return $sth->fetchall_arrayref({});
711
}
711
}
712
712
713
714
=head2 DelEmptyMessages
715
    &DelcwEmptyMessages()
716
    
717
    Delete all messages without subjet nor content
718
    
719
=cut
720
sub DelEmptyMessages {
721
    my $dbh = C4::Context->dbh;
722
723
    my $sth = $dbh->prepare("
724
        DELETE FROM message_queue WHERE subject is null and content is null;
725
    ");
726
    $sth->execute();
727
}
728
729
713
=head2 _add_attachements
730
=head2 _add_attachements
714
731
715
named parameters:
732
named parameters:
(-)a/misc/cronjobs/purge_message_queue.pl (-1 / +58 lines)
Line 0 Link Here
0
- 
1
2
#!/usr/bin/perl -w
3
4
# Copyright 2010 Biblibre SARL
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it under the
9
# terms of the GNU General Public License as published by the Free Software
10
# Foundation; either version 2 of the License, or (at your option) any later
11
# version.
12
#
13
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
14
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License along
18
# with Koha; if not, write to the Free Software Foundation, Inc.,
19
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21
use strict;
22
use warnings;
23
use utf8;
24
25
BEGIN {
26
27
    # find Koha's Perl modules
28
    # test carefully before changing this
29
    use FindBin;
30
    eval { require "$FindBin::Bin/../kohalib.pl" };
31
}
32
33
use Getopt::Long;
34
use Pod::Usage;
35
use C4::Letters;
36
37
my ($help);
38
39
GetOptions(
40
    'help|?'         => \$help
41
);
42
43
if($help){
44
    print <<EOF
45
    This script delete message without subject nor content.
46
    It has to be run before sending messages.
47
    Parameters :
48
    -help|? This message
49
50
     example :
51
     export PERL5LIB=/path/to/koha;export KOHA_CONF=/etc/koha/koha-conf.xml;./purge_message_queue.pl
52
EOF
53
;
54
    exit;
55
}
56
57
DelEmptyMessages();
58

Return to bug 6090