From f6a8aacc8d38578db214a68998834f59e8cd9b4d Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Fri, 10 Feb 2017 18:42:59 +0100
Subject: [PATCH] Fix: deployement of a module

---
 htdocs/admin/tools/update.php | 30 +++++++++++++++++++-----------
 htdocs/langs/en_US/admin.lang |  5 +++--
 2 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php
index 5cebb1dac4e..912016b498c 100644
--- a/htdocs/admin/tools/update.php
+++ b/htdocs/admin/tools/update.php
@@ -143,7 +143,7 @@ if ($action=='install')
 
 	if (! $error)
 	{
-		setEventMessages($langs->trans("SetupIsReadyForUse"), null, 'mesgs');
+		setEventMessages($langs->trans("SetupIsReadyForUse", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules")), null, 'warnings');
 	}
 }
 
@@ -170,6 +170,8 @@ print $langs->trans("CurrentVersion").' : <b>'.DOL_VERSION.'</b><br>';
 
 if (function_exists('curl_init'))
 {
+    $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
+    
     $result = getURLContent('http://sourceforge.net/projects/dolibarr/rss');
     //var_dump($result['content']);
     $sfurl = simplexml_load_string($result['content']);
@@ -281,26 +283,32 @@ if ($allowfromweb < 1)
 
 if ($allowfromweb >= 0)
 {
-	if ($allowfromweb == 1) print $langs->trans("ThisIsProcessToFollow").'<br>';
-	else print $langs->trans("ThisIsAlternativeProcessToFollow").'<br>';
-	print '<b>'.$langs->trans("StepNb",1).'</b>: ';
-	print $langs->trans("FindPackageFromWebSite",$fullurl).'<br>';
-	print '<b>'.$langs->trans("StepNb",2).'</b>: ';
-	print $langs->trans("DownloadPackageFromWebSite",$fullurl).'<br>';
-	print '<b>'.$langs->trans("StepNb",3).'</b>: ';
+	if ($allowfromweb == 1) 
+	{
+	    //print $langs->trans("ThisIsProcessToFollow").'<br>';
+	}
+	else 
+	{
+	    print $langs->trans("ThisIsAlternativeProcessToFollow").'<br>';
+    	print '<b>'.$langs->trans("StepNb",1).'</b>: ';
+    	print $langs->trans("FindPackageFromWebSite",$fullurl).'<br>';
+    	print '<b>'.$langs->trans("StepNb",2).'</b>: ';
+    	print $langs->trans("DownloadPackageFromWebSite",$fullurl).'<br>';
+    	print '<b>'.$langs->trans("StepNb",3).'</b>: ';
+	}
 
 	if ($allowfromweb == 1)
 	{
-		print $langs->trans("UnpackPackageInDolibarrRoot",$dirins).'<br>';
+		print $langs->trans("UnpackPackageInModulesRoot",$dirins).'<br>';
 		print '<form enctype="multipart/form-data" method="POST" class="noborder" action="'.$_SERVER["PHP_SELF"].'" name="forminstall">';
 		print '<input type="hidden" name="action" value="install">';
 		print $langs->trans("YouCanSubmitFile").' <input type="file" name="fileinstall"> ';
-		print '<input type="submit" name="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">';
+		print '<input type="submit" name="send" value="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">';
 		print '</form>';
 	}
 	else
 	{
-		print $langs->trans("UnpackPackageInDolibarrRoot",$dirins).'<br>';
+		print $langs->trans("UnpackPackageInModulesRoot",$dirins).'<br>';
 		print '<b>'.$langs->trans("StepNb",4).'</b>: ';
 		print $langs->trans("SetupIsReadyForUse").'<br>';
 	}
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 45f55a20eba..93f76c49187 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -284,8 +284,9 @@ ThisIsAlternativeProcessToFollow=This is an alternative setup to process:
 StepNb=Step %s
 FindPackageFromWebSite=Find a package that provides feature you want (for example on official web site %s).
 DownloadPackageFromWebSite=Download package (for example from official web site %s).
-UnpackPackageInDolibarrRoot=Unpack package file into Dolibarr server directory dedicated to external modules: <b>%s</b>
-SetupIsReadyForUse=Install is finished and Dolibarr is ready to use with this new component.
+UnpackPackageInDolibarrRoot=Unpack package files into Dolibarr server directory dedicated to Dolibarr: <b>%s</b>
+UnpackPackageInModulesRoot=Unpack package files into Dolibarr server directory dedicated to modules: <b>%s</b>
+SetupIsReadyForUse=Module deployement is finished. You must however enable and setup the module in your application by going on the page to setup modules: <a href="%s">%s</a>.
 NotExistsDirect=The alternative root directory is not defined.<br>
 InfDirAlt=Since version 3 it is possible to define an alternative root directory.This allows you to store, same place, plug-ins and custom templates.<br>Just create a directory at the root of Dolibarr (eg: custom).<br>
 InfDirExample=<br>Then declare it in the file conf.php<br> $dolibarr_main_url_root_alt='http://myserver/custom'<br>$dolibarr_main_document_root_alt='/path/of/dolibarr/htdocs/custom'<br>*These lines are commented with "#", to uncomment only remove the character.
-- 
GitLab