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; }
* $Revision: 8904 $ * $Id: calcExceptions.php 8904 2013-01-20 17:21:15Z ipso $ * $Date: 2013-01-20 09:21:15 -0800 (Sun, 20 Jan 2013) $ */ /* * Calculate Exceptions for the previous day. This helps especially for * the "Unscheuled Absence" exception. * * Run this once a day. AFTER AddUserDate */ require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'global.inc.php'; require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'CLI.inc.php'; //Debug::setVerbosity(5); $execution_time = time(); $clf = new CompanyListFactory(); $clf->getAll(); $x = 0; if ($clf->getRecordCount() > 0) { foreach ($clf as $c_obj) { if ($c_obj->getStatus() != 30) { $company_start_time = microtime(TRUE); Debug::text('Company: ' . $c_obj->getName() . '(' . $c_obj->getId() . ')', __FILE__, __LINE__, __METHOD__, 5); //Recalculate at least the last two days. $start_date = TTDate::getMiddleDayEpoch($execution_time) - 86400 * 2; $end_date = TTDate::getMiddleDayEpoch(time()) - 86400; //Get the last time cron ran this script. $cjlf = new CronJobListFactory(); $cjlf->getByName('calcExceptions'); if ($cjlf->getRecordCount() > 0) { foreach ($cjlf as $cj_obj) { $tmp_start_date = $cj_obj->getLastRunDate();
function getAllArray() { $clf = new CompanyListFactory(); $clf->getAll(); $company_list[0] = '--'; foreach ($clf as $company) { $company_list[$company->getID()] = $company->getName(); } return $company_list; }
function postInstall() { global $cache; Debug::text('postInstall: ' . $this->getVersion(), __FILE__, __LINE__, __METHOD__, 9); //Configure currencies for Standard Edition. if ($this->getIsUpgrade() == TRUE) { $clf = new CompanyListFactory(); $clf->StartTransaction(); $clf->getAll(); if ($clf->getRecordCount() > 0) { foreach ($clf as $c_obj) { if ($c_obj->getStatus() == 10) { //Converting to new Accrual Policy table. Debug::text('Converting to new Accrual Policy Table: ' . $c_obj->getName() . ' ID: ' . $c_obj->getId(), __FILE__, __LINE__, __METHOD__, 9); $pglf = new PolicyGroupListFactory(); $pglf->getByCompanyId($c_obj->getId()); if ($pglf->getRecordCount() > 0) { foreach ($pglf as $pg_obj) { Debug::text('Accrual Policy ID: ' . $pg_obj->getColumn('accrual_policy_id'), __FILE__, __LINE__, __METHOD__, 9); if ($pg_obj->getColumn('accrual_policy_id') != '' and $pg_obj->getColumn('accrual_policy_id') != 0) { $pg_obj->setAccrualPolicy(array($pg_obj->getColumn('accrual_policy_id'))); if ($pg_obj->isValid()) { $pg_obj->Save(); } } } } Debug::text('Adding Currency Information to Company: ' . $c_obj->getName() . ' ID: ' . $c_obj->getId(), __FILE__, __LINE__, __METHOD__, 9); $crlf = new CurrencyListFactory(); $crlf->getByCompanyId($c_obj->getId()); if ($crlf->getRecordCount() == 0) { $cf = new CurrencyFactory(); $country_to_currency_map_arr = $cf->getOptions('country_currency'); if (isset($country_to_currency_map_arr[$c_obj->getCountry()])) { $base_currency = $country_to_currency_map_arr[$c_obj->getCountry()]; Debug::text('Found Base Currency For Country: ' . $c_obj->getCountry() . ' Currency: ' . $base_currency, __FILE__, __LINE__, __METHOD__, 9); } else { Debug::text('DID NOT Find Base Currency For Country: ' . $c_obj->getCountry() . ' Using default USD.', __FILE__, __LINE__, __METHOD__, 9); $base_currency = 'USD'; } $cf->setCompany($c_obj->getId()); $cf->setStatus(10); $cf->setName($base_currency); $cf->setISOCode($base_currency); $cf->setConversionRate('1.000000000'); $cf->setAutoUpdate(FALSE); $cf->setBase(TRUE); $cf->setDefault(TRUE); if ($cf->isValid()) { $base_currency_id = $cf->Save(); Debug::text('Base Currency ID: ' . $base_currency_id, __FILE__, __LINE__, __METHOD__, 10); //Set Employee Hire Defaults. $udlf = new UserDefaultListFactory(); $udlf->getByCompanyId($c_obj->getId()); if ($udlf->getRecordCount() > 0) { $ud_obj = $udlf->getCurrent(); $ud_obj->setCurrency($base_currency_id); $ud_obj->setLanguage('en'); if ($ud_obj->isValid()) { $ud_obj->Save(); } } unset($udlf, $ud_obj); if (is_numeric($base_currency_id)) { $ulf = new UserListFactory(); $ulf->getByCompanyId($c_obj->getId()); if ($ulf->getRecordCount() > 0) { foreach ($ulf as $u_obj) { $user_id = $u_obj->getID(); Debug::text('Setting Base Currency For User: '******' ID: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10); $u_obj->setCurrency($base_currency_id); if ($u_obj->isValid()) { if ($u_obj->Save() == TRUE) { //Set User Default Language $uplf = new UserPreferenceListFactory(); $uplf->getByUserIDAndCompanyID($user_id, $c_obj->getId()); if ($uplf->getRecordCount() > 0) { $up_obj = $uplf->getCurrent(); $up_obj->setLanguage('en'); //Englist if ($up_obj->isValid()) { $up_obj->Save(); } } unset($uplf, $up_obj); Debug::text(' Setting Base Currency for Pay Stubs, User ID: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10); //Change all pay stubs for this user to the base currency. //Do this in a single query for speed purposes. $ph = array('currency_id' => $base_currency_id, 'currency_rate' => '1.000000000', 'user_id' => $user_id); $query = 'update pay_stub set currency_id = ?, currency_rate = ? where user_id = ?'; Debug::text(' Pay Stub Currency Query: ' . $query, __FILE__, __LINE__, __METHOD__, 10); $u_obj->db->Execute($query, $ph); /* $pslf = new PayStubListFactory(); $pslf->getByUserIdAndCompanyId( $user_id, $c_obj->getId() ); if ( $pslf->getRecordCount() > 0 ) { foreach( $pslf as $ps_obj ) { //Debug::text(' Setting Base Currency for Pay Stub ID: '. $ps_obj->getId(), __FILE__, __LINE__, __METHOD__,10); $ps_obj->setCurrency( $base_currency_id ); if ( $ps_obj->isValid() ) { $ps_obj->setEnableLinkedAccruals( FALSE ); $ps_obj->setEnableCalcYTD( FALSE ); $ps_obj->setEnableProcessEntries( FALSE ); $ps_obj->Save(); } unset($ps_obj); } } unset($pslf); */ } else { Debug::text('Failed saving user ID: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10); } } else { Debug::text('Failed saving user ID: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10); } unset($u_obj, $user_id); } } unset($ulf); } } unset($cf); } } else { Debug::text('Company is not active! ' . $c_obj->getId(), __FILE__, __LINE__, __METHOD__, 10); } unset($c_obj, $base_currency, $base_currency_id, $crlf); } } //$clf->FailTransaction(); $clf->CommitTransaction(); } //Add currency updating to cron. $maint_base_path = Environment::getBasePath() . DIRECTORY_SEPARATOR . 'maint' . DIRECTORY_SEPARATOR; if (PHP_OS == 'WINNT') { $cron_job_base_command = 'php-win.exe ' . $maint_base_path; } else { $cron_job_base_command = 'php ' . $maint_base_path; } Debug::text('Cron Job Base Command: ' . $cron_job_base_command, __FILE__, __LINE__, __METHOD__, 9); $cjf = new CronJobFactory(); $cjf->setName('UpdateCurrencyRates'); $cjf->setMinute(45); $cjf->setHour(1); $cjf->setDayOfMonth('*'); $cjf->setMonth('*'); $cjf->setDayOfWeek('*'); $cjf->setCommand($cron_job_base_command . 'UpdateCurrencyRates.php'); $cjf->Save(); return TRUE; }
function postInstall() { Debug::text('postInstall: ' . $this->getVersion(), __FILE__, __LINE__, __METHOD__, 9); //Copy iButton,Fingerprint,EmployeeNumber (barcode/proximity) fields to new UserIdentification table. //Find out if they have both TimeClocks and FingerPrint stations. If they do //we need to copy the fingerprint data to both types of UserIdentification rows. $clf = new CompanyListFactory(); $clf->getAll(); $clf->StartTransaction(); foreach ($clf as $c_obj) { Debug::text('Company: ' . $c_obj->getName(), __FILE__, __LINE__, __METHOD__, 9); $max_templates = 4; $slf = new StationListFactory(); $slf->getByCompanyIdAndTypeId($c_obj->getId(), array(30, 40, 50, 100, 110)); if ($slf->getRecordCount() > 0) { $slf_tmp1 = $slf->getByCompanyIdAndTypeId($c_obj->getId(), array(50)); $griaule_stations = $slf_tmp1->getRecordCount(); Debug::text(' Found Griaule Stations: ' . $griaule_stations, __FILE__, __LINE__, __METHOD__, 9); unset($slf_tmp1); $slf_tmp2 = $slf->getByCompanyIdAndTypeId($c_obj->getId(), array(100, 110)); $zk_stations = $slf_tmp2->getRecordCount(); Debug::text(' Found ZK Stations: ' . $zk_stations, __FILE__, __LINE__, __METHOD__, 9); unset($slf_tmp2); $slf_tmp3 = $slf->getByCompanyIdAndTypeId($c_obj->getId(), array(40)); $barcode_stations = $slf_tmp3->getRecordCount(); Debug::text(' Found Barcode Stations: ' . $barcode_stations, __FILE__, __LINE__, __METHOD__, 9); unset($slf_tmp3); //Loop through each user copying their data to the UserIdenfification Table. $ulf = new UserListFactory(); $ulf->getByCompanyID($c_obj->getId()); if ($ulf->getRecordCount() > 0) { foreach ($ulf as $u_obj) { Debug::text(' User: '******'') { Debug::text(' Converting iButton...', __FILE__, __LINE__, __METHOD__, 9); $uif = new UserIdentificationFactory(); $uif->setUser($u_obj->getId()); $uif->setType(10); //10=iButton $uif->setNumber(0); $uif->setValue($u_obj->getIButtonID()); if ($uif->isValid() == TRUE) { $uif->Save(); $u_obj->getIButtonID(''); } } if ($u_obj->getRFID() != '') { Debug::text(' Converting RFID...', __FILE__, __LINE__, __METHOD__, 9); $uif = new UserIdentificationFactory(); $uif->setUser($u_obj->getId()); $uif->setType(40); //40=Proximity $uif->setNumber(0); $uif->setValue($u_obj->getRFID()); if ($uif->isValid() == TRUE) { $uif->Save(); $u_obj->getRFID(''); } } if ($barcode_stations > 0 and $u_obj->getEmployeeNumber() != '') { Debug::text(' Converting EmployeeNumber...', __FILE__, __LINE__, __METHOD__, 9); $uif = new UserIdentificationFactory(); $uif->setUser($u_obj->getId()); $uif->setType(30); //30=Barcode $uif->setNumber(0); $uif->setValue($u_obj->getEmployeeNumber()); if ($uif->isValid() == TRUE) { $uif->Save(); } } if ($griaule_stations > 0) { for ($t = 1; $t <= $max_templates; $t++) { $set_fingerprint_function = 'setFingerPrint' . $t; $get_fingerprint_function = 'getFingerPrint' . $t; //Griaule fingerprint templates start with: "p/8B" if ($u_obj->{$get_fingerprint_function}() != '' and substr($u_obj->{$get_fingerprint_function}(), 0, 4) == 'p/8B') { Debug::text(' Converting Griaule FingerPrint: ' . $t, __FILE__, __LINE__, __METHOD__, 9); $uif = new UserIdentificationFactory(); $uif->setUser($u_obj->getId()); $uif->setType(20); //20=Griaule, 100=ZK $uif->setNumber($t * 10); $uif->setValue($u_obj->{$get_fingerprint_function}()); if ($uif->isValid() == TRUE) { $uif->Save(); $u_obj->{$set_fingerprint_function}(''); } } } } if ($zk_stations > 0) { for ($t = 1; $t <= $max_templates; $t++) { $set_fingerprint_function = 'setFingerPrint' . $t; $get_fingerprint_function = 'getFingerPrint' . $t; //ZK fingerprint templates start with: "oco" if ($u_obj->{$get_fingerprint_function}() != '' and substr($u_obj->{$get_fingerprint_function}(), 0, 3) == 'oco') { Debug::text(' Converting ZK FingerPrint: ' . $t, __FILE__, __LINE__, __METHOD__, 9); $uif = new UserIdentificationFactory(); $uif->setUser($u_obj->getId()); $uif->setType(100); //20=Griaule, 100=ZK $uif->setNumber($t); $uif->setValue($u_obj->{$get_fingerprint_function}()); if ($uif->isValid() == TRUE) { $uif->Save(); $u_obj->{$set_fingerprint_function}(''); } } } } if ($u_obj->isValid()) { $u_obj->Save(); } } } } } $clf->CommitTransaction(); return TRUE; }
function postInstall() { Debug::text('postInstall: ' . $this->getVersion(), __FILE__, __LINE__, __METHOD__, 9); //Go through all pay period schedules and update the annual pay period column $ppslf = new PayPeriodScheduleListFactory(); $ppslf->getAll(); if ($ppslf->getRecordCount() > 0) { foreach ($ppslf as $pps_obj) { $pps_obj->setAnnualPayPeriods($pps_obj->calcAnnualPayPeriods()); if ($pps_obj->isValid()) { $pps_obj->Save(); } } } //Go through all employee wages and update HourlyRate to the accurate annual hourly rate. //**Handle this in 1034A postInstall() instead, as it needs to handle incorrect effective_dates properly. /* $uwlf = new UserWageListFactory(); $uwlf->getAll(); if ( $uwlf->getRecordCount() > 0 ) { foreach( $uwlf as $uw_obj ) { $uw_obj->setHourlyRate( $uw_obj->calcHourlyRate( time(), TRUE ) ); if ( $uw_obj->isValid() ) { $uw_obj->Save(); } } } */ //Upgrade to new hierarchy format. $clf = new CompanyListFactory(); $clf->getAll(); if ($clf->getRecordCount() > 0) { foreach ($clf as $c_obj) { if ($c_obj->getStatus() != 30) { /* if ( !($c_obj->getId() == 1052) ) { //$c_obj->getId() == 1009 OR $c_obj->getId() == 1087 OR continue; } */ $company_id = $c_obj->getId(); Debug::Text(' Company ID: ' . $company_id, __FILE__, __LINE__, __METHOD__, 10); $hclf = new HierarchyControlListFactory(); $hclf->StartTransaction(); $hclf->getByCompanyId($company_id); if ($hclf->getRecordCount() > 0) { foreach ($hclf as $hc_obj) { $paths_to_root = array(); $hierarchy_id = $hc_obj->getId(); $hlf = new HierarchyListFactory(); $hierarchy_users = $hlf->getByCompanyIdAndHierarchyControlId($company_id, $hierarchy_id); if (is_array($hierarchy_users) and count($hierarchy_users) > 0) { $hotlf = new HierarchyObjectTypeListFactory(); $hotlf->getByHierarchyControlId($hierarchy_id); if ($hotlf->getRecordCount() > 0) { foreach ($hotlf as $hot_obj) { $object_types[$hierarchy_id][] = $hot_obj->getObjectType(); } } foreach ($hierarchy_users as $hierarchy_user_arr) { Debug::Text(' Checking User ID: ' . $hierarchy_user_arr['id'], __FILE__, __LINE__, __METHOD__, 10); $id = $hierarchy_user_arr['id']; $tmp_id = $id; $i = 0; do { Debug::Text(' Iteration...', __FILE__, __LINE__, __METHOD__, 10); $hlf_b = new HierarchyListFactory(); $parents = $hlf_b->getParentLevelIdArrayByHierarchyControlIdAndUserId($hierarchy_id, $tmp_id); sort($parents); $level = $hlf_b->getFastTreeObject()->getLevel($tmp_id) - 1; if (is_array($parents) and count($parents) > 0) { $parent_users = array(); foreach ($parents as $user_id) { $parent_users[] = $user_id; unset($user); } $parent_groups[$level] = $parent_users; unset($parent_users); } if (isset($parents[0])) { $tmp_id = $parents[0]; } $i++; } while (is_array($parents) and count($parents) > 0 and $i < 100); if (isset($parent_groups)) { $serialized_path = serialize($parent_groups); $paths_to_root[$serialized_path][] = $id; unset($serialized_path); } unset($parent_groups, $parents); } } Debug::Arr($paths_to_root, ' Paths To Root: ', __FILE__, __LINE__, __METHOD__, 10); //Decode path_to_root array if (isset($paths_to_root) and count($paths_to_root) > 0) { foreach ($paths_to_root as $serialized_path => $children) { $path_arr = unserialize($serialized_path); $decoded_paths[] = array('hierarchy_control_id' => $hierarchy_id, 'path' => $path_arr, 'children' => $children); } unset($path_arr, $children); Debug::Arr($decoded_paths, ' Decoded Paths: ', __FILE__, __LINE__, __METHOD__, 10); if (isset($decoded_paths) and is_array($decoded_paths)) { foreach ($decoded_paths as $decoded_path) { Debug::Text(' Company ID: ' . $company_id, __FILE__, __LINE__, __METHOD__, 10); //Create new hierarchy_control $hcf = new HierarchyControlFactory(); $hcf->setCompany($company_id); $hcf->setObjectType($object_types[$decoded_path['hierarchy_control_id']]); //Generate meaningful name $name = FALSE; if (isset($decoded_path['path']) and is_array($decoded_path['path'])) { ksort($decoded_path['path']); //Sort by level. foreach ($decoded_path['path'] as $level => $superior_ids) { foreach ($superior_ids as $superior_id) { $ulf = new UserListFactory(); $ulf->getById($superior_id); if ($ulf->getRecordCount() > 0) { $name[] = $level . '. ' . $ulf->getCurrent()->getFullName(); } } } unset($level, $superior_ids, $superior_id); } if (isset($name)) { $name = $hc_obj->getName() . ' ' . implode(', ', $name) . ' (#' . rand(1000, 9999) . ')'; } else { $name = $hc_obj->getName() . ' (#' . rand(1000, 9999) . ')'; } $hcf->setName(substr($name, 0, 249)); $hcf->setDescription(TTi18n::getText('Automatically created by TimeTrex')); if ($hcf->isValid()) { $hc_id = $hcf->Save(FALSE); Debug::Text('Hierarchy Control ID: ' . $hc_id, __FILE__, __LINE__, __METHOD__, 10); $hcf->setUser($decoded_path['children']); if (isset($decoded_path['path']) and is_array($decoded_path['path'])) { foreach ($decoded_path['path'] as $level => $superior_ids) { foreach ($superior_ids as $superior_id) { $hlf = new HierarchyLevelFactory(); $hlf->setHierarchyControl($hc_id); $hlf->setLevel($level); $hlf->setUser($superior_id); if ($hlf->isValid()) { $hlf->Save(); Debug::Text('Saving Level Row ID... User ID: ' . $superior_id, __FILE__, __LINE__, __METHOD__, 10); } } } unset($level, $superior_ids, $superior_id); } } } } unset($decoded_paths); } //Delete existing hierarchy control. $hc_obj->setDeleted(TRUE); if ($hc_obj->isValid() == TRUE) { $hc_obj->Save(); } } } //$hclf->FailTransaction(); $hclf->CommitTransaction(); } } } //Go through each permission group, and enable break policies for anyone who can see meal policies $clf = new CompanyListFactory(); $clf->getAll(); if ($clf->getRecordCount() > 0) { foreach ($clf as $c_obj) { Debug::text('Company: ' . $c_obj->getName(), __FILE__, __LINE__, __METHOD__, 9); if ($c_obj->getStatus() != 30) { $pclf = new PermissionControlListFactory(); $pclf->getByCompanyId($c_obj->getId()); if ($pclf->getRecordCount() > 0) { foreach ($pclf as $pc_obj) { Debug::text('Permission Group: ' . $pc_obj->getName(), __FILE__, __LINE__, __METHOD__, 9); $plf = new PermissionListFactory(); $plf->getByCompanyIdAndPermissionControlIdAndSectionAndName($c_obj->getId(), $pc_obj->getId(), 'meal_policy', 'enabled'); if ($plf->getRecordCount() > 0) { Debug::text('Found permission group with meal policy enabled: ' . $plf->getCurrent()->getValue(), __FILE__, __LINE__, __METHOD__, 9); $pc_obj->setPermission(array('break_policy' => array('enabled' => TRUE, 'view' => TRUE, 'add' => TRUE, 'edit' => TRUE, 'delete' => TRUE))); } else { Debug::text('Permission group does NOT have meal policy enabled...', __FILE__, __LINE__, __METHOD__, 9); } } } } } } //Add MiscDaily cronjob to database. $cjf = new CronJobFactory(); $cjf->setName('MiscDaily'); $cjf->setMinute(55); $cjf->setHour(1); $cjf->setDayOfMonth('*'); $cjf->setMonth('*'); $cjf->setDayOfWeek('*'); $cjf->setCommand('MiscDaily.php'); $cjf->Save(); //Add MiscWeekly cronjob to database. $cjf = new CronJobFactory(); $cjf->setName('MiscWeekly'); $cjf->setMinute(55); $cjf->setHour(1); $cjf->setDayOfMonth('*'); $cjf->setMonth('*'); $cjf->setDayOfWeek('0'); //Sunday morning. $cjf->setCommand('MiscWeekly.php'); $cjf->Save(); return TRUE; }
} else { if ($permission->Check('user', 'view') == FALSE) { if ($permission->Check('user', 'view_child')) { $filter_data['permission_children_ids'] = $permission_children_ids; } if ($permission->Check('user', 'view_own')) { $filter_data['permission_children_ids'][] = $current_user->getId(); } } Debug::Text('Users in company only!', __FILE__, __LINE__, __METHOD__, 10); $ulf->getSearchByCompanyIdAndArrayCriteria($current_company->getId(), $filter_data, $current_user_prefs->getItemsPerPage(), $page, NULL, $sort_array); } $pager = new Pager($ulf); if ($permission->Check('company', 'view')) { $clf = new CompanyListFactory(); $clf->getAll($current_company->getId()); $company_options = $clf->getArrayByListFactory($clf, FALSE, TRUE); } //Get title list, $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)); foreach ($ulf as $u_obj) {