https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41620

--- Comment #9 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 203431
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203431&action=edit
Bug 41620: Introduce Koha::CSV::ItemSearch for CSV exports

This patch introduces Koha::CSV::ItemSearch, a thin subclass of
Koha::CSV that defines the column schema for item search CSV exports.

The class only overrides columns() with 21 column definitions,
leveraging the base class export workflow for serialization, UTF-8
output, and row iteration.

Changes:
- Add Koha::CSV::ItemSearch with column definitions using:
  - $self->av_description() for authorised value fields (cached)
  - __x() with named placeholders for UNIMARC title translatability
  - DateFormat system preference for date formatting
  - fallback_to_value for collection/location codes
  - Empty string for status 0 (not-for-loan, lost, etc.)
- Update itemsearch.pl to use $csv->export()
- Update item-export.pl to use $csv->export()
- Remove obsolete CSV templates

Test plan:
1. Apply patches
2. Run:
   $ ktd --shell
   k$ prove t/Koha/CSV.t t/db_dependent/Koha/CSV/ItemSearch.t
=> SUCCESS: Tests pass!
3. Set DateFormat to dd/mm/yyyy
4. Go to Cataloging > Item search, search, export CSV
5. Open in LibreOffice (select UTF-8 encoding on import)
=> SUCCESS: Diacritics display correctly
=> SUCCESS: Dates use dd/mm/yyyy format
=> SUCCESS: Status columns empty for available items
=> SUCCESS: All 21 columns present
6. Test item-export.pl from record detail page
=> SUCCESS: Same correct output
7. Sign off :-D

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to