(bug #4954) allow date expiry modification only on step 0 and 3

This add a verification, to allow automatic modification of expiry date, only if we are on a page that allow modification of expiry date.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Henri-Damien LAURENT 2010-07-07 15:58:59 +02:00 committed by Galen Charlton
parent 17800939e8
commit 5f5d093c5b

View file

@ -278,7 +278,7 @@ if ($op eq 'save' || $op eq 'insert'){
}
}
if ($op eq 'modify' || $op eq 'insert' || $op eq 'save' ){
if ( ($op eq 'modify' || $op eq 'insert' || $op eq 'save') and ($step == 0 or $step == 3 )){
if (exists ($newdata{'dateexpiry'}) && !($newdata{'dateexpiry'})){
my $arg2 = $newdata{'dateenrolled'} || C4::Dates->today('iso');
$newdata{'dateexpiry'} = GetExpiryDate($newdata{'categorycode'},$arg2);