@@ -239,16 +239,16 @@ discard block |
||
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | if ($filefound && !empty($classname)) { |
| 242 | - $result = dol_include_once($reldir . "core/modules/project/task/" . $modele . '.php'); |
|
| 242 | + $result = dol_include_once($reldir."core/modules/project/task/".$modele.'.php'); |
|
| 243 | 243 | if ($result !== false && class_exists($classname)) { |
| 244 | 244 | $modTask = new $classname(); |
| 245 | 245 | '@phan-var-force ModeleNumRefTask $modTask'; |
| 246 | 246 | $defaultref = $modTask->getNextValue(null, $this->task); |
| 247 | 247 | } else { |
| 248 | - dol_syslog("Failed to include module file or invalid classname: " . $reldir . "core/modules/project/task/" . $modele . '.php', LOG_ERR); |
|
| 248 | + dol_syslog("Failed to include module file or invalid classname: ".$reldir."core/modules/project/task/".$modele.'.php', LOG_ERR); |
|
| 249 | 249 | } |
| 250 | 250 | } else { |
| 251 | - dol_syslog("Module file not found or classname is empty: " . $modele, LOG_ERR); |
|
| 251 | + dol_syslog("Module file not found or classname is empty: ".$modele, LOG_ERR); |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | if (is_numeric($defaultref) && $defaultref <= 0) { |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | if (empty($defaultref)) { |
| 259 | - $defaultref = 'TK' . dol_print_date(dol_now(), 'dayrfc'); |
|
| 259 | + $defaultref = 'TK'.dol_print_date(dol_now(), 'dayrfc'); |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | $this->task->ref = $defaultref; |
@@ -609,7 +609,7 @@ discard block |
||
| 609 | 609 | $this->task->timespent_fk_user = $uid; |
| 610 | 610 | $this->task->timespent_note = $note; |
| 611 | 611 | if (!empty($this->task->progress)) |
| 612 | - $this->task->progress = $progress; |
|
| 612 | + $this->task->progress = $progress; |
|
| 613 | 613 | |
| 614 | 614 | $result = $this->task->addTimeSpent(DolibarrApiAccess::$user, 0); |
| 615 | 615 | if ($result == 0) { |
@@ -608,8 +608,9 @@ |
||
| 608 | 608 | $this->task->timespent_duration = $duration; |
| 609 | 609 | $this->task->timespent_fk_user = $uid; |
| 610 | 610 | $this->task->timespent_note = $note; |
| 611 | - if (!empty($this->task->progress)) |
|
| 612 | - $this->task->progress = $progress; |
|
| 611 | + if (!empty($this->task->progress)) { |
|
| 612 | + $this->task->progress = $progress; |
|
| 613 | + } |
|
| 613 | 614 | |
| 614 | 615 | $result = $this->task->addTimeSpent(DolibarrApiAccess::$user, 0); |
| 615 | 616 | if ($result == 0) { |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | //@ini_set('memory_limit', '128M'); // This may be useless if memory is hard limited by your PHP |
| 43 | 43 | |
| 44 | 44 | // For optional tuning. Enabled if environment variable MAIN_SHOW_TUNING_INFO is defined. |
| 45 | -$micro_start_time = 0; // Used as global var into printCommonFooter() |
|
| 45 | +$micro_start_time = 0; // Used as global var into printCommonFooter() |
|
| 46 | 46 | if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO'])) { |
| 47 | 47 | list($usec, $sec) = explode(" ", microtime()); |
| 48 | 48 | $micro_start_time = ((float) $usec + (float) $sec); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | session_set_cookie_params($sessioncookieparams); |
| 132 | 132 | } |
| 133 | 133 | session_name($sessionname); |
| 134 | - dol_session_start(); // This call the open and read of session handler |
|
| 134 | + dol_session_start(); // This call the open and read of session handler |
|
| 135 | 135 | //exit; // this exist generates a call to write and close |
| 136 | 136 | } |
| 137 | 137 | |
@@ -176,12 +176,12 @@ discard block |
||
| 176 | 176 | if (!$ok) { |
| 177 | 177 | if (session_id() && isset($_SESSION["dol_login"]) && !in_array($_SESSION["dol_login"], explode(';', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')))) { |
| 178 | 178 | print 'Sorry, your application is offline.'."\n"; |
| 179 | - print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
| 180 | - $nexturl = dolBuildUrl(DOL_URL_ROOT . '/user/logout.php', [], true); |
|
| 179 | + print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
| 180 | + $nexturl = dolBuildUrl(DOL_URL_ROOT.'/user/logout.php', [], true); |
|
| 181 | 181 | print 'Please try later or <a href="'.$nexturl.'">click here to disconnect and change login user</a>...'."\n"; |
| 182 | 182 | } else { |
| 183 | - print 'Sorry, your application is offline. Only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
| 184 | - $nexturl = dolBuildUrl(DOL_URL_ROOT . '/'); |
|
| 183 | + print 'Sorry, your application is offline. Only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
| 184 | + $nexturl = dolBuildUrl(DOL_URL_ROOT.'/'); |
|
| 185 | 185 | print 'Please try later or <a href="'.$nexturl.'">click here to change login user</a>...'."\n"; |
| 186 | 186 | } |
| 187 | 187 | exit; |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | print "Access to this page this way (POST method or GET with a sensible value for 'action' parameter) is refused by CSRF protection in main.inc.php. Token not provided.\n"; |
| 415 | 415 | print "If you access your server behind a proxy using url rewriting and the parameter is provided by caller, you might check that all HTTP header are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file or MAIN_SECURITY_CSRF_WITH_TOKEN to 0"; |
| 416 | 416 | if (getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN')) { |
| 417 | - print " instead of " . getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
| 417 | + print " instead of ".getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
| 418 | 418 | } |
| 419 | 419 | print " into setup).\n"; |
| 420 | 420 | } |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | unset($_GET['action']); |
| 443 | 443 | unset($_GET['confirmmassaction']); |
| 444 | 444 | unset($_GET['massaction']); |
| 445 | - unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
| 445 | + unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
| 446 | 446 | if (isset($savid)) { |
| 447 | 447 | $_POST['id'] = ((int) $savid); |
| 448 | 448 | } |
@@ -464,18 +464,18 @@ discard block |
||
| 464 | 464 | foreach ($disabled_modules as $module) { |
| 465 | 465 | if ($module) { |
| 466 | 466 | if (empty($conf->$module)) { |
| 467 | - $conf->$module = new stdClass(); // To avoid warnings |
|
| 467 | + $conf->$module = new stdClass(); // To avoid warnings |
|
| 468 | 468 | } |
| 469 | 469 | |
| 470 | - $conf->$module->enabled = false; // Old usage |
|
| 470 | + $conf->$module->enabled = false; // Old usage |
|
| 471 | 471 | unset($conf->modules[$module]); |
| 472 | 472 | |
| 473 | 473 | foreach ($modulepartkeys as $modulepartkey) { |
| 474 | 474 | unset($conf->modules_parts[$modulepartkey][$module]); |
| 475 | 475 | } |
| 476 | 476 | if ($module == 'fournisseur') { // Special case |
| 477 | - $conf->supplier_order->enabled = 0; // Old usage |
|
| 478 | - $conf->supplier_invoice->enabled = 0; // Old usage |
|
| 477 | + $conf->supplier_order->enabled = 0; // Old usage |
|
| 478 | + $conf->supplier_invoice->enabled = 0; // Old usage |
|
| 479 | 479 | unset($conf->modules['supplier_order']); |
| 480 | 480 | unset($conf->modules['supplier_invoice']); |
| 481 | 481 | } |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | if ($dol_use_jmobile) { |
| 573 | 573 | $query += ['dol_use_jmobile='.$dol_use_jmobile]; |
| 574 | 574 | } |
| 575 | - header("Location: " . dolBuildUrl(DOL_URL_ROOT . '/public/demo/index.php', $query)); |
|
| 575 | + header("Location: ".dolBuildUrl(DOL_URL_ROOT.'/public/demo/index.php', $query)); |
|
| 576 | 576 | exit; |
| 577 | 577 | } |
| 578 | 578 | } |
@@ -620,12 +620,12 @@ discard block |
||
| 620 | 620 | if (is_object($captchaobj) && method_exists($captchaobj, 'validateCodeAfterLoginSubmit')) { |
| 621 | 621 | $ok = $captchaobj->validateCodeAfterLoginSubmit(); // @phan-suppress-current-line PhanUndeclaredMethod |
| 622 | 622 | } else { |
| 623 | - $_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()'; |
|
| 623 | + $_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()'; |
|
| 624 | 624 | $test = false; |
| 625 | 625 | $error++; |
| 626 | 626 | } |
| 627 | 627 | } else { |
| 628 | - $_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include'; |
|
| 628 | + $_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include'; |
|
| 629 | 629 | $test = false; |
| 630 | 630 | $error++; |
| 631 | 631 | } |
@@ -669,7 +669,7 @@ discard block |
||
| 669 | 669 | |
| 670 | 670 | $allowedmethodtopostusername = 3; |
| 671 | 671 | if (defined('MAIN_AUTHENTICATION_POST_METHOD')) { |
| 672 | - $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
| 672 | + $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
| 673 | 673 | } |
| 674 | 674 | // TODO Remove use of $_COOKIE['login_dolibarr'] by replacing line with $usertotest = GETPOST("username", "alpha", $allowedmethodtopostusername); ? |
| 675 | 675 | $usertotest = (!empty($_COOKIE['login_dolibarr']) ? preg_replace('/[^a-zA-Z0-9_@\-\.]/', '', $_COOKIE['login_dolibarr']) : GETPOST("username", "alpha", $allowedmethodtopostusername)); |
@@ -818,7 +818,7 @@ discard block |
||
| 818 | 818 | } |
| 819 | 819 | |
| 820 | 820 | // Show login form |
| 821 | - dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
| 821 | + dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
| 822 | 822 | } |
| 823 | 823 | exit; |
| 824 | 824 | } |
@@ -879,7 +879,7 @@ discard block |
||
| 879 | 879 | if (GETPOST('lang', 'aZ09')) { |
| 880 | 880 | $paramsurl += ['lang' => (string) GETPOST('lang', 'aZ09')]; |
| 881 | 881 | } |
| 882 | - header('Location: '.dolBuildUrl(DOL_URL_ROOT . '/index.php', $paramsurl)); |
|
| 882 | + header('Location: '.dolBuildUrl(DOL_URL_ROOT.'/index.php', $paramsurl)); |
|
| 883 | 883 | exit; |
| 884 | 884 | } else { |
| 885 | 885 | // User is loaded, we may need to change language for him according to its choice |
@@ -1177,7 +1177,7 @@ discard block |
||
| 1177 | 1177 | } else { |
| 1178 | 1178 | // We may have NOLOGIN set, but NOREQUIREUSER not |
| 1179 | 1179 | if (!empty($user) && method_exists($user, 'loadDefaultValues') && !defined('NODEFAULTVALUES')) { |
| 1180 | - $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
| 1180 | + $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
| 1181 | 1181 | } |
| 1182 | 1182 | } |
| 1183 | 1183 | |
@@ -1240,7 +1240,7 @@ discard block |
||
| 1240 | 1240 | $conf->dol_optimize_smallscreen = 1; |
| 1241 | 1241 | |
| 1242 | 1242 | if (getDolGlobalInt('PRODUIT_DESC_IN_FORM') == 1) { |
| 1243 | - $conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0; // This was set to PRODUIT_DESC_IN_FORM and is forced to 0 if smartphone in this case |
|
| 1243 | + $conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0; // This was set to PRODUIT_DESC_IN_FORM and is forced to 0 if smartphone in this case |
|
| 1244 | 1244 | } |
| 1245 | 1245 | } |
| 1246 | 1246 | // Replace themes bugged with jmobile with eldy |
@@ -1328,7 +1328,7 @@ discard block |
||
| 1328 | 1328 | define('ROWS_9', 8); |
| 1329 | 1329 | } |
| 1330 | 1330 | |
| 1331 | -$heightforframes = 52; // Used by frames.php page |
|
| 1331 | +$heightforframes = 52; // Used by frames.php page |
|
| 1332 | 1332 | |
| 1333 | 1333 | // Init menu manager |
| 1334 | 1334 | if (!defined('NOREQUIREMENU')) { |
@@ -1368,7 +1368,7 @@ discard block |
||
| 1368 | 1368 | |
| 1369 | 1369 | if (!empty(GETPOST('seteventmessages', 'alpha'))) { |
| 1370 | 1370 | $message = GETPOST('seteventmessages', 'alpha'); |
| 1371 | - $messages = explode(',', $message); |
|
| 1371 | + $messages = explode(',', $message); |
|
| 1372 | 1372 | foreach ($messages as $key => $msg) { |
| 1373 | 1373 | $tmp = explode(':', $msg); |
| 1374 | 1374 | setEventMessages($tmp[0], null, !empty($tmp[1]) ? $tmp[1] : 'mesgs'); |
@@ -1707,7 +1707,7 @@ discard block |
||
| 1707 | 1707 | } |
| 1708 | 1708 | |
| 1709 | 1709 | if (getDolGlobalString('THEME_ELDY_TOPMENU_BACK1')) { |
| 1710 | - print '<meta name="theme-color" content="rgb(' . getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n"; |
|
| 1710 | + print '<meta name="theme-color" content="rgb('.getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n"; |
|
| 1711 | 1711 | } |
| 1712 | 1712 | |
| 1713 | 1713 | // Auto refresh page |
@@ -1756,7 +1756,7 @@ discard block |
||
| 1756 | 1756 | |
| 1757 | 1757 | $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').(empty($user->id) ? '' : ('&userid='.$user->id)).'&entity='.$conf->entity; |
| 1758 | 1758 | |
| 1759 | - $themeparam .= '&' .$ext . '&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV"); |
|
| 1759 | + $themeparam .= '&'.$ext.'&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV"); |
|
| 1760 | 1760 | if (GETPOSTISSET('dol_hide_topmenu')) { |
| 1761 | 1761 | $themeparam .= '&dol_hide_topmenu='.GETPOSTINT('dol_hide_topmenu'); |
| 1762 | 1762 | } |
@@ -1796,24 +1796,24 @@ discard block |
||
| 1796 | 1796 | $jquerytheme = getDolGlobalString('MAIN_USE_JQUERY_THEME'); |
| 1797 | 1797 | } |
| 1798 | 1798 | if (constant('JS_JQUERY_UI')) { |
| 1799 | - print '<link rel="stylesheet" type="text/css" href="' . JS_JQUERY_UI . 'css/' . $jquerytheme . '/jquery-ui.min.css?' . $ext . '">' . "\n"; // Forced JQuery |
|
| 1799 | + print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css?'.$ext.'">'."\n"; // Forced JQuery |
|
| 1800 | 1800 | } else { |
| 1801 | - print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/css/' . $jquerytheme . '/jquery-ui.css?' . $ext . '">' . "\n"; // JQuery |
|
| 1801 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui.css?'.$ext.'">'."\n"; // JQuery |
|
| 1802 | 1802 | } |
| 1803 | 1803 | } |
| 1804 | 1804 | if (!defined('DISABLE_JQUERY_JNOTIFY')) { |
| 1805 | - print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css?' . $ext . '">'."\n"; // JNotify |
|
| 1805 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css?'.$ext.'">'."\n"; // JNotify |
|
| 1806 | 1806 | } |
| 1807 | 1807 | if (!defined('DISABLE_SELECT2') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) { // jQuery plugin "mutiselect", "multiple-select", "select2"... |
| 1808 | 1808 | $tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT'); |
| 1809 | - print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/css/'.$tmpplugin.'.css?' . $ext . '">'."\n"; |
|
| 1809 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/css/'.$tmpplugin.'.css?'.$ext.'">'."\n"; |
|
| 1810 | 1810 | } |
| 1811 | 1811 | } |
| 1812 | 1812 | |
| 1813 | 1813 | if (!defined('DISABLE_FONT_AWSOME')) { |
| 1814 | 1814 | print '<!-- Includes CSS for font awesome -->'."\n"; |
| 1815 | 1815 | $fontawesome_directory = getDolGlobalString('MAIN_FONTAWESOME_DIRECTORY', '/theme/common/fontawesome-5'); |
| 1816 | - print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.$fontawesome_directory.'/css/all.min.css?' . $ext . '">'."\n"; |
|
| 1816 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.$fontawesome_directory.'/css/all.min.css?'.$ext.'">'."\n"; |
|
| 1817 | 1817 | } |
| 1818 | 1818 | |
| 1819 | 1819 | // Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php' |
@@ -1831,7 +1831,7 @@ discard block |
||
| 1831 | 1831 | |
| 1832 | 1832 | if (!defined('DISABLE_CSS_DEFAULT_THEME')) { |
| 1833 | 1833 | print '<!-- Includes CSS for Dolibarr theme -->'."\n"; |
| 1834 | - print '<link rel="stylesheet" type="text/css" href="' . $themepath . $themeparam . '">' . "\n"; |
|
| 1834 | + print '<link rel="stylesheet" type="text/css" href="'.$themepath.$themeparam.'">'."\n"; |
|
| 1835 | 1835 | } |
| 1836 | 1836 | |
| 1837 | 1837 | // To fix old chrome bug |
@@ -1843,8 +1843,8 @@ discard block |
||
| 1843 | 1843 | |
| 1844 | 1844 | // LEAFLET AND GEOMAN |
| 1845 | 1845 | if (getDolGlobalString('MAIN_USE_GEOPHP')) { |
| 1846 | - print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/leaflet/leaflet.css?' . $ext . "\">\n"; |
|
| 1847 | - print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/leaflet/leaflet-geoman.css?' . $ext . "\">\n"; |
|
| 1846 | + print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/leaflet/leaflet.css?'.$ext."\">\n"; |
|
| 1847 | + print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/leaflet/leaflet-geoman.css?'.$ext."\">\n"; |
|
| 1848 | 1848 | } |
| 1849 | 1849 | |
| 1850 | 1850 | // CSS forced by modules (relative url starting with /) |
@@ -1891,7 +1891,7 @@ discard block |
||
| 1891 | 1891 | // Custom CSS |
| 1892 | 1892 | if (getDolGlobalString('MAIN_IHM_CUSTOM_CSS')) { |
| 1893 | 1893 | // If a custom CSS was set, we add link to the custom css php file |
| 1894 | - print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/custom.css.php?' . $ext . '&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV").'">'."\n"; |
|
| 1894 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/custom.css.php?'.$ext.'&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV").'">'."\n"; |
|
| 1895 | 1895 | } |
| 1896 | 1896 | |
| 1897 | 1897 | // Output standard javascript links |
@@ -1899,36 +1899,36 @@ discard block |
||
| 1899 | 1899 | // JQuery. Must be before other includes |
| 1900 | 1900 | print '<!-- Includes JS for JQuery -->'."\n"; |
| 1901 | 1901 | if (defined('JS_JQUERY') && constant('JS_JQUERY')) { |
| 1902 | - print '<script nonce="'.getNonce().'" src="'.JS_JQUERY.'jquery.min.js?' . $ext . '"></script>'."\n"; |
|
| 1902 | + print '<script nonce="'.getNonce().'" src="'.JS_JQUERY.'jquery.min.js?'.$ext.'"></script>'."\n"; |
|
| 1903 | 1903 | } else { |
| 1904 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery.min.js?' . $ext . '"></script>'."\n"; |
|
| 1904 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery.min.js?'.$ext.'"></script>'."\n"; |
|
| 1905 | 1905 | } |
| 1906 | 1906 | if (!defined('DISABLE_JQUERY_UI')) { |
| 1907 | 1907 | if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) { |
| 1908 | - print '<script nonce="' . getNonce() . '" src="' . JS_JQUERY_UI . 'jquery-ui.min.js?' . $ext . '"></script>' . "\n"; |
|
| 1908 | + print '<script nonce="'.getNonce().'" src="'.JS_JQUERY_UI.'jquery-ui.min.js?'.$ext.'"></script>'."\n"; |
|
| 1909 | 1909 | } else { |
| 1910 | - print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/includes/jquery/js/jquery-ui.min.js?' . $ext . '"></script>' . "\n"; |
|
| 1910 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui.min.js?'.$ext.'"></script>'."\n"; |
|
| 1911 | 1911 | } |
| 1912 | 1912 | } |
| 1913 | 1913 | // jQuery jnotify |
| 1914 | 1914 | if (!getDolGlobalString('MAIN_DISABLE_JQUERY_JNOTIFY') && !defined('DISABLE_JQUERY_JNOTIFY')) { |
| 1915 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js?' . $ext . '"></script>'."\n"; |
|
| 1915 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js?'.$ext.'"></script>'."\n"; |
|
| 1916 | 1916 | } |
| 1917 | 1917 | // Table drag and drop lines |
| 1918 | 1918 | if (empty($disableforlogin) && !defined('DISABLE_JQUERY_TABLEDND')) { |
| 1919 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd.min.js?' . $ext . '"></script>'."\n"; |
|
| 1919 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd.min.js?'.$ext.'"></script>'."\n"; |
|
| 1920 | 1920 | } |
| 1921 | 1921 | // Chart |
| 1922 | 1922 | if (empty($disableforlogin) && (!getDolGlobalString('MAIN_JS_GRAPH') || getDolGlobalString('MAIN_JS_GRAPH') == 'chart') && !defined('DISABLE_JS_GRAPH')) { |
| 1923 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/nnnick/chartjs/dist/chart.min.js?' . $ext . '"></script>'."\n"; |
|
| 1923 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/nnnick/chartjs/dist/chart.min.js?'.$ext.'"></script>'."\n"; |
|
| 1924 | 1924 | } |
| 1925 | 1925 | |
| 1926 | 1926 | // jQuery jeditable for Edit In Place features |
| 1927 | 1927 | if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !defined('DISABLE_JQUERY_JEDITABLE')) { |
| 1928 | 1928 | print '<!-- JS to manage editInPlace feature -->'."\n"; |
| 1929 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.js?' . $ext . '"></script>'."\n"; |
|
| 1930 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js?' . $ext . '"></script>'."\n"; |
|
| 1931 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-autocomplete.js?' . $ext . '"></script>'."\n"; |
|
| 1929 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.js?'.$ext.'"></script>'."\n"; |
|
| 1930 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js?'.$ext.'"></script>'."\n"; |
|
| 1931 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-autocomplete.js?'.$ext.'"></script>'."\n"; |
|
| 1932 | 1932 | print '<script>'."\n"; |
| 1933 | 1933 | print 'var urlSaveInPlace = \''.DOL_URL_ROOT.'/core/ajax/saveinplace.php\';'."\n"; |
| 1934 | 1934 | print 'var urlLoadInPlace = \''.DOL_URL_ROOT.'/core/ajax/loadinplace.php\';'."\n"; |
@@ -1939,16 +1939,16 @@ discard block |
||
| 1939 | 1939 | print 'var indicatorInPlace = \'<img src="'.DOL_URL_ROOT."/theme/".$conf->theme."/img/working.gif".'">\';'."\n"; |
| 1940 | 1940 | print 'var withInPlace = 300;'; // width in pixel for default string edit |
| 1941 | 1941 | print '</script>'."\n"; |
| 1942 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/editinplace.js?' . $ext . '"></script>'."\n"; |
|
| 1943 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js?' . $ext . '"></script>'."\n"; |
|
| 1942 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/editinplace.js?'.$ext.'"></script>'."\n"; |
|
| 1943 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js?'.$ext.'"></script>'."\n"; |
|
| 1944 | 1944 | } |
| 1945 | 1945 | if (!defined('DISABLE_SELECT2') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) { |
| 1946 | 1946 | // jQuery plugin "mutiselect", "multiple-select", "select2", ... |
| 1947 | 1947 | $tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT'); |
| 1948 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/js/'.$tmpplugin.'.full.min.js?' . $ext . '"></script>'."\n"; // We include full because we need the support of containerCssClass |
|
| 1948 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/js/'.$tmpplugin.'.full.min.js?'.$ext.'"></script>'."\n"; // We include full because we need the support of containerCssClass |
|
| 1949 | 1949 | } |
| 1950 | 1950 | if (!defined('DISABLE_MULTISELECT')) { // jQuery plugin "mutiselect" to select with checkboxes. Can be removed once we have an enhanced search tool |
| 1951 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiselect/jquery.multi-select.js?' . $ext . '"></script>'."\n"; |
|
| 1951 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiselect/jquery.multi-select.js?'.$ext.'"></script>'."\n"; |
|
| 1952 | 1952 | } |
| 1953 | 1953 | } |
| 1954 | 1954 | |
@@ -1965,11 +1965,11 @@ discard block |
||
| 1965 | 1965 | print '<script nonce="'.getNonce().'">'; |
| 1966 | 1966 | print '/* enable ckeditor by main.inc.php */'; |
| 1967 | 1967 | print 'var CKEDITOR_BASEPATH = \''.dol_escape_js($pathckeditor).'\';'."\n"; |
| 1968 | - print 'var ckeditorConfig = \''.dol_escape_js(dol_buildpath($themesubdir.'/theme/'.$conf->theme.'/ckeditor/config.js?' . $ext, 1)).'\';'."\n"; // $themesubdir='' in standard usage |
|
| 1968 | + print 'var ckeditorConfig = \''.dol_escape_js(dol_buildpath($themesubdir.'/theme/'.$conf->theme.'/ckeditor/config.js?'.$ext, 1)).'\';'."\n"; // $themesubdir='' in standard usage |
|
| 1969 | 1969 | print 'var ckeditorFilebrowserBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n"; |
| 1970 | 1970 | print 'var ckeditorFilebrowserImageBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Type=Image&Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n"; |
| 1971 | 1971 | print '</script>'."\n"; |
| 1972 | - print '<script src="'.$pathckeditor.$jsckeditor. '?' . $ext . '"></script>'."\n"; |
|
| 1972 | + print '<script src="'.$pathckeditor.$jsckeditor.'?'.$ext.'"></script>'."\n"; |
|
| 1973 | 1973 | print '<script>'; |
| 1974 | 1974 | if (GETPOST('mode', 'aZ09') == 'Full_inline') { |
| 1975 | 1975 | print 'CKEDITOR.disableAutoInline = false;'."\n"; |
@@ -1990,20 +1990,20 @@ discard block |
||
| 1990 | 1990 | } |
| 1991 | 1991 | if ($enablebrowsernotif) { |
| 1992 | 1992 | print '<!-- Includes JS of Dolibarr (browser layout = '.$conf->browser->layout.')-->'."\n"; |
| 1993 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_notification.js.php?lang='.$langs->defaultlang. '&' . $ext . '"></script>'."\n"; |
|
| 1993 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_notification.js.php?lang='.$langs->defaultlang.'&'.$ext.'"></script>'."\n"; |
|
| 1994 | 1994 | } |
| 1995 | 1995 | } |
| 1996 | 1996 | |
| 1997 | 1997 | // Global js function |
| 1998 | 1998 | print '<!-- Includes JS of Dolibarr -->'."\n"; |
| 1999 | 1999 | if (!defined('DISABLE_LIB_HEAD_JS')) { |
| 2000 | - print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/core/js/lib_head.js.php?lang=' . $langs->defaultlang . '&' . $ext . '"></script>' . "\n"; |
|
| 2000 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php?lang='.$langs->defaultlang.'&'.$ext.'"></script>'."\n"; |
|
| 2001 | 2001 | } |
| 2002 | 2002 | |
| 2003 | 2003 | // Leaflet |
| 2004 | 2004 | if (getDolGlobalString('MAIN_USE_GEOPHP')) { |
| 2005 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/leaflet/leaflet.js?' . $ext . '"></script>'."\n"; |
|
| 2006 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/leaflet/leaflet-geoman.min.js?' . $ext . '"></script>'."\n"; |
|
| 2005 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/leaflet/leaflet.js?'.$ext.'"></script>'."\n"; |
|
| 2006 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/leaflet/leaflet-geoman.min.js?'.$ext.'"></script>'."\n"; |
|
| 2007 | 2007 | } |
| 2008 | 2008 | |
| 2009 | 2009 | // JS forced by modules (relative url starting with /) |
@@ -2040,7 +2040,7 @@ discard block |
||
| 2040 | 2040 | if (getDolGlobalString('ALLOW_THEME_JS')) { |
| 2041 | 2041 | $theme_js = dol_buildpath('/theme/'.$conf->theme.'/'.$conf->theme.'.js', 0); |
| 2042 | 2042 | if (file_exists($theme_js)) { |
| 2043 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/'.$conf->theme.'.js?' . $ext . '"></script>'."\n"; |
|
| 2043 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/'.$conf->theme.'.js?'.$ext.'"></script>'."\n"; |
|
| 2044 | 2044 | } |
| 2045 | 2045 | } |
| 2046 | 2046 | |
@@ -2048,7 +2048,7 @@ discard block |
||
| 2048 | 2048 | print $head."\n"; |
| 2049 | 2049 | } |
| 2050 | 2050 | if (getDolGlobalString('MAIN_HTML_HEADER')) { |
| 2051 | - print getDolGlobalString('MAIN_HTML_HEADER') . "\n"; |
|
| 2051 | + print getDolGlobalString('MAIN_HTML_HEADER')."\n"; |
|
| 2052 | 2052 | } |
| 2053 | 2053 | |
| 2054 | 2054 | $parameters = array(); |
@@ -2176,7 +2176,7 @@ discard block |
||
| 2176 | 2176 | |
| 2177 | 2177 | $toprightmenu .= '</div>'; |
| 2178 | 2178 | |
| 2179 | - $toprightmenu .= '</div>'."\n"; // end div class="login_block_tools" |
|
| 2179 | + $toprightmenu .= '</div>'."\n"; // end div class="login_block_tools" |
|
| 2180 | 2180 | |
| 2181 | 2181 | |
| 2182 | 2182 | // Add block for other tools |
@@ -2197,7 +2197,7 @@ discard block |
||
| 2197 | 2197 | |
| 2198 | 2198 | // Link to module builder |
| 2199 | 2199 | if (isModEnabled('modulebuilder')) { |
| 2200 | - $text = '<a href="' . dolBuildUrl(DOL_URL_ROOT . '/modulebuilder/index.php', ['mainmenu' => 'home', 'leftmenu' => 'admintools']) .'" target="modulebuilder">'; |
|
| 2200 | + $text = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/modulebuilder/index.php', ['mainmenu' => 'home', 'leftmenu' => 'admintools']).'" target="modulebuilder">'; |
|
| 2201 | 2201 | //$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"'); |
| 2202 | 2202 | $text .= '<span class="fa fa-bug atoplogin valignmiddle"></span>'; |
| 2203 | 2203 | $text .= '</a>'; |
@@ -2477,7 +2477,7 @@ discard block |
||
| 2477 | 2477 | } |
| 2478 | 2478 | |
| 2479 | 2479 | if (empty($urllogout)) { |
| 2480 | - $urllogout = dolBuildUrl(DOL_URL_ROOT . '/user/logout.php', [], true); |
|
| 2480 | + $urllogout = dolBuildUrl(DOL_URL_ROOT.'/user/logout.php', [], true); |
|
| 2481 | 2481 | } |
| 2482 | 2482 | |
| 2483 | 2483 | // Defined the links for bottom of card |
@@ -2886,7 +2886,7 @@ discard block |
||
| 2886 | 2886 | $langs->load(explode('@', $item['name'])[1]); |
| 2887 | 2887 | $dropDownQuickAddHtml .= ' |
| 2888 | 2888 | <a class="dropdown-item quickadd-item" href="'.DOL_URL_ROOT.$item['url'].'" title="'.$langs->trans(explode('@', $item['title'])[0]).'"> |
| 2889 | - '. img_picto('', $item['picto'], 'style="width:18px;"') . ' ' . $langs->trans(explode('@', $item['name'])[0]) . '</a> |
|
| 2889 | + '. img_picto('', $item['picto'], 'style="width:18px;"').' '.$langs->trans(explode('@', $item['name'])[0]).'</a> |
|
| 2890 | 2890 | '; |
| 2891 | 2891 | } |
| 2892 | 2892 | |
@@ -2991,7 +2991,7 @@ discard block |
||
| 2991 | 2991 | */ |
| 2992 | 2992 | function top_menu_search() |
| 2993 | 2993 | { |
| 2994 | - global $langs, $conf, $db, $user, $hookmanager; // used by htdocs/core/ajax/selectsearchbox.php |
|
| 2994 | + global $langs, $conf, $db, $user, $hookmanager; // used by htdocs/core/ajax/selectsearchbox.php |
|
| 2995 | 2995 | |
| 2996 | 2996 | $html = ''; |
| 2997 | 2997 | |
@@ -3679,7 +3679,7 @@ discard block |
||
| 3679 | 3679 | |
| 3680 | 3680 | if (!empty($conf->use_javascript_ajax)) { |
| 3681 | 3681 | print "\n".'<!-- Includes JS Footer of Dolibarr -->'."\n"; |
| 3682 | - print '<script src="'.DOL_URL_ROOT.'/core/js/lib_foot.js.php?lang='.$langs->defaultlang . '&' . $ext .'"></script>'."\n"; |
|
| 3682 | + print '<script src="'.DOL_URL_ROOT.'/core/js/lib_foot.js.php?lang='.$langs->defaultlang.'&'.$ext.'"></script>'."\n"; |
|
| 3683 | 3683 | } |
| 3684 | 3684 | |
| 3685 | 3685 | // JS wrapper to add log when clicking on download or preview |
@@ -3731,7 +3731,7 @@ discard block |
||
| 3731 | 3731 | $forceping = GETPOST('forceping', 'alpha'); |
| 3732 | 3732 | if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || $forceping) { |
| 3733 | 3733 | //print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.getDolGlobalString('MAIN_FIRST_PING_OK_ID').' -->'; |
| 3734 | - $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
| 3734 | + $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
| 3735 | 3735 | |
| 3736 | 3736 | if (!getDolGlobalString('MAIN_FIRST_PING_OK_DATE') |
| 3737 | 3737 | || (!empty($conf->file->instance_unique_id) && ($hash_unique_id != getDolGlobalString('MAIN_FIRST_PING_OK_ID')) && (getDolGlobalString('MAIN_FIRST_PING_OK_ID') != 'disabled')) |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | $newtimeyear = (int) dol_print_date($newtime, '%Y'); |
| 191 | 191 | $newtimemonth = (int) dol_print_date($newtime, '%m'); |
| 192 | - $newtimetotalmonths = (($newtimeyear * 12) + $newtimemonth); |
|
| 192 | + $newtimetotalmonths = (($newtimeyear * 12) + $newtimemonth); |
|
| 193 | 193 | |
| 194 | 194 | if ($monthsexpected < $newtimetotalmonths) { |
| 195 | 195 | $newtimehours = (int) dol_print_date($newtime, '%H'); |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | $sql = "SELECT id, code, entity, fk_country, dayrule, year, month, day, active"; |
| 807 | 807 | $sql .= " FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday"; |
| 808 | 808 | $sql .= " WHERE active = 1 and fk_country IN (0".($country_id > 0 ? ", ".$country_id : 0).")"; |
| 809 | - $sql .= " AND entity IN (0," .getEntity('holiday') .")"; |
|
| 809 | + $sql .= " AND entity IN (0,".getEntity('holiday').")"; |
|
| 810 | 810 | |
| 811 | 811 | $resql = $db->query($sql); |
| 812 | 812 | if ($resql) { |
@@ -837,7 +837,7 @@ discard block |
||
| 837 | 837 | $jour = (int) gmdate("d", $timestampStart); |
| 838 | 838 | $mois = (int) gmdate("m", $timestampStart); |
| 839 | 839 | $annee = (int) gmdate("Y", $timestampStart); |
| 840 | - $jour_semaine = (int) gmdate("w", $timestampStart); // sunday = 0, monday = 1, ... |
|
| 840 | + $jour_semaine = (int) gmdate("w", $timestampStart); // sunday = 0, monday = 1, ... |
|
| 841 | 841 | |
| 842 | 842 | //print "jour=".$jour." month=".$mois." year=".$annee." includesaturday=".$includesaturday." includesunday=".$includesunday."\n"; |
| 843 | 843 | foreach ($arrayOfPublicHolidays as $entrypublicholiday) { |
@@ -1063,13 +1063,13 @@ discard block |
||
| 1063 | 1063 | $country_id = dol_getIdFromCode($db, $countryCodeOrId, 'c_country', 'code', 'rowid'); |
| 1064 | 1064 | } |
| 1065 | 1065 | |
| 1066 | - if (empty($conf->cache['arrayOfActivePublicHolidays_' . $country_id])) { |
|
| 1066 | + if (empty($conf->cache['arrayOfActivePublicHolidays_'.$country_id])) { |
|
| 1067 | 1067 | // Loop on public holiday defined into hrm_public_holiday for the day, month and year analyzed |
| 1068 | 1068 | $tmpArrayOfPublicHolidays = array(); |
| 1069 | 1069 | $sql = "SELECT id, code, entity, fk_country, dayrule, year, month, day, active"; |
| 1070 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_hrm_public_holiday"; |
|
| 1071 | - $sql .= " WHERE active = 1 and fk_country IN (0" . ($country_id > 0 ? ", " . $country_id : 0) . ")"; |
|
| 1072 | - $sql .= " AND entity IN (0," . getEntity('holiday') . ")"; |
|
| 1070 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday"; |
|
| 1071 | + $sql .= " WHERE active = 1 and fk_country IN (0".($country_id > 0 ? ", ".$country_id : 0).")"; |
|
| 1072 | + $sql .= " AND entity IN (0,".getEntity('holiday').")"; |
|
| 1073 | 1073 | |
| 1074 | 1074 | $resql = $db->query($sql); |
| 1075 | 1075 | if ($resql) { |
@@ -1082,14 +1082,14 @@ discard block |
||
| 1082 | 1082 | } |
| 1083 | 1083 | } else { |
| 1084 | 1084 | dol_syslog($db->lasterror(), LOG_ERR); |
| 1085 | - return 'Error sql ' . $db->lasterror(); |
|
| 1085 | + return 'Error sql '.$db->lasterror(); |
|
| 1086 | 1086 | } |
| 1087 | 1087 | |
| 1088 | 1088 | //var_dump($tmpArrayOfPublicHolidays); |
| 1089 | - $conf->cache['arrayOfActivePublicHolidays_' . $country_id] = $tmpArrayOfPublicHolidays; |
|
| 1089 | + $conf->cache['arrayOfActivePublicHolidays_'.$country_id] = $tmpArrayOfPublicHolidays; |
|
| 1090 | 1090 | } |
| 1091 | 1091 | |
| 1092 | - $arrayOfPublicHolidays = $conf->cache['arrayOfActivePublicHolidays_' . $country_id]; |
|
| 1092 | + $arrayOfPublicHolidays = $conf->cache['arrayOfActivePublicHolidays_'.$country_id]; |
|
| 1093 | 1093 | $listFeries = []; |
| 1094 | 1094 | $i = 0; |
| 1095 | 1095 | while ((($lastday == 0 && $timestampStart < $timestampEnd) || ($lastday && $timestampStart <= $timestampEnd)) |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $propalstatic); // Note that $action and $object may have been modified by hook |
| 99 | 99 | if (empty($reshook)) { |
| 100 | 100 | if ($user->socid) { |
| 101 | - $sql .= " AND s.rowid = " . ((int) $user->socid); |
|
| 101 | + $sql .= " AND s.rowid = ".((int) $user->socid); |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | $sql .= $hookmanager->resPrint; |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $commandestatic); // Note that $action and $object may have been modified by hook |
| 114 | 114 | if (empty($reshook)) { |
| 115 | 115 | if ($user->socid) { |
| 116 | - $sql .= " AND s.rowid = " . ((int) $user->socid); |
|
| 116 | + $sql .= " AND s.rowid = ".((int) $user->socid); |
|
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | $sql .= $hookmanager->resPrint; |
@@ -440,19 +440,19 @@ discard block |
||
| 440 | 440 | |
| 441 | 441 | // Show message if accountancy hidden options are activated to help to resolve some problems |
| 442 | 442 | if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) { |
| 443 | - print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>'; |
|
| 443 | + print '<div class="info">'.$langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS").'</div>'; |
|
| 444 | 444 | } |
| 445 | 445 | if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) { |
| 446 | - print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>'; |
|
| 446 | + print '<div class="info">'.$langs->trans("ConstantIsOn", "FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS").'</div>'; |
|
| 447 | 447 | } |
| 448 | 448 | if (getDolGlobalString('ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY')) { |
| 449 | - print '<div class="info">' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '</div>'; |
|
| 449 | + print '<div class="info">'.$langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY").'</div>'; |
|
| 450 | 450 | } |
| 451 | 451 | if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
| 452 | - print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED") . '</div>'; |
|
| 452 | + print '<div class="info">'.$langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED").'</div>'; |
|
| 453 | 453 | } |
| 454 | 454 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 455 | - print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED") . '</div>'; |
|
| 455 | + print '<div class="info">'.$langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED").'</div>'; |
|
| 456 | 456 | } |
| 457 | 457 | |
| 458 | 458 | print '<br>'; |
@@ -522,8 +522,8 @@ discard block |
||
| 522 | 522 | print $form->selectarray($key, $array, getDolGlobalInt('ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER', 0), 0, 0, 0, '', 0, 0, 0, '', 'onrightofpage width200'); |
| 523 | 523 | } elseif ($key == 'ACCOUNTING_LABEL_OPERATION_ON_TRANSFER') { |
| 524 | 524 | $array = array( |
| 525 | - 0=>$langs->trans("ThirdPartyName") . ' - ' . $langs->trans("NumPiece") . ' - ' . $langs->trans("LabelAccount"), |
|
| 526 | - 1=>$langs->trans("ThirdPartyName") . ' - ' . $langs->trans("NumPiece"), |
|
| 525 | + 0=>$langs->trans("ThirdPartyName").' - '.$langs->trans("NumPiece").' - '.$langs->trans("LabelAccount"), |
|
| 526 | + 1=>$langs->trans("ThirdPartyName").' - '.$langs->trans("NumPiece"), |
|
| 527 | 527 | 2=>$langs->trans("ThirdPartyName") |
| 528 | 528 | ); |
| 529 | 529 | print $form->selectarray($key, $array, getDolGlobalInt('ACCOUNTING_LABEL_OPERATION_ON_TRANSFER', 0), 0, 0, 0, '', 0, 0, 0, '', 'onrightofpage width300'); |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | print '<div class="div-table-responsive-no-min">'; |
| 764 | 764 | print '<table class="noborder centpercent">'; |
| 765 | 765 | print '<tr class="liste_titre">'; |
| 766 | -print '<td colspan="2">' . $langs->trans('OptionsAdvanced') . '</td>'; |
|
| 766 | +print '<td colspan="2">'.$langs->trans('OptionsAdvanced').'</td>'; |
|
| 767 | 767 | print "</tr>\n"; |
| 768 | 768 | |
| 769 | 769 | print '<tr class="oddeven">'; |
@@ -784,7 +784,7 @@ discard block |
||
| 784 | 784 | // Number of letters for lettering (3 by default (AAA), min 2 (AA)) |
| 785 | 785 | print '<tr class="oddeven">'; |
| 786 | 786 | print '<td>'; |
| 787 | - print $form->textwithpicto($langs->trans("ACCOUNTING_LETTERING_NBLETTERS"), $langs->trans("ACCOUNTING_LETTERING_NBLETTERS_DESC")) . '</td>'; |
|
| 787 | + print $form->textwithpicto($langs->trans("ACCOUNTING_LETTERING_NBLETTERS"), $langs->trans("ACCOUNTING_LETTERING_NBLETTERS_DESC")).'</td>'; |
|
| 788 | 788 | print '<td class="right">'; |
| 789 | 789 | |
| 790 | 790 | if (empty($letter)) { |
@@ -795,19 +795,19 @@ discard block |
||
| 795 | 795 | } |
| 796 | 796 | } |
| 797 | 797 | |
| 798 | - print '<input class="flat right" name="ACCOUNTING_LETTERING_NBLETTERS" id="ACCOUNTING_LETTERING_NBLETTERS" value="' . $nbletter . '" type="number" step="1" min="2" max="3" >' . "\n"; |
|
| 798 | + print '<input class="flat right" name="ACCOUNTING_LETTERING_NBLETTERS" id="ACCOUNTING_LETTERING_NBLETTERS" value="'.$nbletter.'" type="number" step="1" min="2" max="3" >'."\n"; |
|
| 799 | 799 | print '</tr>'; |
| 800 | 800 | |
| 801 | 801 | // Auto matching when transfer in accountancy is realized |
| 802 | 802 | print '<tr class="oddeven">'; |
| 803 | 803 | print '<td>'; |
| 804 | - print $form->textwithpicto($langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING_DESC")) . '</td>'; |
|
| 804 | + print $form->textwithpicto($langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING_DESC")).'</td>'; |
|
| 805 | 805 | if (getDolGlobalInt('ACCOUNTING_ENABLE_AUTOLETTERING')) { |
| 806 | - print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenableautolettering&value=0">'; |
|
| 806 | + print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenableautolettering&value=0">'; |
|
| 807 | 807 | print img_picto($langs->trans("Activated"), 'switch_on'); |
| 808 | 808 | print '</a></td>'; |
| 809 | 809 | } else { |
| 810 | - print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenableautolettering&value=1">'; |
|
| 810 | + print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenableautolettering&value=1">'; |
|
| 811 | 811 | print img_picto($langs->trans("Disabled"), 'switch_off'); |
| 812 | 812 | print '</a></td>'; |
| 813 | 813 | } |
@@ -818,11 +818,11 @@ discard block |
||
| 818 | 818 | print '<td>'; |
| 819 | 819 | print $form->textwithpicto($langs->trans("ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE"), $langs->trans("ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE_DESC", $langs->transnoentities("MenuDefaultAccounts"))).'</td>'; |
| 820 | 820 | if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { |
| 821 | - print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenablevatreversecharge&value=0">'; |
|
| 821 | + print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablevatreversecharge&value=0">'; |
|
| 822 | 822 | print img_picto($langs->trans("Activated"), 'switch_on'); |
| 823 | 823 | print '</a></td>'; |
| 824 | 824 | } else { |
| 825 | - print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenablevatreversecharge&value=1">'; |
|
| 825 | + print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablevatreversecharge&value=1">'; |
|
| 826 | 826 | print img_picto($langs->trans("Disabled"), 'switch_off'); |
| 827 | 827 | print '</a></td>'; |
| 828 | 828 | } |
@@ -832,11 +832,11 @@ discard block |
||
| 832 | 832 | print '<td>'; |
| 833 | 833 | print $form->textwithpicto($langs->trans("ACCOUNTING_ENABLE_TABONTHIRDPARTY"), $langs->trans("ACCOUNTING_ENABLE_TABONTHIRDPARTY_DESC")).'</td>'; |
| 834 | 834 | if (getDolGlobalString('ACCOUNTING_ENABLE_TABONTHIRDPARTY')) { |
| 835 | - print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenabletabonthirdparty&value=0">'; |
|
| 835 | + print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenabletabonthirdparty&value=0">'; |
|
| 836 | 836 | print img_picto($langs->trans("Activated"), 'switch_on'); |
| 837 | 837 | print '</a></td>'; |
| 838 | 838 | } else { |
| 839 | - print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenabletabonthirdparty&value=1">'; |
|
| 839 | + print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenabletabonthirdparty&value=1">'; |
|
| 840 | 840 | print img_picto($langs->trans("Disabled"), 'switch_off'); |
| 841 | 841 | print '</a></td>'; |
| 842 | 842 | } |
@@ -382,8 +382,8 @@ discard block |
||
| 382 | 382 | */ |
| 383 | 383 | public function export(&$TData, $formatexportset, $withAttachment = 0, $downloadMode = 1, $outputMode = 1, $noouput = 1) |
| 384 | 384 | { |
| 385 | - global $db, $conf, $langs; // The tpl file use $db |
|
| 386 | - global $search_date_end; // Used into /accountancy/tpl/export_journal.tpl.php |
|
| 385 | + global $db, $conf, $langs; // The tpl file use $db |
|
| 386 | + global $search_date_end; // Used into /accountancy/tpl/export_journal.tpl.php |
|
| 387 | 387 | |
| 388 | 388 | // Define name of file to save |
| 389 | 389 | $filename = 'general_ledger-'.$this->getFormatCode($formatexportset); |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | $exportFileFullName = $completefilename; |
| 465 | 465 | $exportFileBaseName = basename($exportFileFullName); |
| 466 | 466 | $exportFileName = pathinfo($exportFileBaseName, PATHINFO_FILENAME); |
| 467 | - $exportFilePath = $outputDir . '/' . $exportFileFullName; |
|
| 467 | + $exportFilePath = $outputDir.'/'.$exportFileFullName; |
|
| 468 | 468 | $exportFile = fopen($exportFilePath, 'w'); |
| 469 | 469 | if (!$exportFile) { |
| 470 | 470 | $this->errors[] = $langs->trans('ErrorFileNotFound', $exportFilePath); |
@@ -478,8 +478,8 @@ discard block |
||
| 478 | 478 | ); |
| 479 | 479 | |
| 480 | 480 | // archive name and path |
| 481 | - $archiveFullName = $exportFileName . '.zip'; |
|
| 482 | - $archivePath = $outputDir . '/' . $archiveFullName; |
|
| 481 | + $archiveFullName = $exportFileName.'.zip'; |
|
| 482 | + $archivePath = $outputDir.'/'.$archiveFullName; |
|
| 483 | 483 | } |
| 484 | 484 | } |
| 485 | 485 | } |
@@ -620,11 +620,11 @@ discard block |
||
| 620 | 620 | if (!empty($downloadFileMimeType) && !empty($downloadFileFullName) && !empty($downloadFilePath) && empty($noouput)) { |
| 621 | 621 | // deprecated. We must not use this anymore, but have $noouput = 1 because HTTP header must be sent |
| 622 | 622 | // into main page not into a method. |
| 623 | - header('Content-Type: ' . $downloadFileMimeType); |
|
| 624 | - header('Content-Disposition: attachment; filename=' . $downloadFileFullName); |
|
| 623 | + header('Content-Type: '.$downloadFileMimeType); |
|
| 624 | + header('Content-Disposition: attachment; filename='.$downloadFileFullName); |
|
| 625 | 625 | header('Cache-Control: Public, must-revalidate'); |
| 626 | 626 | header('Pragma: public'); |
| 627 | - header('Content-Length: ' . dol_filesize($downloadFilePath)); |
|
| 627 | + header('Content-Length: '.dol_filesize($downloadFilePath)); |
|
| 628 | 628 | |
| 629 | 629 | readfileLowMemory($downloadFilePath); |
| 630 | 630 | } |
@@ -696,14 +696,14 @@ discard block |
||
| 696 | 696 | $refInvoice = ''; |
| 697 | 697 | if ($line->doc_type == 'customer_invoice') { |
| 698 | 698 | // Customer invoice |
| 699 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
| 699 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
| 700 | 700 | $invoice = new Facture($this->db); |
| 701 | 701 | $invoice->fetch($line->fk_doc); |
| 702 | 702 | |
| 703 | 703 | $refInvoice = $invoice->ref; |
| 704 | 704 | } elseif ($line->doc_type == 'supplier_invoice') { |
| 705 | 705 | // Supplier invoice |
| 706 | - require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; |
|
| 706 | + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; |
|
| 707 | 707 | $invoice = new FactureFournisseur($this->db); |
| 708 | 708 | $invoice->fetch($line->fk_doc); |
| 709 | 709 | |
@@ -1371,9 +1371,9 @@ discard block |
||
| 1371 | 1371 | $end_line = "\n"; |
| 1372 | 1372 | |
| 1373 | 1373 | // parcours du tableau pour recuperation des numero de compte des tiers pour pouvoir les fournir dans la bonne ligne pour istea |
| 1374 | - $tiers=[]; |
|
| 1374 | + $tiers = []; |
|
| 1375 | 1375 | foreach ($objectLines as $line) { |
| 1376 | - if ( $line->subledger_account && substr($line->subledger_account, 0, 1) == '4' ) { |
|
| 1376 | + if ($line->subledger_account && substr($line->subledger_account, 0, 1) == '4') { |
|
| 1377 | 1377 | $tiers[$line->piece_num] = $line->subledger_label; |
| 1378 | 1378 | } |
| 1379 | 1379 | } |
@@ -1384,25 +1384,25 @@ discard block |
||
| 1384 | 1384 | /*** preparation du champ label operation pour istea ***/ |
| 1385 | 1385 | // retrecissement du champs car ISTEA n'affiche pas bcp de caract�re. |
| 1386 | 1386 | $search = array('Paiement fournisseur ', 'Virement ', 'Paiement '); |
| 1387 | - $replace = array('Paiemt fourn ','Virt ','Paiemt '); |
|
| 1387 | + $replace = array('Paiemt fourn ', 'Virt ', 'Paiemt '); |
|
| 1388 | 1388 | $label_operation = str_replace($search, $replace, $line->label_operation); |
| 1389 | 1389 | // encadrement par des ' si le champs contient le separateur |
| 1390 | 1390 | $label_operation = preg_match('/'.$separator.'/', $label_operation) ? "'".$label_operation."'" : $label_operation; |
| 1391 | 1391 | |
| 1392 | 1392 | $tab = array(); |
| 1393 | 1393 | // export configurable |
| 1394 | - $tab[] = $line->piece_num; // colonne 1 : numero de piece ISTEA |
|
| 1395 | - $tab[] = $date_document; // colonne 2 : date ISTEA |
|
| 1396 | - $tab[] = $line->doc_ref; // colonne 3 : reference piece ISTEA |
|
| 1397 | - $tab[] = array_key_exists($line->piece_num, $tiers)?$tiers[$line->piece_num]:''; // colonne 4 : nom tiers ISTEA |
|
| 1398 | - $tab[] = length_accountg(($line->subledger_account && ( substr($line->subledger_account, 0, 2) == substr($line->numero_compte, 0, 2) ) )?$line->subledger_account:$line->numero_compte); // colonne 5 : numero de compte ISTEA |
|
| 1399 | - $tab[] = length_accountg($line->subledger_account?$line->subledger_account:$line->numero_compte); // colonne 6 : numero de compte |
|
| 1400 | - $tab[] = length_accountg($line->subledger_account?$line->numero_compte:''); // G // colonne 7 : numero de compte principal (divers paiement ou 40100000 ou 41100000) |
|
| 1401 | - $tab[] = ($line->doc_type == 'bank')?$label_operation:($line->subledger_account?$line->subledger_label:$line->label_compte); // colonne 8 : label de l'operation ISTEA |
|
| 1402 | - $tab[] = $label_operation; // colonne 9 : label de l'operation (semble non prise en compte par ISTEA) |
|
| 1403 | - $tab[] = price2num($line->debit); // colonne 10 : debit ISTEA |
|
| 1404 | - $tab[] = price2num($line->credit); // colonne 11 : credit ISTEA |
|
| 1405 | - $tab[] = $line->code_journal; // colonne 12 : journal ISTEA |
|
| 1394 | + $tab[] = $line->piece_num; // colonne 1 : numero de piece ISTEA |
|
| 1395 | + $tab[] = $date_document; // colonne 2 : date ISTEA |
|
| 1396 | + $tab[] = $line->doc_ref; // colonne 3 : reference piece ISTEA |
|
| 1397 | + $tab[] = array_key_exists($line->piece_num, $tiers) ? $tiers[$line->piece_num] : ''; // colonne 4 : nom tiers ISTEA |
|
| 1398 | + $tab[] = length_accountg(($line->subledger_account && (substr($line->subledger_account, 0, 2) == substr($line->numero_compte, 0, 2))) ? $line->subledger_account : $line->numero_compte); // colonne 5 : numero de compte ISTEA |
|
| 1399 | + $tab[] = length_accountg($line->subledger_account ? $line->subledger_account : $line->numero_compte); // colonne 6 : numero de compte |
|
| 1400 | + $tab[] = length_accountg($line->subledger_account ? $line->numero_compte : ''); // G // colonne 7 : numero de compte principal (divers paiement ou 40100000 ou 41100000) |
|
| 1401 | + $tab[] = ($line->doc_type == 'bank') ? $label_operation : ($line->subledger_account ? $line->subledger_label : $line->label_compte); // colonne 8 : label de l'operation ISTEA |
|
| 1402 | + $tab[] = $label_operation; // colonne 9 : label de l'operation (semble non prise en compte par ISTEA) |
|
| 1403 | + $tab[] = price2num($line->debit); // colonne 10 : debit ISTEA |
|
| 1404 | + $tab[] = price2num($line->credit); // colonne 11 : credit ISTEA |
|
| 1405 | + $tab[] = $line->code_journal; // colonne 12 : journal ISTEA |
|
| 1406 | 1406 | |
| 1407 | 1407 | $output = mb_convert_encoding('"'.implode('"'.$separator.'"', $tab).'"'.$this->end_line, 'ISO-8859-1'); |
| 1408 | 1408 | if ($exportFile) { |
@@ -1581,7 +1581,7 @@ discard block |
||
| 1581 | 1581 | '@phan-var-force FactureFournisseur $invoice'; |
| 1582 | 1582 | /** @var FactureFournisseur $invoice */ |
| 1583 | 1583 | $objectDirPath = !empty($conf->fournisseur->facture->multidir_output[$conf->entity]) ? $conf->fournisseur->facture->multidir_output[$conf->entity] : $conf->fournisseur->facture->dir_output; |
| 1584 | - $objectDirPath .= '/' . rtrim(get_exdir($invoice->id, 2, 0, 0, $invoice, 'invoice_supplier'), '/'); |
|
| 1584 | + $objectDirPath .= '/'.rtrim(get_exdir($invoice->id, 2, 0, 0, $invoice, 'invoice_supplier'), '/'); |
|
| 1585 | 1585 | } |
| 1586 | 1586 | } |
| 1587 | 1587 | $arrayofinclusion = array(); |
@@ -1801,7 +1801,7 @@ discard block |
||
| 1801 | 1801 | '@phan-var-force FactureFournisseur $invoice'; |
| 1802 | 1802 | /** @var FactureFournisseur $invoice */ |
| 1803 | 1803 | $objectDirPath = !empty($conf->fournisseur->facture->multidir_output[$conf->entity]) ? $conf->fournisseur->facture->multidir_output[$conf->entity] : $conf->fournisseur->facture->dir_output; |
| 1804 | - $objectDirPath .= '/' . rtrim(get_exdir($invoice->id, 2, 0, 0, $invoice, 'invoice_supplier'), '/'); |
|
| 1804 | + $objectDirPath .= '/'.rtrim(get_exdir($invoice->id, 2, 0, 0, $invoice, 'invoice_supplier'), '/'); |
|
| 1805 | 1805 | } |
| 1806 | 1806 | } |
| 1807 | 1807 | $arrayofinclusion = array(); |
@@ -2124,7 +2124,7 @@ discard block |
||
| 2124 | 2124 | // MOPM |
| 2125 | 2125 | $tab[] = ""; |
| 2126 | 2126 | // BONP |
| 2127 | - $tab[] = ""; |
|
| 2127 | + $tab[] = ""; |
|
| 2128 | 2128 | // BQAF |
| 2129 | 2129 | $tab[] = ""; |
| 2130 | 2130 | // ECES |
@@ -2330,7 +2330,7 @@ discard block |
||
| 2330 | 2330 | } |
| 2331 | 2331 | } elseif ($line->doc_type == 'customer_invoice') { |
| 2332 | 2332 | if (($line->amount) < 0) { |
| 2333 | - $nature_piece = 'AC'; // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign. |
|
| 2333 | + $nature_piece = 'AC'; // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign. |
|
| 2334 | 2334 | } else { |
| 2335 | 2335 | $nature_piece = 'FC'; |
| 2336 | 2336 | } |
@@ -2539,8 +2539,8 @@ discard block |
||
| 2539 | 2539 | ($line->doc_type == 'supplier_invoice' && !isset($supplier_invoices_infos[$line->fk_doc]))) { |
| 2540 | 2540 | if ($line->doc_type == 'customer_invoice') { |
| 2541 | 2541 | // Get new customer invoice ref and company name |
| 2542 | - $sql = 'SELECT f.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture as f'; |
|
| 2543 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON f.fk_soc = s.rowid'; |
|
| 2542 | + $sql = 'SELECT f.ref, s.nom FROM '.MAIN_DB_PREFIX.'facture as f'; |
|
| 2543 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON f.fk_soc = s.rowid'; |
|
| 2544 | 2544 | $sql .= ' WHERE f.rowid = '.((int) $line->fk_doc); |
| 2545 | 2545 | $resql = $this->db->query($sql); |
| 2546 | 2546 | if ($resql) { |
@@ -2553,8 +2553,8 @@ discard block |
||
| 2553 | 2553 | } |
| 2554 | 2554 | } else { |
| 2555 | 2555 | // Get new supplier invoice ref and company name |
| 2556 | - $sql = 'SELECT ff.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture_fourn as ff'; |
|
| 2557 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON ff.fk_soc = s.rowid'; |
|
| 2556 | + $sql = 'SELECT ff.ref, s.nom FROM '.MAIN_DB_PREFIX.'facture_fourn as ff'; |
|
| 2557 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON ff.fk_soc = s.rowid'; |
|
| 2558 | 2558 | $sql .= ' WHERE ff.rowid = '.((int) $line->fk_doc); |
| 2559 | 2559 | $resql = $this->db->query($sql); |
| 2560 | 2560 | if ($resql) { |
@@ -2592,7 +2592,7 @@ discard block |
||
| 2592 | 2592 | $tab[] = ""; |
| 2593 | 2593 | //print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"'; |
| 2594 | 2594 | //Libellé manual |
| 2595 | - $tab[] = dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1); |
|
| 2595 | + $tab[] = dol_trunc(str_replace('"', '', $invoice_ref.(!empty($company_name) ? ' - ' : '').$company_name), 40, 'right', 'UTF-8', 1); |
|
| 2596 | 2596 | //Numéro de pièce |
| 2597 | 2597 | $tab[] = dol_trunc(str_replace('"', '', (string) $line->piece_num), 10, 'right', 'UTF-8', 1); |
| 2598 | 2598 | //Devise |
@@ -2646,8 +2646,8 @@ discard block |
||
| 2646 | 2646 | } |
| 2647 | 2647 | $tab[] = ""; |
| 2648 | 2648 | $tab[] = '"'.dol_trunc(str_replace('"', '', $line->label_operation), 40, 'right', 'UTF-8', 1).'"'; |
| 2649 | - $tab[] = '"' . dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1) . '"'; |
|
| 2650 | - $tab[] = '"' . dol_trunc(str_replace('"', '', (string) $line->piece_num), 10, 'right', 'UTF-8', 1) . '"'; |
|
| 2649 | + $tab[] = '"'.dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1).'"'; |
|
| 2650 | + $tab[] = '"'.dol_trunc(str_replace('"', '', (string) $line->piece_num), 10, 'right', 'UTF-8', 1).'"'; |
|
| 2651 | 2651 | $tab[] = price2num(abs($line->debit - $line->credit)); |
| 2652 | 2652 | $tab[] = $line->sens; |
| 2653 | 2653 | $tab[] = $date_document; |