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

(-)a/authorities/authorities.pl (-3 / +10 lines)
Lines 127-135 sub create_input { Link Here
127
        $max_length = 40;
127
        $max_length = 40;
128
    }
128
    }
129
129
130
    # if there is no value provided but a default value in parameters, get it
130
    # Apply optional framework default value when it is a new record,
131
    if ($value eq '') {
131
    # or when editing as new (duplicating a record),
132
        $value = $tagslib->{$tag}->{$subfield}->{defaultvalue} if !$cgi->param('authid'); # only for new records
132
    # based on the ApplyFrameworkDefaults setting.
133
    # Substitute date parts, user name
134
    my $applydefaults = C4::Context->preference('ApplyFrameworkDefaults');
135
    if ( $value eq '' && (
136
        ( $applydefaults =~ /new/ && !$cgi->param('authid') ) ||
137
        ( $applydefaults =~ /duplicate/ && $cgi->param('op') eq 'duplicate' )
138
    ) ) {
139
        $value = $tagslib->{$tag}->{$subfield}->{defaultvalue};
133
        if (!defined $value) {
140
        if (!defined $value) {
134
            $value = q{};
141
            $value = q{};
135
        }
142
        }
(-)a/cataloguing/addbiblio.pl (-3 / +10 lines)
Lines 288-296 sub create_input { Link Here
288
    
288
    
289
    my $index_subfield = CreateKey(); # create a specifique key for each subfield
289
    my $index_subfield = CreateKey(); # create a specifique key for each subfield
290
290
291
    # Apply optional framework default value when it is a new record
291
    # Apply optional framework default value when it is a new record,
292
    # or when editing as new (duplicating a record),
293
    # or when changing a record's framework,
294
    # based on the ApplyFrameworkDefaults setting.
292
    # Substitute date parts, user name
295
    # Substitute date parts, user name
293
    if ( $value eq '' && !$cgi->param('biblionumber') ) {
296
    my $applydefaults = C4::Context->preference('ApplyFrameworkDefaults');
297
    if ( $value eq '' && (
298
        ( $applydefaults =~ /new/ && !$cgi->param('biblionumber') ) ||
299
        ( $applydefaults =~ /duplicate/ && $cgi->param('op') eq 'duplicate' ) ||
300
        ( $applydefaults =~ /changed/ && $cgi->param('changed_framework') )
301
    ) ) {
294
        $value = $tagslib->{$tag}->{$subfield}->{defaultvalue} // q{};
302
        $value = $tagslib->{$tag}->{$subfield}->{defaultvalue} // q{};
295
303
296
        # get today date & replace <<YYYY>>, <<YY>>, <<MM>>, <<DD>> if provided in the default value
304
        # get today date & replace <<YYYY>>, <<YY>>, <<MM>>, <<DD>> if provided in the default value
297
- 

Return to bug 30250