Bug 10206 - Add Koha TT Plugin
Summary: Add Koha TT Plugin
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Kyle M Hall
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks: 7441 10200
  Show dependency treegraph
 
Reported: 2013-05-06 18:28 UTC by Kyle M Hall
Modified: 2014-12-07 20:02 UTC (History)
3 users (show)

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


Attachments
Bug 10206 - Add Koha TT Plugin - Koha.Preference (2.63 KB, patch)
2013-05-06 18:29 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10206 - Add Koha TT Plugin - Koha.Preference (2.59 KB, patch)
2013-05-23 17:32 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10206 - Add Koha TT Plugin - Koha.Preference (2.69 KB, patch)
2013-05-23 17:43 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2013-05-06 18:28:17 UTC
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.
Comment 1 Kyle M Hall (khall) 2013-05-06 18:29:56 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2013-05-17 14:34:20 UTC
QA: Looking at this one now..
Comment 3 Marcel de Rooy 2013-05-17 14:37:42 UTC
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 :)
Comment 4 Marcel de Rooy 2013-05-17 14:59:31 UTC
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.
Comment 5 Marcel de Rooy 2013-05-20 15:08:05 UTC
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..
Comment 6 Kyle M Hall (khall) 2013-05-23 17:32:43 UTC Comment hidden (obsolete)
Comment 7 Kyle M Hall 2013-05-23 17:33:46 UTC
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..
Comment 8 Marcel de Rooy 2013-05-23 17:43:17 UTC
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>
Comment 9 Marcel de Rooy 2013-05-23 17:51:04 UTC
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.
Comment 10 Marcel de Rooy 2013-05-23 17:54:09 UTC
With reference to former comments, adjustments make this patch pass QA.
Nice feature, tested with future work for report 9032.

Passed QA
Comment 11 Galen Charlton 2013-05-24 14:52:41 UTC
Pushed to master.  Please note that I adjusted the commit message to include the example usage found in the POD.

Thanks, Kyle!
Comment 12 Tomás Cohen Arazi (tcohen) 2013-08-16 13:22:48 UTC
This patch has been pushed to 3.12.x, will be in 3.12.4.

Thanks Kyle!