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

(-)a/authorities/authorities.pl (-3 / +10 lines)
Lines 112-120 sub create_input { Link Here
112
        $max_length = 40;
112
        $max_length = 40;
113
    }
113
    }
114
114
115
    # if there is no value provided but a default value in parameters, get it
115
    # Apply optional framework default value when it is a new record,
116
    if ($value eq '') {
116
    # or when editing as new (duplicating a record),
117
        $value = $tagslib->{$tag}->{$subfield}->{defaultvalue} if !$cgi->param('authid'); # only for new records
117
    # based on the ApplyFrameworkDefaults setting.
118
    # Substitute date parts, user name
119
    my $applydefaults = C4::Context->preference('ApplyFrameworkDefaults');
120
    if ( $value eq '' && (
121
        ( $applydefaults =~ /new/ && !$cgi->param('authid') ) ||
122
        ( $applydefaults =~ /duplicate/ && $cgi->param('op') eq 'duplicate' )
123
    ) ) {
124
        $value = $tagslib->{$tag}->{$subfield}->{defaultvalue};
118
        if (!defined $value) {
125
        if (!defined $value) {
119
            $value = q{};
126
            $value = q{};
120
        }
127
        }
(-)a/cataloguing/addbiblio.pl (-3 / +10 lines)
Lines 292-300 sub create_input { Link Here
292
    
292
    
293
    my $index_subfield = CreateKey(); # create a specifique key for each subfield
293
    my $index_subfield = CreateKey(); # create a specifique key for each subfield
294
294
295
    # Apply optional framework default value when it is a new record
295
    # Apply optional framework default value when it is a new record,
296
    # or when editing as new (duplicating a record),
297
    # or when changing a record's framework,
298
    # based on the ApplyFrameworkDefaults setting.
296
    # Substitute date parts, user name
299
    # Substitute date parts, user name
297
    if ( $value eq '' && !$cgi->param('biblionumber') ) {
300
    my $applydefaults = C4::Context->preference('ApplyFrameworkDefaults');
301
    if ( $value eq '' && (
302
        ( $applydefaults =~ /new/ && !$cgi->param('biblionumber') ) ||
303
        ( $applydefaults =~ /duplicate/ && $cgi->param('op') eq 'duplicate' ) ||
304
        ( $applydefaults =~ /changed/ && $cgi->param('changed_framework') )
305
    ) ) {
298
        $value = $tagslib->{$tag}->{$subfield}->{defaultvalue} // q{};
306
        $value = $tagslib->{$tag}->{$subfield}->{defaultvalue} // q{};
299
307
300
        # get today date & replace <<YYYY>>, <<YY>>, <<MM>>, <<DD>> if provided in the default value
308
        # get today date & replace <<YYYY>>, <<YY>>, <<MM>>, <<DD>> if provided in the default value
301
- 

Return to bug 30250