New Authority system preference created UNIMARCAuthorityField100 with default value "afrey50 ba0".
AuthoritiesMarc.pm uses the system preference instead of label "afrey50 ba0".
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, all tests and QA script pass.
1) Check system preference is created correctly.
2) Change pref.
3) Catalog a new authority.
4) Change framework to make 100 show in frameworks or check in the
the database, that now 100 has the new defined value.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
if ($format eq "UNIMARCAUTH") {
$record->leader(" nx j22 ") unless ($record->leader());
- my $date=POSIX::strftime("%Y%m%d",localtime);
+ my $date=POSIX::strftime("%Y%m%d",localtime);
+ my $defaultfield100 = C4::Context->preference('UNIMARCAuthorityField100');
if (my $string=$record->subfield('100',"a")){
$string=~s/fre50/frey50/;
$record->field('100')->update('a'=>$string);
}
elsif ($record->field('100')){
- $record->field('100')->update('a'=>$date."afrey50 ba0");
+ $record->field('100')->update('a'=>$date.$defaultfield100);
} else {
$record->append_fields(
MARC::Field->new('100',' ',' '
- ,'a'=>$date."afrey50 ba0")
+ ,'a'=>$date.$defaultfield100)
);
}
}
my @ind_tag = $input->param('ind_tag');
my @indicator = $input->param('indicator');
my $record = TransformHtmlToMarc($input);
- if (C4::Context->preference("marcflavour") eq "UNIMARC"){
- unless ($record->field('100')){
- use POSIX qw(strftime);
- my $string = strftime( "%Y%m%d", localtime(time) );
- # set 50 to position 26 is biblios, 13 if authorities
- my $pos=13;
- $string = sprintf( "%-*s", 35, $string );
- substr( $string, $pos , 2, "50" );
- $record->append_fields(MARC::Field->new('100','','',"a"=>$string));
- }
- }
my ($duplicateauthid,$duplicateauthvalue);
($duplicateauthid,$duplicateauthvalue) = FindDuplicateAuthority($record,$authtypecode) if ($op eq "add") && (!$is_a_modif);
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('UseTransportCostMatrix',0,"Use Transport Cost Matrix when filling holds",'','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UNIMARCAuthorityField100', 'afrey50 ba0', NULL, NULL, 'Textarea');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerUnwantedField','','Name the fields you don\'t need to store for a patron\'s account',NULL,'free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','1',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL);
SetVersion ($DBversion);
}
+$DBversion = "XXX";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('UNIMARCAuthorityField100', 'afrey50 ba0', NULL, NULL, 'Textarea')");
+ print "Upgrade to $DBversion done (Bug 9145 - Add syspref UNIMARCAuthorityField100)\n";
+ SetVersion ($DBversion);
+}
+
+
=head1 FUNCTIONS
=head2 TableExists($table)
yes: Use
no: "Don't use"
- authority record numbers instead of text strings for searches from subject tracings.
+ -
+ - Use the following text for the contents of UNIMARC authority field 100 position (fixed length data elements). Do NOT include the date (position 00-05).
+ - pref: UNIMARCAuthorityField100
+ defautl: "afrey50 ba0"
+ type: textarea
+ class: code
Linker:
-
- Use the