---
C4/Biblio.pm | 43 ++++++++++++++++++++
C4/Search.pm | 2 +-
admin/systempreferences.pl | 1 +
installer/data/mysql/de-DE/mandatory/sysprefs.sql | 1 +
installer/data/mysql/en/mandatory/sysprefs.sql | 1 +
.../1-Obligatoire/unimarc_standard_systemprefs.sql | 1 +
installer/data/mysql/it-IT/necessari/sysprefs.sql | 1 +
.../data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql | 1 +
installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 1 +
...m_preferences_full_optimal_for_install_only.sql | 1 +
...m_preferences_full_optimal_for_install_only.sql | 1 +
installer/data/mysql/updatedatabase.pl | 7 +++
.../en/modules/admin/preferences/cataloguing.pref | 6 +++
13 files changed, 66 insertions(+), 1 deletions(-)
diff --git a/C4/Biblio.pm b/C4/Biblio.pm
index d797f40..c026e76 100644
--- a/C4/Biblio.pm
+++ b/C4/Biblio.pm
@@ -3461,6 +3461,49 @@ sub ModBiblioMarc {
# the previous version of the record
$oldRecord = GetMarcBiblio($biblionumber);
}
+ #
+ if (C4::Context->preference("IsbnIssnRemoveHyphens")){
+ my $isbn;
+ my $issn;
+ if ( $encoding eq 'UNIMARC' ) {
+ if ( my $f010 = $record->field('010') ) {
+ if ( $f010->subfield('a') ) {
+ $isbn = $f010->subfield('a');
+ $isbn =~ s/-//g;
+ $f010->update( 'a' => $isbn );
+ }
+ }
+ if ( my $f011 = $record->field('011') ) {
+ if ( $f011->subfield('a') ) {
+ $issn = $f011->subfield('a');
+ $issn =~ s/-//g;
+ $f011->update( 'a' => $issn );
+ }
+ }
+ } elsif ($encoding eq 'MARC21') {
+ if ( my $f020 = $record->field('020') ) {
+ $isbn = $f020->subfield('a');
+ $isbn =~ s/-//g;
+ $f020->update( 'a' => $isbn );
+ }
+ if ( my $f022 = $record->field('022') ) {
+ $issn = $f022->subfield('a');
+ $issn =~ s/-//g;
+ $f022->update( 'a' => $issn );
+ }
+ } elsif ($encoding eq 'NORMARC') {
+ if ( my $f020 = $record->field('020') ) {
+ $isbn = $f020->subfield('a');
+ $isbn =~ s/-//g;
+ $f020->update( 'a' => $isbn );
+ }
+ if ( my $f022 = $record->field('022') ) {
+ $issn = $f022->subfield('a');
+ $issn =~ s/-//g;
+ $f022->update( 'a' => $issn );
+ }
+ }
+ }
$sth = $dbh->prepare("UPDATE biblioitems SET marc=?,marcxml=? WHERE
biblionumber=?");
$sth->execute( $record->as_usmarc(), $record->as_xml_record($encoding),
$biblionumber );
$sth->finish;
diff --git a/C4/Search.pm b/C4/Search.pm
index c3cff65..069c55e 100644
--- a/C4/Search.pm
+++ b/C4/Search.pm
@@ -1164,7 +1164,7 @@ sub buildQuery {
$weight_fields, $fuzzy_enabled,
$remove_stopwords
) = ( 0, 0, 0, 0, 0 );
-
+ $operand =~ s/-//g if
(C4::Context->preference("IsbnIssnRemoveHyphens"));
}
if(not $index){
diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl
index 87ecac4..884eafb 100755
--- a/admin/systempreferences.pl
+++ b/admin/systempreferences.pl
@@ -153,6 +153,7 @@ $tabsysprefs{'item-level_itypes'} = "Cataloging";
$tabsysprefs{OpacSuppression} = "Cataloging";
$tabsysprefs{SpineLabelFormat} = "Cataloging";
$tabsysprefs{SpineLabelAutoPrint} = "Cataloging";
+$tabsysprefs{IsbnIssnRemoveHyphens} = "Cataloging";
# Circulation
$tabsysprefs{maxoutstanding} = "Circulation";
diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql
b/installer/data/mysql/de-DE/mandatory/sysprefs.sql
index 6eb67a3..6fe546a 100755
--- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql
+++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql
@@ -314,3 +314,4 @@ INSERT INTO `systempreferences`
(variable,value,explanation,options,type) VALUES
INSERT INTO systempreferences (variable,value,explanation,options,type)
VALUES('OpacHiddenItems' ,'','This syspref allows to define custom rules for
hiding specific items at opac. See docs/opac/O pacHiddenItems.txt for more
informations.','','Textarea');
INSERT INTO systempreferences (variable,value,explanation,options,type)
VALUES('numSearchRSSResults',50,'Specify the maximum number of results to
display on a RSS page of results',NULL,'Integer');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES
('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC
renewal is recorded in
statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
+INSERT INTO `systempreferences` (`variable`, `value`, `options`,
`explanation`, `type`) VALUES ('IsbnIssnRemoveHyphens', '0', '', 'Remove or not
hyphens from ISBN and ISSN', 'YesNo');
diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql
b/installer/data/mysql/en/mandatory/sysprefs.sql
index 0abf9d8..3b26b1a 100755
--- a/installer/data/mysql/en/mandatory/sysprefs.sql
+++ b/installer/data/mysql/en/mandatory/sysprefs.sql
@@ -314,3 +314,4 @@ INSERT INTO `systempreferences`
(variable,value,explanation,options,type) VALUES
INSERT INTO `systempreferences` (variable,value,explanation,options,type)
VALUES('OpacHiddenItems','','This syspref allows to define custom rules for
hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more
informations.','','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type)
VALUES('numSearchRSSResults',50,'Specify the maximum number of results to
display on a RSS page of results',NULL,'Integer');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES
('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC
renewal is recorded in
statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
+INSERT INTO `systempreferences` (`variable`, `value`, `options`,
`explanation`, `type`) VALUES ('IsbnIssnRemoveHyphens', '0', '', 'Remove or not
hyphens from ISBN and ISSN', 'YesNo');
diff --git
a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
index 59a258f..cc59963 100755
--- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
+++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
@@ -315,3 +315,4 @@ INSERT INTO `systempreferences`
(variable,value,explanation,options,type) VALUES
INSERT INTO `systempreferences` (variable,value,explanation,options,type)
VALUES('OpacHiddenItems','','This syspref allows to define custom rules for
hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more
informations.','','Textarea');
INSERT INTO systempreferences (variable,value,explanation,options,type)
VALUES('numSearchRSSResults',50,'Specify the maximum number of results to
display on a RSS page of results',NULL,'Integer');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES
('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC
renewal is recorded in
statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
+INSERT INTO `systempreferences` (`variable`, `value`, `options`,
`explanation`, `type`) VALUES ('IsbnIssnRemoveHyphens', '0', '', 'Remove or not
hyphens from ISBN and ISSN', 'YesNo');
diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql
b/installer/data/mysql/it-IT/necessari/sysprefs.sql
index dcdf0ee..35b2790 100755
--- a/installer/data/mysql/it-IT/necessari/sysprefs.sql
+++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql
@@ -301,3 +301,4 @@ INSERT INTO `systempreferences`
(variable,value,explanation,options,type) VALUES
INSERT INTO systempreferences (variable,value,explanation,options,type)
VALUES('OpacHiddenItems','','This syspref allows to define custom rules for
hiding specific items at opac. See docs/opac/O pacHiddenItems.txt for more
informations.','','Textarea');
INSERT INTO systempreferences (variable,value,explanation,options,type)
VALUES('numSearchRSSResults',50,'Specify the maximum number of results to
display on a RSS page of results',NULL,'Integer');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES
('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC
renewal is recorded in
statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
+INSERT INTO `systempreferences` (`variable`, `value`, `options`,
`explanation`, `type`) VALUES ('IsbnIssnRemoveHyphens', '0', '', 'Remove or not
hyphens from ISBN and ISSN', 'YesNo');
diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql
b/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql
index ca71769..1fbc993 100644
--- a/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql
+++ b/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql
@@ -321,3 +321,4 @@ INSERT INTO systempreferences
(variable,value,explanation,options,type) VALUES (
INSERT INTO `systempreferences` (variable,value,explanation,options,type)
VALUES('OpacFavicon','','Enter a complete URL to an image to replace the
default Koha favicon on the OPAC','','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type)
VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the
default Koha favicon on the Staff client','','free');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES
('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for
subject tracings.','1','YesNo');
+INSERT INTO `systempreferences` (`variable`, `value`, `options`,
`explanation`, `type`) VALUES ('IsbnIssnRemoveHyphens', '0', '', 'Remove or not
hyphens from ISBN and ISSN', 'YesNo');
diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql
b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql
index 58ba035..0493267 100755
--- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql
+++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql
@@ -313,3 +313,4 @@ INSERT INTO `systempreferences`
(variable,value,explanation,options,type) VALUES
INSERT INTO systempreferences (variable,value,explanation,options,type)
VALUES('OpacHiddenItems','','This syspref allows to define custom rules for
hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more
informations.','','Textarea');
INSERT INTO systempreferences (variable,value,explanation,options,type)
VALUES('numSearchRSSResults',50,'Specify the maximum number of results to
display on a RSS page of results',NULL,'Integer');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES
('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC
renewal is recorded in
statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
+INSERT INTO `systempreferences` (`variable`, `value`, `options`,
`explanation`, `type`) VALUES ('IsbnIssnRemoveHyphens', '0', '', 'Remove or not
hyphens from ISBN and ISSN', 'YesNo');
diff --git
a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql
b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql
index 54c533c..53fb173 100755
---
a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql
+++
b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql
@@ -368,3 +368,4 @@ INSERT INTO `systempreferences`
(variable,value,explanation,options,type) VALUES
INSERT INTO systempreferences (variable,value,explanation,options,type)
VALUES('OpacHiddenItems','','This syspref allows to define custom rules for
hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more
informations.','','Textarea');
INSERT INTO systempreferences (variable,value,explanation,options,type)
VALUES('numSearchRSSResults',50,'Specify the maximum number of results to
display on a RSS page of results',NULL,'Integer');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES
('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC
renewal is recorded in
statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
+INSERT INTO `systempreferences` (`variable`, `value`, `options`,
`explanation`, `type`) VALUES ('IsbnIssnRemoveHyphens', '0', '', 'Remove or not
hyphens from ISBN and ISSN', 'YesNo');
diff --git
a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql
b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql
index 9f095ab..0dbebe1 100755
---
a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql
+++
b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql
@@ -393,3 +393,4 @@ INSERT INTO `systempreferences`
(variable,value,explanation,options,type) VALUES
INSERT INTO systempreferences (variable,value,explanation,options,type)
VALUES('OpacHiddenItems','','This syspref allows to define custom rules for
hiding specific items at opac. See docs/opac/O pacHiddenItems.txt for more
informations.','','Textarea');
INSERT INTO systempreferences (variable,value,explanation,options,type)
VALUES('numSearchRSSResults',50,'Specify the maximum number of results to
display on a RSS page of results',NULL,'Integer');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES
('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC
renewal is recorded in
statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
+INSERT INTO `systempreferences` (`variable`, `value`, `options`,
`explanation`, `type`) VALUES ('IsbnIssnRemoveHyphens', '0', '', 'Remove or not
hyphens from ISBN and ISSN', 'YesNo');
diff --git a/installer/data/mysql/updatedatabase.pl
b/installer/data/mysql/updatedatabase.pl
index 8fb9656..975b64f 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -4370,6 +4370,13 @@ if (C4::Context->preference("Version") <
TransformToNum($DBversion)) {
SetVersion($DBversion);
}
+$DBversion = "3.05.00.XXX";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("INSERT INTO `systempreferences` (`variable`, `value`, `options`,
`explanation`, `type`) VALUES ('IsbnIssnRemoveHyphens', '0', '', 'Remove or not
hyphens from ISBN and ISSN', 'YesNo');");
+ print "Upgrade to $DBversion done (Add SysPref to remove hyphens or not
into isbn and issn)\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 DropAllForeignKeys($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 4fc1305..0632cab 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
@@ -84,6 +84,12 @@ Cataloging:
annual: generated in the form <year>-0001,
<year>-0002.
hbyymmincr: generated in the form <branchcode>yymm0001.
"OFF": not generated automatically.
+ -
+ - pref: IsbnIssnRemoveHyphens
+ choices:
+ yes: "Remove"
+ no: "Don't remove"
+ - hyphens from ISBN and ISSN
Display:
-
- 'Separate multiple displayed authors, series or subjects with '
--
1.7.1
_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/