diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 7cb3d79cdda..122219a4cb2 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -518,8 +518,6 @@ $i = 0; // is a sequencer of modules found $j = 0; // j is module number. Automatically affected if module number not defined. $modNameLoaded = array(); -$listOfOfficialModuleGroups = array('hr', 'technic', 'interface', 'technic', 'portal', 'financial', 'crm', 'base', 'products', 'srm', 'ecm', 'projects', 'other'); - //if ($mode == 'common' || $mode == 'commonkanban') { // Load $modules (required for the badge count) foreach ($modulesdir as $dir) { @@ -619,7 +617,7 @@ foreach ($modulesdir as $dir) { } $familyposition = (empty($familyinfo[$familykey]['position']) ? '0' : $familyinfo[$familykey]['position']); - if ($external && !in_array($familykey, $listOfOfficialModuleGroups)) { + if ($external && !in_array($familykey, array_keys($familyinfo))) { // If module is extern and into a custom group (not into an official predefined one), it must appear at end (custom groups should not be before official groups). if (is_numeric($familyposition)) { $familyposition = sprintf("%03d", (int) $familyposition + 100); diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 18bd6779529..b9caef3e385 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -26,12 +26,6 @@ // Load Dolibarr environment require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - -if (empty($user->admin)) { - accessforbidden(); -} - /** * @var Conf $conf * @var DoliDB $db @@ -39,6 +33,11 @@ if (empty($user->admin)) { * @var Translate $langs * @var User $user */ +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + +if (empty($user->admin)) { + accessforbidden(); +} // Load translation files required by the page $langs->loadLangs(array("install", "other", "admin")); @@ -52,6 +51,7 @@ $search_id = GETPOST("search_id", 'alpha'); $search_version = GETPOST("search_version", 'alpha'); $search_permission = GETPOST("search_permission", 'alpha'); +$page = GETPOSTINT('page'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 067273bbda7..3e65ff3dab6 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -762,13 +762,13 @@ function dol_fileperm($pathoffile) /** * Make replacement of strings into a file. * - * @param string $srcfile Source file (can't be a directory) - * @param array $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...) - * @param string $destfile Destination file (can't be a directory). If empty, will be same than source file. - * @param string $newmask Mask for new file. '0' by default means getDolGlobalString('MAIN_UMASK'). Example: '0666'. - * @param int $indexdatabase 1=index new file into database. - * @param int $arrayreplacementisregex 1=Array of replacement is already an array with key that is a regex. Warning: the key must be escaped with preg_quote for '/' - * @return int Return integer <0 if error, 0 if nothing done (dest file already exists), >0 if OK + * @param string $srcfile Source file (can't be a directory) + * @param array $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...) + * @param string $destfile Destination file (can't be a directory). If empty, will be same than source file. + * @param string $newmask Mask for new file. '0' by default means getDolGlobalString('MAIN_UMASK'). Example: '0666'. + * @param int $indexdatabase 1=index new file into database. + * @param int $arrayreplacementisregex 1=Array of replacement is already an array with key that is a regex. Warning: the key must be escaped with preg_quote for '/' and include the starting/ending '/' in string. + * @return int Return integer <0 if error, 0 if nothing done (dest file already exists), >0 if OK * @see dol_copy(), dolCopyDir() */ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask = '0', $indexdatabase = 0, $arrayreplacementisregex = 0) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 63aeb67fbac..57b31e1ff2a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5421,7 +5421,8 @@ function getPictoForType($key, $morecss = '') * Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img * Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img * Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1) - * Example: fontawesome_envelope-open-text_fas_red_1em if you want to use fontaweseome icons: fontawesome__