Bug 39860: Allow for the defining of custom MARC fields on the staff interface record display pages
To test:
0. APPLY PATCH, restart_all
1. Find or create a record that has some MARC fields that don't show up by default in the record display. ( I tested using a 538$a )
2. Go to Tools and you should see a new link for 'Record display customizations'.
3. From Record display customizations click 'New Entry'
4. Choose a display location, the choices should be StaffResultsPage, StaffDetailPage, OPACResultsPage, and OPACDetailPage
5. Add the following to the entry:
[% IF record.subfield('538' , 'a') %]
<span class="results_summary test1">
<span class="label">The 538a: </span>
[% record.subfield('538' , 'a') %]
</span>
[% END %]
6. Go to the record from step 1, you should see the 538$a labeled as 'The 538a:' with the appropriate data in it.
7. This should display in the appropriate location depending on if you chose StaffResultsPage, StaffDetailPage, OPACResultsPage, or OPACDetailPage. Check each of the locations.
8. Make a new, or edit existing, Record display customization and mark the 'Library:' field for a specific branch. Make sure that the Record display customization only shows up when you are logged in at that branch.
9. Install a new language pack, I tested with es-ES.
10. Make a new, or edit existing, Record display customization and fill out the language specific tab. Make sure the Record display customization shows correctly with the language you chose.
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
a7bd032aff
commit
9cdb95121e
17
C4/XSLT.pm
17
C4/XSLT.pm
|
|
@ -32,6 +32,8 @@ use Koha::RecordProcessor;
|
|||
use Koha::XSLT::Base;
|
||||
use Koha::Libraries;
|
||||
use Koha::Recalls;
|
||||
use Koha::TemplateUtils qw( process_tt );
|
||||
use C4::Scrubber;
|
||||
|
||||
my $engine; #XSLT Handler object
|
||||
|
||||
|
|
@ -238,6 +240,16 @@ sub XSLTParse4Display {
|
|||
$variables->{OpenURLResolverURL} = $biblio->get_openurl;
|
||||
}
|
||||
}
|
||||
my $extracontent = '';
|
||||
|
||||
# Check if we should add extra content based on system preference
|
||||
if ( C4::Context->preference('ExtraContentForXSLTDisplay') ) {
|
||||
|
||||
my $scrubber = C4::Scrubber->new('staff');
|
||||
my $extracontentvalue = C4::Context->preference('ExtraContentForXSLTDisplay');
|
||||
my $extracontentproccessed = process_tt( $extracontentvalue, { record => $record } );
|
||||
$extracontent = $scrubber->scrub($extracontentproccessed);
|
||||
}
|
||||
|
||||
# embed variables
|
||||
my $varxml = "<variables>\n";
|
||||
|
|
@ -260,7 +272,10 @@ sub XSLTParse4Display {
|
|||
#If the xslt should fail, we will return undef (old behavior was
|
||||
#raw MARC)
|
||||
#Note that we did set do_not_return_source at object construction
|
||||
return $engine->transform( $xmlrecord, $xslfilename ); #file or URL
|
||||
my $transformed_xml = $engine->transform( $xmlrecord, $xslfilename );
|
||||
|
||||
my $concatenated_content = $transformed_xml . $extracontent;
|
||||
return $concatenated_content;
|
||||
}
|
||||
|
||||
=head2 buildKohaItemsNamespace
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
<xsl:template match="/">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="marc:record">
|
||||
|
||||
<!-- Option: Display Alternate Graphic Representation (MARC 880) -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue