本文整理汇总了PHP中UserListFactory类的典型用法代码示例。如果您正苦于以下问题:PHP UserListFactory类的具体用法?PHP UserListFactory怎么用?PHP UserListFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UserListFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUser
function setUser($id)
{
$id = trim($id);
$ulf = new UserListFactory();
if ($id != 0 and $this->Validator->isResultSetWithRows('user', $ulf->getByID($id), TTi18n::gettext('Selected Employee is invalid')) and $this->Validator->isTrue('user', $this->isUniqueUser($id), TTi18n::gettext('Selected Employee is already assigned to another Permission Group'))) {
$this->data['user_id'] = $id;
return TRUE;
}
return FALSE;
}
示例2: setUser
function setUser($id)
{
$id = trim($id);
$ulf = new UserListFactory();
if ($id == 0 or $this->Validator->isResultSetWithRows('user', $ulf->getByID($id), TTi18n::gettext('Invalid User'))) {
$this->data['user_id'] = $id;
return TRUE;
}
return FALSE;
}
示例3: setIncludeUser
function setIncludeUser($id)
{
$id = trim($id);
$ulf = new UserListFactory();
if ($this->Validator->isResultSetWithRows('include_user', $ulf->getByID($id), TTi18n::gettext('Selected User is invalid'))) {
$this->data['user_id'] = $id;
return TRUE;
}
return FALSE;
}
示例4: smarty_function_EmbeddedAuthorizationList
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
function smarty_function_EmbeddedAuthorizationList($params, &$smarty)
{
global $current_company, $current_user;
$object_type_id = $params['object_type_id'];
$object_id = $params['object_id'];
$ulf = new UserListFactory();
$hlf = new HierarchyListFactory();
$hotlf = new HierarchyObjectTypeListFactory();
$alf = new AuthorizationListFactory();
$alf->setObjectType($object_type_id);
//$authorizing_obj = $alf->getObjectHandler()->getById( $object_id )->getCurrent();
$tmp_authorizing_obj = $alf->getObjectHandler()->getById($object_id);
if (is_object($tmp_authorizing_obj)) {
$authorizing_obj = $tmp_authorizing_obj->getCurrent();
} else {
return FALSE;
}
//var_dump($authorizing_obj);
unset($alf);
$user_id = $authorizing_obj->getUserObject()->getId();
$alf = new AuthorizationListFactory();
$alf->getByObjectTypeAndObjectId($object_type_id, $object_id);
foreach ($alf as $authorization_obj) {
$authorization_data[] = array('id' => $authorization_obj->getId(), 'created_by_full_name' => $ulf->getById($authorization_obj->getCreatedBy())->getCurrent()->getFullName(), 'authorized' => $authorization_obj->getAuthorized(), 'created_date' => $authorization_obj->getCreatedDate(), 'created_by' => $authorization_obj->getCreatedBy(), 'updated_date' => $authorization_obj->getUpdatedDate(), 'updated_by' => $authorization_obj->getUpdatedBy(), 'deleted_date' => $authorization_obj->getDeletedDate(), 'deleted_by' => $authorization_obj->getDeletedBy());
$user_id = $authorization_obj->getCreatedBy();
}
if ($authorizing_obj->getStatus() == 30) {
//If the object is still pending authorization, display who its waiting on...
$hierarchy_id = $hotlf->getByCompanyIdAndObjectTypeId($current_company->getId(), $object_type_id)->getCurrent()->getHierarchyControl();
Debug::Text('Hierarchy ID: ' . $hierarchy_id, __FILE__, __LINE__, __METHOD__, 10);
//Get Parents
$parent_level_user_ids = $hlf->getParentLevelIdArrayByHierarchyControlIdAndUserId($hierarchy_id, $user_id);
Debug::Arr($parent_level_user_ids, 'Parent Level Ids', __FILE__, __LINE__, __METHOD__, 10);
if ($parent_level_user_ids !== FALSE and count($parent_level_user_ids) > 0) {
Debug::Text('Adding Pending Line: ', __FILE__, __LINE__, __METHOD__, 10);
foreach ($parent_level_user_ids as $parent_user_id) {
$created_by_full_name[] = $ulf->getById($parent_user_id)->getCurrent()->getFullName();
}
$authorization_data[] = array('id' => NULL, 'created_by_full_name' => implode('<br>', $created_by_full_name), 'authorized' => NULL, 'created_date' => NULL, 'created_by' => NULL);
}
}
$smarty->assign_by_ref('authorization_data', $authorization_data);
$smarty->display('authorization/EmbeddedAuthorizationList.tpl');
}
示例5: postInstall
function postInstall()
{
Debug::text('postInstall: ' . $this->getVersion(), __FILE__, __LINE__, __METHOD__, 9);
$clf = new CompanyListFactory();
$clf->StartTransaction();
$clf->getAll();
if ($clf->getRecordCount() > 0) {
foreach ($clf as $c_obj) {
if ($c_obj->getStatus() == 10) {
$ulf = new UserListFactory();
$ulf->getHighestEmployeeNumberByCompanyId($c_obj->getId());
if ($ulf->getRecordCount() > 0) {
$next_available_employee_number = $ulf->getCurrent()->getEmployeeNumber() + 1;
} else {
$next_available_employee_number = 1;
}
$ulf->getByCompanyId($c_obj->getId(), NULL, NULL, NULL, array('hire_date' => 'asc'));
if ($ulf->getRecordCount() > 0) {
foreach ($ulf as $u_obj) {
if ($u_obj->getEmployeeNumber() == '') {
Debug::text('Setting Employee Number to: ' . $next_available_employee_number . ' for ' . $u_obj->getUserName(), __FILE__, __LINE__, __METHOD__, 9);
$u_obj->setEmployeeNumber($next_available_employee_number);
if ($u_obj->isValid()) {
$u_obj->Save();
$next_available_employee_number++;
}
} else {
Debug::text('NOT Setting Employee Number for ' . $u_obj->getUserName() . ' already set to: ' . $u_obj->getEmployeeNumber(), __FILE__, __LINE__, __METHOD__, 9);
}
}
}
}
}
}
//$clf->FailTransaction();
$clf->CommitTransaction();
return TRUE;
}
示例6: array
Debug::Text('Found Default Report!', __FILE__, __LINE__, __METHOD__, 10);
$ugd_obj = $ugdlf->getCurrent();
$filter_data = $ugd_obj->getData();
$generic_data['id'] = $ugd_obj->getId();
} else {
Debug::Text('Default Settings!', __FILE__, __LINE__, __METHOD__, 10);
//Default selections
$filter_data['user_status_ids'] = array(-1);
$filter_data['branch_ids'] = array(-1);
$filter_data['department_ids'] = array(-1);
$filter_data['user_title_ids'] = array(-1);
$filter_data['group_ids'] = array(-1);
}
}
$filter_data = Misc::preSetArrayValues($filter_data, array('include_user_ids', 'exclude_user_ids', 'user_status_ids', 'group_ids', 'branch_ids', 'department_ids', 'user_title_ids', 'pay_period_ids', 'column_ids'), NULL);
$ulf = new UserListFactory();
$all_array_option = array('-1' => TTi18n::gettext('-- All --'));
//Get include employee list.
$ulf->getByCompanyId($current_company->getId());
$user_options = $ulf->getArrayByListFactory($ulf, FALSE, TRUE);
$filter_data['src_include_user_options'] = Misc::arrayDiffByKey((array) $filter_data['include_user_ids'], $user_options);
$filter_data['selected_include_user_options'] = Misc::arrayIntersectByKey((array) $filter_data['include_user_ids'], $user_options);
//Get exclude employee list
$exclude_user_options = Misc::prependArray($all_array_option, $ulf->getArrayByListFactory($ulf, FALSE, TRUE));
$filter_data['src_exclude_user_options'] = Misc::arrayDiffByKey((array) $filter_data['exclude_user_ids'], $user_options);
$filter_data['selected_exclude_user_options'] = Misc::arrayIntersectByKey((array) $filter_data['exclude_user_ids'], $user_options);
//Get employee status list.
$user_status_options = Misc::prependArray($all_array_option, $ulf->getOptions('status'));
$filter_data['src_user_status_options'] = Misc::arrayDiffByKey((array) $filter_data['user_status_ids'], $user_status_options);
$filter_data['selected_user_status_options'] = Misc::arrayIntersectByKey((array) $filter_data['user_status_ids'], $user_status_options);
//Get Employee Groups
示例7: UserTaxListFactory
$utlf = new UserTaxListFactory();
//$uwlf->GetByUserIdAndCompanyId($current_user->getId(), $current_company->getId() );
$utlf->GetByUserId($user_id);
foreach ($utlf as $tax) {
//Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);
//$user_id = $tax->getUser();
$tax_data = array('id' => $tax->getId(), 'user_id' => $tax->getUser(), 'country' => $user_obj->getCountry(), 'federal_claim' => $tax->getFederalClaim(), 'provincial_claim' => $tax->getProvincialClaim(), 'federal_additional_deduction' => $tax->getFederalAdditionalDeduction(), 'wcb_rate' => $tax->getWCBRate(), 'vacation_rate' => $tax->getVacationRate(), 'release_vacation' => $tax->getReleaseVacation(), 'ei_exempt' => $tax->getEIExempt(), 'cpp_exempt' => $tax->getCPPExempt(), 'federal_tax_exempt' => $tax->getFederalTaxExempt(), 'provincial_tax_exempt' => $tax->getProvincialTaxExempt(), 'federal_filing_status_id' => $tax->getFederalFilingStatus(), 'state_filing_status_id' => $tax->getStateFilingStatus(), 'federal_allowance' => $tax->getFederalAllowance(), 'state_allowance' => $tax->getStateAllowance(), 'state_additional_deduction' => $tax->getStateAdditionalDeduction(), 'state_ui_rate' => $tax->getStateUIRate(), 'state_ui_wage_base' => $tax->getStateUIWageBase(), 'social_security_exempt' => $tax->getSocialSecurityExempt(), 'ui_exempt' => $tax->getUIExempt(), 'medicare_exempt' => $tax->getMedicareExempt(), 'created_date' => $tax->getCreatedDate(), 'created_by' => $tax->getCreatedBy(), 'updated_date' => $tax->getUpdatedDate(), 'updated_by' => $tax->getUpdatedBy(), 'deleted_date' => $tax->getDeletedDate(), 'deleted_by' => $tax->getDeletedBy());
}
if (!isset($tax_data)) {
$tax_data = array('country' => $user_obj->getCountry(), 'wcb_rate' => 0, 'vacation_rate' => 0, 'federal_claim' => 0, 'provincial_claim' => 0, 'federal_additional_deduction' => 0, 'federal_allowance' => 0, 'state_allowance' => 0, 'state_additional_deduction' => 0, 'state_ui_rate' => 0, 'state_ui_wage_base' => 0);
}
} else {
if ($tax_data['user_id'] != '') {
$user_id = $tax_data['user_id'];
}
}
$tax_data['user_options'] = UserListFactory::getByCompanyIdArray($current_company->getId(), FALSE);
$tax_data['federal_filing_status_options'] = $utf->getOptions('federal_filing_status');
$tax_data['state_filing_status_options'] = $utf->getOptions('state_filing_status');
//var_dump($tax_data);
$smarty->assign_by_ref('tax_data', $tax_data);
$smarty->assign_by_ref('user_id', $user_id);
$ulf = new UserListFactory();
$ulf->getByIdAndCompanyId($user_id, $current_company->getId());
$user_data = $ulf->getCurrent();
$smarty->assign_by_ref('full_name', $user_data->getFullName());
$smarty->assign_by_ref('data_saved', $data_saved);
break;
}
$smarty->assign_by_ref('utf', $utf);
$smarty->display('users/EditUserTax.tpl');
示例8: setUser
function setUser($ids)
{
if (is_array($ids)) {
if (!$this->isNew()) {
//If needed, delete mappings first.
$ppsulf = new PayPeriodScheduleUserListFactory();
$ppsulf->getByPayPeriodScheduleId($this->getId());
$user_ids = array();
foreach ($ppsulf as $pay_period_schedule) {
$user_id = $pay_period_schedule->getUser();
Debug::text('Schedule ID: ' . $pay_period_schedule->getPayPeriodSchedule() . ' User ID: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10);
//Delete users that are not selected.
if (!in_array($user_id, $ids)) {
Debug::text('Deleting User: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10);
$pay_period_schedule->Delete();
} else {
//Save user ID's that need to be updated.
Debug::text('NOT Deleting User: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10);
$user_ids[] = $user_id;
}
}
}
//Insert new mappings.
$ulf = new UserListFactory();
foreach ($ids as $id) {
if ($id != '' and isset($user_ids) and !in_array($id, $user_ids)) {
$ppsuf = new PayPeriodScheduleUserFactory();
$ppsuf->setPayPeriodSchedule($this->getId());
$ppsuf->setUser($id);
$user_obj = $ulf->getById($id)->getCurrent();
if ($this->Validator->isTrue('user', $ppsuf->Validator->isValid(), TTi18n::gettext('Selected Employee is already assigned to another Pay Period') . ' (' . $user_obj->getFullName() . ')')) {
$ppsuf->save();
}
}
}
return TRUE;
}
return FALSE;
}
示例9: setOfflinePunch
function setOfflinePunch($data)
{
Debug::Text('Setting Offline Punches... Rows: ' . count($data), __FILE__, __LINE__, __METHOD__, 10);
//
//WHen in Offline mode, default Type/Status to "AUTO"...
//That way once I get the punches, I can determine what they should be on my end.
//
if (!is_array($data) or count($data) == 0) {
return FALSE;
}
ksort($data);
//Debug::Arr($data, 'offlinePunchDataArr', __FILE__, __LINE__, __METHOD__,10);
/*
//Original
$data[] = array(
'user_id' => 1,
'time_stamp' => '12:00 PM',
'date_stamp' => '03-Dec-05',
'branch_id' => 1,
'department_id' => NULL,
'status_id' => 20,
'type_id' => 20,
'punch_control_id' => 0,
'station_id' => '7D00000023352A81'
);
*/
/*
unset($data);
$data[] = array(
'user_id' => 1001,
'time_stamp' => '08:00 AM',
'date_stamp' => '05-Dec-05',
'branch_id' => 5,
'department_id' => 3,
'status_id' => 0,
'type_id' => 0,
'punch_control_id' => 0,
'station_id' => '7D00000023352A81'
);
$data[] = array(
'user_id' => 1001,
'time_stamp' => '12:00 PM',
'date_stamp' => '05-Dec-05',
'branch_id' => 0,
'department_id' => 3,
'status_id' => 20,
'type_id' => 0,
'punch_control_id' => 0,
'station_id' => '7D00000023352A81'
);
*/
/*
$data[] = array(
'user_id' => 1001,
'time_stamp' => '1:00 PM',
'date_stamp' => '05-Dec-05',
'branch_id' => 6,
'department_id' => 0,
'status_id' => 0,
'type_id' => 20,
'punch_control_id' => 0,
'station_id' => '7D00000023352A81'
);
*/
/*
$data[] = array(
'user_id' => 1001,
'time_stamp' => '5:00 PM',
'date_stamp' => '05-Dec-05',
'branch_id' => 0,
'department_id' => 0,
'status_id' => 0,
'type_id' => 0,
'punch_control_id' => 0,
'station_id' => '7D00000023352A81'
);
*/
//Debug::Arr($data, 'offlinePunchDataArr', __FILE__, __LINE__, __METHOD__,10);
//One punch per row
foreach ($data as $row_key => $punch_row) {
Debug::Text('--------------------------========================---------------------------', __FILE__, __LINE__, __METHOD__, 10);
Debug::Text('--------------------------========================---------------------------', __FILE__, __LINE__, __METHOD__, 10);
Debug::Text('Row Key: ' . $row_key . ' Date: ' . $punch_row['date_stamp'] . ' Time: ' . $punch_row['time_stamp'] . ' Station ID: ' . $punch_row['station_id'], __FILE__, __LINE__, __METHOD__, 10);
if (isset($punch_row['station_id'])) {
$slf = new StationListFactory();
$slf->getByStationId($punch_row['station_id']);
if ($slf->getRecordCount() > 0) {
Debug::Text('Found Station Data...', __FILE__, __LINE__, __METHOD__, 10);
$current_station = $slf->getCurrent();
} else {
Debug::Text('DID NOT Find Station Data...', __FILE__, __LINE__, __METHOD__, 10);
continue;
}
unset($slf);
}
if (isset($punch_row['user_id']) and $punch_row['user_id'] != '') {
$ulf = new UserListFactory();
$ulf->getById($punch_row['user_id']);
//.........这里部分代码省略.........
示例10: setUser
function setUser($ids)
{
Debug::text('Setting User IDs : ', __FILE__, __LINE__, __METHOD__, 10);
if (is_array($ids)) {
if (!$this->isNew()) {
//If needed, delete mappings first.
$udlf = new UserDeductionListFactory();
$udlf->getByCompanyIdAndCompanyDeductionId($this->getCompany(), $this->getId());
$tmp_ids = array();
foreach ($udlf as $obj) {
$id = $obj->getUser();
Debug::text('ID: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
//Delete users that are not selected.
if (!in_array($id, $ids)) {
Debug::text('Deleting: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
$obj->Delete();
} else {
//Save ID's that need to be updated.
Debug::text('NOT Deleting : ' . $id, __FILE__, __LINE__, __METHOD__, 10);
$tmp_ids[] = $id;
}
}
unset($id, $obj);
}
//Insert new mappings.
//$psealf = new PayStubEntryAccountListFactory();
$ulf = new UserListFactory();
foreach ($ids as $id) {
if ($id != FALSE and isset($ids) and !in_array($id, $tmp_ids)) {
$udf = new UserDeductionFactory();
$udf->setUser($id);
$udf->setCompanyDeduction($this->getId());
$obj = $ulf->getById($id)->getCurrent();
if ($this->Validator->isTrue('user', $udf->Validator->isValid(), TTi18n::gettext('Employee is invalid') . ' (' . $obj->getFullName() . ')')) {
$udf->save();
}
}
}
return TRUE;
}
Debug::text('No IDs to set.', __FILE__, __LINE__, __METHOD__, 10);
return FALSE;
}
示例11: array
if ($action != 'submit' and !is_array($data)) {
Debug::Text(' ID was NOT passed: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
$user_id = NULL;
$user_date_id = NULL;
$user_full_name = NULL;
$user_default_branch = NULL;
$user_default_department = NULL;
$pay_period_is_locked = FALSE;
$time_stamp = $start_date_stamp = $end_date_stamp = TTDate::getBeginDayEpoch(TTDate::getTime()) + 3600 * 12;
//Noon
$data = array('start_date_stamp' => $start_date_stamp, 'end_date_stamp' => $end_date_stamp, 'start_time' => strtotime('08:00 AM'), 'parsed_start_time' => strtotime('08:00 AM'), 'end_time' => strtotime('05:00 PM'), 'parsed_end_time' => strtotime('05:00 PM'), 'total_time' => 3600 * 9, 'branch_id' => $user_default_branch, 'department_id' => $user_default_department, 'dow' => array(1 => TRUE, 2 => TRUE, 3 => TRUE, 4 => TRUE, 5 => TRUE));
}
//var_dump($data);
$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');
示例12: unset
}
unset($include_psea_id, $tmp_psea_options);
}
$smarty->assign_by_ref('filter_include_options', $filter_include_options);
$data['exclude_pay_stub_entry_account_options'] = $psealf->getByCompanyIdAndStatusIdAndTypeIdArray($current_company->getId(), 10, array(10, 20, 30, 40, 50, 80), FALSE);
if (isset($data['exclude_pay_stub_entry_account_ids']) and is_array($data['exclude_pay_stub_entry_account_ids'])) {
$tmp_psea_options = $psealf->getByCompanyIdAndStatusIdAndTypeIdArray($current_company->getId(), 10, array(10, 20, 30, 40, 50, 80), FALSE);
foreach ($data['exclude_pay_stub_entry_account_ids'] as $exclude_psea_id) {
$filter_exclude_options[$exclude_psea_id] = $tmp_psea_options[$exclude_psea_id];
}
unset($exclude_psea_id, $tmp_psea_options);
}
$smarty->assign_by_ref('filter_exclude_options', $filter_exclude_options);
//var_dump($data);
//Employee Selection Options
$data['user_options'] = UserListFactory::getByCompanyIdArray($current_company->getId(), FALSE, TRUE);
if (isset($data['user_ids']) and is_array($data['user_ids'])) {
$tmp_user_options = UserListFactory::getByCompanyIdArray($current_company->getId(), FALSE, TRUE);
foreach ($data['user_ids'] as $user_id) {
if (isset($tmp_user_options[$user_id])) {
$filter_user_options[$user_id] = $tmp_user_options[$user_id];
}
}
unset($user_id, $tmp_user_options);
}
$smarty->assign_by_ref('filter_user_options', $filter_user_options);
$smarty->assign_by_ref('data', $data);
break;
}
$smarty->assign_by_ref('cdf', $cdf);
$smarty->display('company/EditCompanyDeduction.tpl');
示例13: UserTitleListFactory
$utlf = new UserTitleListFactory();
$utlf->getByCompanyId($current_company->getId());
$title_options = $utlf->getArrayByListFactory($utlf, FALSE, TRUE);
$blf = new BranchListFactory();
$blf->getByCompanyId($current_company->getId());
$branch_options = $blf->getArrayByListFactory($blf, FALSE, TRUE);
$dlf = new DepartmentListFactory();
$dlf->getByCompanyId($current_company->getId());
$department_options = $dlf->getArrayByListFactory($dlf, FALSE, TRUE);
$uglf = new UserGroupListFactory();
$group_options = $uglf->getArrayByNodes(FastTree::FormatArray($uglf->getByCompanyIdArray($current_company->getId()), 'TEXT', TRUE));
$rstclf = new RecurringScheduleTemplateControlListFactory();
$template_options = $rstclf->getByCompanyIdArray($current_company->getId(), FALSE, TRUE);
foreach ($rsclf as $rsc_obj) {
$user_id = $rsc_obj->getColumn('user_id');
$ulf = new UserListFactory();
$ulf->getByID($user_id);
if ($ulf->getRecordCount() == 1) {
$u_obj = $ulf->getCurrent();
} else {
//Skip this row.
Debug::Text('Skipping Row: User ID: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10);
continue;
}
$rows[] = array('id' => $rsc_obj->getId(), 'user_id' => $user_id, 'name' => $rsc_obj->getColumn('name'), 'description' => $rsc_obj->getColumn('description'), 'start_week' => $rsc_obj->getStartWeek(), 'start_date' => $rsc_obj->getStartDate(), 'end_date' => $rsc_obj->getEndDate(), 'first_name' => $u_obj->getFirstName(), 'middle_name' => $u_obj->getMiddleName(), 'last_name' => $u_obj->getLastName(), 'user_full_name' => $u_obj->getFullName(TRUE), 'is_owner' => $permission->isOwner($u_obj->getCreatedBy(), $u_obj->getId()), 'is_child' => $permission->isChild($u_obj->getId(), $permission_children_ids), 'deleted' => $rsc_obj->getDeleted());
}
$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['template_options'] = Misc::prependArray($all_array_option, $template_options);
示例14: foreach
if ($ulf->getRecordCount() > 0) {
$user_obj = $ulf->getCurrent();
if (is_object($user_obj)) {
$is_owner = $permission->isOwner($user_obj->getCreatedBy(), $user_obj->getID());
$is_child = $permission->isChild($user_obj->getId(), $permission_children_ids);
if ($permission->Check('user_tax_deduction', 'view') or $permission->Check('user_tax_deduction', 'view_own') and $is_owner === TRUE or $permission->Check('user_tax_deduction', 'view_child') and $is_child === TRUE) {
foreach ($udlf as $ud_obj) {
$cd_obj = $ud_obj->getCompanyDeductionObject();
$rows[] = array('id' => $ud_obj->getId(), 'status_id' => $cd_obj->getStatus(), 'user_id' => $ud_obj->getUser(), 'name' => $cd_obj->getName(), 'type_id' => $cd_obj->getType(), 'type' => Option::getByKey($cd_obj->getType(), $cd_obj->getOptions('type')), 'calculation' => Option::getByKey($cd_obj->getCalculation(), $cd_obj->getOptions('calculation')), 'is_owner' => $is_owner, 'is_child' => $is_child, 'deleted' => $ud_obj->getDeleted());
}
}
}
}
$smarty->assign_by_ref('rows', $rows);
$smarty->assign_by_ref('user_id', $user_id);
$ulf = new UserListFactory();
$filter_data = NULL;
extract(UserGenericDataFactory::getSearchFormData($saved_search_id, NULL));
if ($permission->Check('user_tax_deduction', 'view') == FALSE) {
if ($permission->Check('user_tax_deduction', 'view_child')) {
$filter_data['permission_children_ids'] = $permission_children_ids;
}
if ($permission->Check('user_tax_deduction', 'view_own')) {
$filter_data['permission_children_ids'][] = $current_user->getId();
}
}
$ulf->getSearchByCompanyIdAndArrayCriteria($current_company->getId(), $filter_data);
$user_options = UserListFactory::getArrayByListFactory($ulf, FALSE, TRUE);
$smarty->assign_by_ref('user_options', $user_options);
$smarty->assign_by_ref('sort_column', $sort_column);
$smarty->assign_by_ref('sort_order', $sort_order);
示例15: getReportByStartDateAndEndDateAndUserIdList
function getReportByStartDateAndEndDateAndUserIdList($start_date, $end_date, $user_ids, $order = NULL)
{
if ($user_ids == '') {
return FALSE;
}
if ($start_date == '') {
return FALSE;
}
if ($end_date == '') {
return FALSE;
}
//$order = array( 'b.pay_period_id' => 'asc', 'b.user_id' => 'asc' );
$order = array('z.last_name' => 'asc');
/*
if ( $order == NULL ) {
$order = array( 'b.pay_period_id' => 'asc', 'b.user_id' => 'asc' );
$strict = FALSE;
} else {
$strict = TRUE;
}
*/
$ulf = new UserListFactory();
$udf = new UserDateFactory();
$uwf = new UserWageFactory();
$otpf = new OverTimePolicyFactory();
$apf = new AbsencePolicyFactory();
$ppf = new PremiumPolicyFactory();
$ph = array('start_date' => $this->db->BindDate($start_date), 'end_date' => $this->db->BindDate($end_date));
//Make it so employees with 0 hours still show up!! Very important!
//Order dock hours first, so it can be deducted from regular time.
$query = '
select z.id, tmp.*
from ' . $ulf->getTable() . ' as z
LEFT JOIN
( select b.user_id,
b.date_stamp as date_stamp,
a.status_id as status_id,
a.type_id as type_id,
a.over_time_policy_id as over_time_policy_id,
n.id as over_time_policy_wage_id,
n.effective_date as over_time_policy_wage_effective_date,
a.absence_policy_id as absence_policy_id,
p.id as absence_policy_wage_id,
p.effective_date as absence_policy_wage_effective_date,
a.premium_policy_id as premium_policy_id,
r.id as premium_policy_wage_id,
r.effective_date as premium_policy_wage_effective_date,
z.id as user_wage_id,
z.effective_date as user_wage_effective_date,
sum(total_Time) as total_time,
sum(actual_total_Time) as actual_total_time
from ' . $this->getTable() . ' as a
LEFT JOIN ' . $udf->getTable() . ' as b ON a.user_date_id = b.id
LEFT JOIN ' . $otpf->getTable() . ' as m ON a.over_time_policy_id = m.id
LEFT JOIN ' . $uwf->getTable() . ' as n ON n.id = (select n.id
from ' . $uwf->getTable() . ' as n
where n.user_id = b.user_id
and n.wage_group_id = m.wage_group_id
and n.effective_date <= b.date_stamp
and n.deleted = 0
order by n.effective_date desc limit 1)
LEFT JOIN ' . $apf->getTable() . ' as o ON a.absence_policy_id = o.id
LEFT JOIN ' . $uwf->getTable() . ' as p ON p.id = (select p.id
from ' . $uwf->getTable() . ' as p
where p.user_id = b.user_id
and p.wage_group_id = o.wage_group_id
and p.effective_date <= b.date_stamp
and p.deleted = 0
order by p.effective_date desc limit 1)
LEFT JOIN ' . $ppf->getTable() . ' as q ON a.premium_policy_id = q.id
LEFT JOIN ' . $uwf->getTable() . ' as r ON r.id = (select r.id
from ' . $uwf->getTable() . ' as r
where r.user_id = b.user_id
and r.wage_group_id = q.wage_group_id
and r.effective_date <= b.date_stamp
and r.deleted = 0
order by r.effective_date desc limit 1)
LEFT JOIN ' . $uwf->getTable() . ' as z ON z.id = (select z.id
from ' . $uwf->getTable() . ' as z
where z.user_id = b.user_id
and z.effective_date <= b.date_stamp
and z.deleted = 0
order by z.effective_date desc limit 1)
where
b.date_stamp >= ?
AND b.date_stamp <= ?
AND b.user_id in (' . $this->getListSQL($user_ids, $ph) . ')
AND a.status_id in (10,30)
AND ( a.deleted = 0 AND b.deleted = 0)
group by b.user_id, b.date_stamp, user_wage_id, user_wage_effective_date, over_time_policy_wage_id, over_time_policy_wage_effective_date, absence_policy_wage_id, absence_policy_wage_effective_date, premium_policy_wage_id, premium_policy_wage_effective_date, a.status_id, a.type_id, a.over_time_policy_id, a.absence_policy_id, a.premium_policy_id
) as tmp ON z.id = tmp.user_id
WHERE z.id in (' . $this->getListSQL($user_ids, $ph) . ')
//.........这里部分代码省略.........