From f34e0b1bdb1deebdfb85dc57970c9fc9794f68ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Feb 2017 15:41:01 +0100 Subject: [PATCH] NEW Can deploy an external module from the module setup area. --- htdocs/admin/modules.php | 405 +++++++++++++++++++-------------- htdocs/admin/tools/update.php | 252 +++----------------- htdocs/langs/en_US/admin.lang | 22 +- htdocs/langs/en_US/errors.lang | 3 +- 4 files changed, 279 insertions(+), 403 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index b61e5a4a86e..e34861450eb 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -29,12 +29,15 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->load("errors"); $langs->load("admin"); -$mode=GETPOST('mode', 'alpha')?GETPOST('mode', 'alpha'):0; +$mode=GETPOST('mode', 'alpha'); +if (empty($mode)) $mode='common'; $action=GETPOST('action','alpha'); $value=GETPOST('value', 'alpha'); $page_y=GETPOST('page_y','int'); @@ -69,13 +72,14 @@ if ($search_status) $param.='&search_status='.urlencode($search_status); if ($search_nature) $param.='&search_nature='.urlencode($search_nature); if ($search_version) $param.='&search_version='.urlencode($search_version); +$dirins=DOL_DOCUMENT_ROOT.'/custom'; +$urldolibarrmodules='https://www.dolistore.com/'; /* * Actions */ - if (GETPOST('buttonreset')) { $search_keyword=''; @@ -84,6 +88,103 @@ if (GETPOST('buttonreset')) $search_version=''; } +if ($action=='install') +{ + $error=0; + + // $original_file should match format module_modulename-x.y[.z].zip + $original_file=basename($_FILES["fileinstall"]["name"]); + $newfile=$conf->admin->dir_temp.'/'.$original_file.'/'.$original_file; + + if (! $original_file) + { + $langs->load("Error"); + setEventMessages($langs->trans("ErrorModuleFileRequired"), null, 'warnings'); + $error++; + } + else + { + if (! preg_match('/\.zip/i',$original_file)) + { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), null, 'errors'); + $error++; + } + } + + if (! $error) + { + if ($original_file) + { + @dol_delete_dir_recursive($conf->admin->dir_temp.'/'.$original_file); + dol_mkdir($conf->admin->dir_temp.'/'.$original_file); + } + + $tmpdir=preg_replace('/\.zip$/','',$original_file).'.dir'; + if ($tmpdir) + { + @dol_delete_dir_recursive($conf->admin->dir_temp.'/'.$tmpdir); + dol_mkdir($conf->admin->dir_temp.'/'.$tmpdir); + } + + $result=dol_move_uploaded_file($_FILES['fileinstall']['tmp_name'],$newfile,1,0,$_FILES['fileinstall']['error']); + if ($result > 0) + { + $result=dol_uncompress($newfile,$conf->admin->dir_temp.'/'.$tmpdir); + + if (! empty($result['error'])) + { + $langs->load("errors"); + setEventMessages($langs->trans($result['error'],$original_file), null, 'errors'); + $error++; + } + else + { + // Now we move the dir of the module + $modulename=preg_replace('/module_/', '', $original_file); + $modulename=preg_replace('/\-[\d]+\.[\d]+.*$/', '', $modulename); + // Search dir $modulename + $modulenamedir=$conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulename; + //var_dump($modulenamedir); + if (! dol_is_dir($modulenamedir)) + { + $modulenamedir=$conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulename; + //var_dump($modulenamedir); + if (! dol_is_dir($modulenamedir)) + { + setEventMessages($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat"), null, 'errors'); + $error++; + } + } + + if (! $error) + { + //var_dump($dirins); + @dol_delete_dir_recursive($dirins.'/'.$modulename); + dol_syslog("Uncompress of module file is a success. We copy it from ".$modulenamedir." into target dir ".$dirins.'/'.$modulename); + $result=dolCopyDir($modulenamedir, $dirins.'/'.$modulename, '0444', 1); + if ($result <= 0) + { + dol_syslog('Failed to call dolCopyDir result='.$result." with param ".$modulenamedir." and ".$dirins.'/'.$modulename, LOG_WARNING); + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFailToCopyDir", $modulenamedir, $dirins.'/'.$modulename), null, 'errors'); + $error++; + } + } + } + } + else + { + $error++; + } + } + + if (! $error) + { + setEventMessages($langs->trans("SetupIsReadyForUse", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules")), null, 'warnings'); + } +} + if ($action == 'set' && $user->admin) { $resarray = activateModule($value); @@ -115,6 +216,13 @@ if ($action == 'reset' && $user->admin) * View */ +// Set dir where external modules are installed +if (! dol_is_dir($dirins)) +{ + dol_mkdir($dirins); +} +$dirins_ok=(dol_is_dir($dirins)); + $form = new Form($db); $help_url='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; @@ -277,33 +385,35 @@ if ($nbofactivatedmodules <= 1) $moreinfo .= ' '.img_warning($langs->trans("YouM print load_fiche_titre($langs->trans("ModulesSetup"),$moreinfo,'title_setup'); // Start to show page -if (empty($mode)) $mode='common'; -if ($mode==='common') print $langs->trans("ModulesDesc")."
\n"; -if ($mode==='marketplace') print $langs->trans("ModulesMarketPlaceDesc")."
\n"; -if ($mode==='expdev') print $langs->trans("ModuleFamilyExperimental")."
\n"; +if ($mode=='common') print $langs->trans("ModulesDesc")."
\n"; +if ($mode=='marketplace') print $langs->trans("ModulesMarketPlaceDesc")."
\n"; +if ($mode=='deploy') print $langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."
\n"; $h = 0; -$categidx='common'; // Main -$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; +$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=common"; $head[$h][1] = $langs->trans("AvailableModules"); $head[$h][2] = 'common'; $h++; -$categidx='marketplace'; -$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; +$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=marketplace"; $head[$h][1] = $langs->trans("ModulesMarketPlaces"); $head[$h][2] = 'marketplace'; $h++; +$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=deploy"; +$head[$h][1] = $langs->trans("AddExtensionThemeModuleOrOther"); +$head[$h][2] = 'deploy'; +$h++; + print "
\n"; $var=true; -if ($mode != 'marketplace') +if ($mode == 'common') { print '
'; @@ -351,7 +461,6 @@ if ($mode != 'marketplace') //print ''; } - //dol_fiche_end(); print '

'; @@ -477,163 +586,6 @@ if ($mode != 'marketplace') $imginfo="info_black"; } - // Define text of description of module - /* - $text=''; - - if ($objMod->getDescLong()) $text.='
'.$objMod->getDesc().'

'.$objMod->getDescLong().'
'; - else $text.='
'.$objMod->getDesc().'

'; - - $text.='
'.$langs->trans("Version").': '.$version; - - $textexternal=''; - if ($objMod->isCoreOrExternalModule() == 'external') - { - $textexternal.='
'.$langs->trans("Origin").': '.$langs->trans("ExternalModule",$dirofmodule); - if ($objMod->editor_name != 'dolibarr') $textexternal.='
'.$langs->trans("Publisher").': '.(empty($objMod->editor_name)?$langs->trans("Unknown"):$objMod->editor_name); - if (! empty($objMod->editor_url) && ! preg_match('/dolibarr\.org/i',$objMod->editor_url)) $textexternal.='
'.$langs->trans("Url").': '.$objMod->editor_url; - $text.=$textexternal; - $text.='
'; - } - else - { - $text.='
'.$langs->trans("Origin").': '.$langs->trans("Core").'
'; - } - $text.='
'.$langs->trans("LastActivationDate").': '; - if (! empty($conf->global->$const_name)) $text.=dol_print_date($objMod->getLastActivationDate(), 'dayhour'); - else $text.=$langs->trans("Disabled"); - $text.='
'; - - $text.='
'.$langs->trans("AddRemoveTabs").': '; - if (isset($objMod->tabs) && is_array($objMod->tabs) && count($objMod->tabs)) - { - $i=0; - foreach($objMod->tabs as $val) - { - $tmp=explode(':',$val,3); - $text.=($i?', ':'').$tmp[0].':'.$tmp[1]; - $i++; - } - } - else $text.=$langs->trans("No"); - - $text.='
'.$langs->trans("AddDictionaries").': '; - if (isset($objMod->dictionaries) && isset($objMod->dictionaries['tablib']) && is_array($objMod->dictionaries['tablib']) && count($objMod->dictionaries['tablib'])) - { - $i=0; - foreach($objMod->dictionaries['tablib'] as $val) - { - $text.=($i?', ':'').$val; - $i++; - } - } - else $text.=$langs->trans("No"); - - $text.='
'.$langs->trans("AddBoxes").': '; - if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes)) - { - $i=0; - foreach($objMod->boxes as $val) - { - $text.=($i?', ':'').($val['file']?$val['file']:$val[0]); - $i++; - } - } - else $text.=$langs->trans("No"); - - $text.='
'.$langs->trans("AddModels").': '; - if (isset($objMod->module_parts) && isset($objMod->module_parts['models']) && $objMod->module_parts['models']) - { - $text.=$langs->trans("Yes"); - } - else $text.=$langs->trans("No"); - - $text.='
'.$langs->trans("AddSubstitutions").': '; - if (isset($objMod->module_parts) && isset($objMod->module_parts['substitutions']) && $objMod->module_parts['substitutions']) - { - $text.=$langs->trans("Yes"); - } - else $text.=$langs->trans("No"); - - $text.='
'.$langs->trans("AddSheduledJobs").': '; - if (isset($objMod->cronjobs) && is_array($objMod->cronjobs) && count($objMod->cronjobs)) - { - $i=0; - foreach($objMod->cronjobs as $val) - { - $text.=($i?', ':'').($val['label']); - $i++; - } - } - else $text.=$langs->trans("No"); - - $text.='
'.$langs->trans("AddTriggers").': '; - if (isset($objMod->module_parts) && isset($objMod->module_parts['triggers']) && $objMod->module_parts['triggers']) - { - $text.=$langs->trans("Yes"); - } - else $text.=$langs->trans("No"); - - $text.='
'.$langs->trans("AddHooks").': '; - if (isset($objMod->module_parts) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks'])) - { - $i=0; - foreach($objMod->module_parts['hooks'] as $val) - { - $text.=($i?', ':'').($val); - $i++; - } - } - else $text.=$langs->trans("No"); - - $text.='
'.$langs->trans("AddPermissions").': '; - if (isset($objMod->rights) && is_array($objMod->rights) && count($objMod->rights)) - { - $i=0; - foreach($objMod->rights as $val) - { - $text.=($i?', ':'').($val[1]); - $i++; - } - } - else $text.=$langs->trans("No"); - - $text.='
'.$langs->trans("AddMenus").': '; - if (isset($objMod->menu) && ! empty($objMod->menu)) // objMod can be an array or just an int 1 - { - $text.=$langs->trans("Yes"); - } - else $text.=$langs->trans("No"); - - $text.='
'.$langs->trans("AddExportProfiles").': '; - if (isset($objMod->export_label) && is_array($objMod->export_label) && count($objMod->export_label)) - { - $i=0; - foreach($objMod->export_label as $val) - { - $text.=($i?', ':'').($val); - $i++; - } - } - else $text.=$langs->trans("No"); - - $text.='
'.$langs->trans("AddImportProfiles").': '; - if (isset($objMod->import_label) && is_array($objMod->import_label) && count($objMod->import_label)) - { - $i=0; - foreach($objMod->import_label as $val) - { - $text.=($i?', ':'').($val); - $i++; - } - } - else $text.=$langs->trans("No"); - - $text.='
'.$langs->trans("AddOtherPagesOrServices").': '; - $text.=$langs->trans("DetectionNotPossible"); - */ - - //print "\n\n"; print '\n"; // Picto @@ -768,8 +720,11 @@ if ($mode != 'marketplace') } print "\n"; print ''; + + dol_fiche_end(); } -else + +if ($mode == 'marketplace') { dol_fiche_head($head, $mode, ''); @@ -799,13 +754,115 @@ else print "\n"; - //dol_fiche_end(); + dol_fiche_end(); +} + + +// Install external module + +if ($mode == 'deploy') +{ + dol_fiche_head($head, $mode, ''); + + + $allowonlineinstall=true; + $allowfromweb=1; + if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) $allowonlineinstall=false; + + $fullurl=''.$urldolibarrmodules.''; + $message=''; + if (! empty($allowonlineinstall)) + { + if (! in_array('/custom',explode(',',$dolibarr_main_url_root_alt))) + { + $message=info_admin($langs->trans("ConfFileMuseContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT)); + $allowfromweb=-1; + } + else + { + if ($dirins_ok) + { + if (! is_writable(dol_osencode($dirins))) + { + $langs->load("errors"); + $message=info_admin($langs->trans("ErrorFailedToWriteInDir",$dirins)); + $allowfromweb=0; + } + } + else + { + + $message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample")); + $allowfromweb=0; + } + } + } + else + { + $message=info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile",$dolibarrdataroot.'/installmodules.lock')); + $allowfromweb=0; + } + + if ($allowfromweb < 1) + { + print $langs->trans("SomethingMakeInstallFromWebNotPossible"); + print $message; + //print $langs->trans("SomethingMakeInstallFromWebNotPossible2"); + print '
'; + } + + + if ($allowfromweb >= 0) + { + if ($allowfromweb == 1) + { + //print $langs->trans("ThisIsProcessToFollow").'
'; + } + else + { + print $langs->trans("ThisIsAlternativeProcessToFollow").'
'; + 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).': '; + } + + if ($allowfromweb == 1) + { + print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
'; + print ''; + print ''; + print ''; + print $langs->trans("YouCanSubmitFile").' '; + print ''; + print '
'; + } + else + { + print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
'; + print ''.$langs->trans("StepNb",4).': '; + print $langs->trans("SetupIsReadyForUse").'
'; + } + } + + + if (! empty($result['return'])) + { + print '
'; + + foreach($result['return'] as $value) + { + echo $value.'
'; + } + } + + dol_fiche_end(); } -dol_fiche_end(); // Show warning about external users -if ($mode != 'marketplace') print info_admin(showModulesExludedForExternal($modules))."\n"; +if ($mode == 'common') print info_admin(showModulesExludedForExternal($modules))."\n"; llxFooter(); diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index 912016b498c..d8b17ab989b 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2007-2017 Laurent Destailleur * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2012 Juanjo Menent * @@ -23,9 +23,9 @@ */ require '../../main.inc.php'; -include_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; -include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; -include_once DOL_DOCUMENT_ROOT . '/core/lib/geturl.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/geturl.lib.php'; $langs->load("admin"); $langs->load("other"); @@ -40,111 +40,23 @@ if (GETPOST('msg','alpha')) { $urldolibarr='https://www.dolibarr.org/downloads/'; -$urldolibarrmodules='https://www.dolistore.com/'; -$urldolibarrthemes='https://www.dolistore.com/'; $dolibarrroot=preg_replace('/([\\/]+)$/i','',DOL_DOCUMENT_ROOT); $dolibarrroot=preg_replace('/([^\\/]+)$/i','',$dolibarrroot); $dolibarrdataroot=preg_replace('/([\\/]+)$/i','',DOL_DATA_ROOT); -$dirins=DOL_DOCUMENT_ROOT.'/custom'; +$sfurl = ''; +$version='0.0'; /* * Actions */ -if ($action=='install') +if ($action == 'getlastversion') { - $error=0; - - // $original_file should match format module_modulename-x.y[.z].zip - $original_file=basename($_FILES["fileinstall"]["name"]); - $newfile=$conf->admin->dir_temp.'/'.$original_file.'/'.$original_file; - - if (! $original_file) - { - $langs->load("Error"); - setEventMessages($langs->trans("ErrorFileRequired"), null, 'warnings'); - $error++; - } - else - { - if (! preg_match('/\.zip/i',$original_file)) - { - $langs->load("errors"); - setEventMessages($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), null, 'errors'); - $error++; - } - } - - if (! $error) - { - if ($original_file) - { - @dol_delete_dir_recursive($conf->admin->dir_temp.'/'.$original_file); - dol_mkdir($conf->admin->dir_temp.'/'.$original_file); - } - - $tmpdir=preg_replace('/\.zip$/','',$original_file).'.dir'; - if ($tmpdir) - { - @dol_delete_dir_recursive($conf->admin->dir_temp.'/'.$tmpdir); - dol_mkdir($conf->admin->dir_temp.'/'.$tmpdir); - } - - $result=dol_move_uploaded_file($_FILES['fileinstall']['tmp_name'],$newfile,1,0,$_FILES['fileinstall']['error']); - if ($result > 0) - { - $result=dol_uncompress($newfile,$conf->admin->dir_temp.'/'.$tmpdir); - - if (! empty($result['error'])) - { - $langs->load("errors"); - setEventMessages($langs->trans($result['error'],$original_file), null, 'errors'); - $error++; - } - else - { - // Now we move the dir of the module - $modulename=preg_replace('/module_/', '', $original_file); - $modulename=preg_replace('/\-[\d]+\.[\d]+.*$/', '', $modulename); - // Search dir $modulename - $modulenamedir=$conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulename; - //var_dump($modulenamedir); - if (! dol_is_dir($modulenamedir)) - { - $modulenamedir=$conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulename; - //var_dump($modulenamedir); - if (! dol_is_dir($modulenamedir)) - { - setEventMessages($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat"), null, 'errors'); - $error++; - } - } - - if (! $error) - { - //var_dump($dirins); - @dol_delete_dir_recursive($dirins.'/'.$modulename); - $result=dolCopyDir($modulenamedir, $dirins.'/'.$modulename, '0444', 1); - if ($result <= 0) - { - setEventMessages($langs->trans("ErrorFailedToCopy"), null, 'errors'); - $error++; - } - } - } - } - else - { - $error++; - } - } - - if (! $error) - { - setEventMessages($langs->trans("SetupIsReadyForUse", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules")), null, 'warnings'); - } + $result = getURLContent('http://sourceforge.net/projects/dolibarr/rss'); + //var_dump($result['content']); + $sfurl = simplexml_load_string($result['content']); } @@ -152,15 +64,6 @@ if ($action=='install') * View */ - - -// Set dir where external modules are installed -if (! dol_is_dir($dirins)) -{ - dol_mkdir($dirins); -} -$dirins_ok=(dol_is_dir($dirins)); - $wikihelp='EN:Installation_-_Upgrade|FR:Installation_-_Mise_à_jour|ES:Instalación_-_Actualización'; llxHeader('',$langs->trans("Upgrade"),$wikihelp); @@ -172,36 +75,40 @@ 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']); - if ($sfurl) + if ($action == 'getlastversion') { - $i=0; - $version='0.0'; - while (! empty($sfurl->channel[0]->item[$i]->title) && $i < 10000) + if ($sfurl) { - $title=$sfurl->channel[0]->item[$i]->title; - if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg)) + $i=0; + while (! empty($sfurl->channel[0]->item[$i]->title) && $i < 10000) { - $newversion=$reg[1]; - $newversionarray=explode('.',$newversion); - $versionarray=explode('.',$version); - //var_dump($newversionarray);var_dump($versionarray); - if (versioncompare($newversionarray, $versionarray) > 0) $version=$newversion; + $title=$sfurl->channel[0]->item[$i]->title; + if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg)) + { + $newversion=$reg[1]; + $newversionarray=explode('.',$newversion); + $versionarray=explode('.',$version); + //var_dump($newversionarray);var_dump($versionarray); + if (versioncompare($newversionarray, $versionarray) > 0) $version=$newversion; + } + $i++; } - $i++; + + // Show version + print $langs->trans("LastStableVersion").' : '. (($version != '0.0')?$version:$langs->trans("Unknown")) .'
'; + } + else + { + print $langs->trans("LastStableVersion").' : ' .$langs->trans("UpdateServerOffline").'
'; } - - // Show version - print $langs->trans("LastStableVersion").' : '. (($version != '0.0')?$version:$langs->trans("Unknown")) .'
'; } else { - print $langs->trans("LastStableVersion").' : ' .$langs->trans("UpdateServerOffline").'
'; + print $langs->trans("LastStableVersion").' : ' .$langs->trans("Check").'
'; } } +print '
'; print '
'; // Upgrade @@ -225,106 +132,15 @@ print '
'; print '
'; -// Install external module - -$allowonlineinstall=true; -$allowfromweb=1; -if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) $allowonlineinstall=false; - -$fullurl=''.$urldolibarrmodules.''; -$message=''; -if (! empty($allowonlineinstall)) -{ - if (! in_array('/custom',explode(',',$dolibarr_main_url_root_alt))) - { - $message=info_admin($langs->trans("ConfFileMuseContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT)); - $allowfromweb=-1; - } - else - { - if ($dirins_ok) - { - if (! is_writable(dol_osencode($dirins))) - { - $langs->load("errors"); - $message=info_admin($langs->trans("ErrorFailedToWriteInDir",$dirins)); - $allowfromweb=0; - } - } - else - { - - $message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample")); - $allowfromweb=0; - } - } -} -else -{ - $message=info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile",$dolibarrdataroot.'/installmodules.lock')); - $allowfromweb=0; -} - - print $langs->trans("AddExtensionThemeModuleOrOther").'
'; print '
'; -if ($allowfromweb < 1) -{ - print $langs->trans("SomethingMakeInstallFromWebNotPossible"); - print $message; - //print $langs->trans("SomethingMakeInstallFromWebNotPossible2"); - print '
'; -} +print $langs->trans("GoModuleSetupArea", DOL_URL_ROOT.'/admin/modules.php?mode=deploy', $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Modules")); -if ($allowfromweb >= 0) -{ - if ($allowfromweb == 1) - { - //print $langs->trans("ThisIsProcessToFollow").'
'; - } - else - { - print $langs->trans("ThisIsAlternativeProcessToFollow").'
'; - 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).': '; - } - - if ($allowfromweb == 1) - { - print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
'; - print '
'; - print ''; - print $langs->trans("YouCanSubmitFile").' '; - print ''; - print '
'; - } - else - { - print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
'; - print ''.$langs->trans("StepNb",4).': '; - print $langs->trans("SetupIsReadyForUse").'
'; - } -} - - -if (! empty($result['return'])) -{ - print '
'; - - foreach($result['return'] as $value) - { - echo $value.'
'; - } -} - llxFooter(); $db->close(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6ee9a1854f4..36d8772dccb 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -191,7 +191,9 @@ BoxesDesc=Widgets are components showing some information that you can add to pe OnlyActiveElementsAreShown=Only elements from enabled modules are shown. ModulesDesc=Dolibarr modules define which functionality is enabled in software. Some modules require permissions you must grant to users, after enabling module. Click on button on/off to enable a module/feature. ModulesMarketPlaceDesc=You can find more modules to download on external websites on the Internet... -ModulesMarketPlaces=More modules... +ModulesDeployDesc=If permissions on your file system allows it, you can use this tool to deploy an external module. The module wil then be visible on the tab %s. +ModulesMarketPlaces=Find external modules... +GoModuleSetupArea=To deploy/install a new module, go onto the Module setup area at %s. DoliStoreDesc=DoliStore, the official market place for Dolibarr ERP/CRM external modules DoliPartnersDesc=List of companies providing custom developed modules or features (Note: anyone experienced in PHP programming can provide custom development for an open source project) WebSiteDesc=Reference websites to find more modules... @@ -283,16 +285,16 @@ MenuHandlers=Menu handlers MenuAdmin=Menu editor DoNotUseInProduction=Do not use in production ThisIsProcessToFollow=This is steps to process: -ThisIsAlternativeProcessToFollow=This is an alternative setup to process: +ThisIsAlternativeProcessToFollow=This is an alternative setup to process manually: 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 files into Dolibarr server directory dedicated to Dolibarr: %s -UnpackPackageInModulesRoot=Unpack package files into Dolibarr server directory dedicated to modules: %s -oiSetupIsReadyForUse=Module deployement is finished. You must however enable and setup the module in your application by going on the page to setup modules: %s. -NotExistsDirect=The alternative root directory is not defined.
-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.
Just create a directory at the root of Dolibarr (eg: custom).
-InfDirExample=
Then declare it in the file conf.php
$dolibarr_main_url_root_alt='http://myserver/custom'
$dolibarr_main_document_root_alt='/path/of/dolibarr/htdocs/custom'
*These lines are commented with "#", to uncomment only remove the character. +UnpackPackageInDolibarrRoot=Unpack the packaged files into server directory dedicated to Dolibarr: %s +UnpackPackageInModulesRoot=To deploy/install an external module, unpack the packaged files into the server directory dedicated to modules: %s +SetupIsReadyForUse=Module deployment is finished. You must however enable and setup the module in your application by going on the page to setup modules: %s. +NotExistsDirect=The alternative root directory is not defined to an existing directory.
+InfDirAlt=Since version 3, it is possible to define an alternative root directory. This allows you to store, into a dedicated directory, plug-ins and custom templates.
Just create a directory at the root of Dolibarr (eg: custom).
+InfDirExample=
Then declare it in the file conf.php
$dolibarr_main_url_root_alt='http://myserver/custom'
$dolibarr_main_document_root_alt='/path/of/dolibarr/htdocs/custom'
If these lines are commented with "#", to enable them, just uncomment by removing the "#" character. YouCanSubmitFile=For this step, you can send package using this tool: Select module file CurrentVersion=Dolibarr current version CallUpdatePage=Go to the page that updates the database structure and data: %s. @@ -895,7 +897,7 @@ Offset=Offset AlwaysActive=Always active Upgrade=Upgrade MenuUpgrade=Upgrade / Extend -AddExtensionThemeModuleOrOther=Add extension (theme, module, ...) +AddExtensionThemeModuleOrOther=Deploy/install external module WebServer=Web server DocumentRootServer=Web server's root directory DataRootServer=Data files directory @@ -1582,7 +1584,7 @@ BackupDumpWizard=Wizard to build database backup dump file SomethingMakeInstallFromWebNotPossible=Installation of external module is not possible from the web interface for the following reason: SomethingMakeInstallFromWebNotPossible2=For this reason, process to upgrade described here is only manual steps a privileged user can do. InstallModuleFromWebHasBeenDisabledByFile=Install of external module from application has been disabled by your administrator. You must ask him to remove the file %s to allow this feature. -ConfFileMuseContainCustom=Installing an external module from application need to save the module files into directory %s. To have this directory processed by Dolibarr, you must setup your conf/conf.php to have option
$dolibarr_main_url_root_alt='/custom';
$dolibarr_main_document_root_alt='%s/custom'; +ConfFileMuseContainCustom=Installing an external module from application need to save the module files into directory %s. To have this directory processed by Dolibarr, you must setup your conf/conf.php to add the 2 directive lines:
$dolibarr_main_url_root_alt='/custom';
$dolibarr_main_document_root_alt='%s/custom'; HighlightLinesOnMouseHover=Highlight table lines when mouse move passes over HighlightLinesColor=Highlight color of the line when the mouse passes over (keep empty for no highlight) TextTitleColor=Color of page title diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index edbf603e8fc..e493bc67524 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -11,6 +11,7 @@ ErrorLoginAlreadyExists=Login %s already exists. ErrorGroupAlreadyExists=Group %s already exists. ErrorRecordNotFound=Record not found. ErrorFailToCopyFile=Failed to copy file '%s' into '%s'. +ErrorFailToCopyDir=Failed to copy directory '%s' into '%s'. ErrorFailToRenameFile=Failed to rename file '%s' into '%s'. ErrorFailToDeleteFile=Failed to remove file '%s'. ErrorFailToCreateFile=Failed to create file '%s'. @@ -115,7 +116,7 @@ ErrorNoActivatedBarcode=No barcode type activated ErrUnzipFails=Failed to unzip %s with ZipArchive ErrNoZipEngine=No engine to unzip %s file in this PHP ErrorFileMustBeADolibarrPackage=The file %s must be a Dolibarr zip package -ErrorFileRequired=It takes a package Dolibarr file +ErrorModuleFileRequired=You must select a Dolibarr module package file ErrorPhpCurlNotInstalled=The PHP CURL is not installed, this is essential to talk with Paypal ErrorFailedToAddToMailmanList=Failed to add record %s to Mailman list %s or SPIP base ErrorFailedToRemoveToMailmanList=Failed to remove record %s to Mailman list %s or SPIP base