Markup tweak for login; Link correction for facets.
[koha_fer] / C4 / Dates.pm
index f45fd79..061cc98 100644 (file)
@@ -18,10 +18,12 @@ use strict;
 use warnings;
 use Carp;
 use C4::Context;
+use C4::Debug;
 use Exporter;
 use POSIX qw(strftime);
 use Date::Calc qw(check_date check_time);
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($debug $cgi_debug);
 
 BEGIN {
        $VERSION = 0.03;
@@ -30,7 +32,8 @@ BEGIN {
 }
 
 my $prefformat = C4::Context->preference('dateformat');
-my $debug = $ENV{'DEBUG'} || 0;
+# print STDERR " Dates :      \$debug is '$debug'\n";
+# print STDERR " Dates :  \$cgi_debug is '$cgi_debug'\n";
 
 our %format_map = ( 
          iso  => 'yyyy-mm-dd',
@@ -77,7 +80,7 @@ sub dmy_map ($$) {
                return  @{$aref}; 
        }
        # $debug and 
-       carp "Illegal Date '$val' does not match '$dformat' format: " . $self->visual() . "\n";
+       carp "Illegal Date '$val' does not match '$dformat' format: " . $self->visual();
        return 0;
 }
 
@@ -85,11 +88,11 @@ sub _check_date_and_time {
     my $chron_ref = shift;
     my ($year, $month, $day) = _chron_to_ymd($chron_ref);
     unless (check_date($year, $month, $day)) {
-        carp "Illegal date specified (year = $year, month = $month, day = $day)\n";
+        carp "Illegal date specified (year = $year, month = $month, day = $day)";
     }
     my ($hour, $minute, $second) = _chron_to_hms($chron_ref);
     unless (check_time($hour, $minute, $second)) {
-        carp "Illegal time specified (hour = $hour, minute = $minute, second = $second)\n";
+        carp "Illegal time specified (hour = $hour, minute = $minute, second = $second)";
     }
 }