Exemplo n.º 1
0
 $pglf = TTnew('PolicyGroupListFactory');
 $policy_group_options = $pglf->getByCompanyIDArray($current_company->getId());
 $pclf = TTnew('PermissionControlListFactory');
 $pclf->getByCompanyIdAndUserId($current_company->getId(), $filter_data['user_ids']);
 $permission_control_user_map = $pclf->getUserToPermissionControlMapArrayByListFactory($pclf);
 $ppslf = TTnew('PayPeriodScheduleListFactory');
 $ppslf->getByCompanyIdAndUserId($current_company->getId(), $filter_data['user_ids']);
 $pay_period_schedule_user_map = $ppslf->getUserToPayPeriodScheduleMapArrayByListFactory($ppslf);
 $pglf = TTnew('PolicyGroupListFactory');
 $pglf->getByCompanyIdAndUserId($current_company->getId(), $filter_data['user_ids']);
 $policy_group_user_map = $pglf->getUserToPolicyGroupMapArrayByListFactory($pglf);
 $crlf = TTnew('CurrencyListFactory');
 $crlf->getByCompanyId($current_company->getId());
 $currency_options = $crlf->getArrayByListFactory($crlf, FALSE, TRUE);
 $upf = TTnew('UserPreferenceFactory');
 $language_options = TTi18n::getLanguageArray();
 $date_format_options = $upf->getOptions('date_format');
 $time_format_options = $upf->getOptions('time_format');
 $time_unit_format_options = $upf->getOptions('time_unit_format');
 $timesheet_view_options = $upf->getOptions('timesheet_view');
 $start_week_day_options = $upf->getOptions('start_week_day');
 $time_zone_options = $upf->getOptions('time_zone');
 //Make sure we account for wage permissions.
 if ($permission->Check('wage', 'view') == TRUE) {
     $wage_filter_data['permission_children_ids'] = $filter_data['user_ids'];
 }
 $uwlf = TTnew('UserWageListFactory');
 $uwlf->getLastWageByUserIdAndDate($wage_filter_data['permission_children_ids'], TTDate::getTime());
 if ($uwlf->getRecordCount() > 0) {
     foreach ($uwlf as $uw_obj) {
         $user_wage[$uw_obj->getUser()] = array('type_id' => $uw_obj->getType(), 'type' => Option::getByKey($uw_obj->getType(), $uw_obj->getOptions('type')), 'wage' => $uw_obj->getWage(), 'effective_date' => $uw_obj->getEffectiveDate());
 function setLanguage($value)
 {
     $value = trim($value);
     $language_options = TTi18n::getLanguageArray();
     $key = Option::getByValue($value, $language_options);
     if ($key !== FALSE) {
         $value = $key;
     }
     if ($this->Validator->inArrayKey('language', $value, TTi18n::gettext('Incorrect language'), $language_options)) {
         $this->data['language'] = $value;
         return TRUE;
     }
     return FALSE;
 }
Exemplo n.º 3
0
        if (DEPLOYMENT_ON_DEMAND == FALSE and isset($config_vars['other']['installer_enabled']) and $config_vars['other']['installer_enabled'] == TRUE) {
            //Installer is enabled, check to see if any companies have been created, if not redirect to installer automatically, as they skipped it somehow.
            //Check if Company table exists first, incase the installer hasn't run at all, this avoids a SQL error.
            $install_obj = new Install();
            if ($install_obj->checkTableExists('company') == TRUE) {
                $clf = TTnew('CompanyListFactory');
                $clf->getAll();
                if ($clf->getRecordCount() == 0) {
                    Redirect::Page(URLBuilder::getURL(array('external_installer' => 1), 'install/install.php'));
                }
            } else {
                Redirect::Page(URLBuilder::getURL(array('external_installer' => 1), 'install/install.php'));
            }
        }
        break;
}
$smarty->assign_by_ref('user_name', $user_name);
$smarty->assign_by_ref('password', $password);
$smarty->assign_by_ref('password_reset', $password_reset);
$smarty->assign('language_options', TTi18n::getLanguageArray());
if (isset($config_vars)) {
    $smarty->assign_by_ref('config_vars', $config_vars);
}
if ($language == '') {
    $language = TTi18n::getLanguageFromLocale();
} elseif (strlen($language) >= 4) {
    $language = TTi18n::getLanguageFromLocale($language);
}
$smarty->assign('language', $language);
$smarty->assign_by_ref('validator', $validator);
$smarty->display('Login.tpl');
Exemplo n.º 4
0
        $utlf = TTnew('UserTitleListFactory');
        $user_titles = $utlf->getByCompanyIdArray($current_company->getId());
        $user_data['title_options'] = $user_titles;
        //Get Permission Groups
        $pclf = TTnew('PermissionControlListFactory');
        $pclf->getByCompanyId($current_company->getId());
        $user_data['permission_control_options'] = $pclf->getArrayByListFactory($pclf, FALSE);
        //Get pay period schedules
        $ppslf = TTnew('PayPeriodScheduleListFactory');
        $pay_period_schedules = $ppslf->getByCompanyIDArray($current_company->getId());
        $user_data['pay_period_schedule_options'] = $pay_period_schedules;
        $pglf = TTnew('PolicyGroupListFactory');
        $policy_groups = $pglf->getByCompanyIDArray($current_company->getId());
        $user_data['policy_group_options'] = $policy_groups;
        $user_data['company'] = $current_company->getName();
        $user_data['language_options'] = TTi18n::getLanguageArray();
        $user_data['date_format_options'] = $upf->getOptions('date_format');
        $user_data['other_date_format_options'] = $upf->getOptions('other_date_format');
        $user_data['time_format_options'] = $upf->getOptions('time_format');
        $user_data['time_unit_format_options'] = $upf->getOptions('time_unit_format');
        $user_data['timesheet_view_options'] = $upf->getOptions('timesheet_view');
        $user_data['start_week_day_options'] = $upf->getOptions('start_week_day');
        $timezone_options = Misc::prependArray(array(-1 => '---'), $upf->getOptions('time_zone'));
        $user_data['time_zone_options'] = $timezone_options;
        //Get all Company Deductions for drop down box.
        $cdlf = TTnew('CompanyDeductionListFactory');
        $user_data['company_deduction_options'] = $cdlf->getByCompanyIdAndStatusIdArray($current_company->getId(), 10, FALSE);
        $smarty->assign_by_ref('user_data', $user_data);
        $smarty->assign_by_ref('data_saved', $data_saved);
        break;
}
Exemplo n.º 5
0
 function getPreLoginData($api = NULL)
 {
     global $config_vars;
     return array('primary_company_id' => PRIMARY_COMPANY_ID, 'base_url' => Environment::getBaseURL(), 'api_url' => Environment::getAPIURL($api), 'api_base_url' => Environment::getAPIBaseURL($api), 'api_json_url' => Environment::getAPIURL('json'), 'images_url' => Environment::getImagesURL(), 'powered_by_logo_enabled' => $this->isPoweredByLogoEnabled(), 'product_edition' => $this->getTTProductEdition(FALSE), 'product_edition_name' => $this->getTTProductEdition(TRUE), 'deployment_on_demand' => $this->getDeploymentOnDemand(), 'web_session_expire' => (isset($config_vars['other']['web_session_expire']) and $config_vars['other']['web_session_expire'] != '') ? (bool) $config_vars['other']['web_session_expire'] : FALSE, 'analytics_enabled' => $this->isAnalyticsEnabled(), 'registration_key' => $this->getRegistrationKey(), 'http_host' => $this->getHTTPHost(), 'application_version' => $this->getApplicationVersion(), 'is_logged_in' => $this->isLoggedIn(), 'language_options' => Misc::addSortPrefix(TTi18n::getLanguageArray()), 'language' => TTi18n::getLanguageFromLocale(TTi18n::getLocaleCookie()));
 }