<, >, ', or " in an item call number will no longer make
the bib displays break when using XSLT mode.
Added a new routine to C4::Koha, xml_escape(), to implement
converting &, <, >, ', and " to their corresponding
entities.
Patch loosely based on work done by Daniel Latrémolière <daniel.latremoliere@bulac.fr>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
- Adding material type icons from the OPAC side
- Adding OPAC View link
- Copying revised handling of MU from the OPAC
- Removing OPAC-specific markup
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Note: approach used can be described as a hack at best; the current
language should probably become a session attribute.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This is a quick fix to XSLTParse4Display to make ampersands display
correctly in OPAC search results.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Fixes the opac results (opac-search.pl), if using xsl to transform data. I have no way to test UNIMARC results, if someone could test it for me.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
When using XSLT Display, and UNIMARC,
since marcFlavour is not used in encoding data, when data is true utf8, as_xml
fails on some subfields.
Moreover, because transformMARCXMLForXSLT edits some values in the marc record
and the PERL UTF8 is not handled by MARC::File::USMARC, it endsup in double
encoding the data.
Sending a patch to fix both issues.
This patch adds
- two functions in C4/Charset.pm
NormalizeString (uses Unicode::Normalize)
SetUTF8Flag (This function in my opinion belongs to MARC::Record, or at least MARC::File::USMARC)
- edits C4::XSLT in order to cope with the correct marcflavour
- edits C4::Search searchResults to use setUTF8Flag
If the homebranch tag had an & in its name, then the XML wouldn't parse
correctly. As a result, if XSLT was turned on, "No copies available" would
always be displayed.
- the XSLTParse4Display sub now has a new parameter : the interface (intranet or opac)
- the XSLTdisplay sysprefs is common to staff & opac (Auth.pm)
- added UNIMARC xslt in intranet templates (modified to deal with staff/opac differences)
The patch I sent earlier repeated a line having to do with the count of items, which mean the count was now doubling (2 items instead of 1, 4 instead of 2, etc.). This patch removes the first, now superflous line of $xmlrecord =~ s/\<\/record\>/$itemsxml\<\/record\>/;
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
The MARC21slim2OPACDetail.xsl and MARC21slim2OPACResults.xsl XSLT
stylesheets do not obey any of the OPAC sysprefs, OPACURLOpenInNewWindow,
URLLinkText, or a new one added for Bug 3545, DisplayOPACiconsXSLT.
Modified C4/XSLT.pm based on code written by Fréric Demians (thanks!) to
pass the values of the sysprefs to the .xsl files. Modified the .xsl
files to implement them. If the respective sysprefs are set, the OPAC
results and display pages will/will not display the format/material
type/audience icons, will/will not open URLs in new browser windows,
and will/will not use the text entered in URLLinkText as generic link
text when there is no value in the 856 subfield y, 3, or z. (Note that
if subfields y, 3, or z do contain text, the first match is what will be displayed.)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This patch is done in the process of understanding what's
going wrong with bug #3226. It improves some processing.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Avoid reading marc_tag_structure for each biblo record to
transform by XSLT. Not totaly useless on OPAC result page.
Should be done via application variables rather than
request variable, but this is another story.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Speed up bib search and OPAC bib display, especially
when the XSLT OPAC results and details display sysprefs are
ON, by passing an existing MARC::Record object to three
functions:
C4::Biblio::get_biblio_authorised_values()
C4::XSLT::XSLTParse4Display()
C4::XSLT::transformMARCXML4XSLT (internal)
These functions previously fetched the bib from the
database, incurring the cost of DB retrieval and MARCXML
parsing even though client code already had a
MARC::Record object available.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
1. rather than testing for notforloan == -1, test for any negative values to set the On order status
2. in cases where itemcallnumber is blank or null, don't display the itemcallnumber brackets []
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This patch works with XSL* sysprefs == ON, a future patch will address XSL sysprefs==OFF
Items with notforloan set to a negative number still designate an 'ordered' status
Some items are marked 'not for loan' by setting that value at the item level, others by assigning
that value to that item's itemtype. This patch works for both scenarios.
Specific changes this patch introduces to the OPAC:
* Adds a new OPAC results page key 'Copies available for reference:'
* Changes 'Copies available at:' to 'Copies available for loan:'
* Changes the availability limit label in opac-advsearch from:
'Only items currently available' to 'Only items currently
available for loan or reference
* Displays the authorised value for the specific notforloan value in the OPAC detail page in
parentheses next to 'Not for Loan'
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
In XSLT.pm, put XSLT stylesheet object in a session variable in order
to avoid to build it for each biblio to parse: useful on search
result page.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
The in transit status now displays as such in the
OPAC search results. In the non-XSLT version, the status
is checked only for bibs having 20 or fewer items to avoid
extra hits on the database during result set presentation.
In the XSLT version, all items are checked.
Note that because an item's transfer status is not
stored in the MARC record, the transfer status
has no effect when limiting a search by item
availability. For a future version, the transit status
should be added to the Zebra index.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>