*/ if ($id != '') { Debug::Text(' ID was passed: ' . $id, __FILE__, __LINE__, __METHOD__, 10); $udtlf = TTnew('UserDateTotalListFactory'); $udtlf->getById($id); foreach ($udtlf as $udt_obj) { //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10); $user_id = $udt_obj->getUserDateObject()->getUser(); $udt_data = array('id' => $udt_obj->getId(), 'user_date_id' => $udt_obj->getUserDateId(), 'date_stamp' => $udt_obj->getUserDateObject()->getDateStamp(), 'user_id' => $udt_obj->getUserDateObject()->getUser(), 'user_full_name' => $udt_obj->getUserDateObject()->getUserObject()->getFullName(), 'status_id' => $udt_obj->getStatus(), 'type_id' => $udt_obj->getType(), 'total_time' => $udt_obj->getTotalTime(), 'absence_policy_id' => $udt_obj->getAbsencePolicyID(), 'branch_id' => $udt_obj->getBranch(), 'department_id' => $udt_obj->getDepartment(), 'job_id' => $udt_obj->getJob(), 'job_item_id' => $udt_obj->getJobItem(), 'override' => $udt_obj->getOverride(), 'created_date' => $udt_obj->getCreatedDate(), 'created_by' => $udt_obj->getCreatedBy(), 'updated_date' => $udt_obj->getUpdatedDate(), 'updated_by' => $udt_obj->getUpdatedBy(), 'deleted_date' => $udt_obj->getDeletedDate(), 'deleted_by' => $udt_obj->getDeletedBy()); } } elseif ($action != 'submit') { Debug::Text(' ID was NOT passed: ' . $id, __FILE__, __LINE__, __METHOD__, 10); //Get user full name $ulf = TTnew('UserListFactory'); $user_obj = $ulf->getById($user_id)->getCurrent(); $user_date_id = UserDateFactory::getUserDateID($user_id, $date_stamp); $udt_data = array('user_id' => $user_id, 'date_stamp' => $date_stamp, 'user_date_id' => $user_date_id, 'user_full_name' => $user_obj->getFullName(), 'branch_id' => $user_obj->getDefaultBranch(), 'department_id' => $user_obj->getDefaultDepartment(), 'total_time' => 0, 'override' => TRUE); } $aplf = TTnew('AbsencePolicyListFactory'); $absence_policy_options = Misc::prependArray(array(0 => TTi18n::gettext('-- Please Choose --')), $aplf->getByCompanyIdArray($current_company->getId())); $blf = TTnew('BranchListFactory'); $branch_options = $blf->getByCompanyIdArray($current_company->getId()); $dlf = TTnew('DepartmentListFactory'); $department_options = $dlf->getByCompanyIdArray($current_company->getId()); if ($current_company->getProductEdition() >= 20) { $jlf = TTnew('JobListFactory'); $jlf->getByCompanyIdAndUserIdAndStatus($current_company->getId(), $user_id, array(10, 20, 30, 40)); $udt_data['job_options'] = $jlf->getArrayByListFactory($jlf, TRUE, TRUE); $udt_data['job_manual_id_options'] = $jlf->getManualIDArrayByListFactory($jlf, TRUE); $jilf = TTnew('JobItemListFactory'); $jilf->getByCompanyId($current_company->getId());