Bug 24591 - Add developer script to preview a letter
Summary: Add developer script to preview a letter
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Julian Maurice
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-05 11:27 UTC by Julian Maurice
Modified: 2022-06-06 20:24 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.03


Attachments
Bug 24591: Add developer script to preview a letter (1.97 KB, patch)
2020-02-05 11:27 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 24591: Add developer script to preview a letter (2.63 KB, patch)
2020-03-22 18:21 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 24591: Add developer script to preview a letter (2.83 KB, patch)
2020-03-22 18:55 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 24591: Add --help option to misc/devel/get-prepared-letter.pl (3.67 KB, patch)
2020-04-10 09:24 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 24591: Add developer script to preview a letter (2.89 KB, patch)
2020-08-07 00:50 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24591: Add --help option to misc/devel/get-prepared-letter.pl (3.74 KB, patch)
2020-08-07 00:50 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 24591: Add developer script to preview a letter (3.20 KB, patch)
2020-08-07 08:23 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24591: Add --help option to misc/devel/get-prepared-letter.pl (2.65 KB, patch)
2020-08-07 08:23 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Maurice 2020-02-05 11:27:06 UTC
I just a wrote a tiny script to help me preview a letter content. I'm not sure if it should go in Koha sources but I don't know where to put it and I think it may help other people
Comment 1 Julian Maurice 2020-02-05 11:27:44 UTC
Created attachment 98448 [details] [review]
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]}'
Comment 2 Bernardo Gonzalez Kriegel 2020-03-22 17:54:12 UTC
Hi, could you add a copyright message?
Comment 3 Julian Maurice 2020-03-22 18:21:20 UTC
Created attachment 101389 [details] [review]
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]}'
Comment 4 Julian Maurice 2020-03-22 18:21:44 UTC
(In reply to Bernardo Gonzalez Kriegel from comment #2)
> Hi, could you add a copyright message?

Done ;)
Comment 5 Bernardo Gonzalez Kriegel 2020-03-22 18:55:32 UTC
Created attachment 101390 [details] [review]
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]}'

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works for the example and other cases.
Correct option is 'letter-code', with dash, not underscore.
An usage message would be nice.
No errors
Comment 6 Jonathan Druart 2020-03-24 09:51:03 UTC
Julian, please add usage (Pod::Usage) and perltidy the script.
Comment 7 Julian Maurice 2020-04-10 09:24:09 UTC
Created attachment 102685 [details] [review]
Bug 24591: Add --help option to misc/devel/get-prepared-letter.pl

Also fix code style with perltidy
Comment 8 Nick Clemens 2020-08-07 00:50:35 UTC
Created attachment 107935 [details] [review]
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]}'

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works for the example and other cases.
Correct option is 'letter-code', with dash, not underscore.
An usage message would be nice.
No errors

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 9 Nick Clemens 2020-08-07 00:50:38 UTC
Created attachment 107936 [details] [review]
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>
Comment 10 Jonathan Druart 2020-08-07 08:23:27 UTC
Created attachment 107942 [details] [review]
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]}'

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works for the example and other cases.
Correct option is 'letter-code', with dash, not underscore.
An usage message would be nice.
No errors

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

JD amended patch: tidy the new file and rename it matching the other
scripts' names in this directory
Comment 11 Jonathan Druart 2020-08-07 08:23:41 UTC
Created attachment 107943 [details] [review]
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>
Comment 12 Jonathan Druart 2020-08-07 14:55:48 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 13 Lucas Gass 2020-08-14 22:49:37 UTC
small and very. useful enhancement, choosing to backport

backported to 20.05.x for 20.05.03
Comment 14 Aleisha Amohia 2020-08-16 23:32:11 UTC
enhancement, not backported to 19.11.x