本文整理汇总了PHP中Option::getByArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Option::getByArray方法的具体用法?PHP Option::getByArray怎么用?PHP Option::getByArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Option
的用法示例。
在下文中一共展示了Option::getByArray方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getFactoryOptions
function _getFactoryOptions($name)
{
$retval = NULL;
switch ($name) {
case 'filtered_status':
//Select box options;
$status_options_filter = array(50);
if ($this->getStatus() == 55) {
$status_options_filter = array(55);
} elseif ($this->getStatus() == 52) {
$status_options_filter = array(52);
}
$retval = Option::getByArray($status_options_filter, $this->getOptions('status'));
break;
case 'status':
$retval = array(10 => TTi18n::gettext('NEW'), 20 => TTi18n::gettext('OPEN'), 30 => TTi18n::gettext('PENDING AUTHORIZATION'), 40 => TTi18n::gettext('AUTHORIZATION OPEN'), 50 => TTi18n::gettext('ACTIVE'), 52 => TTi18n::gettext('IN USE'), 55 => TTi18n::gettext('PAID'), 60 => TTi18n::gettext('DISABLED'));
break;
case 'type':
$retval = array(10 => TTi18n::gettext('Fixed'), 20 => TTi18n::gettext('Percent'));
break;
case 'pay_stub_account_type':
$retval = array(10, 20, 30, 50, 60, 65);
break;
case 'percent_pay_stub_account_type':
$retval = array(10, 20, 30, 40, 50, 60, 65);
break;
case 'export_type':
case 'export_eft':
case 'export_cheque':
$psf = TTNew('PayStubFactory');
$retval = $psf->getOptions($name);
break;
case 'columns':
$retval = array('-1000-first_name' => TTi18n::gettext('First Name'), '-1002-last_name' => TTi18n::gettext('Last Name'), '-1005-user_status' => TTi18n::gettext('Employee Status'), '-1010-title' => TTi18n::gettext('Title'), '-1020-user_group' => TTi18n::gettext('Group'), '-1030-default_branch' => TTi18n::gettext('Default Branch'), '-1040-default_department' => TTi18n::gettext('Default Department'), '-1110-status' => TTi18n::gettext('Status'), '-1120-type' => TTi18n::gettext('Type'), '-1130-pay_stub_entry_name' => TTi18n::gettext('Account'), '-1140-effective_date' => TTi18n::gettext('Effective Date'), '-1150-amount' => TTi18n::gettext('Amount'), '-1160-rate' => TTi18n::gettext('Rate'), '-1170-units' => TTi18n::gettext('Units'), '-1180-description' => TTi18n::gettext('Pay Stub Note (Public)'), '-1182-private_description' => TTi18n::gettext('Description (Private)'), '-1190-ytd_adjustment' => TTi18n::gettext('YTD Adjustment'), '-2000-created_by' => TTi18n::gettext('Created By'), '-2010-created_date' => TTi18n::gettext('Created Date'), '-2020-updated_by' => TTi18n::gettext('Updated By'), '-2030-updated_date' => TTi18n::gettext('Updated Date'));
break;
case 'list_columns':
$retval = Misc::arrayIntersectByKey($this->getOptions('default_display_columns'), Misc::trimSortPrefix($this->getOptions('columns')));
break;
case 'default_display_columns':
//Columns that are displayed by default.
$retval = array('first_name', 'last_name', 'status', 'pay_stub_entry_name', 'effective_date', 'amount', 'description');
break;
case 'unique_columns':
//Columns that are unique, and disabled for mass editing.
$retval = array();
break;
case 'linked_columns':
//Columns that are linked together, mainly for Mass Edit, if one changes, they all must.
$retval = array();
break;
}
return $retval;
}
示例2: _getFactoryOptions
function _getFactoryOptions($name)
{
$retval = NULL;
switch ($name) {
case 'filtered_status':
//Select box options;
$status_options_filter = array(50, 60);
$retval = Option::getByArray($status_options_filter, $this->getOptions('status'));
break;
case 'status':
$retval = array(10 => TTi18n::gettext('INCOMPLETE'), 20 => TTi18n::gettext('OPEN'), 30 => TTi18n::gettext('PENDING AUTHORIZATION'), 40 => TTi18n::gettext('AUTHORIZATION OPEN'), 50 => TTi18n::gettext('ACTIVE'), 55 => TTi18n::gettext('AUTHORIZATION DECLINED'), 60 => TTi18n::gettext('DISABLED'));
break;
case 'frequency':
$retval = array(10 => TTi18n::gettext('each Pay Period'), 30 => TTi18n::gettext('Weekly'), 40 => TTi18n::gettext('Monthly'), 70 => TTi18n::gettext('Yearly'));
break;
case 'percent_amount':
$retval = array(10 => TTi18n::gettext('Gross Wage'));
break;
case 'type':
$retval = array(10 => TTi18n::gettext('Fixed'), 20 => TTi18n::gettext('Percent'));
break;
case 'pay_stub_account_type':
$retval = array(10, 20, 30, 50, 60, 65);
break;
case 'percent_pay_stub_account_type':
$retval = array(10, 20, 30, 40, 50, 60, 65);
break;
case 'columns':
$retval = array('-1000-name' => TTi18n::gettext('Name'), '-1002-description' => TTi18n::gettext('Description'), '-1110-status' => TTi18n::gettext('Status'), '-1115-frequency' => TTi18n::gettext('Frequency'), '-1120-type' => TTi18n::gettext('Type'), '-1130-pay_stub_entry_name' => TTi18n::gettext('Account'), '-1140-effective_date' => TTi18n::gettext('Effective Date'), '-1150-amount' => TTi18n::gettext('Amount'), '-1160-rate' => TTi18n::gettext('Rate'), '-1170-units' => TTi18n::gettext('Units'), '-1180-ps_amendment_description' => TTi18n::gettext('PS Amendment Description'), '-1190-start_date' => TTi18n::gettext('Start Date'), '-1190-end_date' => TTi18n::gettext('End Date'), '-2000-created_by' => TTi18n::gettext('Created By'), '-2010-created_date' => TTi18n::gettext('Created Date'), '-2020-updated_by' => TTi18n::gettext('Updated By'), '-2030-updated_date' => TTi18n::gettext('Updated Date'));
break;
case 'list_columns':
$retval = Misc::arrayIntersectByKey($this->getOptions('default_display_columns'), Misc::trimSortPrefix($this->getOptions('columns')));
break;
case 'default_display_columns':
//Columns that are displayed by default.
$retval = array('status', 'name', 'description', 'type', 'frequency');
break;
case 'unique_columns':
//Columns that are unique, and disabled for mass editing.
$retval = array();
break;
case 'linked_columns':
//Columns that are linked together, mainly for Mass Edit, if one changes, they all must.
$retval = array();
break;
}
return $retval;
}
示例3: _getFactoryOptions
function _getFactoryOptions($name, $country = NULL)
{
$retval = NULL;
switch ($name) {
case 'filtered_status':
$retval = Option::getByArray(array(25, 40), $this->getOptions('status'));
break;
case 'status':
$retval = array(10 => TTi18n::gettext('NEW'), 20 => TTi18n::gettext('LOCKED'), 25 => TTi18n::gettext('Open'), 30 => TTi18n::gettext('Pending Transaction'), 40 => TTi18n::gettext('Paid'));
break;
case 'export_type':
$retval = array();
$retval += array('00' => TTi18n::gettext('-- Direct Deposit --'));
$retval += $this->getOptions('export_eft');
$retval += array('01' => '', '02' => TTi18n::gettext('-- Laser Cheques --'));
$retval += $this->getOptions('export_cheque');
break;
case 'export_eft':
$retval = array('-1010-eft_ACH' => TTi18n::gettext('United States - ACH (94-Byte)'), '-1020-eft_1464' => TTi18n::gettext('Canada - EFT (CPA 005/1464-Byte)'), '-1030-eft_105' => TTi18n::gettext('Canada - EFT (105-Byte)'), '-1040-eft_HSBC' => TTi18n::gettext('Canada - HSBC EFT-PC (CSV)'), '-1050-eft_BEANSTREAM' => TTi18n::gettext('Beanstream (CSV)'));
break;
case 'export_cheque':
$retval = array('-2010-cheque_9085' => TTi18n::gettext('NEBS #9085'), '-2020-cheque_9209p' => TTi18n::gettext('NEBS #9209P'), '-2030-cheque_dlt103' => TTi18n::gettext('NEBS #DLT103'), '-2040-cheque_dlt104' => TTi18n::gettext('NEBS #DLT104'), '-2050-cheque_cr_standard_form_1' => TTi18n::gettext('Costa Rica - Std Form 1'), '-2060-cheque_cr_standard_form_2' => TTi18n::gettext('Costa Rica - Std Form 2'));
break;
case 'export_general_ledger':
$retval = array('-2010-csv' => TTi18n::gettext('Excel (CSV)'), '-2020-simply' => TTi18n::gettext('Simply Accounting GL'), '-2030-quickbooks' => TTi18n::gettext('Quickbooks GL'));
break;
case 'columns':
$retval = array('-1000-first_name' => TTi18n::gettext('First Name'), '-1002-last_name' => TTi18n::gettext('Last Name'), '-1005-user_status' => TTi18n::gettext('Employee Status'), '-1010-title' => TTi18n::gettext('Title'), '-1020-user_group' => TTi18n::gettext('Group'), '-1030-default_branch' => TTi18n::gettext('Default Branch'), '-1040-default_department' => TTi18n::gettext('Default Department'), '-1050-city' => TTi18n::gettext('City'), '-1060-province' => TTi18n::gettext('Province/State'), '-1070-country' => TTi18n::gettext('Country'), '-1080-currency' => TTi18n::gettext('Currency'), '-1140-status' => TTi18n::gettext('Status'), '-1170-start_date' => TTi18n::gettext('Start Date'), '-1180-end_date' => TTi18n::gettext('End Date'), '-1190-transaction_date' => TTi18n::gettext('Transaction Date'), '-2000-created_by' => TTi18n::gettext('Created By'), '-2010-created_date' => TTi18n::gettext('Created Date'), '-2020-updated_by' => TTi18n::gettext('Updated By'), '-2030-updated_date' => TTi18n::gettext('Updated Date'));
break;
case 'list_columns':
$retval = Misc::arrayIntersectByKey($this->getOptions('default_display_columns'), Misc::trimSortPrefix($this->getOptions('columns')));
break;
case 'default_display_columns':
//Columns that are displayed by default.
$retval = array('first_name', 'last_name', 'status', 'start_date', 'end_date', 'transaction_date');
break;
case 'unique_columns':
//Columns that are unique, and disabled for mass editing.
$retval = array();
break;
case 'linked_columns':
//Columns that are linked together, mainly for Mass Edit, if one changes, they all must.
$retval = array();
break;
}
return $retval;
}
示例4: array
$pay_period_data = array('id' => $pay_period_obj->getId(), 'company_id' => $pay_period_obj->getCompany(), 'pay_period_schedule_id' => $pay_period_obj->getPayPeriodSchedule(), 'pay_period_schedule_type' => $pay_period_obj->getPayPeriodScheduleObject()->getType(), 'status_id' => $pay_period_obj->getStatus(), 'status' => $status_options[$pay_period_obj->getStatus()], 'start_date' => $pay_period_obj->getStartDate(), 'end_date' => $pay_period_obj->getEndDate(), 'transaction_date' => $pay_period_obj->getTransactionDate(), 'is_primary' => $pay_period_obj->getPrimary(), 'deleted' => $pay_period_obj->getDeleted(), 'tainted' => $pay_period_obj->getTainted(), 'tainted_date' => $pay_period_obj->getTaintedDate(), 'tainted_by' => $pay_period_obj->getTaintedBy(), 'created_date' => $pay_period_obj->getCreatedDate(), 'created_by' => $pay_period_obj->getCreatedBy(), 'updated_date' => $pay_period_obj->getUpdatedDate(), 'updated_by' => $pay_period_obj->getUpdatedBy(), 'deleted_date' => $pay_period_obj->getDeletedDate(), 'deleted_by' => $pay_period_obj->getDeletedBy());
}
Debug::Text('Current Pay Period Status: ' . $pay_period_obj->getStatus(), __FILE__, __LINE__, __METHOD__, 10);
$status_options = $pay_period_obj->getOptions('status');
if ($pay_period_obj->getStatus() == 20 or $pay_period_obj->getStatus() == 30) {
//Once pay period is closed, do not allow it to re-open.
$status_filter_arr = array(20, 30);
} else {
//Only allow to close pay period if AFTER end date.
if (TTDate::getTime() >= $pay_period_obj->getEndDate()) {
$status_filter_arr = array(10, 12, $pay_period_obj->getStatus(), 20);
} else {
$status_filter_arr = array(10, 12, $pay_period_obj->getStatus());
}
}
$status_options = Option::getByArray($status_filter_arr, $status_options);
$smarty->assign_by_ref('status_options', $status_options);
$elf = TTnew('ExceptionListFactory');
$elf->getSumExceptionsByPayPeriodIdAndBeforeDate($pay_period_obj->getId(), $pay_period_obj->getEndDate());
$exceptions = array('low' => 0, 'med' => 0, 'high' => 0, 'critical' => 0);
if ($elf->getRecordCount() > 0) {
Debug::Text(' Found Exceptions: ' . $elf->getRecordCount(), __FILE__, __LINE__, __METHOD__, 10);
foreach ($elf as $e_obj) {
if ($e_obj->getColumn('severity_id') == 10) {
$exceptions['low'] = $e_obj->getColumn('count');
}
if ($e_obj->getColumn('severity_id') == 20) {
$exceptions['med'] = $e_obj->getColumn('count');
}
if ($e_obj->getColumn('severity_id') == 25) {
$exceptions['high'] = $e_obj->getColumn('count');
示例5: array
//Select box options;
$status_options_filter = array(50);
if (isset($pay_stub_amendment) and $pay_stub_amendment->getStatus() == 55) {
$status_options_filter = array(55);
} elseif (isset($pay_stub_amendment) and $pay_stub_amendment->getStatus() == 52) {
$status_options_filter = array(52);
}
if (!isset($pay_stub_amendment_data['filter_user_id'])) {
$pay_stub_amendment_data['filter_user_id'] = array();
}
$ulf = TTnew('UserListFactory');
$ulf->getSearchByCompanyIdAndArrayCriteria($current_company->getId(), NULL);
$src_user_options = UserListFactory::getArrayByListFactory($ulf, FALSE, FALSE);
$user_options = Misc::arrayDiffByKey((array) $pay_stub_amendment_data['filter_user_id'], $src_user_options);
$filter_user_options = Misc::arrayIntersectByKey((array) $pay_stub_amendment_data['filter_user_id'], $src_user_options);
$status_options = Option::getByArray($status_options_filter, $psaf->getOptions('status'));
$pay_stub_amendment_data['status_options'] = $status_options;
$pseallf = TTnew('PayStubEntryAccountLinkListFactory');
$pseallf->getByCompanyId($current_company->getId());
if ($pseallf->getRecordCount() > 0) {
$net_pay_psea_id = $pseallf->getCurrent()->getTotalNetPay();
}
$psealf = TTnew('PayStubEntryAccountListFactory');
$pay_stub_amendment_data['pay_stub_entry_name_options'] = $psealf->getByCompanyIdAndStatusIdAndTypeIdArray($current_company->getId(), 10, array(10, 20, 30, 50, 60, 65));
$pay_stub_amendment_data['percent_amount_entry_name_options'] = $psealf->getByCompanyIdAndStatusIdAndTypeIdArray($current_company->getId(), 10, array(10, 20, 30, 40, 50, 60, 65));
if (isset($net_pay_psea_id)) {
unset($pay_stub_amendment_data['percent_amount_entry_name_options'][$net_pay_psea_id]);
}
//$pay_stub_amendment_data['pay_stub_entry_name_options'] = $psenlf->getByTypeIdArray( array(10,20,30,35) );
//$user_options = UserListFactory::getByCompanyIdArray( $current_company->getId(), TRUE );
$pay_stub_amendment_data['user_options'] = $user_options;
示例6: PayPeriodScheduleListFactory
$ppslf = new PayPeriodScheduleListFactory();
$pay_period_schedule_obj = $ppslf->getById($pay_period_obj->getPayPeriodSchedule())->getCurrent();
$pay_period_data = array('start_date' => TTDate::getDate('DATE', $pay_period_obj->getStartDate()), 'end_date' => TTDate::getDate('DATE', $pay_period_obj->getEndDate()), 'transaction_date' => TTDate::getDate('DATE', $pay_period_obj->getTransactionDate()), 'annual_pay_periods' => $pay_period_schedule_obj->getAnnualPayPeriods());
//Get User information
$ulf = new UserListFactory();
$user_obj = $ulf->getById($ps_obj->getUser())->getCurrent();
$data['user_full_name'] = $user_obj->getFullName();
//Get company information
/*
$clf = new CompanyListFactory();
$company_obj = $clf->getById( $user_obj->getCompany() )->getCurrent();
*/
}
}
}
$pay_stub_status_options = $psf->getOptions('status');
$data['pay_stub_status_options'] = Option::getByArray(array(25, 40), $pay_stub_status_options);
$culf = new CurrencyListFactory();
$culf->getByCompanyId($current_company->getId());
$data['currency_options'] = $culf->getArrayByListFactory($culf, FALSE, TRUE);
//var_dump($data);
$smarty->assign_by_ref('data', $data);
$smarty->assign_by_ref('pay_stub_id', $id);
$smarty->assign_by_ref('filter_pay_period_id', $filter_pay_period_id);
$smarty->assign_by_ref('modified_entry', $modified_entry);
$smarty->assign_by_ref('sort_column', $sort_column);
$smarty->assign_by_ref('sort_order', $sort_order);
break;
}
$smarty->assign_by_ref('psf', $psf);
$smarty->display('pay_stub/EditPayStub.tpl');