Przeglądaj źródła

Enhancement of DoliWamp

Laurent Destailleur 16 lat temu
rodzic
commit
9105a53d43

+ 13 - 2
build/exe/doliwamp/doliwamp.iss

@@ -65,6 +65,7 @@ Source: "build\exe\doliwamp\startdoliwamp.bat"; DestDir: "{app}\"; Flags: ignore
 Source: "build\exe\doliwamp\removefiles.bat"; DestDir: "{app}\"; Flags: ignoreversion;
 Source: "build\exe\doliwamp\rundoliwamp.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
 Source: "build\exe\doliwamp\rundolihelp.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
+Source: "build\exe\doliwamp\rundoliadmin.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
 Source: "build\exe\doliwamp\install_services.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
 Source: "build\exe\doliwamp\uninstall_services.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
 Source: "build\exe\doliwamp\mysqlinitpassword.bat.install"; DestDir: "{app}\"; Flags: ignoreversion;
@@ -105,6 +106,7 @@ Name: "{group}\Dolibarr ERP-CRM"; Filename: "{app}\rundoliwamp.bat"; WorkingDir:
 Name: "{group}\Tools\Help center"; Filename: "{app}\rundolihelp.bat"; WorkingDir: "{app}"; IconFilename: {app}\www\dolibarr\doc\images\dolihelp.ico
 Name: "{group}\Tools\Start DoliWamp server"; Filename: "{app}\startdoliwamp.bat"; WorkingDir: "{app}"; IconFilename: {app}\www\dolibarr\doc\images\doliwampon.ico
 Name: "{group}\Tools\Stop DoliWamp server"; Filename: "{app}\stopdoliwamp.bat"; WorkingDir: "{app}"; IconFilename: {app}\www\dolibarr\doc\images\doliwampoff.ico
+Name: "{group}\Tools\Admin DoliWamp server"; Filename: "{app}\rundoliadmin.bat"; WorkingDir: "{app}"; IconFilename: {app}\www\dolibarr\doc\images\doliadmin.ico
 Name: "{group}\Tools\Uninstall DoliWamp"; Filename: "{app}\unins000.exe"; WorkingDir: "{app}"; IconFilename: {app}\uninstall_services.bat
 Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Dolibarr"; WorkingDir: "{app}"; Filename: "{app}\rundoliwamp.bat"; Tasks: quicklaunchicon; IconFilename: {app}\www\dolibarr\doc\images\dolibarr.ico
 Name: "{userdesktop}\Dolibarr ERP-CRM"; Filename: "{app}\rundoliwamp.bat"; WorkingDir: "{app}"; Tasks: desktopicon; IconFilename: {app}\www\dolibarr\doc\images\dolibarr.ico
@@ -303,7 +305,7 @@ begin
 
 
     //----------------------------------------------
-    // rundoliwamp.bat and rundolihelp.bat
+    // rundoliwamp.bat, rundolihelp.bat and rundoliadmin.bat
     //----------------------------------------------
 
     destFile := pathWithSlashes+'/rundoliwamp.bat';
@@ -312,7 +314,11 @@ begin
     destFileH := pathWithSlashes+'/rundolihelp.bat';
     srcFileH := pathWithSlashes+'/rundolihelp.bat.install';
 
-    if (not FileExists (destFile) or not FileExists (destFileH)) and (FileExists(srcFile) and FileExists(srcFileH)) then
+    destFileA := pathWithSlashes+'/rundoliadmin.bat';
+    srcFileA := pathWithSlashes+'/rundoliadmin.bat.install';
+
+    if (not FileExists (destFile) or not FileExists (destFileH) or not FileExists (destFileA))
+     and (FileExists(srcFile) and FileExists(srcFileH) and FileExists(srcFileA)) then
     begin
       //navigateur
       browser := 'explorer.exe';
@@ -337,6 +343,11 @@ begin
       StringChange (srcContents, 'WAMPBROWSER', browser);
       StringChange (srcContents, 'WAMPAPACHEPORT', myporta);
       SaveStringToFile(destFileH,srcContents, False);
+      
+      LoadStringFromFile (srcFileA, srcContents);
+      StringChange (srcContents, 'WAMPBROWSER', browser);
+      StringChange (srcContents, 'WAMPAPACHEPORT', myporta);
+      SaveStringToFile(destFileA,srcContents, False);
     end
 
 

+ 55 - 26
build/exe/doliwamp/index.php.install

