* Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud * * 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 3 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, see . */ /** * \file htdocs/admin/modules.php * \brief Page to activate/disable all modules */ require '../main.inc.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'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->load("errors"); $langs->load("admin"); $mode=GETPOST('mode', 'alpha'); if (empty($mode)) $mode='common'; $action=GETPOST('action','alpha'); $value=GETPOST('value', 'alpha'); $page_y=GETPOST('page_y','int'); $search_keyword=GETPOST('search_keyword','alpha'); $search_status=GETPOST('search_status','alpha'); $search_nature=GETPOST('search_nature','alpha'); $search_version=GETPOST('search_version','alpha'); if (! $user->admin) accessforbidden(); $specialtostring=array(0=>'common', 1=>'interfaces', 2=>'other', 3=>'functional', 4=>'marketplace'); $familyinfo=array( 'hr'=>array('position'=>'001', 'label'=>$langs->trans("ModuleFamilyHr")), 'crm'=>array('position'=>'006', 'label'=>$langs->trans("ModuleFamilyCrm")), 'srm'=>array('position'=>'007', 'label'=>$langs->trans("ModuleFamilySrm")), 'financial'=>array('position'=>'009', 'label'=>$langs->trans("ModuleFamilyFinancial")), 'products'=>array('position'=>'012', 'label'=>$langs->trans("ModuleFamilyProducts")), 'projects'=>array('position'=>'015', 'label'=>$langs->trans("ModuleFamilyProjects")), 'ecm'=>array('position'=>'018', 'label'=>$langs->trans("ModuleFamilyECM")), 'technic'=>array('position'=>'021', 'label'=>$langs->trans("ModuleFamilyTechnic")), 'portal'=>array('position'=>'040', 'label'=>$langs->trans("ModuleFamilyPortal")), 'interface'=>array('position'=>'050', 'label'=>$langs->trans("ModuleFamilyInterface")), 'base'=>array('position'=>'060', 'label'=>$langs->trans("ModuleFamilyBase")), 'other'=>array('position'=>'100', 'label'=>$langs->trans("ModuleFamilyOther")), ); $param=''; if ($search_keyword) $param.='&search_keyword='.urlencode($search_keyword); 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=''; $search_status=''; $search_nature=''; $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 (! preg_match('/module_.*\-[\d]+\.[\d]+.*$/i',$original_file)) { $langs->load("errors"); setEventMessages($langs->trans("ErrorFilenameDosNotMatchDolibarrPackageRules",$original_file, 'module_*-x.y*.zip'), 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").'
Dir not found: '.$conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulename.'
'.$conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulename, 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); if (! empty($resarray['errors'])) setEventMessages('', $resarray['errors'], 'errors'); else { //var_dump($resarray);exit; if ($resarray['nbperms'] > 0) { $msg = $langs->trans('ModuleEnabledAdminMustCheckRights'); setEventMessages($msg, null, 'warnings'); } } header("Location: modules.php?mode=".$mode.$param.($page_y?'&page_y='.$page_y:'')); exit; } if ($action == 'reset' && $user->admin) { $result=unActivateModule($value); if ($result) setEventMessages($result, null, 'errors'); header("Location: modules.php?mode=".$mode.$param.($page_y?'&page_y='.$page_y:'')); exit; } /* * 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'; llxHeader('',$langs->trans("Setup"),$help_url); $arrayofnatures=array('core'=>$langs->transnoentitiesnoconv("Core"), 'external'=>$langs->transnoentitiesnoconv("External").' - '.$langs->trans("AllPublishers")); $arrayofwarnings=array(); // Array of warning each module want to show when activated $arrayofwarningsext=array(); // Array of warning each module want to show when we activate an external module // Search modules dirs $modulesdir = dolGetModulesDirs(); $filename = array(); $modules = array(); $orders = array(); $categ = array(); $dirmod = array(); $i = 0; // is a sequencer of modules found $j = 0; // j is module number. Automatically affected if module number not defined. $modNameLoaded=array(); foreach ($modulesdir as $dir) { // Load modules attributes in arrays (name, numero, orders) from dir directory //print $dir."\n
"; dol_syslog("Scan directory ".$dir." for module descriptor files (modXXX.class.php)"); $handle=@opendir($dir); if (is_resource($handle)) { while (($file = readdir($handle))!==false) { //print "$i ".$file."\n
"; if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') { $modName = substr($file, 0, dol_strlen($file) - 10); if ($modName) { if (! empty($modNameLoaded[$modName])) // In cache of already loaded modules ? { $mesg="Error: Module ".$modName." was found twice: Into ".$modNameLoaded[$modName]." and ".$dir.". You probably have an old file on your disk.
"; setEventMessages($mesg, null, 'warnings'); dol_syslog($mesg, LOG_ERR); continue; } try { $res=include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error. if (class_exists($modName)) { try { $objMod = new $modName($db); $modNameLoaded[$modName]=$dir; if (! $objMod->numero > 0 && $modName != 'modUser') { dol_syslog('The module descriptor '.$modName.' must have a numero property', LOG_ERR); } $j = $objMod->numero; $modulequalified=1; // We discard modules according to features level (PS: if module is activated we always show it) $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=0; if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0; if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) $modulequalified=0; // We discard modules according to property ->hidden if (! empty($objMod->hidden)) $modulequalified=0; if ($modulequalified > 0) { $publisher=dol_escape_htmltag($objMod->getPublisher()); $external=($objMod->isCoreOrExternalModule() == 'external'); if ($external) { if ($publisher) { $arrayofnatures['external_'.$publisher]=$langs->trans("External").' - '.$publisher; } else { $arrayofnatures['external_']=$langs->trans("External").' - '.$langs->trans("UnknownPublishers"); } } ksort($arrayofnatures); } // Define array $categ with categ with at least one qualified module if ($modulequalified > 0) { $filename[$i]= $modName; $modules[$modName] = $objMod; $special = $objMod->special; // Gives the possibility to the module, to provide his own family info and position of this family if (is_array($objMod->familyinfo) && !empty($objMod->familyinfo)) { $familyinfo = array_merge($familyinfo, $objMod->familyinfo); $familykey = key($objMod->familyinfo); } else { $familykey = $objMod->family; } $moduleposition = ($objMod->module_position?$objMod->module_position:'500'); if ($moduleposition == 500 && ($objMod->isCoreOrExternalModule() == 'external')) { $moduleposition = 800; } if ($special == 1) $familykey='interface'; // Add list of warnings to show into arrayofwarnings and arrayofwarningsext if (! empty($objMod->warnings_activation)) { $arrayofwarnings[$modName]=$objMod->warnings_activation; } if (! empty($objMod->warnings_activation_ext)) { $arrayofwarningsext[$modName]=$objMod->warnings_activation_ext; } $orders[$i] = $familyinfo[$familykey]['position']."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number $dirmod[$i] = $dir; //print $i.'-'.$dirmod[$i].'
'; // Set categ[$i] $specialstring = isset($specialtostring[$special])?$specialtostring[$special]:'unknown'; if ($objMod->version == 'development' || $objMod->version == 'experimental') $specialstring='expdev'; if (isset($categ[$specialstring])) $categ[$specialstring]++; // Array of all different modules categories else $categ[$specialstring]=1; $j++; $i++; } else dol_syslog("Module ".get_class($objMod)." not qualified"); } catch(Exception $e) { dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); } } else { print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)
"; } } catch(Exception $e) { dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); } } } } closedir($handle); } else { dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING); } } asort($orders); //var_dump($orders); //var_dump($categ); //var_dump($modules); $nbofactivatedmodules=count($conf->modules); $moreinfo=$langs->trans("TotalNumberOfActivatedModules",($nbofactivatedmodules-1), count($modules)); if ($nbofactivatedmodules <= 1) $moreinfo .= ' '.img_warning($langs->trans("YouMustEnableOneModule")); print load_fiche_titre($langs->trans("ModulesSetup"),$moreinfo,'title_setup'); // Start to show page 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; $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=common"; $head[$h][1] = $langs->trans("AvailableModules"); $head[$h][2] = 'common'; $h++; $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"; if ($mode == 'common') { print '
'; if ($optioncss != '') print ''; print ''; print ''; print ''; print ''; dol_fiche_head($head, $mode, '', -1); $moreforfilter = ''; $moreforfilter.='
'; $moreforfilter.= $langs->trans('Keyword') . ': '; $moreforfilter.= '
'; $moreforfilter.='
'; $moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), 1); $moreforfilter.= '
'; if (! empty($conf->global->MAIN_FEATURES_LEVEL)) { $array_version = array('stable'=>$langs->transnoentitiesnoconv("Stable")); if ($conf->global->MAIN_FEATURES_LEVEL < 0) $array_version['deprecated']=$langs->trans("Deprecated"); if ($conf->global->MAIN_FEATURES_LEVEL > 0) $array_version['experimental']=$langs->trans("Experimental"); if ($conf->global->MAIN_FEATURES_LEVEL > 1) $array_version['development']=$langs->trans("Development"); $moreforfilter.='
'; $moreforfilter.= $langs->trans('Version') . ': '.$form->selectarray('search_version', $array_version, $search_version, 1); $moreforfilter.= '
'; } $moreforfilter.='
'; $moreforfilter.= $langs->trans('Status') . ': '.$form->selectarray('search_status', array('active'=>$langs->transnoentitiesnoconv("Enabled"), 'disabled'=>$langs->transnoentitiesnoconv("Disabled")), $search_status, 1); $moreforfilter.= '
'; $moreforfilter.=' '; $moreforfilter.='
'; $moreforfilter.=''; $moreforfilter.=' '; $moreforfilter.=''; $moreforfilter.= '
'; if (! empty($moreforfilter)) { print $moreforfilter; $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; } print '

'; $moreforfilter=''; // Show list of modules $oldfamily=''; foreach ($orders as $key => $value) { $tab=explode('_',$value); $familyposition=$tab[0]; $familykey=$tab[1]; $module_position=$tab[2]; $numero=$tab[3]; $modName = $filename[$key]; $objMod = $modules[$modName]; $dirofmodule = $dirmod[$key]; $special = $objMod->special; //print $objMod->name." - ".$key." - ".$objMod->special.' - '.$objMod->version."
"; //if (($mode != (isset($specialtostring[$special])?$specialtostring[$special]:'unknown') && $mode != 'expdev') if (($special >= 4 && $mode != 'expdev') || ($mode == 'expdev' && $objMod->version != 'development' && $objMod->version != 'experimental')) continue; // Discard if not for current tab if (! $objMod->getName()) { dol_syslog("Error for module ".$key." - Property name of module looks empty", LOG_WARNING); continue; } $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); // Check filters $modulename=$objMod->getName(); $moduletechnicalname=$objMod->name; $moduledesc=$objMod->getDesc(); $moduledesclong=$objMod->getDescLong(); $moduleauthor=$objMod->getPublisher(); // We discard showing according to filters if ($search_keyword) { $qualified=0; if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename) || preg_match('/'.preg_quote($search_keyword).'/i', $moduletechnicalname) || preg_match('/'.preg_quote($search_keyword).'/i', $moduledesc) || preg_match('/'.preg_quote($search_keyword).'/i', $moduledesclong) || preg_match('/'.preg_quote($search_keyword).'/i', $moduleauthor) ) $qualified=1; if (! $qualified) continue; } if ($search_status) { if ($search_status == 'active' && empty($conf->global->$const_name)) continue; if ($search_status == 'disabled' && ! empty($conf->global->$const_name)) continue; } if ($search_nature) { if (preg_match('/^external/',$search_nature) && $objMod->isCoreOrExternalModule() != 'external') continue; if (preg_match('/^external_(.*)$/',$search_nature, $reg)) { //print $reg[1].'-'.dol_escape_htmltag($objMod->getPublisher()); $publisher=dol_escape_htmltag($objMod->getPublisher()); if ($reg[1] && dol_escape_htmltag($reg[1]) != $publisher) continue; if (! $reg[1] && ! empty($publisher)) continue; } if ($search_nature == 'core' && $objMod->isCoreOrExternalModule() == 'external') continue; } if ($search_version) { if (($objMod->version == 'development' || $objMod->version == 'experimental' || preg_match('/deprecated/', $objMod->version)) && $search_version == 'stable') continue; if ($objMod->version != 'development' && ($search_version == 'development')) continue; if ($objMod->version != 'experimental' && ($search_version == 'experimental')) continue; if (! preg_match('/deprecated/', $objMod->version) && ($search_version == 'deprecated')) continue; } // Load all lang files of module if (isset($objMod->langfiles) && is_array($objMod->langfiles)) { foreach($objMod->langfiles as $domain) { $langs->load($domain); } } // Print a separator if we change family if ($familykey!=$oldfamily) { if ($oldfamily) print '
'; $familytext=empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label']; print_fiche_titre($familytext, '', ''); print '
'; print ''."\n"; $atleastoneforfamily=0; } $atleastoneforfamily++; if ($familykey!=$oldfamily) { $familytext=empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label']; $oldfamily=$familykey; } // Version (with picto warning or not) $version=$objMod->getVersion(0); $versiontrans=''; if (preg_match('/development/i', $version)) $versiontrans.=img_warning($langs->trans("Development"), 'style="float: left"'); if (preg_match('/experimental/i', $version)) $versiontrans.=img_warning($langs->trans("Experimental"), 'style="float: left"'); if (preg_match('/deprecated/i', $version)) $versiontrans.=img_warning($langs->trans("Deprecated"), 'style="float: left"'); $versiontrans.=$objMod->getVersion(1); // Define imginfo $imginfo="info"; if ($objMod->isCoreOrExternalModule() == 'external') { $imginfo="info_black"; } print ''."\n"; // Picto + Name of module print ' \n"; // Desc print '\n"; // Help print ''; // Version print '\n"; // Activate/Disable and Setup (2 columns) if (! empty($conf->global->$const_name)) // If module is already activated { $disableSetup = 0; // Link enable/disabme print ''."\n"; // Link config if (! empty($objMod->config_page_url) && !$disableSetup) { if (is_array($objMod->config_page_url)) { print '\n"; } else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs)) { print ''; } else { print ''; } } else { print ''; } } else // Module not yet activated { // Link enable/disable print '\n"; // Link config print ''; } print "\n"; } if ($oldfamily) { print "
'; $alttext=''; //if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version); //if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin); if (! empty($objMod->picto)) { if (preg_match('/^\//i',$objMod->picto)) print img_picto($alttext,$objMod->picto,' width="14px"',1); else print img_object($alttext, $objMod->picto, 'class="valignmiddle" width="14px"'); } else { print img_object($alttext, 'generic', 'class="valignmiddle"'); } print ' '.$objMod->getName().''; print "'; print nl2br($objMod->getDesc()); print "'; //print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20', 0, 2, 1); print ''.img_picto($langs->trans("ClickToShowDescription"), $imginfo).''; print ''; print $versiontrans; print "'; if (! empty($arrayofwarnings[$modName])) { print ''."\n"; } if (! empty($objMod->disabled)) { print $langs->trans("Disabled"); } else if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1))) { print $langs->trans("Required"); if (! empty($conf->multicompany->enabled) && $user->entity) $disableSetup++; } else { print ''; print img_picto($langs->trans("Activated"),'switch_on'); print ''; } print ''; $i=0; foreach ($objMod->config_page_url as $page) { $urlpage=$page; if ($i++) { print ''.img_picto(ucfirst($page),"setup").''; // print ''.ucfirst($page).' '; } else { if (preg_match('/^([^@]+)@([^@]+)$/i',$urlpage,$regs)) { print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; } else { print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; } } } print "'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').''; if (! empty($objMod->always_enabled)) { // Should never happened } else if (! empty($objMod->disabled)) { print $langs->trans("Disabled"); } else { // Module qualified for activation $warningmessage=''; if (! empty($arrayofwarnings[$modName])) { print ''."\n"; foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage) { $warningmessage .= ($warningmessage?"\n":"").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code); } } if ($objMod->isCoreOrExternalModule() == 'external' && ! empty($arrayofwarningsext)) { print ''."\n"; foreach ($arrayofwarningsext as $keymodule => $arrayofwarningsextbycountry) { if (! empty($modules[$keymodule]->const_name)) // If module that request warning is on { foreach ($arrayofwarningsextbycountry as $keycountry => $cursorwarningmessage) { if ($keycountry == 'always' || $keycountry == $mysoc->country_code) { $warningmessage .= ($warningmessage?"\n":"").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code, $modules[$keymodule]->getName()); } } } } } print ''."\n"; print ''; print img_picto($langs->trans("Disabled"),'switch_off'); print "\n"; } print "'.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').'
\n"; print '
'; } dol_fiche_end(); // Show warning about external users print info_admin(showModulesExludedForExternal($modules))."\n"; print '
'; } if ($mode == 'marketplace') { dol_fiche_head($head, $mode, '', -1); // Marketplace print "\n"; print "\n"; //print ''; print ''; print ''; print ''; print "\n"; $url='https://www.dolistore.com'; print ''; print ''; print ''; print ''; print "\n"; $url='https://partners.dolibarr.org'; print ''; print ''; print ''; print ''; print "
'.$langs->trans("Logo").''.$langs->trans("WebSiteDesc").''.$langs->trans("URL").'
'.$langs->trans("DoliStoreDesc").''.$url.'
'.$langs->trans("DoliPartnersDesc").''.$url.'
\n"; dol_fiche_end(); } // Install external module if ($mode == 'deploy') { dol_fiche_head($head, $mode, '', -1); $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(); } llxFooter(); $db->close();