Bugzilla – Attachment 107936 Details for
Bug 24591
Add developer script to preview a letter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24591: Add --help option to misc/devel/get-prepared-letter.pl
Bug-24591-Add---help-option-to-miscdevelget-prepar.patch (text/plain), 3.74 KB, created by
Nick Clemens (kidclamp)
on 2020-08-07 00:50:38 UTC
(
hide
)
Description:
Bug 24591: Add --help option to misc/devel/get-prepared-letter.pl
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-08-07 00:50:38 UTC
Size:
3.74 KB
patch
obsolete
>From a986b5c5d12ef1af767e823e4f037f87655ef0fc Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 10 Apr 2020 11:19:47 +0200 >Subject: [PATCH] Bug 24591: Add --help option to > misc/devel/get-prepared-letter.pl > >Also fix code style with perltidy > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > misc/devel/get-prepared-letter.pl | 93 ++++++++++++++++++++++++++++++++------- > 1 file changed, 76 insertions(+), 17 deletions(-) > >diff --git a/misc/devel/get-prepared-letter.pl b/misc/devel/get-prepared-letter.pl >index 30150162e4..45f5544d82 100755 >--- a/misc/devel/get-prepared-letter.pl >+++ b/misc/devel/get-prepared-letter.pl >@@ -16,39 +16,98 @@ > # You should have received a copy of the GNU General Public License along > # with Koha; if not, see <http://www.gnu.org/licenses>. > >+=head1 NAME >+ >+get-prepared-letter.pl - preview letter content >+ >+=head1 SYNOPSIS >+ >+get-prepared-letter.pl --module MODULE --letter-code CODE [options] >+ >+=head1 OPTIONS >+ >+=over >+ >+=item B<--module MODULE> >+ >+The letter module (acquisition, catalogue, circulation, ...) >+ >+=item B<--letter-code CODE> >+ >+The letter code (DUE, PREDUE, ...) >+ >+=item B<--branchcode BRANCHCODE> >+ >+The letter branchcode >+ >+=item B<--message-transport-type TYPE> >+ >+The message transport type (email, print, ...) >+ >+=item B<--lang LANG> >+ >+The letter language (es-ES, fr-FR, ...) >+ >+=item B<--repeat REPEAT> >+ >+A JSON formatted string that will be used as repeat parameter. See >+documentation of GetPreparedLetter for more informations. >+ >+=item B<--tables TABLES> >+ >+A JSON formatted string that will be used as tables parameter. See >+documentation of GetPreparedLetter for more informations. >+ >+=item B<--loops LOOPS> >+ >+A JSON formatted string that will be used as loops parameter. See >+documentation of GetPreparedLetter for more informations. >+ >+=back >+ >+=cut >+ > use Modern::Perl; > > use Getopt::Long; > use JSON; >+use Pod::Usage; > > use C4::Letters; > >-my ($module, $letter_code, $branchcode, $message_transport_type, $lang, $repeat, $tables, $loops); >+my $help; >+my ( $module, $letter_code, $branchcode, $message_transport_type, $lang, >+ $repeat, $tables, $loops ); > > GetOptions( >- 'module=s' => \$module, >- 'letter-code=s' => \$letter_code, >- 'branchcode=s' => \$branchcode, >+ 'help' => \$help, >+ 'module=s' => \$module, >+ 'letter-code=s' => \$letter_code, >+ 'branchcode=s' => \$branchcode, > 'message-transport-type=s' => \$message_transport_type, >- 'lang=s' => \$lang, >- 'repeat=s' => \$repeat, >- 'tables=s' => \$tables, >- 'loops=s' => \$loops, >-) or die "Error in command line arguments\n"; >+ 'lang=s' => \$lang, >+ 'repeat=s' => \$repeat, >+ 'tables=s' => \$tables, >+ 'loops=s' => \$loops, >+) or pod2usage( -exitval => 2, -verbose => 1 ); >+ >+if ($help) { >+ pod2usage( -exitval => 0, -verbose => 1 ); >+} > > $repeat = $repeat ? decode_json($repeat) : {}; > $tables = $tables ? decode_json($tables) : {}; >-$loops = $loops ? decode_json($loops) : {}; >+$loops = $loops ? decode_json($loops) : {}; > > my $letter = C4::Letters::GetPreparedLetter( >- module => $module, >- letter_code => $letter_code, >- branchcode => $branchcode, >+ module => $module, >+ letter_code => $letter_code, >+ branchcode => $branchcode, > message_transport_type => $message_transport_type, >- lang => $lang, >- repeat => $repeat, >- tables => $tables, >- loops => $loops, >+ lang => $lang, >+ repeat => $repeat, >+ tables => $tables, >+ loops => $loops, > ); > > print "Subject: " . $letter->{title} . "\n\n"; >-- >2.11.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 24591
:
98448
|
101389
|
101390
|
102685
|
107935
|
107936
|
107942
|
107943