Esempio n. 1
0
 $filter_data['src_department_options'] = Misc::arrayDiffByKey((array) $filter_data['department_ids'], $department_options);
 $filter_data['selected_department_options'] = Misc::arrayIntersectByKey((array) $filter_data['department_ids'], $department_options);
 $filter_data['src_punch_branch_options'] = Misc::arrayDiffByKey((array) $filter_data['punch_branch_ids'], $branch_options);
 $filter_data['selected_punch_branch_options'] = Misc::arrayIntersectByKey((array) $filter_data['punch_branch_ids'], $branch_options);
 $filter_data['src_punch_department_options'] = Misc::arrayDiffByKey((array) $filter_data['punch_department_ids'], $department_options);
 $filter_data['selected_punch_department_options'] = Misc::arrayIntersectByKey((array) $filter_data['punch_department_ids'], $department_options);
 //Get employee titles
 $utlf = new UserTitleListFactory();
 $utlf->getByCompanyId($current_company->getId());
 $user_title_options = Misc::prependArray($all_array_option, $utlf->getArrayByListFactory($utlf, FALSE, TRUE));
 $filter_data['src_user_title_options'] = Misc::arrayDiffByKey((array) $filter_data['user_title_ids'], $user_title_options);
 $filter_data['selected_user_title_options'] = Misc::arrayIntersectByKey((array) $filter_data['user_title_ids'], $user_title_options);
 if ($current_company->getProductEdition() == 20) {
     $jlf = new JobListFactory();
     //Get include job list.
     $jlf->getByCompanyId($current_company->getId());
     $job_options = Misc::prependArray(array('0' => TTi18n::gettext('- No Job -')), $jlf->getArrayByListFactory($jlf, FALSE, TRUE));
     $filter_data['job_manual_id_options'] = $jlf->getManualIDArrayByListFactory($jlf, TRUE);
     $filter_data['src_include_job_options'] = Misc::arrayDiffByKey((array) $filter_data['include_job_ids'], $job_options);
     $filter_data['selected_include_job_options'] = Misc::arrayIntersectByKey((array) $filter_data['include_job_ids'], $job_options);
     //Get exclude job list
     $exclude_job_options = Misc::prependArray($all_array_option, $jlf->getArrayByListFactory($jlf, FALSE, TRUE));
     $filter_data['src_exclude_job_options'] = Misc::arrayDiffByKey((array) $filter_data['exclude_job_ids'], $job_options);
     $filter_data['selected_exclude_job_options'] = Misc::arrayIntersectByKey((array) $filter_data['exclude_job_ids'], $job_options);
     //Get Job Groups
     $jglf = new JobGroupListFactory();
     $nodes = FastTree::FormatArray($jglf->getByCompanyIdArray($current_company->getId()), 'TEXT', TRUE);
     $job_group_options = Misc::prependArray($all_array_option, $jglf->getArrayByNodes($nodes, FALSE, TRUE));
     $filter_data['src_job_group_options'] = Misc::arrayDiffByKey((array) $filter_data['job_group_ids'], $job_group_options);
     $filter_data['selected_job_group_options'] = Misc::arrayIntersectByKey((array) $filter_data['job_group_ids'], $job_group_options);
     //Get Job Items
Esempio n. 2
0
     $blf = new BranchListFactory();
     $blf->getByCompanyId($u_obj->getCompany());
     $branch_options = $blf->getArrayByListFactory($blf, FALSE, TRUE);
     unset($blf);
 }
 if (!isset($department_options)) {
     //Get departments
     $dlf = new DepartmentListFactory();
     $dlf->getByCompanyId($u_obj->getCompany());
     $department_options = $dlf->getArrayByListFactory($dlf, FALSE, TRUE);
     unset($dlf);
 }
 if (getTTProductEdition() == TT_PRODUCT_PROFESSIONAL and !isset($job_options)) {
     //Get jobs
     $jlf = new JobListFactory();
     $jlf->getByCompanyId($u_obj->getCompany());
     $job_options = $jlf->getArrayByListFactory($jlf, FALSE, TRUE);
     unset($jlf);
 }
 if (getTTProductEdition() == TT_PRODUCT_PROFESSIONAL and !isset($job_item_options)) {
     //Get tasks
     $jilf = new JobItemListFactory();
     $jilf->getByCompanyId($u_obj->getCompany());
     $job_item_options = $jilf->getArrayByListFactory($jilf, FALSE, TRUE);
     unset($jilf);
 }
 if (isset($mapped_row['time_stamp']) and $mapped_row['time_stamp'] != '') {
     $time_stamp_epoch = Misc::importCallInputParseFunction('time_stamp', $mapped_row['time_stamp'], $filtered_import_map['time_stamp']['default_value'], $filtered_import_map['time_stamp']['parse_hint']);
 } else {
     if (isset($mapped_row['start_time_stamp']) and $mapped_row['start_time_stamp'] != '') {
         $time_stamp_epoch = Misc::importCallInputParseFunction('time_stamp', $mapped_row['start_time_stamp'], $filtered_import_map['start_time_stamp']['default_value'], $filtered_import_map['start_time_stamp']['parse_hint']);