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

--- Comment #7 from Community Sandboxes <[email protected]> ---
Created attachment 208575
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208575&action=edit
Bug 43860: Show cataloging search results data in ISBD order

In the cataloging search results (cataloguing/addbooks.pl) the line
under the title showed the bibliographic data in an arbitrary order:

  Author - ISBN - Year - Publisher - Copyright Edition: X; Place - Extent; Size

and the separators added by the template duplicated the ISBD
punctuation usually catalogued in the subfields (264$a "New York :",
264$b "Vision,", 300$a "501 p. ;"), at the end of a subfield or at the
start of the next one (264$b ": Publisher", 300$c "; 30 cm").

This patch shows the data following the order of the ISBD areas:

  Author - Edition: X - Place : Publisher, Date - Extent ; Size - ISBN

- The publication area is grouped as "Place : Publisher, Date", with
  separators only between the elements that are present, and wrapped
  in <span class="results_publication">.
- copyrightdate is only shown if it differs from publicationyear.
- Size is preceded by " ; " if there is an extent, or by "- " if not.
- ISBN goes at the end.
- Leading and trailing ISBD punctuation is stripped from each element
  before building the line, so it is not duplicated. When a field is
  repeated, Koha joins the values with " | ", so the punctuation is
  stripped from each value (e.g. 260$a "Harmondsworth ; | Baltimore :"
  is shown as "Harmondsworth | Baltimore").
- The ISBN is cleaned the same way (020$a "0198709862 (pbk.) :" is shown
  as "0198709862 (pbk.)").

The separators are built inside TT directives so that the template
tidy does not strip their surrounding spaces.

Steps to follow:
1. Make sure some records have publication data with catalogued ISBD
   punctuation, e.g. 264 _1 $a New York, NY : $b Vision, and
   300 $a 501 p. ; $c 19 cm. (the date is only shown if the subfield
   used is mapped to biblio.copyrightdate, 260$c by default).
2. Cataloging > search for those records. Look at the line under the
   title: the ISBN comes first, the place is shown after the edition,
   the edition is glued to the previous element and the punctuation is
   duplicated (e.g. "New York, NY : - 501 p. ; ; 19 cm.").
3. Edit a record so that 264$b (or 260$b) starts with ": " and 300$c
   starts with "; ", and remove 300$a. Reindex the record if your
   test environment does not do it automatically (e.g.
   misc/search_tools/rebuild_elasticsearch.pl -b --bnumber <biblionumber>,
   or check that koha-es-indexer / the Zebra daemon is running).
   Search again: you see "- : Publisher" and "; 30 cm".
4. Apply the patch (no restart needed, it is a template change).
5. Repeat the searches. The line now reads
   Author - Edition: X - Place : Publisher, Date - Extent ; Size - ISBN
   with no duplicated punctuation, and the record from step 3 shows
   "- Publisher - 30 cm".
6. Check a record with only a publisher (no place) and one with no
   publication data at all: no stray separators are shown.
7. Put a value with & or quotes in 264$b, reindex the record as in
   step 3 and check it is displayed correctly.
8. Edit a record with repeated subfields and ISBD punctuation, e.g.
   260 $a New York : $b Arcade Pub. ; $a [Boston, Mass.] : $b Little,
   Brown, $c 1993, and 020 $a 1559702176 : $c $20.00, and reindex it.
   Check that the punctuation is stripped from each value before the
   " | " ("New York | [Boston, Mass.] : Arcade Pub. | Little, Brown,
   1993") and that the ISBN is shown without the final ":".

Signed-off-by: Adolfo Rodríguez <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Gretchen Maxeiner <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
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