All things related to translations.
예제 #1
0
파일: init.php 프로젝트: kimai/kimai
// ==================================
// = display membership roles table =
// ==================================
$view->assign('membershipRoles', $database->membership_roles());
$view->assign('tab_membershiprole', $view->render("membershipRoles.php"));
// ========================
// = display status table =
// ========================
$view->assign('statuses', $database->get_statuses());
$view->assign('tab_status', $view->render("status.php"));
// ========================
// = display advanced tab =
// ========================
$showAdvancedTab = $database->global_role_allows($kga['user']['globalRoleID'], 'adminPanel_extension-editAdvanced');
if ($showAdvancedTab) {
    $view->assign('languages', Kimai_Translation_Service::getAvailableLanguages());
    $view->assign('timezones', timezoneList());
    $view->assign('editLimitEnabled', false);
    $view->assign('editLimitDays', '');
    $view->assign('editLimitHours', '');
    if ($kga->isEditLimit()) {
        $view->assign('editLimitEnabled', true);
        $editLimit = $kga->getEditLimit() / (60 * 60);
        // convert to hours
        $view->assign('editLimitDays', (int) ($editLimit / 24));
        $view->assign('editLimitHours', (int) ($editLimit % 24));
    }
    $view->assign('roundTimesheetEntries', false);
    $view->assign('roundMinutes', '');
    $view->assign('roundSeconds', '');
    if ($kga['conf']['roundTimesheetEntries'] != '') {
예제 #2
0
파일: basics.php 프로젝트: kimai/kimai
// ============ setup database ============
// we do not unset the $database variable
// as it is historically referenced in many places from the global namespace
$database = new Kimai_Database_Mysql($kga, true);
if (!$database->isConnected()) {
    die('Kimai could not connect to database. Check your autoconf.php.');
}
Kimai_Registry::setDatabase($database);
// ============ setup authenticator ============
$authClass = 'Kimai_Auth_' . ucfirst($kga->getAuthenticator());
if (!class_exists($authClass)) {
    $authClass = 'Kimai_Auth_Kimai';
}
$authPlugin = new $authClass($database, $kga);
Kimai_Registry::setAuthenticator($authPlugin);
unset($authPlugin);
// ============ load global configurations ============
$database->initializeConfig($kga);
// ============ setup translation object ============
$service = new Kimai_Translation_Service();
Kimai_Registry::setTranslation($service->load($kga->getLanguage()));
unset($service);
$tmpDir = WEBROOT . 'temporary/';
if (!file_exists($tmpDir) || !is_dir($tmpDir) || !is_writable($tmpDir)) {
    die('Kimai needs write permissions for: temporary/');
}
$frontendOptions = array('lifetime' => 7200, 'automatic_serialization' => true);
$backendOptions = array('cache_dir' => $tmpDir);
$cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
Kimai_Registry::setCache($cache);
Zend_Locale::setCache($cache);
예제 #3
0
파일: floaters.php 프로젝트: kimai/kimai
      */
 /**
  * Display the preferences dialog.
  */
 case 'prefs':
     if (isset($kga['customer'])) {
         die;
     }
     $allSkins = glob(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'skins' . DIRECTORY_SEPARATOR . '*', GLOB_ONLYDIR);
     $skins = array();
     foreach ($allSkins as $skin) {
         $name = basename($skin);
         $skins[$name] = $name;
     }
     $languages = array();
     foreach (Kimai_Translation_Service::getAvailableLanguages() as $lang) {
         $languages[$lang] = $lang;
     }
     $view->assign('skins', $skins);
     $view->assign('langs', $languages);
     $view->assign('timezones', timezoneList());
     $view->assign('user', $kga['user']);
     $view->assign('rate', $database->get_rate($kga['user']['userID'], null, null));
     $defaults = array('table_time_format' => $kga->getTableTimeFormat());
     $prefs = $database->user_get_preferences_by_prefix('ui.');
     $view->assign('prefs', array_merge($defaults, $prefs));
     echo $view->render("floaters/preferences.php");
     break;
     /**
      * Display the dialog to add or edit a customer.
      */