示例#1
0
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkAdmin();
$cmd = CValue::post("cmd");
$mod_id = CValue::post("mod_id");
$mod_name = CValue::post("mod_name");
$mobile = CValue::post("mobile", 0);
// If it we come from the installer script
if ($cmd == "upgrade-core") {
    // we deactivate errors under error
    $old_er = error_reporting(E_ERROR);
    $module = new CModule();
    $module->mod_type = "core";
    /** @var CModule[] $list_modules */
    $list_modules = $module->loadMatchingList();
    foreach ($list_modules as $module) {
        $setupClass = "CSetup{$module->mod_name}";
        /** @var CSetup $setup */
        $setup = new $setupClass();
        if ($module->mod_version = $setup->upgrade($module->mod_version)) {
            $module->mod_type = $setup->mod_type;
            $module->store();
            if ($setup->mod_version == $module->mod_version) {
                CAppUI::setMsg("Installation de '%s' à la version %s", UI_MSG_OK, $module->mod_name, $setup->mod_version);
            } else {
                CAppUI::setMsg("Installation de '{$module->mod_name}' à la version {$module->mod_version} sur {$setup->mod_version}", UI_MSG_WARNING, true);
            }
        } else {
            CAppUI::setMsg("Module '%s' non mis à jour", UI_MSG_WARNING, $module->mod_name);
        }
示例#2
0
 * @subpackage System
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19290 $
 */
CCanDo::checkAdmin();
$cmd = CValue::get("cmd");
$mod_id = CValue::get("mod_id");
$mod_name = CValue::get("mod_name");
// If it we come from the installer script
if ($cmd == "upgrade-core") {
    // we deactivate errors under error
    $old_er = error_reporting(E_ERROR);
    $module = new CModule();
    $module->mod_type = "core";
    $list_modules = $module->loadMatchingList($module->_spec->key);
    foreach ($list_modules as $module) {
        $setupClass = "CSetup{$module->mod_name}";
        /** @var CSetup $setup */
        $setup = new $setupClass();
        if ($module->mod_version = $setup->upgrade($module->mod_version, true)) {
            $module->mod_type = $setup->mod_type;
            $module->store();
            if ($setup->mod_version == $module->mod_version) {
                CAppUI::setMsg("Installation de '%s' à la version %s", UI_MSG_OK, $module->mod_name, $setup->mod_version);
            } else {
                CAppUI::setMsg("Installation de '%s' à la version %s sur %s", UI_MSG_WARNING, $module->mod_name, $module->mod_version, $setup->mod_version);
            }
        } else {
            CAppUI::setMsg("Module '%s' non mis à jour", UI_MSG_WARNING, $module->mod_name);
        }