Bugzilla – Attachment 98448 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 developer script to preview a letter
Bug-24591-Add-developer-script-to-preview-a-letter.patch (text/plain), 1.97 KB, created by
Julian Maurice
on 2020-02-05 11:27:44 UTC
(
hide
)
Description:
Bug 24591: Add developer script to preview a letter
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2020-02-05 11:27:44 UTC
Size:
1.97 KB
patch
obsolete
>From 0fdf90a9f14f00f33ba8232367bd422e3c5ffc24 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Wed, 5 Feb 2020 12:20:37 +0100 >Subject: [PATCH] Bug 24591: Add developer script to preview a letter > >The script is very simple, it just calls GetPreparedLetter with >arguments given on command line and print the resulting letter content > >Usage example: > >misc/devel/get-prepared-letter.pl --module circulation \ > --letter_code ODUE --tables '{"borrowers":1,"branches":"CPL"}' \ > --repeat '{"item":[{"biblio":1,"items":1}]}' \ > --loops '{"overdues":[1]}' >--- > misc/devel/get-prepared-letter.pl | 39 +++++++++++++++++++++++++++++++ > 1 file changed, 39 insertions(+) > create mode 100755 misc/devel/get-prepared-letter.pl > >diff --git a/misc/devel/get-prepared-letter.pl b/misc/devel/get-prepared-letter.pl >new file mode 100755 >index 0000000000..db92f3300f >--- /dev/null >+++ b/misc/devel/get-prepared-letter.pl >@@ -0,0 +1,39 @@ >+#!/usr/bin/perl >+ >+use Modern::Perl; >+ >+use Getopt::Long; >+use JSON; >+ >+use C4::Letters; >+ >+my ($module, $letter_code, $branchcode, $message_transport_type, $lang, $repeat, $tables, $loops); >+ >+GetOptions( >+ '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"; >+ >+$repeat = $repeat ? decode_json($repeat) : {}; >+$tables = $tables ? decode_json($tables) : {}; >+$loops = $loops ? decode_json($loops) : {}; >+ >+my $letter = C4::Letters::GetPreparedLetter( >+ module => $module, >+ letter_code => $letter_code, >+ branchcode => $branchcode, >+ message_transport_type => $message_transport_type, >+ lang => $lang, >+ repeat => $repeat, >+ tables => $tables, >+ loops => $loops, >+); >+ >+print "Subject: " . $letter->{title} . "\n\n"; >+print $letter->{content} . "\n"; >-- >2.20.1
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