Skip to content

Commit

Permalink
[#81005450] Edit links from patron details page update expiration dat…
Browse files Browse the repository at this point in the history
…e SC 48998

Restricted the potential auto calculation of expiration date to only the "Edit"
linked pages that display this field.
  • Loading branch information
dlbptfs authored and ctfliblime committed Jan 16, 2015
1 parent 44f3ea7 commit 085a7d3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cgi/members/memberentry.pl
Expand Up @@ -190,14 +190,16 @@ BEGIN
# If dateexpiry was blank - set it to default value, with
# format specified per $syspref for Koha variable "dateformat".
$newdata{'categorycode'} = $categorycode;
if (! defined $newdata{'dateexpiry'} or ! $newdata{'dateexpiry'}) {
my $denr = $newdata{'dateenrolled'} // C4::Dates->today('iso');
if (($step == 0) || ($step == 3)) { # Pages that can edit dateexpiry
if (! defined $newdata{'dateexpiry'} or ! $newdata{'dateexpiry'}) {
my $denr = $newdata{'dateenrolled'} // C4::Dates->today('iso');

if ($denr =~ /$syspref/) {
# if match syspref format, then convert to ISO
$denr = format_date_in_iso($denr);
if ($denr =~ /$syspref/) {
# if match syspref format, then convert to ISO
$denr = format_date_in_iso($denr);
}
$newdata{dateexpiry} = GetExpiryDate($newdata{categorycode}, $denr);
}
$newdata{dateexpiry} = GetExpiryDate($newdata{categorycode}, $denr);
}
foreach (qw(dateenrolled dateexpiry dateofbirth)) {
my $userdate = $newdata{$_} or next;
Expand Down

0 comments on commit 085a7d3

Please sign in to comment.