Summary: | Add collection column to built in 'Items lost' report | ||
---|---|---|---|
Product: | Koha | Reporter: | Nicole C. Engard <nengard> |
Component: | Reports | Assignee: | Owen Leonard <oleonard> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | jonathan.druart, martin.renvoize, nick, severine.queune |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 22468 | ||
Attachments: |
Bug 8775: Add collection code to lost report
Bug 8775: Add collection code to lost report Bug 8775: Add collection code to lost report Bug 8775: (follow-up) Change column header to "Collection" Bug 8775: Add collection code to lost report Bug 8775: (follow-up) Change column header to "Collection" Bug 8775: Use the AV mapped with items.ccode instead of CCODE |
Description
Nicole C. Engard
2012-09-17 12:24:06 UTC
Still valid. Created attachment 85526 [details] [review] Bug 8775: Add collection code to lost report This patch adds a column for collection code to the lost items report. To test, apply the patch and run the lost items report. You should see a collection code column. Hi Owen, On /cgi-bin/koha/admin/columns_settings.pl page, 'collection code' is not present in 'id=lostitems-table', is it normal ? Except that point , behaviour is correct on items lost report, and the column can be hibben using the "Comulns" button on the /cgi-bin/koha/reports/itemslost.pl page. Created attachment 85910 [details] [review] Bug 8775: Add collection code to lost report This patch adds a column for collection code to the lost items report. To test, apply the patch and run the lost items report. You should see a collection code column. Test column configuration for this table: Go to Administration -> Configure columns. Confirm that the "collection_code" column can be configured and that configuration choices are applied correctly. Created attachment 85912 [details] [review] Bug 8775: Add collection code to lost report This patch adds a column for collection code to the lost items report. To test, apply the patch and run the lost items report. You should see a collection code column. Test column configuration for this table: Go to Administration -> Configure columns. Confirm that the "collection_code" column can be configured and that configuration choices are applied correctly. Signed-off-by: Bin Wen <bin.wen@inlibro.com> Hi Bin, please make sure to change the status to "Signed Off" when signing off. The sequence of columns appears a little strange: - Library (homelibrary) - Item type - Collection code - Current location (holdinglibrary) - Location Out of scope here, but can we change "Collection code" to be "Collection"? We are not showing the code, but the description :) Created attachment 86190 [details] [review] Bug 8775: (follow-up) Change column header to "Collection" This patch changes the table heading for ccode to be "Collection" instead of "Collection code." Current templates vary, but "Collection" is more logical because we show the description, not the code. We should use the more flexible way to retrieve an AV's value: AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) That way, if items.ccode is not bind to an AV, or bind to a different one than CCODE, it will display the correct value. I know it's not how we did in all of the places they are displayed, but it should be the correct way to do :) (In reply to Jonathan Druart from comment #9) > We should use the more flexible way to retrieve an AV's value: > > AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', > authorised_value => item.ccode ) > > That way, if items.ccode is not bind to an AV, or bind to a different one > than CCODE, it will display the correct value. I know it's not how we did in > all of the places they are displayed, but it should be the correct way to do > :) What happens if it's not mapped? I know the normal plugin outputs the content of the field. If you mapped another category, you are breaking a lot of things. I am not sure if we should start officially supporting this. (In reply to Katrin Fischer from comment #10) > (In reply to Jonathan Druart from comment #9) > > We should use the more flexible way to retrieve an AV's value: > > > > AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', > > authorised_value => item.ccode ) > > > > That way, if items.ccode is not bind to an AV, or bind to a different one > > than CCODE, it will display the correct value. I know it's not how we did in > > all of the places they are displayed, but it should be the correct way to do > > :) > > What happens if it's not mapped? I know the normal plugin outputs the > content of the field. It should output the value, yes. > If you mapped another category, you are breaking a lot of things. I am not > sure if we should start officially supporting this. Not supporting, but keeping it in mind for new additions. (In reply to Jonathan Druart from comment #9) > We should use the more flexible way to retrieve an AV's value: > > AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', > authorised_value => item.ccode ) Is this really a blocker for this bug? There are many existing instances of using AuthorisedValues.GetByCode for ccode. If this is a new best practice they could all be fixed in a separate bug. It's a one line fix, I can provide a follow-up later. Created attachment 86200 [details] [review] Bug 8775: Add collection code to lost report This patch adds a column for collection code to the lost items report. To test, apply the patch and run the lost items report. You should see a collection code column. Test column configuration for this table: Go to Administration -> Configure columns. Confirm that the "collection_code" column can be configured and that configuration choices are applied correctly. Signed-off-by: Bin Wen <bin.wen@inlibro.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 86201 [details] [review] Bug 8775: (follow-up) Change column header to "Collection" This patch changes the table heading for ccode to be "Collection" instead of "Collection code." Current templates vary, but "Collection" is more logical because we show the description, not the code. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 86202 [details] [review] Bug 8775: Use the AV mapped with items.ccode instead of CCODE Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> (In reply to Jonathan Druart from comment #16) > Created attachment 86202 [details] [review] [review] > Bug 8775: Use the AV mapped with items.ccode instead of CCODE > > Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> The newer method (GetDescriptionBYKOhaField) is nice because it caches, however, it does not currently return a value when the code does not match an authorised value. This patch also repeats the code and description when a description is found: [% item.ccode%][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %] Obsoleting the last patch here, please address using the new method and returning the code if no value found on another bug. Awesome work all! Pushed to master for 19.05 Enhancement will not be backported to 18.11.x series. |