* Copyright (C) 2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/admin/tools/update.php * \brief Page to make a Dolibarr online upgrade * \version $Id$ */ require("../../main.inc.php"); include_once $dolibarr_main_document_root."/lib/databases/".$conf->db->type.".lib.php"; include_once $dolibarr_main_document_root."/lib/files.lib.php"; $langs->load("admin"); $langs->load("other"); if (! $user->admin) accessforbidden(); if ($_GET["msg"]) $message='
'.$_GET["msg"].'
'; $urldolibarr='http://www.dolibarr.org/downloads/cat_view/62-stable-versions'; //$urldolibarrmodules='http://www.dolibarr.org/downloads/cat_view/65-modulesaddon'; $urldolibarrmodules='http://www.dolistore.com/'; //$urldolibarrthemes='http://www.dolibarr.org/'; $urldolibarrthemes='http://www.dolistore.com/'; $dolibarrroot=preg_replace('/([\\/]+)$/i','',DOL_DOCUMENT_ROOT); $dolibarrroot=preg_replace('/([^\\/]+)$/i','',$dolibarrroot); /* * Actions */ if ($_POST["action"]=='install') { $error=0; $original_file=basename($_FILES["fileinstall"]["name"]); $newfile=$conf->admin->dir_temp.'/'.$original_file.'/'.$original_file; if (! $original_file) { $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("File")); $error++; } else { if (! preg_match('/\.tgz/i',$original_file)) { $mesg=$langs->trans("ErrorFileMustBeADolibarrPackage"); $error++; } } if (! $error) { @dol_delete_dir_recursive($conf->admin->dir_temp.'/'.$original_file); create_exdir($conf->admin->dir_temp.'/'.$original_file); $result=dol_move_uploaded_file($_FILES["fileinstall"]["tmp_name"],$newfile,1,0,$_FILES['fileinstall']['error']); if ($result > 0) { //dol_uncompress($newfile); } } } /* * View */ $wikihelp='EN:Installation_-_Upgrade|FR:Installation_-_Mise_à_jour|ES:Instalaci&omodulon_-_Actualizaci&omodulon'; llxHeader('',$langs->trans("Upgrade"),$wikihelp); print_fiche_titre($langs->trans("Upgrade"),'','setup'); print $langs->trans("CurrentVersion").' : '.DOL_VERSION.'
'; print $langs->trans("LastStableVersion").' : '.$langs->trans("FeatureNotYetAvailable").'
'; print '
'; if ($mesg) { print '
'.$mesg.'

'; } print $langs->trans("Upgrade").'
'; print '
'; print $langs->trans("ThisIsProcessToFollow").'
'; print ''.$langs->trans("StepNb",1).': '; $fullurl=''.$urldolibarr.''; print $langs->trans("DownloadPackageFromWebSite",$fullurl).'
'; print ''.$langs->trans("StepNb",2).': '; print $langs->trans("UnpackPackageInDolibarrRoot",$dolibarrroot).'
'; print ''.$langs->trans("StepNb",3).': '; print $langs->trans("RemoveLock",$dolibarrroot.'install.lock').'
'; print ''.$langs->trans("StepNb",4).': '; $fullurl=''.DOL_URL_ROOT.'/install/'.''; print $langs->trans("CallUpdatePage",$fullurl).'
'; print ''.$langs->trans("StepNb",5).': '; print $langs->trans("RestoreLock",$dolibarrroot.'install.lock').'
'; print '
'; print '
'; $fullurl=''.$urldolibarrmodules.''; print $langs->trans("AddExtensionThemeModuleOrOther").'
'; print '
'; print $langs->trans("ThisIsProcessToFollow").'
'; print ''.$langs->trans("StepNb",1).': '; print $langs->trans("FindPackageFromWebSite",$fullurl).'
'; print ''.$langs->trans("StepNb",2).': '; print $langs->trans("DownloadPackageFromWebSite",$fullurl).'
'; print ''.$langs->trans("StepNb",3).': '; print $langs->trans("UnpackPackageInDolibarrRoot",$dolibarrroot).'
'; if (! empty($conf->global->MAIN_ONLINE_INSTALL_MODULE)) { print '
'; print ''; print $langs->trans("YouCanSubmitFile").' '; print ''; print '
'; } print ''.$langs->trans("StepNb",4).': '; print $langs->trans("SetupIsReadyForUse").'
'; print ''; llxFooter('$Date$ - $Revision$'); ?>