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 |
- |
|
|