New: Install wizard can activate a module during install process.

This commit is contained in:
Laurent Destailleur 2011-06-07 18:34:29 +00:00
parent 9b20de2391
commit bfa08aff52
2 changed files with 20 additions and 1 deletions

View File

@ -1,4 +1,6 @@
<?php
// This file must be presen into htdocs/install directory
// to force values of install wizard.
$force_install_noedit=1;
$force_install_message='KeepDefaultValuesWamp';
$force_install_main_data_root='WAMPROOT/dolibarr_documents';
@ -14,4 +16,6 @@ $force_install_databaserootpass='WAMPMYSQLNEWPASSWORD';
$force_install_dolibarrlogin='admin';
$force_install_nophpinfo='1';
$force_install_lockinstall='644';
$force_install_module='';
?>

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Sebastien DiCintio <sdicintio@ressource-toi.org>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
@ -30,6 +30,7 @@
include_once("./inc.php");
if (file_exists($conffile)) include_once($conffile);
require_once($dolibarr_main_document_root . "/lib/databases/".$dolibarr_main_db_type.".lib.php");
require_once($dolibarr_main_document_root . "/lib/admin.lib.php");
$setuplang=isset($_POST["selectlang"])?$_POST["selectlang"]:(isset($_GET["selectlang"])?$_GET["selectlang"]:'auto');
@ -215,6 +216,20 @@ if ($action == "set" || preg_match('/upgrade/i',$action))
$conf->global->MAIN_REMOVE_INSTALL_WARNING=1;
}
// If we ask to force some modules to be enabled
if (! empty($force_install_module))
{
$tmparray=explode(',',$force_install_module);
foreach ($tmparray as $modtoactivate)
{
$modtoactivatenew=preg_replace('/\.class\.php$/i','',$modtoactivate);
dolibarr_install_syslog('install/etape5.php Activate module '.$modtoactivatenew);
$result=Activate($modtoactivatenew);
$mesg='';
if ($result) $mesg=$result;
}
}
dolibarr_install_syslog('install/etape5.php Remove MAIN_NOT_INSTALLED const', LOG_DEBUG);
$resql=$db->query("DELETE FROM llx_const WHERE ".$db->decrypt('name')."='MAIN_NOT_INSTALLED'");
if (! $resql) dol_print_error($db,'Error in setup program');