Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple leave request approval bug #301

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1066,10 +1066,12 @@ public function updateleavedetailsAction()
$message = '<div>Hi,</div><div>The below leave(s) has been cancelled.</div>';
}elseif(sapp_Global::_decrypt($status)=='Approved'){
$leavestatus =2;
if(!empty($leavetypeArr)) {
if($leavetypeArr[0]['leavepredeductable'] == 1) {
$updateemployeeleave = $leaverequestmodel->updateemployeeleaves($leave_details['appliedleavescount'],$leave_details['user_id']);
}
if($leave_details['leavestatus']!='Approved') {
if(!empty($leavetypeArr)) {
if($leavetypeArr[0]['leavepredeductable'] == 1) {
$updateemployeeleave = $leaverequestmodel->updateemployeeleaves($leave_details['appliedleavescount'],$leave_details['user_id']);
}
}
}
$successmsg ='Leave request approved succesfully.';
$subject = 'Leave request approved';
Expand Down
6 changes: 3 additions & 3 deletions application/modules/default/forms/empleaves.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ public function init()


$emp_leave_limit = new Zend_Form_Element_Text('leave_limit');
$emp_leave_limit->setAttrib('maxLength', 3);
$emp_leave_limit->setAttrib('maxLength', 4);
$emp_leave_limit->addFilter(new Zend_Filter_StringTrim());
$emp_leave_limit->setRequired(true);
$emp_leave_limit->addValidator('NotEmpty', false, array('messages' => 'Please enter leave limit for current year.'));

$emp_leave_limit->addValidator("regex",true,array(

'pattern'=>'/^(\-?[1-9]|\-?[1-9][0-9])$/',
'pattern'=>'/^((\-?[0-9]|\-?[1-9][0-9])\.?[5]?)$/',

'messages'=>array(
'regexNotMatch'=>'Leave limit must be in the range of 0 to 100.'
Expand Down Expand Up @@ -71,4 +71,4 @@ public function init()
$this->setElementDecorators(array('ViewHelper'));

}
}
}