This plugin is meant to be a place to put general purpose TT functions directly related to Koha. If a plugin is not a filter, and does not have more than one subroutine, that subroutine most likely belongs in this TT plugin. This first and only function the plugin currently has is Preference, which allows a template to get the value of a system preference without, it needing to be passed in from a perl script. This plugin was already tested and signed off as part of bug 7441.
Created attachment 17969 [details] [review] Bug 10206 - Add Koha TT Plugin - Koha.Preference This plugin is meant to be a place to put general purpose TT functions directly related to Koha. If a plugin is not a filter, and does not have more than one subroutine, that subroutine most likely belongs in this TT plugin. This first and only function the plugin currently has is Preference, which allows a template to get the value of a system preference without, it needing to be passed in from a perl script. This plugin was already tested and signed off as part of bug 7441. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
QA: Looking at this one now..
Kyle, This works fine. Two questions remain: 1) To have this work, you currently do not need to do a use C4::Koha. Without that line, it works too. Why did you add it? 2) If it can be removed, please repair the typo: replated-> related :)
Well, just to harass you a little bit more :) Why do you add use Template::Plugin btw? The use base seems to be enough? And could we find a better and still generic name for Koha.pm? I do not directly have the solution.. But just thinking about KohaInterface, Functions, GeneralPurpose, .., .. But we could start with Koha. Just trying to avoid it.
Changing status to reflect need for clarification. Why C4::Koha? Are there specific functions in that module you recommend to use? If so, maybe add this in the pod lines? Typo replated. Use Template::Plugin not needed? Use base seems enough. Leaving the name as-is..
Created attachment 18356 [details] [review] Bug 10206 - Add Koha TT Plugin - Koha.Preference This plugin is meant to be a place to put general purpose TT functions directly related to Koha. If a plugin is not a filter, and does not have more than one subroutine, that subroutine most likely belongs in this TT plugin. This first and only function the plugin currently has is Preference, which allows a template to get the value of a system preference without, it needing to be passed in from a perl script. This plugin was already tested and signed off as part of bug 7441. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
My bad ; ) I've removed all the unnecessary code from this new patch. Kyle (In reply to comment #5) > Changing status to reflect need for clarification. > Why C4::Koha? Are there specific functions in that module you recommend to > use? If so, maybe add this in the pod lines? > Typo replated. > Use Template::Plugin not needed? Use base seems enough. > Leaving the name as-is..
Created attachment 18357 [details] [review] Bug 10206 - Add Koha TT Plugin - Koha.Preference This plugin is meant to be a place to put general purpose TT functions directly related to Koha. If a plugin is not a filter, and does not have more than one subroutine, that subroutine most likely belongs in this TT plugin. This first and only function the plugin currently has is Preference, which allows a template to get the value of a system preference without, it needing to be passed in from a perl script. This plugin was already tested and signed off as part of bug 7441. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
False warning of qa-tools: critic FAIL Code before strictures are enabled at line 42, column 1. See page 429 of PBP. This is not true, since the code contains a use Modern::Perl.
With reference to former comments, adjustments make this patch pass QA. Nice feature, tested with future work for report 9032. Passed QA
Pushed to master. Please note that I adjusted the commit message to include the example usage found in the POD. Thanks, Kyle!
This patch has been pushed to 3.12.x, will be in 3.12.4. Thanks Kyle!