View | Details | Raw Unified | Return to bug 8347
Collapse All | Expand All

(-)a/C4/Biblio.pm (-1 / +4 lines)
Lines 3579-3584 sub ModBiblioMarc { Link Here
3579
3579
3580
    # deal with UNIMARC field 100 (encoding) : create it if needed & set encoding to unicode
3580
    # deal with UNIMARC field 100 (encoding) : create it if needed & set encoding to unicode
3581
    if ( $encoding eq "UNIMARC" ) {
3581
    if ( $encoding eq "UNIMARC" ) {
3582
	my $defaultlanguage = C4::Context->preference("UNIMARCField100Language");
3583
        $defaultlanguage = "fre" if (!$defaultlanguage || length($defaultlanguage) != 3);
3582
        my $string = $record->subfield( 100, "a" );
3584
        my $string = $record->subfield( 100, "a" );
3583
        if ( ($string) && ( length( $record->subfield( 100, "a" ) ) == 36 ) ) {
3585
        if ( ($string) && ( length( $record->subfield( 100, "a" ) ) == 36 ) ) {
3584
            my $f100 = $record->field(100);
3586
            my $f100 = $record->field(100);
Lines 3587-3594 sub ModBiblioMarc { Link Here
3587
            $string = POSIX::strftime( "%Y%m%d", localtime );
3589
            $string = POSIX::strftime( "%Y%m%d", localtime );
3588
            $string =~ s/\-//g;
3590
            $string =~ s/\-//g;
3589
            $string = sprintf( "%-*s", 35, $string );
3591
            $string = sprintf( "%-*s", 35, $string );
3592
	    substr ( $string, 22, 3, $defaultlanguage);
3590
        }
3593
        }
3591
        substr( $string, 22, 6, "frey50" );
3594
        substr( $string, 25, 3, "y50" );
3592
        unless ( $record->subfield( 100, "a" ) ) {
3595
        unless ( $record->subfield( 100, "a" ) ) {
3593
            $record->insert_fields_ordered( MARC::Field->new( 100, "", "", "a" => $string ) );
3596
            $record->insert_fields_ordered( MARC::Field->new( 100, "", "", "a" => $string ) );
3594
        }
3597
        }
(-)a/cataloguing/value_builder/unimarc_field_100.pl (-1 / +4 lines)
Lines 82-87 sub plugin { Link Here
82
82
83
    my $dbh = C4::Context->dbh;
83
    my $dbh = C4::Context->dbh;
84
84
85
    my $defaultlanguage = C4::Context->preference("UNIMARCField100Language");
86
    $defaultlanguage = "fre" if (!$defaultlanguage || length($defaultlanguage) != 3);
87
85
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
88
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
86
        {
89
        {
87
            template_name => "cataloguing/value_builder/unimarc_field_100.tmpl",
90
            template_name => "cataloguing/value_builder/unimarc_field_100.tmpl",
Lines 92-98 sub plugin { Link Here
92
            debug           => 1,
95
            debug           => 1,
93
        }
96
        }
94
    );
97
    );
95
    $result = '        d        u  y0frey50      ba' unless $result;
98
    $result = "        d        u  y0".$defaultlanguage."y50      ba" unless $result;
96
    my $f1 = substr( $result, 0, 8 );
99
    my $f1 = substr( $result, 0, 8 );
97
    if ( $f1 eq '        ' ) {
100
    if ( $f1 eq '        ' ) {
98
        my @today = Date::Calc::Today();
101
        my @today = Date::Calc::Today();
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 387-389 INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdid Link Here
387
INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
387
INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
388
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
388
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
389
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free');
389
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free');
390
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UNIMARCField100Language', 'fre','UNIMARC field 100 default language',NULL,'short');
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +7 lines)
Lines 6083-6088 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
6083
    SetVersion($DBversion);
6083
    SetVersion($DBversion);
6084
}
6084
}
6085
6085
6086
$DBversion = "XXX";
6087
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
6088
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UNIMARCField100Language', 'fre','UNIMARC field 100 default language',NULL,'short')");
6089
    print "Upgrade to $DBversion done (Bug 8347 - Koha forces UNIMARC 100 field code language to 'fre')\n";
6090
    SetVersion($DBversion);
6091
}
6092
6086
=head1 FUNCTIONS
6093
=head1 FUNCTIONS
6087
6094
6088
=head2 TableExists($table)
6095
=head2 TableExists($table)
6089
- 

Return to bug 8347