use C4::SMS;
use C4::Debug;
use Koha::DateUtils;
-
use Date::Calc qw( Add_Delta_Days );
use Encode;
use Carp;
}
if ($letter->{content} && $letter->{content} =~ /<<today>>/) {
- my @da = localtime();
- my $todaysdate = "$da[2]:$da[1] " . C4::Dates->today();
+ my $todaysdate = output_pref( DateTime->now() );
$letter->{content} =~ s/<<today>>/$todaysdate/go;
}
while ( my ($field, $val) = each %$values ) {
my $replacetablefield = "<<$table.$field>>";
my $replacefield = "<<$field>>";
- $val =~ s/\p{P}(?=$)//g if $val;
+ $val =~ s/\p{P}$// if $val && $table=~/biblio/;
+ #BZ 9886: Assuming that we want to eliminate ISBD punctuation here
+ #Therefore adding the test on biblio. This includes biblioitems,
+ #but excludes items. Removed unneeded global and lookahead.
+
my $replacedby = defined ($val) ? $val : '';
($letter->{title} ) and do {
$letter->{title} =~ s/$replacetablefield/$replacedby/g;