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

(-)a/cataloguing/addbiblio.pl (-1 / +3 lines)
Lines 307-319 sub create_input { Link Here
307
307
308
        # get today date & replace YYYY, MM, DD if provided in the default value
308
        # get today date & replace YYYY, MM, DD if provided in the default value
309
        my ( $year, $month, $day ) = Today();
309
        my ( $year, $month, $day ) = Today();
310
        my $shortyear = substr $year, 2, 2;
310
        $month = sprintf( "%02d", $month );
311
        $month = sprintf( "%02d", $month );
311
        $day   = sprintf( "%02d", $day );
312
        $day   = sprintf( "%02d", $day );
312
        $value =~ s/YYYY/$year/g;
313
        $value =~ s/YYYY/$year/g;
314
        $value =~ s/YY/$shortyear/g;
313
        $value =~ s/MM/$month/g;
315
        $value =~ s/MM/$month/g;
314
        $value =~ s/DD/$day/g;
316
        $value =~ s/DD/$day/g;
315
        my $username=(C4::Context->userenv?C4::Context->userenv->{'surname'}:"superlibrarian");    
317
        my $username=(C4::Context->userenv?C4::Context->userenv->{'surname'}:"superlibrarian");    
316
        $value=~s/user/$username/g;
318
        $value=~s/USER/$username/g;
317
    
319
    
318
    }
320
    }
319
    my $dbh = C4::Context->dbh;
321
    my $dbh = C4::Context->dbh;
(-)a/cataloguing/additem.pl (-2 / +7 lines)
Lines 33-38 use C4::ClassSource; Link Here
33
use C4::Dates;
33
use C4::Dates;
34
use List::MoreUtils qw/any/;
34
use List::MoreUtils qw/any/;
35
35
36
use Date::Calc qw(Today);
36
use MARC::File::XML;
37
use MARC::File::XML;
37
use URI::Escape;
38
use URI::Escape;
38
39
Lines 124-133 sub generate_subfield_form { Link Here
124
        if ( ! defined( $value ) || $value eq '')  {
125
        if ( ! defined( $value ) || $value eq '')  {
125
            $value = $subfieldlib->{defaultvalue};
126
            $value = $subfieldlib->{defaultvalue};
126
            # get today date & replace YYYY, MM, DD if provided in the default value
127
            # get today date & replace YYYY, MM, DD if provided in the default value
127
            my ( $year, $month, $day ) = split ',', $today_iso;     # FIXME: iso dates don't have commas!
128
            my ( $year, $month, $day ) = Today();
129
            my $shortyear = substr $year, 2, 2;
128
            $value =~ s/YYYY/$year/g;
130
            $value =~ s/YYYY/$year/g;
131
            $value =~ s/YY/$shortyear/g;
129
            $value =~ s/MM/$month/g;
132
            $value =~ s/MM/$month/g;
130
            $value =~ s/DD/$day/g;
133
            $value =~ s/DD/$day/g;
134
            my $username=(C4::Context->userenv?C4::Context->userenv->{'surname'}:"superlibrarian");
135
            $value=~s/USER/$username/g;
136
131
        }
137
        }
132
        
138
        
133
        $subfield_data{visibility} = "display:none;" if (($subfieldlib->{hidden} > 4) || ($subfieldlib->{hidden} < -4));
139
        $subfield_data{visibility} = "display:none;" if (($subfieldlib->{hidden} > 4) || ($subfieldlib->{hidden} < -4));
134
- 

Return to bug 7045