@@ -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')) { |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | |
249 | 249 | // Copy last html.formsetup.class.php' to backport folder |
250 | 250 | $tryToCopyFromSetupClass = true; |
251 | - $backportDest = $destdir .'/backport/v16/core/class'; |
|
251 | + $backportDest = $destdir.'/backport/v16/core/class'; |
|
252 | 252 | $backportFileSrc = DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php'; |
253 | 253 | $backportFileDest = $backportDest.'/html.formsetup.class.php'; |
254 | 254 | $result = dol_mkdir($backportDest); |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | |
392 | 392 | clearstatcache(true); |
393 | 393 | if (function_exists('opcache_invalidate')) { |
394 | - opcache_reset(); // remove the include cache hell ! |
|
394 | + opcache_reset(); // remove the include cache hell ! |
|
395 | 395 | } |
396 | 396 | |
397 | 397 | header("Location: ".$_SERVER["PHP_SELF"].'?module='.$modulename); |
@@ -840,7 +840,7 @@ discard block |
||
840 | 840 | } |
841 | 841 | } |
842 | 842 | $stringLog = implode("\n", $strreplace); |
843 | - dolReplaceInFile($destfile, array('//include::ChangeLog.md[]' => '','__CHANGELOG__' => $stringLog)); |
|
843 | + dolReplaceInFile($destfile, array('//include::ChangeLog.md[]' => '', '__CHANGELOG__' => $stringLog)); |
|
844 | 844 | } |
845 | 845 | |
846 | 846 | // Delete old documentation files |
@@ -1315,7 +1315,7 @@ discard block |
||
1315 | 1315 | } |
1316 | 1316 | $rights = $moduleobj->rights; |
1317 | 1317 | $moduledescriptorfile = $destdir.'/core/modules/mod'.$module.'.class.php'; |
1318 | - $checkComment=checkExistComment($moduledescriptorfile, 1); |
|
1318 | + $checkComment = checkExistComment($moduledescriptorfile, 1); |
|
1319 | 1319 | if ($checkComment < 0) { |
1320 | 1320 | setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Permissions"), "mod".$module."class.php"), null, 'warnings'); |
1321 | 1321 | } else { |
@@ -1481,7 +1481,7 @@ discard block |
||
1481 | 1481 | } |
1482 | 1482 | } |
1483 | 1483 | $menus = $moduleobj->menu; |
1484 | - $counter = 0 ; |
|
1484 | + $counter = 0; |
|
1485 | 1485 | foreach ($menus as $menu) { |
1486 | 1486 | if ($menu['leftmenu'] == strtolower($objectname)) { |
1487 | 1487 | $counter++; |
@@ -1634,7 +1634,7 @@ discard block |
||
1634 | 1634 | } else { |
1635 | 1635 | createNewDictionnary($module, $moduledescriptorfile, $newdicname, $dictionaries); |
1636 | 1636 | if (function_exists('opcache_invalidate')) { |
1637 | - opcache_reset(); // remove the include cache hell ! |
|
1637 | + opcache_reset(); // remove the include cache hell ! |
|
1638 | 1638 | } |
1639 | 1639 | clearstatcache(true); |
1640 | 1640 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); |
@@ -1713,7 +1713,7 @@ discard block |
||
1713 | 1713 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors'); |
1714 | 1714 | } |
1715 | 1715 | |
1716 | - if (!$error && !GETPOST('regenerateclasssql')&& !GETPOST('regeneratemissing')) { |
|
1716 | + if (!$error && !GETPOST('regenerateclasssql') && !GETPOST('regeneratemissing')) { |
|
1717 | 1717 | $addfieldentry = array( |
1718 | 1718 | 'name'=>GETPOST('propname', 'aZ09'), |
1719 | 1719 | 'label'=>GETPOST('proplabel', 'alpha'), |
@@ -1728,7 +1728,7 @@ discard block |
||
1728 | 1728 | 'isameasure'=>GETPOST('propisameasure', 'int'), |
1729 | 1729 | 'comment'=>GETPOST('propcomment', 'alpha'), |
1730 | 1730 | 'help'=>GETPOST('prophelp', 'alpha'), |
1731 | - 'css'=>GETPOST('propcss', 'alpha'), // Can be 'maxwidth500 widthcentpercentminusxx' for example |
|
1731 | + 'css'=>GETPOST('propcss', 'alpha'), // Can be 'maxwidth500 widthcentpercentminusxx' for example |
|
1732 | 1732 | 'cssview'=>GETPOST('propcssview', 'alpha'), |
1733 | 1733 | 'csslist'=>GETPOST('propcsslist', 'alpha'), |
1734 | 1734 | 'default'=>GETPOST('propdefault', 'restricthtml'), |
@@ -1877,7 +1877,7 @@ discard block |
||
1877 | 1877 | |
1878 | 1878 | clearstatcache(true); |
1879 | 1879 | if (function_exists('opcache_invalidate')) { |
1880 | - opcache_reset(); // remove the include cache hell ! |
|
1880 | + opcache_reset(); // remove the include cache hell ! |
|
1881 | 1881 | } |
1882 | 1882 | |
1883 | 1883 | header("Location: ".$_SERVER["PHP_SELF"].'?module=deletemodule'); |
@@ -1969,7 +1969,7 @@ discard block |
||
1969 | 1969 | |
1970 | 1970 | clearstatcache(true); |
1971 | 1971 | if (function_exists('opcache_invalidate')) { |
1972 | - opcache_reset(); // remove the include cache hell ! |
|
1972 | + opcache_reset(); // remove the include cache hell ! |
|
1973 | 1973 | } |
1974 | 1974 | $resultko = 0; |
1975 | 1975 | foreach ($filetodelete as $tmpfiletodelete) { |
@@ -2046,11 +2046,11 @@ discard block |
||
2046 | 2046 | } |
2047 | 2047 | |
2048 | 2048 | if (!empty(GETPOST('dictionnarykey'))) { |
2049 | - $newdicname = $dicts['tabname'][GETPOST('dictionnarykey')-1]; |
|
2049 | + $newdicname = $dicts['tabname'][GETPOST('dictionnarykey') - 1]; |
|
2050 | 2050 | } |
2051 | 2051 | |
2052 | 2052 | //chercher la table dicname |
2053 | - $query = "SHOW TABLES LIKE '" . MAIN_DB_PREFIX.strtolower($newdicname) . "'"; |
|
2053 | + $query = "SHOW TABLES LIKE '".MAIN_DB_PREFIX.strtolower($newdicname)."'"; |
|
2054 | 2054 | $checkTable = $db->query($query); |
2055 | 2055 | if ($checkTable && $db->num_rows($checkTable) <= 0) { |
2056 | 2056 | $error++; |
@@ -2089,7 +2089,7 @@ discard block |
||
2089 | 2089 | setEventMessages($langs->trans("DictionaryDeleted", ucfirst(substr($newdicname, 2))), null); |
2090 | 2090 | } |
2091 | 2091 | if (function_exists('opcache_invalidate')) { |
2092 | - opcache_reset(); // remove the include cache hell ! |
|
2092 | + opcache_reset(); // remove the include cache hell ! |
|
2093 | 2093 | } |
2094 | 2094 | clearstatcache(true); |
2095 | 2095 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); |
@@ -2097,7 +2097,7 @@ discard block |
||
2097 | 2097 | } |
2098 | 2098 | } |
2099 | 2099 | if ($dirins && $action == 'updatedictionary' && GETPOST('dictionnarykey')) { |
2100 | - $keydict = GETPOST('dictionnarykey') - 1 ; |
|
2100 | + $keydict = GETPOST('dictionnarykey') - 1; |
|
2101 | 2101 | |
2102 | 2102 | $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; |
2103 | 2103 | $destdir = $dirins.'/'.strtolower($module); |
@@ -2131,7 +2131,7 @@ discard block |
||
2131 | 2131 | setEventMessages($langs->trans("DictionaryNameUpdated", ucfirst(GETPOST('tablib'))), null); |
2132 | 2132 | } |
2133 | 2133 | if (function_exists('opcache_invalidate')) { |
2134 | - opcache_reset(); // remove the include cache hell ! |
|
2134 | + opcache_reset(); // remove the include cache hell ! |
|
2135 | 2135 | } |
2136 | 2136 | clearstatcache(true); |
2137 | 2137 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); |
@@ -2251,13 +2251,13 @@ discard block |
||
2251 | 2251 | |
2252 | 2252 | //check existing object permission |
2253 | 2253 | $counter = 0; |
2254 | - $permsForObject =array(); |
|
2254 | + $permsForObject = array(); |
|
2255 | 2255 | $permissions = $moduleobj->rights; |
2256 | 2256 | $allObject = array(); |
2257 | 2257 | |
2258 | 2258 | $countPerms = count($permissions); |
2259 | 2259 | |
2260 | - for ($i =0; $i<$countPerms; $i++) { |
|
2260 | + for ($i = 0; $i < $countPerms; $i++) { |
|
2261 | 2261 | if ($permissions[$i][4] == $objectForPerms) { |
2262 | 2262 | $counter++; |
2263 | 2263 | if (count($permsForObject) < 3) { |
@@ -2269,7 +2269,7 @@ discard block |
||
2269 | 2269 | |
2270 | 2270 | // check if label of object already exists |
2271 | 2271 | $countPermsObj = count($permsForObject); |
2272 | - for ($j = 0; $j<$countPermsObj; $j++) { |
|
2272 | + for ($j = 0; $j < $countPermsObj; $j++) { |
|
2273 | 2273 | if (in_array($crud, $permsForObject[$j])) { |
2274 | 2274 | $error++; |
2275 | 2275 | setEventMessages($langs->trans("ErrorExistingPermission", $langs->transnoentities($crud), $langs->transnoentities($objectForPerms)), null, 'errors'); |
@@ -2306,7 +2306,7 @@ discard block |
||
2306 | 2306 | |
2307 | 2307 | clearstatcache(true); |
2308 | 2308 | if (function_exists('opcache_invalidate')) { |
2309 | - opcache_reset(); // remove the include cache hell ! |
|
2309 | + opcache_reset(); // remove the include cache hell ! |
|
2310 | 2310 | } |
2311 | 2311 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module); |
2312 | 2312 | exit; |
@@ -2315,7 +2315,7 @@ discard block |
||
2315 | 2315 | |
2316 | 2316 | |
2317 | 2317 | // Update permission |
2318 | -if ($dirins && GETPOST('action') == 'update_right' && GETPOST('modifyright')&& empty($cancel)) { |
|
2318 | +if ($dirins && GETPOST('action') == 'update_right' && GETPOST('modifyright') && empty($cancel)) { |
|
2319 | 2319 | $error = 0; |
2320 | 2320 | // load class and check if right exist |
2321 | 2321 | $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; |
@@ -2358,21 +2358,21 @@ discard block |
||
2358 | 2358 | } |
2359 | 2359 | |
2360 | 2360 | $permissions = $moduleobj->rights; |
2361 | - $key =(int) GETPOST('counter')-1; |
|
2361 | + $key = (int) GETPOST('counter') - 1; |
|
2362 | 2362 | //get permission want to delete from permissions array |
2363 | 2363 | $x1 = $permissions[$key][1]; |
2364 | 2364 | $x2 = $permissions[$key][4]; |
2365 | 2365 | $x3 = $permissions[$key][5]; |
2366 | 2366 | //check existing object permission |
2367 | 2367 | $counter = 0; |
2368 | - $permsForObject =array(); |
|
2368 | + $permsForObject = array(); |
|
2369 | 2369 | $permissions = $moduleobj->rights; |
2370 | 2370 | $firstRight = 0; |
2371 | 2371 | $existRight = 0; |
2372 | 2372 | $allObject = array(); |
2373 | 2373 | |
2374 | 2374 | $countPerms = count($permissions); |
2375 | - for ($i =0; $i<$countPerms; $i++) { |
|
2375 | + for ($i = 0; $i < $countPerms; $i++) { |
|
2376 | 2376 | if ($permissions[$i][4] == $objectForPerms) { |
2377 | 2377 | $counter++; |
2378 | 2378 | if (count($permsForObject) < 3) { |
@@ -2384,7 +2384,7 @@ discard block |
||
2384 | 2384 | |
2385 | 2385 | if ($label != $x1 && $crud != $x3) { |
2386 | 2386 | $countPermsObj = count($permsForObject); |
2387 | - for ($j = 0; $j<$countPermsObj; $j++) { |
|
2387 | + for ($j = 0; $j < $countPermsObj; $j++) { |
|
2388 | 2388 | if (in_array($label, $permsForObject[$j])) { |
2389 | 2389 | $error++; |
2390 | 2390 | setEventMessages($langs->trans("ErrorExistingPermission", $langs->transnoentities($label), $langs->transnoentities($objectForPerms)), null, 'errors'); |
@@ -2412,7 +2412,7 @@ discard block |
||
2412 | 2412 | setEventMessages($langs->trans('PermissionUpdatedSuccesfuly'), null); |
2413 | 2413 | clearstatcache(true); |
2414 | 2414 | if (function_exists('opcache_invalidate')) { |
2415 | - opcache_reset(); // remove the include cache hell ! |
|
2415 | + opcache_reset(); // remove the include cache hell ! |
|
2416 | 2416 | } |
2417 | 2417 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module); |
2418 | 2418 | exit; |
@@ -2436,7 +2436,7 @@ discard block |
||
2436 | 2436 | } |
2437 | 2437 | |
2438 | 2438 | $permissions = $moduleobj->rights; |
2439 | - $key = (int) GETPOST('permskey', 'int')-1; |
|
2439 | + $key = (int) GETPOST('permskey', 'int') - 1; |
|
2440 | 2440 | |
2441 | 2441 | if (!$error) { |
2442 | 2442 | // check if module is enabled |
@@ -2462,7 +2462,7 @@ discard block |
||
2462 | 2462 | |
2463 | 2463 | clearstatcache(true); |
2464 | 2464 | if (function_exists('opcache_invalidate')) { |
2465 | - opcache_reset(); // remove the include cache hell ! |
|
2465 | + opcache_reset(); // remove the include cache hell ! |
|
2466 | 2466 | } |
2467 | 2467 | |
2468 | 2468 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module); |
@@ -2631,7 +2631,7 @@ discard block |
||
2631 | 2631 | |
2632 | 2632 | clearstatcache(true); |
2633 | 2633 | if (function_exists('opcache_invalidate')) { |
2634 | - opcache_reset(); // remove the include cache hell ! |
|
2634 | + opcache_reset(); // remove the include cache hell ! |
|
2635 | 2635 | } |
2636 | 2636 | |
2637 | 2637 | setEventMessages($langs->trans('MenuDeletedSuccessfuly'), null); |
@@ -2687,7 +2687,7 @@ discard block |
||
2687 | 2687 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Url")), null, 'errors'); |
2688 | 2688 | } |
2689 | 2689 | if (!empty(GETPOST('target'))) { |
2690 | - $targets = array('_blank','_self','_parent','_top',''); |
|
2690 | + $targets = array('_blank', '_self', '_parent', '_top', ''); |
|
2691 | 2691 | if (!in_array(GETPOST('target'), $targets)) { |
2692 | 2692 | $error++; |
2693 | 2693 | setEventMessages($langs->trans("ErrorFieldValue", $langs->transnoentities("target")), null, 'errors'); |
@@ -2721,7 +2721,7 @@ discard block |
||
2721 | 2721 | $objects = dolGetListOfObjectClasses($destdir); |
2722 | 2722 | |
2723 | 2723 | if (GETPOST('type', 'alpha') == 'left') { |
2724 | - if (empty(GETPOST('leftmenu')) && count($objects) >0) { |
|
2724 | + if (empty(GETPOST('leftmenu')) && count($objects) > 0) { |
|
2725 | 2725 | $error++; |
2726 | 2726 | setEventMessages($langs->trans("ErrorCoherenceMenu", $langs->transnoentities("leftmenu"), $langs->transnoentities("type")), null, 'errors'); |
2727 | 2727 | } |
@@ -2784,7 +2784,7 @@ discard block |
||
2784 | 2784 | |
2785 | 2785 | // modify a menu |
2786 | 2786 | if ($dirins && $action == "modify_menu" && GETPOST('menukey', 'int') && GETPOST('tabobj')) { |
2787 | - $objectname = GETPOST('tabobj'); |
|
2787 | + $objectname = GETPOST('tabobj'); |
|
2788 | 2788 | $dirins = $listofmodules[strtolower($module)]['moduledescriptorrootpath']; |
2789 | 2789 | $destdir = $dirins.'/'.strtolower($module); |
2790 | 2790 | $objects = dolGetListOfObjectClasses($destdir); |
@@ -2869,7 +2869,7 @@ discard block |
||
2869 | 2869 | } |
2870 | 2870 | if ($result < 0) { |
2871 | 2871 | setEventMessages($langs->trans('ErrorMenuExistValue'), null, 'errors'); |
2872 | - header("Location: ".$_SERVER["PHP_SELF"].'?action=editmenu&token='.newToken().'&menukey='.urlencode($key+1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.($key+1)); |
|
2872 | + header("Location: ".$_SERVER["PHP_SELF"].'?action=editmenu&token='.newToken().'&menukey='.urlencode($key + 1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.($key + 1)); |
|
2873 | 2873 | exit; |
2874 | 2874 | } |
2875 | 2875 | setEventMessages($langs->trans('MenuUpdatedSuccessfuly'), null); |
@@ -3327,7 +3327,7 @@ discard block |
||
3327 | 3327 | $h++; |
3328 | 3328 | |
3329 | 3329 | $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : ''); |
3330 | - $head2[$h][1] = ($countDictionaries == 0 ? $langs->trans("Dictionaries") : $langs->trans('Dictionaries').' <span class="badge">'.$countDictionaries."</span>"); |
|
3330 | + $head2[$h][1] = ($countDictionaries == 0 ? $langs->trans("Dictionaries") : $langs->trans('Dictionaries').' <span class="badge">'.$countDictionaries."</span>"); |
|
3331 | 3331 | $head2[$h][2] = 'dictionaries'; |
3332 | 3332 | $h++; |
3333 | 3333 | |
@@ -3830,7 +3830,7 @@ discard block |
||
3830 | 3830 | |
3831 | 3831 | print '</form>'; |
3832 | 3832 | } elseif ($tabobj == 'createproperty') { |
3833 | - $attributesUnique = array ( |
|
3833 | + $attributesUnique = array( |
|
3834 | 3834 | 'propname' => $form->textwithpicto($langs->trans("Code"), $langs->trans("PropertyDesc"), 1, 'help', 'extracss', 0, 3, 'propertyhelp'), |
3835 | 3835 | 'proplabel' => $form->textwithpicto($langs->trans("Label"), $langs->trans("YouCanUseTranslationKey")), |
3836 | 3836 | 'proptype' => $form->textwithpicto($langs->trans("Type"), $langs->trans("TypeOfFieldsHelpIntro").'<br><br>'.$langs->trans("TypeOfFieldsHelp"), 1, 'help', 'extracss', 0, 3, 'typehelp'), |
@@ -3890,8 +3890,8 @@ discard block |
||
3890 | 3890 | } |
3891 | 3891 | print '</table><br>'."\n"; |
3892 | 3892 | print '<div class="center">'; |
3893 | - print '<input type="submit" class="button button-save" name="add" value="' . dol_escape_htmltag($langs->trans('Create')) . '">'; |
|
3894 | - print '<input type="button" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '" onclick="goBack()">'; |
|
3893 | + print '<input type="submit" class="button button-save" name="add" value="'.dol_escape_htmltag($langs->trans('Create')).'">'; |
|
3894 | + print '<input type="button" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans('Cancel')).'" onclick="goBack()">'; |
|
3895 | 3895 | print '</div>'; |
3896 | 3896 | print '</form>'; |
3897 | 3897 | // javascript |
@@ -3986,7 +3986,7 @@ discard block |
||
3986 | 3986 | // Print form confirm |
3987 | 3987 | print $formconfirm; |
3988 | 3988 | } |
3989 | - if ($action != 'editfile' || empty($file) ) { |
|
3989 | + if ($action != 'editfile' || empty($file)) { |
|
3990 | 3990 | try { |
3991 | 3991 | //$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; |
3992 | 3992 | |
@@ -4026,16 +4026,16 @@ discard block |
||
4026 | 4026 | // Define path for sql file |
4027 | 4027 | $pathtosql = strtolower($module).'/sql/llx_'.strtolower($module).'_'.strtolower($tabobj).'-'.strtolower($module).'.sql'; |
4028 | 4028 | $result = dol_buildpath($pathtosql); |
4029 | - if (! dol_is_file($result)) { |
|
4029 | + if (!dol_is_file($result)) { |
|
4030 | 4030 | $pathtosql = strtolower($module).'/sql/llx_'.strtolower($module).'_'.strtolower($tabobj).'.sql'; |
4031 | 4031 | $result = dol_buildpath($pathtosql); |
4032 | - if (! dol_is_file($result)) { |
|
4032 | + if (!dol_is_file($result)) { |
|
4033 | 4033 | $pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($tabobj).'-'.strtolower($module).'.sql'; |
4034 | 4034 | $result = dol_buildpath($pathtosql); |
4035 | - if (! dol_is_file($result)) { |
|
4035 | + if (!dol_is_file($result)) { |
|
4036 | 4036 | $pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'-'.strtolower($module).'.sql'; |
4037 | 4037 | $result = dol_buildpath($pathtosql); |
4038 | - if (! dol_is_file($result)) { |
|
4038 | + if (!dol_is_file($result)) { |
|
4039 | 4039 | $pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'.sql'; |
4040 | 4040 | $pathtosqlextra = 'install/mysql/tables/llx_'.strtolower($module).'_extrafields.sql'; |
4041 | 4041 | $result = dol_buildpath($pathtosql); |
@@ -4054,7 +4054,7 @@ discard block |
||
4054 | 4054 | $pathtosqlroot = preg_replace('/\/llx_.*$/', '', $pathtosql); |
4055 | 4055 | |
4056 | 4056 | $pathtosqlkey = preg_replace('/\.sql$/', '.key.sql', $pathtosql); |
4057 | - $pathtosqlextrakey = preg_replace('/\.sql$/', '.key.sql', $pathtosqlextra); |
|
4057 | + $pathtosqlextrakey = preg_replace('/\.sql$/', '.key.sql', $pathtosqlextra); |
|
4058 | 4058 | |
4059 | 4059 | $pathtolib = strtolower($module).'/lib/'.strtolower($module).'.lib.php'; |
4060 | 4060 | $pathtoobjlib = strtolower($module).'/lib/'.strtolower($module).'_'.strtolower($tabobj).'.lib.php'; |
@@ -4113,7 +4113,7 @@ discard block |
||
4113 | 4113 | |
4114 | 4114 | // API file |
4115 | 4115 | print '<br>'; |
4116 | - 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>'; |
|
4116 | + 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>'; |
|
4117 | 4117 | if (dol_is_file($realpathtoapi)) { |
4118 | 4118 | $file = file_get_contents($realpathtoapi); |
4119 | 4119 | if (preg_match('/var '.$tabobj.'\s+([^\s]*)\s/ims', $file, $objs)) { |
@@ -4135,7 +4135,7 @@ discard block |
||
4135 | 4135 | } |
4136 | 4136 | // PHPUnit |
4137 | 4137 | print '<br>'; |
4138 | - 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>'; |
|
4138 | + 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>'; |
|
4139 | 4139 | if (dol_is_file($realpathtophpunit)) { |
4140 | 4140 | 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>'; |
4141 | 4141 | print ' '; |
@@ -4324,26 +4324,26 @@ discard block |
||
4324 | 4324 | $propname = $propkey; |
4325 | 4325 | $proplabel = $propval['label']; |
4326 | 4326 | $proptype = $propval['type']; |
4327 | - $proparrayofkeyval = !empty($propval['arrayofkeyval'])?$propval['arrayofkeyval']:''; |
|
4327 | + $proparrayofkeyval = !empty($propval['arrayofkeyval']) ? $propval['arrayofkeyval'] : ''; |
|
4328 | 4328 | $propnotnull = !empty($propval['notnull']) ? $propval['notnull'] : '0'; |
4329 | - $propdefault = !empty($propval['default'])?$propval['default']:''; |
|
4330 | - $propindex = !empty($propval['index'])?$propval['index']:''; |
|
4331 | - $propforeignkey = !empty($propval['foreignkey'])?$propval['foreignkey']:''; |
|
4329 | + $propdefault = !empty($propval['default']) ? $propval['default'] : ''; |
|
4330 | + $propindex = !empty($propval['index']) ? $propval['index'] : ''; |
|
4331 | + $propforeignkey = !empty($propval['foreignkey']) ? $propval['foreignkey'] : ''; |
|
4332 | 4332 | $propposition = $propval['position']; |
4333 | 4333 | $propenabled = $propval['enabled']; |
4334 | 4334 | $propvisible = $propval['visible']; |
4335 | - $propnoteditable = !empty($propval['noteditable'])?$propval['noteditable']:0; |
|
4336 | - $propalwayseditable = !empty($propval['alwayseditable'])?$propval['alwayseditable']:0; |
|
4337 | - $propsearchall = !empty($propval['searchall'])?$propval['searchall']:0; |
|
4338 | - $propisameasure = !empty($propval['isameasure'])?$propval['isameasure']:0; |
|
4339 | - $propcss = !empty($propval['css'])?$propval['css']:''; |
|
4340 | - $propcssview = !empty($propval['cssview'])?$propval['cssview']:''; |
|
4341 | - $propcsslist = !empty($propval['csslist'])?$propval['csslist']:''; |
|
4342 | - $prophelp = !empty($propval['help'])?$propval['help']:''; |
|
4343 | - $propshowoncombobox = !empty($propval['showoncombobox'])?$propval['showoncombobox']:0; |
|
4335 | + $propnoteditable = !empty($propval['noteditable']) ? $propval['noteditable'] : 0; |
|
4336 | + $propalwayseditable = !empty($propval['alwayseditable']) ? $propval['alwayseditable'] : 0; |
|
4337 | + $propsearchall = !empty($propval['searchall']) ? $propval['searchall'] : 0; |
|
4338 | + $propisameasure = !empty($propval['isameasure']) ? $propval['isameasure'] : 0; |
|
4339 | + $propcss = !empty($propval['css']) ? $propval['css'] : ''; |
|
4340 | + $propcssview = !empty($propval['cssview']) ? $propval['cssview'] : ''; |
|
4341 | + $propcsslist = !empty($propval['csslist']) ? $propval['csslist'] : ''; |
|
4342 | + $prophelp = !empty($propval['help']) ? $propval['help'] : ''; |
|
4343 | + $propshowoncombobox = !empty($propval['showoncombobox']) ? $propval['showoncombobox'] : 0; |
|
4344 | 4344 | //$propdisabled=$propval['disabled']; |
4345 | - $propvalidate = !empty($propval['validate'])?$propval['validate']:0; |
|
4346 | - $propcomment = !empty($propval['comment'])?$propval['comment']:''; |
|
4345 | + $propvalidate = !empty($propval['validate']) ? $propval['validate'] : 0; |
|
4346 | + $propcomment = !empty($propval['comment']) ? $propval['comment'] : ''; |
|
4347 | 4347 | |
4348 | 4348 | print '<tr class="oddeven">'; |
4349 | 4349 | |
@@ -4734,14 +4734,14 @@ discard block |
||
4734 | 4734 | $i = 0; |
4735 | 4735 | $maxi = count($dicts['tabname']); |
4736 | 4736 | while ($i < $maxi) { |
4737 | - if ($action == 'editdict' && $i == (int) GETPOST('dictionnarykey', 'int')-1) { |
|
4737 | + if ($action == 'editdict' && $i == (int) GETPOST('dictionnarykey', 'int') - 1) { |
|
4738 | 4738 | print '<tr class="oddeven">'; |
4739 | 4739 | print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
4740 | 4740 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
4741 | 4741 | print '<input type="hidden" name="tab" value="dictionaries">'; |
4742 | 4742 | print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module).'">'; |
4743 | 4743 | print '<input type="hidden" name="action" value="updatedictionary">'; |
4744 | - print '<input type="hidden" name="dictionnarykey" value="'.($i+1).'">'; |
|
4744 | + print '<input type="hidden" name="dictionnarykey" value="'.($i + 1).'">'; |
|
4745 | 4745 | |
4746 | 4746 | print '<td class="tdsticky tdstickygray">'; |
4747 | 4747 | print ($i + 1); |
@@ -4837,8 +4837,8 @@ discard block |
||
4837 | 4837 | print '</td>'; |
4838 | 4838 | |
4839 | 4839 | print '<td class="center minwidth75 tdstickyright tdstickyghostwhite">'; |
4840 | - 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>'; |
|
4841 | - 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>'; |
|
4840 | + 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>'; |
|
4841 | + 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>'; |
|
4842 | 4842 | print '</td>'; |
4843 | 4843 | |
4844 | 4844 | print '</tr>'; |
@@ -5045,7 +5045,7 @@ discard block |
||
5045 | 5045 | print_liste_field_titre("", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center ', $langs->trans('')); |
5046 | 5046 | |
5047 | 5047 | print "</tr>\n"; |
5048 | - $r = count($menus)+1; |
|
5048 | + $r = count($menus) + 1; |
|
5049 | 5049 | // for adding menu on module |
5050 | 5050 | print '<tr>'; |
5051 | 5051 | print '<td class="center"><input type="hidden" readonly class="center maxwidth50" name="propenabled" value="#"></td>'; |
@@ -5069,7 +5069,7 @@ discard block |
||
5069 | 5069 | print '<td class="left"><input id="url" type="text" class="left maxwidth50" name="url" value="'.dol_escape_htmltag(GETPOST('url', 'alpha')).'"></td>'; |
5070 | 5070 | print '<td class="left"><input type="text" class="left maxwidth75" name="langs" value="'.strtolower($module).'@'.strtolower($module).'" readonly></td>'; |
5071 | 5071 | // Position |
5072 | - print '<td class="center"><input type="text" class="center maxwidth50 tdstickygray" name="position" value="'.(1000+$r).'" readonly></td>'; |
|
5072 | + print '<td class="center"><input type="text" class="center maxwidth50 tdstickygray" name="position" value="'.(1000 + $r).'" readonly></td>'; |
|
5073 | 5073 | // Enabled |
5074 | 5074 | print '<td class="center">'; |
5075 | 5075 | print '<input type="enabled" class="maxwidth125" value="'.dol_escape_htmltag(GETPOSTISSET('enabled') ? GETPOST('enabled') : 'isModEnabled(\''.$module.'\')').'">'; |
@@ -5120,7 +5120,7 @@ discard block |
||
5120 | 5120 | $propMainmenu = !empty($menu['mainmenu']) ? $menu['mainmenu'] : GETPOST('mainmenu'); |
5121 | 5121 | $propLeftmenu = !empty($menu['leftmenu']) ? $menu['leftmenu'] : GETPOST('leftmenu'); |
5122 | 5122 | $propUrl = !empty($menu['url']) ? $menu['url'] : GETPOST('url', 'alpha'); |
5123 | - $propPerms = !empty($menu['perms']) ? $menu['perms'] : GETPOST('perms'); |
|
5123 | + $propPerms = !empty($menu['perms']) ? $menu['perms'] : GETPOST('perms'); |
|
5124 | 5124 | $propUser = !empty($menu['user']) ? $menu['user'] : GETPOST('user'); |
5125 | 5125 | $propTarget = !empty($menu['target']) ? $menu['target'] : GETPOST('target'); |
5126 | 5126 | $propEnabled = !empty($menu['enabled']) ? $menu['enabled'] : GETPOST('enabled'); |
@@ -5280,7 +5280,7 @@ discard block |
||
5280 | 5280 | if (strpos($menu['perms'], "\$user->hasRight") !== 0) { |
5281 | 5281 | print ''; |
5282 | 5282 | } else { |
5283 | - print (dol_escape_htmltag($langs->trans($crud[$valPerms])) ); |
|
5283 | + print (dol_escape_htmltag($langs->trans($crud[$valPerms]))); |
|
5284 | 5284 | } |
5285 | 5285 | print '</td>'; |
5286 | 5286 | |
@@ -5302,7 +5302,7 @@ discard block |
||
5302 | 5302 | print '<td class="center minwidth75 tdstickyright tdstickyghostwhite">'; |
5303 | 5303 | if ($menu['titre'] != 'Module'.$module.'Name') { |
5304 | 5304 | 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>'; |
5305 | - 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>'; |
|
5305 | + 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>'; |
|
5306 | 5306 | } |
5307 | 5307 | print '</td>'; |
5308 | 5308 | } |
@@ -5328,7 +5328,7 @@ discard block |
||
5328 | 5328 | } |
5329 | 5329 | }); |
5330 | 5330 | |
5331 | - var groupedRights = ' . $groupedRights_json . '; |
|
5331 | + var groupedRights = ' . $groupedRights_json.'; |
|
5332 | 5332 | var objectsSelect = $("select[id=\'objects\']"); |
5333 | 5333 | var permsSelect = $("select[id=\'perms\']"); |
5334 | 5334 | |
@@ -5399,7 +5399,7 @@ discard block |
||
5399 | 5399 | $dir = $dirread.'/'.$modulelowercase.'/class'; |
5400 | 5400 | $listofobject = dol_dir_list($dir, 'files', 0, '\.class\.php$'); |
5401 | 5401 | $objects = array('myobject'); |
5402 | - $reg =array(); |
|
5402 | + $reg = array(); |
|
5403 | 5403 | foreach ($listofobject as $fileobj) { |
5404 | 5404 | $tmpcontent = file_get_contents($fileobj['fullname']); |
5405 | 5405 | if (preg_match('/class\s+([^\s]*)\s+extends\s+CommonObject/ims', $tmpcontent, $reg)) { |
@@ -5550,7 +5550,7 @@ discard block |
||
5550 | 5550 | if (in_array($perm[5], array('lire', 'read', 'creer', 'write', 'effacer', 'delete'))) { |
5551 | 5551 | print dol_escape_htmltag(ucfirst($perm[4])); |
5552 | 5552 | } else { |
5553 | - print ''; // No particular object |
|
5553 | + print ''; // No particular object |
|
5554 | 5554 | } |
5555 | 5555 | print '</td>'; |
5556 | 5556 | |
@@ -6387,9 +6387,9 @@ discard block |
||
6387 | 6387 | |
6388 | 6388 | print '<td>'; |
6389 | 6389 | if ($tabName[0] === "+") { |
6390 | - print '<span class="badge badge-status4 badge-status">' . dol_escape_htmltag($tabName) . '</span>'; |
|
6390 | + print '<span class="badge badge-status4 badge-status">'.dol_escape_htmltag($tabName).'</span>'; |
|
6391 | 6391 | } else { |
6392 | - print '<span class="badge badge-status8 badge-status">' . dol_escape_htmltag($tabName) . '</span>'; |
|
6392 | + print '<span class="badge badge-status8 badge-status">'.dol_escape_htmltag($tabName).'</span>'; |
|
6393 | 6393 | } |
6394 | 6394 | print '</td>'; |
6395 | 6395 |
@@ -205,8 +205,8 @@ discard block |
||
205 | 205 | /** |
206 | 206 | * @var int Thirdparty ID |
207 | 207 | */ |
208 | - public $socid; // both socid and fk_soc are used |
|
209 | - public $fk_soc; // both socid and fk_soc are used |
|
208 | + public $socid; // both socid and fk_soc are used |
|
209 | + public $fk_soc; // both socid and fk_soc are used |
|
210 | 210 | |
211 | 211 | /** |
212 | 212 | * @var string Thirdparty name |
@@ -911,12 +911,12 @@ discard block |
||
911 | 911 | // Update birthday alert |
912 | 912 | if (!empty($this->birthday_alert)) { |
913 | 913 | //check existing |
914 | - $sql_check = "SELECT rowid FROM " . MAIN_DB_PREFIX . "user_alert WHERE type = 1 AND fk_contact = " . ((int) $id) . " AND fk_user = " . ((int) $user->id); |
|
914 | + $sql_check = "SELECT rowid FROM ".MAIN_DB_PREFIX."user_alert WHERE type = 1 AND fk_contact = ".((int) $id)." AND fk_user = ".((int) $user->id); |
|
915 | 915 | $result_check = $this->db->query($sql_check); |
916 | 916 | if (!$result_check || ($this->db->num_rows($result_check) < 1)) { |
917 | 917 | //insert |
918 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "user_alert(type, fk_contact, fk_user) "; |
|
919 | - $sql .= "VALUES (1," . ((int) $id) . "," . ((int) $user->id) . ")"; |
|
918 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."user_alert(type, fk_contact, fk_user) "; |
|
919 | + $sql .= "VALUES (1,".((int) $id).",".((int) $user->id).")"; |
|
920 | 920 | $result = $this->db->query($sql); |
921 | 921 | if (!$result) { |
922 | 922 | $error++; |
@@ -926,8 +926,8 @@ discard block |
||
926 | 926 | $result = true; |
927 | 927 | } |
928 | 928 | } else { |
929 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_alert "; |
|
930 | - $sql .= "WHERE type=1 AND fk_contact=" . ((int) $id) . " AND fk_user=" . ((int) $user->id); |
|
929 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_alert "; |
|
930 | + $sql .= "WHERE type=1 AND fk_contact=".((int) $id)." AND fk_user=".((int) $user->id); |
|
931 | 931 | $result = $this->db->query($sql); |
932 | 932 | if (!$result) { |
933 | 933 | $error++; |
@@ -1024,36 +1024,36 @@ discard block |
||
1024 | 1024 | } elseif ($num) { // $num = 1 |
1025 | 1025 | $obj = $this->db->fetch_object($resql); |
1026 | 1026 | |
1027 | - $this->id = $obj->rowid; |
|
1028 | - $this->entity = $obj->entity; |
|
1029 | - $this->ref = $obj->rowid; |
|
1030 | - $this->ref_ext = $obj->ref_ext; |
|
1027 | + $this->id = $obj->rowid; |
|
1028 | + $this->entity = $obj->entity; |
|
1029 | + $this->ref = $obj->rowid; |
|
1030 | + $this->ref_ext = $obj->ref_ext; |
|
1031 | 1031 | |
1032 | 1032 | $this->civility_code = $obj->civility_code; |
1033 | 1033 | $this->civility = $obj->civility_code ? ($langs->trans("Civility".$obj->civility_code) != ("Civility".$obj->civility_code) ? $langs->trans("Civility".$obj->civility_code) : $obj->civility_code) : ''; |
1034 | 1034 | |
1035 | 1035 | $this->lastname = $obj->lastname; |
1036 | 1036 | $this->firstname = $obj->firstname; |
1037 | - $this->address = $obj->address; |
|
1038 | - $this->zip = $obj->zip; |
|
1039 | - $this->town = $obj->town; |
|
1037 | + $this->address = $obj->address; |
|
1038 | + $this->zip = $obj->zip; |
|
1039 | + $this->town = $obj->town; |
|
1040 | 1040 | |
1041 | 1041 | $this->date_creation = $this->db->jdate($obj->date_creation); |
1042 | 1042 | $this->date_modification = $this->db->jdate($obj->date_modification); |
1043 | 1043 | |
1044 | - $this->state_id = $obj->state_id; |
|
1044 | + $this->state_id = $obj->state_id; |
|
1045 | 1045 | $this->state_code = $obj->state_code; |
1046 | - $this->state = $obj->state; |
|
1046 | + $this->state = $obj->state; |
|
1047 | 1047 | |
1048 | 1048 | $this->country_id = $obj->country_id; |
1049 | - $this->country_code = $obj->country_id ? $obj->country_code : ''; |
|
1050 | - $this->country = $obj->country_id ? ($langs->trans('Country'.$obj->country_code) != 'Country'.$obj->country_code ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : ''; |
|
1049 | + $this->country_code = $obj->country_id ? $obj->country_code : ''; |
|
1050 | + $this->country = $obj->country_id ? ($langs->trans('Country'.$obj->country_code) != 'Country'.$obj->country_code ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : ''; |
|
1051 | 1051 | |
1052 | - $this->fk_soc = $obj->fk_soc; // Both fk_soc and socid are used |
|
1053 | - $this->socid = $obj->fk_soc; // Both fk_soc and socid are used |
|
1054 | - $this->socname = $obj->socname; |
|
1052 | + $this->fk_soc = $obj->fk_soc; // Both fk_soc and socid are used |
|
1053 | + $this->socid = $obj->fk_soc; // Both fk_soc and socid are used |
|
1054 | + $this->socname = $obj->socname; |
|
1055 | 1055 | $this->poste = $obj->poste; |
1056 | - $this->statut = $obj->statut; |
|
1056 | + $this->statut = $obj->statut; |
|
1057 | 1057 | |
1058 | 1058 | $this->fk_prospectlevel = $obj->fk_prospectlevel; |
1059 | 1059 | |
@@ -1063,25 +1063,25 @@ discard block |
||
1063 | 1063 | $this->statut_commercial = $libelle; // libelle statut commercial |
1064 | 1064 | $this->stcomm_picto = $obj->stcomm_picto; // Picto statut commercial |
1065 | 1065 | |
1066 | - $this->phone_pro = trim($obj->phone); |
|
1067 | - $this->fax = trim($obj->fax); |
|
1068 | - $this->phone_perso = trim($obj->phone_perso); |
|
1069 | - $this->phone_mobile = trim($obj->phone_mobile); |
|
1066 | + $this->phone_pro = trim($obj->phone); |
|
1067 | + $this->fax = trim($obj->fax); |
|
1068 | + $this->phone_perso = trim($obj->phone_perso); |
|
1069 | + $this->phone_mobile = trim($obj->phone_mobile); |
|
1070 | 1070 | |
1071 | 1071 | $this->email = $obj->email; |
1072 | - $this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array()); |
|
1072 | + $this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array()); |
|
1073 | 1073 | $this->photo = $obj->photo; |
1074 | 1074 | $this->priv = $obj->priv; |
1075 | 1075 | $this->mail = $obj->email; |
1076 | 1076 | |
1077 | - $this->birthday = $this->db->jdate($obj->birthday); |
|
1078 | - $this->note = $obj->note_private; // deprecated |
|
1077 | + $this->birthday = $this->db->jdate($obj->birthday); |
|
1078 | + $this->note = $obj->note_private; // deprecated |
|
1079 | 1079 | $this->note_private = $obj->note_private; |
1080 | - $this->note_public = $obj->note_public; |
|
1080 | + $this->note_public = $obj->note_public; |
|
1081 | 1081 | $this->default_lang = $obj->default_lang; |
1082 | - $this->user_id = $obj->user_id; |
|
1082 | + $this->user_id = $obj->user_id; |
|
1083 | 1083 | $this->user_login = $obj->user_login; |
1084 | - $this->canvas = $obj->canvas; |
|
1084 | + $this->canvas = $obj->canvas; |
|
1085 | 1085 | |
1086 | 1086 | $this->import_key = $obj->import_key; |
1087 | 1087 | |
@@ -1416,7 +1416,7 @@ discard block |
||
1416 | 1416 | $datas['photo'] = $photo; |
1417 | 1417 | } |
1418 | 1418 | |
1419 | - $datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Contact").'</u> ' . $this->getLibStatut(4); |
|
1419 | + $datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Contact").'</u> '.$this->getLibStatut(4); |
|
1420 | 1420 | $datas['name'] = '<br><b>'.$langs->trans("Name").':</b> '.$this->getFullName($langs); |
1421 | 1421 | // if ($this->civility_id) $datas['civility'] = '<br><b>' . $langs->trans("Civility") . ':</b> '.$this->civility_id; // TODO Translate civilty_id code |
1422 | 1422 | if (!empty($this->poste)) { |
@@ -1424,7 +1424,7 @@ discard block |
||
1424 | 1424 | } |
1425 | 1425 | $datas['email'] = '<br><b>'.$langs->trans("EMail").':</b> '.$this->email; |
1426 | 1426 | $phonelist = array(); |
1427 | - $country_code = empty($this->country_code) ? '': $this->country_code; |
|
1427 | + $country_code = empty($this->country_code) ? '' : $this->country_code; |
|
1428 | 1428 | if ($this->phone_pro) { |
1429 | 1429 | $phonelist[] = dol_print_phone($this->phone_pro, $country_code, $this->id, 0, '', ' ', 'phone'); |
1430 | 1430 | } |
@@ -1498,7 +1498,7 @@ discard block |
||
1498 | 1498 | $label = $langs->trans("ShowContact"); |
1499 | 1499 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
1500 | 1500 | } |
1501 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
1501 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
1502 | 1502 | $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
1503 | 1503 | } else { |
1504 | 1504 | $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
@@ -1868,7 +1868,7 @@ discard block |
||
1868 | 1868 | $error = 0; |
1869 | 1869 | |
1870 | 1870 | if (!isset($this->roles)) { |
1871 | - return 0; // Avoid to loose roles when property not set |
|
1871 | + return 0; // Avoid to loose roles when property not set |
|
1872 | 1872 | } |
1873 | 1873 | |
1874 | 1874 | $this->db->begin(); |
@@ -2173,7 +2173,7 @@ discard block |
||
2173 | 2173 | $return .= '<span class="info-box-icon bg-infobox-action">'; |
2174 | 2174 | //var_dump($this->photo);exit; |
2175 | 2175 | if (property_exists($this, 'photo') && !is_null($this->photo)) { |
2176 | - $return.= Form::showphoto('contact', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1); |
|
2176 | + $return .= Form::showphoto('contact', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1); |
|
2177 | 2177 | } else { |
2178 | 2178 | $return .= img_picto('', $this->picto); |
2179 | 2179 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | } else { |
79 | 79 | $db->commit(); |
80 | 80 | setEventMessage($langs->trans('SetupSaved')); |
81 | - header('Location: ' . $_SERVER["PHP_SELF"]); |
|
81 | + header('Location: '.$_SERVER["PHP_SELF"]); |
|
82 | 82 | exit(); |
83 | 83 | } |
84 | 84 | } elseif (preg_match('/del_(.*)/', $action, $reg)) { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } else { |
99 | 99 | $db->commit(); |
100 | 100 | setEventMessage($langs->trans('SetupSaved')); |
101 | - header('Location: ' . $_SERVER["PHP_SELF"]); |
|
101 | + header('Location: '.$_SERVER["PHP_SELF"]); |
|
102 | 102 | exit(); |
103 | 103 | } |
104 | 104 | } elseif ($action == 'save') { |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | |
205 | 205 | |
206 | 206 | $selectedvalue = getDolGlobalInt('AGENDA_DISABLE_EXT'); |
207 | -if ($selectedvalue==1) $selectedvalue=0; else $selectedvalue=1; |
|
207 | +if ($selectedvalue == 1) $selectedvalue = 0; else $selectedvalue = 1; |
|
208 | 208 | |
209 | 209 | print "<table class=\"noborder\" width=\"100%\">"; |
210 | 210 | |
@@ -256,35 +256,35 @@ discard block |
||
256 | 256 | $i = 1; |
257 | 257 | while ($i <= $MAXAGENDA) { |
258 | 258 | $key = $i; |
259 | - $name = 'AGENDA_EXT_NAME' . $key; |
|
260 | - $src = 'AGENDA_EXT_SRC' . $key; |
|
261 | - $offsettz = 'AGENDA_EXT_OFFSETTZ' . $key; |
|
262 | - $color = 'AGENDA_EXT_COLOR' . $key; |
|
263 | - $enabled = 'AGENDA_EXT_ENABLED' . $key; |
|
264 | - $default = 'AGENDA_EXT_ACTIVEBYDEFAULT' . $key; |
|
259 | + $name = 'AGENDA_EXT_NAME'.$key; |
|
260 | + $src = 'AGENDA_EXT_SRC'.$key; |
|
261 | + $offsettz = 'AGENDA_EXT_OFFSETTZ'.$key; |
|
262 | + $color = 'AGENDA_EXT_COLOR'.$key; |
|
263 | + $enabled = 'AGENDA_EXT_ENABLED'.$key; |
|
264 | + $default = 'AGENDA_EXT_ACTIVEBYDEFAULT'.$key; |
|
265 | 265 | |
266 | 266 | print '<tr class="oddeven">'; |
267 | 267 | // Nb |
268 | - print '<td width="180" class="nowrap">' . $langs->trans("AgendaExtNb", $key) . "</td>"; |
|
268 | + print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb", $key)."</td>"; |
|
269 | 269 | // Name |
270 | - print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME' . $key . '" value="' . (GETPOST('AGENDA_EXT_NAME' . $key) ? GETPOST('AGENDA_EXT_NAME' . $key, 'alpha') : getDolGlobalString($name)) . '" size="28"></td>'; |
|
270 | + print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'.(GETPOST('AGENDA_EXT_NAME'.$key) ? GETPOST('AGENDA_EXT_NAME'.$key, 'alpha') : getDolGlobalString($name)).'" size="28"></td>'; |
|
271 | 271 | // URL |
272 | - print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC' . $key . '" value="' . (GETPOST('AGENDA_EXT_SRC' . $key) ? GETPOST('AGENDA_EXT_SRC' . $key, 'alpha') : getDolGlobalString($src)) . '" size="60"></td>'; |
|
272 | + print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'.(GETPOST('AGENDA_EXT_SRC'.$key) ? GETPOST('AGENDA_EXT_SRC'.$key, 'alpha') : getDolGlobalString($src)).'" size="60"></td>'; |
|
273 | 273 | // Offset TZ |
274 | - print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ' . $key . '" value="' . (GETPOST('AGENDA_EXT_OFFSETTZ' . $key) ? GETPOST('AGENDA_EXT_OFFSETTZ' . $key) : getDolGlobalString($offsettz)) . '" size="2"></td>'; |
|
274 | + print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ'.$key.'" value="'.(GETPOST('AGENDA_EXT_OFFSETTZ'.$key) ? GETPOST('AGENDA_EXT_OFFSETTZ'.$key) : getDolGlobalString($offsettz)).'" size="2"></td>'; |
|
275 | 275 | // Color (Possible colors are limited by Google) |
276 | 276 | print '<td class="nowrap right">'; |
277 | - print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR" . $key) ? GETPOST("AGENDA_EXT_COLOR" . $key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR" . $key, 'extsitesconfig', 1, '', 'hideifnotset'); |
|
277 | + print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key) ? GETPOST("AGENDA_EXT_COLOR".$key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset'); |
|
278 | 278 | print '</td>'; |
279 | 279 | // Calendar active by default |
280 | 280 | print '<td class="nowrap right">'; |
281 | 281 | if (!empty($conf->use_javascript_ajax)) { |
282 | - print ajax_constantonoff('AGENDA_EXT_ACTIVEBYDEFAULT' . $key); |
|
282 | + print ajax_constantonoff('AGENDA_EXT_ACTIVEBYDEFAULT'.$key); |
|
283 | 283 | } else { |
284 | 284 | if (getDolGlobalString($default)) { |
285 | - print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_AGENDA_EXT_ACTIVEBYDEFAULT' . $key . '&token='.newToken().'">' . img_picto($langs->trans("Disabled"), 'off') . '</a>'; |
|
285 | + print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_EXT_ACTIVEBYDEFAULT'.$key.'&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; |
|
286 | 286 | } else { |
287 | - print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_AGENDA_EXT_ACTIVEBYDEFAULT' . $key . '&token='.newToken().'">' . img_picto($langs->trans("Enabled"), 'on') . '</a>'; |
|
287 | + print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_EXT_ACTIVEBYDEFAULT'.$key.'&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>'; |
|
288 | 288 | } |
289 | 289 | } |
290 | 290 | print '</td>'; |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | if (!$error) { |
205 | 205 | $db->commit(); |
206 | 206 | setEventMessage($langs->trans('SetupSaved')); |
207 | - header("Location: " . $_SERVER['PHP_SELF']); |
|
207 | + header("Location: ".$_SERVER['PHP_SELF']); |
|
208 | 208 | exit; |
209 | 209 | } else { |
210 | 210 | $db->rollback(); |
@@ -319,9 +319,9 @@ discard block |
||
319 | 319 | print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailMustExist").'</td>'; |
320 | 320 | print '<td class="left">'; |
321 | 321 | if (!getDolGlobalInt('TICKET_EMAIL_MUST_EXISTS')) { |
322 | - print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_TICKET_EMAIL_MUST_EXISTS&token='.newToken().'">' . img_picto($langs->trans('Disabled'), 'switch_off') . '</a>'; |
|
322 | + print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_TICKET_EMAIL_MUST_EXISTS&token='.newToken().'">'.img_picto($langs->trans('Disabled'), 'switch_off').'</a>'; |
|
323 | 323 | } else { |
324 | - print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_TICKET_EMAIL_MUST_EXISTS&token='.newToken().'">' . img_picto($langs->trans('Enabled'), 'switch_on') . '</a>'; |
|
324 | + print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_TICKET_EMAIL_MUST_EXISTS&token='.newToken().'">'.img_picto($langs->trans('Enabled'), 'switch_on').'</a>'; |
|
325 | 325 | } |
326 | 326 | print '</td>'; |
327 | 327 | print '<td class="center width75">'; |
@@ -401,9 +401,9 @@ discard block |
||
401 | 401 | print ajax_constantonoff('TICKET_SHOW_PROGRESSION'); |
402 | 402 | } else { |
403 | 403 | if (!getDolGlobalInt('TICKET_SHOW_PROGRESSION')) { |
404 | - print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_TICKET_SHOW_PROGRESSION&token='.newToken().'">' . img_picto($langs->trans('Disabled'), 'switch_off') . '</a>'; |
|
404 | + print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_TICKET_SHOW_PROGRESSION&token='.newToken().'">'.img_picto($langs->trans('Disabled'), 'switch_off').'</a>'; |
|
405 | 405 | } else { |
406 | - print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_TICKET_SHOW_PROGRESSION&token='.newToken().'">' . img_picto($langs->trans('Enabled'), 'switch_on') . '</a>'; |
|
406 | + print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_TICKET_SHOW_PROGRESSION&token='.newToken().'">'.img_picto($langs->trans('Enabled'), 'switch_on').'</a>'; |
|
407 | 407 | } |
408 | 408 | } |
409 | 409 | print '</td>'; |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | } |
290 | 290 | |
291 | 291 | print '<div class="div-table-responsive-no-min">'; |
292 | -print '<table class="noborder centpercent">';"\n"; |
|
292 | +print '<table class="noborder centpercent">'; "\n"; |
|
293 | 293 | print '<tr class="liste_titre">'."\n"; |
294 | 294 | print '<td>'.$langs->trans("Name").'</td>'; |
295 | 295 | print '<td class="minwidth100">'.$langs->trans("Description").'</td>'; |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | print load_fiche_titre($langs->trans("BankColorizeMovement"), '', ''); |
410 | 410 | |
411 | 411 | print '<div class="div-table-responsive-no-min">'; |
412 | -print '<table class="noborder centpercent">';"\n"; |
|
412 | +print '<table class="noborder centpercent">'; "\n"; |
|
413 | 413 | print '<tr class="liste_titre">'."\n"; |
414 | 414 | print '<td colspan="4">'.$langs->trans("Name").'</td>'; |
415 | 415 | print '<td align="center" width="75">'.$langs->trans("Value").'</td>'."\n"; |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | print load_fiche_titre($langs->trans("Other"), '', ''); |
465 | 465 | |
466 | 466 | print '<div class="div-table-responsive-no-min">'; |
467 | -print '<table class="noborder centpercent">';"\n"; |
|
467 | +print '<table class="noborder centpercent">'; "\n"; |
|
468 | 468 | print '<tr class="liste_titre">'."\n"; |
469 | 469 | print '<td>'.$langs->trans("Name").'</td>'; |
470 | 470 | print '<td>'.$langs->trans("Description").'</td>'; |
@@ -100,10 +100,10 @@ discard block |
||
100 | 100 | function dolGetRandomBytes($length) |
101 | 101 | { |
102 | 102 | if (function_exists('random_bytes')) { // Available with PHP 7 only. |
103 | - return bin2hex(random_bytes((int) floor($length / 2))); // the bin2hex will double the number of bytes so we take length / 2 |
|
103 | + return bin2hex(random_bytes((int) floor($length / 2))); // the bin2hex will double the number of bytes so we take length / 2 |
|
104 | 104 | } |
105 | 105 | |
106 | - return bin2hex(openssl_random_pseudo_bytes((int) floor($length / 2))); // the bin2hex will double the number of bytes so we take length / 2. May be very slow on Windows. |
|
106 | + return bin2hex(openssl_random_pseudo_bytes((int) floor($length / 2))); // the bin2hex will double the number of bytes so we take length / 2. May be very slow on Windows. |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | global $conf; |
283 | 283 | |
284 | 284 | if ($type == '0' && !empty($conf->global->MAIN_SECURITY_HASH_ALGO) && getDolGlobalString('MAIN_SECURITY_HASH_ALGO') == 'password_hash' && function_exists('password_verify')) { |
285 | - if (! empty($hash[0]) && $hash[0] == '$') { |
|
285 | + if (!empty($hash[0]) && $hash[0] == '$') { |
|
286 | 286 | return password_verify($chain, $hash); |
287 | 287 | } elseif (dol_strlen($hash) == 32) { |
288 | 288 | return dol_verifyHash($chain, $hash, '3'); // md5 |
@@ -312,31 +312,31 @@ discard block |
||
312 | 312 | $salt = substr(sha1(time()), 0, 8); |
313 | 313 | |
314 | 314 | if ($type === 'md5') { |
315 | - return '{MD5}' . base64_encode(hash("md5", $password, true)); //For OpenLdap with md5 (based on an unencrypted password in base) |
|
315 | + return '{MD5}'.base64_encode(hash("md5", $password, true)); //For OpenLdap with md5 (based on an unencrypted password in base) |
|
316 | 316 | } elseif ($type === 'md5frommd5') { |
317 | - return '{MD5}' . base64_encode(hex2bin($password)); // Create OpenLDAP MD5 password from Dolibarr MD5 password |
|
317 | + return '{MD5}'.base64_encode(hex2bin($password)); // Create OpenLDAP MD5 password from Dolibarr MD5 password |
|
318 | 318 | } elseif ($type === 'smd5') { |
319 | - return "{SMD5}" . base64_encode(hash("md5", $password . $salt, true) . $salt); |
|
319 | + return "{SMD5}".base64_encode(hash("md5", $password.$salt, true).$salt); |
|
320 | 320 | } elseif ($type === 'sha') { |
321 | - return '{SHA}' . base64_encode(hash("sha1", $password, true)); |
|
321 | + return '{SHA}'.base64_encode(hash("sha1", $password, true)); |
|
322 | 322 | } elseif ($type === 'ssha') { |
323 | - return "{SSHA}" . base64_encode(hash("sha1", $password . $salt, true) . $salt); |
|
323 | + return "{SSHA}".base64_encode(hash("sha1", $password.$salt, true).$salt); |
|
324 | 324 | } elseif ($type === 'sha256') { |
325 | - return "{SHA256}" . base64_encode(hash("sha256", $password, true)); |
|
325 | + return "{SHA256}".base64_encode(hash("sha256", $password, true)); |
|
326 | 326 | } elseif ($type === 'ssha256') { |
327 | - return "{SSHA256}" . base64_encode(hash("sha256", $password . $salt, true) . $salt); |
|
327 | + return "{SSHA256}".base64_encode(hash("sha256", $password.$salt, true).$salt); |
|
328 | 328 | } elseif ($type === 'sha384') { |
329 | - return "{SHA384}" . base64_encode(hash("sha384", $password, true)); |
|
329 | + return "{SHA384}".base64_encode(hash("sha384", $password, true)); |
|
330 | 330 | } elseif ($type === 'ssha384') { |
331 | - return "{SSHA384}" . base64_encode(hash("sha384", $password . $salt, true) . $salt); |
|
331 | + return "{SSHA384}".base64_encode(hash("sha384", $password.$salt, true).$salt); |
|
332 | 332 | } elseif ($type === 'sha512') { |
333 | - return "{SHA512}" . base64_encode(hash("sha512", $password, true)); |
|
333 | + return "{SHA512}".base64_encode(hash("sha512", $password, true)); |
|
334 | 334 | } elseif ($type === 'ssha512') { |
335 | - return "{SSHA512}" . base64_encode(hash("sha512", $password . $salt, true) . $salt); |
|
335 | + return "{SSHA512}".base64_encode(hash("sha512", $password.$salt, true).$salt); |
|
336 | 336 | } elseif ($type === 'crypt') { |
337 | - return '{CRYPT}' . crypt($password, $salt); |
|
337 | + return '{CRYPT}'.crypt($password, $salt); |
|
338 | 338 | } elseif ($type === 'clear') { |
339 | - return '{CLEAR}' . $password; // Just for test, plain text password is not secured ! |
|
339 | + return '{CLEAR}'.$password; // Just for test, plain text password is not secured ! |
|
340 | 340 | } |
341 | 341 | return ""; |
342 | 342 | } |
@@ -370,13 +370,13 @@ discard block |
||
370 | 370 | if (is_object($object)) { |
371 | 371 | $objectid = $object->id; |
372 | 372 | } else { |
373 | - $objectid = $object; // $objectid can be X or 'X,Y,Z' |
|
373 | + $objectid = $object; // $objectid can be X or 'X,Y,Z' |
|
374 | 374 | } |
375 | 375 | if ($objectid == "-1") { |
376 | 376 | $objectid = 0; |
377 | 377 | } |
378 | 378 | if ($objectid) { |
379 | - $objectid = preg_replace('/[^0-9\.\,]/', '', $objectid); // For the case value is coming from a non sanitized user input |
|
379 | + $objectid = preg_replace('/[^0-9\.\,]/', '', $objectid); // For the case value is coming from a non sanitized user input |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | //dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft"); |
@@ -853,9 +853,9 @@ discard block |
||
853 | 853 | if (is_object($object)) { |
854 | 854 | $objectid = $object->id; |
855 | 855 | } else { |
856 | - $objectid = $object; // $objectid can be X or 'X,Y,Z' |
|
856 | + $objectid = $object; // $objectid can be X or 'X,Y,Z' |
|
857 | 857 | } |
858 | - $objectid = preg_replace('/[^0-9\.\,]/', '', $objectid); // For the case value is coming from a non sanitized user input |
|
858 | + $objectid = preg_replace('/[^0-9\.\,]/', '', $objectid); // For the case value is coming from a non sanitized user input |
|
859 | 859 | |
860 | 860 | //dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft"); |
861 | 861 | //print "user_id=".$user->id.", features=".join(',', $featuresarray).", objectid=".$objectid; |
@@ -902,8 +902,8 @@ discard block |
||
902 | 902 | $checkparentsoc = array('agenda', 'contact', 'contrat'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...). |
903 | 903 | $checkproject = array('projet', 'project'); // Test for project object |
904 | 904 | $checktask = array('projet_task'); // Test for task object |
905 | - $checkhierarchy = array('expensereport', 'holiday'); // check permission among the hierarchy of user |
|
906 | - $checkuser = array('bookmark'); // check permission among the fk_user (must be myself or null) |
|
905 | + $checkhierarchy = array('expensereport', 'holiday'); // check permission among the hierarchy of user |
|
906 | + $checkuser = array('bookmark'); // check permission among the fk_user (must be myself or null) |
|
907 | 907 | $nocheck = array('barcode', 'stock'); // No test |
908 | 908 | |
909 | 909 | //$checkdefault = 'all other not already defined'; // Test on entity + link to third party on field $dbt_keyfield. Not allowed if link is empty (Ex: invoice, orders...). |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | |
917 | 917 | // To avoid an access forbidden with a numeric ref |
918 | 918 | if ($dbt_select != 'rowid' && $dbt_select != 'id') { |
919 | - $objectid = "'".$objectid."'"; // Note: $objectid was already cast into int at begin of this method. |
|
919 | + $objectid = "'".$objectid."'"; // Note: $objectid was already cast into int at begin of this method. |
|
920 | 920 | } |
921 | 921 | // Check permission for objectid on entity only |
922 | 922 | if (in_array($feature, $check) && $objectid > 0) { // For $objectid = 0, no check |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * Only common components are here. |
32 | 32 | */ |
33 | 33 | |
34 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; |
|
35 | 35 | |
36 | 36 | |
37 | 37 | /** |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | $effs = array(); |
57 | 57 | |
58 | 58 | $sql = "SELECT id, code, libelle as label"; |
59 | - $sql .= " FROM " . $this->db->prefix() . "c_typent"; |
|
60 | - $sql .= " WHERE active = 1 AND (fk_country IS NULL OR fk_country = " . (empty($mysoc->country_id) ? '0' : $mysoc->country_id) . ")"; |
|
59 | + $sql .= " FROM ".$this->db->prefix()."c_typent"; |
|
60 | + $sql .= " WHERE active = 1 AND (fk_country IS NULL OR fk_country = ".(empty($mysoc->country_id) ? '0' : $mysoc->country_id).")"; |
|
61 | 61 | if ($filter) { |
62 | - $sql .= " " . $filter; |
|
62 | + $sql .= " ".$filter; |
|
63 | 63 | } |
64 | 64 | $sql .= " ORDER by position, id"; |
65 | - dol_syslog(get_class($this) . '::typent_array', LOG_DEBUG); |
|
65 | + dol_syslog(get_class($this).'::typent_array', LOG_DEBUG); |
|
66 | 66 | $resql = $this->db->query($sql); |
67 | 67 | if ($resql) { |
68 | 68 | $num = $this->db->num_rows($resql); |
@@ -105,13 +105,13 @@ discard block |
||
105 | 105 | $effs = array(); |
106 | 106 | |
107 | 107 | $sql = "SELECT id, code, libelle as label"; |
108 | - $sql .= " FROM " . $this->db->prefix() . "c_effectif"; |
|
108 | + $sql .= " FROM ".$this->db->prefix()."c_effectif"; |
|
109 | 109 | $sql .= " WHERE active = 1"; |
110 | 110 | if ($filter) { |
111 | - $sql .= " " . $filter; |
|
111 | + $sql .= " ".$filter; |
|
112 | 112 | } |
113 | 113 | $sql .= " ORDER BY id ASC"; |
114 | - dol_syslog(get_class($this) . '::effectif_array', LOG_DEBUG); |
|
114 | + dol_syslog(get_class($this).'::effectif_array', LOG_DEBUG); |
|
115 | 115 | $resql = $this->db->query($sql); |
116 | 116 | if ($resql) { |
117 | 117 | $num = $this->db->num_rows($resql); |
@@ -149,13 +149,13 @@ discard block |
||
149 | 149 | // phpcs:enable |
150 | 150 | global $user, $langs; |
151 | 151 | |
152 | - print '<form method="post" action="' . $page . '">'; |
|
152 | + print '<form method="post" action="'.$page.'">'; |
|
153 | 153 | print '<input type="hidden" name="action" value="setprospectlevel">'; |
154 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
154 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
155 | 155 | |
156 | - dol_syslog(get_class($this) . '::form_prospect_level', LOG_DEBUG); |
|
156 | + dol_syslog(get_class($this).'::form_prospect_level', LOG_DEBUG); |
|
157 | 157 | $sql = "SELECT code, label"; |
158 | - $sql .= " FROM " . $this->db->prefix() . "c_prospectlevel"; |
|
158 | + $sql .= " FROM ".$this->db->prefix()."c_prospectlevel"; |
|
159 | 159 | $sql .= " WHERE active > 0"; |
160 | 160 | $sql .= " ORDER BY sortorder"; |
161 | 161 | $resql = $this->db->query($sql); |
@@ -181,9 +181,9 @@ discard block |
||
181 | 181 | dol_print_error($this->db); |
182 | 182 | } |
183 | 183 | if (!empty($htmlname) && $user->admin) { |
184 | - print ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
184 | + print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
185 | 185 | } |
186 | - print '<input type="submit" class="button button-save valignmiddle small" value="' . $langs->trans("Modify") . '">'; |
|
186 | + print '<input type="submit" class="button button-save valignmiddle small" value="'.$langs->trans("Modify").'">'; |
|
187 | 187 | print '</form>'; |
188 | 188 | } |
189 | 189 | |
@@ -200,13 +200,13 @@ discard block |
||
200 | 200 | { |
201 | 201 | global $user, $langs; |
202 | 202 | |
203 | - print '<form method="post" action="' . $page . '">'; |
|
203 | + print '<form method="post" action="'.$page.'">'; |
|
204 | 204 | print '<input type="hidden" name="action" value="setprospectcontactlevel">'; |
205 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
205 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
206 | 206 | |
207 | 207 | dol_syslog(__METHOD__, LOG_DEBUG); |
208 | 208 | $sql = "SELECT code, label"; |
209 | - $sql .= " FROM " . $this->db->prefix() . "c_prospectcontactlevel"; |
|
209 | + $sql .= " FROM ".$this->db->prefix()."c_prospectcontactlevel"; |
|
210 | 210 | $sql .= " WHERE active > 0"; |
211 | 211 | $sql .= " ORDER BY sortorder"; |
212 | 212 | $resql = $this->db->query($sql); |
@@ -232,9 +232,9 @@ discard block |
||
232 | 232 | dol_print_error($this->db); |
233 | 233 | } |
234 | 234 | if (!empty($htmlname) && $user->admin) { |
235 | - print ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
235 | + print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
236 | 236 | } |
237 | - print '<input type="submit" class="button button-save valignmiddle small" value="' . $langs->trans("Modify") . '">'; |
|
237 | + print '<input type="submit" class="button button-save valignmiddle small" value="'.$langs->trans("Modify").'">'; |
|
238 | 238 | print '</form>'; |
239 | 239 | } |
240 | 240 | |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | // phpcs:enable |
276 | 276 | global $conf, $langs, $user; |
277 | 277 | |
278 | - dol_syslog(get_class($this) . "::select_departement selected=" . $selected . ", country_codeid=" . $country_codeid, LOG_DEBUG); |
|
278 | + dol_syslog(get_class($this)."::select_departement selected=".$selected.", country_codeid=".$country_codeid, LOG_DEBUG); |
|
279 | 279 | |
280 | 280 | $langs->load("dict"); |
281 | 281 | |
@@ -283,28 +283,28 @@ discard block |
||
283 | 283 | |
284 | 284 | // Serch departements/cantons/province active d'une region et pays actif |
285 | 285 | $sql = "SELECT d.rowid, d.code_departement as code, d.nom as name, d.active, c.label as country, c.code as country_code, r.nom as region_name FROM"; |
286 | - $sql .= " " . $this->db->prefix() . "c_departements as d, " . $this->db->prefix() . "c_regions as r," . $this->db->prefix() . "c_country as c"; |
|
286 | + $sql .= " ".$this->db->prefix()."c_departements as d, ".$this->db->prefix()."c_regions as r,".$this->db->prefix()."c_country as c"; |
|
287 | 287 | $sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid"; |
288 | 288 | $sql .= " AND d.active = 1 AND r.active = 1 AND c.active = 1"; |
289 | 289 | if ($country_codeid && is_numeric($country_codeid)) { |
290 | - $sql .= " AND c.rowid = '" . $this->db->escape($country_codeid) . "'"; |
|
290 | + $sql .= " AND c.rowid = '".$this->db->escape($country_codeid)."'"; |
|
291 | 291 | } |
292 | 292 | if ($country_codeid && !is_numeric($country_codeid)) { |
293 | - $sql .= " AND c.code = '" . $this->db->escape($country_codeid) . "'"; |
|
293 | + $sql .= " AND c.code = '".$this->db->escape($country_codeid)."'"; |
|
294 | 294 | } |
295 | 295 | $sql .= " ORDER BY c.code, d.code_departement"; |
296 | 296 | |
297 | 297 | $result = $this->db->query($sql); |
298 | 298 | if ($result) { |
299 | 299 | if (!empty($htmlname)) { |
300 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
300 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
301 | 301 | } |
302 | 302 | if ($country_codeid) { |
303 | 303 | $out .= '<option value="0"> </option>'; |
304 | 304 | } |
305 | 305 | $num = $this->db->num_rows($result); |
306 | 306 | $i = 0; |
307 | - dol_syslog(get_class($this) . "::select_departement num=" . $num, LOG_DEBUG); |
|
307 | + dol_syslog(get_class($this)."::select_departement num=".$num, LOG_DEBUG); |
|
308 | 308 | if ($num) { |
309 | 309 | $country = ''; |
310 | 310 | while ($i < $num) { |
@@ -315,15 +315,15 @@ discard block |
||
315 | 315 | if (!$country || $country != $obj->country) { |
316 | 316 | // Show break if we are in list with multiple countries |
317 | 317 | if (!$country_codeid && $obj->country_code) { |
318 | - $out .= '<option value="-1" disabled data-html="----- ' . $obj->country . ' -----">----- ' . $obj->country . " -----</option>\n"; |
|
318 | + $out .= '<option value="-1" disabled data-html="----- '.$obj->country.' -----">----- '.$obj->country." -----</option>\n"; |
|
319 | 319 | $country = $obj->country; |
320 | 320 | } |
321 | 321 | } |
322 | 322 | |
323 | 323 | if (!empty($selected) && $selected == $obj->rowid) { |
324 | - $out .= '<option value="' . $obj->rowid . '" selected>'; |
|
324 | + $out .= '<option value="'.$obj->rowid.'" selected>'; |
|
325 | 325 | } else { |
326 | - $out .= '<option value="' . $obj->rowid . '">'; |
|
326 | + $out .= '<option value="'.$obj->rowid.'">'; |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut |
@@ -332,13 +332,13 @@ discard block |
||
332 | 332 | (getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 1 || getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 2 || $conf->global->MAIN_SHOW_STATE_CODE === 'all') |
333 | 333 | ) { |
334 | 334 | if (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1) { |
335 | - $out .= $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
335 | + $out .= $obj->region_name.' - '.$obj->code.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
336 | 336 | } else { |
337 | - $out .= $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
337 | + $out .= $obj->code.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
338 | 338 | } |
339 | 339 | } else { |
340 | 340 | if (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1) { |
341 | - $out .= $obj->region_name . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
341 | + $out .= $obj->region_name.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
|
342 | 342 | } else { |
343 | 343 | $out .= ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : '')); |
344 | 344 | } |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | $out .= '</select>'; |
354 | 354 | } |
355 | 355 | if (!empty($htmlname) && $user->admin) { |
356 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
356 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
357 | 357 | } |
358 | 358 | } else { |
359 | 359 | dol_print_error($this->db); |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | |
362 | 362 | // Make select dynamic |
363 | 363 | if (!empty($htmlname)) { |
364 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
364 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
365 | 365 | $out .= ajax_combobox($htmlname); |
366 | 366 | } |
367 | 367 | |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | public function select_state_ajax($parent_field_id = 'country_id', $selected = 0, $country_codeid = 0, $htmlname = 'state_id', $morecss = 'maxwidth200onsmartphone minwidth300') |
387 | 387 | { |
388 | 388 | $html = '<script>'; |
389 | - $html.='$("select[name=\"'.$parent_field_id.'\"]").change(function(){ |
|
389 | + $html .= '$("select[name=\"'.$parent_field_id.'\"]").change(function(){ |
|
390 | 390 | $.ajax( "'.dol_buildpath('/core/ajax/ziptown.php', 2).'", { data:{ selected: $("select[name=\"'.$htmlname.'\"]").val(), country_codeid: $(this).val(), htmlname:"'.$htmlname.'", morecss:"'.$morecss.'" } } ) |
391 | 391 | .done(function(msg) { |
392 | 392 | $("span#target_'.$htmlname.'").html(msg); |
@@ -413,14 +413,14 @@ discard block |
||
413 | 413 | $langs->load("dict"); |
414 | 414 | |
415 | 415 | $sql = "SELECT r.rowid, r.code_region as code, r.nom as label, r.active, c.code as country_code, c.label as country"; |
416 | - $sql .= " FROM " . $this->db->prefix() . "c_regions as r, " . $this->db->prefix() . "c_country as c"; |
|
416 | + $sql .= " FROM ".$this->db->prefix()."c_regions as r, ".$this->db->prefix()."c_country as c"; |
|
417 | 417 | $sql .= " WHERE r.fk_pays=c.rowid AND r.active = 1 and c.active = 1"; |
418 | 418 | $sql .= " ORDER BY c.code, c.label ASC"; |
419 | 419 | |
420 | - dol_syslog(get_class($this) . "::select_region", LOG_DEBUG); |
|
420 | + dol_syslog(get_class($this)."::select_region", LOG_DEBUG); |
|
421 | 421 | $resql = $this->db->query($sql); |
422 | 422 | if ($resql) { |
423 | - print '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
423 | + print '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
424 | 424 | $num = $this->db->num_rows($resql); |
425 | 425 | $i = 0; |
426 | 426 | if ($num) { |
@@ -432,16 +432,16 @@ discard block |
||
432 | 432 | } else { |
433 | 433 | if ($country == '' || $country != $obj->country) { |
434 | 434 | // Show break |
435 | - $key = $langs->trans("Country" . strtoupper($obj->country_code)); |
|
436 | - $valuetoshow = ($key != "Country" . strtoupper($obj->country_code)) ? $obj->country_code . " - " . $key : $obj->country; |
|
437 | - print '<option value="-2" disabled>----- ' . $valuetoshow . " -----</option>\n"; |
|
435 | + $key = $langs->trans("Country".strtoupper($obj->country_code)); |
|
436 | + $valuetoshow = ($key != "Country".strtoupper($obj->country_code)) ? $obj->country_code." - ".$key : $obj->country; |
|
437 | + print '<option value="-2" disabled>----- '.$valuetoshow." -----</option>\n"; |
|
438 | 438 | $country = $obj->country; |
439 | 439 | } |
440 | 440 | |
441 | 441 | if ($selected > 0 && $selected == $obj->code) { |
442 | - print '<option value="' . $obj->code . '" selected>' . $obj->label . '</option>'; |
|
442 | + print '<option value="'.$obj->code.'" selected>'.$obj->label.'</option>'; |
|
443 | 443 | } else { |
444 | - print '<option value="' . $obj->code . '">' . $obj->label . '</option>'; |
|
444 | + print '<option value="'.$obj->code.'">'.$obj->label.'</option>'; |
|
445 | 445 | } |
446 | 446 | } |
447 | 447 | $i++; |
@@ -472,13 +472,13 @@ discard block |
||
472 | 472 | |
473 | 473 | $out = ''; |
474 | 474 | |
475 | - $sql = "SELECT rowid, code, label, active FROM " . $this->db->prefix() . "c_civility"; |
|
475 | + $sql = "SELECT rowid, code, label, active FROM ".$this->db->prefix()."c_civility"; |
|
476 | 476 | $sql .= " WHERE active = 1"; |
477 | 477 | |
478 | 478 | dol_syslog("Form::select_civility", LOG_DEBUG); |
479 | 479 | $resql = $this->db->query($sql); |
480 | 480 | if ($resql) { |
481 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
481 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
482 | 482 | $out .= '<option value=""> </option>'; |
483 | 483 | $num = $this->db->num_rows($resql); |
484 | 484 | $i = 0; |
@@ -486,12 +486,12 @@ discard block |
||
486 | 486 | while ($i < $num) { |
487 | 487 | $obj = $this->db->fetch_object($resql); |
488 | 488 | if ($selected == $obj->code) { |
489 | - $out .= '<option value="' . $obj->code . '" selected>'; |
|
489 | + $out .= '<option value="'.$obj->code.'" selected>'; |
|
490 | 490 | } else { |
491 | - $out .= '<option value="' . $obj->code . '">'; |
|
491 | + $out .= '<option value="'.$obj->code.'">'; |
|
492 | 492 | } |
493 | 493 | // If translation exists, we use it, otherwise, we use tha had coded label |
494 | - $out .= ($langs->trans("Civility" . $obj->code) != "Civility" . $obj->code ? $langs->trans("Civility" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
494 | + $out .= ($langs->trans("Civility".$obj->code) != "Civility".$obj->code ? $langs->trans("Civility".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
495 | 495 | $out .= '</option>'; |
496 | 496 | $i++; |
497 | 497 | } |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | |
504 | 504 | if ($addjscombo) { |
505 | 505 | // Enhance with select2 |
506 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
506 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
507 | 507 | $out .= ajax_combobox($htmlname); |
508 | 508 | } |
509 | 509 | } else { |
@@ -553,22 +553,22 @@ discard block |
||
553 | 553 | |
554 | 554 | // On recherche les formes juridiques actives des pays actifs |
555 | 555 | $sql = "SELECT f.rowid, f.code as code , f.libelle as label, f.active, c.label as country, c.code as country_code"; |
556 | - $sql .= " FROM " . $this->db->prefix() . "c_forme_juridique as f, " . $this->db->prefix() . "c_country as c"; |
|
556 | + $sql .= " FROM ".$this->db->prefix()."c_forme_juridique as f, ".$this->db->prefix()."c_country as c"; |
|
557 | 557 | $sql .= " WHERE f.fk_pays=c.rowid"; |
558 | 558 | $sql .= " AND f.active = 1 AND c.active = 1"; |
559 | 559 | if ($country_codeid) { |
560 | - $sql .= " AND c.code = '" . $this->db->escape($country_codeid) . "'"; |
|
560 | + $sql .= " AND c.code = '".$this->db->escape($country_codeid)."'"; |
|
561 | 561 | } |
562 | 562 | if ($filter) { |
563 | - $sql .= " " . $filter; |
|
563 | + $sql .= " ".$filter; |
|
564 | 564 | } |
565 | 565 | $sql .= " ORDER BY c.code"; |
566 | 566 | |
567 | - dol_syslog(get_class($this) . "::select_juridicalstatus", LOG_DEBUG); |
|
567 | + dol_syslog(get_class($this)."::select_juridicalstatus", LOG_DEBUG); |
|
568 | 568 | $resql = $this->db->query($sql); |
569 | 569 | if ($resql) { |
570 | 570 | $out .= '<div id="particulier2" class="visible">'; |
571 | - $out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
571 | + $out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
572 | 572 | if ($country_codeid) { |
573 | 573 | $out .= '<option value="0"> </option>'; // When country_codeid is set, we force to add an empty line because it does not appears from select. When not set, we already get the empty line from select. |
574 | 574 | } |
@@ -582,9 +582,9 @@ discard block |
||
582 | 582 | $obj = $this->db->fetch_object($resql); |
583 | 583 | |
584 | 584 | if ($obj->code) { // We exclude empty line, we will add it later |
585 | - $labelcountry = (($langs->trans("Country" . $obj->country_code) != "Country" . $obj->country_code) ? $langs->trans("Country" . $obj->country_code) : $obj->country); |
|
586 | - $labeljs = (($langs->trans("JuridicalStatus" . $obj->code) != "JuridicalStatus" . $obj->code) ? $langs->trans("JuridicalStatus" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); // $obj->label is already in output charset (converted by database driver) |
|
587 | - $arraydata[$obj->code] = array('code' => $obj->code, 'label' => $labeljs, 'label_sort' => $labelcountry . '_' . $labeljs, 'country_code' => $obj->country_code, 'country' => $labelcountry); |
|
585 | + $labelcountry = (($langs->trans("Country".$obj->country_code) != "Country".$obj->country_code) ? $langs->trans("Country".$obj->country_code) : $obj->country); |
|
586 | + $labeljs = (($langs->trans("JuridicalStatus".$obj->code) != "JuridicalStatus".$obj->code) ? $langs->trans("JuridicalStatus".$obj->code) : ($obj->label != '-' ? $obj->label : '')); // $obj->label is already in output charset (converted by database driver) |
|
587 | + $arraydata[$obj->code] = array('code' => $obj->code, 'label' => $labeljs, 'label_sort' => $labelcountry.'_'.$labeljs, 'country_code' => $obj->country_code, 'country' => $labelcountry); |
|
588 | 588 | } |
589 | 589 | $i++; |
590 | 590 | } |
@@ -598,15 +598,15 @@ discard block |
||
598 | 598 | if (!$country || $country != $val['country']) { |
599 | 599 | // Show break when we are in multi country mode |
600 | 600 | if (empty($country_codeid) && $val['country_code']) { |
601 | - $out .= '<option value="0" disabled class="selectoptiondisabledwhite">----- ' . $val['country'] . " -----</option>\n"; |
|
601 | + $out .= '<option value="0" disabled class="selectoptiondisabledwhite">----- '.$val['country']." -----</option>\n"; |
|
602 | 602 | $country = $val['country']; |
603 | 603 | } |
604 | 604 | } |
605 | 605 | |
606 | 606 | if ($selected > 0 && $selected == $val['code']) { |
607 | - $out .= '<option value="' . $val['code'] . '" selected>'; |
|
607 | + $out .= '<option value="'.$val['code'].'" selected>'; |
|
608 | 608 | } else { |
609 | - $out .= '<option value="' . $val['code'] . '">'; |
|
609 | + $out .= '<option value="'.$val['code'].'">'; |
|
610 | 610 | } |
611 | 611 | // If translation exists, we use it, otherwise we use default label in database |
612 | 612 | $out .= $val['label']; |
@@ -615,11 +615,11 @@ discard block |
||
615 | 615 | } |
616 | 616 | $out .= '</select>'; |
617 | 617 | if ($user->admin) { |
618 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
618 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
619 | 619 | } |
620 | 620 | |
621 | 621 | // Make select dynamic |
622 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
622 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
623 | 623 | $out .= ajax_combobox($htmlname); |
624 | 624 | |
625 | 625 | $out .= '</div>'; |
@@ -673,13 +673,13 @@ discard block |
||
673 | 673 | $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); |
674 | 674 | |
675 | 675 | if (count($events)) { // If there is some ajax events to run once selection is done, we add code here to run events |
676 | - print '<script nonce="' . getNonce() . '" type="text/javascript"> |
|
676 | + print '<script nonce="'.getNonce().'" type="text/javascript"> |
|
677 | 677 | jQuery(document).ready(function() { |
678 | - $("#search_' . $htmlname . '").change(function() { |
|
679 | - var obj = ' . json_encode($events) . '; |
|
678 | + $("#search_' . $htmlname.'").change(function() { |
|
679 | + var obj = ' . json_encode($events).'; |
|
680 | 680 | $.each(obj, function(key,values) { |
681 | 681 | if (values.method.length) { |
682 | - runJsCodeForEvent' . $htmlname . '(values); |
|
682 | + runJsCodeForEvent' . $htmlname.'(values); |
|
683 | 683 | } |
684 | 684 | }); |
685 | 685 | |
@@ -687,13 +687,13 @@ discard block |
||
687 | 687 | }); |
688 | 688 | |
689 | 689 | // Function used to execute events when search_htmlname change |
690 | - function runJsCodeForEvent' . $htmlname . '(obj) { |
|
691 | - var id = $("#' . $htmlname . '").val(); |
|
690 | + function runJsCodeForEvent' . $htmlname.'(obj) { |
|
691 | + var id = $("#' . $htmlname.'").val(); |
|
692 | 692 | var method = obj.method; |
693 | 693 | var url = obj.url; |
694 | 694 | var htmlname = obj.htmlname; |
695 | 695 | var showempty = obj.showempty; |
696 | - console.log("Run runJsCodeForEvent-' . $htmlname . ' from selectCompaniesForNewContact id="+id+" method="+method+" showempty="+showempty+" url="+url+" htmlname="+htmlname); |
|
696 | + console.log("Run runJsCodeForEvent-' . $htmlname.' from selectCompaniesForNewContact id="+id+" method="+method+" showempty="+showempty+" url="+url+" htmlname="+htmlname); |
|
697 | 697 | $.getJSON(url, |
698 | 698 | { |
699 | 699 | action: method, |
@@ -723,9 +723,9 @@ discard block |
||
723 | 723 | </script>'; |
724 | 724 | } |
725 | 725 | |
726 | - print "\n" . '<!-- Input text for third party with Ajax.Autocompleter (selectCompaniesForNewContact) -->' . "\n"; |
|
727 | - print '<input type="text" size="30" id="search_' . $htmlname . '" name="search_' . $htmlname . '" value="' . $name . '" />'; |
|
728 | - print ajax_autocompleter(($socid ? $socid : -1), $htmlname, DOL_URL_ROOT . '/societe/ajax/ajaxcompanies.php', '', $minLength, 0); |
|
726 | + print "\n".'<!-- Input text for third party with Ajax.Autocompleter (selectCompaniesForNewContact) -->'."\n"; |
|
727 | + print '<input type="text" size="30" id="search_'.$htmlname.'" name="search_'.$htmlname.'" value="'.$name.'" />'; |
|
728 | + print ajax_autocompleter(($socid ? $socid : -1), $htmlname, DOL_URL_ROOT.'/societe/ajax/ajaxcompanies.php', '', $minLength, 0); |
|
729 | 729 | return $socid; |
730 | 730 | } else { |
731 | 731 | // Search to list thirdparties |
@@ -737,14 +737,14 @@ discard block |
||
737 | 737 | $sql .= ", s.address, s.zip, s.town"; |
738 | 738 | $sql .= ", dictp.code as country_code"; |
739 | 739 | } |
740 | - $sql .= " FROM " . $this->db->prefix() . "societe as s"; |
|
740 | + $sql .= " FROM ".$this->db->prefix()."societe as s"; |
|
741 | 741 | if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { |
742 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
742 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
743 | 743 | } |
744 | - $sql .= " WHERE s.entity IN (" . getEntity('societe') . ")"; |
|
744 | + $sql .= " WHERE s.entity IN (".getEntity('societe').")"; |
|
745 | 745 | // For ajax search we limit here. For combo list, we limit later |
746 | 746 | if (is_array($limitto) && count($limitto)) { |
747 | - $sql .= " AND s.rowid IN (" . $this->db->sanitize(join(',', $limitto)) . ")"; |
|
747 | + $sql .= " AND s.rowid IN (".$this->db->sanitize(join(',', $limitto)).")"; |
|
748 | 748 | } |
749 | 749 | // Add where from hooks |
750 | 750 | $parameters = array(); |
@@ -754,10 +754,10 @@ discard block |
||
754 | 754 | |
755 | 755 | $resql = $this->db->query($sql); |
756 | 756 | if ($resql) { |
757 | - print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"'; |
|
757 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'; |
|
758 | 758 | if ($conf->use_javascript_ajax) { |
759 | - $javaScript = "window.location='" . dol_escape_js($_SERVER['PHP_SELF']) . "?" . $var_id . "=" . ($forceid > 0 ? $forceid : $object->id) . $moreparam . "&" . $htmlname . "=' + form." . $htmlname . ".options[form." . $htmlname . ".selectedIndex].value;"; |
|
760 | - print ' onChange="' . $javaScript . '"'; |
|
759 | + $javaScript = "window.location='".dol_escape_js($_SERVER['PHP_SELF'])."?".$var_id."=".($forceid > 0 ? $forceid : $object->id).$moreparam."&".$htmlname."=' + form.".$htmlname.".options[form.".$htmlname.".selectedIndex].value;"; |
|
760 | + print ' onChange="'.$javaScript.'"'; |
|
761 | 761 | } |
762 | 762 | print '>'; |
763 | 763 | print '<option value="-1"> </option>'; |
@@ -775,18 +775,18 @@ discard block |
||
775 | 775 | $disabled = 1; |
776 | 776 | } |
777 | 777 | if ($selected > 0 && $selected == $obj->rowid) { |
778 | - print '<option value="' . $obj->rowid . '"'; |
|
778 | + print '<option value="'.$obj->rowid.'"'; |
|
779 | 779 | if ($disabled) { |
780 | 780 | print ' disabled'; |
781 | 781 | } |
782 | - print ' selected>' . dol_escape_htmltag($obj->name, 0, 0, '', 0, 1) . '</option>'; |
|
782 | + print ' selected>'.dol_escape_htmltag($obj->name, 0, 0, '', 0, 1).'</option>'; |
|
783 | 783 | $firstCompany = $obj->rowid; |
784 | 784 | } else { |
785 | - print '<option value="' . $obj->rowid . '"'; |
|
785 | + print '<option value="'.$obj->rowid.'"'; |
|
786 | 786 | if ($disabled) { |
787 | 787 | print ' disabled'; |
788 | 788 | } |
789 | - print '>' . dol_escape_htmltag($obj->name, 0, 0, '', 0, 1) . '</option>'; |
|
789 | + print '>'.dol_escape_htmltag($obj->name, 0, 0, '', 0, 1).'</option>'; |
|
790 | 790 | } |
791 | 791 | $i++; |
792 | 792 | } |
@@ -823,20 +823,20 @@ discard block |
||
823 | 823 | if (is_object($object) && method_exists($object, 'liste_type_contact')) { |
824 | 824 | $lesTypes = $object->liste_type_contact($source, $sortorder, 0, 1); |
825 | 825 | |
826 | - $out .= '<select class="flat valignmiddle' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
826 | + $out .= '<select class="flat valignmiddle'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
827 | 827 | if ($showempty) { |
828 | 828 | $out .= '<option value="0"> </option>'; |
829 | 829 | } |
830 | 830 | foreach ($lesTypes as $key => $value) { |
831 | - $out .= '<option value="' . $key . '"'; |
|
831 | + $out .= '<option value="'.$key.'"'; |
|
832 | 832 | if ($key == $selected) { |
833 | 833 | $out .= ' selected'; |
834 | 834 | } |
835 | - $out .= '>' . $value . '</option>'; |
|
835 | + $out .= '>'.$value.'</option>'; |
|
836 | 836 | } |
837 | 837 | $out .= "</select>"; |
838 | 838 | if ($user->admin && empty($forcehidetooltip)) { |
839 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
839 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
840 | 840 | } |
841 | 841 | |
842 | 842 | $out .= ajax_combobox($htmlname); |
@@ -865,9 +865,9 @@ discard block |
||
865 | 865 | if ($rendermode === 'view') { |
866 | 866 | $toprint = array(); |
867 | 867 | foreach ($contact->roles as $key => $val) { |
868 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb;">' . $val['label'] . '</li>'; |
|
868 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb;">'.$val['label'].'</li>'; |
|
869 | 869 | } |
870 | - return '<div class="select2-container-multi-dolibarr" style="width: 90%;" id="' . $htmlname . '"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
870 | + return '<div class="select2-container-multi-dolibarr" style="width: 90%;" id="'.$htmlname.'"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
871 | 871 | } |
872 | 872 | |
873 | 873 | if ($rendermode === 'edit') { |
@@ -913,14 +913,14 @@ discard block |
||
913 | 913 | |
914 | 914 | $size = ''; |
915 | 915 | if (!empty($fieldsize)) { |
916 | - $size = 'size="' . $fieldsize . '"'; |
|
916 | + $size = 'size="'.$fieldsize.'"'; |
|
917 | 917 | } |
918 | 918 | |
919 | 919 | if ($conf->use_javascript_ajax && empty($disableautocomplete)) { |
920 | - $out .= ajax_multiautocompleter($htmlname, $fields, DOL_URL_ROOT . '/core/ajax/ziptown.php') . "\n"; |
|
920 | + $out .= ajax_multiautocompleter($htmlname, $fields, DOL_URL_ROOT.'/core/ajax/ziptown.php')."\n"; |
|
921 | 921 | $moreattrib .= ' autocomplete="off"'; |
922 | 922 | } |
923 | - $out .= '<input id="' . $htmlname . '" class="maxwidthonsmartphone' . ($morecss ? ' ' . $morecss : '') . '" type="text"' . ($moreattrib ? ' ' . $moreattrib : '') . ' name="' . $htmlname . '" ' . $size . ' value="' . $selected . '">' . "\n"; |
|
923 | + $out .= '<input id="'.$htmlname.'" class="maxwidthonsmartphone'.($morecss ? ' '.$morecss : '').'" type="text"'.($moreattrib ? ' '.$moreattrib : '').' name="'.$htmlname.'" '.$size.' value="'.$selected.'">'."\n"; |
|
924 | 924 | |
925 | 925 | return $out; |
926 | 926 | } |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | $parameters = array('formlength' => $formlength, 'selected' => $preselected, 'idprof' => $idprof, 'htmlname' => $htmlname, 'country_code' => $country_code); |
997 | 997 | $reshook = $hookmanager->executeHooks('getInputIdProf', $parameters); |
998 | 998 | if (empty($reshook)) { |
999 | - $out .= '<input type="text" ' . ($morecss ? 'class="' . $morecss . '" ' : '') . 'name="' . $htmlname . '" id="' . $htmlname . '" maxlength="' . $maxlength . '" value="' . $selected . '">'; |
|
999 | + $out .= '<input type="text" '.($morecss ? 'class="'.$morecss.'" ' : '').'name="'.$htmlname.'" id="'.$htmlname.'" maxlength="'.$maxlength.'" value="'.$selected.'">'; |
|
1000 | 1000 | } |
1001 | 1001 | $out .= $hookmanager->resPrint; |
1002 | 1002 | |
@@ -1027,9 +1027,9 @@ discard block |
||
1027 | 1027 | $i = 0; |
1028 | 1028 | while ($i < $nbvalues) { |
1029 | 1029 | if ($selected == $valors[$i]) { |
1030 | - print '<option value="' . $valors[$i] . '" selected>'; |
|
1030 | + print '<option value="'.$valors[$i].'" selected>'; |
|
1031 | 1031 | } else { |
1032 | - print '<option value="' . $valors[$i] . '">'; |
|
1032 | + print '<option value="'.$valors[$i].'">'; |
|
1033 | 1033 | } |
1034 | 1034 | print $valors[$i]; |
1035 | 1035 | print '</option>'; |
@@ -1058,7 +1058,7 @@ discard block |
||
1058 | 1058 | return ''; |
1059 | 1059 | } |
1060 | 1060 | |
1061 | - $out = '<select class="flat ' . $morecss . '" name="' . $htmlname . '" id="' . $htmlidname . '">'; |
|
1061 | + $out = '<select class="flat '.$morecss.'" name="'.$htmlname.'" id="'.$htmlidname.'">'; |
|
1062 | 1062 | if ($typeinput == 'form') { |
1063 | 1063 | if ($allowempty || ($selected == '' || $selected == '-1')) { |
1064 | 1064 | $out .= '<option value="-1">'; |
@@ -1070,33 +1070,33 @@ discard block |
||
1070 | 1070 | $out .= '</option>'; |
1071 | 1071 | } |
1072 | 1072 | if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { |
1073 | - $out .= '<option value="2"' . ($selected == 2 ? ' selected' : '') . '>' . $langs->trans('Prospect') . '</option>'; |
|
1073 | + $out .= '<option value="2"'.($selected == 2 ? ' selected' : '').'>'.$langs->trans('Prospect').'</option>'; |
|
1074 | 1074 | } |
1075 | 1075 | if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { |
1076 | - $out .= '<option value="3"' . ($selected == 3 ? ' selected' : '') . '>' . $langs->trans('ProspectCustomer') . '</option>'; |
|
1076 | + $out .= '<option value="3"'.($selected == 3 ? ' selected' : '').'>'.$langs->trans('ProspectCustomer').'</option>'; |
|
1077 | 1077 | } |
1078 | 1078 | if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { |
1079 | - $out .= '<option value="1"' . ($selected == 1 ? ' selected' : '') . '>' . $langs->trans('Customer') . '</option>'; |
|
1079 | + $out .= '<option value="1"'.($selected == 1 ? ' selected' : '').'>'.$langs->trans('Customer').'</option>'; |
|
1080 | 1080 | } |
1081 | - $out .= '<option value="0"' . ((string) $selected == '0' ? ' selected' : '') . '>' . $langs->trans('NorProspectNorCustomer') . '</option>'; |
|
1081 | + $out .= '<option value="0"'.((string) $selected == '0' ? ' selected' : '').'>'.$langs->trans('NorProspectNorCustomer').'</option>'; |
|
1082 | 1082 | } elseif ($typeinput == 'list') { |
1083 | - $out .= '<option value="-1"' . (($selected == '' || $selected == '-1') ? ' selected' : '') . '> </option>'; |
|
1083 | + $out .= '<option value="-1"'.(($selected == '' || $selected == '-1') ? ' selected' : '').'> </option>'; |
|
1084 | 1084 | if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { |
1085 | - $out .= '<option value="2,3"' . ($selected == '2,3' ? ' selected' : '') . '>' . $langs->trans('Prospect') . '</option>'; |
|
1085 | + $out .= '<option value="2,3"'.($selected == '2,3' ? ' selected' : '').'>'.$langs->trans('Prospect').'</option>'; |
|
1086 | 1086 | } |
1087 | 1087 | if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { |
1088 | - $out .= '<option value="1,3"' . ($selected == '1,3' ? ' selected' : '') . '>' . $langs->trans('Customer') . '</option>'; |
|
1088 | + $out .= '<option value="1,3"'.($selected == '1,3' ? ' selected' : '').'>'.$langs->trans('Customer').'</option>'; |
|
1089 | 1089 | } |
1090 | 1090 | if (isModEnabled("fournisseur")) { |
1091 | - $out .= '<option value="4"' . ($selected == '4' ? ' selected' : '') . '>' . $langs->trans('Supplier') . '</option>'; |
|
1091 | + $out .= '<option value="4"'.($selected == '4' ? ' selected' : '').'>'.$langs->trans('Supplier').'</option>'; |
|
1092 | 1092 | } |
1093 | - $out .= '<option value="0"' . ($selected == '0' ? ' selected' : '') . '>' . $langs->trans('Other') . '</option>'; |
|
1093 | + $out .= '<option value="0"'.($selected == '0' ? ' selected' : '').'>'.$langs->trans('Other').'</option>'; |
|
1094 | 1094 | } elseif ($typeinput == 'admin') { |
1095 | 1095 | if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { |
1096 | - $out .= '<option value="3"' . ($selected == 3 ? ' selected' : '') . '>' . $langs->trans('ProspectCustomer') . '</option>'; |
|
1096 | + $out .= '<option value="3"'.($selected == 3 ? ' selected' : '').'>'.$langs->trans('ProspectCustomer').'</option>'; |
|
1097 | 1097 | } |
1098 | 1098 | if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) { |
1099 | - $out .= '<option value="1"' . ($selected == 1 ? ' selected' : '') . '>' . $langs->trans('Customer') . '</option>'; |
|
1099 | + $out .= '<option value="1"'.($selected == 1 ? ' selected' : '').'>'.$langs->trans('Customer').'</option>'; |
|
1100 | 1100 | } |
1101 | 1101 | } |
1102 | 1102 | $out .= '</select>'; |
@@ -1122,12 +1122,12 @@ discard block |
||
1122 | 1122 | |
1123 | 1123 | $out = ''; |
1124 | 1124 | if ($htmlname != "none") { |
1125 | - $out .= '<form method="post" action="' . $page . '">'; |
|
1125 | + $out .= '<form method="post" action="'.$page.'">'; |
|
1126 | 1126 | $out .= '<input type="hidden" name="action" value="set_thirdpartytype">'; |
1127 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
1127 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1128 | 1128 | $sortparam = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. |
1129 | 1129 | $out .= $this->selectarray($htmlname, $this->typent_array(0, $filter), $selected, 1, 0, 0, '', 0, 0, 0, $sortparam, '', 1); |
1130 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
1130 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
1131 | 1131 | $out .= '</form>'; |
1132 | 1132 | } else { |
1133 | 1133 | if ($selected > 0) { |
@@ -1166,7 +1166,7 @@ discard block |
||
1166 | 1166 | |
1167 | 1167 | //print $prospectstatic->LibProspCommStatut($statusprospect, 2, $prospectstatic->cacheprospectstatus[$statusprospect]['label'], $prospectstatic->cacheprospectstatus[$statusprospect]['picto']); |
1168 | 1168 | print img_action('', $actioncode, $actionpicto, 'class="inline-block valignmiddle paddingright pictoprospectstatus"'); |
1169 | - print '<select class="flat selectprospectstatus maxwidth150" id="'. $htmlname.$idprospect .'" data-socid="'.$idprospect.'" name="' . $htmlname .'">'; |
|
1169 | + print '<select class="flat selectprospectstatus maxwidth150" id="'.$htmlname.$idprospect.'" data-socid="'.$idprospect.'" name="'.$htmlname.'">'; |
|
1170 | 1170 | foreach ($prospectstatic->cacheprospectstatus as $key => $val) { |
1171 | 1171 | $titlealt = (empty($val['label']) ? 'default' : $val['label']); |
1172 | 1172 | $label = $val['label']; |
@@ -1192,8 +1192,8 @@ discard block |
||
1192 | 1192 | var image = $(this).prev(".pictoprospectstatus"); |
1193 | 1193 | $.ajax({ |
1194 | 1194 | type: "POST", |
1195 | - url: \'' . DOL_URL_ROOT . '/core/ajax/ajaxstatusprospect.php\', |
|
1196 | - data: { id: statusid, prospectid: prospectid, token: \''. newToken() .'\', action: \'updatestatusprospect\' }, |
|
1195 | + url: \'' . DOL_URL_ROOT.'/core/ajax/ajaxstatusprospect.php\', |
|
1196 | + data: { id: statusid, prospectid: prospectid, token: \''. newToken().'\', action: \'updatestatusprospect\' }, |
|
1197 | 1197 | success: function(response) { |
1198 | 1198 | console.log(response.img); |
1199 | 1199 | image.replaceWith(response.img); |
@@ -220,16 +220,16 @@ discard block |
||
220 | 220 | |
221 | 221 | $marginInfo = $this->getMarginInfosArray($object, $force_price); |
222 | 222 | |
223 | - $parameters=array('marginInfo' => &$marginInfo); |
|
223 | + $parameters = array('marginInfo' => &$marginInfo); |
|
224 | 224 | $reshook = $hookmanager->executeHooks('displayMarginInfos', $parameters, $object, $action); |
225 | 225 | if ($reshook < 0) { |
226 | 226 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
227 | 227 | } elseif (empty($reshook)) { |
228 | 228 | if (!empty($conf->global->MARGIN_ADD_SHOWHIDE_BUTTON)) { |
229 | - print $langs->trans('ShowMarginInfos') . ' '; |
|
229 | + print $langs->trans('ShowMarginInfos').' '; |
|
230 | 230 | $hidemargininfos = preg_replace('/[^a-zA-Z0-9_\-]/', '', $_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']); // Clean cookie |
231 | - print '<span id="showMarginInfos" class="linkobject valignmiddle ' . (!empty($hidemargininfos) ? '' : 'hideobject') . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</span>'; |
|
232 | - print '<span id="hideMarginInfos" class="linkobject valignmiddle ' . (!empty($hidemargininfos) ? 'hideobject' : '') . '">' . img_picto($langs->trans("Enabled"), 'switch_on') . '</span>'; |
|
231 | + print '<span id="showMarginInfos" class="linkobject valignmiddle '.(!empty($hidemargininfos) ? '' : 'hideobject').'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</span>'; |
|
232 | + print '<span id="hideMarginInfos" class="linkobject valignmiddle '.(!empty($hidemargininfos) ? 'hideobject' : '').'">'.img_picto($langs->trans("Enabled"), 'switch_on').'</span>'; |
|
233 | 233 | |
234 | 234 | print '<script nonce="'.getNonce().'">$(document).ready(function() {'; |
235 | 235 | print '$("span#showMarginInfos").click(function() { console.log("click on showMargininfos"); date = new Date(); date.setTime(date.getTime()+(30*86400000)); document.cookie = "DOLUSER_MARGININFO_HIDE_SHOW=0; expires=" + date.toGMTString() + "; path=/ "; $(".margintable").show(); $("span#showMarginInfos").addClass("hideobject"); $("span#hideMarginInfos").removeClass("hideobject"); });'; |
@@ -240,69 +240,69 @@ discard block |
||
240 | 240 | print '});</script>'; |
241 | 241 | } |
242 | 242 | |
243 | - print '<!-- displayMarginInfos() - Show margin table -->' . "\n"; |
|
243 | + print '<!-- displayMarginInfos() - Show margin table -->'."\n"; |
|
244 | 244 | print '<div class="div-table-responsive-no-min">'; |
245 | 245 | |
246 | 246 | print '<table class="noborder margintable centpercent" id="margintable">'; |
247 | 247 | print '<tr class="liste_titre">'; |
248 | - print '<td class="liste_titre">' . $langs->trans('Margins') . '</td>'; |
|
249 | - print '<td class="liste_titre right">' . $langs->trans('SellingPrice') . '</td>'; |
|
248 | + print '<td class="liste_titre">'.$langs->trans('Margins').'</td>'; |
|
249 | + print '<td class="liste_titre right">'.$langs->trans('SellingPrice').'</td>'; |
|
250 | 250 | if (getDolGlobalString('MARGIN_TYPE') == "1") { |
251 | - print '<td class="liste_titre right">' . $langs->trans('BuyingPrice') . '</td>'; |
|
251 | + print '<td class="liste_titre right">'.$langs->trans('BuyingPrice').'</td>'; |
|
252 | 252 | } else { |
253 | - print '<td class="liste_titre right">' . $langs->trans('CostPrice') . '</td>'; |
|
253 | + print '<td class="liste_titre right">'.$langs->trans('CostPrice').'</td>'; |
|
254 | 254 | } |
255 | - print '<td class="liste_titre right">' . $langs->trans('Margin') . '</td>'; |
|
255 | + print '<td class="liste_titre right">'.$langs->trans('Margin').'</td>'; |
|
256 | 256 | if (!empty($conf->global->DISPLAY_MARGIN_RATES)) { |
257 | - print '<td class="liste_titre right">' . $langs->trans('MarginRate') . '</td>'; |
|
257 | + print '<td class="liste_titre right">'.$langs->trans('MarginRate').'</td>'; |
|
258 | 258 | } |
259 | 259 | if (!empty($conf->global->DISPLAY_MARK_RATES)) { |
260 | - print '<td class="liste_titre right">' . $langs->trans('MarkRate') . '</td>'; |
|
260 | + print '<td class="liste_titre right">'.$langs->trans('MarkRate').'</td>'; |
|
261 | 261 | } |
262 | 262 | print '</tr>'; |
263 | 263 | |
264 | 264 | if (isModEnabled("product")) { |
265 | 265 | //if ($marginInfo['margin_on_products'] != 0 && $marginInfo['margin_on_services'] != 0) { |
266 | 266 | print '<tr class="oddeven">'; |
267 | - print '<td>' . $langs->trans('MarginOnProducts') . '</td>'; |
|
268 | - print '<td class="right">' . price($marginInfo['pv_products']) . '</td>'; |
|
269 | - print '<td class="right">' . price($marginInfo['pa_products']) . '</td>'; |
|
270 | - print '<td class="right">' . price($marginInfo['margin_on_products']) . '</td>'; |
|
267 | + print '<td>'.$langs->trans('MarginOnProducts').'</td>'; |
|
268 | + print '<td class="right">'.price($marginInfo['pv_products']).'</td>'; |
|
269 | + print '<td class="right">'.price($marginInfo['pa_products']).'</td>'; |
|
270 | + print '<td class="right">'.price($marginInfo['margin_on_products']).'</td>'; |
|
271 | 271 | if (!empty($conf->global->DISPLAY_MARGIN_RATES)) { |
272 | - print '<td class="right">' . (($marginInfo['margin_rate_products'] == '') ? '' : price($marginInfo['margin_rate_products'], null, null, null, null, 2) . '%') . '</td>'; |
|
272 | + print '<td class="right">'.(($marginInfo['margin_rate_products'] == '') ? '' : price($marginInfo['margin_rate_products'], null, null, null, null, 2).'%').'</td>'; |
|
273 | 273 | } |
274 | 274 | if (!empty($conf->global->DISPLAY_MARK_RATES)) { |
275 | - print '<td class="right">' . (($marginInfo['mark_rate_products'] == '') ? '' : price($marginInfo['mark_rate_products'], null, null, null, null, 2) . '%') . '</td>'; |
|
275 | + print '<td class="right">'.(($marginInfo['mark_rate_products'] == '') ? '' : price($marginInfo['mark_rate_products'], null, null, null, null, 2).'%').'</td>'; |
|
276 | 276 | } |
277 | 277 | print '</tr>'; |
278 | 278 | } |
279 | 279 | |
280 | 280 | if (isModEnabled("service")) { |
281 | 281 | print '<tr class="oddeven">'; |
282 | - print '<td>' . $langs->trans('MarginOnServices') . '</td>'; |
|
283 | - print '<td class="right">' . price($marginInfo['pv_services']) . '</td>'; |
|
284 | - print '<td class="right">' . price($marginInfo['pa_services']) . '</td>'; |
|
285 | - print '<td class="right">' . price($marginInfo['margin_on_services']) . '</td>'; |
|
282 | + print '<td>'.$langs->trans('MarginOnServices').'</td>'; |
|
283 | + print '<td class="right">'.price($marginInfo['pv_services']).'</td>'; |
|
284 | + print '<td class="right">'.price($marginInfo['pa_services']).'</td>'; |
|
285 | + print '<td class="right">'.price($marginInfo['margin_on_services']).'</td>'; |
|
286 | 286 | if (!empty($conf->global->DISPLAY_MARGIN_RATES)) { |
287 | - print '<td class="right">' . (($marginInfo['margin_rate_services'] == '') ? '' : price($marginInfo['margin_rate_services'], null, null, null, null, 2) . '%') . '</td>'; |
|
287 | + print '<td class="right">'.(($marginInfo['margin_rate_services'] == '') ? '' : price($marginInfo['margin_rate_services'], null, null, null, null, 2).'%').'</td>'; |
|
288 | 288 | } |
289 | 289 | if (!empty($conf->global->DISPLAY_MARK_RATES)) { |
290 | - print '<td class="right">' . (($marginInfo['mark_rate_services'] == '') ? '' : price($marginInfo['mark_rate_services'], null, null, null, null, 2) . '%') . '</td>'; |
|
290 | + print '<td class="right">'.(($marginInfo['mark_rate_services'] == '') ? '' : price($marginInfo['mark_rate_services'], null, null, null, null, 2).'%').'</td>'; |
|
291 | 291 | } |
292 | 292 | print '</tr>'; |
293 | 293 | } |
294 | 294 | |
295 | 295 | if (isModEnabled("product") && isModEnabled("service")) { |
296 | 296 | print '<tr class="liste_total">'; |
297 | - print '<td>' . $langs->trans('TotalMargin') . '</td>'; |
|
298 | - print '<td class="right">' . price($marginInfo['pv_total']) . '</td>'; |
|
299 | - print '<td class="right">' . price($marginInfo['pa_total']) . '</td>'; |
|
300 | - print '<td class="right">' . price($marginInfo['total_margin']) . '</td>'; |
|
297 | + print '<td>'.$langs->trans('TotalMargin').'</td>'; |
|
298 | + print '<td class="right">'.price($marginInfo['pv_total']).'</td>'; |
|
299 | + print '<td class="right">'.price($marginInfo['pa_total']).'</td>'; |
|
300 | + print '<td class="right">'.price($marginInfo['total_margin']).'</td>'; |
|
301 | 301 | if (!empty($conf->global->DISPLAY_MARGIN_RATES)) { |
302 | - print '<td class="right">' . (($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2) . '%') . '</td>'; |
|
302 | + print '<td class="right">'.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').'</td>'; |
|
303 | 303 | } |
304 | 304 | if (!empty($conf->global->DISPLAY_MARK_RATES)) { |
305 | - print '<td class="right">' . (($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2) . '%') . '</td>'; |
|
305 | + print '<td class="right">'.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').'</td>'; |
|
306 | 306 | } |
307 | 307 | print '</tr>'; |
308 | 308 | } |
@@ -143,20 +143,20 @@ discard block |
||
143 | 143 | $search_date_start_startmonth = GETPOST('search_date_start_startmonth', 'int'); |
144 | 144 | $search_date_start_startyear = GETPOST('search_date_start_startyear', 'int'); |
145 | 145 | $search_date_start_startday = GETPOST('search_date_start_startday', 'int'); |
146 | -$search_date_start_start = dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear); // Use tzserver |
|
146 | +$search_date_start_start = dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear); // Use tzserver |
|
147 | 147 | $search_date_start_endmonth = GETPOST('search_date_start_endmonth', 'int'); |
148 | 148 | $search_date_start_endyear = GETPOST('search_date_start_endyear', 'int'); |
149 | 149 | $search_date_start_endday = GETPOST('search_date_start_endday', 'int'); |
150 | -$search_date_start_end = dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear); // Use tzserver |
|
150 | +$search_date_start_end = dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear); // Use tzserver |
|
151 | 151 | |
152 | 152 | $search_date_end_startmonth = GETPOST('search_date_end_startmonth', 'int'); |
153 | 153 | $search_date_end_startyear = GETPOST('search_date_end_startyear', 'int'); |
154 | 154 | $search_date_end_startday = GETPOST('search_date_end_startday', 'int'); |
155 | -$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver |
|
155 | +$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver |
|
156 | 156 | $search_date_end_endmonth = GETPOST('search_date_end_endmonth', 'int'); |
157 | 157 | $search_date_end_endyear = GETPOST('search_date_end_endyear', 'int'); |
158 | 158 | $search_date_end_endday = GETPOST('search_date_end_endday', 'int'); |
159 | -$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); // Use tzserver |
|
159 | +$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); // Use tzserver |
|
160 | 160 | |
161 | 161 | if (isModEnabled('categorie')) { |
162 | 162 | $search_category_array = GETPOST("search_category_".Categorie::TYPE_PROJECT."_list", "array"); |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | $sqlfields = $sql; // $sql fields to remove for count total |
457 | 457 | |
458 | 458 | $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as p"; |
459 | -if (!empty($extrafields->attributes[$object->table_element]['label']) &&is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { |
|
459 | +if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { |
|
460 | 460 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (p.rowid = ef.fk_object)"; |
461 | 461 | } |
462 | 462 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | if ($searchCategoryProjectOperator == 0) { |
627 | 627 | $searchCategoryProjectSqlList[] = " EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project AND ck.fk_categorie = ".((int) $searchCategoryProject).")"; |
628 | 628 | } else { |
629 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProject); |
|
629 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProject); |
|
630 | 630 | } |
631 | 631 | } |
632 | 632 | } |
@@ -822,7 +822,7 @@ discard block |
||
822 | 822 | $param .= '&search_date_end_endday='.urlencode($search_date_end_endday); |
823 | 823 | } |
824 | 824 | if ($search_date_end_end) { |
825 | - $param .= '&search_date_end_end=' . urlencode($search_date_end_end); |
|
825 | + $param .= '&search_date_end_end='.urlencode($search_date_end_end); |
|
826 | 826 | } |
827 | 827 | if ($socid) { |
828 | 828 | $param .= '&socid='.urlencode($socid); |
@@ -1026,7 +1026,7 @@ discard block |
||
1026 | 1026 | $categoriesArr[-2] = '- '.$langs->trans('NotCategorized').' -'; |
1027 | 1027 | $moreforfilter .= Form::multiselectarray('search_category_customer_list', $categoriesArr, $searchCategoryCustomerList, 0, 0, 'minwidth300im minwidth300 widthcentpercentminusx', 0, 0, '', 'category', $tmptitle); |
1028 | 1028 | $moreforfilter .= ' <input type="checkbox" class="valignmiddle" id="search_category_customer_operator" name="search_category_customer_operator" value="1"'.($searchCategoryCustomerOperator == 1 ? ' checked="checked"' : '').'/>'; |
1029 | - $moreforfilter .= $form->textwithpicto('', $langs->trans('UseOrOperatorForCategories') . ' : ' . $tmptitle, 1, 'help', '', 0, 2, 'tooltip_cat_cus'); // Tooltip on click |
|
1029 | + $moreforfilter .= $form->textwithpicto('', $langs->trans('UseOrOperatorForCategories').' : '.$tmptitle, 1, 'help', '', 0, 2, 'tooltip_cat_cus'); // Tooltip on click |
|
1030 | 1030 | $moreforfilter .= '</div>'; |
1031 | 1031 | } |
1032 | 1032 | |
@@ -1537,7 +1537,7 @@ discard block |
||
1537 | 1537 | // Project url |
1538 | 1538 | if (!empty($arrayfields['p.ref']['checked'])) { |
1539 | 1539 | print '<td class="nowraponall tdoverflowmax200">'; |
1540 | - print $object->getNomUrl(1, (!empty(GETPOST('search_usage_event_organization', 'int'))?'eventorganization':'')); |
|
1540 | + print $object->getNomUrl(1, (!empty(GETPOST('search_usage_event_organization', 'int')) ? 'eventorganization' : '')); |
|
1541 | 1541 | if ($object->hasDelay()) { |
1542 | 1542 | print img_warning($langs->trans('Late')); |
1543 | 1543 | } |