Bugzilla – Attachment 39038 Details for
Bug 11603
Gather print notices: add csv and ods export
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11603 Add --send|--nosend, fix stuf
Bug-11603-Add---send--nosend-fix-stuf.patch (text/plain), 3.51 KB, created by
Jonathan Druart
on 2015-05-11 10:07:07 UTC
(
hide
)
Description:
Bug 11603 Add --send|--nosend, fix stuf
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-05-11 10:07:07 UTC
Size:
3.51 KB
patch
obsolete
>From 0851015893e10fe18eced4600f25f05a5828e0f5 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= <f.demians@tamil.fr> >Date: Tue, 14 Apr 2015 13:13:18 +0200 >Subject: [PATCH] Bug 11603 Add --send|--nosend, fix stuf > >Fix --html without --letter_code >Fix --ods which was producing a 2 lines ods file > >Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> >--- > misc/cronjobs/gather_print_notices.pl | 44 +++++++++++++++++++++++++---------- > 1 file changed, 32 insertions(+), 12 deletions(-) > >diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl >index b2b5293..fb68085 100755 >--- a/misc/cronjobs/gather_print_notices.pl >+++ b/misc/cronjobs/gather_print_notices.pl >@@ -23,8 +23,19 @@ use C4::Log; > use File::Basename qw( dirname ); > use Koha::DateUtils; > >-my ( $stylesheet, $help, $split, $html, $csv, $ods, $delimiter, @letter_codes ); >- >+my ( >+ $stylesheet, >+ $help, >+ $split, >+ $html, >+ $csv, >+ $ods, >+ $delimiter, >+ @letter_codes, >+ $send, >+); >+ >+$send = 1; > GetOptions( > 'h|help' => \$help, > 's|split' => \$split, >@@ -33,6 +44,7 @@ GetOptions( > 'ods' => \$ods, > 'd|delimiter:s' => \$delimiter, > 'letter_code:s' => \@letter_codes, >+ 'send!' => \$send, > ) || pod2usage(1); > > pod2usage(0) if $help; >@@ -76,7 +88,7 @@ my @all_messages = @{ GetPrintMessages() }; > ( > grep { /^$letter_code$/ } @letter_codes > ) ? $_ : () >-} @all_messages; >+} @all_messages if @letter_codes; > exit unless @all_messages; > > my ( $html_filenames, $csv_filenames, $ods_filenames ); >@@ -155,13 +167,15 @@ sub print_notices { > }); > } > >- foreach my $message ( @$branch_messages ) { >- C4::Letters::_set_message_status( >- { >- message_id => $message->{'message_id'}, >- status => 'sent' >- } >- ); >+ if ( $send ) { >+ foreach my $message ( @$branch_messages ) { >+ C4::Letters::_set_message_status( >+ { >+ message_id => $message->{'message_id'}, >+ status => 'sent' >+ } >+ ); >+ } > } > push @filenames, $filename; > } >@@ -231,7 +245,7 @@ sub generate_ods { > my $table = $doc->getTable(0); > > my @headers; >- my ( $nb_rows, $nb_cols ) = ( scalar(@$messages), 0 ); >+ my ( $nb_rows, $nb_cols, $i ) = ( scalar(@$messages), 0, 0 ); > foreach my $message ( @$messages ) { > my @lines = split /\n/, $message->{content}; > chomp for @lines; >@@ -248,10 +262,10 @@ sub generate_ods { > $doc->cellValue( $row, $j, Encode::encode( 'UTF8', $header ) ); > $j++; > } >+ $i = 1; > } > > shift @lines; # remove headers >- my $i = 1; > for my $line ( @lines ) { > my @row_data = split $delimiter, $line; > my $row = $doc->getRow( $table, $i ); >@@ -286,6 +300,12 @@ The generated filename will be holdnotices-TODAY.[csv|html|ods] or holdnotices-T > > Define the output directory where the files will be generated. > >+=item B<--send|--nosend> >+ >+After files have been generated, messages status is changed from 'pending' to >+'sent'. This is the default action, without this parameter or with --send. >+Using --nosend, mesages status aren't changed. >+ > =item B<-s|--split> > > Split messages into separate file by borrower home library to OUTPUT_DIRECTORY/notices-CURRENT_DATE-BRANCHCODE.[csv|html|ods] >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11603
:
25021
|
25022
|
25023
|
25024
|
25640
|
25642
|
30980
|
30981
|
30982
|
30983
|
37799
|
37812
|
37813
|
37814
|
37815
|
37816
|
37817
|
37829
|
37830
|
37831
|
37832
|
37833
|
37834
|
37837
|
38381
|
38385
|
38386
|
38387
|
38388
|
38389
|
38390
|
38391
|
38392
|
38403
|
38411
|
38412
|
38413
|
38414
|
38415
|
38416
|
38417
|
38418
|
38419
|
39033
|
39034
|
39035
|
39036
|
39037
| 39038 |
39039
|
39040
|
39041