Fix non existing class errors

This commit is contained in:
Thilina Hasantha
2019-09-05 06:32:07 +02:00
parent 91bb1d2d8a
commit 60c92d7935
2 changed files with 9 additions and 6 deletions

View File

@@ -13,7 +13,6 @@ use Classes\BaseService;
use Classes\IceResponse;
use Classes\SubActionManager;
use Dependents\Common\Model\EmployeeDependent;
use Documents\Common\Model\EmployeeDocument;
use EmergencyContacts\Common\Model\EmergencyContact;
use Employees\Common\Model\ArchivedEmployee;
use Employees\Common\Model\Employee;
@@ -115,7 +114,9 @@ class EmployeesActionManager extends SubActionManager
$data->timesheets = $this->getEmployeeData($employee->id, new EmployeeTimeSheet());
$data->timesheetEntries = $this->getEmployeeData($employee->id, new EmployeeTimeEntry());
$data->attendance = $this->getEmployeeData($employee->id, new Attendance());
$data->documents = $this->getEmployeeData($employee->id, new EmployeeDocument());
if (class_exists('\Documents\Common\Model\EmployeeDocument')) {
$data->documents = $this->getEmployeeData($employee->id, new \Documents\Common\Model\EmployeeDocument());
}
$data->travelRecords = $this->getEmployeeData($employee->id, new EmployeeTravelRecord());
$data->qualificationSkills = $this->getEmployeeData($employee->id, new EmployeeSkill());
$data->qualificationEducation = $this->getEmployeeData($employee->id, new EmployeeEducation());

View File

@@ -215,11 +215,13 @@ class TimeSheetsActionManager extends SubActionManager
$data[] = $this->workScheduleToEvent($leave);
}
$holiday = new HoliDay();
$holidays = $holiday->Find("1=1", array());
if (class_exists('\Leaves\Common\Model\HoliDay')) {
$holiday = new HoliDay();
$holidays = $holiday->Find("1=1", array());
foreach ($holidays as $holiday) {
$data[] = $this->holidayToEvent($holiday);
foreach ($holidays as $holiday) {
$data[] = $this->holidayToEvent($holiday);
}
}
echo json_encode($data);