Bugzilla – Attachment 40605 Details for
Bug 11674
Configuration for MARC field doc URLs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
(rebased) Config for MARC field doc URLs
rebased-Config-for-MARC-field-doc-URLs.patch (text/plain), 5.61 KB, created by
Indranil Das Gupta
on 2015-06-24 21:27:07 UTC
(
hide
)
Description:
(rebased) Config for MARC field doc URLs
Filename:
MIME Type:
Creator:
Indranil Das Gupta
Created:
2015-06-24 21:27:07 UTC
Size:
5.61 KB
patch
obsolete
>From 281f74be01cf34a3c339d7f359b2cf5473a60b73 Mon Sep 17 00:00:00 2001 >From: paxed <pasi.kallinen@pttk.fi> >Date: Sat, 20 Jun 2015 20:18:48 +0530 >Subject: [PATCH] (rebased) Config for MARC field doc URLs > >Rebased from 3.15 to 3.21. no other changes made. > >Test plans as before. > >http://bugs.koha-community.org/show_bug.cgi?id=11674 > >Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> >--- > cataloguing/addbiblio.pl | 1 + > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 12 ++++++++++++ > .../prog/en/modules/admin/preferences/cataloguing.pref | 7 +++++++ > .../intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt | 8 +++++++- > 5 files changed, 28 insertions(+), 1 deletion(-) > >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index 890db0f..536d334 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -982,6 +982,7 @@ if ( $record ne '-1' ) { > $template->param( title => $title ); > } > $template->param( >+ marcfielddocurl => C4::Context->preference("MarcFieldDocURL"), > popup => $mode, > frameworkcode => $frameworkcode, > itemtype => $frameworkcode, >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 84ba363..a6d2898 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -201,6 +201,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('MARCAuthorityControlField008','|| aca||aabn | a|a d',NULL,'Define the contents of MARC21 authority control field 008 position 06-39','Textarea'), > ('MarcFieldsToOrder','',NULL,'Set the mapping values for a new order line created from a MARC record in a staged file. In a YAML format.','textarea'), > ('MARCOrgCode','OSt','','Define MARC Organization Code for MARC21 records - http://www.loc.gov/marc/organizations/orgshome.html','free'), >+('MarcFieldDocURL', NULL, NULL, 'URL used for MARC field documentation. Following substitutions are available: {MARC} = marc flavour, eg. "MARC21" or "UNIMARC". {FIELD} = field number, eg. "000" or "048". {LANG} = user language, eg. "en" or "fi-FI"', 'free'), > ('MaxFine',NULL,'','Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.','Integer'), > ('MaxItemsForBatch','1000',NULL,'Max number of items record to process in a batch (modification or deletion)','Integer'), > ('maxItemsInSearchResults','20',NULL,'Specify the maximum number of items to display for each result on a page of results','free'), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 214faa3..2afac41 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -10659,6 +10659,18 @@ foreach my $file ( sort readdir $dirh ) { > } > } > >+ >+$DBversion = "3.21.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(" >+ INSERT INTO systempreferences (variable,value,options,explanation,type) >+ VALUES ('MarcFieldDocURL', NULL, NULL, 'URL used for MARC field documentation. Following substitutions are available: {MARC} = marc flavour, eg. \"MARC21\" or \"UNIMARC\". {FIELD} = field number, eg. \"000\" or \"048\". {LANG} = user language, eg. \"en\" or \"fi-FI\"', 'free'); >+ "); >+ print "Upgrade to $DBversion done (Bug 11674: Configuration for MARC field doc URLs)\n"; >+ SetVersion ($DBversion); >+} >+ >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >index bc35aad..fda78fc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >@@ -142,6 +142,13 @@ Cataloging: > no: "Don't use" > - record control number ($w subfields) and control number (001) for linking of bibliographic records. > - >+ - Use >+ - pref: MarcFieldDocURL >+ - as the URL for MARC field documentation. >+ - Possible substitutions are <tt>{MARC}</tt> (marc flavour, eg. "MARC21" or "UNIMARC"), <tt>{FIELD}</tt> (field number, eg. "000" or "048"), <tt>{LANG}</tt> (user language, eg. "en" or "fi-FI"). >+ - If left empty, the format documentation on http://loc.gov (MARC21) or http://archive.ifla.org (UNIMARC) is used. >+ - For example <tt>http://fielddoc.example.com/?marc={MARC}&field={FIELD}&language={LANG}</tt> >+ - > - pref: hide_marc > choices: > yes: "Don't display" >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >index 3bc00d5..47bcc49 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >@@ -140,7 +140,13 @@ function PopupZ3950() { > } > > function PopupMARCFieldDoc(field) { >- [% IF ( marcflavour == 'MARC21' ) %] >+ [% IF (marcfielddocurl) %] >+ var docurl = "[% marcfielddocurl.replace('"','"') %]"; >+ docurl = docurl.replace("{MARC}", "[% marcflavour %]"); >+ docurl = docurl.replace("{FIELD}", ""+field); >+ docurl = docurl.replace("{LANG}", "[% lang %]"); >+ window.open(docurl); >+ [% ELSIF ( marcflavour == 'MARC21' ) %] > _MARC21FieldDoc(field); > [% ELSIF ( marcflavour == 'UNIMARC' ) %] > _UNIMARCFieldDoc(field); >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11674
:
26894
|
40432
|
40433
|
40506
|
40515
|
40516
|
40517
|
40519
|
40541
|
40542
|
40605
|
40606
|
40638
|
71108
|
73594
|
74196