@@ -, +, @@ --- 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(-) --- a/cataloguing/addbiblio.pl +++ a/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, --- a/installer/data/mysql/sysprefs.sql +++ a/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'), --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -10628,6 +10628,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) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ a/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 {MARC} (marc flavour, eg. "MARC21" or "UNIMARC"), {FIELD} (field number, eg. "000" or "048"), {LANG} (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 http://fielddoc.example.com/?marc={MARC}&field={FIELD}&language={LANG} + - - pref: hide_marc choices: yes: "Don't display" --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ a/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); --