From f1443becd7154105fa20215ef6c3a50243360c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Cohen=20Arazi?= Date: Tue, 28 Dec 2010 11:39:41 -0300 Subject: [PATCH] [Bug 5546] syspref to hide MARC documentation links --- cataloguing/addbiblio.pl | 6 ++++++ installer/data/mysql/en/mandatory/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../en/modules/admin/preferences/cataloguing.pref | 6 ++++++ .../prog/en/modules/cataloguing/addbiblio.tmpl | 9 +++++++-- 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 2c0c63d..82d5ddb 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -1023,6 +1023,12 @@ $template->param( title => $record->title() ) if ( $record ne "-1" ); if (C4::Context->preference("marcflavour") eq "MARC21"){ $template->param(MARC21 => 1); } + +if (C4::Context->preference("enableMARCdocs")){ + $template->param(enableMARCdocs => 1); +} + + $template->param( popup => $mode, frameworkcode => $frameworkcode, diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 94d5de1..0b3d487 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -278,3 +278,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ILS-DI:AuthorizedIPs','','.','Restricts usage of ILS-DI to some IPs','Free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OverduesBlockCirc','noblock','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','noblock|confirmation|block','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('DisplayMultiPlaceHold','1','Display the ability to place multiple holds or not','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('enableMARCdocs',1,'If ON, enables display of MARC documentation links',NULL,'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index ac272ce..39d3218 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3915,6 +3915,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = 'XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('enableMARCdocs',1,'If Yes, enables display of MARC documentation links',NULL,'YesNo')"); + print "Upgrade to $DBversion done (Add enableMARCdocs syspref)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS 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 d809022..0a51ced 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 @@ -100,6 +100,12 @@ Cataloging: economical: Do - collapse repeated tags of the same type into one tag entry on the display. - + - pref: enableMARCdocs + choices: + yes: Display + no: "Don't display" + - "MARC documentation links" + - - By default, display biblio records in - pref: IntranetBiblioDefaultView choices: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl index 0fa4dc1..79c55ae 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl @@ -67,6 +67,7 @@ function PopupZ3950() { } } + function PopupMARCFieldDoc(field, fieldnumber) { _MARC21FieldDoc(field); @@ -101,6 +102,7 @@ function _UNIMARCFieldDoc(field,fieldnumber) { window.open("http://archive.ifla.org/VI/3/p1996-1/uni9.htm"); } } + /** * check if mandatory subfields are written @@ -784,8 +786,11 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? - Click to Expand this Tag" onclick="ExpandField('tag__'); return false;"> - ">, ); return false;"> ? + "> + , ); return false;"> ? + + _indicator1_" size="1" maxlength="1" value="" /> -- 1.7.1