Skip to content

Commit

Permalink
on call should not be considered for tm cronjob
Browse files Browse the repository at this point in the history
  • Loading branch information
go-faustino committed Mar 19, 2018
1 parent 9a0b2e7 commit 1a540ab
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions application/modules/timemanagement/models/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function checkweekdaysdatacron($hidstartweek_date,$hidendweek_date,$hidem
$weekDatesArray = sapp_Global::createDateRangeArray($hidstartweek_date,$hidendweek_date); //echo '<pre>';print_r($weekDatesArray);
//End

$submittedtsdates = $holDates = $weekendDates = $leaveDates = $oncallDates = array();
$submittedtsdates = $holDates = $weekendDates = $leaveDates = array();

$startdateObj = DateTime::createFromFormat("Y-m-d", $hidstartweek_date);

Expand Down Expand Up @@ -219,19 +219,6 @@ public function checkweekdaysdatacron($hidstartweek_date,$hidendweek_date,$hidem
}
//End

//To get On call applied by user for the given duration
$empOncalls = $this->getEmpOncalls($hidemp,$hidstartweek_date,$hidendweek_date);
if(!empty($empOncalls)){
$emponcallDatesArray = array();
foreach($empOncalls as $empOncallRow){
if($empOncallRow['oncallday'] == 1){
$oncallDatesArray = sapp_Global::createDateRangeArray($empOncallRow['from_date'],$empOncallRow['to_date']);
}
$emponcallDatesArray = array_merge($emponcallDatesArray,$oncallDatesArray);
}
}
//End

//To get default not working days(saturday and sunday)
if($emp_dept_id !='' && $emp_dept_id != NULL){
$weekendDetailsArr = $this->getWeekend($hidstartweek_date, $hidendweek_date, $emp_dept_id);
Expand All @@ -258,15 +245,6 @@ public function checkweekdaysdatacron($hidstartweek_date,$hidendweek_date,$hidem
}
}
}
if(isset($emponcallDatesArray) && count($emponcallDatesArray)> 0 )
{
foreach($emponcallDatesArray as $emponcallDate)
{
if(in_array($emponcallDate,$weekDatesArray)){
$oncallDates[] = $emponcallDate;
}
}
}
if(isset($weekendDetailsArr) && count($weekendDetailsArr)> 0 )
{
foreach($weekendDetailsArr as $weekendDate)
Expand All @@ -278,7 +256,7 @@ public function checkweekdaysdatacron($hidstartweek_date,$hidendweek_date,$hidem
}

$totalDaysArray = array();
$totalDaysArray = array_merge($submittedtsdates,$holDates,$leaveDates,$oncallDates,$weekendDates);
$totalDaysArray = array_merge($submittedtsdates,$holDates,$leaveDates,$weekendDates);
//print_r($totalDaysArray);

$emptyDataDatesArray = array();
Expand Down

0 comments on commit 1a540ab

Please sign in to comment.