@@ -74,12 +74,12 @@ discard block |
||
74 | 74 | $modulename = dol_sanitizeFileName(GETPOST('modulename', 'alpha')); |
75 | 75 | $objectname = dol_sanitizeFileName(GETPOST('objectname', 'alpha')); |
76 | 76 | $dicname = dol_sanitizeFileName(GETPOST('dicname', 'alpha')); |
77 | -$editorname= GETPOST('editorname', 'alpha'); |
|
78 | -$editorurl= GETPOST('editorurl', 'alpha'); |
|
79 | -$version= GETPOST('version', 'alpha'); |
|
80 | -$family= GETPOST('family', 'alpha'); |
|
81 | -$picto= GETPOST('idpicto', 'alpha'); |
|
82 | -$idmodule= GETPOST('idmodule', 'alpha'); |
|
77 | +$editorname = GETPOST('editorname', 'alpha'); |
|
78 | +$editorurl = GETPOST('editorurl', 'alpha'); |
|
79 | +$version = GETPOST('version', 'alpha'); |
|
80 | +$family = GETPOST('family', 'alpha'); |
|
81 | +$picto = GETPOST('idpicto', 'alpha'); |
|
82 | +$idmodule = GETPOST('idmodule', 'alpha'); |
|
83 | 83 | |
84 | 84 | // Security check |
85 | 85 | if (!isModEnabled('modulebuilder')) { |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | // Copy last 'html.formsetup.class.php' to backport folder |
250 | 250 | if (getDolGlobalInt('MODULEBUILDER_SUPPORT_COMPATIBILITY_V16')) { |
251 | 251 | $tryToCopyFromSetupClass = true; |
252 | - $backportDest = $destdir .'/backport/v16/core/class'; |
|
252 | + $backportDest = $destdir.'/backport/v16/core/class'; |
|
253 | 253 | $backportFileSrc = DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php'; |
254 | 254 | $backportFileDest = $backportDest.'/html.formsetup.class.php'; |
255 | 255 | $result = dol_mkdir($backportDest); |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | ); |
354 | 354 | |
355 | 355 | if (!empty($conf->global->MODULEBUILDER_SPECIFIC_AUTHOR)) { |
356 | - $arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' ' . getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR'); |
|
356 | + $arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' '.getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR'); |
|
357 | 357 | } |
358 | 358 | |
359 | 359 | $result = dolReplaceInFile($phpfileval['fullname'], $arrayreplacement); |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | |
382 | 382 | clearstatcache(true); |
383 | 383 | if (function_exists('opcache_invalidate')) { |
384 | - opcache_reset(); // remove the include cache hell ! |
|
384 | + opcache_reset(); // remove the include cache hell ! |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | header("Location: ".$_SERVER["PHP_SELF"].'?module='.$modulename); |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | } |
831 | 831 | } |
832 | 832 | $stringLog = implode("\n", $strreplace); |
833 | - dolReplaceInFile($destfile, array('//include::ChangeLog.md[]' => '','__CHANGELOG__' => $stringLog)); |
|
833 | + dolReplaceInFile($destfile, array('//include::ChangeLog.md[]' => '', '__CHANGELOG__' => $stringLog)); |
|
834 | 834 | } |
835 | 835 | |
836 | 836 | // Delete old documentation files |
@@ -1305,7 +1305,7 @@ discard block |
||
1305 | 1305 | } |
1306 | 1306 | $rights = $moduleobj->rights; |
1307 | 1307 | $moduledescriptorfile = $destdir.'/core/modules/mod'.$module.'.class.php'; |
1308 | - $checkComment=checkExistComment($moduledescriptorfile, 1); |
|
1308 | + $checkComment = checkExistComment($moduledescriptorfile, 1); |
|
1309 | 1309 | if ($checkComment < 0) { |
1310 | 1310 | setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Permissions"), "mod".$module."class.php"), null, 'warnings'); |
1311 | 1311 | } else { |
@@ -1471,7 +1471,7 @@ discard block |
||
1471 | 1471 | } |
1472 | 1472 | } |
1473 | 1473 | $menus = $moduleobj->menu; |
1474 | - $counter = 0 ; |
|
1474 | + $counter = 0; |
|
1475 | 1475 | foreach ($menus as $menu) { |
1476 | 1476 | if ($menu['leftmenu'] == strtolower($objectname)) { |
1477 | 1477 | $counter++; |
@@ -1512,7 +1512,7 @@ discard block |
||
1512 | 1512 | ); |
1513 | 1513 | |
1514 | 1514 | if (!empty($conf->global->MODULEBUILDER_SPECIFIC_AUTHOR)) { |
1515 | - $arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' ' . getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR'); |
|
1515 | + $arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' '.getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR'); |
|
1516 | 1516 | } |
1517 | 1517 | |
1518 | 1518 | $result = dolReplaceInFile($phpfileval['fullname'], $arrayreplacement); |
@@ -1612,7 +1612,7 @@ discard block |
||
1612 | 1612 | } else { |
1613 | 1613 | createNewDictionnary($module, $moduledescriptorfile, $newdicname, $dictionaries); |
1614 | 1614 | if (function_exists('opcache_invalidate')) { |
1615 | - opcache_reset(); // remove the include cache hell ! |
|
1615 | + opcache_reset(); // remove the include cache hell ! |
|
1616 | 1616 | } |
1617 | 1617 | clearstatcache(true); |
1618 | 1618 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); |
@@ -1706,7 +1706,7 @@ discard block |
||
1706 | 1706 | 'isameasure'=>GETPOST('propisameasure', 'int'), |
1707 | 1707 | 'comment'=>GETPOST('propcomment', 'alpha'), |
1708 | 1708 | 'help'=>GETPOST('prophelp', 'alpha'), |
1709 | - 'css'=>GETPOST('propcss', 'alpha'), // Can be 'maxwidth500 widthcentpercentminusxx' for example |
|
1709 | + 'css'=>GETPOST('propcss', 'alpha'), // Can be 'maxwidth500 widthcentpercentminusxx' for example |
|
1710 | 1710 | 'cssview'=>GETPOST('propcssview', 'alpha'), |
1711 | 1711 | 'csslist'=>GETPOST('propcsslist', 'alpha'), |
1712 | 1712 | 'default'=>GETPOST('propdefault', 'restricthtml'), |
@@ -1860,7 +1860,7 @@ discard block |
||
1860 | 1860 | |
1861 | 1861 | clearstatcache(true); |
1862 | 1862 | if (function_exists('opcache_invalidate')) { |
1863 | - opcache_reset(); // remove the include cache hell ! |
|
1863 | + opcache_reset(); // remove the include cache hell ! |
|
1864 | 1864 | } |
1865 | 1865 | |
1866 | 1866 | header("Location: ".$_SERVER["PHP_SELF"].'?module=deletemodule'); |
@@ -1952,7 +1952,7 @@ discard block |
||
1952 | 1952 | |
1953 | 1953 | clearstatcache(true); |
1954 | 1954 | if (function_exists('opcache_invalidate')) { |
1955 | - opcache_reset(); // remove the include cache hell ! |
|
1955 | + opcache_reset(); // remove the include cache hell ! |
|
1956 | 1956 | } |
1957 | 1957 | $resultko = 0; |
1958 | 1958 | foreach ($filetodelete as $tmpfiletodelete) { |
@@ -1972,7 +1972,7 @@ discard block |
||
1972 | 1972 | } |
1973 | 1973 | |
1974 | 1974 | $action = ''; |
1975 | - if (! $error) { |
|
1975 | + if (!$error) { |
|
1976 | 1976 | $tabobj = 'newobject'; |
1977 | 1977 | } else { |
1978 | 1978 | $tabobj = 'deleteobject'; |
@@ -2033,11 +2033,11 @@ discard block |
||
2033 | 2033 | } |
2034 | 2034 | |
2035 | 2035 | if (!empty(GETPOST('dictionnarykey'))) { |
2036 | - $newdicname = $dicts['tabname'][GETPOST('dictionnarykey')-1]; |
|
2036 | + $newdicname = $dicts['tabname'][GETPOST('dictionnarykey') - 1]; |
|
2037 | 2037 | } |
2038 | 2038 | |
2039 | 2039 | //chercher la table dicname |
2040 | - $query = "SHOW TABLES LIKE '" . MAIN_DB_PREFIX.strtolower($newdicname) . "'"; |
|
2040 | + $query = "SHOW TABLES LIKE '".MAIN_DB_PREFIX.strtolower($newdicname)."'"; |
|
2041 | 2041 | $checkTable = $db->query($query); |
2042 | 2042 | if ($checkTable && $db->num_rows($checkTable) <= 0) { |
2043 | 2043 | $error++; |
@@ -2076,7 +2076,7 @@ discard block |
||
2076 | 2076 | setEventMessages($langs->trans("DictionaryDeleted", ucfirst(substr($newdicname, 2))), null); |
2077 | 2077 | } |
2078 | 2078 | if (function_exists('opcache_invalidate')) { |
2079 | - opcache_reset(); // remove the include cache hell ! |
|
2079 | + opcache_reset(); // remove the include cache hell ! |
|
2080 | 2080 | } |
2081 | 2081 | clearstatcache(true); |
2082 | 2082 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); |
@@ -2084,7 +2084,7 @@ discard block |
||
2084 | 2084 | } |
2085 | 2085 | } |
2086 | 2086 | if ($dirins && $action == 'updatedictionary' && GETPOST('dictionnarykey')) { |
2087 | - $keydict = GETPOST('dictionnarykey') - 1 ; |
|
2087 | + $keydict = GETPOST('dictionnarykey') - 1; |
|
2088 | 2088 | |
2089 | 2089 | $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; |
2090 | 2090 | $destdir = $dirins.'/'.strtolower($module); |
@@ -2118,7 +2118,7 @@ discard block |
||
2118 | 2118 | setEventMessages($langs->trans("DictionaryNameUpdated", ucfirst(GETPOST('tablib'))), null); |
2119 | 2119 | } |
2120 | 2120 | if (function_exists('opcache_invalidate')) { |
2121 | - opcache_reset(); // remove the include cache hell ! |
|
2121 | + opcache_reset(); // remove the include cache hell ! |
|
2122 | 2122 | } |
2123 | 2123 | clearstatcache(true); |
2124 | 2124 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); |
@@ -2238,13 +2238,13 @@ discard block |
||
2238 | 2238 | |
2239 | 2239 | //check existing object permission |
2240 | 2240 | $counter = 0; |
2241 | - $permsForObject =array(); |
|
2241 | + $permsForObject = array(); |
|
2242 | 2242 | $permissions = $moduleobj->rights; |
2243 | 2243 | $allObject = array(); |
2244 | 2244 | |
2245 | 2245 | $countPerms = count($permissions); |
2246 | 2246 | |
2247 | - for ($i =0; $i<$countPerms; $i++) { |
|
2247 | + for ($i = 0; $i < $countPerms; $i++) { |
|
2248 | 2248 | if ($permissions[$i][4] == $objectForPerms) { |
2249 | 2249 | $counter++; |
2250 | 2250 | if (count($permsForObject) < 3) { |
@@ -2256,7 +2256,7 @@ discard block |
||
2256 | 2256 | |
2257 | 2257 | // check if label of object already exists |
2258 | 2258 | $countPermsObj = count($permsForObject); |
2259 | - for ($j = 0; $j<$countPermsObj; $j++) { |
|
2259 | + for ($j = 0; $j < $countPermsObj; $j++) { |
|
2260 | 2260 | if (in_array($crud, $permsForObject[$j])) { |
2261 | 2261 | $error++; |
2262 | 2262 | setEventMessages($langs->trans("ErrorExistingPermission", $langs->transnoentities($crud), $langs->transnoentities($objectForPerms)), null, 'errors'); |
@@ -2293,7 +2293,7 @@ discard block |
||
2293 | 2293 | |
2294 | 2294 | clearstatcache(true); |
2295 | 2295 | if (function_exists('opcache_invalidate')) { |
2296 | - opcache_reset(); // remove the include cache hell ! |
|
2296 | + opcache_reset(); // remove the include cache hell ! |
|
2297 | 2297 | } |
2298 | 2298 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module); |
2299 | 2299 | exit; |
@@ -2302,7 +2302,7 @@ discard block |
||
2302 | 2302 | |
2303 | 2303 | |
2304 | 2304 | // Update permission |
2305 | -if ($dirins && GETPOST('action') == 'update_right' && GETPOST('modifyright')&& empty($cancel)) { |
|
2305 | +if ($dirins && GETPOST('action') == 'update_right' && GETPOST('modifyright') && empty($cancel)) { |
|
2306 | 2306 | $error = 0; |
2307 | 2307 | // load class and check if right exist |
2308 | 2308 | $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; |
@@ -2345,21 +2345,21 @@ discard block |
||
2345 | 2345 | } |
2346 | 2346 | |
2347 | 2347 | $permissions = $moduleobj->rights; |
2348 | - $key =(int) GETPOST('counter')-1; |
|
2348 | + $key = (int) GETPOST('counter') - 1; |
|
2349 | 2349 | //get permission want to delete from permissions array |
2350 | 2350 | $x1 = $permissions[$key][1]; |
2351 | 2351 | $x2 = $permissions[$key][4]; |
2352 | 2352 | $x3 = $permissions[$key][5]; |
2353 | 2353 | //check existing object permission |
2354 | 2354 | $counter = 0; |
2355 | - $permsForObject =array(); |
|
2355 | + $permsForObject = array(); |
|
2356 | 2356 | $permissions = $moduleobj->rights; |
2357 | 2357 | $firstRight = 0; |
2358 | 2358 | $existRight = 0; |
2359 | 2359 | $allObject = array(); |
2360 | 2360 | |
2361 | 2361 | $countPerms = count($permissions); |
2362 | - for ($i =0; $i<$countPerms; $i++) { |
|
2362 | + for ($i = 0; $i < $countPerms; $i++) { |
|
2363 | 2363 | if ($permissions[$i][4] == $objectForPerms) { |
2364 | 2364 | $counter++; |
2365 | 2365 | if (count($permsForObject) < 3) { |
@@ -2371,7 +2371,7 @@ discard block |
||
2371 | 2371 | |
2372 | 2372 | if ($label != $x1 && $crud != $x3) { |
2373 | 2373 | $countPermsObj = count($permsForObject); |
2374 | - for ($j = 0; $j<$countPermsObj; $j++) { |
|
2374 | + for ($j = 0; $j < $countPermsObj; $j++) { |
|
2375 | 2375 | if (in_array($label, $permsForObject[$j])) { |
2376 | 2376 | $error++; |
2377 | 2377 | setEventMessages($langs->trans("ErrorExistingPermission", $langs->transnoentities($label), $langs->transnoentities($objectForPerms)), null, 'errors'); |
@@ -2399,7 +2399,7 @@ discard block |
||
2399 | 2399 | setEventMessages($langs->trans('PermissionUpdatedSuccesfuly'), null); |
2400 | 2400 | clearstatcache(true); |
2401 | 2401 | if (function_exists('opcache_invalidate')) { |
2402 | - opcache_reset(); // remove the include cache hell ! |
|
2402 | + opcache_reset(); // remove the include cache hell ! |
|
2403 | 2403 | } |
2404 | 2404 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module); |
2405 | 2405 | exit; |
@@ -2423,7 +2423,7 @@ discard block |
||
2423 | 2423 | } |
2424 | 2424 | |
2425 | 2425 | $permissions = $moduleobj->rights; |
2426 | - $key = (int) GETPOST('permskey', 'int')-1; |
|
2426 | + $key = (int) GETPOST('permskey', 'int') - 1; |
|
2427 | 2427 | |
2428 | 2428 | if (!$error) { |
2429 | 2429 | // check if module is enabled |
@@ -2449,7 +2449,7 @@ discard block |
||
2449 | 2449 | |
2450 | 2450 | clearstatcache(true); |
2451 | 2451 | if (function_exists('opcache_invalidate')) { |
2452 | - opcache_reset(); // remove the include cache hell ! |
|
2452 | + opcache_reset(); // remove the include cache hell ! |
|
2453 | 2453 | } |
2454 | 2454 | |
2455 | 2455 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module); |
@@ -2619,7 +2619,7 @@ discard block |
||
2619 | 2619 | |
2620 | 2620 | clearstatcache(true); |
2621 | 2621 | if (function_exists('opcache_invalidate')) { |
2622 | - opcache_reset(); // remove the include cache hell ! |
|
2622 | + opcache_reset(); // remove the include cache hell ! |
|
2623 | 2623 | } |
2624 | 2624 | |
2625 | 2625 | setEventMessages($langs->trans('MenuDeletedSuccessfuly'), null); |
@@ -2676,7 +2676,7 @@ discard block |
||
2676 | 2676 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Url")), null, 'errors'); |
2677 | 2677 | } |
2678 | 2678 | if (!empty(GETPOST('target'))) { |
2679 | - $targets = array('_blank','_self','_parent','_top',''); |
|
2679 | + $targets = array('_blank', '_self', '_parent', '_top', ''); |
|
2680 | 2680 | if (!in_array(GETPOST('target'), $targets)) { |
2681 | 2681 | $error++; |
2682 | 2682 | setEventMessages($langs->trans("ErrorFieldValue", $langs->transnoentities("target")), null, 'errors'); |
@@ -2710,7 +2710,7 @@ discard block |
||
2710 | 2710 | $objects = dolGetListOfObjectClasses($destdir); |
2711 | 2711 | |
2712 | 2712 | if (GETPOST('type', 'alpha') == 'left') { |
2713 | - if (empty(GETPOST('leftmenu')) && count($objects) >0) { |
|
2713 | + if (empty(GETPOST('leftmenu')) && count($objects) > 0) { |
|
2714 | 2714 | $error++; |
2715 | 2715 | setEventMessages($langs->trans("ErrorCoherenceMenu", $langs->transnoentities("leftmenu"), $langs->transnoentities("type")), null, 'errors'); |
2716 | 2716 | } |
@@ -2782,7 +2782,7 @@ discard block |
||
2782 | 2782 | |
2783 | 2783 | // Modify a menu entry |
2784 | 2784 | if ($dirins && $action == "update_menu" && GETPOST('menukey', 'int') && GETPOST('tabobj')) { |
2785 | - $objectname = GETPOST('tabobj'); |
|
2785 | + $objectname = GETPOST('tabobj'); |
|
2786 | 2786 | $dirins = $listofmodules[strtolower($module)]['moduledescriptorrootpath']; |
2787 | 2787 | $destdir = $dirins.'/'.strtolower($module); |
2788 | 2788 | $objects = dolGetListOfObjectClasses($destdir); |
@@ -2867,7 +2867,7 @@ discard block |
||
2867 | 2867 | if ($result < 0) { |
2868 | 2868 | setEventMessages($langs->trans('ErrorMenuExistValue'), null, 'errors'); |
2869 | 2869 | //var_dump($_SESSION);exit; |
2870 | - header("Location: ".$_SERVER["PHP_SELF"].'?action=editmenu&token='.newToken().'&menukey='.urlencode($key+1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.($key+1)); |
|
2870 | + header("Location: ".$_SERVER["PHP_SELF"].'?action=editmenu&token='.newToken().'&menukey='.urlencode($key + 1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.($key + 1)); |
|
2871 | 2871 | exit; |
2872 | 2872 | } |
2873 | 2873 | |
@@ -3321,7 +3321,7 @@ discard block |
||
3321 | 3321 | $h++; |
3322 | 3322 | |
3323 | 3323 | $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : ''); |
3324 | - $head2[$h][1] = ($countDictionaries == 0 ? $langs->trans("Dictionaries") : $langs->trans('Dictionaries').'<span class="marginleftonlyshort badge">'.$countDictionaries."</span>"); |
|
3324 | + $head2[$h][1] = ($countDictionaries == 0 ? $langs->trans("Dictionaries") : $langs->trans('Dictionaries').'<span class="marginleftonlyshort badge">'.$countDictionaries."</span>"); |
|
3325 | 3325 | $head2[$h][2] = 'dictionaries'; |
3326 | 3326 | $h++; |
3327 | 3327 | |
@@ -3844,7 +3844,7 @@ discard block |
||
3844 | 3844 | |
3845 | 3845 | print '</form>'; |
3846 | 3846 | } elseif ($tabobj == 'createproperty') { |
3847 | - $attributesUnique = array ( |
|
3847 | + $attributesUnique = array( |
|
3848 | 3848 | 'proplabel' => $form->textwithpicto($langs->trans("Label"), $langs->trans("YouCanUseTranslationKey")), |
3849 | 3849 | 'propname' => $form->textwithpicto($langs->trans("Code"), $langs->trans("PropertyDesc"), 1, 'help', 'extracss', 0, 3, 'propertyhelp'), |
3850 | 3850 | 'proptype' => $form->textwithpicto($langs->trans("Type"), $langs->trans("TypeOfFieldsHelpIntro").'<br><br>'.$langs->trans("TypeOfFieldsHelp"), 1, 'help', 'extracss', 0, 3, 'typehelp'), |
@@ -3939,8 +3939,8 @@ discard block |
||
3939 | 3939 | } |
3940 | 3940 | print '</table><br>'."\n"; |
3941 | 3941 | print '<div class="center">'; |
3942 | - print '<input type="submit" class="button button-save" name="add" value="' . dol_escape_htmltag($langs->trans('Create')) . '">'; |
|
3943 | - print '<input type="button" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '" onclick="goBack()">'; |
|
3942 | + print '<input type="submit" class="button button-save" name="add" value="'.dol_escape_htmltag($langs->trans('Create')).'">'; |
|
3943 | + print '<input type="button" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans('Cancel')).'" onclick="goBack()">'; |
|
3944 | 3944 | print '</div>'; |
3945 | 3945 | print '</form>'; |
3946 | 3946 | // javascript |
@@ -4005,7 +4005,7 @@ discard block |
||
4005 | 4005 | // Print form confirm |
4006 | 4006 | print $formconfirm; |
4007 | 4007 | } |
4008 | - if ($action != 'editfile' || empty($file) ) { |
|
4008 | + if ($action != 'editfile' || empty($file)) { |
|
4009 | 4009 | try { |
4010 | 4010 | //$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; |
4011 | 4011 | |
@@ -4045,16 +4045,16 @@ discard block |
||
4045 | 4045 | // Define path for sql file |
4046 | 4046 | $pathtosql = strtolower($module).'/sql/llx_'.strtolower($module).'_'.strtolower($tabobj).'-'.strtolower($module).'.sql'; |
4047 | 4047 | $result = dol_buildpath($pathtosql); |
4048 | - if (! dol_is_file($result)) { |
|
4048 | + if (!dol_is_file($result)) { |
|
4049 | 4049 | $pathtosql = strtolower($module).'/sql/llx_'.strtolower($module).'_'.strtolower($tabobj).'.sql'; |
4050 | 4050 | $result = dol_buildpath($pathtosql); |
4051 | - if (! dol_is_file($result)) { |
|
4051 | + if (!dol_is_file($result)) { |
|
4052 | 4052 | $pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($tabobj).'-'.strtolower($module).'.sql'; |
4053 | 4053 | $result = dol_buildpath($pathtosql); |
4054 | - if (! dol_is_file($result)) { |
|
4054 | + if (!dol_is_file($result)) { |
|
4055 | 4055 | $pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'-'.strtolower($module).'.sql'; |
4056 | 4056 | $result = dol_buildpath($pathtosql); |
4057 | - if (! dol_is_file($result)) { |
|
4057 | + if (!dol_is_file($result)) { |
|
4058 | 4058 | $pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'.sql'; |
4059 | 4059 | $pathtosqlextra = 'install/mysql/tables/llx_'.strtolower($module).'_extrafields.sql'; |
4060 | 4060 | $result = dol_buildpath($pathtosql); |
@@ -4073,7 +4073,7 @@ discard block |
||
4073 | 4073 | $pathtosqlroot = preg_replace('/\/llx_.*$/', '', $pathtosql); |
4074 | 4074 | |
4075 | 4075 | $pathtosqlkey = preg_replace('/\.sql$/', '.key.sql', $pathtosql); |
4076 | - $pathtosqlextrakey = preg_replace('/\.sql$/', '.key.sql', $pathtosqlextra); |
|
4076 | + $pathtosqlextrakey = preg_replace('/\.sql$/', '.key.sql', $pathtosqlextra); |
|
4077 | 4077 | |
4078 | 4078 | $pathtolib = strtolower($module).'/lib/'.strtolower($module).'.lib.php'; |
4079 | 4079 | $pathtoobjlib = strtolower($module).'/lib/'.strtolower($module).'_'.strtolower($tabobj).'.lib.php'; |
@@ -4132,7 +4132,7 @@ discard block |
||
4132 | 4132 | |
4133 | 4133 | // API file |
4134 | 4134 | print '<br>'; |
4135 | - print '<span class="fa fa-file-o"></span> '.$langs->trans("ApiClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtoapi) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtoapi).(dol_is_file($realpathtoapi)?'':'</span></strike>').'</strong>'; |
|
4135 | + print '<span class="fa fa-file-o"></span> '.$langs->trans("ApiClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtoapi) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtoapi).(dol_is_file($realpathtoapi) ? '' : '</span></strike>').'</strong>'; |
|
4136 | 4136 | if (dol_is_file($realpathtoapi)) { |
4137 | 4137 | $file = file_get_contents($realpathtoapi); |
4138 | 4138 | if (preg_match('/var '.$tabobj.'\s+([^\s]*)\s/ims', $file, $objs)) { |
@@ -4154,7 +4154,7 @@ discard block |
||
4154 | 4154 | } |
4155 | 4155 | // PHPUnit |
4156 | 4156 | print '<br>'; |
4157 | - print '<span class="fa fa-file-o"></span> '.$langs->trans("TestClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtophpunit) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtophpunit).(dol_is_file($realpathtophpunit)?'':'</span></strike>').'</strong>'; |
|
4157 | + print '<span class="fa fa-file-o"></span> '.$langs->trans("TestClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtophpunit) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtophpunit).(dol_is_file($realpathtophpunit) ? '' : '</span></strike>').'</strong>'; |
|
4158 | 4158 | if (dol_is_file($realpathtophpunit)) { |
4159 | 4159 | print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.urlencode($tab).'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&token='.newToken().'&format=php&file='.urlencode($pathtophpunit).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>'; |
4160 | 4160 | print ' '; |
@@ -4343,26 +4343,26 @@ discard block |
||
4343 | 4343 | $propname = $propkey; |
4344 | 4344 | $proplabel = $propval['label']; |
4345 | 4345 | $proptype = $propval['type']; |
4346 | - $proparrayofkeyval = !empty($propval['arrayofkeyval'])?$propval['arrayofkeyval']:''; |
|
4346 | + $proparrayofkeyval = !empty($propval['arrayofkeyval']) ? $propval['arrayofkeyval'] : ''; |
|
4347 | 4347 | $propnotnull = !empty($propval['notnull']) ? $propval['notnull'] : '0'; |
4348 | - $propdefault = !empty($propval['default'])?$propval['default']:''; |
|
4349 | - $propindex = !empty($propval['index'])?$propval['index']:''; |
|
4350 | - $propforeignkey = !empty($propval['foreignkey'])?$propval['foreignkey']:''; |
|
4348 | + $propdefault = !empty($propval['default']) ? $propval['default'] : ''; |
|
4349 | + $propindex = !empty($propval['index']) ? $propval['index'] : ''; |
|
4350 | + $propforeignkey = !empty($propval['foreignkey']) ? $propval['foreignkey'] : ''; |
|
4351 | 4351 | $propposition = $propval['position']; |
4352 | 4352 | $propenabled = $propval['enabled']; |
4353 | 4353 | $propvisible = $propval['visible']; |
4354 | - $propnoteditable = !empty($propval['noteditable'])?$propval['noteditable']:0; |
|
4354 | + $propnoteditable = !empty($propval['noteditable']) ? $propval['noteditable'] : 0; |
|
4355 | 4355 | //$propalwayseditable = !empty($propval['alwayseditable'])?$propval['alwayseditable']:0; |
4356 | - $propsearchall = !empty($propval['searchall'])?$propval['searchall']:0; |
|
4357 | - $propisameasure = !empty($propval['isameasure'])?$propval['isameasure']:0; |
|
4358 | - $propcss = !empty($propval['css'])?$propval['css']:''; |
|
4359 | - $propcssview = !empty($propval['cssview'])?$propval['cssview']:''; |
|
4360 | - $propcsslist = !empty($propval['csslist'])?$propval['csslist']:''; |
|
4361 | - $prophelp = !empty($propval['help'])?$propval['help']:''; |
|
4362 | - $propshowoncombobox = !empty($propval['showoncombobox'])?$propval['showoncombobox']:0; |
|
4356 | + $propsearchall = !empty($propval['searchall']) ? $propval['searchall'] : 0; |
|
4357 | + $propisameasure = !empty($propval['isameasure']) ? $propval['isameasure'] : 0; |
|
4358 | + $propcss = !empty($propval['css']) ? $propval['css'] : ''; |
|
4359 | + $propcssview = !empty($propval['cssview']) ? $propval['cssview'] : ''; |
|
4360 | + $propcsslist = !empty($propval['csslist']) ? $propval['csslist'] : ''; |
|
4361 | + $prophelp = !empty($propval['help']) ? $propval['help'] : ''; |
|
4362 | + $propshowoncombobox = !empty($propval['showoncombobox']) ? $propval['showoncombobox'] : 0; |
|
4363 | 4363 | //$propdisabled=$propval['disabled']; |
4364 | - $propvalidate = !empty($propval['validate'])?$propval['validate']:0; |
|
4365 | - $propcomment = !empty($propval['comment'])?$propval['comment']:''; |
|
4364 | + $propvalidate = !empty($propval['validate']) ? $propval['validate'] : 0; |
|
4365 | + $propcomment = !empty($propval['comment']) ? $propval['comment'] : ''; |
|
4366 | 4366 | |
4367 | 4367 | print '<!-- line for object property -->'."\n"; |
4368 | 4368 | print '<tr class="oddeven">'; |
@@ -4755,14 +4755,14 @@ discard block |
||
4755 | 4755 | $i = 0; |
4756 | 4756 | $maxi = count($dicts['tabname']); |
4757 | 4757 | while ($i < $maxi) { |
4758 | - if ($action == 'editdict' && $i == (int) GETPOST('dictionnarykey', 'int')-1) { |
|
4758 | + if ($action == 'editdict' && $i == (int) GETPOST('dictionnarykey', 'int') - 1) { |
|
4759 | 4759 | print '<tr class="oddeven">'; |
4760 | 4760 | print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
4761 | 4761 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
4762 | 4762 | print '<input type="hidden" name="tab" value="dictionaries">'; |
4763 | 4763 | print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module).'">'; |
4764 | 4764 | print '<input type="hidden" name="action" value="updatedictionary">'; |
4765 | - print '<input type="hidden" name="dictionnarykey" value="'.($i+1).'">'; |
|
4765 | + print '<input type="hidden" name="dictionnarykey" value="'.($i + 1).'">'; |
|
4766 | 4766 | |
4767 | 4767 | print '<td class="tdsticky tdstickygray">'; |
4768 | 4768 | print ($i + 1); |
@@ -4858,8 +4858,8 @@ discard block |
||
4858 | 4858 | print '</td>'; |
4859 | 4859 | |
4860 | 4860 | print '<td class="center minwidth75 tdstickyright tdstickyghostwhite">'; |
4861 | - print '<a class="editfielda reposition marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=editdict&token='.newToken().'&dictionnarykey='.urlencode($i+1).'&tab='.urlencode($tab).'&module='.urlencode($module).'">'.img_edit().'</a>'; |
|
4862 | - print '<a class="marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=deletedict&token='.newToken().'&dictionnarykey='.urlencode($i+1).'&tab='.urlencode($tab).'&module='.urlencode($module).'">'.img_delete().'</a>'; |
|
4861 | + print '<a class="editfielda reposition marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=editdict&token='.newToken().'&dictionnarykey='.urlencode($i + 1).'&tab='.urlencode($tab).'&module='.urlencode($module).'">'.img_edit().'</a>'; |
|
4862 | + print '<a class="marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=deletedict&token='.newToken().'&dictionnarykey='.urlencode($i + 1).'&tab='.urlencode($tab).'&module='.urlencode($module).'">'.img_delete().'</a>'; |
|
4863 | 4863 | print '</td>'; |
4864 | 4864 | |
4865 | 4865 | print '</tr>'; |
@@ -5074,7 +5074,7 @@ discard block |
||
5074 | 5074 | print_liste_field_titre("", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center ', $langs->trans('')); |
5075 | 5075 | print "</tr>\n"; |
5076 | 5076 | |
5077 | - $r = count($menus)+1; |
|
5077 | + $r = count($menus) + 1; |
|
5078 | 5078 | // for adding menu on module |
5079 | 5079 | print '<tr>'; |
5080 | 5080 | print '<td class="center tdsticky tdstickygray"><input type="hidden" readonly class="center maxwidth50" name="propenabled" value="#"></td>'; |
@@ -5099,7 +5099,7 @@ discard block |
||
5099 | 5099 | print '<td class="left"><input id="url" type="text" class="left maxwidth100" name="url" value="'.dol_escape_htmltag(GETPOST('url', 'alpha')).'"></td>'; |
5100 | 5100 | print '<td class="left"><input type="text" class="left maxwidth75" name="langs" value="'.strtolower($module).'@'.strtolower($module).'" readonly></td>'; |
5101 | 5101 | // Position |
5102 | - print '<td class="center"><input type="text" class="center maxwidth50 tdstickygray" name="position" value="'.(1000+$r).'" readonly></td>'; |
|
5102 | + print '<td class="center"><input type="text" class="center maxwidth50 tdstickygray" name="position" value="'.(1000 + $r).'" readonly></td>'; |
|
5103 | 5103 | // Enabled |
5104 | 5104 | print '<td class="center">'; |
5105 | 5105 | print '<input type="enabled" class="maxwidth125" value="'.dol_escape_htmltag(GETPOSTISSET('enabled') ? GETPOST('enabled') : 'isModEnabled(\''.$module.'\')').'">'; |
@@ -5148,7 +5148,7 @@ discard block |
||
5148 | 5148 | $propMainmenu = !empty($menu['mainmenu']) ? $menu['mainmenu'] : GETPOST('mainmenu'); |
5149 | 5149 | $propLeftmenu = !empty($menu['leftmenu']) ? $menu['leftmenu'] : GETPOST('leftmenu'); |
5150 | 5150 | $propUrl = !empty($menu['url']) ? $menu['url'] : GETPOST('url', 'alpha'); |
5151 | - $propPerms = !empty($menu['perms']) ? $menu['perms'] : GETPOST('perms'); |
|
5151 | + $propPerms = !empty($menu['perms']) ? $menu['perms'] : GETPOST('perms'); |
|
5152 | 5152 | $propUser = !empty($menu['user']) ? $menu['user'] : GETPOST('user'); |
5153 | 5153 | $propTarget = !empty($menu['target']) ? $menu['target'] : GETPOST('target'); |
5154 | 5154 | $propEnabled = !empty($menu['enabled']) ? $menu['enabled'] : GETPOST('enabled'); |
@@ -5331,7 +5331,7 @@ discard block |
||
5331 | 5331 | print '<td class="center minwidth75 tdstickyright tdstickyghostwhite">'; |
5332 | 5332 | if ($menu['titre'] != 'Module'.$module.'Name') { |
5333 | 5333 | print '<a class="editfielda reposition marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=editmenu&token='.newToken().'&menukey='.urlencode($i).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_edit().'</a>'; |
5334 | - print '<a class="marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=deletemenu&token='.newToken().'&menukey='.urlencode($i-1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_delete().'</a>'; |
|
5334 | + print '<a class="marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=deletemenu&token='.newToken().'&menukey='.urlencode($i - 1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_delete().'</a>'; |
|
5335 | 5335 | } |
5336 | 5336 | print '</td>'; |
5337 | 5337 | } |
@@ -5359,7 +5359,7 @@ discard block |
||
5359 | 5359 | } |
5360 | 5360 | }); |
5361 | 5361 | |
5362 | - var groupedRights = ' . $groupedRights_json . '; |
|
5362 | + var groupedRights = ' . $groupedRights_json.'; |
|
5363 | 5363 | var objectsSelect = $("select[id=\'objects\']"); |
5364 | 5364 | var permsSelect = $("select[id=\'perms\']"); |
5365 | 5365 | |
@@ -5430,7 +5430,7 @@ discard block |
||
5430 | 5430 | $dir = $dirread.'/'.$modulelowercase.'/class'; |
5431 | 5431 | $listofobject = dol_dir_list($dir, 'files', 0, '\.class\.php$'); |
5432 | 5432 | $objects = array('myobject'); |
5433 | - $reg =array(); |
|
5433 | + $reg = array(); |
|
5434 | 5434 | foreach ($listofobject as $fileobj) { |
5435 | 5435 | $tmpcontent = file_get_contents($fileobj['fullname']); |
5436 | 5436 | if (preg_match('/class\s+([^\s]*)\s+extends\s+CommonObject/ims', $tmpcontent, $reg)) { |
@@ -5582,7 +5582,7 @@ discard block |
||
5582 | 5582 | if (in_array($perm[5], array('lire', 'read', 'creer', 'write', 'effacer', 'delete'))) { |
5583 | 5583 | print dol_escape_htmltag(ucfirst($perm[4])); |
5584 | 5584 | } else { |
5585 | - print ''; // No particular object |
|
5585 | + print ''; // No particular object |
|
5586 | 5586 | } |
5587 | 5587 | print '</td>'; |
5588 | 5588 | |
@@ -6422,9 +6422,9 @@ discard block |
||
6422 | 6422 | |
6423 | 6423 | print '<td>'; |
6424 | 6424 | if ($tabName[0] === "+") { |
6425 | - print '<span class="badge badge-status4 badge-status">' . dol_escape_htmltag($tabName) . '</span>'; |
|
6425 | + print '<span class="badge badge-status4 badge-status">'.dol_escape_htmltag($tabName).'</span>'; |
|
6426 | 6426 | } else { |
6427 | - print '<span class="badge badge-status8 badge-status">' . dol_escape_htmltag($tabName) . '</span>'; |
|
6427 | + print '<span class="badge badge-status8 badge-status">'.dol_escape_htmltag($tabName).'</span>'; |
|
6428 | 6428 | } |
6429 | 6429 | print '</td>'; |
6430 | 6430 |