Ejemplo n.º 1
0
                }
                unset($time_stamp, $plf);
            }
        }
        $blf = new BranchListFactory();
        $branch_options = $blf->getByCompanyIdArray($current_company->getId());
        $dlf = new DepartmentListFactory();
        $department_options = $dlf->getByCompanyIdArray($current_company->getId());
        if ($current_company->getProductEdition() == 20) {
            $jlf = new JobListFactory();
            $jlf->getByCompanyIdAndUserIdAndStatus($current_company->getId(), $pc_data['user_id'], array(10, 20, 30, 40));
            $pc_data['job_options'] = $jlf->getArrayByListFactory($jlf, TRUE, TRUE);
            $pc_data['job_manual_id_options'] = $jlf->getManualIDArrayByListFactory($jlf, TRUE);
            $jilf = new JobItemListFactory();
            $jilf->getByCompanyId($current_company->getId());
            $pc_data['job_item_options'] = $jilf->getArrayByListFactory($jilf, TRUE, TRUE);
            $pc_data['job_item_manual_id_options'] = $jilf->getManualIdArrayByListFactory($jilf, TRUE);
        }
        //Select box options;
        $pc_data['status_options'] = $pf->getOptions('status');
        $pc_data['type_options'] = $pf->getOptions('type');
        $pc_data['branch_options'] = $branch_options;
        $pc_data['department_options'] = $department_options;
        //Get other field names
        $oflf = new OtherFieldListFactory();
        $pc_data['other_field_names'] = $oflf->getByCompanyIdAndTypeIdArray($current_company->getId(), 15);
        //Debug::Text('pc_data[date_stamp]: '. TTDate::getDate('DATE+TIME', $pc_data['date_stamp']), __FILE__, __LINE__, __METHOD__,10);
        $smarty->assign_by_ref('pc_data', $pc_data);
        break;
}
$smarty->assign_by_ref('pcf', $pcf);
Ejemplo n.º 2
0
     $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
     $jilf = new JobItemListFactory();
     $jilf->getByCompanyId($current_company->getId());
     $job_item_options = Misc::prependArray(array('-1' => TTi18n::gettext('-- All --'), '0' => TTi18n::gettext('- No Task -')), $jilf->getArrayByListFactory($jilf, FALSE, TRUE));
     $filter_data['src_job_item_options'] = Misc::arrayDiffByKey((array) $filter_data['job_item_ids'], $job_item_options);
     $filter_data['selected_job_item_options'] = Misc::arrayIntersectByKey((array) $filter_data['job_item_ids'], $job_item_options);
 }
 //Get column list
 $filter_data['src_column_options'] = Misc::arrayDiffByKey((array) $filter_data['column_ids'], $columns);
 $filter_data['selected_column_options'] = Misc::arrayIntersectByKey((array) $filter_data['column_ids'], $columns);
 //$filter_data['refresh_options'] = array( 0 => TTi18n::gettext('- Disabled -'), 60 => TTi18n::gettext('1 minute'), 300 => TTi18n::gettext('5 minutes'), 600 => TTi18n::gettext('10 minutes'), 1800 => TTi18n::gettext('30 minutes'), 3600 => TTi18n::gettext('60 minutes') );
 //Get primary/secondary order list
 $filter_data['sort_options'] = $columns;
 $filter_data['sort_options']['effective_date_order'] = 'Wage Effective Date';
 unset($filter_data['sort_options']['effective_date']);
 $filter_data['sort_direction_options'] = Misc::getSortDirectionArray();
 $saved_report_options = $ugdlf->getByUserIdAndScriptArray($current_user->getId(), $_SERVER['SCRIPT_NAME']);
 $generic_data['saved_report_options'] = $saved_report_options;
 $smarty->assign_by_ref('generic_data', $generic_data);
Ejemplo n.º 3
0
 function getJobItemOptions($job_id, $include_disabled = TRUE)
 {
     //Don't check for current company as this needs to work when we are not fully authenticated.
     /*
     global $current_company;
     
     if ( !is_object($current_company) ) {
     	return FALSE;
     }
     */
     Debug::text('Job ID: ' . $job_id . ' Include Disabled: ' . (int) $include_disabled, __FILE__, __LINE__, __METHOD__, 10);
     $jilf = new JobItemListFactory();
     //$jilf->getByCompanyIdAndJobId( $current_company->getId(), $job_id );
     $jilf->getByJobId($job_id);
     $job_item_options = $jilf->getArrayByListFactory($jilf, TRUE, $include_disabled);
     if ($job_item_options != FALSE and is_array($job_item_options)) {
         return $job_item_options;
     }
     Debug::text('Returning FALSE!', __FILE__, __LINE__, __METHOD__, 10);
     $retarr = array('00' => '--');
     return $retarr;
 }
Ejemplo n.º 4
0
     $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']);
     } else {
         $time_stamp_epoch = NULL;
     }
 }
 echo "  Time Stamp: {$i}. " . TTDate::getDate('DATE+TIME', $time_stamp_epoch) . " (" . $time_stamp_epoch . ")\n";
 $status_id = Misc::importCallInputParseFunction('status_id', $mapped_row['status_id'], $filtered_import_map['status_id']['default_value'], $filtered_import_map['status_id']['parse_hint']);
 if (!isset($mapped_row['time_stamp']) or $mapped_row['time_stamp'] == '') {
     //Two punches per row
Ejemplo n.º 5
0
 }
 $data = Misc::preSetArrayValues($data, array('branch_ids', 'department_ids', 'group_ids', 'include_user_ids', 'exclude_user_ids'), NULL);
 //Select box options;
 $data['status_options'] = $sf->getOptions('status');
 $data['type_options'] = $sf->getOptions('type');
 $data['poll_frequency_options'] = $sf->getOptions('poll_frequency');
 $data['push_frequency_options'] = $sf->getOptions('push_frequency');
 $data['time_clock_command_options'] = $sf->getOptions('time_clock_command');
 $data['mode_flag_options'] = $sf->getOptions('mode_flag');
 if ($current_company->getProductEdition() == 20) {
     $jlf = new JobListFactory();
     $jlf->getByCompanyId($current_company->getId());
     $data['job_options'] = Misc::prependArray(array(0 => '-- None --'), $jlf->getArrayByListFactory($jlf, FALSE, TRUE));
     $jilf = new JobItemListFactory();
     $jilf->getByCompanyIdAndStatus($current_company->getId(), 10);
     $data['job_item_options'] = Misc::prependArray(array(0 => '-- None --'), $jilf->getArrayByListFactory($jilf, TRUE, FALSE));
 }
 //Get branches
 $blf = new BranchListFactory();
 $blf->getByCompanyId($current_company->getId());
 $branch_options = $blf->getArrayByListFactory($blf, FALSE, TRUE);
 $data['src_branch_options'] = Misc::arrayDiffByKey((array) $data['branch_ids'], $branch_options);
 $data['selected_branch_options'] = Misc::arrayIntersectByKey((array) $data['branch_ids'], $branch_options);
 //Get departments
 $dlf = new DepartmentListFactory();
 $dlf->getByCompanyId($current_company->getId());
 $department_options = $dlf->getArrayByListFactory($dlf, FALSE, TRUE);
 $data['src_department_options'] = Misc::arrayDiffByKey((array) $data['department_ids'], $department_options);
 $data['selected_department_options'] = Misc::arrayIntersectByKey((array) $data['department_ids'], $department_options);
 $uglf = new UserGroupListFactory();
 $group_options = $uglf->getArrayByNodes(FastTree::FormatArray($uglf->getByCompanyIdArray($current_company->getId()), 'TEXT', TRUE));