[Bug 36815] New: Add the option to 'Reset to default' in the notices editor
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Bug ID: 36815 Summary: Add the option to 'Reset to default' in the notices editor Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Notices Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org Blocks: 15278 It would be nice to have the option to reset to the default notice text from the UI. This would allow for a reset to catch changes at upgrades or a reset for when you've installed a translation after the fact. I imagine a preview before reset might be helpful too? Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15278 [Bug 15278] [Omnibus] Port default slips and notices from bespoke syntax to Template Toolkit -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166429 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166429&action=edit Bug 36815: Add 'get_default' method to Koha::Notice::Template This patch adds a new 'get_default' method to the Koha::Notice::Template object. The idea is that it returns the template content as defined by the sample_notices.yml file for the language of your choosing. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166430 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166430&action=edit Bug 36815: WIP - Expose to the UI This patch begins to expose the sample notices to the UI in the notices editor. It doesn't look pretty yet, we need to treat the output as code as aposed to rendering it as html.. and we want to add the 'copy to content' functoinality to allow resetting from it. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@ptfs-europe |ity.org |.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- If anyone wants to continue here I'd be more than happy to share the work. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |oleonard@myacpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |P1 - high -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emily.lamancusa@montgomeryc | |ountymd.gov -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- To test this, just apply the patches and then navigate to any notice template from the tools and look for a new 'View default' button that appears when editing a template if a sample exists for that code + language + message_transport_type combination. The button will display a modal containing the sample template content.. it is very rough around the edges right now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166429|0 |1 is obsolete| | --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166449 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166449&action=edit Bug 36815: Add 'get_default' method to Koha::Notice::Template This patch adds a new 'get_default' method to the Koha::Notice::Template object. The idea is that it returns the template content as defined by the sample_notices.yml file for the language of your choosing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166450 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166450&action=edit Bug 36815: Expose to the UI This patch adds a modal to preview the sample notices in the UI and allow replacing the template content with that content of that modal. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166430|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- This is all working pretty well for a first draft now so I'm setting to NSO. We'll need a unit test for the new method introduced to Koha::Notice::Template.. but honestly, I'm not entirely sure yet how to achieve that. Anyway.. I'd love some feedback and testing. Test plan: 1) Apply patches and restart plack (Or just use a sandbox) 2) Login to the staff client and navigate to 'Tools > Notices and Slips' 3) 'Edit' a notice. 4) Note the new 'View default' button on some notices where we ship a default in the 'sample_notices' file. 5) Click the button to view the sample notice 6) Confirm 'Close' just closes the modal 7) Confirm 'Copy' copies the sample notice into the editor field -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- For bonus points.. confirm that translated sample notices also work ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Alexandre <alexandre.noel@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |alexandre.noel@inlibro.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166449|0 |1 is obsolete| | --- Comment #9 from Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> --- Created attachment 166475 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166475&action=edit Bug 36815: Add 'get_default' method to Koha::Notice::Template This patch adds a new 'get_default' method to the Koha::Notice::Template object. The idea is that it returns the template content as defined by the sample_notices.yml file for the language of your choosing. Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166450|0 |1 is obsolete| | --- Comment #10 from Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> --- Created attachment 166476 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166476&action=edit Bug 36815: Expose to the UI This patch adds a modal to preview the sample notices in the UI and allow replacing the template content with that content of that modal. Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off --- Comment #11 from Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> --- That looks really nice! Everything seems to be working as intended without translations. I tested a few different notices, and it correctly displayed/copied the default notice text for email, SMS, and print notices if a corresponding default was defined. It didn't seem to work for translated notices, though I'm not 100% sure I set that up correctly. Here's what I did: 1. Install Spanish by running koha-translate --install es-ES from inside the kohashell 2. restart all 3. Enable Spanish and set it to the default language in both the staff interface and OPAC 4. Set TranslateNotices to Allow 5. Verify that the Spanish-language sample_notices.yml exists 6. Open a notice that has at least one Spanish default notice defined The Default language tab for the notice says "Default language: Español", but the "View default" button shows the English notice text. The Español (es-ES) and English (en) tabs don't show the "View default" button at all. On the other hand, the text editors for those tabs are also completely blank, so it's entirely possible that I missed a step for importing the translated notices at all. I also tried a full reset of KTD and then repeated steps 3-6 to see if that would automagically import the default Spanish notices, but the results were the same. Signing off since the main test plan worked and I'm not sure I did the "bonus" part right anyway. Feel free to set back if needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks for the testing Emily. You've highlighted a fun little challenge with the translated notices which I'm working on now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |m.de.rooy@rijksmuseum.nl --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- WARN tools/letter.pl WARN tidiness The file is less tidy than before (bad/messy lines before: 125, now: 127) Module changes require tests. Could you please add a test? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166535 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166535&action=edit Bug 36815: (follow-up) Fix logic for new languages If a notice doesn't already have any data in it we weren't able to use the object to lookup the sample.. with this patch we now always load the samples if they exist for each installed and enabled language, regardless of whether there's already a notice stored in that language. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Follow-up should work but doesn't.. I'll revisit this with a fresher brain some time. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- # Fetch sample notices use Data::Printer; for my $lang_key ( keys %letters ) { for my $mtt_key ( keys %{ $letters{$lang_key}{templates} } ) { my $object = Koha::Notice::Template->new( { module => $module, code => $code, message_transport_type => $mtt_key, lang => $lang_key } ); $letters{$lang_key}{templates}{$mtt_key}{sample} = $object->get_default; $letters{$lang_key}{templates}{$mtt_key}{id} = lc( "$module" . "_" . $code . "_" . $mtt_key . "_" . $lang_key ); p $letters{$lang_key}{templates}{$mtt_key}, as => $lang_key . ":" . $mtt_key; } } # while ( my ( $lang_key, $lang_value ) = each %letters ) { # p $lang_value, as => $lang_key; # while ( my ( $mtt_key, $mtt_value ) = each %{ $lang_value->{templates} } ) { # my $object = Koha::Notice::Template->new( # { module => $module, code => $code, message_transport_type => $mtt_key, lang => $lang_key } ); # $mtt_value->{sample} = $object->get_default; # $mtt_value->{id} = lc( "$module" . "_" . $code . "_" . $mtt_key . "_" . $lang_key ); # } # warn "\n\n"; # } -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Alexandre <alexandre.noel@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|alexandre.noel@inlibro.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166475|0 |1 is obsolete| | --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166678 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166678&action=edit Bug 36815: Add 'get_default' method to Koha::Notice::Template This patch adds a new 'get_default' method to the Koha::Notice::Template object. The idea is that it returns the template content as defined by the sample_notices.yml file for the language of your choosing. Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166476|0 |1 is obsolete| | --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166679 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166679&action=edit Bug 36815: Expose to the UI This patch adds a modal to preview the sample notices in the UI and allow replacing the template content with that content of that modal. Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166535|0 |1 is obsolete| | --- Comment #19 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166680 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166680&action=edit Bug 36815: (follow-up) Fix logic for new languages If a notice doesn't already have any data in it we weren't able to use the object to lookup the sample.. with this patch we now always load the samples if they exist for each installed and enabled language, regardless of whether there's already a notice stored in that language. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #20 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I finally got to the bottom of my referencing/de-referencing challenge! This should be ready to go now.. I'm sure we can further improve it down the line but as a first go I think it's a great little enhancement. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166678|0 |1 is obsolete| | --- Comment #21 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166684 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166684&action=edit Bug 36815: Add 'get_default' method to Koha::Notice::Template This patch adds a new 'get_default' method to the Koha::Notice::Template object. The idea is that it returns the template content as defined by the sample_notices.yml file for the language of your choosing. Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166679|0 |1 is obsolete| | --- Comment #22 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166685 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166685&action=edit Bug 36815: Expose to the UI This patch adds a modal to preview the sample notices in the UI and allow replacing the template content with that content of that modal. Test plan 1) Apply patches and restart plack (Or just use a sandbox) 2) Login to the staff client and navigate to 'Tools > Notices and Slips' 3) 'Edit' a notice. 4) Note the new 'View default' button on some notices where we ship a default in the 'sample_notices' file. 5) Click the button to view the sample notice 6) Confirm 'Close' just closes the modal 7) Confirm 'Copy' copies the sample notice into the editor field Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166680|0 |1 is obsolete| | --- Comment #23 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166686 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166686&action=edit Bug 36815: (follow-up) Fix logic for new languages If a notice doesn't already have any data in it we weren't able to use the object to lookup the sample.. with this patch we now always load the samples if they exist for each installed and enabled language, regardless of whether there's already a notice stored in that language. Test plan 1. Install Spanish by running koha-translate --install es-ES from inside the kohashell 2. restart all 3. Set TranslateNotices to Allow 4. Verify that the Spanish-language sample_notices.yml exists 5. Open a notice that has at least one Spanish default notice defined 6. Confirm you see the 'View default' button for the spanish notice and that the displayed notice is indeed the spanish translation -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #24 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166689 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166689&action=edit Bug 36815: Unit tests Add a pretty sparse integration test that relies on the default shipped sample_notices.yaml. This should catch if the format of that file changes, but it doesn't test any more than that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #25 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Hmm.. and now I'm struggling to get the unit test to pass.. this is the bug that just keeps giving. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #26 from Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> --- (In reply to Martin Renvoize from comment #25)
Hmm.. and now I'm struggling to get the unit test to pass.. this is the bug that just keeps giving.
Shooting in the dark a bit here...but could it be a newline character mismatch?
$content = join "\r\n", @{ $template->{content} };
versus the multiline string in the test file, which might just be encoding the line breaks as '\n'? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166684|0 |1 is obsolete| | --- Comment #27 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166693 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166693&action=edit Bug 36815: Add 'get_default' method to Koha::Notice::Template This patch adds a new 'get_default' method to the Koha::Notice::Template object. The idea is that it returns the template content as defined by the sample_notices.yml file for the language of your choosing. Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166689|0 |1 is obsolete| | --- Comment #28 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166694 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166694&action=edit Bug 36815: Unit tests Add a pretty sparse integration test that relies on the default shipped sample_notices.yaml. This should catch if the format of that file changes, but it doesn't test any more than that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166685|0 |1 is obsolete| | --- Comment #29 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166695 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166695&action=edit Bug 36815: Expose to the UI This patch adds a modal to preview the sample notices in the UI and allow replacing the template content with that content of that modal. Test plan 1) Apply patches and restart plack (Or just use a sandbox) 2) Login to the staff client and navigate to 'Tools > Notices and Slips' 3) 'Edit' a notice. 4) Note the new 'View default' button on some notices where we ship a default in the 'sample_notices' file. 5) Click the button to view the sample notice 6) Confirm 'Close' just closes the modal 7) Confirm 'Copy' copies the sample notice into the editor field Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166686|0 |1 is obsolete| | --- Comment #30 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166696 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166696&action=edit Bug 36815: (follow-up) Fix logic for new languages If a notice doesn't already have any data in it we weren't able to use the object to lookup the sample.. with this patch we now always load the samples if they exist for each installed and enabled language, regardless of whether there's already a notice stored in that language. Test plan 1. Install Spanish by running koha-translate --install es-ES from inside the kohashell 2. restart all 3. Set TranslateNotices to Allow 4. Verify that the Spanish-language sample_notices.yml exists 5. Open a notice that has at least one Spanish default notice defined 6. Confirm you see the 'View default' button for the spanish notice and that the displayed notice is indeed the spanish translation -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #31 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- (In reply to Emily Lamancusa from comment #26)
(In reply to Martin Renvoize from comment #25)
Hmm.. and now I'm struggling to get the unit test to pass.. this is the bug that just keeps giving.
Shooting in the dark a bit here...but could it be a newline character mismatch?
$content = join "\r\n", @{ $template->{content} };
versus the multiline string in the test file, which might just be encoding the line breaks as '\n'?
Of course, you were correct there.. clearly it's been a long day ;P -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #32 from David Cook <dcook@prosentient.com.au> --- This sounds like an awesome idea -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166693|0 |1 is obsolete| | Attachment #166694|0 |1 is obsolete| | Attachment #166695|0 |1 is obsolete| | Attachment #166696|0 |1 is obsolete| | --- Comment #33 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 166763 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166763&action=edit Bug 36815: Add 'get_default' method to Koha::Notice::Template This patch adds a new 'get_default' method to the Koha::Notice::Template object. The idea is that it returns the template content as defined by the sample_notices.yml file for the language of your choosing. Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #34 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 166764 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166764&action=edit Bug 36815: Unit tests Add a pretty sparse integration test that relies on the default shipped sample_notices.yaml. This should catch if the format of that file changes, but it doesn't test any more than that. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #35 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 166765 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166765&action=edit Bug 36815: Expose to the UI This patch adds a modal to preview the sample notices in the UI and allow replacing the template content with that content of that modal. Test plan 1) Apply patches and restart plack (Or just use a sandbox) 2) Login to the staff client and navigate to 'Tools > Notices and Slips' 3) 'Edit' a notice. 4) Note the new 'View default' button on some notices where we ship a default in the 'sample_notices' file. 5) Click the button to view the sample notice 6) Confirm 'Close' just closes the modal 7) Confirm 'Copy' copies the sample notice into the editor field Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #36 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 166766 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166766&action=edit Bug 36815: (follow-up) Fix logic for new languages If a notice doesn't already have any data in it we weren't able to use the object to lookup the sample.. with this patch we now always load the samples if they exist for each installed and enabled language, regardless of whether there's already a notice stored in that language. Test plan 1. Install Spanish by running koha-translate --install es-ES from inside the kohashell 2. restart all 3. Set TranslateNotices to Allow 4. Verify that the Spanish-language sample_notices.yml exists 5. Open a notice that has at least one Spanish default notice defined 6. Confirm you see the 'View default' button for the spanish notice and that the displayed notice is indeed the spanish translation Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |15279 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15279 [Bug 15279] Deprecate bespoke syntax for Slips and Notices -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Katie Bliss <kebliss@dmpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kebliss@dmpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #37 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- While I love the idea and the feature, I think we are keeping this for 24.11 or an early backport. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #38 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Started a bit slow today with easy pushes - next on my list for the next session. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #39 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Not all libraries use TranslateNotices, actually most of ours don't and notices are only added in one language. With this patch set, if I am not mistaken and you are not using TranslateNotices, you can only pull the English sample templates. I did: - sudo koha-translate --install de-DE --dev kohadev - restart_all - Activated de-DE in language and OpacLanguages and moved it to be the first entry. - Switched staff interface language to German. - The notice editor shows German as standard language on top of the editor. - Sample notice pulled is English. - Verified that a German version was available in installer/data/mysql/de-DE/mandatory/sample_notices.yml Could we adapt the script to pull the German sample notice in that case? (if TranslateNotices is off, try the standard language first and then fall back to English?) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |33237 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33237 [Bug 33237] If TranslateNotices is off, use the default language includes in slips -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166763|0 |1 is obsolete| | --- Comment #40 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168190 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168190&action=edit Bug 36815: Add 'get_default' method to Koha::Notice::Template This patch adds a new 'get_default' method to the Koha::Notice::Template object. The idea is that it returns the template content as defined by the sample_notices.yml file for the language of your choosing. Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166764|0 |1 is obsolete| | --- Comment #41 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168191 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168191&action=edit Bug 36815: Unit tests Add a pretty sparse integration test that relies on the default shipped sample_notices.yaml. This should catch if the format of that file changes, but it doesn't test any more than that. Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166765|0 |1 is obsolete| | --- Comment #42 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168192 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168192&action=edit Bug 36815: Expose to the UI This patch adds a modal to preview the sample notices in the UI and allow replacing the template content with that content of that modal. Test plan 1) Apply patches and restart plack (Or just use a sandbox) 2) Login to the staff client and navigate to 'Tools > Notices and Slips' 3) 'Edit' a notice. 4) Note the new 'View default' button on some notices where we ship a default in the 'sample_notices' file. 5) Click the button to view the sample notice 6) Confirm 'Close' just closes the modal 7) Confirm 'Copy' copies the sample notice into the editor field Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166766|0 |1 is obsolete| | --- Comment #43 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168193 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168193&action=edit Bug 36815: (follow-up) Fix logic for new languages If a notice doesn't already have any data in it we weren't able to use the object to lookup the sample.. with this patch we now always load the samples if they exist for each installed and enabled language, regardless of whether there's already a notice stored in that language. Test plan 1. Install Spanish by running koha-translate --install es-ES from inside the kohashell 2. restart all 3. Set TranslateNotices to Allow 4. Verify that the Spanish-language sample_notices.yml exists 5. Open a notice that has at least one Spanish default notice defined 6. Confirm you see the 'View default' button for the spanish notice and that the displayed notice is indeed the spanish translation Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #44 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168194 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168194&action=edit Bug 36815: (follow-up) Use correct language for default When 'default' language is set, we need to use the default as defined by the OPACLanguages system preference. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 --- Comment #45 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement adds a new release notes| |'View default' button to | |the notices editor for | |notices that ship in the | |sample data for Koha. | | | |This | |button allows you to | |display the default sample | |notice in a popup modal and | |even reset the notice your | |currently editing to that | |default. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting --- Comment #46 from Lucas Gass <lucas@bywatersolutions.com> --- Enhancement will not be backported to the 24.05.x series -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This enhancement adds a new |This enhancement adds a new release notes|'View default' button to |'View default' button to |the notices editor for |the notices editor for |notices that ship in the |notices that ship in the |sample data for Koha. |sample data for Koha. | | |This |This |button allows you to |button allows you to |display the default sample |display the default sample |notice in a popup modal and |notice in a popup modal and |even reset the notice your |even reset the notice your |currently editing to that |currently editing to that |default. |default. | | | |**Sponsored by** | |*PTFS Europe* -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED Documentation| |https://gitlab.com/koha-com submission| |munity/koha-manual/-/merge_ | |requests/1019 Documentation| |Caroline Cyr La Rose contact| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36815 Bug 36815 depends on bug 33237, which changed state. Bug 33237 Summary: If TranslateNotices is off, use the default language includes in slips https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33237 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org