Skip to content
Snippets Groups Projects
  • Thane de Loth's avatar
    7042e6c8
    Adopt translation work from Thane de Loth · 7042e6c8
    Thane de Loth authored
    Multilanguage Support via gettext
    
    - added gettext encapsulations to all texts i thought necessary
    - added fallback function for the case that the gettext extension isn't loaded
    - added browser language detection
    - added gettext to the list of optional extensions in setup
    - rewritten some of the texts to use sprintf instead of appending strings
    - added german translation file
    - removed mark_overdue-confirm from cannedresponses.inc.php
    
    extend multi language support and a fex fixes
    
    - Better detection of translation files
    - Added functionality to redirect language codes (see redirecting
    language codes)
    - Ticket Status can be translated
    - The Datepicker can be translated
    - Extended functionality of 'testlang.php' to show what language code is
    used to translate
    
    Forgotten to apply a patch from RC5 to RC6
    
    - Forgotten to change $var to $vars in line 380 of class.mailfetch.php
    - Removed unneeded comment
    
    Added php_gettext as primary translation engine
    
    - Added php_gettext support (thanks to Danilo Segan and Steven
    Armstrong)
    - php_gettext is now the primary translation engine
    - Extended language detection functionality
    
    Add error/misconfiguration checks and fix undefined variables
    7042e6c8
    History
    Adopt translation work from Thane de Loth
    Thane de Loth authored
    Multilanguage Support via gettext
    
    - added gettext encapsulations to all texts i thought necessary
    - added fallback function for the case that the gettext extension isn't loaded
    - added browser language detection
    - added gettext to the list of optional extensions in setup
    - rewritten some of the texts to use sprintf instead of appending strings
    - added german translation file
    - removed mark_overdue-confirm from cannedresponses.inc.php
    
    extend multi language support and a fex fixes
    
    - Better detection of translation files
    - Added functionality to redirect language codes (see redirecting
    language codes)
    - Ticket Status can be translated
    - The Datepicker can be translated
    - Extended functionality of 'testlang.php' to show what language code is
    used to translate
    
    Forgotten to apply a patch from RC5 to RC6
    
    - Forgotten to change $var to $vars in line 380 of class.mailfetch.php
    - Removed unneeded comment
    
    Added php_gettext as primary translation engine
    
    - Added php_gettext support (thanks to Danilo Segan and Steven
    Armstrong)
    - php_gettext is now the primary translation engine
    - Extended language detection functionality
    
    Add error/misconfiguration checks and fix undefined variables
upgrade.php 3.31 KiB
<?php
/*********************************************************************
    upgrade.php

    osTicket Upgrade Wizard

    Peter Rotich <peter@osticket.com>
    Copyright (c)  2006-2013 osTicket
    http://www.osticket.com

    Released under the GNU General Public License WITHOUT ANY WARRANTY.
    See LICENSE.TXT for details.

    vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/
require_once 'admin.inc.php';
require_once INCLUDE_DIR.'class.upgrader.php';

//$_SESSION['ost_upgrader']=null;
$upgrader = new Upgrader(TABLE_PREFIX, UPGRADE_DIR.'streams/');
$errors=array();
if($_POST && $_POST['s'] && !$upgrader->isAborted()) {
    switch(strtolower($_POST['s'])) {
        case 'prereq':
            if(!$ost->isUpgradePending()) {
                $errors['err']=__('Nothing to do! System already upgraded to the current version');
            } elseif(!$upgrader->isUpgradable()) {
                $errors['err']=__('The upgrader does NOT support upgrading from the current vesion!');
            } elseif(!$upgrader->check_prereq()) {
                $errors['prereq']=__('Minimum requirements not met! Refer to Release Notes for more information');
            } elseif(!strcasecmp(basename(CONFIG_FILE), 'settings.php')) {
                $errors['err']=__('Config file rename required to continue!');
            } else {
                $upgrader->setState('upgrade');
            }
            break;
        case 'upgrade': //Manual upgrade.... when JS (ajax) is not supported.
            if($upgrader->getTask()) {
                $upgrader->doTask();
            } elseif($ost->isUpgradePending() && $upgrader->isUpgradable()) {
                $upgrader->upgrade();
            } elseif(!$ost->isUpgradePending()) {
                $upgrader->setState('done');
            }

            if(($errors=$upgrader->getErrors()))  {
                $upgrader->setState('aborted');
            }
            break;
        default:
            $errors['err']=__('Unknown action!');
    }
}

switch(strtolower($upgrader->getState())) {
    case 'aborted':
        $inc='aborted.inc.php';
        break;
    case 'upgrade':
        $inc='upgrade.inc.php';
        break;
    case 'done':
        $inc='done.inc.php';
        break;
    default:
        $inc='prereq.inc.php';
        if($upgrader->isAborted())
            $inc='aborted.inc.php';
        elseif(!strcasecmp(basename(CONFIG_FILE), 'settings.php'))
            $inc='rename.inc.php';
        elseif(!$ost->isUpgradePending())
            $errors['err']=sprintf(__('Nothing to do! System already upgraded to <b>%s</b> with no pending patches to apply.'),$ost->getVersion());
        elseif(!$upgrader->isUpgradable())
            $errors['err']=sprintf(__('The upgrader does NOT support upgrading from the current patch [%s]!'), $cfg->getSchemaSignature());

}

$nav = new AdminNav($thisstaff);
$nav->setTabActive('dashboard');
$nav->addSubMenu(array('desc'=>'Upgrader',
                           'title'=>'Upgrader',
                           'href'=>'upgrade.php',
                           'iconclass'=>'preferences'),
                        true);
$ost->addExtraHeader('<script type="text/javascript" src="./js/upgrader.js"></script>');
require(STAFFINC_DIR.'header.inc.php');
require(UPGRADE_DIR.$inc);
require(STAFFINC_DIR.'footer.inc.php');
?>