[Bug 7515] New: authorized value code showing in opac for public note
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Bug #: 7515 Summary: authorized value code showing in opac for public note Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Platform: All OS/Version: All Status: NEW Severity: normal Priority: P5 - low Component: Templates AssignedTo: oleonard@myacpl.org ReportedBy: nengard@gmail.com QAContact: koha.sekjal@gmail.com See: http://screencast.com/t/PoGPO0PB If you have an authorized value for the public notes field on the item record it shows the description when editing items, but when you view the normal view in the opac and the staff client it shows the authorized value code and that means nothing to the public - it should show the description for authorized values. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 --- Comment #1 from Kyle M Hall <kyle.m.hall@gmail.com> 2012-02-14 18:12:09 UTC --- Created attachment 7641 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7641 Bug 7515 - authorized value code showing in opac for public note This alters C4::Items::GetItemsInfo() to look up the authorised value for the itemnotes value if the field has been assigned an authorised value rather than being a free text field. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff CC| |kyle.m.hall@gmail.com -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Nicole C. Engard <nengard@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7641|0 |1 is obsolete| | --- Comment #2 from Nicole C. Engard <nengard@gmail.com> 2012-02-14 19:11:34 UTC --- Created attachment 7643 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7643 Bug 7515 - authorized value code showing in opac for public note This alters C4::Items::GetItemsInfo() to look up the authorised value for the itemnotes value if the field has been assigned an authorised value rather than being a free text field. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Nicole C. Engard <nengard@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7643|0 |1 is obsolete| | --- Comment #3 from Nicole C. Engard <nengard@gmail.com> 2012-02-14 19:12:00 UTC --- Created attachment 7644 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7644 [SIGNED-OFF] Bug 7515 - authorized value code showing in opac for public note This alters C4::Items::GetItemsInfo() to look up the authorised value for the itemnotes value if the field has been assigned an authorised value rather than being a free text field. Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com> -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Nicole C. Engard <nengard@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Ian Walls <koha.sekjal@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #4 from Ian Walls <koha.sekjal@gmail.com> 2012-02-16 16:15:58 UTC --- This patch doesn't differentiate between the OPAC description (opaclib) and the staff client description (lib, which is used here). This means that the public will see the staffside description, which is counter to expectations. Marking as Failed QA. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 --- Comment #5 from Kyle M Hall <kyle.m.hall@gmail.com> 2012-02-16 17:53:39 UTC --- Created attachment 7702 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7702 Bug 7515 - authorized value code showing in opac for public note This alters C4::Items::GetItemsInfo() to look up the authorised value for the itemnotes value if the field has been assigned an authorised value rather than being a free text field. A new boolean parameter $opac has been added to let GetItemsInfo know if the data is destined for the opac or intranet view. Defaults to intranet view. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7644|0 |1 is obsolete| | -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #6 from Kyle M Hall <kyle.m.hall@gmail.com> 2012-02-16 17:54:59 UTC --- Updated the patch to take into account whether the data is to be used for the intranet or the opac. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #7 from Julian Maurice <julian.maurice@biblibre.com> 2012-02-23 10:03:19 UTC --- QA comment: In GetItemsInfo I think that all added code can be replaced by two already existing subs: my $sql_itemnotes = " SELECT authorised_value FROM marc_subfield_structure WHERE kohafield = 'items.itemnotes' AND frameworkcode = ? "; my $sth_itemnotes = $dbh->prepare( $sql_itemnotes ); $sth_itemnotes->execute( $data->{'frameworkcode'} ); my ($authorised_valuecode) = $sth_itemnotes->fetchrow; can be replaced by: my ($authorised_valuecode) = C4::Koha::GetAuthValCode('items.itemnotes', $data->{frameworkcode}); and my $lib = $opac ? 'lib_opac' : 'lib'; if ($authorised_valuecode) { $sth_itemnotes = $dbh->prepare( "SELECT $lib FROM authorised_values WHERE category=? AND authorised_value=?" ); $sth_itemnotes->execute( $authorised_valuecode, $data->{'itemnotes'} ); my ($lib) = $sth_itemnotes->fetchrow; $data->{'itemnotes'} = $lib; } can be replaced by: $data->{itemnotes} = C4::Koha::GetKohaAuthorisedValueLib($authorised_valuecode, $data->{itemnotes}, $opac); Does anybody agree? -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7702|0 |1 is obsolete| | --- Comment #8 from Kyle M Hall <kyle.m.hall@gmail.com> 2012-02-23 14:47:37 UTC --- Created attachment 7833 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7833 Bug 7515 - authorized value code showing in opac for public note This alters C4::Items::GetItemsInfo() to look up the authorised value for the itemnotes value if the field has been assigned an authorised value rather than being a free text field. A new boolean parameter $opac has been added to let GetItemsInfo know if the data is destined for the opac or intranet view. Defaults to intranet view. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 --- Comment #9 from Kyle M Hall <kyle.m.hall@gmail.com> 2012-02-23 14:48:45 UTC --- Updated patch to take into account the suggestions by Julian Maurice. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Nicole C. Engard <nengard@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7833|0 |1 is obsolete| | --- Comment #10 from Nicole C. Engard <nengard@gmail.com> 2012-02-26 21:05:15 UTC --- Created attachment 7893 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7893 [SIGNED-OFF] Bug 7515 - authorized value code showing in opac for public note This alters C4::Items::GetItemsInfo() to look up the authorised value for the itemnotes value if the field has been assigned an authorised value rather than being a free text field. A new boolean parameter $opac has been added to let GetItemsInfo know if the data is destined for the opac or intranet view. Defaults to intranet view. Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com> -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Nicole C. Engard <nengard@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |paul.poulain@biblibre.com --- Comment #11 from Paul Poulain <paul.poulain@biblibre.com> 2012-02-27 17:13:38 UTC --- QA comment: * my pre-apply hook complains: "my" variable $authorised_valuecode masks earlier declaration in same scope at /home/paul/koha.dev/koha-community//C4/Items.pm line 1264. Looking at the code, you're adding + my ($authorised_valuecode) = C4::Koha::GetAuthValCode('items.itemnotes', $data->{frameworkcode}); and $authorised_valuecode is declared a few line before. Removing the my is probably enough, please fix, test & resubmit. (the code is fine otherwise) -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7893|0 |1 is obsolete| | --- Comment #12 from Kyle M Hall <kyle.m.hall@gmail.com> 2012-02-28 14:52:05 UTC --- Created attachment 7918 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7918 Bug 7515 - authorized value code showing in opac for public note This alters C4::Items::GetItemsInfo() to look up the authorised value for the itemnotes value if the field has been assigned an authorised value rather than being a free text field. A new boolean parameter $opac has been added to let GetItemsInfo know if the data is destined for the opac or intranet view. Defaults to intranet view. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Nicole C. Engard <nengard@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7918|0 |1 is obsolete| | --- Comment #13 from Nicole C. Engard <nengard@gmail.com> 2012-02-28 15:08:43 UTC --- Created attachment 7924 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7924 [SIGNED-OFF] Bug 7515 - authorized value code showing in opac for public note This alters C4::Items::GetItemsInfo() to look up the authorised value for the itemnotes value if the field has been assigned an authorised value rather than being a free text field. A new boolean parameter $opac has been added to let GetItemsInfo know if the data is destined for the opac or intranet view. Defaults to intranet view. Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com> Tested in staff client and the OPAC and the note shows the description that is appropriate for that page (OPAC or staff client). -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Nicole C. Engard <nengard@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #14 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- QA Comment: Filling itemnotes in Items.pm: Shouldn't you test if GetAuthValCode returned something? If it is not an authorized value, you are overwriting it, isn't it? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 --- Comment #15 from Kyle M Hall <kyle.m.hall@gmail.com> --- Created attachment 8182 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=8182&action=edit Bug 7515 - Followup - Only set itemnotes to authorised value if said value exists. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Nicole C. Engard <nengard@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #16 from Nicole C. Engard <nengard@gmail.com> --- After applying the two patches (was I only supposed to do the followup?) above and doing a search I get : Software error: Global symbol "$itemnotes" requires explicit package name at /home/nengard/kohaclone/C4/Items.pm line 1267. Compilation failed in require at /home/nengard/kohaclone/C4/Reserves.pm line 29. BEGIN failed--compilation aborted at /home/nengard/kohaclone/C4/Reserves.pm line 29. Compilation failed in require at /home/nengard/kohaclone/C4/Circulation.pm line 26. BEGIN failed--compilation aborted at /home/nengard/kohaclone/C4/Circulation.pm line 26. Compilation failed in require at /home/nengard/kohaclone/C4/Overdues.pm line 26. BEGIN failed--compilation aborted at /home/nengard/kohaclone/C4/Overdues.pm line 26. Compilation failed in require at /home/nengard/kohaclone/C4/Members.pm line 30. BEGIN failed--compilation aborted at /home/nengard/kohaclone/C4/Members.pm line 30. Compilation failed in require at /home/nengard/kohaclone/C4/Search.pm line 28. BEGIN failed--compilation aborted at /home/nengard/kohaclone/C4/Search.pm line 28. Compilation failed in require at /home/nengard/kohaclone/catalogue/search.pl line 146. BEGIN failed--compilation aborted at /home/nengard/kohaclone/catalogue/search.pl line 146. For help, please send mail to the webmaster (webmaster@debian), giving this error message and the time and date of the error. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #8182|0 |1 is obsolete| | --- Comment #17 from Kyle M Hall <kyle.m.hall@gmail.com> --- Created attachment 8214 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=8214&action=edit Bug 7515 - Followup - Only set itemnotes to authorised value if said value exists. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 delaye <stephane.delaye@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |stephane.delaye@biblibre.co | |m --- Comment #18 from delaye <stephane.delaye@biblibre.com> --- i have crete une link between items.itemnotes(995$u : UNIMARc) and authorised_values I create an item In the opac the description of the authorised value display it's work! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |In Discussion Depends on| |7379, 7525 --- Comment #19 from Paul Poulain <paul.poulain@biblibre.com> --- This patch looks to be a duplicate of bug 7379 if i'm not mistaking. I think we should find a generic solution and not add specific code. So switching to in discussion and also linking to bug 7525 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com --- Comment #20 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to comment #19)
This patch looks to be a duplicate of bug 7379 if i'm not mistaking. I think we should find a generic solution and not add specific code.
So switching to in discussion and also linking to bug 7525
This is not a duplicate of bug 7379, but it is a similar situation. That one was pushed, so I don't see a reason why we shouldn't push this one too. Could we solve this at the template level using Koha::Template::Plugin::KohaAuthorisedValues? I think that would be an elegant solution, but we may need to add a more subroutine to it for various situations. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 --- Comment #21 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to comment #19)
This patch looks to be a duplicate of bug 7379 if i'm not mistaking. I think we should find a generic solution and not add specific code.
So switching to in discussion and also linking to bug 7525
Paul, can you give me some more input on this? I think there are a few solutions: 1) Solve at the .pl level: i.e. patch as we go along in the perl code ( i.e. this bug's patches ) 2) Solve at the .tt level: i.e. use Koha::Template::Plugin::KohaAuthorisedValues and patch as we go along at the template level. We can patch this sub to check for an authorised value mapping and return either the correct mapping or the original passed in data. The will greatly simplify the amount of code necessary to support the use of authorised values mapping. 3) Solve at the .pm level: i.e. all subs that send back data from biblio, biblioitems or items will first pass that data through a new sub ReplaceWithAuthorisedValues that will check each field to see if it is mapped to an authorised value list and replace the code with the data if necessary. I personally think choice 2 is will be the quickest, lightest weight solution. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gmcharlt@gmail.com --- Comment #22 from Galen Charlton <gmcharlt@gmail.com> --- (In reply to Kyle M Hall from comment #21)
2) Solve at the .tt level: i.e. use Koha::Template::Plugin::KohaAuthorisedValues and patch as we go along at the template level. We can patch this sub to check for an authorised value mapping and return either the correct mapping or the original passed in data. The will greatly simplify the amount of code necessary to support the use of authorised values mapping.
I prefer this option. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7924|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #8214|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7515 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW QA Contact|koha.sekjal@gmail.com |testopia@bugs.koha-communit | |y.org -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org