@@ -18,10 +18,10 @@ $appDir = '../apps/';
 
 
 // we set version of applications
-$phpVersion = '5.2.5';
-$apacheVersion = '2.2.6';
-$mysqlVersion = '5.0.45';
-
+$phpVersion = 'WAMPPHPVERSION';
+$apacheVersion = 'WAMPAPACHEVERSION';
+$mysqlVersion = 'WAMPMYSQLVERSION';
+$apachePort = 'WAMPAPACHEPORT';
 
 
 // directories to ignore in project list
@@ -32,8 +32,10 @@ $projectsListIgnore = array ('.','..');
 $langues = array(
 	'en' => array(
 		'langue' => 'English',
-		'autreLangue' => 'Version Française',
-		'autreLangueLien' => 'fr',
+		'autreLangue1' => 'Español',
+		'autreLangueLien1' => 'es',
+		'autreLangue2' => 'Français',
+		'autreLangueLien2' => 'fr',
 		'titreHtml' => 'DoliWamp Homepage',
 		'titreConf' => 'Server Configuration',
 		'versa' => 'Apache Version :',
@@ -46,14 +48,19 @@ $langues = array(
 		'txtProjet' => 'Your Softwares',
 		'txtNoProjet' => 'No other softwares. To create a new one, just create a directory in \'www\'.',
 		'txtApp' => 'Applications',
+		'FromLocalNetwork' => 'URL for local access',
+		'FromInternet' => 'URL for Internet',
+		'NotAvailable' => 'Not available',
 		'faq' => 'http://www.en.wampserver.com/faq.php',
 		'ipserver' => 'Name/IP Server:',
-		'askhelp' => 'Request a help support'
+		'askhelp' => 'Dolibarr Help center'
 	),
 	'fr' => array(
 		'langue' => 'Français',
-		'autreLangue' => 'Versión Español',
-		'autreLangueLien' => 'es',
+		'autreLangue1' => 'Español',
+		'autreLangueLien1' => 'es',
+		'autreLangue2' => 'English',
+		'autreLangueLien2' => 'en',
 		'titreHtml' => 'Accueil DoliWamp',
 		'titreConf' => 'Configuration Serveur',
 		'versa' => 'Version de Apache:',
@@ -66,14 +73,19 @@ $langues = array(
 		'txtProjet' => 'Autres applications (sans alias)',
 		'txtNoProjet' => 'Pas d\'autre application. Pour en ajouter une nouvelle, créez simplement un répertoire dans \'www\'.',
 		'txtApp' => 'Applications',
+		'FromLocalNetwork' => 'URL accès local',
+		'FromInternet' => 'URL accès par Internet',
+		'NotAvailable' => 'Non disponible',
 		'faq' => 'http://www.wampserver.com/faq.php',
 		'ipserver' => 'Name/IP Serveur:',
-		'askhelp' => 'Demander une aide au support'
+		'askhelp' => 'Centre d\'assistance Dolibarr'
 	),
 	'es' => array(
 		'langue' => 'Español',
-		'autreLangue' => 'English Version',
-		'autreLangueLien' => 'en',
+		'autreLangue1' => 'English',
+		'autreLangueLien1' => 'en',
+		'autreLangue2' => 'Français',
+		'autreLangueLien2' => 'fr',
 		'titreHtml' => 'Inicio DoliWamp',
 		'titreConf' => 'Configuración Servidor',
 		'versa' => 'Versión de Apache:',
@@ -86,6 +98,9 @@ $langues = array(
 		'txtProjet' => 'Otras aplicaciones (sin alias)',
 		'txtNoProjet' => 'Ninguna otra aplicación. Para añadir una nueva, simplemente cree una carpeta en \'www\'.',
 		'txtApp' => 'Aplicaciones',
+		'FromLocalNetwork' => 'URL for local access',
+		'FromInternet' => 'URL for Internet',
+		'NotAvailable' => 'Not available',
 		'faq' => 'http://www.wampserver.com/faq.php',
 		'ipserver' => 'Nombre/IP Servidor',
 		'askhelp' => 'Pedir ayuda o soporte'
@@ -331,19 +346,22 @@ if (is_dir($aliasDir))
 	    if (is_file($aliasDir.$file) && ereg('.conf',$file))
 	    {		
 		    $msg = '';
+
+			$aliasContents.='<tr><td><ul class="aliases">';
+
 		    $aliasContents .= '<li><a href="'.ereg_replace('.conf','',$file).'/">';
 			$file = ereg_replace('.conf','',$file);
-			if (eregi('dolibarr',$file)) $aliasContents .= $file.'</a> (URL: http://<i>ipofyourserver</i>:81/'.$file.'/)';
-			elseif (eregi('phpmyadmin',$file)) $aliasContents .= $file.'</a> (URL: http://<i>ipofyourserver</i>:81/'.$file.'/)';
-			else $aliasContents .= $file.'</a>';
-			$aliasContents.='</li>';
+			if (eregi('dolibarr',$file)) $aliasContents .= $file.'</a></li></ul></td><td>http://localhost'.($apachePort != 80?':'.$apachePort:'').'/'.$file.'/</td><td>http://<i>ipofyourserver</i>'.($apachePort != 80?':'.$apachePort:'').'/'.$file.'/</td></tr>';
+			elseif (eregi('phpmyadmin',$file)) $aliasContents .= $file.'</a></li></ul></td><td>http://localhost'.($apachePort != 80?':'.$apachePort:'').'/'.$file.'/</td><td>'.$langues[$langue]['NotAvailable'].'</td></tr>';
+			else $aliasContents .= $file.'</a></li></ul></td> <td> </td><td>'.$langues[$langue]['NotAvailable'].'</td></tr>';
+			
 			$aliasarray[]=$file;
 	    }
     }
     closedir($handle);
 }
 if (!isset($aliasContents))
-	$aliasContents = $langues[$langue]['txtNoAlias'];
+	$aliasContents = '<tr><td colspan="3">'.$langues[$langue]['txtNoAlias'].'</td></tr>';
 	
 
 // Read projects in www dir
@@ -359,14 +377,18 @@ foreach($listoffiles as $file)
 {
 	if (is_dir($file) && !in_array($file,$projectsListIgnore) && !in_array($file,$aliasarray)) 
 	{		
+		$projectContents .= '<tr><td><ul class="projects">';
+		
 		$projectContents .= '<li><a href="'.$file.'/">';
-		$projectContents .= $file.'</a> (URL: http://<i>ipofyourserver</i>:81/'.$file.'/)';
+		$projectContents .= $file.'</a>';
 		$projectContents .= '</li>';
+		
+		$projectContents .= '</ul></td><td>http://localhost'.($apachePort != 80?':'.$apachePort:'').'/'.$file.'/)'.'</td><td>'.$langues[$langue]['NotAvailable'].'</td></tr>';
 	}
 }
 
 if (!isset($projectContents))
-	$projectContents = $langues[$langue]['txtNoProjet'];
+	$projectContents = '<tr><td colspan="3">'.$langues[$langue]['txtNoProjet'].'</td></tr>';
 
 
 
@@ -380,7 +402,7 @@ $pageContents = <<< EOPAGE
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
 	"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 
-<html lang="en" xml:lang="en">
+<html lang="$langue" xml:lang="$langue">
 <head>
 	<title>{$langues[$langue]['titreHtml']}</title>
 	<meta http-equiv="Content-Type" content="txt/html; charset=utf-8" />
@@ -501,7 +523,8 @@ a:hover {
 <td align="right">
 	<ul class="utility">
 		<li>${wampserverVersion}</li>
-		<li><a href="?lang={$langues[$langue]['autreLangueLien']}">{$langues[$langue]['autreLangue']}</a></li>
+		<li><a href="?lang={$langues[$langue]['autreLangueLien1']}">{$langues[$langue]['autreLangue1']}</a>
+		- <a href="?lang={$langues[$langue]['autreLangueLien2']}">{$langues[$langue]['autreLangue2']}</a></li>
 		<br><br>
 		<li>Provided by <a href="http://www.nltechno.com" targer="_blank">NLTechno</a></li>
 	</ul>
@@ -527,17 +550,23 @@ a:hover {
 	</dl>
 
 	<h2>{$langues[$langue]['txtApp']}</h2>
-	<ul class="aliases">
+	<table width="100%" style="padding: 0px 0px 0px 0px;">
+	<tr valign="middle"><td>
+	{$langues[$langue]['txtApp']}
+	</td><td valign="middle">
+	{$langues[$langue]['FromLocalNetwork']}
+	</td><td valign="middle">
+	{$langues[$langue]['FromInternet']}
+	</td></tr>
 	${aliasContents}			
-	<ul class="projects">
-	$projectContents
-	</ul>
+	${projectContents}			
+	</table>
 
 	<h2>{$langues[$langue]['titrePage']}</h2>
 	<ul class="tools">
 		<li><a href="index.php?phpinfo=1">Phpinfo</a></li>
 		<li><a href="server-status">Server-status</a></li>
-		<li><a href="/dolibarr/support/onlinesupport.php">{$langues[$langue]['askhelp']}</a></li>
+		<li><a href="/dolibarr/support/index.php">{$langues[$langue]['askhelp']}</a></li>
 	</ul>
 
 

+ 6 - 0
build/exe/doliwamp/rundoliadmin.bat.install

@@ -0,0 +1,6 @@
+@echo off
+REM Launch Dolibarr Admin center
+REM ----------------------------
+
+REM Go to admin center page
+start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/

BIN
doc/images/doliadmin.ico


+ 80 - 40
htdocs/install/etape5.php

@@ -33,6 +33,11 @@ include_once("./inc.php");
 $setuplang=isset($_POST["selectlang"])?$_POST["selectlang"]:(isset($_GET["selectlang"])?$_GET["selectlang"]:'auto');
 $langs->setDefaultLang($setuplang);
 
+// TODO Send value from migrate choice
+$targetversion=DOL_VERSION;
+if (isset($_REQUEST["targetversion"])) $targetversion=$_REQUEST["targetversion"];
+
+
 $langs->load("admin");
 $langs->load("install");
 
@@ -162,9 +167,10 @@ if ($_POST["action"] == "set" || $_POST["action"] == "upgrade")
 			{
 				$db->begin();
 
-				dolibarr_install_syslog('install/etape5.php set MAIN_VERSION_LAST_INSTALL const to '.DOL_VERSION, LOG_DEBUG);
+				dolibarr_install_syslog('install/etape5.php set MAIN_VERSION_LAST_INSTALL const to '.$targetversion, LOG_DEBUG);
 				$db->query("DELETE FROM llx_const WHERE name='MAIN_VERSION_LAST_INSTALL'");
-				$db->query("INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL','".DOL_VERSION."','chaine',0,'Dolibarr version when install',0)");
+				$db->query("INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL','".$targetversion."','chaine',0,'Dolibarr version when install',0)");
+				$conf->global->MAIN_VERSION_LAST_INSTALL=$targetversion;
 
 				dolibarr_install_syslog('install/etape5.php Remove MAIN_NOT_INSTALLED const', LOG_DEBUG);
 				$db->query("DELETE FROM llx_const WHERE name='MAIN_NOT_INSTALLED'");
@@ -177,13 +183,17 @@ if ($_POST["action"] == "set" || $_POST["action"] == "upgrade")
 			print $langs->trans("Error")."<br>";
 		}
 	}
-
 	// If upgrade
-	if ($_POST["action"] == "upgrade")
+	elseif ($_POST["action"] == "upgrade")
 	{
-		dolibarr_install_syslog('install/etape5.php set MAIN_VERSION_LAST_UPGRADE const to value '.DOL_VERSION, LOG_DEBUG);
+		dolibarr_install_syslog('install/etape5.php set MAIN_VERSION_LAST_UPGRADE const to value '.$targetversion, LOG_DEBUG);
 		$db->query("DELETE FROM llx_const WHERE name='MAIN_VERSION_LAST_UPGRADE'");
-		$db->query("INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_UPGRADE','".DOL_VERSION."','chaine',0,'Dolibarr version for last upgrade',0)");
+		$db->query("INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_UPGRADE','".$targetversion."','chaine',0,'Dolibarr version for last upgrade',0)");
+		$conf->global->MAIN_VERSION_LAST_UPGRADE=$targetversion;
+	}
+	else
+	{
+		dol_print_error('','install/etape5.php Unknown choice of action');
 	}
 
 	// May fail if parameter already defined
@@ -197,68 +207,98 @@ if ($_POST["action"] == "set" || $_POST["action"] == "upgrade")
 print "<br>";
 
 
+// Create lock file
+
 // If first install
 if ($_POST["action"] == "set")
 {
-	// Fin install
-	print $langs->trans("SystemIsInstalled")."<br>";
-	if (empty($force_install_lockinstall))
+	if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION))
 	{
-		print '<div class="warning">'.$langs->trans("WarningRemoveInstallDir")."</div>";
+		// Install is finished
+		print $langs->trans("SystemIsInstalled")."<br>";
+		if (empty($force_install_lockinstall))
+		{
+			print '<div class="warning">'.$langs->trans("WarningRemoveInstallDir")."</div>";
+		}
+		else
+		{
+			// Install is finished, we create the lock file
+			$fp = fopen("../../install.lock", "w");
+			fwrite($fp, "This is a lock file to prevent use of install pages");
+			fclose($fp);
+		}
+
+		print "<br>";
+
+		print $langs->trans("YouNeedToPersonalizeSetup")."<br><br>";
+
+		print '<center><a href="'.$dolibarr_main_url_root .'/admin/index.php?mainmenu=home&leftmenu=setup'.(isset($_POST["login"])?'&username='.urlencode($_POST["login"]):'').'">';
+		print $langs->trans("GoToSetupArea");
+		print '</a></center>';
 	}
 	else
 	{
-		// Open the file and erase the contents if any
-		$fp = fopen("../../install.lock", "w");
-		fwrite($fp, "This is a lock file to prevent use of install pages");
-		fclose($fp);
-	}
+		// If here MAIN_VERSION_LAST_UPGRADE is not empty
+		print $langs->trans("VersionLastUpgrade").': <b><font class="ok">'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</font></b><br>';
+		print $langs->trans("VersionProgram").': <b><font class="ok">'.DOL_VERSION.'</font></b>';
 
-	print "<br>";
+		print "<br>";
 
-	print $langs->trans("YouNeedToPersonalizeSetup")."<br><br>";
+		print '<center><a href="'.$dolibarr_main_url_root .'/install/index.php">';
+		print $langs->trans("GoToUpgradePage");
+		print '</a></center>';
+	}
 }
-
 // If upgrade
-if ($_POST["action"] == "upgrade")
+elseif ($_POST["action"] == "upgrade")
 {
-	// Fin install
-	print $langs->trans("SystemIsUpgraded")."<br>";
-	if (empty($force_install_lockinstall))
+	if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION))
 	{
-		print '<div class="warning">'.$langs->trans("WarningRemoveInstallDir")."</div>";
+		// Upgrade is finished
+		print $langs->trans("SystemIsUpgraded")."<br>";
+		if (empty($force_install_lockinstall))
+		{
+			print '<div class="warning">'.$langs->trans("WarningRemoveInstallDir")."</div>";
+		}
+		else
+		{
+			// Upgrade is finished, we create the lock file
+			$fp = fopen("../../install.lock", "w");
+			fwrite($fp, "This is a lock file to prevent use of install pages");
+			fclose($fp);
+		}
+
+		print "<br>";
+
+		print '<center><a href="'.$dolibarr_main_url_root .'/index.php?mainmenu=home'.(isset($_POST["login"])?'&username='.urlencode($_POST["login"]):'').'">';
+		print $langs->trans("GoToDolibarr");
+		print '</a></center>';
 	}
 	else
 	{
-		// Open the file and erase the contents if any
-		$fp = fopen("../../install.lock", "w");
-		fwrite($fp, "This is a lock file to prevent use of install pages");
-		fclose($fp);
-	}
-
-	print "<br>";
-}
+		// If here MAIN_VERSION_LAST_UPGRADE is not empty
+		print $langs->trans("VersionLastUpgrade").': <b><font class="ok">'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</font></b><br>';
+		print $langs->trans("VersionProgram").': <b><font class="ok">'.DOL_VERSION.'</font></b>';
 
+		print "<br>";
 
-if ($_POST["action"] == "upgrade")
-{
-	print '<center><a href="'.$dolibarr_main_url_root .'/index.php?mainmenu=home'.(isset($_POST["login"])?'&username='.urlencode($_POST["login"]):'').'">';
-	print $langs->trans("GoToDolibarr");
-	print '</a></center>';
+		print '<center><a href="'.$dolibarr_main_url_root .'/install/index.php">';
+		print $langs->trans("GoToUpgradePage");
+		print '</a></center>';
+	}
 }
 else
 {
-	print '<center><a href="'.$dolibarr_main_url_root .'/admin/index.php?mainmenu=home&leftmenu=setup'.(isset($_POST["login"])?'&username='.urlencode($_POST["login"]):'').'">';
-	print $langs->trans("GoToSetupArea");
-	print '</a></center>';
+	dol_print_error('','install/etape5.php Unknown choice of action');
 }
 
 
+
 // Clear cache files
 clearstatcache();
 
 
-dolibarr_install_syslog("Dolibarr install/setup finished", LOG_INFO);
+dolibarr_install_syslog("install/etape5.php Dolibarr setup finished", LOG_INFO);
 
 pFooter(1,$setuplang);
 ?>