本文整理汇总了PHP中Misc::prependArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Misc::prependArray方法的具体用法?PHP Misc::prependArray怎么用?PHP Misc::prependArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Misc
的用法示例。
在下文中一共展示了Misc::prependArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOptions
static function getOptions($name, $interval = 1)
{
$all_array_option = array('*' => TTi18n::getText('-- All --'));
$retval = FALSE;
switch ($name) {
case 'minute':
for ($i = 0; $i <= 59; $i += $interval) {
$retval[$i] = $i;
}
$retval = Misc::prependArray($all_array_option, $retval);
break;
case 'hour':
for ($i = 0; $i <= 23; $i += $interval) {
$retval[$i] = $i;
}
$retval = Misc::prependArray($all_array_option, $retval);
break;
case 'day_of_month':
$retval = Misc::prependArray($all_array_option, TTDate::getDayOfMonthArray());
break;
case 'month':
$retval = Misc::prependArray($all_array_option, TTDate::getMonthOfYearArray());
break;
case 'day_of_week':
$retval = Misc::prependArray($all_array_option, TTDate::getDayOfWeekArray());
break;
}
return $retval;
}
示例2: _getFactoryOptions
function _getFactoryOptions($name, $parent = NULL)
{
$retval = NULL;
switch ($name) {
case 'columns':
$retval = array('-1100-type' => TTi18n::gettext('Type'), '-1110-status' => TTi18n::gettext('Status'), '-1210-time_stamp' => TTi18n::gettext('Date/Time'), '-1220-date' => TTi18n::gettext('Date'), '-1230-time' => TTi18n::gettext('Time'), '-1239-in_type' => TTi18n::gettext('In Type'), '-1240-in_time_stamp' => TTi18n::gettext('In Date/Time'), '-1250-in_punch_date' => TTi18n::gettext('In Date'), '-1260-in_punch_time' => TTi18n::gettext('In Time'), '-1269-out_type' => TTi18n::gettext('Out Type'), '-1270-out_time_stamp' => TTi18n::gettext('Out Date/Time'), '-1280-out_punch_date' => TTi18n::gettext('Out Date'), '-1290-out_punch_time' => TTi18n::gettext('Out Time'), '-1310-branch' => TTi18n::gettext('Branch'), '-1320-department' => TTi18n::gettext('Department'), '-1410-station_id' => TTi18n::gettext('Station ID'), '-1420-longitude' => TTi18n::gettext('Longitude'), '-1430-latitude' => TTi18n::gettext('Latitude'), '-1500-note' => TTi18n::gettext('Note'));
//Since getOptions() can be called without first setting a company, we don't always know the product edition for the currently
//logged in employee.
if (is_object($this->getCompanyObject()) and $this->getCompanyObject()->getProductEdition() >= TT_PRODUCT_CORPORATE or !is_object($this->getCompanyObject()) and getTTProductEdition() >= TT_PRODUCT_CORPORATE) {
$retval += array('-1330-job' => TTi18n::gettext('Job'), '-1340-job_item' => TTi18n::gettext('Task'), '-1350-quantity' => TTi18n::gettext('Quantity'), '-1360-bad_quantity' => TTi18n::gettext('Bad Quantity'));
}
$retval = Misc::addSortPrefix(Misc::prependArray($this->getUserIdentificationColumns(), Misc::trimSortPrefix($retval)));
ksort($retval);
break;
case 'column_aliases':
//Used for converting column names after they have been parsed.
$retval = array('type' => 'type_id', 'status' => 'status_id', 'branch' => 'branch_id', 'department' => 'department_id', 'job' => 'job_id', 'job_item' => 'job_item_id');
break;
case 'import_options':
$retval = array('-1010-fuzzy_match' => TTi18n::getText('Enable smart matching.'), '-1020-disable_rounding' => TTi18n::getText('Disable rounding.'));
break;
case 'parse_hint':
$upf = TTnew('UserPreferenceFactory');
$retval = array('branch' => array('-1010-name' => TTi18n::gettext('Name'), '-1010-manual_id' => TTi18n::gettext('Code')), 'department' => array('-1010-name' => TTi18n::gettext('Name'), '-1010-manual_id' => TTi18n::gettext('Code')), 'job' => array('-1010-name' => TTi18n::gettext('Name'), '-1010-manual_id' => TTi18n::gettext('Code')), 'job_item' => array('-1010-name' => TTi18n::gettext('Name'), '-1010-manual_id' => TTi18n::gettext('Code')), 'time_stamp' => $upf->getOptions('date_time_format'), 'in_time_stamp' => $upf->getOptions('date_time_format'), 'out_time_stamp' => $upf->getOptions('date_time_format'), 'date' => $upf->getOptions('date_format'), 'in_punch_date' => $upf->getOptions('date_format'), 'out_punch_date' => $upf->getOptions('date_format'), 'time' => $upf->getOptions('time_format'), 'in_punch_time' => $upf->getOptions('time_format'), 'out_punch_time' => $upf->getOptions('time_format'));
break;
}
return $retval;
}
示例3: _getFactoryOptions
function _getFactoryOptions($name, $parent = NULL)
{
$retval = NULL;
switch ($name) {
case 'columns':
$uwf = TTNew('UserWageFactory');
$retval = Misc::prependArray($this->getUserIdentificationColumns(), Misc::arrayIntersectByKey(array('wage_group', 'type', 'wage', 'effective_date', 'hourly_rate', 'labor_burden_percent', 'weekly_time', 'note'), Misc::trimSortPrefix($uwf->getOptions('columns'))));
break;
case 'column_aliases':
//Used for converting column names after they have been parsed.
$retval = array('type' => 'type_id', 'wage_group' => 'wage_group_id');
break;
case 'import_options':
$retval = array('-1010-fuzzy_match' => TTi18n::getText('Enable smart matching.'));
break;
case 'parse_hint':
case 'parse_hint':
$upf = TTnew('UserPreferenceFactory');
$retval = array('effective_date' => $upf->getOptions('date_format'), 'weekly_time' => $upf->getOptions('time_unit_format'));
break;
}
return $retval;
}
示例4: _getFactoryOptions
function _getFactoryOptions($name, $parent = NULL)
{
$retval = NULL;
switch ($name) {
case 'columns':
$baf = TTNew('BankAccountFactory');
$retval = Misc::prependArray($this->getUserIdentificationColumns(), Misc::arrayIntersectByKey(array('transit', 'institution', 'account'), Misc::trimSortPrefix($baf->getOptions('columns'))));
break;
case 'column_aliases':
//Used for converting column names after they have been parsed.
$retval = array();
break;
case 'import_options':
$retval = array('-1010-fuzzy_match' => TTi18n::getText('Enable smart matching.'));
break;
case 'parse_hint':
case 'parse_hint':
//$upf = TTnew('UserPreferenceFactory');
$retval = array();
break;
}
return $retval;
}
示例5: _getFactoryOptions
function _getFactoryOptions($name, $parent = NULL)
{
$retval = NULL;
switch ($name) {
case 'columns':
$psaf = TTNew('PayStubAmendmentFactory');
$retval = Misc::prependArray($this->getUserIdentificationColumns(), Misc::arrayIntersectByKey(array('status', 'type', 'pay_stub_entry_name', 'effective_date', 'amount', 'rate', 'units', 'description', 'ytd_adjustment'), Misc::trimSortPrefix($psaf->getOptions('columns'))));
break;
case 'column_aliases':
//Used for converting column names after they have been parsed.
$retval = array('status' => 'status_id', 'type' => 'type_id', 'pay_stub_entry_name' => 'pay_stub_entry_name_id');
break;
case 'import_options':
$retval = array('-1010-fuzzy_match' => TTi18n::getText('Enable smart matching.'));
break;
case 'parse_hint':
case 'parse_hint':
$upf = TTnew('UserPreferenceFactory');
$retval = array('effective_date' => $upf->getOptions('date_format'));
break;
}
return $retval;
}
示例6: _getFactoryOptions
function _getFactoryOptions($name, $parent = NULL)
{
$retval = NULL;
switch ($name) {
case 'columns':
$apf = TTNew('AccrualFactory');
$retval = Misc::prependArray($this->getUserIdentificationColumns(), Misc::arrayIntersectByKey(array('accrual_policy', 'type', 'amount', 'date_stamp'), Misc::trimSortPrefix($apf->getOptions('columns'))));
break;
case 'column_aliases':
//Used for converting column names after they have been parsed.
$retval = array('type' => 'type_id', 'accrual_policy' => 'accrual_policy_id');
break;
case 'import_options':
$retval = array('-1010-fuzzy_match' => TTi18n::getText('Enable smart matching.'));
break;
case 'parse_hint':
case 'parse_hint':
$upf = TTnew('UserPreferenceFactory');
$retval = array('date_stamp' => $upf->getOptions('date_format'), 'amount' => $upf->getOptions('time_unit_format'));
break;
}
return $retval;
}
示例7: JobGroupListFactory
$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);
示例8: getAPISearchByCompanyIdAndArrayCriteria
/**
* Return user records based on advanced filter criteria.
*
* @param int $company_id Company ID
* @param array $filter_data Filter criteria in array('id' => array(1,2), 'last_name' => 'smith' ) format, with possible top level array keys as follows: id, exclude_id, status_id, user_group_id, default_branch_id, default_department_id, title_id, currency_id, permission_control_id, pay_period_schedule_id, policy_group_id, sex_id, first_name, last_name, home_phone, work_phone, country, province, city, address1, address2, postal_code, employee_number, user_name, sin, work_email, home_email, tag, last_login_date, created_by, created_date, updated_by, updated_date
* @param int $limit Optional. Restrict the number of records returned
* @param int $page Optional. Specify the page of records to return
* @param array $where Optional. Additional WHERE clauses in array( 'column' => 'value', 'column' => 'value' ) format.
* @param array $order Optional. Sort order in array( 'column' => ASC, 'column2' => DESC ) format.
*
* @return object $this
*/
function getAPISearchByCompanyIdAndArrayCriteria($company_id, $filter_data, $limit = NULL, $page = NULL, $where = NULL, $order = NULL)
{
if ($company_id == '') {
return FALSE;
}
if (!is_array($order)) {
//Use Filter Data ordering if its set.
if (isset($filter_data['sort_column']) and $filter_data['sort_order']) {
$order = array(Misc::trimSortPrefix($filter_data['sort_column']) => $filter_data['sort_order']);
}
}
if (isset($filter_data['user_status_id'])) {
$filter_data['status_id'] = $filter_data['user_status_id'];
}
if (isset($filter_data['include_user_id'])) {
$filter_data['id'] = $filter_data['include_user_id'];
}
if (isset($filter_data['exclude_user_id'])) {
$filter_data['exclude_id'] = $filter_data['exclude_user_id'];
}
//Some of these are passed from Flex Schedule view.
if (isset($filter_data['default_branch_ids'])) {
$filter_data['default_branch_id'] = $filter_data['default_branch_ids'];
}
if (isset($filter_data['default_department_ids'])) {
$filter_data['default_department_id'] = $filter_data['default_department_ids'];
}
if (isset($filter_data['group_id'])) {
$filter_data['user_group_id'] = $filter_data['group_id'];
}
if (isset($filter_data['user_title_id'])) {
$filter_data['title_id'] = $filter_data['user_title_id'];
}
if (isset($filter_data['user_tag'])) {
$filter_data['tag'] = $filter_data['user_tag'];
}
//$additional_order_fields = array('b.name', 'c.name', 'd.name', 'e.name');
$additional_order_fields = array('default_branch', 'default_department', 'default_job', 'default_job_item', 'sex', 'user_group', 'title', 'currency', 'permission_control', 'pay_period_schedule', 'policy_group');
$sort_column_aliases = array('type' => 'type_id', 'status' => 'status_id', 'sex' => 'sex_id', 'full_name' => 'last_name');
$order = $this->getColumnsFromAliases($order, $sort_column_aliases);
if ($order == NULL) {
$order = array('status_id' => 'asc', 'last_name' => 'asc', 'first_name' => 'asc', 'middle_name' => 'asc');
$strict = FALSE;
} else {
//Do order by column conversions, because if we include these columns in the SQL
//query, they contaminate the data array.
//Always try to order by status first so INACTIVE employees go to the bottom.
if (!isset($order['status_id'])) {
$order = Misc::prependArray(array('status_id' => 'asc'), $order);
}
//Always sort by last name,first name after other columns
if (!isset($order['last_name'])) {
$order['last_name'] = 'asc';
}
if (!isset($order['first_name'])) {
$order['first_name'] = 'asc';
}
$strict = TRUE;
}
//Debug::Arr($order,'Order Data:', __FILE__, __LINE__, __METHOD__,10);
//Debug::Arr($filter_data,'Filter Data:', __FILE__, __LINE__, __METHOD__,10);
$compf = new CompanyFactory();
$bf = new BranchFactory();
$df = new DepartmentFactory();
$ugf = new UserGroupFactory();
$utf = new UserTitleFactory();
$cf = new CurrencyFactory();
$pcf = new PermissionControlFactory();
$puf = new PermissionUserFactory();
$ppsuf = new PayPeriodScheduleUserFactory();
$ppsf = new PayPeriodScheduleFactory();
$pguf = new PolicyGroupUserFactory();
$pgf = new PolicyGroupFactory();
$egf = new EthnicGroupFactory();
if (getTTProductEdition() >= TT_PRODUCT_CORPORATE) {
$jf = new JobFactory();
$jif = new JobItemFactory();
}
$ph = array('company_id' => $company_id);
$query = '
select
a.*,
compf.name as company,
b.name as default_branch,
c.name as default_department,
d.name as user_group,
e.name as title,
f.name as currency,
//.........这里部分代码省略.........
示例9: array
}
$prepend_array_option = array(0 => '--', -1 => TTi18n::gettext('-- Default --'));
//Select box options;
$aplf = TTnew('AbsencePolicyListFactory');
$absence_policy_options = $aplf->getByCompanyIdArray($current_company->getId());
$splf = TTnew('SchedulePolicyListFactory');
$data['schedule_options'] = $splf->getByCompanyIdArray($current_company->getId());
$blf = TTnew('BranchListFactory');
$blf->getByCompanyId($current_company->getId());
$data['branch_options'] = Misc::prependArray($prepend_array_option, $blf->getArrayByListFactory($blf, FALSE, TRUE));
//$data['branch_options'] = Misc::prependArray( array( -1 => '-- Default --' ), $blf->getByCompanyIdArray( $current_company->getId(), FALSE, FALSE ) );
$dlf = TTnew('DepartmentListFactory');
$dlf->getByCompanyId($current_company->getId());
$data['department_options'] = Misc::prependArray($prepend_array_option, $dlf->getArrayByListFactory($dlf, FALSE, TRUE));
//$data['department_options'] = $dlf->getByCompanyIdArray( $current_company->getId() );
if ($current_company->getProductEdition() >= 20) {
$jlf = TTnew('JobListFactory');
$data['job_options'] = $jlf->getByCompanyIdAndStatusArray($current_company->getId(), array(10, 20, 30, 40), TRUE);
$jilf = TTnew('JobItemListFactory');
$data['job_item_options'] = $jilf->getByCompanyIdArray($current_company->getId(), TRUE);
}
$data['status_options'] = $rstlf->getOptions('status');
$data['absence_policy_options'] = Misc::prependArray(array('- ' . TTi18n::getText('Select Policy') . ' -'), $absence_policy_options);
//var_dump($week_rows);
$smarty->assign_by_ref('data', $data);
$smarty->assign_by_ref('week_rows', $week_rows);
break;
}
$smarty->assign_by_ref('rstcf', $rstcf);
$smarty->assign_by_ref('rstf', $rstf);
$smarty->display('schedule/EditRecurringScheduleTemplate.tpl');
示例10: TTnew
$slf = TTnew('StationListFactory');
$sulf = TTnew('StationUserListFactory');
$slf->GetByIdAndCompanyId($id, $current_company->getId());
foreach ($slf as $station) {
//Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);
if (isset($station_data['user_ids'])) {
Debug::Text('Using Selected Users', __FILE__, __LINE__, __METHOD__, 10);
//Use selected values
$user_ids = $station_data['user_ids'];
} else {
Debug::Text('Grabbing Users from DB', __FILE__, __LINE__, __METHOD__, 10);
$sulf->getByStationId($station->getId());
$user_ids = array();
foreach ($sulf as $station_user) {
$user_ids[] = $station_user->getUser();
}
}
$station_data = array('id' => $station->getId(), 'status' => TTi18n::gettext($station->getStatus()), 'type' => $station->getType(), 'station' => $station->getStation(), 'source' => $station->getSource(), 'description' => $station->getDescription(), 'user_ids' => $user_ids, 'created_date' => $station->getCreatedDate(), 'created_by' => $station->getCreatedBy(), 'updated_date' => $station->getUpdatedDate(), 'updated_by' => $station->getUpdatedBy(), 'deleted_date' => $station->getDeletedDate(), 'deleted_by' => $station->getDeletedBy());
}
}
//Select box options;
$station_data['status_options'] = $sf->getOptions('status');
$station_data['type_options'] = $sf->getOptions('type');
$user_options = UserListFactory::getByCompanyIdArray($current_company->getId(), FALSE);
$user_options = Misc::prependArray(array(-1 => TTi18n::gettext('-- ALL --')), $user_options);
$station_data['user_options'] = $user_options;
$smarty->assign_by_ref('station_data', $station_data);
break;
}
$smarty->assign_by_ref('sf', $sf);
$smarty->display('station/EditStationUser.tpl');
示例11: TTnew
$ulf = TTnew('UserListFactory');
$ulf->getSearchByCompanyIdAndArrayCriteria($current_company->getId(), $filter_data);
$src_user_options = UserListFactory::getArrayByListFactory($ulf, FALSE, FALSE);
$user_options = Misc::arrayDiffByKey((array) $filter_user_id, $src_user_options);
$filter_user_options = Misc::arrayIntersectByKey((array) $filter_user_id, $src_user_options);
$prepend_array_option = array(0 => '--', -1 => TTi18n::gettext('-- Default --'));
$splf = TTnew('SchedulePolicyListFactory');
$schedule_policy_options = $splf->getByCompanyIdArray($current_company->getId());
$aplf = TTnew('AbsencePolicyListFactory');
$absence_policy_options = $aplf->getByCompanyIdArray($current_company->getId());
$blf = TTnew('BranchListFactory');
$blf->getByCompanyId($current_company->getId());
$branch_options = Misc::prependArray($prepend_array_option, $blf->getArrayByListFactory($blf, FALSE, TRUE));
$dlf = TTnew('DepartmentListFactory');
$dlf->getByCompanyId($current_company->getId());
$department_options = Misc::prependArray($prepend_array_option, $dlf->getArrayByListFactory($dlf, FALSE, TRUE));
if ($current_company->getProductEdition() >= 20) {
$jlf = TTnew('JobListFactory');
$jlf->getByStatusIdAndCompanyId(array(10, 20, 30, 40), $current_company->getId());
//$jlf->getByCompanyIdAndUserIdAndStatus( $current_company->getId(), $data['user_id'], array(10,20,30,40) );
$data['job_options'] = $jlf->getArrayByListFactory($jlf, TRUE, TRUE);
$data['job_manual_id_options'] = $jlf->getManualIDArrayByListFactory($jlf, TRUE);
$jilf = TTnew('JobItemListFactory');
$jilf->getByCompanyId($current_company->getId());
$data['job_item_options'] = $jilf->getArrayByListFactory($jilf, TRUE);
$data['job_item_manual_id_options'] = $jilf->getManualIdArrayByListFactory($jilf, TRUE);
}
//Select box options;
$smarty->assign_by_ref('user_options', $user_options);
$smarty->assign_by_ref('filter_user_options', $filter_user_options);
$data['status_options'] = $sf->getOptions('status');
示例12: TTnew
$cdlf = TTnew('CompanyDeductionListFactory');
$cdlf->getByCompanyIdAndId($current_company->getId(), $id);
foreach ($cdlf as $cd_obj) {
//Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);
$data = array('id' => $cd_obj->getId(), 'company_id' => $cd_obj->getCompany(), 'status_id' => $cd_obj->getStatus(), 'type_id' => $cd_obj->getType(), 'name' => $cd_obj->getName(), 'start_date' => $cd_obj->getStartDate(), 'end_date' => $cd_obj->getEndDate(), 'minimum_length_of_service' => $cd_obj->getMinimumLengthOfService(), 'minimum_length_of_service_unit_id' => $cd_obj->getMinimumLengthOfServiceUnit(), 'maximum_length_of_service' => $cd_obj->getMaximumLengthOfService(), 'maximum_length_of_service_unit_id' => $cd_obj->getMaximumLengthOfServiceUnit(), 'minimum_user_age' => $cd_obj->getMinimumUserAge(), 'maximum_user_age' => $cd_obj->getMaximumUserAge(), 'calculation_id' => $cd_obj->getCalculation(), 'calculation_order' => $cd_obj->getCalculationOrder(), 'country' => $cd_obj->getCountry(), 'province' => $cd_obj->getProvince(), 'district' => $cd_obj->getDistrict(), 'company_value1' => $cd_obj->getCompanyValue1(), 'company_value2' => $cd_obj->getCompanyValue2(), 'user_value1' => $cd_obj->getUserValue1(), 'user_value2' => $cd_obj->getUserValue2(), 'user_value3' => $cd_obj->getUserValue3(), 'user_value4' => $cd_obj->getUserValue4(), 'user_value5' => $cd_obj->getUserValue5(), 'user_value6' => $cd_obj->getUserValue6(), 'user_value7' => $cd_obj->getUserValue7(), 'user_value8' => $cd_obj->getUserValue8(), 'user_value9' => $cd_obj->getUserValue9(), 'user_value10' => $cd_obj->getUserValue10(), 'lock_user_value1' => $cd_obj->getLockUserValue1(), 'lock_user_value2' => $cd_obj->getLockUserValue2(), 'lock_user_value3' => $cd_obj->getLockUserValue3(), 'lock_user_value4' => $cd_obj->getLockUserValue4(), 'lock_user_value5' => $cd_obj->getLockUserValue5(), 'lock_user_value6' => $cd_obj->getLockUserValue6(), 'lock_user_value7' => $cd_obj->getLockUserValue7(), 'lock_user_value8' => $cd_obj->getLockUserValue8(), 'lock_user_value9' => $cd_obj->getLockUserValue9(), 'lock_user_value10' => $cd_obj->getLockUserValue10(), 'pay_stub_entry_account_id' => $cd_obj->getPayStubEntryAccount(), 'include_pay_stub_entry_account_ids' => $cd_obj->getIncludePayStubEntryAccount(), 'exclude_pay_stub_entry_account_ids' => $cd_obj->getExcludePayStubEntryAccount(), 'include_account_amount_type_id' => $cd_obj->getIncludeAccountAmountType(), 'exclude_account_amount_type_id' => $cd_obj->getExcludeAccountAmountType(), 'user_ids' => $cd_obj->getUser(), 'created_date' => $cd_obj->getCreatedDate(), 'created_by' => $cd_obj->getCreatedBy(), 'updated_date' => $cd_obj->getUpdatedDate(), 'updated_by' => $cd_obj->getUpdatedBy(), 'deleted_date' => $cd_obj->getDeletedDate(), 'deleted_by' => $cd_obj->getDeletedBy());
}
} elseif ($action != 'submit') {
$data = array('country' => 0, 'province' => 0, 'district' => 0, 'user_value1' => 0, 'user_value2' => 0, 'user_value3' => 0, 'user_value4' => 0, 'user_value5' => 0, 'user_value6' => 0, 'user_value7' => 0, 'user_value8' => 0, 'user_value9' => 0, 'user_value10' => 0, 'minimum_length_of_service' => 0, 'maximum_length_of_service' => 0, 'minimum_user_age' => 0, 'maximum_user_age' => 0, 'calculation_order' => 100);
}
//Select box options;
$data['status_options'] = $cdf->getOptions('status');
$data['type_options'] = $cdf->getOptions('type');
$data['length_of_service_unit_options'] = $cdf->getOptions('length_of_service_unit');
$data['account_amount_type_options'] = $cdf->getOptions('account_amount_type');
$cf = TTnew('CompanyFactory');
$data['country_options'] = Misc::prependArray(array(0 => '--'), $cf->getOptions('country'));
if (isset($data['country'])) {
$data['province_options'] = $cf->getOptions('province', $data['country']);
}
if (isset($data['district'])) {
$district_options = $cf->getOptions('district', $data['country']);
if (isset($district_options[$data['province']])) {
$data['district_options'] = $district_options[$data['province']];
}
}
$data['us_medicare_filing_status_options'] = $cdf->getOptions('us_medicare_filing_status');
$data['us_eic_filing_status_options'] = $cdf->getOptions('us_eic_filing_status');
$data['federal_filing_status_options'] = $cdf->getOptions('federal_filing_status');
$data['state_filing_status_options'] = $cdf->getOptions('state_filing_status');
$data['state_ga_filing_status_options'] = $cdf->getOptions('state_ga_filing_status');
$data['state_nj_filing_status_options'] = $cdf->getOptions('state_nj_filing_status');
示例13: BranchListFactory
//Get branches
$blf = new BranchListFactory();
$blf->getByCompanyId($current_company->getId());
$branch_options = Misc::prependArray($all_array_option, $blf->getArrayByListFactory($blf, FALSE, TRUE));
$filter_data['src_branch_options'] = Misc::arrayDiffByKey((array) $filter_data['branch_ids'], $branch_options);
$filter_data['selected_branch_options'] = Misc::arrayIntersectByKey((array) $filter_data['branch_ids'], $branch_options);
//Get departments
$dlf = new DepartmentListFactory();
$dlf->getByCompanyId($current_company->getId());
$department_options = Misc::prependArray($all_array_option, $dlf->getArrayByListFactory($dlf, FALSE, TRUE));
$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);
//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);
//Deduction PSEA accounts
$psealf = new PayStubEntryAccountListFactory();
$filter_data['deduction_pay_stub_entry_account_options'] = $psealf->getByCompanyIdAndStatusIdAndTypeIdArray($current_company->getId(), 10, array(20, 30, 40), TRUE);
$filter_data['earning_pay_stub_entry_account_options'] = $psealf->getByCompanyIdAndStatusIdAndTypeIdArray($current_company->getId(), 10, array(10, 40), TRUE);
$filter_data['income_pay_stub_entry_account_options'] = $psealf->getByCompanyIdAndStatusIdAndTypeIdArray($current_company->getId(), 10, array(10, 30, 40), TRUE);
//Get employee list
//$filter_data['user_options'] = UserListFactory::getByCompanyIdArray( $current_company->getId(), FALSE );
//Quarters
$filter_data['year_options'] = $year_options;
$setup_data['state_options'] = $state_options;
$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);
示例14: array
$user_obj = $ulf->getById($p_obj->getColumn('user_id'))->getCurrent();
$rows[] = array('id' => $p_obj->getColumn('punch_id'), 'punch_control_id' => $p_obj->getPunchControlId(), 'user_id' => $p_obj->getColumn('user_id'), 'first_name' => $user_obj->getFirstName(), 'last_name' => $user_obj->getLastName(), 'title' => Option::getByKey($user_obj->getTitle(), $title_options), 'group' => Option::getByKey($user_obj->getGroup(), $group_options), 'default_branch' => Option::getByKey($user_obj->getDefaultBranch(), $branch_options), 'default_department' => Option::getByKey($user_obj->getDefaultDepartment(), $department_options), 'branch_id' => $p_obj->getColumn('branch_id'), 'branch' => Option::getByKey($p_obj->getColumn('branch_id'), $branch_options), 'department_id' => $p_obj->getColumn('department_id'), 'department' => Option::getByKey($p_obj->getColumn('department_id'), $department_options), 'status_id' => Option::getByKey($p_obj->getStatus(), $punch_status_options), 'type_id' => Option::getByKey($p_obj->getType(), $punch_type_options), 'date_stamp' => TTDate::getDate('DATE', TTDate::strtotime($p_obj->getColumn('date_stamp'))), 'job_id' => $p_obj->getColumn('job_id'), 'job_name' => $p_obj->getColumn('job_name'), 'job_group_id' => $p_obj->getColumn('job_group_id'), 'job_item_id' => $p_obj->getColumn('job_item_id'), 'time_stamp' => TTDate::getDate('DATE+TIME', $p_obj->getTimeStamp()), 'is_owner' => $permission->isOwner($p_obj->getCreatedBy(), $current_user->getId()), 'is_child' => $permission->isChild($p_obj->getColumn('user_id'), $permission_children_ids));
}
$smarty->assign_by_ref('rows', $rows);
$all_array_option = array('-1' => TTi18n::gettext('-- Any --'));
$ulf->getSearchByCompanyIdAndArrayCriteria($current_company->getId(), $filter_data);
$filter_data['user_options'] = Misc::prependArray($all_array_option, UserListFactory::getArrayByListFactory($ulf, FALSE, TRUE));
//Select box options;
$filter_data['branch_options'] = Misc::prependArray($all_array_option, $branch_options);
$filter_data['department_options'] = Misc::prependArray($all_array_option, $department_options);
$filter_data['title_options'] = Misc::prependArray($all_array_option, $title_options);
$filter_data['group_options'] = Misc::prependArray($all_array_option, $group_options);
$filter_data['status_options'] = Misc::prependArray($all_array_option, $ulf->getOptions('status'));
$filter_data['pay_period_options'] = Misc::prependArray($all_array_option, $pay_period_options);
$filter_data['punch_status_options'] = Misc::prependArray($all_array_option, $punch_status_options);
$filter_data['punch_type_options'] = Misc::prependArray($all_array_option, $punch_type_options);
$filter_data['saved_search_options'] = $ugdlf->getArrayByListFactory($ugdlf->getByUserIdAndScript($current_user->getId(), $_SERVER['SCRIPT_NAME']), FALSE);
//Get column list
$filter_data['src_column_options'] = Misc::arrayDiffByKey((array) $filter_data['columns'], $columns);
$filter_data['selected_column_options'] = Misc::arrayIntersectByKey((array) $filter_data['columns'], $columns);
$filter_data['sort_options'] = Misc::trimSortPrefix($columns);
$filter_data['sort_direction_options'] = Misc::getSortDirectionArray(TRUE);
foreach ($filter_data['columns'] as $column_key) {
$filter_columns[Misc::trimSortPrefix($column_key)] = $columns[$column_key];
}
unset($column_key);
$smarty->assign_by_ref('sort_column', $sort_column);
$smarty->assign_by_ref('sort_order', $sort_order);
$smarty->assign_by_ref('filter_data', $filter_data);
$smarty->assign_by_ref('columns', $filter_columns);
$smarty->assign('total_columns', count($filter_columns) + 3);
示例15: getAPISearchByCompanyIdAndArrayCriteria
function getAPISearchByCompanyIdAndArrayCriteria($company_id, $filter_data, $limit = NULL, $page = NULL, $where = NULL, $order = NULL)
{
if ($company_id == '') {
return FALSE;
}
if (!is_array($order)) {
//Use Filter Data ordering if its set.
if (isset($filter_data['sort_column']) and $filter_data['sort_order']) {
$order = array(Misc::trimSortPrefix($filter_data['sort_column']) => $filter_data['sort_order']);
}
}
$additional_order_fields = array();
$sort_column_aliases = array();
$order = $this->getColumnsFromAliases($order, $sort_column_aliases);
if ($order == NULL) {
$order = array('date_stamp' => 'desc', 'name' => 'asc');
$strict = FALSE;
} else {
if (!isset($order['date_stamp'])) {
$order = Misc::prependArray(array('date_stamp' => 'desc'), $order);
}
$strict = TRUE;
}
//Debug::Arr($order,'Order Data:', __FILE__, __LINE__, __METHOD__,10);
//Debug::Arr($filter_data,'Filter Data:', __FILE__, __LINE__, __METHOD__,10);
$uf = new UserFactory();
$pgf = new PolicyGroupFactory();
$pguf = new PolicyGroupUserFactory();
$hpf = new HolidayPolicyFactory();
$cgmf = new CompanyGenericMapFactory();
$ph = array('company_id' => $company_id);
$query = '
select distinct a.*,
y.first_name as created_by_first_name,
y.middle_name as created_by_middle_name,
y.last_name as created_by_last_name,
z.first_name as updated_by_first_name,
z.middle_name as updated_by_middle_name,
z.last_name as updated_by_last_name
from ' . $this->getTable() . ' as a
LEFT JOIN ' . $hpf->getTable() . ' as hpf ON ( a.holiday_policy_id = hpf.id AND hpf.deleted = 0 )
LEFT JOIN ' . $cgmf->getTable() . ' as cgmf ON ( cgmf.company_id = hpf.company_id AND cgmf.object_type_id = 180 AND cgmf.map_id = a.holiday_policy_id )
LEFT JOIN ' . $pgf->getTable() . ' as pgf ON ( pgf.id = cgmf.object_id AND pgf.deleted = 0 )
LEFT JOIN ' . $pguf->getTable() . ' as pguf ON ( pguf.policy_group_id = pgf.id AND pgf.deleted = 0 )
LEFT JOIN ' . $uf->getTable() . ' as y ON ( a.created_by = y.id AND y.deleted = 0 )
LEFT JOIN ' . $uf->getTable() . ' as z ON ( a.updated_by = z.id AND z.deleted = 0 )
where hpf.company_id = ?
';
if (isset($filter_data['permission_children_ids']) and isset($filter_data['permission_children_ids'][0]) and !in_array(-1, (array) $filter_data['permission_children_ids'])) {
$query .= ' AND a.created_by in (' . $this->getListSQL($filter_data['permission_children_ids'], $ph) . ') ';
}
if (isset($filter_data['id']) and isset($filter_data['id'][0]) and !in_array(-1, (array) $filter_data['id'])) {
$query .= ' AND a.id in (' . $this->getListSQL($filter_data['id'], $ph) . ') ';
}
if (isset($filter_data['exclude_id']) and isset($filter_data['exclude_id'][0]) and !in_array(-1, (array) $filter_data['exclude_id'])) {
$query .= ' AND a.id not in (' . $this->getListSQL($filter_data['exclude_id'], $ph) . ') ';
}
if (isset($filter_data['holiday_policy_id']) and isset($filter_data['holiday_policy_id'][0]) and !in_array(-1, (array) $filter_data['holiday_policy_id'])) {
$query .= ' AND a.holiday_policy_id in (' . $this->getListSQL($filter_data['holiday_policy_id'], $ph) . ') ';
}
if (isset($filter_data['user_id']) and isset($filter_data['user_id'][0]) and !in_array(-1, (array) $filter_data['user_id'])) {
$query .= ' AND pguf.user_id in (' . $this->getListSQL($filter_data['user_id'], $ph) . ') ';
}
if (isset($filter_data['name']) and trim($filter_data['name']) != '') {
$ph[] = strtolower(trim($filter_data['name']));
$query .= ' AND lower(a.name) LIKE ?';
}
if (isset($filter_data['start_date']) and trim($filter_data['start_date']) != '') {
$ph[] = $this->db->BindDate($filter_data['start_date']);
$query .= ' AND a.date_stamp >= ?';
}
if (isset($filter_data['end_date']) and trim($filter_data['end_date']) != '') {
$ph[] = $this->db->BindDate($filter_data['end_date']);
$query .= ' AND a.date_stamp <= ?';
}
$query .= isset($filter_data['created_by']) ? $this->getWhereClauseSQL(array('a.created_by', 'y.first_name', 'y.last_name'), $filter_data['created_by'], 'user_id_or_name', $ph) : NULL;
$query .= isset($filter_data['updated_by']) ? $this->getWhereClauseSQL(array('a.updated_by', 'z.first_name', 'z.last_name'), $filter_data['updated_by'], 'user_id_or_name', $ph) : NULL;
$query .= '
AND a.deleted = 0
';
$query .= $this->getWhereSQL($where);
$query .= $this->getSortSQL($order, $strict, $additional_order_fields);
$this->ExecuteSQL($query, $ph, $limit, $page);
return $this;
}