@@ -189,10 +189,10 @@ discard block |
||
189 | 189 | $colortext = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXT) ? $colortext : $conf->global->THEME_ELDY_TEXT) : (empty($user->conf->THEME_ELDY_TEXT) ? $colortext : $user->conf->THEME_ELDY_TEXT); |
190 | 190 | $colortextlink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTLINK) ? $colortext : $conf->global->THEME_ELDY_TEXTLINK) : (empty($user->conf->THEME_ELDY_TEXTLINK) ? $colortextlink : $user->conf->THEME_ELDY_TEXTLINK); |
191 | 191 | $butactionbg = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_BTNACTION) ? $butactionbg : $conf->global->THEME_ELDY_BTNACTION) : (empty($user->conf->THEME_ELDY_BTNACTION) ? $butactionbg : $user->conf->THEME_ELDY_BTNACTION); |
192 | -$textbutaction = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $conf->global->THEME_ELDY_TEXTBTNACTION) : (empty($user->conf->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $user->conf->THEME_ELDY_TEXTBTNACTION); |
|
192 | +$textbutaction = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $conf->global->THEME_ELDY_TEXTBTNACTION) : (empty($user->conf->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $user->conf->THEME_ELDY_TEXTBTNACTION); |
|
193 | 193 | $fontsize = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_FONT_SIZE1) ? $fontsize : $conf->global->THEME_ELDY_FONT_SIZE1) : (empty($user->conf->THEME_ELDY_FONT_SIZE1) ? $fontsize : $user->conf->THEME_ELDY_FONT_SIZE1); |
194 | 194 | $fontsizesmaller = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_FONT_SIZE2) ? $fontsize : $conf->global->THEME_ELDY_FONT_SIZE2) : (empty($user->conf->THEME_ELDY_FONT_SIZE2) ? $fontsize : $user->conf->THEME_ELDY_FONT_SIZE2); |
195 | -$heightrow = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_USECOMOACTROW) ? '155%' : '300%') : (empty($conf->global->THEME_ELDY_USECOMOACTROW) ? '155%' : '300%'); |
|
195 | +$heightrow = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_USECOMOACTROW) ? '155%' : '300%') : (empty($conf->global->THEME_ELDY_USECOMOACTROW) ? '155%' : '300%'); |
|
196 | 196 | |
197 | 197 | // Hover color |
198 | 198 | $colorbacklinepairhover = ((!isset($conf->global->THEME_ELDY_USE_HOVER) || (string) $conf->global->THEME_ELDY_USE_HOVER === '255,255,255') ? '' : ($conf->global->THEME_ELDY_USE_HOVER === '1' ? 'edf4fb' : $conf->global->THEME_ELDY_USE_HOVER)); |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | if (!empty($conf->global->THEME_DARKMODEENABLED)) { |
370 | 370 | print "/* For dark mode */\n"; |
371 | 371 | if ($conf->global->THEME_DARKMODEENABLED != 2) { |
372 | - print "@media (prefers-color-scheme: dark) {"; // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes |
|
372 | + print "@media (prefers-color-scheme: dark) {"; // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes |
|
373 | 373 | } else { |
374 | 374 | print "@media not print {"; |
375 | 375 | } |
@@ -2988,7 +2988,7 @@ discard block |
||
2988 | 2988 | if (preg_match('/^fa\-/', $iconformodule)) { |
2989 | 2989 | // This is a fa icon |
2990 | 2990 | } else { |
2991 | - $url = dol_buildpath('/'.$val.'/img/'.$iconformodule.'.png', 1); |
|
2991 | + $url = dol_buildpath('/'.$val.'/img/'.$iconformodule.'.png', 1); |
|
2992 | 2992 | } |
2993 | 2993 | $found = 1; |
2994 | 2994 | } else { |
@@ -185,10 +185,10 @@ |
||
185 | 185 | $colortext = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXT) ? $colortext : $conf->global->THEME_ELDY_TEXT) : (empty($user->conf->THEME_ELDY_TEXT) ? $colortext : $user->conf->THEME_ELDY_TEXT); |
186 | 186 | $colortextlink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTLINK) ? $colortextlink : $conf->global->THEME_ELDY_TEXTLINK) : (empty($user->conf->THEME_ELDY_TEXTLINK) ? $colortextlink : $user->conf->THEME_ELDY_TEXTLINK); |
187 | 187 | $butactionbg = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_BTNACTION) ? $butactionbg : $conf->global->THEME_ELDY_BTNACTION) : (empty($user->conf->THEME_ELDY_BTNACTION) ? $butactionbg : $user->conf->THEME_ELDY_BTNACTION); |
188 | -$textbutaction = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $conf->global->THEME_ELDY_TEXTBTNACTION) : (empty($user->conf->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $user->conf->THEME_ELDY_TEXTBTNACTION); |
|
188 | +$textbutaction = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $conf->global->THEME_ELDY_TEXTBTNACTION) : (empty($user->conf->THEME_ELDY_TEXTBTNACTION) ? $textbutaction : $user->conf->THEME_ELDY_TEXTBTNACTION); |
|
189 | 189 | $fontsize = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_FONT_SIZE1) ? $fontsize : $conf->global->THEME_ELDY_FONT_SIZE1) : (empty($user->conf->THEME_ELDY_FONT_SIZE1) ? $fontsize : $user->conf->THEME_ELDY_FONT_SIZE1); |
190 | 190 | $fontsizesmaller = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_FONT_SIZE2) ? $fontsize : $conf->global->THEME_ELDY_FONT_SIZE2) : (empty($user->conf->THEME_ELDY_FONT_SIZE2) ? $fontsize : $user->conf->THEME_ELDY_FONT_SIZE2); |
191 | -$heightrow = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_USECOMOACTROW) ? '155%' : '300%') : (empty($conf->global->THEME_ELDY_USECOMOACTROW) ? '155%' : '300%'); |
|
191 | +$heightrow = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_USECOMOACTROW) ? '155%' : '300%') : (empty($conf->global->THEME_ELDY_USECOMOACTROW) ? '155%' : '300%'); |
|
192 | 192 | // Hover color |
193 | 193 | $colorbacklinepairhover = ((!isset($conf->global->THEME_ELDY_USE_HOVER) || (string) $conf->global->THEME_ELDY_USE_HOVER === '255,255,255') ? '' : ($conf->global->THEME_ELDY_USE_HOVER === '1' ? 'e6edf0' : $conf->global->THEME_ELDY_USE_HOVER)); |
194 | 194 | $colorbacklinepairchecked = ((!isset($conf->global->THEME_ELDY_USE_CHECKED) || (string) $conf->global->THEME_ELDY_USE_CHECKED === '255,255,255') ? '' : ($conf->global->THEME_ELDY_USE_CHECKED === '1' ? 'e6edf0' : $conf->global->THEME_ELDY_USE_CHECKED)); |
@@ -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) { |
@@ -1989,7 +1989,7 @@ discard block |
||
1989 | 1989 | } |
1990 | 1990 | |
1991 | 1991 | $action = ''; |
1992 | - if (! $error) { |
|
1992 | + if (!$error) { |
|
1993 | 1993 | $tabobj = 'newobject'; |
1994 | 1994 | } else { |
1995 | 1995 | $tabobj = 'deleteobject'; |
@@ -2050,11 +2050,11 @@ discard block |
||
2050 | 2050 | } |
2051 | 2051 | |
2052 | 2052 | if (!empty(GETPOST('dictionnarykey'))) { |
2053 | - $newdicname = $dicts['tabname'][GETPOST('dictionnarykey')-1]; |
|
2053 | + $newdicname = $dicts['tabname'][GETPOST('dictionnarykey') - 1]; |
|
2054 | 2054 | } |
2055 | 2055 | |
2056 | 2056 | //chercher la table dicname |
2057 | - $query = "SHOW TABLES LIKE '" . MAIN_DB_PREFIX.strtolower($newdicname) . "'"; |
|
2057 | + $query = "SHOW TABLES LIKE '".MAIN_DB_PREFIX.strtolower($newdicname)."'"; |
|
2058 | 2058 | $checkTable = $db->query($query); |
2059 | 2059 | if ($checkTable && $db->num_rows($checkTable) <= 0) { |
2060 | 2060 | $error++; |
@@ -2093,7 +2093,7 @@ discard block |
||
2093 | 2093 | setEventMessages($langs->trans("DictionaryDeleted", ucfirst(substr($newdicname, 2))), null); |
2094 | 2094 | } |
2095 | 2095 | if (function_exists('opcache_invalidate')) { |
2096 | - opcache_reset(); // remove the include cache hell ! |
|
2096 | + opcache_reset(); // remove the include cache hell ! |
|
2097 | 2097 | } |
2098 | 2098 | clearstatcache(true); |
2099 | 2099 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); |
@@ -2101,7 +2101,7 @@ discard block |
||
2101 | 2101 | } |
2102 | 2102 | } |
2103 | 2103 | if ($dirins && $action == 'updatedictionary' && GETPOST('dictionnarykey')) { |
2104 | - $keydict = GETPOST('dictionnarykey') - 1 ; |
|
2104 | + $keydict = GETPOST('dictionnarykey') - 1; |
|
2105 | 2105 | |
2106 | 2106 | $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; |
2107 | 2107 | $destdir = $dirins.'/'.strtolower($module); |
@@ -2135,7 +2135,7 @@ discard block |
||
2135 | 2135 | setEventMessages($langs->trans("DictionaryNameUpdated", ucfirst(GETPOST('tablib'))), null); |
2136 | 2136 | } |
2137 | 2137 | if (function_exists('opcache_invalidate')) { |
2138 | - opcache_reset(); // remove the include cache hell ! |
|
2138 | + opcache_reset(); // remove the include cache hell ! |
|
2139 | 2139 | } |
2140 | 2140 | clearstatcache(true); |
2141 | 2141 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); |
@@ -2255,13 +2255,13 @@ discard block |
||
2255 | 2255 | |
2256 | 2256 | //check existing object permission |
2257 | 2257 | $counter = 0; |
2258 | - $permsForObject =array(); |
|
2258 | + $permsForObject = array(); |
|
2259 | 2259 | $permissions = $moduleobj->rights; |
2260 | 2260 | $allObject = array(); |
2261 | 2261 | |
2262 | 2262 | $countPerms = count($permissions); |
2263 | 2263 | |
2264 | - for ($i =0; $i<$countPerms; $i++) { |
|
2264 | + for ($i = 0; $i < $countPerms; $i++) { |
|
2265 | 2265 | if ($permissions[$i][4] == $objectForPerms) { |
2266 | 2266 | $counter++; |
2267 | 2267 | if (count($permsForObject) < 3) { |
@@ -2273,7 +2273,7 @@ discard block |
||
2273 | 2273 | |
2274 | 2274 | // check if label of object already exists |
2275 | 2275 | $countPermsObj = count($permsForObject); |
2276 | - for ($j = 0; $j<$countPermsObj; $j++) { |
|
2276 | + for ($j = 0; $j < $countPermsObj; $j++) { |
|
2277 | 2277 | if (in_array($crud, $permsForObject[$j])) { |
2278 | 2278 | $error++; |
2279 | 2279 | setEventMessages($langs->trans("ErrorExistingPermission", $langs->transnoentities($crud), $langs->transnoentities($objectForPerms)), null, 'errors'); |
@@ -2310,7 +2310,7 @@ discard block |
||
2310 | 2310 | |
2311 | 2311 | clearstatcache(true); |
2312 | 2312 | if (function_exists('opcache_invalidate')) { |
2313 | - opcache_reset(); // remove the include cache hell ! |
|
2313 | + opcache_reset(); // remove the include cache hell ! |
|
2314 | 2314 | } |
2315 | 2315 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module); |
2316 | 2316 | exit; |
@@ -2319,7 +2319,7 @@ discard block |
||
2319 | 2319 | |
2320 | 2320 | |
2321 | 2321 | // Update permission |
2322 | -if ($dirins && GETPOST('action') == 'update_right' && GETPOST('modifyright')&& empty($cancel)) { |
|
2322 | +if ($dirins && GETPOST('action') == 'update_right' && GETPOST('modifyright') && empty($cancel)) { |
|
2323 | 2323 | $error = 0; |
2324 | 2324 | // load class and check if right exist |
2325 | 2325 | $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; |
@@ -2362,21 +2362,21 @@ discard block |
||
2362 | 2362 | } |
2363 | 2363 | |
2364 | 2364 | $permissions = $moduleobj->rights; |
2365 | - $key =(int) GETPOST('counter')-1; |
|
2365 | + $key = (int) GETPOST('counter') - 1; |
|
2366 | 2366 | //get permission want to delete from permissions array |
2367 | 2367 | $x1 = $permissions[$key][1]; |
2368 | 2368 | $x2 = $permissions[$key][4]; |
2369 | 2369 | $x3 = $permissions[$key][5]; |
2370 | 2370 | //check existing object permission |
2371 | 2371 | $counter = 0; |
2372 | - $permsForObject =array(); |
|
2372 | + $permsForObject = array(); |
|
2373 | 2373 | $permissions = $moduleobj->rights; |
2374 | 2374 | $firstRight = 0; |
2375 | 2375 | $existRight = 0; |
2376 | 2376 | $allObject = array(); |
2377 | 2377 | |
2378 | 2378 | $countPerms = count($permissions); |
2379 | - for ($i =0; $i<$countPerms; $i++) { |
|
2379 | + for ($i = 0; $i < $countPerms; $i++) { |
|
2380 | 2380 | if ($permissions[$i][4] == $objectForPerms) { |
2381 | 2381 | $counter++; |
2382 | 2382 | if (count($permsForObject) < 3) { |
@@ -2388,7 +2388,7 @@ discard block |
||
2388 | 2388 | |
2389 | 2389 | if ($label != $x1 && $crud != $x3) { |
2390 | 2390 | $countPermsObj = count($permsForObject); |
2391 | - for ($j = 0; $j<$countPermsObj; $j++) { |
|
2391 | + for ($j = 0; $j < $countPermsObj; $j++) { |
|
2392 | 2392 | if (in_array($label, $permsForObject[$j])) { |
2393 | 2393 | $error++; |
2394 | 2394 | setEventMessages($langs->trans("ErrorExistingPermission", $langs->transnoentities($label), $langs->transnoentities($objectForPerms)), null, 'errors'); |
@@ -2416,7 +2416,7 @@ discard block |
||
2416 | 2416 | setEventMessages($langs->trans('PermissionUpdatedSuccesfuly'), null); |
2417 | 2417 | clearstatcache(true); |
2418 | 2418 | if (function_exists('opcache_invalidate')) { |
2419 | - opcache_reset(); // remove the include cache hell ! |
|
2419 | + opcache_reset(); // remove the include cache hell ! |
|
2420 | 2420 | } |
2421 | 2421 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module); |
2422 | 2422 | exit; |
@@ -2440,7 +2440,7 @@ discard block |
||
2440 | 2440 | } |
2441 | 2441 | |
2442 | 2442 | $permissions = $moduleobj->rights; |
2443 | - $key = (int) GETPOST('permskey', 'int')-1; |
|
2443 | + $key = (int) GETPOST('permskey', 'int') - 1; |
|
2444 | 2444 | |
2445 | 2445 | if (!$error) { |
2446 | 2446 | // check if module is enabled |
@@ -2466,7 +2466,7 @@ discard block |
||
2466 | 2466 | |
2467 | 2467 | clearstatcache(true); |
2468 | 2468 | if (function_exists('opcache_invalidate')) { |
2469 | - opcache_reset(); // remove the include cache hell ! |
|
2469 | + opcache_reset(); // remove the include cache hell ! |
|
2470 | 2470 | } |
2471 | 2471 | |
2472 | 2472 | header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module); |
@@ -2635,7 +2635,7 @@ discard block |
||
2635 | 2635 | |
2636 | 2636 | clearstatcache(true); |
2637 | 2637 | if (function_exists('opcache_invalidate')) { |
2638 | - opcache_reset(); // remove the include cache hell ! |
|
2638 | + opcache_reset(); // remove the include cache hell ! |
|
2639 | 2639 | } |
2640 | 2640 | |
2641 | 2641 | setEventMessages($langs->trans('MenuDeletedSuccessfuly'), null); |
@@ -2691,7 +2691,7 @@ discard block |
||
2691 | 2691 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Url")), null, 'errors'); |
2692 | 2692 | } |
2693 | 2693 | if (!empty(GETPOST('target'))) { |
2694 | - $targets = array('_blank','_self','_parent','_top',''); |
|
2694 | + $targets = array('_blank', '_self', '_parent', '_top', ''); |
|
2695 | 2695 | if (!in_array(GETPOST('target'), $targets)) { |
2696 | 2696 | $error++; |
2697 | 2697 | setEventMessages($langs->trans("ErrorFieldValue", $langs->transnoentities("target")), null, 'errors'); |
@@ -2725,7 +2725,7 @@ discard block |
||
2725 | 2725 | $objects = dolGetListOfObjectClasses($destdir); |
2726 | 2726 | |
2727 | 2727 | if (GETPOST('type', 'alpha') == 'left') { |
2728 | - if (empty(GETPOST('leftmenu')) && count($objects) >0) { |
|
2728 | + if (empty(GETPOST('leftmenu')) && count($objects) > 0) { |
|
2729 | 2729 | $error++; |
2730 | 2730 | setEventMessages($langs->trans("ErrorCoherenceMenu", $langs->transnoentities("leftmenu"), $langs->transnoentities("type")), null, 'errors'); |
2731 | 2731 | } |
@@ -2788,7 +2788,7 @@ discard block |
||
2788 | 2788 | |
2789 | 2789 | // modify a menu |
2790 | 2790 | if ($dirins && $action == "modify_menu" && GETPOST('menukey', 'int') && GETPOST('tabobj')) { |
2791 | - $objectname = GETPOST('tabobj'); |
|
2791 | + $objectname = GETPOST('tabobj'); |
|
2792 | 2792 | $dirins = $listofmodules[strtolower($module)]['moduledescriptorrootpath']; |
2793 | 2793 | $destdir = $dirins.'/'.strtolower($module); |
2794 | 2794 | $objects = dolGetListOfObjectClasses($destdir); |
@@ -2873,7 +2873,7 @@ discard block |
||
2873 | 2873 | } |
2874 | 2874 | if ($result < 0) { |
2875 | 2875 | setEventMessages($langs->trans('ErrorMenuExistValue'), null, 'errors'); |
2876 | - header("Location: ".$_SERVER["PHP_SELF"].'?action=editmenu&token='.newToken().'&menukey='.urlencode($key+1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.($key+1)); |
|
2876 | + header("Location: ".$_SERVER["PHP_SELF"].'?action=editmenu&token='.newToken().'&menukey='.urlencode($key + 1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.($key + 1)); |
|
2877 | 2877 | exit; |
2878 | 2878 | } |
2879 | 2879 | setEventMessages($langs->trans('MenuUpdatedSuccessfuly'), null); |
@@ -3326,7 +3326,7 @@ discard block |
||
3326 | 3326 | $h++; |
3327 | 3327 | |
3328 | 3328 | $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : ''); |
3329 | - $head2[$h][1] = ($countDictionaries == 0 ? $langs->trans("Dictionaries") : $langs->trans('Dictionaries').'<span class="marginleftonlyshort badge">'.$countDictionaries."</span>"); |
|
3329 | + $head2[$h][1] = ($countDictionaries == 0 ? $langs->trans("Dictionaries") : $langs->trans('Dictionaries').'<span class="marginleftonlyshort badge">'.$countDictionaries."</span>"); |
|
3330 | 3330 | $head2[$h][2] = 'dictionaries'; |
3331 | 3331 | $h++; |
3332 | 3332 | |
@@ -3837,7 +3837,7 @@ discard block |
||
3837 | 3837 | |
3838 | 3838 | print '</form>'; |
3839 | 3839 | } elseif ($tabobj == 'createproperty') { |
3840 | - $attributesUnique = array ( |
|
3840 | + $attributesUnique = array( |
|
3841 | 3841 | 'propname' => $form->textwithpicto($langs->trans("Code"), $langs->trans("PropertyDesc"), 1, 'help', 'extracss', 0, 3, 'propertyhelp'), |
3842 | 3842 | 'proplabel' => $form->textwithpicto($langs->trans("Label"), $langs->trans("YouCanUseTranslationKey")), |
3843 | 3843 | 'proptype' => $form->textwithpicto($langs->trans("Type"), $langs->trans("TypeOfFieldsHelpIntro").'<br><br>'.$langs->trans("TypeOfFieldsHelp"), 1, 'help', 'extracss', 0, 3, 'typehelp'), |
@@ -3897,8 +3897,8 @@ discard block |
||
3897 | 3897 | } |
3898 | 3898 | print '</table><br>'."\n"; |
3899 | 3899 | print '<div class="center">'; |
3900 | - print '<input type="submit" class="button button-save" name="add" value="' . dol_escape_htmltag($langs->trans('Create')) . '">'; |
|
3901 | - print '<input type="button" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '" onclick="goBack()">'; |
|
3900 | + print '<input type="submit" class="button button-save" name="add" value="'.dol_escape_htmltag($langs->trans('Create')).'">'; |
|
3901 | + print '<input type="button" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans('Cancel')).'" onclick="goBack()">'; |
|
3902 | 3902 | print '</div>'; |
3903 | 3903 | print '</form>'; |
3904 | 3904 | // javascript |
@@ -3994,7 +3994,7 @@ discard block |
||
3994 | 3994 | // Print form confirm |
3995 | 3995 | print $formconfirm; |
3996 | 3996 | } |
3997 | - if ($action != 'editfile' || empty($file) ) { |
|
3997 | + if ($action != 'editfile' || empty($file)) { |
|
3998 | 3998 | try { |
3999 | 3999 | //$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; |
4000 | 4000 | |
@@ -4034,16 +4034,16 @@ discard block |
||
4034 | 4034 | // Define path for sql file |
4035 | 4035 | $pathtosql = strtolower($module).'/sql/llx_'.strtolower($module).'_'.strtolower($tabobj).'-'.strtolower($module).'.sql'; |
4036 | 4036 | $result = dol_buildpath($pathtosql); |
4037 | - if (! dol_is_file($result)) { |
|
4037 | + if (!dol_is_file($result)) { |
|
4038 | 4038 | $pathtosql = strtolower($module).'/sql/llx_'.strtolower($module).'_'.strtolower($tabobj).'.sql'; |
4039 | 4039 | $result = dol_buildpath($pathtosql); |
4040 | - if (! dol_is_file($result)) { |
|
4040 | + if (!dol_is_file($result)) { |
|
4041 | 4041 | $pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($tabobj).'-'.strtolower($module).'.sql'; |
4042 | 4042 | $result = dol_buildpath($pathtosql); |
4043 | - if (! dol_is_file($result)) { |
|
4043 | + if (!dol_is_file($result)) { |
|
4044 | 4044 | $pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'-'.strtolower($module).'.sql'; |
4045 | 4045 | $result = dol_buildpath($pathtosql); |
4046 | - if (! dol_is_file($result)) { |
|
4046 | + if (!dol_is_file($result)) { |
|
4047 | 4047 | $pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'.sql'; |
4048 | 4048 | $pathtosqlextra = 'install/mysql/tables/llx_'.strtolower($module).'_extrafields.sql'; |
4049 | 4049 | $result = dol_buildpath($pathtosql); |
@@ -4062,7 +4062,7 @@ discard block |
||
4062 | 4062 | $pathtosqlroot = preg_replace('/\/llx_.*$/', '', $pathtosql); |
4063 | 4063 | |
4064 | 4064 | $pathtosqlkey = preg_replace('/\.sql$/', '.key.sql', $pathtosql); |
4065 | - $pathtosqlextrakey = preg_replace('/\.sql$/', '.key.sql', $pathtosqlextra); |
|
4065 | + $pathtosqlextrakey = preg_replace('/\.sql$/', '.key.sql', $pathtosqlextra); |
|
4066 | 4066 | |
4067 | 4067 | $pathtolib = strtolower($module).'/lib/'.strtolower($module).'.lib.php'; |
4068 | 4068 | $pathtoobjlib = strtolower($module).'/lib/'.strtolower($module).'_'.strtolower($tabobj).'.lib.php'; |
@@ -4121,7 +4121,7 @@ discard block |
||
4121 | 4121 | |
4122 | 4122 | // API file |
4123 | 4123 | print '<br>'; |
4124 | - 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>'; |
|
4124 | + 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>'; |
|
4125 | 4125 | if (dol_is_file($realpathtoapi)) { |
4126 | 4126 | $file = file_get_contents($realpathtoapi); |
4127 | 4127 | if (preg_match('/var '.$tabobj.'\s+([^\s]*)\s/ims', $file, $objs)) { |
@@ -4143,7 +4143,7 @@ discard block |
||
4143 | 4143 | } |
4144 | 4144 | // PHPUnit |
4145 | 4145 | print '<br>'; |
4146 | - 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>'; |
|
4146 | + 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>'; |
|
4147 | 4147 | if (dol_is_file($realpathtophpunit)) { |
4148 | 4148 | 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>'; |
4149 | 4149 | print ' '; |
@@ -4332,26 +4332,26 @@ discard block |
||
4332 | 4332 | $propname = $propkey; |
4333 | 4333 | $proplabel = $propval['label']; |
4334 | 4334 | $proptype = $propval['type']; |
4335 | - $proparrayofkeyval = !empty($propval['arrayofkeyval'])?$propval['arrayofkeyval']:''; |
|
4335 | + $proparrayofkeyval = !empty($propval['arrayofkeyval']) ? $propval['arrayofkeyval'] : ''; |
|
4336 | 4336 | $propnotnull = !empty($propval['notnull']) ? $propval['notnull'] : '0'; |
4337 | - $propdefault = !empty($propval['default'])?$propval['default']:''; |
|
4338 | - $propindex = !empty($propval['index'])?$propval['index']:''; |
|
4339 | - $propforeignkey = !empty($propval['foreignkey'])?$propval['foreignkey']:''; |
|
4337 | + $propdefault = !empty($propval['default']) ? $propval['default'] : ''; |
|
4338 | + $propindex = !empty($propval['index']) ? $propval['index'] : ''; |
|
4339 | + $propforeignkey = !empty($propval['foreignkey']) ? $propval['foreignkey'] : ''; |
|
4340 | 4340 | $propposition = $propval['position']; |
4341 | 4341 | $propenabled = $propval['enabled']; |
4342 | 4342 | $propvisible = $propval['visible']; |
4343 | - $propnoteditable = !empty($propval['noteditable'])?$propval['noteditable']:0; |
|
4344 | - $propalwayseditable = !empty($propval['alwayseditable'])?$propval['alwayseditable']:0; |
|
4345 | - $propsearchall = !empty($propval['searchall'])?$propval['searchall']:0; |
|
4346 | - $propisameasure = !empty($propval['isameasure'])?$propval['isameasure']:0; |
|
4347 | - $propcss = !empty($propval['css'])?$propval['css']:''; |
|
4348 | - $propcssview = !empty($propval['cssview'])?$propval['cssview']:''; |
|
4349 | - $propcsslist = !empty($propval['csslist'])?$propval['csslist']:''; |
|
4350 | - $prophelp = !empty($propval['help'])?$propval['help']:''; |
|
4351 | - $propshowoncombobox = !empty($propval['showoncombobox'])?$propval['showoncombobox']:0; |
|
4343 | + $propnoteditable = !empty($propval['noteditable']) ? $propval['noteditable'] : 0; |
|
4344 | + $propalwayseditable = !empty($propval['alwayseditable']) ? $propval['alwayseditable'] : 0; |
|
4345 | + $propsearchall = !empty($propval['searchall']) ? $propval['searchall'] : 0; |
|
4346 | + $propisameasure = !empty($propval['isameasure']) ? $propval['isameasure'] : 0; |
|
4347 | + $propcss = !empty($propval['css']) ? $propval['css'] : ''; |
|
4348 | + $propcssview = !empty($propval['cssview']) ? $propval['cssview'] : ''; |
|
4349 | + $propcsslist = !empty($propval['csslist']) ? $propval['csslist'] : ''; |
|
4350 | + $prophelp = !empty($propval['help']) ? $propval['help'] : ''; |
|
4351 | + $propshowoncombobox = !empty($propval['showoncombobox']) ? $propval['showoncombobox'] : 0; |
|
4352 | 4352 | //$propdisabled=$propval['disabled']; |
4353 | - $propvalidate = !empty($propval['validate'])?$propval['validate']:0; |
|
4354 | - $propcomment = !empty($propval['comment'])?$propval['comment']:''; |
|
4353 | + $propvalidate = !empty($propval['validate']) ? $propval['validate'] : 0; |
|
4354 | + $propcomment = !empty($propval['comment']) ? $propval['comment'] : ''; |
|
4355 | 4355 | |
4356 | 4356 | print '<tr class="oddeven">'; |
4357 | 4357 | |
@@ -4742,14 +4742,14 @@ discard block |
||
4742 | 4742 | $i = 0; |
4743 | 4743 | $maxi = count($dicts['tabname']); |
4744 | 4744 | while ($i < $maxi) { |
4745 | - if ($action == 'editdict' && $i == (int) GETPOST('dictionnarykey', 'int')-1) { |
|
4745 | + if ($action == 'editdict' && $i == (int) GETPOST('dictionnarykey', 'int') - 1) { |
|
4746 | 4746 | print '<tr class="oddeven">'; |
4747 | 4747 | print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
4748 | 4748 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
4749 | 4749 | print '<input type="hidden" name="tab" value="dictionaries">'; |
4750 | 4750 | print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module).'">'; |
4751 | 4751 | print '<input type="hidden" name="action" value="updatedictionary">'; |
4752 | - print '<input type="hidden" name="dictionnarykey" value="'.($i+1).'">'; |
|
4752 | + print '<input type="hidden" name="dictionnarykey" value="'.($i + 1).'">'; |
|
4753 | 4753 | |
4754 | 4754 | print '<td class="tdsticky tdstickygray">'; |
4755 | 4755 | print ($i + 1); |
@@ -4845,8 +4845,8 @@ discard block |
||
4845 | 4845 | print '</td>'; |
4846 | 4846 | |
4847 | 4847 | print '<td class="center minwidth75 tdstickyright tdstickyghostwhite">'; |
4848 | - 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>'; |
|
4849 | - 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>'; |
|
4848 | + 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>'; |
|
4849 | + 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>'; |
|
4850 | 4850 | print '</td>'; |
4851 | 4851 | |
4852 | 4852 | print '</tr>'; |
@@ -5053,7 +5053,7 @@ discard block |
||
5053 | 5053 | print_liste_field_titre("", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center ', $langs->trans('')); |
5054 | 5054 | |
5055 | 5055 | print "</tr>\n"; |
5056 | - $r = count($menus)+1; |
|
5056 | + $r = count($menus) + 1; |
|
5057 | 5057 | // for adding menu on module |
5058 | 5058 | print '<tr>'; |
5059 | 5059 | print '<td class="center"><input type="hidden" readonly class="center maxwidth50" name="propenabled" value="#"></td>'; |
@@ -5077,7 +5077,7 @@ discard block |
||
5077 | 5077 | print '<td class="left"><input id="url" type="text" class="left maxwidth50" name="url" value="'.dol_escape_htmltag(GETPOST('url', 'alpha')).'"></td>'; |
5078 | 5078 | print '<td class="left"><input type="text" class="left maxwidth75" name="langs" value="'.strtolower($module).'@'.strtolower($module).'" readonly></td>'; |
5079 | 5079 | // Position |
5080 | - print '<td class="center"><input type="text" class="center maxwidth50 tdstickygray" name="position" value="'.(1000+$r).'" readonly></td>'; |
|
5080 | + print '<td class="center"><input type="text" class="center maxwidth50 tdstickygray" name="position" value="'.(1000 + $r).'" readonly></td>'; |
|
5081 | 5081 | // Enabled |
5082 | 5082 | print '<td class="center">'; |
5083 | 5083 | print '<input type="enabled" class="maxwidth125" value="'.dol_escape_htmltag(GETPOSTISSET('enabled') ? GETPOST('enabled') : 'isModEnabled(\''.$module.'\')').'">'; |
@@ -5130,7 +5130,7 @@ discard block |
||
5130 | 5130 | $propMainmenu = !empty($menu['mainmenu']) ? $menu['mainmenu'] : GETPOST('mainmenu'); |
5131 | 5131 | $propLeftmenu = !empty($menu['leftmenu']) ? $menu['leftmenu'] : GETPOST('leftmenu'); |
5132 | 5132 | $propUrl = !empty($menu['url']) ? $menu['url'] : GETPOST('url', 'alpha'); |
5133 | - $propPerms = !empty($menu['perms']) ? $menu['perms'] : GETPOST('perms'); |
|
5133 | + $propPerms = !empty($menu['perms']) ? $menu['perms'] : GETPOST('perms'); |
|
5134 | 5134 | $propUser = !empty($menu['user']) ? $menu['user'] : GETPOST('user'); |
5135 | 5135 | $propTarget = !empty($menu['target']) ? $menu['target'] : GETPOST('target'); |
5136 | 5136 | $propEnabled = !empty($menu['enabled']) ? $menu['enabled'] : GETPOST('enabled'); |
@@ -5290,7 +5290,7 @@ discard block |
||
5290 | 5290 | if (strpos($menu['perms'], "\$user->hasRight") !== 0) { |
5291 | 5291 | print ''; |
5292 | 5292 | } else { |
5293 | - print (dol_escape_htmltag($langs->trans($crud[$valPerms])) ); |
|
5293 | + print (dol_escape_htmltag($langs->trans($crud[$valPerms]))); |
|
5294 | 5294 | } |
5295 | 5295 | print '</td>'; |
5296 | 5296 | |
@@ -5312,7 +5312,7 @@ discard block |
||
5312 | 5312 | print '<td class="center minwidth75 tdstickyright tdstickyghostwhite">'; |
5313 | 5313 | if ($menu['titre'] != 'Module'.$module.'Name') { |
5314 | 5314 | 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>'; |
5315 | - 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>'; |
|
5315 | + 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>'; |
|
5316 | 5316 | } |
5317 | 5317 | print '</td>'; |
5318 | 5318 | } |
@@ -5338,7 +5338,7 @@ discard block |
||
5338 | 5338 | } |
5339 | 5339 | }); |
5340 | 5340 | |
5341 | - var groupedRights = ' . $groupedRights_json . '; |
|
5341 | + var groupedRights = ' . $groupedRights_json.'; |
|
5342 | 5342 | var objectsSelect = $("select[id=\'objects\']"); |
5343 | 5343 | var permsSelect = $("select[id=\'perms\']"); |
5344 | 5344 | |
@@ -5409,7 +5409,7 @@ discard block |
||
5409 | 5409 | $dir = $dirread.'/'.$modulelowercase.'/class'; |
5410 | 5410 | $listofobject = dol_dir_list($dir, 'files', 0, '\.class\.php$'); |
5411 | 5411 | $objects = array('myobject'); |
5412 | - $reg =array(); |
|
5412 | + $reg = array(); |
|
5413 | 5413 | foreach ($listofobject as $fileobj) { |
5414 | 5414 | $tmpcontent = file_get_contents($fileobj['fullname']); |
5415 | 5415 | if (preg_match('/class\s+([^\s]*)\s+extends\s+CommonObject/ims', $tmpcontent, $reg)) { |
@@ -5561,7 +5561,7 @@ discard block |
||
5561 | 5561 | if (in_array($perm[5], array('lire', 'read', 'creer', 'write', 'effacer', 'delete'))) { |
5562 | 5562 | print dol_escape_htmltag(ucfirst($perm[4])); |
5563 | 5563 | } else { |
5564 | - print ''; // No particular object |
|
5564 | + print ''; // No particular object |
|
5565 | 5565 | } |
5566 | 5566 | print '</td>'; |
5567 | 5567 | |
@@ -6401,9 +6401,9 @@ discard block |
||
6401 | 6401 | |
6402 | 6402 | print '<td>'; |
6403 | 6403 | if ($tabName[0] === "+") { |
6404 | - print '<span class="badge badge-status4 badge-status">' . dol_escape_htmltag($tabName) . '</span>'; |
|
6404 | + print '<span class="badge badge-status4 badge-status">'.dol_escape_htmltag($tabName).'</span>'; |
|
6405 | 6405 | } else { |
6406 | - print '<span class="badge badge-status8 badge-status">' . dol_escape_htmltag($tabName) . '</span>'; |
|
6406 | + print '<span class="badge badge-status8 badge-status">'.dol_escape_htmltag($tabName).'</span>'; |
|
6407 | 6407 | } |
6408 | 6408 | print '</td>'; |
6409 | 6409 |
@@ -30,18 +30,18 @@ discard block |
||
30 | 30 | |
31 | 31 | // Load Dolibarr environment |
32 | 32 | require '../../main.inc.php'; |
33 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php'; |
|
34 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/tax.lib.php'; |
|
35 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/compta/tva/class/tva.class.php'; |
|
37 | -require_once DOL_DOCUMENT_ROOT . '/compta/localtax/class/localtax.class.php'; |
|
38 | -require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
39 | -require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
40 | -require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; |
|
41 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; |
|
42 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/paiementfourn.class.php'; |
|
43 | -require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; |
|
44 | -require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.class.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php'; |
|
38 | +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
39 | +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
40 | +require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; |
|
41 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; |
|
42 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; |
|
43 | +require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; |
|
44 | +require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.php'; |
|
45 | 45 | |
46 | 46 | // Load translation files required by the page |
47 | 47 | $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "product", "trips", "admin")); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $invoice_type = GETPOSTISSET('invoice_type') ? GETPOST('invoice_type', 'alpha') : ''; |
51 | 51 | $vat_rate_show = GETPOSTISSET('vat_rate_show') ? GETPOST('vat_rate_show', 'alphanohtml') : -1; |
52 | 52 | |
53 | -include DOL_DOCUMENT_ROOT . '/compta/tva/initdatesforvat.inc.php'; |
|
53 | +include DOL_DOCUMENT_ROOT.'/compta/tva/initdatesforvat.inc.php'; |
|
54 | 54 | |
55 | 55 | $min = price2num(GETPOST("min", "alpha")); |
56 | 56 | if (empty($min)) { |
@@ -95,11 +95,11 @@ discard block |
||
95 | 95 | $listofparams = array('date_startmonth', 'date_startyear', 'date_startday', 'date_endmonth', 'date_endyear', 'date_endday'); |
96 | 96 | foreach ($listofparams as $param) { |
97 | 97 | if (GETPOST($param) != '') { |
98 | - $morequerystring .= ($morequerystring ? '&' : '') . $param . '=' . GETPOST($param); |
|
98 | + $morequerystring .= ($morequerystring ? '&' : '').$param.'='.GETPOST($param); |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
102 | -$title = $langs->trans("VATReport") . " " . dol_print_date($date_start, '', 'tzserver') . " -> " . dol_print_date($date_end, '', 'tzserver'); |
|
102 | +$title = $langs->trans("VATReport")." ".dol_print_date($date_start, '', 'tzserver')." -> ".dol_print_date($date_end, '', 'tzserver'); |
|
103 | 103 | llxHeader('', $title, '', '', 0, 0, '', '', $morequerystring); |
104 | 104 | |
105 | 105 | |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | |
108 | 108 | //$fsearch.='<br>'; |
109 | 109 | $fsearch = '<!-- hidden fields for form -->'; |
110 | -$fsearch .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
111 | -$fsearch .= '<input type="hidden" name="modetax" value="' . $modetax . '">'; |
|
110 | +$fsearch .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
111 | +$fsearch .= '<input type="hidden" name="modetax" value="'.$modetax.'">'; |
|
112 | 112 | //$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': '; |
113 | 113 | //$fsearch.=' <input type="text" name="min" value="'.$min.'">'; |
114 | 114 | |
@@ -125,13 +125,13 @@ discard block |
||
125 | 125 | if ($modetax == 2) { |
126 | 126 | $calcmode = $langs->trans('OptionPaymentForProductAndServices'); |
127 | 127 | } |
128 | -$calcmode .= ' <span class="opacitymedium">(' . $langs->trans("TaxModuleSetupToModifyRules", DOL_URL_ROOT . '/admin/taxes.php') . ')</span>'; |
|
128 | +$calcmode .= ' <span class="opacitymedium">('.$langs->trans("TaxModuleSetupToModifyRules", DOL_URL_ROOT.'/admin/taxes.php').')</span>'; |
|
129 | 129 | // Set period |
130 | 130 | $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver'); |
131 | 131 | $period .= ' - '; |
132 | 132 | $period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver'); |
133 | 133 | $prevyear = $date_start_year; |
134 | -$q=0; |
|
134 | +$q = 0; |
|
135 | 135 | $prevquarter = $q; |
136 | 136 | if ($prevquarter > 1) { |
137 | 137 | $prevquarter--; |
@@ -157,19 +157,19 @@ discard block |
||
157 | 157 | $description .= $langs->trans("RulesVATInProducts"); |
158 | 158 | } |
159 | 159 | if (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'invoice') { |
160 | - $description .= '<br>' . $langs->trans("RulesVATDueServices"); |
|
160 | + $description .= '<br>'.$langs->trans("RulesVATDueServices"); |
|
161 | 161 | } |
162 | 162 | if (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'payment') { |
163 | - $description .= '<br>' . $langs->trans("RulesVATInServices"); |
|
163 | + $description .= '<br>'.$langs->trans("RulesVATInServices"); |
|
164 | 164 | } |
165 | 165 | if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { |
166 | - $description .= '<br>' . $langs->trans("DepositsAreNotIncluded"); |
|
166 | + $description .= '<br>'.$langs->trans("DepositsAreNotIncluded"); |
|
167 | 167 | } |
168 | 168 | if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { |
169 | 169 | $description .= $langs->trans("SupplierDepositsAreNotIncluded"); |
170 | 170 | } |
171 | 171 | if (isModEnabled('accounting')) { |
172 | - $description .= '<br>' . $langs->trans("ThisIsAnEstimatedValue"); |
|
172 | + $description .= '<br>'.$langs->trans("ThisIsAnEstimatedValue"); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | // Customers invoices |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $vatcust = $langs->trans("VATReceived"); |
180 | 180 | $namecust = $langs->trans("Name"); |
181 | 181 | if ($mysoc->tva_assuj) { |
182 | - $vatcust .= ' (' . $langs->trans("VATToPay") . ')'; |
|
182 | + $vatcust .= ' ('.$langs->trans("VATToPay").')'; |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | // Suppliers invoices |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | $vatsup = $langs->trans("VATPaid"); |
190 | 190 | $namesup = $namecust; |
191 | 191 | if ($mysoc->tva_assuj) { |
192 | - $vatsup .= ' (' . $langs->trans("ToGetBack") . ')'; |
|
192 | + $vatsup .= ' ('.$langs->trans("ToGetBack").')'; |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | $optioncss = GETPOST('optioncss', 'alpha'); |
@@ -225,11 +225,11 @@ discard block |
||
225 | 225 | if (!is_array($x_coll) || !is_array($x_paye)) { |
226 | 226 | $langs->load("errors"); |
227 | 227 | if ($x_coll == -1) { |
228 | - print '<tr><td colspan="' . $columns . '">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>'; |
|
228 | + print '<tr><td colspan="'.$columns.'">'.$langs->trans("ErrorNoAccountancyModuleLoaded").'</td></tr>'; |
|
229 | 229 | } elseif ($x_coll == -2) { |
230 | - print '<tr><td colspan="' . $columns . '">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>'; |
|
230 | + print '<tr><td colspan="'.$columns.'">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>'; |
|
231 | 231 | } else { |
232 | - print '<tr><td colspan="' . $columns . '">' . $langs->trans("Error") . '</td></tr>'; |
|
232 | + print '<tr><td colspan="'.$columns.'">'.$langs->trans("Error").'</td></tr>'; |
|
233 | 233 | } |
234 | 234 | } else { |
235 | 235 | $x_both = array(); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $company_static->name = $x_coll[$my_coll_rate]['company_name'][$id]; |
252 | 252 | $company_static->name_alias = $x_coll[$my_coll_rate]['company_alias'][$id]; |
253 | 253 | $company_static->email = $x_coll[$my_coll_rate]['company_email'][$id]; |
254 | - $company_static->tva_intra = isset($x_coll[$my_coll_rate]['tva_intra'][$id])?$x_coll[$my_coll_rate]['tva_intra'][$id]:0; |
|
254 | + $company_static->tva_intra = isset($x_coll[$my_coll_rate]['tva_intra'][$id]) ? $x_coll[$my_coll_rate]['tva_intra'][$id] : 0; |
|
255 | 255 | $company_static->client = $x_coll[$my_coll_rate]['company_client'][$id]; |
256 | 256 | $company_static->fournisseur = $x_coll[$my_coll_rate]['company_fournisseur'][$id]; |
257 | 257 | $company_static->status = $x_coll[$my_coll_rate]['company_status'][$id]; |
@@ -379,21 +379,21 @@ discard block |
||
379 | 379 | |
380 | 380 | // Customers invoices |
381 | 381 | print '<tr class="liste_titre">'; |
382 | - print '<td class="left">' . $elementcust . '</td>'; |
|
383 | - print '<td class="left">' . $langs->trans("DateInvoice") . '</td>'; |
|
382 | + print '<td class="left">'.$elementcust.'</td>'; |
|
383 | + print '<td class="left">'.$langs->trans("DateInvoice").'</td>'; |
|
384 | 384 | if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'payment') { |
385 | - print '<td class="left">' . $langs->trans("DatePayment") . '</td>'; |
|
385 | + print '<td class="left">'.$langs->trans("DatePayment").'</td>'; |
|
386 | 386 | } else { |
387 | 387 | print '<td></td>'; |
388 | 388 | } |
389 | - print '<td class="left">' . $namecust . '</td>'; |
|
390 | - print '<td class="left">' . $productcust . '</td>'; |
|
389 | + print '<td class="left">'.$namecust.'</td>'; |
|
390 | + print '<td class="left">'.$productcust.'</td>'; |
|
391 | 391 | if ($modetax != 1) { |
392 | - print '<td class="right">' . $amountcust . '</td>'; |
|
393 | - print '<td class="right">' . $langs->trans("Payment") . ' (' . $langs->trans("PercentOfInvoice") . ')</td>'; |
|
392 | + print '<td class="right">'.$amountcust.'</td>'; |
|
393 | + print '<td class="right">'.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')</td>'; |
|
394 | 394 | } |
395 | - print '<td class="right">' . $langs->trans("AmountHTVATRealReceived") . '</td>'; |
|
396 | - print '<td class="right">' . $vatcust . '</td>'; |
|
395 | + print '<td class="right">'.$langs->trans("AmountHTVATRealReceived").'</td>'; |
|
396 | + print '<td class="right">'.$vatcust.'</td>'; |
|
397 | 397 | print '</tr>'; |
398 | 398 | |
399 | 399 | $action = "tvadetail"; |
@@ -414,15 +414,15 @@ discard block |
||
414 | 414 | if (is_array($x_both[$rate]['coll']['detail'])) { |
415 | 415 | // VAT Rate |
416 | 416 | print "<tr>"; |
417 | - print '<td class="tax_rate" colspan="' . ($span + 1) . '">'; |
|
418 | - print $langs->trans('Rate') . ' : ' . vatrate($rate) . '%'; |
|
419 | - print ' - <a href="' . DOL_URL_ROOT . '/compta/tva/quadri_detail.php?invoice_type=customer'; |
|
417 | + print '<td class="tax_rate" colspan="'.($span + 1).'">'; |
|
418 | + print $langs->trans('Rate').' : '.vatrate($rate).'%'; |
|
419 | + print ' - <a href="'.DOL_URL_ROOT.'/compta/tva/quadri_detail.php?invoice_type=customer'; |
|
420 | 420 | if ($invoice_type != 'customer' || !GETPOSTISSET('vat_rate_show') || GETPOST('vat_rate_show') != $rate) { |
421 | - print '&vat_rate_show=' . urlencode($rate); |
|
421 | + print '&vat_rate_show='.urlencode($rate); |
|
422 | 422 | } |
423 | - print '&date_startyear=' . urlencode($date_start_year) . '&date_startmonth=' . urlencode($date_start_month) . '&date_startday=' . urlencode($date_start_day) . '&date_endyear=' . urlencode($date_end_year) . '&date_endmonth=' . urlencode($date_end_month) . '&date_endday=' . urlencode($date_end_day) . '">' . img_picto('', 'chevron-down', 'class="paddingrightonly"') . $langs->trans('VATReportShowByRateDetails') . '</a>'; |
|
423 | + print '&date_startyear='.urlencode($date_start_year).'&date_startmonth='.urlencode($date_start_month).'&date_startday='.urlencode($date_start_day).'&date_endyear='.urlencode($date_end_year).'&date_endmonth='.urlencode($date_end_month).'&date_endday='.urlencode($date_end_day).'">'.img_picto('', 'chevron-down', 'class="paddingrightonly"').$langs->trans('VATReportShowByRateDetails').'</a>'; |
|
424 | 424 | print '</td>'; |
425 | - print '</tr>' . "\n"; |
|
425 | + print '</tr>'."\n"; |
|
426 | 426 | |
427 | 427 | foreach ($x_both[$rate]['coll']['detail'] as $index => $fields) { |
428 | 428 | // Define type |
@@ -493,13 +493,13 @@ discard block |
||
493 | 493 | print '<tr class="oddeven">'; |
494 | 494 | |
495 | 495 | // Ref |
496 | - print '<td class="nowrap left">' . $fields['link'] . '</td>'; |
|
496 | + print '<td class="nowrap left">'.$fields['link'].'</td>'; |
|
497 | 497 | |
498 | 498 | // Invoice date |
499 | - print '<td class="left">' . dol_print_date($fields['datef'], 'day') . '</td>'; |
|
499 | + print '<td class="left">'.dol_print_date($fields['datef'], 'day').'</td>'; |
|
500 | 500 | |
501 | 501 | // Payment date |
502 | - if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'payment') print '<td class="left">' . dol_print_date($fields['datep'], 'day') . '</td>'; |
|
502 | + if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'payment') print '<td class="left">'.dol_print_date($fields['datep'], 'day').'</td>'; |
|
503 | 503 | else print '<td></td>'; |
504 | 504 | |
505 | 505 | // Company name |
@@ -513,10 +513,10 @@ discard block |
||
513 | 513 | if ($fields['pid']) { |
514 | 514 | $product_static->id = $fields['pid']; |
515 | 515 | $product_static->ref = $fields['pref']; |
516 | - $product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered |
|
516 | + $product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered |
|
517 | 517 | print $product_static->getNomUrl(1); |
518 | 518 | if (dol_string_nohtmltag($fields['descr'])) { |
519 | - print ' - ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24); |
|
519 | + print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); |
|
520 | 520 | } |
521 | 521 | } else { |
522 | 522 | if ($type) { |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | $fields['descr'] = $langs->transnoentitiesnoconv($reg[1]); |
534 | 534 | } |
535 | 535 | } |
536 | - print $text . ' ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24); |
|
536 | + print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); |
|
537 | 537 | |
538 | 538 | // Show range |
539 | 539 | print_date_range($fields['ddate_start'], $fields['ddate_end']); |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | if ($fields['payment_amount'] && $fields['ftotal_ttc']) { |
561 | 561 | $payment_static->id = $fields['payment_id']; |
562 | 562 | $payment_static->ref = $fields['payment_ref']; |
563 | - print $payment_static->getNomUrl(2, '', '', 0) . ' '; |
|
563 | + print $payment_static->getNomUrl(2, '', '', 0).' '; |
|
564 | 564 | } |
565 | 565 | if (($type == 0 && getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') |
566 | 566 | || ($type == 1 && getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'invoice')) { |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | } |
572 | 572 | print price(price2num($fields['payment_amount'], 'MT')); |
573 | 573 | if (isset($fields['payment_amount'])) { |
574 | - print ' (' . round($ratiopaymentinvoice * 100, 2) . '%)'; |
|
574 | + print ' ('.round($ratiopaymentinvoice * 100, 2).'%)'; |
|
575 | 575 | } |
576 | 576 | } |
577 | 577 | print '</td>'; |
@@ -600,47 +600,47 @@ discard block |
||
600 | 600 | // Total customers for this vat rate |
601 | 601 | print '<tr class="liste_total">'; |
602 | 602 | print '<td colspan="4"></td>'; |
603 | - print '<td class="right">' . $langs->trans("Total") . ':</td>'; |
|
603 | + print '<td class="right">'.$langs->trans("Total").':</td>'; |
|
604 | 604 | if ($modetax != 1) { |
605 | 605 | print '<td class="nowrap right"> </td>'; |
606 | 606 | print '<td class="right"> </td>'; |
607 | 607 | } |
608 | - print '<td class="right"><span class="amount">' . price(price2num($subtot_coll_total_ht, 'MT')) . '</span></td>'; |
|
609 | - print '<td class="nowrap right"><span class="amount">' . price(price2num($subtot_coll_vat, 'MT')) . '</span></td>'; |
|
608 | + print '<td class="right"><span class="amount">'.price(price2num($subtot_coll_total_ht, 'MT')).'</span></td>'; |
|
609 | + print '<td class="nowrap right"><span class="amount">'.price(price2num($subtot_coll_vat, 'MT')).'</span></td>'; |
|
610 | 610 | print '</tr>'; |
611 | 611 | } |
612 | 612 | |
613 | 613 | if (count($x_coll) == 0) { // Show a total line if nothing shown |
614 | 614 | print '<tr class="liste_total">'; |
615 | 615 | print '<td colspan="4"></td>'; |
616 | - print '<td class="right">' . $langs->trans("Total") . ':</td>'; |
|
616 | + print '<td class="right">'.$langs->trans("Total").':</td>'; |
|
617 | 617 | if ($modetax != 1) { |
618 | 618 | print '<td class="nowrap right"> </td>'; |
619 | 619 | print '<td class="right"> </td>'; |
620 | 620 | } |
621 | - print '<td class="right">' . price(price2num(0, 'MT')) . '</td>'; |
|
622 | - print '<td class="nowrap right">' . price(price2num(0, 'MT')) . '</td>'; |
|
621 | + print '<td class="right">'.price(price2num(0, 'MT')).'</td>'; |
|
622 | + print '<td class="nowrap right">'.price(price2num(0, 'MT')).'</td>'; |
|
623 | 623 | print '</tr>'; |
624 | 624 | } |
625 | 625 | |
626 | 626 | // Blank line |
627 | - print '<tr><td colspan="' . ($span + 2) . '"> </td></tr>'; |
|
627 | + print '<tr><td colspan="'.($span + 2).'"> </td></tr>'; |
|
628 | 628 | |
629 | 629 | // Print table headers for this quadri - expenses |
630 | 630 | print '<tr class="liste_titre liste_titre_topborder">'; |
631 | - print '<td class="left">' . $elementsup . '</td>'; |
|
632 | - print '<td class="left">' . $langs->trans("DateInvoice") . '</td>'; |
|
633 | - if (getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'payment') print '<td class="left">' . $langs->trans("DatePayment") . '</td>'; |
|
631 | + print '<td class="left">'.$elementsup.'</td>'; |
|
632 | + print '<td class="left">'.$langs->trans("DateInvoice").'</td>'; |
|
633 | + if (getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'payment') print '<td class="left">'.$langs->trans("DatePayment").'</td>'; |
|
634 | 634 | else print '<td></td>'; |
635 | - print '<td class="left">' . $namesup . '</td>'; |
|
636 | - print '<td class="left">' . $productsup . '</td>'; |
|
635 | + print '<td class="left">'.$namesup.'</td>'; |
|
636 | + print '<td class="left">'.$productsup.'</td>'; |
|
637 | 637 | if ($modetax != 1) { |
638 | - print '<td class="right">' . $amountsup . '</td>'; |
|
639 | - print '<td class="right">' . $langs->trans("Payment") . ' (' . $langs->trans("PercentOfInvoice") . ')</td>'; |
|
638 | + print '<td class="right">'.$amountsup.'</td>'; |
|
639 | + print '<td class="right">'.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')</td>'; |
|
640 | 640 | } |
641 | - print '<td class="right">' . $langs->trans("AmountHTVATRealPaid") . '</td>'; |
|
642 | - print '<td class="right">' . $vatsup . '</td>'; |
|
643 | - print '</tr>' . "\n"; |
|
641 | + print '<td class="right">'.$langs->trans("AmountHTVATRealPaid").'</td>'; |
|
642 | + print '<td class="right">'.$vatsup.'</td>'; |
|
643 | + print '</tr>'."\n"; |
|
644 | 644 | |
645 | 645 | foreach (array_keys($x_paye) as $rate) { |
646 | 646 | $subtot_paye_total_ht = 0; |
@@ -648,15 +648,15 @@ discard block |
||
648 | 648 | |
649 | 649 | if (is_array($x_both[$rate]['paye']['detail'])) { |
650 | 650 | print "<tr>"; |
651 | - print '<td class="tax_rate" colspan="' . ($span + 1) . '">'; |
|
652 | - print $langs->trans('Rate') . ' : ' . vatrate($rate) . '%'; |
|
653 | - print ' - <a href="' . DOL_URL_ROOT . '/compta/tva/quadri_detail.php?invoice_type=supplier'; |
|
651 | + print '<td class="tax_rate" colspan="'.($span + 1).'">'; |
|
652 | + print $langs->trans('Rate').' : '.vatrate($rate).'%'; |
|
653 | + print ' - <a href="'.DOL_URL_ROOT.'/compta/tva/quadri_detail.php?invoice_type=supplier'; |
|
654 | 654 | if ($invoice_type != 'supplier' || !GETPOSTISSET('vat_rate_show') || GETPOST('vat_rate_show') != $rate) { |
655 | - print '&vat_rate_show=' . urlencode($rate); |
|
655 | + print '&vat_rate_show='.urlencode($rate); |
|
656 | 656 | } |
657 | - print '&date_startyear=' . urlencode($date_start_year) . '&date_startmonth=' . urlencode($date_start_month) . '&date_startday=' . urlencode($date_start_day) . '&date_endyear=' . urlencode($date_end_year) . '&date_endmonth=' . urlencode($date_end_month) . '&date_endday=' . urlencode($date_end_day) . '">' . img_picto('', 'chevron-down', 'class="paddingrightonly"') . $langs->trans('VATReportShowByRateDetails') . '</a>'; |
|
657 | + print '&date_startyear='.urlencode($date_start_year).'&date_startmonth='.urlencode($date_start_month).'&date_startday='.urlencode($date_start_day).'&date_endyear='.urlencode($date_end_year).'&date_endmonth='.urlencode($date_end_month).'&date_endday='.urlencode($date_end_day).'">'.img_picto('', 'chevron-down', 'class="paddingrightonly"').$langs->trans('VATReportShowByRateDetails').'</a>'; |
|
658 | 658 | print '</td>'; |
659 | - print '</tr>' . "\n"; |
|
659 | + print '</tr>'."\n"; |
|
660 | 660 | |
661 | 661 | foreach ($x_both[$rate]['paye']['detail'] as $index => $fields) { |
662 | 662 | // Define type |
@@ -725,14 +725,14 @@ discard block |
||
725 | 725 | print '<tr class="oddeven">'; |
726 | 726 | |
727 | 727 | // Ref |
728 | - print '<td class="nowrap left">' . $fields['link'] . '</td>'; |
|
728 | + print '<td class="nowrap left">'.$fields['link'].'</td>'; |
|
729 | 729 | |
730 | 730 | // Invoice date |
731 | - print '<td class="left">' . dol_print_date($fields['datef'], 'day') . '</td>'; |
|
731 | + print '<td class="left">'.dol_print_date($fields['datef'], 'day').'</td>'; |
|
732 | 732 | |
733 | 733 | // Payment date |
734 | 734 | if (getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'payment') { |
735 | - print '<td class="left">' . dol_print_date($fields['datep'], 'day') . '</td>'; |
|
735 | + print '<td class="left">'.dol_print_date($fields['datep'], 'day').'</td>'; |
|
736 | 736 | } else { |
737 | 737 | print '<td></td>'; |
738 | 738 | } |
@@ -748,10 +748,10 @@ discard block |
||
748 | 748 | if ($fields['pid']) { |
749 | 749 | $product_static->id = $fields['pid']; |
750 | 750 | $product_static->ref = $fields['pref']; |
751 | - $product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered |
|
751 | + $product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered |
|
752 | 752 | print $product_static->getNomUrl(1); |
753 | 753 | if (dol_string_nohtmltag($fields['descr'])) { |
754 | - print ' - ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24); |
|
754 | + print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); |
|
755 | 755 | } |
756 | 756 | } else { |
757 | 757 | if ($type) { |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | $fields['descr'] = $langs->transnoentitiesnoconv($reg[1]); |
769 | 769 | } |
770 | 770 | } |
771 | - print $text . ' ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24); |
|
771 | + print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); |
|
772 | 772 | |
773 | 773 | // Show range |
774 | 774 | print_date_range($fields['ddate_start'], $fields['ddate_end']); |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | if ($fields['payment_amount'] && $fields['ftotal_ttc']) { |
795 | 795 | $paymentfourn_static->id = $fields['payment_id']; |
796 | 796 | $paymentfourn_static->ref = $fields['payment_ref']; |
797 | - print $paymentfourn_static->getNomUrl(2, '', '', 0) . ' '; |
|
797 | + print $paymentfourn_static->getNomUrl(2, '', '', 0).' '; |
|
798 | 798 | } |
799 | 799 | |
800 | 800 | if (($type == 0 && getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'invoice') |
@@ -806,7 +806,7 @@ discard block |
||
806 | 806 | } |
807 | 807 | print price(price2num($fields['payment_amount'], 'MT')); |
808 | 808 | if (isset($fields['payment_amount'])) { |
809 | - print ' (' . round($ratiopaymentinvoice * 100, 2) . '%)'; |
|
809 | + print ' ('.round($ratiopaymentinvoice * 100, 2).'%)'; |
|
810 | 810 | } |
811 | 811 | } |
812 | 812 | print '</td>'; |
@@ -836,26 +836,26 @@ discard block |
||
836 | 836 | // Total suppliers for this vat rate |
837 | 837 | print '<tr class="liste_total">'; |
838 | 838 | print '<td colspan="4"></td>'; |
839 | - print '<td class="right">' . $langs->trans("Total") . ':</td>'; |
|
839 | + print '<td class="right">'.$langs->trans("Total").':</td>'; |
|
840 | 840 | if ($modetax != 1) { |
841 | 841 | print '<td class="nowrap right"> </td>'; |
842 | 842 | print '<td class="right"> </td>'; |
843 | 843 | } |
844 | - print '<td class="right"><span class="amount">' . price(price2num($subtot_paye_total_ht, 'MT')) . '</span></td>'; |
|
845 | - print '<td class="nowrap right"><span class="amount">' . price(price2num($subtot_paye_vat, 'MT')) . '</span></td>'; |
|
844 | + print '<td class="right"><span class="amount">'.price(price2num($subtot_paye_total_ht, 'MT')).'</span></td>'; |
|
845 | + print '<td class="nowrap right"><span class="amount">'.price(price2num($subtot_paye_vat, 'MT')).'</span></td>'; |
|
846 | 846 | print '</tr>'; |
847 | 847 | } |
848 | 848 | |
849 | 849 | if (count($x_paye) == 0) { // Show a total line if nothing shown |
850 | 850 | print '<tr class="liste_total">'; |
851 | 851 | print '<td colspan="4"></td>'; |
852 | - print '<td class="right">' . $langs->trans("Total") . ':</td>'; |
|
852 | + print '<td class="right">'.$langs->trans("Total").':</td>'; |
|
853 | 853 | if ($modetax != 1) { |
854 | 854 | print '<td class="nowrap right"> </td>'; |
855 | 855 | print '<td class="right"> </td>'; |
856 | 856 | } |
857 | - print '<td class="right"><span class="amount">' . price(price2num(0, 'MT')) . '</span></td>'; |
|
858 | - print '<td class="nowrap right"><span class="amount">' . price(price2num(0, 'MT')) . '</span></td>'; |
|
857 | + print '<td class="right"><span class="amount">'.price(price2num(0, 'MT')).'</span></td>'; |
|
858 | + print '<td class="nowrap right"><span class="amount">'.price(price2num(0, 'MT')).'</span></td>'; |
|
859 | 859 | print '</tr>'; |
860 | 860 | } |
861 | 861 | |
@@ -867,8 +867,8 @@ discard block |
||
867 | 867 | print '<table class="noborder centpercent">'; |
868 | 868 | $diff = $x_coll_sum - $x_paye_sum; |
869 | 869 | print '<tr class="liste_total">'; |
870 | - print '<td class="liste_total" colspan="' . $span . '">' . $langs->trans("TotalToPay") . ($q ? ', ' . $langs->trans("Quadri") . ' ' . $q : '') . '</td>'; |
|
871 | - print '<td class="liste_total nowrap right"><b>' . price(price2num($diff, 'MT')) . "</b></td>\n"; |
|
870 | + print '<td class="liste_total" colspan="'.$span.'">'.$langs->trans("TotalToPay").($q ? ', '.$langs->trans("Quadri").' '.$q : '').'</td>'; |
|
871 | + print '<td class="liste_total nowrap right"><b>'.price(price2num($diff, 'MT'))."</b></td>\n"; |
|
872 | 872 | print "</tr>\n"; |
873 | 873 | |
874 | 874 | $i++; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | // Load object |
62 | 62 | include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
63 | 63 | |
64 | -$result = restrictedArea($user, $object->element, $object->id, 'paiement'); // This also test permission on read invoice |
|
64 | +$result = restrictedArea($user, $object->element, $object->id, 'paiement'); // This also test permission on read invoice |
|
65 | 65 | |
66 | 66 | // Security check |
67 | 67 | if ($user->socid) { |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } |
197 | 197 | } |
198 | 198 | |
199 | - if (! $error) { |
|
199 | + if (!$error) { |
|
200 | 200 | header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); |
201 | 201 | exit; |
202 | 202 | } |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | if (isModEnabled('stripe') && in_array($object->ext_payment_site, array('Stripe', 'StripeLive'))) { |
431 | 431 | $tmp1 = explode('@', $object->ext_payment_id); |
432 | 432 | if (!empty($tmp1[1])) { |
433 | - $site_account_payment = $tmp1[1]; // pk_live_... |
|
433 | + $site_account_payment = $tmp1[1]; // pk_live_... |
|
434 | 434 | } |
435 | 435 | $tmp2 = explode(':', $tmp1[0]); |
436 | 436 | if (!empty($tmp2[1])) { |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | } |
606 | 606 | |
607 | 607 | $params = array(); |
608 | -if (! empty($title_button)) { |
|
608 | +if (!empty($title_button)) { |
|
609 | 609 | $params['attr'] = array('title' => $title_button); |
610 | 610 | } |
611 | 611 |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $arrayofcss = array('/takepos/css/pos.css.php', '/takepos/css/colorbox.css'); |
119 | 119 | |
120 | 120 | if (getDolGlobalInt('TAKEPOS_COLOR_THEME') == 1) { |
121 | - $arrayofcss[] = '/takepos/css/colorful.css'; |
|
121 | + $arrayofcss[] = '/takepos/css/colorful.css'; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | limit = maxproduct-1; |
332 | 332 | } |
333 | 333 | // Only show products for sale (tosell=1) |
334 | - $.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken();?>&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&category='+currentcat+'&tosell=1&limit='+limit+'&offset=0', function(data) { |
|
334 | + $.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken(); ?>&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&category='+currentcat+'&tosell=1&limit='+limit+'&offset=0', function(data) { |
|
335 | 335 | console.log("Call ajax.php (in LoadProducts) to get Products of category "+currentcat+" then loop on result to fill image thumbs"); |
336 | 336 | console.log(data); |
337 | 337 | while (ishow < maxproduct) { |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | |
388 | 388 | <?php |
389 | 389 | // Add js from hooks |
390 | - $parameters=array(); |
|
390 | + $parameters = array(); |
|
391 | 391 | $parameters['caller'] = 'loadProducts'; |
392 | 392 | $hookmanager->executeHooks('completeJSProductDisplay', $parameters); |
393 | 393 | print $hookmanager->resPrint; |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | } |
432 | 432 | var offset = <?php echo ($MAXPRODUCT - 2); ?> * pageproducts; |
433 | 433 | // Only show products for sale (tosell=1) |
434 | - $.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken();?>&category='+currentcat+'&tosell=1&limit='+limit+'&offset='+offset, function(data) { |
|
434 | + $.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken(); ?>&category='+currentcat+'&tosell=1&limit='+limit+'&offset='+offset, function(data) { |
|
435 | 435 | console.log("Call ajax.php (in MoreProducts) to get Products of category "+currentcat); |
436 | 436 | |
437 | 437 | if (typeof (data[0]) == "undefined" && moreorless=="more"){ // Return if no more pages |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | if (idproduct=="") return; |
493 | 493 | // Call page invoice.php to generate the section with product lines |
494 | 494 | $("#poslines").load("invoice.php?action=addline&token=<?php echo newToken() ?>&place="+place+"&idproduct="+idproduct+"&selectedline="+selectedline+"&qty="+qty, function() { |
495 | - <?php if (!empty($conf->global->TAKEPOS_CUSTOMER_DISPLAY)) echo "CustomerDisplay();";?> |
|
495 | + <?php if (!empty($conf->global->TAKEPOS_CUSTOMER_DISPLAY)) echo "CustomerDisplay();"; ?> |
|
496 | 496 | }); |
497 | 497 | } |
498 | 498 | |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | function ChangeThirdparty(idcustomer) { |
503 | 503 | console.log("ChangeThirdparty"); |
504 | 504 | // Call page list.php to change customer |
505 | - $("#poslines").load("../societe/list.php?action=change&token=<?php echo newToken();?>&type=t&contextpage=poslist&idcustomer="+idcustomer+"&place="+place+"", function() { |
|
505 | + $("#poslines").load("../societe/list.php?action=change&token=<?php echo newToken(); ?>&type=t&contextpage=poslist&idcustomer="+idcustomer+"&place="+place+"", function() { |
|
506 | 506 | }); |
507 | 507 | |
508 | 508 | ClearSearch(); |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | |
580 | 580 | console.log("New with place = <?php echo $place; ?>, js place="+place+", invoiceid="+invoiceid); |
581 | 581 | |
582 | - $.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getInvoice&token=<?php echo newToken();?>&id='+invoiceid, function(data) { |
|
582 | + $.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getInvoice&token=<?php echo newToken(); ?>&id='+invoiceid, function(data) { |
|
583 | 583 | var r; |
584 | 584 | |
585 | 585 | if (parseInt(data['paye']) === 1) { |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | pageproducts = 0; |
650 | 650 | jQuery(".wrapper2 .catwatermark").hide(); |
651 | 651 | var nbsearchresults = 0; |
652 | - $.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&token=<?php echo newToken();?>&term=' + search_term + '&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) { |
|
652 | + $.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&token=<?php echo newToken(); ?>&term=' + search_term + '&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) { |
|
653 | 653 | for (i = 0; i < <?php echo $MAXPRODUCT ?>; i++) { |
654 | 654 | if (typeof (data[i]) == "undefined") { |
655 | 655 | $("#prowatermark" + i).html(""); |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | |
694 | 694 | <?php |
695 | 695 | // Add js from hooks |
696 | - $parameters=array(); |
|
696 | + $parameters = array(); |
|
697 | 697 | $parameters['caller'] = 'search2'; |
698 | 698 | $hookmanager->executeHooks('completeJSProductDisplay', $parameters); |
699 | 699 | print $hookmanager->resPrint; |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | } |
732 | 732 | else { |
733 | 733 | $("#prodiv<?php echo $MAXPRODUCT - 2; ?> span").show(); |
734 | - var search_start_less = Math.max(0, parseInt(search_start) - parseInt(<?php echo $MAXPRODUCT - 2;?>)); |
|
734 | + var search_start_less = Math.max(0, parseInt(search_start) - parseInt(<?php echo $MAXPRODUCT - 2; ?>)); |
|
735 | 735 | $("#search_start_less").val(search_start_less); |
736 | 736 | } |
737 | 737 | if (nbsearchresults != <?php echo $MAXPRODUCT - 2; ?>) { |
@@ -739,7 +739,7 @@ discard block |
||
739 | 739 | } |
740 | 740 | else { |
741 | 741 | $("#prodiv<?php echo $MAXPRODUCT - 1; ?> span").show(); |
742 | - var search_start_more = parseInt(search_start) + parseInt(<?php echo $MAXPRODUCT - 2;?>); |
|
742 | + var search_start_more = parseInt(search_start) + parseInt(<?php echo $MAXPRODUCT - 2; ?>); |
|
743 | 743 | $("#search_start_more").val(search_start_more); |
744 | 744 | } |
745 | 745 | }); |
@@ -836,14 +836,14 @@ discard block |
||
836 | 836 | |
837 | 837 | function TakeposPrintingOrder(){ |
838 | 838 | console.log("TakeposPrintingOrder"); |
839 | - $("#poslines").load("invoice.php?action=order&token=<?php echo newToken();?>&place="+place, function() { |
|
839 | + $("#poslines").load("invoice.php?action=order&token=<?php echo newToken(); ?>&place="+place, function() { |
|
840 | 840 | //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); |
841 | 841 | }); |
842 | 842 | } |
843 | 843 | |
844 | 844 | function TakeposPrintingTemp(){ |
845 | 845 | console.log("TakeposPrintingTemp"); |
846 | - $("#poslines").load("invoice.php?action=temp&token=<?php echo newToken();?>&place="+place, function() { |
|
846 | + $("#poslines").load("invoice.php?action=temp&token=<?php echo newToken(); ?>&place="+place, function() { |
|
847 | 847 | //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); |
848 | 848 | }); |
849 | 849 | } |
@@ -865,7 +865,7 @@ discard block |
||
865 | 865 | } |
866 | 866 | |
867 | 867 | function DolibarrOpenDrawer() { |
868 | - console.log("DolibarrOpenDrawer call ajax url /takepos/ajax/ajax.php?action=opendrawer&token=<?php echo newToken();?>&term=<?php print urlencode($_SESSION["takeposterminal"]); ?>"); |
|
868 | + console.log("DolibarrOpenDrawer call ajax url /takepos/ajax/ajax.php?action=opendrawer&token=<?php echo newToken(); ?>&term=<?php print urlencode($_SESSION["takeposterminal"]); ?>"); |
|
869 | 869 | $.ajax({ |
870 | 870 | type: "GET", |
871 | 871 | data: { token: '<?php echo currentToken(); ?>' }, |
@@ -1205,15 +1205,15 @@ discard block |
||
1205 | 1205 | |
1206 | 1206 | // TakePOS setup check |
1207 | 1207 | if (isset($_SESSION["takeposterminal"]) && $_SESSION["takeposterminal"]) { |
1208 | - $sql = "SELECT code, libelle FROM " . MAIN_DB_PREFIX . "c_paiement"; |
|
1209 | - $sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")"; |
|
1208 | + $sql = "SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_paiement"; |
|
1209 | + $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; |
|
1210 | 1210 | $sql .= " AND active = 1"; |
1211 | 1211 | $sql .= " ORDER BY libelle"; |
1212 | 1212 | |
1213 | 1213 | $resql = $db->query($sql); |
1214 | 1214 | $paiementsModes = array(); |
1215 | 1215 | if ($resql) { |
1216 | - while ( $obj = $db->fetch_object($resql) ) { |
|
1216 | + while ($obj = $db->fetch_object($resql)) { |
|
1217 | 1217 | $paycode = $obj->code; |
1218 | 1218 | if ($paycode == 'LIQ') { |
1219 | 1219 | $paycode = 'CASH'; |
@@ -1222,9 +1222,9 @@ discard block |
||
1222 | 1222 | $paycode = 'CHEQUE'; |
1223 | 1223 | } |
1224 | 1224 | |
1225 | - $constantforkey = "CASHDESK_ID_BANKACCOUNT_" . $paycode . $_SESSION["takeposterminal"]; |
|
1225 | + $constantforkey = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"]; |
|
1226 | 1226 | //var_dump($constantforkey.' '.getDolGlobalInt($constantforkey)); |
1227 | - if ( !empty($conf->global->$constantforkey) && getDolGlobalInt($constantforkey) > 0) { |
|
1227 | + if (!empty($conf->global->$constantforkey) && getDolGlobalInt($constantforkey) > 0) { |
|
1228 | 1228 | array_push($paiementsModes, $obj); |
1229 | 1229 | } |
1230 | 1230 | } |
@@ -1264,7 +1264,7 @@ discard block |
||
1264 | 1264 | $menus[$r++] = array('title'=>'<span class="far fa-building paddingrightonly"></span><div class="trunc">'.$langs->trans("Customer").'</div>', 'action'=>'Customer();'); |
1265 | 1265 | } |
1266 | 1266 | } |
1267 | -if ( ! getDolGlobalString('TAKEPOS_HIDE_HISTORY')) { |
|
1267 | +if (!getDolGlobalString('TAKEPOS_HIDE_HISTORY')) { |
|
1268 | 1268 | $menus[$r++] = array('title'=>'<span class="fa fa-history paddingrightonly"></span><div class="trunc">'.$langs->trans("History").'</div>', 'action'=>'History();'); |
1269 | 1269 | } |
1270 | 1270 | $menus[$r++] = array('title'=>'<span class="fa fa-cube paddingrightonly"></span><div class="trunc">'.$langs->trans("FreeZone").'</div>', 'action'=>'FreeZone();'); |
@@ -1334,7 +1334,7 @@ discard block |
||
1334 | 1334 | $parameters = array('menus'=>$menus); |
1335 | 1335 | $reshook = $hookmanager->executeHooks('ActionButtons', $parameters); |
1336 | 1336 | if ($reshook == 0) { //add buttons |
1337 | - if (is_array($hookmanager->resArray) ) { |
|
1337 | + if (is_array($hookmanager->resArray)) { |
|
1338 | 1338 | foreach ($hookmanager->resArray as $resArray) { |
1339 | 1339 | foreach ($resArray as $butmenu) { |
1340 | 1340 | $menus[$r++] = $butmenu; |
@@ -1342,7 +1342,7 @@ discard block |
||
1342 | 1342 | } |
1343 | 1343 | } elseif ($reshook == 1) { |
1344 | 1344 | $r = 0; //replace buttons |
1345 | - if (is_array($hookmanager->resArray) ) { |
|
1345 | + if (is_array($hookmanager->resArray)) { |
|
1346 | 1346 | foreach ($hookmanager->resArray as $resArray) { |
1347 | 1347 | foreach ($resArray as $butmenu) { |
1348 | 1348 | $menus[$r++] = $butmenu; |
@@ -134,13 +134,13 @@ discard block |
||
134 | 134 | if ($invoiceid > 0) { |
135 | 135 | $ret = $invoice->fetch($invoiceid); |
136 | 136 | } else { |
137 | - $ret = $invoice->fetch('', '(PROV-POS'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '') .'-'.$place.')'); |
|
137 | + $ret = $invoice->fetch('', '(PROV-POS'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '').'-'.$place.')'); |
|
138 | 138 | } |
139 | 139 | if ($ret > 0) { |
140 | 140 | $placeid = $invoice->id; |
141 | 141 | } |
142 | 142 | |
143 | -$constforcompanyid = 'CASHDESK_ID_THIRDPARTY'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
143 | +$constforcompanyid = 'CASHDESK_ID_THIRDPARTY'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
144 | 144 | |
145 | 145 | $soc = new Societe($db); |
146 | 146 | if ($invoice->socid > 0) { |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | * Actions |
162 | 162 | */ |
163 | 163 | |
164 | -$parameters=array(); |
|
165 | -$reshook=$hookmanager->executeHooks('doActions', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
164 | +$parameters = array(); |
|
165 | +$reshook = $hookmanager->executeHooks('doActions', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
166 | 166 | if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
167 | 167 | |
168 | 168 | if (empty($reshook)) { |
@@ -175,9 +175,9 @@ discard block |
||
175 | 175 | $bankaccount = GETPOST('accountid', 'int'); |
176 | 176 | } else { |
177 | 177 | if ($pay == 'LIQ') { |
178 | - $bankaccount = getDolGlobalString('CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]); // For backward compatibility |
|
178 | + $bankaccount = getDolGlobalString('CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]); // For backward compatibility |
|
179 | 179 | } elseif ($pay == "CHQ") { |
180 | - $bankaccount = getDolGlobalString('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]); // For backward compatibility |
|
180 | + $bankaccount = getDolGlobalString('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]); // For backward compatibility |
|
181 | 181 | } else { |
182 | 182 | $accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"]; |
183 | 183 | $bankaccount = getDolGlobalString($accountname); |
@@ -237,9 +237,9 @@ discard block |
||
237 | 237 | $savconst = $conf->global->STOCK_CALCULATE_ON_BILL; |
238 | 238 | |
239 | 239 | if (isModEnabled('productbatch') && !getDolGlobalInt('CASHDESK_FORCE_DECREASE_STOCK')) { |
240 | - $conf->global->STOCK_CALCULATE_ON_BILL = 0; // To not change the stock (not yet compatible with batch management) |
|
240 | + $conf->global->STOCK_CALCULATE_ON_BILL = 0; // To not change the stock (not yet compatible with batch management) |
|
241 | 241 | } else { |
242 | - $conf->global->STOCK_CALCULATE_ON_BILL = 1; // To force the change of stock |
|
242 | + $conf->global->STOCK_CALCULATE_ON_BILL = 1; // To force the change of stock |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | if ($res < 0) { |
258 | 258 | $error++; |
259 | 259 | $langs->load("admin"); |
260 | - dol_htmloutput_errors($invoice->error == 'NotConfigured' ? $langs->trans("NotConfigured").' (TakePos numbering module)': $invoice->error, $invoice->errors, 1); |
|
260 | + dol_htmloutput_errors($invoice->error == 'NotConfigured' ? $langs->trans("NotConfigured").' (TakePos numbering module)' : $invoice->error, $invoice->errors, 1); |
|
261 | 261 | } |
262 | 262 | } |
263 | 263 | |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | $creditnote->socid = $invoice->socid; |
319 | 319 | $creditnote->date = dol_now(); |
320 | 320 | $creditnote->module_source = 'takepos'; |
321 | - $creditnote->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ; |
|
321 | + $creditnote->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''; |
|
322 | 322 | $creditnote->type = Facture::TYPE_CREDIT_NOTE; |
323 | 323 | $creditnote->fk_facture_source = $placeid; |
324 | 324 | $creditnote->remise_absolue = $invoice->remise_absolue; |
@@ -469,9 +469,9 @@ discard block |
||
469 | 469 | // If we add a line and no invoice yet, we create the invoice |
470 | 470 | if (($action == "addline" || $action == "freezone") && $placeid == 0) { |
471 | 471 | $invoice->socid = getDolGlobalString($constforcompanyid); |
472 | - $invoice->date = dol_now('tzuserrel'); // We use the local date, only the day will be saved. |
|
472 | + $invoice->date = dol_now('tzuserrel'); // We use the local date, only the day will be saved. |
|
473 | 473 | $invoice->module_source = 'takepos'; |
474 | - $invoice->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ; |
|
474 | + $invoice->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''; |
|
475 | 475 | $invoice->entity = !empty($_SESSION["takeposinvoiceentity"]) ? $_SESSION["takeposinvoiceentity"] : $conf->entity; |
476 | 476 | |
477 | 477 | if ($invoice->socid <= 0) { |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | if (!empty($conf->global->TAKEPOS_GROUP_SAME_PRODUCT)) { |
533 | 533 | foreach ($invoice->lines as $line) { |
534 | 534 | if ($line->product_ref == $prod->ref) { |
535 | - if ($line->special_code==4) continue; // If this line is sended to printer create new line |
|
535 | + if ($line->special_code == 4) continue; // If this line is sended to printer create new line |
|
536 | 536 | // check if qty in stock |
537 | 537 | if (getDolGlobalString('TAKEPOS_QTY_IN_STOCK') && (($line->qty + $qty) > $prod->stock_reel)) { |
538 | 538 | $invoice->error = $langs->trans('NotEnoughInStock'); |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | |
580 | 580 | // complete line by hook |
581 | 581 | $parameters = array('prod' => $prod, 'line' => $line); |
582 | - $reshook=$hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks |
|
582 | + $reshook = $hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks |
|
583 | 583 | if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
584 | 584 | |
585 | 585 | |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | |
633 | 633 | if ($action == "addnote") { |
634 | 634 | $desc = GETPOST('addnote', 'alpha'); |
635 | - if ($idline==0) { |
|
635 | + if ($idline == 0) { |
|
636 | 636 | $invoice->update_note($desc, '_public'); |
637 | 637 | } else foreach ($invoice->lines as $line) { |
638 | 638 | if ($line->id == $idline) { |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | } else { |
733 | 733 | if (empty($user->rights->takepos->editlines) || (empty($user->rights->takepos->editorderedlines) && $line->special_code == "4")) { |
734 | 734 | dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos"), null, 1); |
735 | - } elseif (getDolGlobalInt('TAKEPOS_CHANGE_PRICE_HT') == 1) { |
|
735 | + } elseif (getDolGlobalInt('TAKEPOS_CHANGE_PRICE_HT') == 1) { |
|
736 | 736 | $result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); |
737 | 737 | } else { |
738 | 738 | $result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'TTC', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | } |
928 | 928 | $sectionwithinvoicelink .= '</span><br>'; |
929 | 929 | if (getDolGlobalInt('TAKEPOS_PRINT_INVOICE_DOC_INSTEAD_OF_RECEIPT')) { |
930 | - $sectionwithinvoicelink .= ' <a target="_blank" class="button" href="' . DOL_URL_ROOT . '/document.php?token=' . newToken() . '&modulepart=facture&file=' . $invoice->ref . '/' . $invoice->ref . '.pdf">Invoice</a>'; |
|
930 | + $sectionwithinvoicelink .= ' <a target="_blank" class="button" href="'.DOL_URL_ROOT.'/document.php?token='.newToken().'&modulepart=facture&file='.$invoice->ref.'/'.$invoice->ref.'.pdf">Invoice</a>'; |
|
931 | 931 | } elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { |
932 | 932 | if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { |
933 | 933 | $sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="TakeposConnector('.$placeid.')">'.$langs->trans('PrintTicket').'</button>'; |
@@ -989,7 +989,7 @@ discard block |
||
989 | 989 | <script type="text/javascript"> |
990 | 990 | var selectedline=0; |
991 | 991 | var selectedtext=""; |
992 | -<?php if ($action=="valid") echo "var place=0;";?> // Set to default place after close sale |
|
992 | +<?php if ($action == "valid") echo "var place=0;"; ?> // Set to default place after close sale |
|
993 | 993 | var placeid=<?php echo ($placeid > 0 ? $placeid : 0); ?>; |
994 | 994 | $(document).ready(function() { |
995 | 995 | var idoflineadded = <?php echo (empty($idoflineadded) ? 0 : $idoflineadded); ?>; |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | if ($contactid > 0) { |
1180 | 1180 | $contact = new Contact($db); |
1181 | 1181 | $contact->fetch($contactid); |
1182 | - $s .= " - " . $contact->getFullName($langs); |
|
1182 | + $s .= " - ".$contact->getFullName($langs); |
|
1183 | 1183 | } |
1184 | 1184 | } |
1185 | 1185 | } |
@@ -1240,10 +1240,10 @@ discard block |
||
1240 | 1240 | $s = ''; |
1241 | 1241 | |
1242 | 1242 | $idwarehouse = 0; |
1243 | - $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
1243 | + $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
1244 | 1244 | if (isModEnabled('stock')) { |
1245 | 1245 | if (getDolGlobalString($constantforkey) != "1") { |
1246 | - $constantforkey = 'CASHDESK_ID_WAREHOUSE'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
1246 | + $constantforkey = 'CASHDESK_ID_WAREHOUSE'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); |
|
1247 | 1247 | $idwarehouse = getDolGlobalString($constantforkey); |
1248 | 1248 | if ($idwarehouse > 0) { |
1249 | 1249 | $s = '<span class="small">'; |
@@ -1286,7 +1286,7 @@ discard block |
||
1286 | 1286 | $result = $adh->fetch('', '', $invoice->socid); |
1287 | 1287 | if ($result > 0) { |
1288 | 1288 | $adh->ref = $adh->getFullName($langs); |
1289 | - if (empty($adh->statut) || $adh->statut == Adherent::STATUS_EXCLUDED ) { |
|
1289 | + if (empty($adh->statut) || $adh->statut == Adherent::STATUS_EXCLUDED) { |
|
1290 | 1290 | $s .= "<s>"; |
1291 | 1291 | } |
1292 | 1292 | $s .= $adh->getFullName($langs); |
@@ -1342,7 +1342,7 @@ discard block |
||
1342 | 1342 | print '<script src="'.DOL_URL_ROOT.'/core/js/lib_foot.js.php?lang='.$langs->defaultlang.'"></script>'."\n"; |
1343 | 1343 | } |
1344 | 1344 | |
1345 | -print '<!-- invoice.php place='.(int) $place.' invoice='.$invoice->ref.' mobilepage='.(empty($mobilepage) ? '' : $mobilepage).' $_SESSION["basiclayout"]='.(empty($_SESSION["basiclayout"])?'':$_SESSION["basiclayout"]).' conf->global->TAKEPOS_BAR_RESTAURANT='.getDolGlobalString('TAKEPOS_BAR_RESTAURANT').' -->'."\n"; |
|
1345 | +print '<!-- invoice.php place='.(int) $place.' invoice='.$invoice->ref.' mobilepage='.(empty($mobilepage) ? '' : $mobilepage).' $_SESSION["basiclayout"]='.(empty($_SESSION["basiclayout"]) ? '' : $_SESSION["basiclayout"]).' conf->global->TAKEPOS_BAR_RESTAURANT='.getDolGlobalString('TAKEPOS_BAR_RESTAURANT').' -->'."\n"; |
|
1346 | 1346 | print '<div class="div-table-responsive-no-min invoice">'; |
1347 | 1347 | print '<table id="tablelines" class="noborder noshadow postablelines centpercent">'; |
1348 | 1348 | if ($sectionwithinvoicelink && ($mobilepage == "invoice" || $mobilepage == "")) { |
@@ -1386,8 +1386,8 @@ discard block |
||
1386 | 1386 | print '</td>'; |
1387 | 1387 | |
1388 | 1388 | // complete header by hook |
1389 | -$parameters=array(); |
|
1390 | -$reshook=$hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
1389 | +$parameters = array(); |
|
1390 | +$reshook = $hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
1391 | 1391 | if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
1392 | 1392 | print $hookmanager->resPrint; |
1393 | 1393 | |
@@ -1396,16 +1396,16 @@ discard block |
||
1396 | 1396 | print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>'; |
1397 | 1397 | if (getDolGlobalString('TAKEPOS_SHOW_HT')) { |
1398 | 1398 | print '<td class="linecolht right nowraponall">'; |
1399 | - print '<span class="opacitymedium small">' . $langs->trans('TotalHTShort') . '</span><br>'; |
|
1399 | + print '<span class="opacitymedium small">'.$langs->trans('TotalHTShort').'</span><br>'; |
|
1400 | 1400 | // In phone version only show when it is invoice page |
1401 | 1401 | if (empty($mobilepage) || $mobilepage == "invoice") { |
1402 | - print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">' . price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency) . '</span>'; |
|
1402 | + print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">'.price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency).'</span>'; |
|
1403 | 1403 | if (isModEnabled('multicurrency') && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) { |
1404 | 1404 | //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency |
1405 | - include_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php'; |
|
1405 | + include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; |
|
1406 | 1406 | $multicurrency = new MultiCurrency($db); |
1407 | 1407 | $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]); |
1408 | - print '<br><span id="linecolht-span-total" style="font-size:0.9em; font-style:italic;">(' . price($invoice->total_ht * $multicurrency->rate->rate) . ' ' . $_SESSION["takeposcustomercurrency"] . ')</span>'; |
|
1408 | + print '<br><span id="linecolht-span-total" style="font-size:0.9em; font-style:italic;">('.price($invoice->total_ht * $multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"].')</span>'; |
|
1409 | 1409 | } |
1410 | 1410 | print '</td>'; |
1411 | 1411 | } |
@@ -1550,8 +1550,8 @@ discard block |
||
1550 | 1550 | $htmlsupplements[$line->fk_parent_line] .= '</td>'; |
1551 | 1551 | |
1552 | 1552 | // complete line by hook |
1553 | - $parameters=array('line' => $line); |
|
1554 | - $reshook=$hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
1553 | + $parameters = array('line' => $line); |
|
1554 | + $reshook = $hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
1555 | 1555 | if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
1556 | 1556 | $htmlsupplements[$line->fk_parent_line] .= $hookmanager->resPrint; |
1557 | 1557 | |
@@ -1598,7 +1598,7 @@ discard block |
||
1598 | 1598 | } |
1599 | 1599 | } |
1600 | 1600 | if (getDolGlobalInt('TAKEPOS_SHOW_PRODUCT_REFERENCE') == 1) { |
1601 | - $htmlforlines .= $form->textwithpicto($line->product_label ? '<b>' . $line->product_ref . '</b> - ' . $line->product_label : dolGetFirstLineOfText($line->desc, 1), $tooltiptext); |
|
1601 | + $htmlforlines .= $form->textwithpicto($line->product_label ? '<b>'.$line->product_ref.'</b> - '.$line->product_label : dolGetFirstLineOfText($line->desc, 1), $tooltiptext); |
|
1602 | 1602 | } elseif (getDolGlobalInt('TAKEPOS_SHOW_PRODUCT_REFERENCE') == 2) { |
1603 | 1603 | $htmlforlines .= $form->textwithpicto($line->product_ref ? '<b>'.$line->product_ref.'<b>' : dolGetFirstLineOfText($line->desc, 1), $tooltiptext); |
1604 | 1604 | } else { |
@@ -1644,8 +1644,8 @@ discard block |
||
1644 | 1644 | $htmlforlines .= '</td>'; |
1645 | 1645 | |
1646 | 1646 | // complete line by hook |
1647 | - $parameters=array('line' => $line); |
|
1648 | - $reshook=$hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
1647 | + $parameters = array('line' => $line); |
|
1648 | + $reshook = $hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
|
1649 | 1649 | if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
1650 | 1650 | $htmlforlines .= $hookmanager->resPrint; |
1651 | 1651 | |
@@ -1734,7 +1734,7 @@ discard block |
||
1734 | 1734 | if (($action == "valid" || $action == "history") && $invoice->type != Facture::TYPE_CREDIT_NOTE && empty($conf->global->TAKEPOS_NO_CREDITNOTE)) { |
1735 | 1735 | print '<button id="buttonprint" type="button" onclick="ModalBox(\'ModalCreditNote\')">'.$langs->trans('CreateCreditNote').'</button>'; |
1736 | 1736 | if (getDolGlobalInt('TAKEPOS_PRINT_INVOICE_DOC_INSTEAD_OF_RECEIPT')) { |
1737 | - print ' <a target="_blank" class="button" href="' . DOL_URL_ROOT . '/document.php?token=' . newToken() . '&modulepart=facture&file=' . $invoice->ref . '/' . $invoice->ref . '.pdf">Invoice</a>'; |
|
1737 | + print ' <a target="_blank" class="button" href="'.DOL_URL_ROOT.'/document.php?token='.newToken().'&modulepart=facture&file='.$invoice->ref.'/'.$invoice->ref.'.pdf">Invoice</a>'; |
|
1738 | 1738 | } |
1739 | 1739 | } |
1740 | 1740 |
@@ -163,7 +163,9 @@ discard block |
||
163 | 163 | |
164 | 164 | $parameters=array(); |
165 | 165 | $reshook=$hookmanager->executeHooks('doActions', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
166 | -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
166 | +if ($reshook < 0) { |
|
167 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
168 | +} |
|
167 | 169 | |
168 | 170 | if (empty($reshook)) { |
169 | 171 | // Action to record a payment on a TakePOS invoice |
@@ -532,7 +534,10 @@ discard block |
||
532 | 534 | if (!empty($conf->global->TAKEPOS_GROUP_SAME_PRODUCT)) { |
533 | 535 | foreach ($invoice->lines as $line) { |
534 | 536 | if ($line->product_ref == $prod->ref) { |
535 | - if ($line->special_code==4) continue; // If this line is sended to printer create new line |
|
537 | + if ($line->special_code==4) { |
|
538 | + continue; |
|
539 | + } |
|
540 | + // If this line is sended to printer create new line |
|
536 | 541 | // check if qty in stock |
537 | 542 | if (getDolGlobalString('TAKEPOS_QTY_IN_STOCK') && (($line->qty + $qty) > $prod->stock_reel)) { |
538 | 543 | $invoice->error = $langs->trans('NotEnoughInStock'); |
@@ -571,8 +576,9 @@ discard block |
||
571 | 576 | if ($pf->find_min_price_product_fournisseur($idproduct, $qty) > 0) { |
572 | 577 | $line['fk_fournprice'] = $pf->product_fourn_price_id; |
573 | 578 | $line['pa_ht'] = $pf->fourn_unitprice_with_discount; |
574 | - if (getDolGlobalString('PRODUCT_CHARGES') && $pf->fourn_charges > 0) |
|
575 | - $line['pa_ht'] += $pf->fourn_charges / $pf->fourn_qty; |
|
579 | + if (getDolGlobalString('PRODUCT_CHARGES') && $pf->fourn_charges > 0) { |
|
580 | + $line['pa_ht'] += $pf->fourn_charges / $pf->fourn_qty; |
|
581 | + } |
|
576 | 582 | } |
577 | 583 | } |
578 | 584 | } |
@@ -580,7 +586,9 @@ discard block |
||
580 | 586 | // complete line by hook |
581 | 587 | $parameters = array('prod' => $prod, 'line' => $line); |
582 | 588 | $reshook=$hookmanager->executeHooks('completeTakePosAddLine', $parameters, $invoice, $action); // Note that $action and $line may have been modified by some hooks |
583 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
589 | + if ($reshook < 0) { |
|
590 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
591 | + } |
|
584 | 592 | |
585 | 593 | |
586 | 594 | if (empty($reshook)) { |
@@ -634,9 +642,11 @@ discard block |
||
634 | 642 | $desc = GETPOST('addnote', 'alpha'); |
635 | 643 | if ($idline==0) { |
636 | 644 | $invoice->update_note($desc, '_public'); |
637 | - } else foreach ($invoice->lines as $line) { |
|
645 | + } else { |
|
646 | + foreach ($invoice->lines as $line) { |
|
638 | 647 | if ($line->id == $idline) { |
639 | 648 | $result = $invoice->updateline($line->id, $desc, $line->subprice, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); |
649 | + } |
|
640 | 650 | } |
641 | 651 | } |
642 | 652 | $invoice->fetch($placeid); |
@@ -989,7 +999,10 @@ discard block |
||
989 | 999 | <script type="text/javascript"> |
990 | 1000 | var selectedline=0; |
991 | 1001 | var selectedtext=""; |
992 | -<?php if ($action=="valid") echo "var place=0;";?> // Set to default place after close sale |
|
1002 | +<?php if ($action=="valid") { |
|
1003 | + echo "var place=0;"; |
|
1004 | +} |
|
1005 | +?> // Set to default place after close sale |
|
993 | 1006 | var placeid=<?php echo ($placeid > 0 ? $placeid : 0); ?>; |
994 | 1007 | $(document).ready(function() { |
995 | 1008 | var idoflineadded = <?php echo (empty($idoflineadded) ? 0 : $idoflineadded); ?>; |
@@ -1388,7 +1401,9 @@ discard block |
||
1388 | 1401 | // complete header by hook |
1389 | 1402 | $parameters=array(); |
1390 | 1403 | $reshook=$hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
1391 | -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1404 | +if ($reshook < 0) { |
|
1405 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1406 | +} |
|
1392 | 1407 | print $hookmanager->resPrint; |
1393 | 1408 | |
1394 | 1409 | if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) { |
@@ -1552,7 +1567,9 @@ discard block |
||
1552 | 1567 | // complete line by hook |
1553 | 1568 | $parameters=array('line' => $line); |
1554 | 1569 | $reshook=$hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
1555 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1570 | + if ($reshook < 0) { |
|
1571 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1572 | + } |
|
1556 | 1573 | $htmlsupplements[$line->fk_parent_line] .= $hookmanager->resPrint; |
1557 | 1574 | |
1558 | 1575 | if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) { |
@@ -1646,7 +1663,9 @@ discard block |
||
1646 | 1663 | // complete line by hook |
1647 | 1664 | $parameters=array('line' => $line); |
1648 | 1665 | $reshook=$hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks |
1649 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1666 | + if ($reshook < 0) { |
|
1667 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1668 | + } |
|
1650 | 1669 | $htmlforlines .= $hookmanager->resPrint; |
1651 | 1670 | |
1652 | 1671 | $htmlforlines .= '<td class="right">'.vatrate($line->remise_percent, true).'</td>'; |