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

(-)a/C4/Items.pm (+17 lines)
Lines 1596-1601 sub PrepareItemrecordDisplay { Link Here
1596
                    $defaultvalue = q||;
1596
                    $defaultvalue = q||;
1597
                } else {
1597
                } else {
1598
                    $defaultvalue =~ s/"/"/g;
1598
                    $defaultvalue =~ s/"/"/g;
1599
                    # get today date & replace <<YYYY>>, <<MM>>, <<DD>> if provided in the default value
1600
                    my $today_dt = dt_from_string;
1601
                    my $year     = $today_dt->strftime('%Y');
1602
                    my $shortyear     = $today_dt->strftime('%y');
1603
                    my $month    = $today_dt->strftime('%m');
1604
                    my $day      = $today_dt->strftime('%d');
1605
                    $defaultvalue =~ s/<<YYYY>>/$year/g;
1606
                    $defaultvalue =~ s/<<YY>>/$shortyear/g;
1607
                    $defaultvalue =~ s/<<MM>>/$month/g;
1608
                    $defaultvalue =~ s/<<DD>>/$day/g;
1609
1610
                    # And <<USER>> with surname (?)
1611
                    my $username =
1612
                      (   C4::Context->userenv
1613
                        ? C4::Context->userenv->{'surname'}
1614
                        : "superlibrarian" );
1615
                    $defaultvalue =~ s/<<USER>>/$username/g;
1599
                }
1616
                }
1600
1617
1601
                my $maxlength = $tagslib->{$tag}->{$subfield}->{maxlength};
1618
                my $maxlength = $tagslib->{$tag}->{$subfield}->{maxlength};
(-)a/acqui/neworderempty.pl (-1 / +3 lines)
Lines 228-239 if ( not $ordernumber ) { # create order Link Here
228
228
229
                if ( $value ) {
229
                if ( $value ) {
230
230
231
                    # get today date & replace <<YYYY>>, <<MM>>, <<DD>> if provided in the default value
231
                    # get today date & replace <<YYYY>>, <<YY>>, <<MM>>, <<DD>> if provided in the default value
232
                    my $today_dt = dt_from_string;
232
                    my $today_dt = dt_from_string;
233
                    my $year     = $today_dt->strftime('%Y');
233
                    my $year     = $today_dt->strftime('%Y');
234
                    my $shortyear = $today_dt->strftime('%y');
234
                    my $month    = $today_dt->strftime('%m');
235
                    my $month    = $today_dt->strftime('%m');
235
                    my $day      = $today_dt->strftime('%d');
236
                    my $day      = $today_dt->strftime('%d');
236
                    $value =~ s/<<YYYY>>/$year/g;
237
                    $value =~ s/<<YYYY>>/$year/g;
238
                    $value =~ s/<<YY>>/$shortyear/g;
237
                    $value =~ s/<<MM>>/$month/g;
239
                    $value =~ s/<<MM>>/$month/g;
238
                    $value =~ s/<<DD>>/$day/g;
240
                    $value =~ s/<<DD>>/$day/g;
239
241
(-)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 132-143 sub generate_subfield_form { Link Here
132
        if ( ! defined( $value ) || $value eq '')  {
132
        if ( ! defined( $value ) || $value eq '')  {
133
            $value = $subfieldlib->{defaultvalue};
133
            $value = $subfieldlib->{defaultvalue};
134
            if ( $value ) {
134
            if ( $value ) {
135
                # get today date & replace <<YYYY>>, <<MM>>, <<DD>> if provided in the default value
135
                # get today date & replace <<YYYY>>, <<YY>>, <<MM>>, <<DD>> if provided in the default value
136
                my $today_dt = dt_from_string;
136
                my $today_dt = dt_from_string;
137
                my $year = $today_dt->strftime('%Y');
137
                my $year = $today_dt->strftime('%Y');
138
                my $shortyear = $today_dt->strftime('%y');
138
                my $month = $today_dt->strftime('%m');
139
                my $month = $today_dt->strftime('%m');
139
                my $day = $today_dt->strftime('%d');
140
                my $day = $today_dt->strftime('%d');
140
                $value =~ s/<<YYYY>>/$year/g;
141
                $value =~ s/<<YYYY>>/$year/g;
142
                $value =~ s/<<YY>>/$shortyear/g;
141
                $value =~ s/<<MM>>/$month/g;
143
                $value =~ s/<<MM>>/$month/g;
142
                $value =~ s/<<DD>>/$day/g;
144
                $value =~ s/<<DD>>/$day/g;
143
                # And <<USER>> with surname (?)
145
                # And <<USER>> with surname (?)
144
- 

Return to bug 24134