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

(-)a/C4/Members.pm (-8 / +5 lines)
Lines 23-29 package C4::Members; Link Here
23
use strict;
23
use strict;
24
#use warnings; FIXME - Bug 2505
24
#use warnings; FIXME - Bug 2505
25
use C4::Context;
25
use C4::Context;
26
use C4::Dates qw(format_date_in_iso format_date);
27
use String::Random qw( random_string );
26
use String::Random qw( random_string );
28
use Date::Calc qw/Today Add_Delta_YM check_date Date_to_Days/;
27
use Date::Calc qw/Today Add_Delta_YM check_date Date_to_Days/;
29
use C4::Log; # logaction
28
use C4::Log; # logaction
Lines 864-875 sub AddMember { Link Here
864
863
865
    # add expiration date if it isn't already there
864
    # add expiration date if it isn't already there
866
    unless ( $data{'dateexpiry'} ) {
865
    unless ( $data{'dateexpiry'} ) {
867
        $data{'dateexpiry'} = GetExpiryDate( $data{'categorycode'}, C4::Dates->new()->output("iso") );
866
        $data{'dateexpiry'} = GetExpiryDate( $data{'categorycode'}, output_pref({ dt=>DateTime->now(), dateformat => 'iso', dateonly=>1 }) );
868
    }
867
    }
869
868
870
    # add enrollment date if it isn't already there
869
    # add enrollment date if it isn't already there
871
    unless ( $data{'dateenrolled'} ) {
870
    unless ( $data{'dateenrolled'} ) {
872
        $data{'dateenrolled'} = C4::Dates->new()->output("iso");
871
        $data{'dateenrolled'} = output_pref({ dt=>DateTime->now(), dateformat => 'iso', dateonly=>1 });
873
    }
872
    }
874
873
875
    my $patron_category =
874
    my $patron_category =
Lines 1965-1972 sub ExtendMemberSubscriptionTo { Link Here
1965
    my $borrower = GetMember('borrowernumber'=>$borrowerid);
1964
    my $borrower = GetMember('borrowernumber'=>$borrowerid);
1966
    unless ($date){
1965
    unless ($date){
1967
      $date = (C4::Context->preference('BorrowerRenewalPeriodBase') eq 'dateexpiry') ?
1966
      $date = (C4::Context->preference('BorrowerRenewalPeriodBase') eq 'dateexpiry') ?
1968
                                        C4::Dates->new($borrower->{'dateexpiry'}, 'iso')->output("iso") :
1967
                                        output_pref({ dt=>dt_from_string( $borrower->{'dateexpiry'} ), dateformat => 'iso', dateonly=>1}) :
1969
                                        C4::Dates->new()->output("iso");
1968
                                        output_pref({ dt=>DateTime->now(), dateformat => 'iso', dateonly=>1 });
1970
      $date = GetExpiryDate( $borrower->{'categorycode'}, $date );
1969
      $date = GetExpiryDate( $borrower->{'categorycode'}, $date );
1971
    }
1970
    }
1972
    my $sth = $dbh->do(<<EOF);
1971
    my $sth = $dbh->do(<<EOF);
Lines 2357-2364 sub GetMessages { Link Here
2357
    my @results;
2356
    my @results;
2358
2357
2359
    while ( my $data = $sth->fetchrow_hashref ) {
2358
    while ( my $data = $sth->fetchrow_hashref ) {
2360
        my $d = C4::Dates->new( $data->{message_date}, 'iso' );
2359
        $data->{message_date_formatted} = output_pref({ dt=>dt_from_string( $data->{message_date} ), dateformat => 'iso', dateonly=>1 });
2361
        $data->{message_date_formatted} = $d->output;
2362
        push @results, $data;
2360
        push @results, $data;
2363
    }
2361
    }
2364
    return \@results;
2362
    return \@results;
2365
- 

Return to bug 13813