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

(-)a/C4/Items.pm (+17 lines)
Lines 2398-2403 sub PrepareItemrecordDisplay { Link Here
2398
                    $defaultvalue = q||;
2398
                    $defaultvalue = q||;
2399
                } else {
2399
                } else {
2400
                    $defaultvalue =~ s/"/"/g;
2400
                    $defaultvalue =~ s/"/"/g;
2401
                    # get today date & replace <<YYYY>>, <<MM>>, <<DD>> if provided in the default value
2402
                    my $today_dt = dt_from_string;
2403
                    my $year     = $today_dt->strftime('%Y');
2404
                    my $shortyear     = $today_dt->strftime('%y');
2405
                    my $month    = $today_dt->strftime('%m');
2406
                    my $day      = $today_dt->strftime('%d');
2407
                    $defaultvalue =~ s/<<YYYY>>/$year/g;
2408
                    $defaultvalue =~ s/<<YY>>/$shortyear/g;
2409
                    $defaultvalue =~ s/<<MM>>/$month/g;
2410
                    $defaultvalue =~ s/<<DD>>/$day/g;
2411
2412
                    # And <<USER>> with surname (?)
2413
                    my $username =
2414
                      (   C4::Context->userenv
2415
                        ? C4::Context->userenv->{'surname'}
2416
                        : "superlibrarian" );
2417
                    $defaultvalue =~ s/<<USER>>/$username/g;
2401
                }
2418
                }
2402
2419
2403
                my $maxlength = $tagslib->{$tag}->{$subfield}->{maxlength};
2420
                my $maxlength = $tagslib->{$tag}->{$subfield}->{maxlength};
(-)a/acqui/neworderempty.pl (-1 / +3 lines)
Lines 227-238 if ( not $ordernumber ) { # create order Link Here
227
227
228
                if ( $value eq '' ) {
228
                if ( $value eq '' ) {
229
229
230
                    # get today date & replace <<YYYY>>, <<MM>>, <<DD>> if provided in the default value
230
                    # get today date & replace <<YYYY>>, <<YY>>, <<MM>>, <<DD>> if provided in the default value
231
                    my $today_dt = dt_from_string;
231
                    my $today_dt = dt_from_string;
232
                    my $year     = $today_dt->strftime('%Y');
232
                    my $year     = $today_dt->strftime('%Y');
233
                    my $shortyear = $today_dt->strftime('%y');
233
                    my $month    = $today_dt->strftime('%m');
234
                    my $month    = $today_dt->strftime('%m');
234
                    my $day      = $today_dt->strftime('%d');
235
                    my $day      = $today_dt->strftime('%d');
235
                    $value =~ s/<<YYYY>>/$year/g;
236
                    $value =~ s/<<YYYY>>/$year/g;
237
                    $value =~ s/<<YY>>/$shortyear/g;
236
                    $value =~ s/<<MM>>/$month/g;
238
                    $value =~ s/<<MM>>/$month/g;
237
                    $value =~ s/<<DD>>/$day/g;
239
                    $value =~ s/<<DD>>/$day/g;
238
240
(-)a/cataloguing/addbiblio.pl (-1 / +3 lines)
Lines 279-290 sub create_input { Link Here
279
    if ( $value eq '' ) {
279
    if ( $value eq '' ) {
280
        $value = $tagslib->{$tag}->{$subfield}->{defaultvalue} // q{};
280
        $value = $tagslib->{$tag}->{$subfield}->{defaultvalue} // q{};
281
281
282
        # get today date & replace <<YYYY>>, <<MM>>, <<DD>> if provided in the default value
282
        # get today date & replace <<YYYY>>, <<YY>>, <<MM>>, <<DD>> if provided in the default value
283
        my $today_dt = dt_from_string;
283
        my $today_dt = dt_from_string;
284
        my $year = $today_dt->strftime('%Y');
284
        my $year = $today_dt->strftime('%Y');
285
        my $shortyear = $today_dt->strftime('%y');
285
        my $month = $today_dt->strftime('%m');
286
        my $month = $today_dt->strftime('%m');
286
        my $day = $today_dt->strftime('%d');
287
        my $day = $today_dt->strftime('%d');
287
        $value =~ s/<<YYYY>>/$year/g;
288
        $value =~ s/<<YYYY>>/$year/g;
289
        $value =~ s/<<YY>>/$shortyear/g;
288
        $value =~ s/<<MM>>/$month/g;
290
        $value =~ s/<<MM>>/$month/g;
289
        $value =~ s/<<DD>>/$day/g;
291
        $value =~ s/<<DD>>/$day/g;
290
        # And <<USER>> with surname (?)
292
        # And <<USER>> with surname (?)
(-)a/cataloguing/additem.pl (-2 / +3 lines)
Lines 136-147 sub generate_subfield_form { Link Here
136
        if ( ! defined( $value ) || $value eq '')  {
136
        if ( ! defined( $value ) || $value eq '')  {
137
            $value = $subfieldlib->{defaultvalue};
137
            $value = $subfieldlib->{defaultvalue};
138
            if ( $value ) {
138
            if ( $value ) {
139
                # get today date & replace <<YYYY>>, <<MM>>, <<DD>> if provided in the default value
139
                # get today date & replace <<YYYY>>, <<YY>>, <<MM>>, <<DD>> if provided in the default value
140
                my $today_dt = dt_from_string;
140
                my $today_dt = dt_from_string;
141
                my $year = $today_dt->strftime('%Y');
141
                my $year = $today_dt->strftime('%Y');
142
                my $shortyear = $today_dt->strftime('%y');
142
                my $month = $today_dt->strftime('%m');
143
                my $month = $today_dt->strftime('%m');
143
                my $day = $today_dt->strftime('%d');
144
                my $day = $today_dt->strftime('%d');
144
                $value =~ s/<<YYYY>>/$year/g;
145
                $value =~ s/<<YYYY>>/$year/g;
146
                $value =~ s/<<YY>>/$shortyear/g;
145
                $value =~ s/<<MM>>/$month/g;
147
                $value =~ s/<<MM>>/$month/g;
146
                $value =~ s/<<DD>>/$day/g;
148
                $value =~ s/<<DD>>/$day/g;
147
                # And <<USER>> with surname (?)
149
                # And <<USER>> with surname (?)
148
- 

Return to bug 24134