Lines 36-41
use C4::ClassSource;
Link Here
|
36 |
use C4::ImportBatch; |
36 |
use C4::ImportBatch; |
37 |
use C4::Charset; |
37 |
use C4::Charset; |
38 |
use Koha::BiblioFrameworks; |
38 |
use Koha::BiblioFrameworks; |
|
|
39 |
use Koha::DateUtils; |
39 |
|
40 |
|
40 |
use Date::Calc qw(Today); |
41 |
use Date::Calc qw(Today); |
41 |
use MARC::File::USMARC; |
42 |
use MARC::File::USMARC; |
Lines 294-308
sub create_input {
Link Here
|
294 |
if ( $value eq '' ) { |
295 |
if ( $value eq '' ) { |
295 |
$value = $tagslib->{$tag}->{$subfield}->{defaultvalue}; |
296 |
$value = $tagslib->{$tag}->{$subfield}->{defaultvalue}; |
296 |
|
297 |
|
297 |
# get today date & replace YYYY, MM, DD if provided in the default value |
298 |
# get today date & replace <<YYYY>>, <<MM>>, <<DD>> if provided in the default value |
298 |
my ( $year, $month, $day ) = Today(); |
299 |
my $today_dt = dt_from_string; |
299 |
$month = sprintf( "%02d", $month ); |
300 |
my $year = $today_dt->year; |
300 |
$day = sprintf( "%02d", $day ); |
301 |
my $month = $today_dt->month; |
301 |
$value =~ s/YYYY/$year/g; |
302 |
my $day = $today_dt->day; |
302 |
$value =~ s/MM/$month/g; |
303 |
$value =~ s/<<YYYY>>/$year/g; |
303 |
$value =~ s/DD/$day/g; |
304 |
$value =~ s/<<MM>>/$month/g; |
304 |
my $username=(C4::Context->userenv?C4::Context->userenv->{'surname'}:"superlibrarian"); |
305 |
$value =~ s/<<DD>>/$day/g; |
305 |
$value=~s/user/$username/g; |
306 |
# And <<USER>> with surname (?) |
|
|
307 |
my $username=(C4::Context->userenv?C4::Context->userenv->{'surname'}:"superlibrarian"); |
308 |
$value=~s/<<USER>>/$username/g; |
306 |
|
309 |
|
307 |
} |
310 |
} |
308 |
my $dbh = C4::Context->dbh; |
311 |
my $dbh = C4::Context->dbh; |