[Bug 9426] New: Add itemtype description template plugin
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9426 Bug ID: 9426 Summary: Add itemtype description template plugin Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: fridolyn.somers@biblibre.com Like branch name template plugin KohaBranchName, add a plugin that converts itemtype code into its description. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9426 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |fridolyn.somers@biblibre.co | |m --- Comment #1 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- Created attachment 14702 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14702&action=edit Proposed patch See commit message -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9426 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9426 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff --- Comment #2 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- I added in this patch a new method to instantiate a C4::ItemType object from its code, in order to improve the use of object-oriented programing in Koha. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9426 --- Comment #3 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- It will be useful to improve bug 9423. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9426 --- Comment #4 from Owen Leonard <oleonard@myacpl.org> --- I get an error unless I change "[% USE KohaAuthorisedValues %]" (in the test plan) to "[% USE KohaItemType %]" Is that what it should be? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9426 --- Comment #5 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- (In reply to comment #4)
I get an error unless I change "[% USE KohaAuthorisedValues %]" (in the test plan) to "[% USE KohaItemType %]"
Is that what it should be?
Sorry, error in my test plan : - Add as first line : [% USE KohaAuthorisedValues %] It is : - Add as first line : [% USE KohaItemType %] Thanks for testing -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9426 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #14702|0 |1 is obsolete| | --- Comment #6 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- Created attachment 14922 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14922&action=edit Proposed patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9426 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #14922|0 |1 is obsolete| | --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 15188 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=15188&action=edit Bug 9426: Add itemtype description template plugin Like branch name template plugin KohaBranchName, add a plugin that converts itemtype code into its description. This patch adds this template plugin and a method tho instanciate a C4::ItemType object using its code. Test plan : - Choose an existing itemtype code (ie DVD) - Edit any template (ie intranet-main.tt) - Add as first line : [% USE KohaItemType %] - Add in body : itemtype=[% 'DVD' | $KohaItemType %] - Go to this page => Itemtype description is displayed next to 'itemtype=' Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9426 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9426 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |jonathan.druart@biblibre.co | |m QA Contact| |jonathan.druart@biblibre.co | |m --- Comment #8 from Jonathan Druart <jonathan.druart@biblibre.com> --- QA comment: Works as described. I am not sure about the behavior if the code doesn't exist in the DB, maybe we should return the code instead of an empty string. Marked as Passed. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9426 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #15188|0 |1 is obsolete| | --- Comment #9 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 16165 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=16165&action=edit Bug 9426: Add itemtype description template plugin Like branch name template plugin KohaBranchName, add a plugin that converts itemtype code into its description. This patch adds this template plugin and a method tho instanciate a C4::ItemType object using its code. Test plan : - Choose an existing itemtype code (ie DVD) - Edit any template (ie intranet-main.tt) - Add as first line : [% USE KohaItemType %] - Add in body : itemtype=[% 'DVD' | $KohaItemType %] - Go to this page => Itemtype description is displayed next to 'itemtype=' Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9426 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #10 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This patch looks good, except it doesn't add unit tests for the new code in C4/ and Koha/. What about something like this in t/ItemType.t (obviously a resultset will have to be added to the mocked dbh before this test): my $itype = C4::ItemType->new_from_code('BK'); is(ref $itype, 'C4::ItemType', 'new_from_code creates correct type of object'); is($itype->description, 'Books', 'new_from_code retrieved correct itemtype'); And, of course, there also need to be tests for Koha::Template::Plugin::ItemType. If you look at t/db_dependent/Koha_template_plugin_KohaDates.t you'll see an example of a unit test for a TT filter (and bonus points if you test by way of C4::Template as well). A follow-up adding the unit tests need not go through the entire sign off/QA process again. If the coverage is good (and the tests pass), I will review it myself and push it, so you can set this bug back to "Passed QA" after your follow-up is attached. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9426 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |RESOLVED Resolution|--- |DUPLICATE --- Comment #11 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- Same plugin was added by Bug 8215. Cool. *** This bug has been marked as a duplicate of bug 8215 *** -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org