check.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. <?php
  2. /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
  5. * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
  6. * Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es>
  7. * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
  8. * Copyright (C) 2015-2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 3 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. */
  23. /**
  24. * \file htdocs/install/check.php
  25. * \ingroup install
  26. * \brief Test if file conf can be modified and if does not exists, test if install process can create it
  27. */
  28. include_once 'inc.php';
  29. global $langs;
  30. $err = 0;
  31. $allowinstall = 0;
  32. $allowupgrade = false;
  33. $checksok = 1;
  34. $setuplang=GETPOST("selectlang",'',3)?GETPOST("selectlang",'',3):$langs->getDefaultLang();
  35. $langs->setDefaultLang($setuplang);
  36. $langs->load("install");
  37. // Now we load forced value from install.forced.php file.
  38. $useforcedwizard=false;
  39. $forcedfile="./install.forced.php";
  40. if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php";
  41. if (@file_exists($forcedfile)) {
  42. $useforcedwizard = true;
  43. include_once $forcedfile;
  44. }
  45. dolibarr_install_syslog("--- check: Dolibarr install/upgrade process started");
  46. /*
  47. * View
  48. */
  49. pHeader('',''); // No next step for navigation buttons. Next step is defined by clik on links.
  50. //print "<br>\n";
  51. //print $langs->trans("InstallEasy")."<br><br>\n";
  52. print '<h3>'.$langs->trans("MiscellaneousChecks").":</h3>\n";
  53. // Check browser
  54. $useragent=$_SERVER['HTTP_USER_AGENT'];
  55. if (! empty($useragent))
  56. {
  57. $tmp=getBrowserInfo($_SERVER["HTTP_USER_AGENT"]);
  58. $browserversion=$tmp['browserversion'];
  59. $browsername=$tmp['browsername'];
  60. if ($browsername == 'ie' && $browserversion < 7) print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("WarningBrowserTooOld")."<br>\n";
  61. }
  62. // Check PHP version
  63. $arrayphpminversionerror = array(5,3,0);
  64. $arrayphpminversionwarning = array(5,3,0);
  65. if (versioncompare(versionphparray(),$arrayphpminversionerror) < 0) // Minimum to use (error if lower)
  66. {
  67. print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionerror));
  68. $checksok=0; // 0=error, 1=warning
  69. }
  70. else if (versioncompare(versionphparray(),$arrayphpminversionwarning) < 0) // Minimum supported (warning if lower)
  71. {
  72. print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPVersionTooLow",versiontostring($arrayphpminversionwarning));
  73. $checksok=0; // 0=error, 1=warning
  74. }
  75. else
  76. {
  77. print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPVersion")." ".versiontostring(versionphparray());
  78. }
  79. if (empty($force_install_nophpinfo)) print ' (<a href="phpinfo.php" target="_blank">'.$langs->trans("MoreInformation").'</a>)';
  80. print "<br>\n";
  81. // Check PHP support for $_POST
  82. if (! isset($_GET["testget"]) && ! isset($_POST["testpost"]))
  83. {
  84. print '<img src="../theme/eldy/img/warning.png" alt="Warning"> '.$langs->trans("PHPSupportPOSTGETKo");
  85. print ' (<a href="'.$_SERVER["PHP_SELF"].'?testget=ok">'.$langs->trans("Recheck").'</a>)';
  86. print "<br>\n";
  87. $checksok=0;
  88. }
  89. else
  90. {
  91. print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupportPOSTGETOk")."<br>\n";
  92. }
  93. // Check if sessions enabled
  94. if (! function_exists("session_id"))
  95. {
  96. print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportSessions")."<br>\n";
  97. $checksok=0;
  98. }
  99. else
  100. {
  101. print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupportSessions")."<br>\n";
  102. }
  103. // Check if GD supported
  104. /*if (! function_exists("imagecreate"))
  105. {
  106. $langs->load("errors");
  107. print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportGD")."<br>\n";
  108. // $checksok=0; // If image ko, just warning. So check must still be 1 (otherwise no way to install)
  109. }
  110. else
  111. {
  112. print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupportGD")."<br>\n";
  113. }*/
  114. // Check if Curl supported
  115. if (! function_exists("curl_init"))
  116. {
  117. $langs->load("errors");
  118. print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportCurl")."<br>\n";
  119. // $checksok=0; // If image ko, just warning. So check must still be 1 (otherwise no way to install)
  120. }
  121. else
  122. {
  123. print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupportCurl")."<br>\n";
  124. }
  125. // Check if UTF8 supported
  126. if (! function_exists("utf8_encode"))
  127. {
  128. $langs->load("errors");
  129. print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportUTF8")."<br>\n";
  130. // $checksok=0; // If image ko, just warning. So check must still be 1 (otherwise no way to install)
  131. }
  132. else
  133. {
  134. print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupportUTF8")."<br>\n";
  135. }
  136. // Check memory
  137. $memrequiredorig='64M';
  138. $memrequired=64*1024*1024;
  139. $memmaxorig=@ini_get("memory_limit");
  140. $memmax=@ini_get("memory_limit");
  141. if ($memmaxorig != '')
  142. {
  143. preg_match('/([0-9]+)([a-zA-Z]*)/i',$memmax,$reg);
  144. if ($reg[2])
  145. {
  146. if (strtoupper($reg[2]) == 'G') $memmax=$reg[1]*1024*1024*1024;
  147. if (strtoupper($reg[2]) == 'M') $memmax=$reg[1]*1024*1024;
  148. if (strtoupper($reg[2]) == 'K') $memmax=$reg[1]*1024;
  149. }
  150. if ($memmax >= $memrequired || $memmax == -1)
  151. {
  152. print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPMemoryOK",$memmaxorig,$memrequiredorig)."<br>\n";
  153. }
  154. else
  155. {
  156. print '<img src="../theme/eldy/img/warning.png" alt="Warning"> '.$langs->trans("PHPMemoryTooLow",$memmaxorig,$memrequiredorig)."<br>\n";
  157. }
  158. }
  159. // If config file present and filled
  160. clearstatcache();
  161. if (is_readable($conffile) && filesize($conffile) > 8)
  162. {
  163. dolibarr_install_syslog("check: conf file '" . $conffile . "' already defined");
  164. $confexists=1;
  165. include_once $conffile;
  166. $databaseok=1;
  167. if ($databaseok)
  168. {
  169. // Already installed for all parts (config and database). We can propose upgrade.
  170. $allowupgrade=true;
  171. }
  172. else
  173. {
  174. $allowupgrade=false;
  175. }
  176. }
  177. else
  178. {
  179. // If not, we create it
  180. dolibarr_install_syslog("check: we try to create conf file '" . $conffile . "'");
  181. $confexists=0;
  182. // First we try by copying example
  183. if (@copy($conffile.".example", $conffile))
  184. {
  185. // Success
  186. dolibarr_install_syslog("check: successfully copied file " . $conffile . ".example into " . $conffile);
  187. }
  188. else
  189. {
  190. // If failed, we try to create an empty file
  191. dolibarr_install_syslog("check: failed to copy file " . $conffile . ".example into " . $conffile . ". We try to create it.", LOG_WARNING);
  192. $fp = @fopen($conffile, "w");
  193. if ($fp)
  194. {
  195. @fwrite($fp, '<?php');
  196. @fputs($fp,"\n");
  197. fclose($fp);
  198. }
  199. else dolibarr_install_syslog("check: failed to create a new file " . $conffile . " into current dir " . getcwd() . ". Please check permissions.", LOG_ERR);
  200. }
  201. // First install, we can't upgrade
  202. $allowupgrade=false;
  203. }
  204. // File is missng and can't be created
  205. if (! file_exists($conffile))
  206. {
  207. print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ConfFileDoesNotExistsAndCouldNotBeCreated",$conffiletoshow);
  208. print "<br><br>";
  209. print $langs->trans("YouMustCreateWithPermission",$conffiletoshow);
  210. print "<br><br>";
  211. print $langs->trans("CorrectProblemAndReloadPage",$_SERVER['PHP_SELF'].'?testget=ok');
  212. $err++;
  213. }
  214. else
  215. {
  216. // File exists but can't be modified
  217. if (!is_writable($conffile))
  218. {
  219. if ($confexists)
  220. {
  221. print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("ConfFileExists",$conffiletoshow);
  222. }
  223. else
  224. {
  225. print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("ConfFileCouldBeCreated",$conffiletoshow);
  226. }
  227. print "<br>";
  228. print '<img src="../theme/eldy/img/tick.png" alt="Warning"> '.$langs->trans("ConfFileIsNotWritable",$conffiletoshow);
  229. print "<br>\n";
  230. $allowinstall=0;
  231. }
  232. // File exists and can be modified
  233. else
  234. {
  235. if ($confexists)
  236. {
  237. print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("ConfFileExists",$conffiletoshow);
  238. }
  239. else
  240. {
  241. print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("ConfFileCouldBeCreated",$conffiletoshow);
  242. }
  243. print "<br>";
  244. print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("ConfFileIsWritable",$conffiletoshow);
  245. print "<br>\n";
  246. $allowinstall=1;
  247. }
  248. print "<br>\n";
  249. // Requirements ok, we display the next step button
  250. if ($checksok)
  251. {
  252. $ok=0;
  253. // Try to create db connection
  254. if (file_exists($conffile))
  255. {
  256. include_once $conffile;
  257. if (! empty($dolibarr_main_db_type) && ! empty($dolibarr_main_document_root))
  258. {
  259. if (! file_exists($dolibarr_main_document_root."/core/lib/admin.lib.php"))
  260. {
  261. print '<font class="error">A '.$conffiletoshow.' file exists with a dolibarr_main_document_root to '.$dolibarr_main_document_root.' that seems wrong. Try to fix or remove the '.$conffiletoshow.' file.</font><br>'."\n";
  262. dol_syslog("A '" . $conffiletoshow . "' file exists with a dolibarr_main_document_root to " . $dolibarr_main_document_root . " that seems wrong. Try to fix or remove the '" . $conffiletoshow . "' file.", LOG_WARNING);
  263. }
  264. else
  265. {
  266. require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php';
  267. // $conf is already instancied inside inc.php
  268. $conf->db->type = $dolibarr_main_db_type;
  269. $conf->db->host = $dolibarr_main_db_host;
  270. $conf->db->port = $dolibarr_main_db_port;
  271. $conf->db->name = $dolibarr_main_db_name;
  272. $conf->db->user = $dolibarr_main_db_user;
  273. $conf->db->pass = $dolibarr_main_db_pass;
  274. $db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
  275. if ($db->connected && $db->database_selected)
  276. {
  277. $ok=true;
  278. }
  279. }
  280. }
  281. }
  282. // If a database access is available, we set more variable
  283. if ($ok)
  284. {
  285. if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption=0;
  286. $conf->db->dolibarr_main_db_encryption = $dolibarr_main_db_encryption;
  287. if (empty($dolibarr_main_db_cryptkey)) $dolibarr_main_db_cryptkey='';
  288. $conf->db->dolibarr_main_db_cryptkey = $dolibarr_main_db_cryptkey;
  289. $conf->setValues($db);
  290. // Current version is $conf->global->MAIN_VERSION_LAST_UPGRADE
  291. // Version to install is DOL_VERSION
  292. $dolibarrlastupgradeversionarray=preg_split('/[\.-]/',isset($conf->global->MAIN_VERSION_LAST_UPGRADE) ? $conf->global->MAIN_VERSION_LAST_UPGRADE : (isset($conf->global->MAIN_VERSION_LAST_INSTALL)?$conf->global->MAIN_VERSION_LAST_INSTALL:''));
  293. $dolibarrversiontoinstallarray=versiondolibarrarray();
  294. }
  295. // Show title
  296. if (! empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ! empty($conf->global->MAIN_VERSION_LAST_INSTALL))
  297. {
  298. print $langs->trans("VersionLastUpgrade").': <b><font class="ok">'.(empty($conf->global->MAIN_VERSION_LAST_UPGRADE)?$conf->global->MAIN_VERSION_LAST_INSTALL:$conf->global->MAIN_VERSION_LAST_UPGRADE).'</font></b><br>';
  299. print $langs->trans("VersionProgram").': <b><font class="ok">'.DOL_VERSION.'</font></b>';
  300. //print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired"));
  301. print '<br>';
  302. print '<br>';
  303. }
  304. else print "<br>\n";
  305. print $langs->trans("InstallEasy")." ";
  306. print $langs->trans("ChooseYourSetupMode");
  307. print '<br /><br />';
  308. $foundrecommandedchoice=0;
  309. $available_choices = array();
  310. $notavailable_choices = array();
  311. // Show first install line
  312. $choice = '<tr class="listofchoices"><td class="listofchoices nowrap" align="center"><b>'.$langs->trans("FreshInstall").'</b>';
  313. $choice .= '</td>';
  314. $choice .= '<td class="listofchoices">';
  315. $choice .= $langs->trans("FreshInstallDesc");
  316. if (empty($dolibarr_main_db_host)) // This means install process was not run
  317. {
  318. $choice .= '<br>';
  319. //print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE);
  320. $choice .= '<div class="center"><div class="ok">'.$langs->trans("InstallChoiceSuggested").'</div></div>';
  321. // <img src="../theme/eldy/img/tick.png" alt="Ok"> ';
  322. $foundrecommandedchoice=1; // To show only once
  323. }
  324. $choice .= '</td>';
  325. $choice .= '<td class="listofchoices" align="center">';
  326. if ($allowinstall)
  327. {
  328. $choice .= '<a class="button" href="fileconf.php?selectlang='.$setuplang.'">'.$langs->trans("Start").'</a>';
  329. }
  330. else
  331. {
  332. $choice .= $langs->trans("InstallNotAllowed");
  333. }
  334. $choice .= '</td>';
  335. $choice .= '</tr>'."\n";
  336. if ($allowinstall) {
  337. $available_choices[] = $choice;
  338. } else {
  339. $notavailable_choices[] = $choice;
  340. }
  341. // Show upgrade lines
  342. $allowupgrade=true;
  343. if (empty($dolibarr_main_db_host)) // This means install process was not run
  344. {
  345. $allowupgrade=false;
  346. }
  347. if (defined("MAIN_NOT_INSTALLED")) $allowupgrade=false;
  348. if (GETPOST('allowupgrade')) $allowupgrade=true;
  349. $migrationscript=array( array('from'=>'3.0.0', 'to'=>'3.1.0'),
  350. array('from'=>'3.1.0', 'to'=>'3.2.0'),
  351. array('from'=>'3.2.0', 'to'=>'3.3.0'),
  352. array('from'=>'3.3.0', 'to'=>'3.4.0'),
  353. array('from'=>'3.4.0', 'to'=>'3.5.0'),
  354. array('from'=>'3.5.0', 'to'=>'3.6.0'),
  355. array('from'=>'3.6.0', 'to'=>'3.7.0'),
  356. array('from'=>'3.7.0', 'to'=>'3.8.0'),
  357. array('from'=>'3.8.0', 'to'=>'3.9.0'),
  358. array('from'=>'3.9.0', 'to'=>'4.0.0'),
  359. array('from'=>'4.0.0', 'to'=>'5.0.0')
  360. );
  361. $count=0;
  362. foreach ($migrationscript as $migarray)
  363. {
  364. $choice = '';
  365. $count++;
  366. $recommended_choice = false;
  367. $version=DOL_VERSION;
  368. $versionfrom=$migarray['from'];
  369. $versionto=$migarray['to'];
  370. $versionarray=preg_split('/[\.-]/',$version);
  371. $dolibarrversionfromarray=preg_split('/[\.-]/',$versionfrom);
  372. $dolibarrversiontoarray=preg_split('/[\.-]/',$versionto);
  373. // Define string newversionxxx that are used for text to show
  374. $newversionfrom=preg_replace('/(\.[0-9]+)$/i','.*',$versionfrom);
  375. $newversionto=preg_replace('/(\.[0-9]+)$/i','.*',$versionto);
  376. $newversionfrombis='';
  377. if (versioncompare($dolibarrversiontoarray,$versionarray) < -2) // From x.y.z -> x.y.z+1
  378. {
  379. $newversionfrombis=' '.$langs->trans("or").' '.$versionto;
  380. }
  381. if ($ok)
  382. {
  383. if (count($dolibarrlastupgradeversionarray) >= 2) // If a database access is available and last upgrade version is known
  384. {
  385. // Now we check if this is the first qualified choice
  386. if ($allowupgrade && empty($foundrecommandedchoice) &&
  387. (versioncompare($dolibarrversiontoarray,$dolibarrlastupgradeversionarray) > 0 || versioncompare($dolibarrversiontoarray,$versionarray) < -2)
  388. )
  389. {
  390. $foundrecommandedchoice=1; // To show only once
  391. $recommended_choice = true;
  392. }
  393. }
  394. else {
  395. // We can not recommand a choice.
  396. // A version of install may be known, but we need last upgrade.
  397. }
  398. }
  399. $choice .= '<tr class="listofchoices '.($recommended_choice ? 'choiceselected' : '').'">';
  400. $choice .= '<td class="listofchoices nowrap" align="center"><b>'.$langs->trans("Upgrade").'<br>'.$newversionfrom.$newversionfrombis.' -> '.$newversionto.'</b></td>';
  401. $choice .= '<td class="listofchoices">';
  402. $choice .= $langs->trans("UpgradeDesc");
  403. if ($recommended_choice)
  404. {
  405. $choice .= '<br>';
  406. //print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE);
  407. $choice .= '<div class="center"><div class="ok">'.$langs->trans("InstallChoiceSuggested").'</div>';
  408. if ($count < count($migarray)) // There is other choices after
  409. {
  410. print $langs->trans("MigrateIsDoneStepByStep",DOL_VERSION);
  411. }
  412. $choice .= '</div>';
  413. }
  414. $choice .= '</td>';
  415. $choice .= '<td class="listofchoices" align="center">';
  416. if ($allowupgrade)
  417. {
  418. // If it's not last updagre script, action = upgrade_tmp, if last action = upgrade
  419. $choice .= '<a class="button runupgrade" href="upgrade.php?action=upgrade'.($count<count($migrationscript)?'_'.$versionto:'').'&amp;selectlang='.$setuplang.'&amp;versionfrom='.$versionfrom.'&amp;versionto='.$versionto.'">'.$langs->trans("Start").'</a>';
  420. }
  421. else
  422. {
  423. $choice .= $langs->trans("NotAvailable");
  424. }
  425. $choice .= '</td>';
  426. $choice .= '</tr>'."\n";
  427. if ($allowupgrade) {
  428. $available_choices[] = $choice;
  429. } else {
  430. $notavailable_choices[] = $choice;
  431. }
  432. }
  433. // If there is no choice at all, we show all of them.
  434. if (empty($available_choices))
  435. {
  436. $available_choices=$notavailable_choices;
  437. $notavailable_choices=array();
  438. }
  439. // Array of install choices
  440. print '<table width="100%" class="listofchoices">';
  441. foreach ($available_choices as $choice) {
  442. print $choice;
  443. }
  444. print '</table>';
  445. if (count($notavailable_choices)) {
  446. print '<br />';
  447. print '<div id="AShowChoices">';
  448. print '<img src="../theme/eldy/img/1downarrow.png"> <a href="#">'.$langs->trans('ShowNotAvailableOptions').'</a>';
  449. print '</div>';
  450. print '<div id="navail_choices" style="display:none">';
  451. print '<br />';
  452. print '<table width="100%" class="listofchoices">';
  453. foreach ($notavailable_choices as $choice) {
  454. print $choice;
  455. }
  456. print '</table>';
  457. print '</div>';
  458. }
  459. }
  460. }
  461. print '<script type="text/javascript">
  462. $("div#AShowChoices a").click(function() {
  463. $("div#navail_choices").toggle();
  464. if ($("div#navail_choices").css("display") == "none") {
  465. $(this).text("'.$langs->trans('ShowNotAvailableOptions').'");
  466. $(this).parent().children("img").attr("src", "../theme/eldy/img/1downarrow.png");
  467. } else {
  468. $(this).text("'.$langs->trans('HideNotAvailableOptions').'");
  469. $(this).parent().children("img").attr("src", "../theme/eldy/img/1uparrow.png");
  470. }
  471. });
  472. /*
  473. $(".runupgrade").click(function() {
  474. return confirm("'.dol_escape_js($langs->transnoentitiesnoconv("WarningUpgrade"), 0, 1).'");
  475. });
  476. */
  477. </script>';
  478. dolibarr_install_syslog("--- check: end");
  479. pFooter(1); // Never display next button