diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php
index 0764d64b491..ec9ded557ff 100755
--- a/build/generate_filelist_xml.php
+++ b/build/generate_filelist_xml.php
@@ -34,8 +34,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
exit;
}
-require_once($path."../htdocs/master.inc.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
+require_once $path."../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
/*
diff --git a/dev/examples/code/create_invoice.php b/dev/examples/code/create_invoice.php
index bd82d38d306..e519c62a436 100755
--- a/dev/examples/code/create_invoice.php
+++ b/dev/examples/code/create_invoice.php
@@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment
-require_once($path."../../htdocs/master.inc.php");
+require_once $path."../../htdocs/master.inc.php";
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
//$langs->setDefaultLang('en_US'); // To change default language of $langs
@@ -58,7 +58,7 @@ print "***** ".$script_file." (".$version.") *****\n";
// Start of transaction
$db->begin();
-require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
+require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
// Create invoice object
$obj = new Facture($db);
diff --git a/dev/examples/code/create_order.php b/dev/examples/code/create_order.php
index 4575e9e28f3..95b047705fa 100755
--- a/dev/examples/code/create_order.php
+++ b/dev/examples/code/create_order.php
@@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment
-require_once($path."../../htdocs/master.inc.php");
+require_once $path."../../htdocs/master.inc.php";
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
//$langs->setDefaultLang('en_US'); // To change default language of $langs
@@ -59,7 +59,7 @@ print "***** ".$script_file." (".$version.") *****\n";
// Start of transaction
$db->begin();
-require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
+require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php";
// Create order object
$com = new Commande($db);
diff --git a/dev/examples/code/create_product.php b/dev/examples/code/create_product.php
index 61598ff59d9..8cbc07a1b63 100755
--- a/dev/examples/code/create_product.php
+++ b/dev/examples/code/create_product.php
@@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment
-require_once($path."../../htdocs/master.inc.php");
+require_once $path."../../htdocs/master.inc.php";
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
//$langs->setDefaultLang('en_US'); // To change default language of $langs
@@ -59,7 +59,7 @@ print "***** ".$script_file." (".$version.") *****\n";
// Start of transaction
$db->begin();
-require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
+require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
// Create instance of object
$myproduct=new Product($db);
diff --git a/dev/examples/code/create_user.php b/dev/examples/code/create_user.php
index 20173eb914a..f8e0ba23011 100755
--- a/dev/examples/code/create_user.php
+++ b/dev/examples/code/create_user.php
@@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment
-require_once($path."../../htdocs/master.inc.php");
+require_once $path."../../htdocs/master.inc.php";
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
//$langs->setDefaultLang('en_US'); // To change default language of $langs
@@ -58,7 +58,7 @@ print "***** ".$script_file." (".$version.") *****\n";
// Start of transaction
$db->begin();
-require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php");
+require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php";
// Create user object
$obj = new User($db);
diff --git a/dev/examples/code/get_contracts.php b/dev/examples/code/get_contracts.php
index fbe512300e8..daff0e43e6f 100755
--- a/dev/examples/code/get_contracts.php
+++ b/dev/examples/code/get_contracts.php
@@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment
-require_once($path."../../htdocs/master.inc.php");
+require_once $path."../../htdocs/master.inc.php";
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
//$langs->setDefaultLang('en_US'); // To change default language of $langs
@@ -65,7 +65,7 @@ print 'Argument id_thirdparty='.$argv[1]."\n";
// Start of transaction
$db->begin();
-require_once(DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php");
+require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php";
// Create contract object
$obj = new Contrat($db);
diff --git a/dev/initdata/generate-invoice.php b/dev/initdata/generate-invoice.php
index e313aa44d1f..4064336cbab 100755
--- a/dev/initdata/generate-invoice.php
+++ b/dev/initdata/generate-invoice.php
@@ -32,9 +32,9 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
//$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]);
-require (__DIR__. '/../../htdocs/master.inc.php');
-require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
-require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
+require __DIR__. '/../../htdocs/master.inc.php';
+require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
+require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
/*
diff --git a/dev/initdata/generate-order.php b/dev/initdata/generate-order.php
index c73b15b620d..5e53fa752a2 100755
--- a/dev/initdata/generate-order.php
+++ b/dev/initdata/generate-order.php
@@ -33,14 +33,14 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
//$path=preg_replace('/generate-commande.php/i','',$_SERVER["PHP_SELF"]);
-require (__DIR__. '/../../htdocs/master.inc.php');
+require __DIR__. '/../../htdocs/master.inc.php';
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
-require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
+require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php";
/*
diff --git a/dev/initdata/generate-product.php b/dev/initdata/generate-product.php
index 3ae44b00b3a..393d5c5ce3d 100755
--- a/dev/initdata/generate-product.php
+++ b/dev/initdata/generate-product.php
@@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
//$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]);
-require (__DIR__. '/../../htdocs/master.inc.php');
+require __DIR__. '/../../htdocs/master.inc.php';
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
diff --git a/dev/initdata/generate-proposal.php b/dev/initdata/generate-proposal.php
index 6f1dc293a68..631b734fc9e 100755
--- a/dev/initdata/generate-proposal.php
+++ b/dev/initdata/generate-proposal.php
@@ -33,11 +33,11 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
//$path=preg_replace('/generate-propale.php/i','',$_SERVER["PHP_SELF"]);
-require (__DIR__. '/../../htdocs/master.inc.php');
-require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
-require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php");
-require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
-require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
+require __DIR__. '/../../htdocs/master.inc.php';
+require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
+require_once DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php";
+require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php";
+require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
/*
* Parameters
@@ -157,7 +157,7 @@ $user->rights->propal->propal_advance->validate=1;
if (! empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
{
- require_once(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php");
+ require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php";
}
$i=0;
diff --git a/dev/initdata/generate-thirdparty.php b/dev/initdata/generate-thirdparty.php
index 992ab61f4ef..7f2c3e2055d 100755
--- a/dev/initdata/generate-thirdparty.php
+++ b/dev/initdata/generate-thirdparty.php
@@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
//$path=preg_replace('/generate-societe.php/i','',$_SERVER["PHP_SELF"]);
-require (__DIR__. '/../../htdocs/master.inc.php');
+require __DIR__. '/../../htdocs/master.inc.php';
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
diff --git a/dev/initdata/import-products.php b/dev/initdata/import-products.php
index a08e3b6066e..942e6f8f5d7 100755
--- a/dev/initdata/import-products.php
+++ b/dev/initdata/import-products.php
@@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
$path=preg_replace('/import-products.php/i','',$_SERVER["PHP_SELF"]);
-require ($path."../../htdocs/master.inc.php");
+require $path."../../htdocs/master.inc.php";
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
diff --git a/dev/initdata/import-thirdparties.php b/dev/initdata/import-thirdparties.php
index 0c32c7ea6a3..63c6856e5ec 100755
--- a/dev/initdata/import-thirdparties.php
+++ b/dev/initdata/import-thirdparties.php
@@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
$path=preg_replace('/import-thirdparties.php/i','',$_SERVER["PHP_SELF"]);
-require ($path."../../htdocs/master.inc.php");
+require $path."../../htdocs/master.inc.php";
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
diff --git a/dev/initdata/import-users.php b/dev/initdata/import-users.php
index 3aaa9c11a4a..72a006bbe29 100755
--- a/dev/initdata/import-users.php
+++ b/dev/initdata/import-users.php
@@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
$path=preg_replace('/import-users.php/i','',$_SERVER["PHP_SELF"]);
-require ($path."../../htdocs/master.inc.php");
+require $path."../../htdocs/master.inc.php";
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php
index f992dcb2dc6..5a1e7b3afc3 100755
--- a/dev/initdata/purge-data.php
+++ b/dev/initdata/purge-data.php
@@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
$path=preg_replace('/purge-data.php/i','',$_SERVER["PHP_SELF"]);
-require ($path."../../htdocs/master.inc.php");
+require $path."../../htdocs/master.inc.php";
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
diff --git a/dev/initdemo/sftpget_and_loaddump.php b/dev/initdemo/sftpget_and_loaddump.php
index 981ff964b8e..98cb6189935 100755
--- a/dev/initdemo/sftpget_and_loaddump.php
+++ b/dev/initdemo/sftpget_and_loaddump.php
@@ -41,15 +41,15 @@ $passwordbase=isset($argv[6])?$argv[6]:'';
// Include Dolibarr environment
$res=0;
-if (! $res && file_exists($path."../../master.inc.php")) $res=@include($path."../../master.inc.php");
-if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include($path."../../htdocs/master.inc.php");
-if (! $res && file_exists("../master.inc.php")) $res=@include("../master.inc.php");
-if (! $res && file_exists("../../master.inc.php")) $res=@include("../../master.inc.php");
-if (! $res && file_exists("../../../master.inc.php")) $res=@include("../../../master.inc.php");
-if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include($path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
-if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include("../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
+if (! $res && file_exists($path."../../master.inc.php")) $res=@include $path."../../master.inc.php";
+if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include $path."../../htdocs/master.inc.php";
+if (! $res && file_exists("../master.inc.php")) $res=@include "../master.inc.php";
+if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.inc.php";
+if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php";
+if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
+if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
if (! $res) die ("Failed to include master.inc.php file\n");
-include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
+include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
/*
diff --git a/dev/initdemo/updatedemo.php b/dev/initdemo/updatedemo.php
index 9c453096904..ef37e25c04f 100755
--- a/dev/initdemo/updatedemo.php
+++ b/dev/initdemo/updatedemo.php
@@ -36,15 +36,15 @@ $confirm=isset($argv[1])?$argv[1]:'';
// Include Dolibarr environment
$res=0;
-if (! $res && file_exists($path."../../master.inc.php")) $res=@include($path."../../master.inc.php");
-if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include($path."../../htdocs/master.inc.php");
-if (! $res && file_exists("../master.inc.php")) $res=@include("../master.inc.php");
-if (! $res && file_exists("../../master.inc.php")) $res=@include("../../master.inc.php");
-if (! $res && file_exists("../../../master.inc.php")) $res=@include("../../../master.inc.php");
-if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include($path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
-if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include("../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
+if (! $res && file_exists($path."../../master.inc.php")) $res=@include $path."../../master.inc.php";
+if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include $path."../../htdocs/master.inc.php";
+if (! $res && file_exists("../master.inc.php")) $res=@include "../master.inc.php";
+if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.inc.php";
+if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php";
+if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
+if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
if (! $res) die ("Failed to include master.inc.php file\n");
-include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
+include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
/*
diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml
index a43e4dde82b..6619cf83754 100644
--- a/dev/setup/codesniffer/ruleset.xml
+++ b/dev/setup/codesniffer/ruleset.xml
@@ -285,7 +285,20 @@
-
+
';
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php
index 9643227da64..6a92a3f6080 100644
--- a/htdocs/accountancy/admin/card.php
+++ b/htdocs/accountancy/admin/card.php
@@ -397,6 +397,6 @@ else if ($id > 0 || $ref) {
}
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php
index aec34469559..735c5595ddc 100644
--- a/htdocs/accountancy/admin/categories.php
+++ b/htdocs/accountancy/admin/categories.php
@@ -184,6 +184,6 @@ if ($action == 'display' || $action == 'delete') {
print "";
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php
index 15a50e7b8e8..900205b7588 100644
--- a/htdocs/accountancy/admin/categories_list.php
+++ b/htdocs/accountancy/admin/categories_list.php
@@ -800,7 +800,7 @@ if ($id)
print '
';
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php
index c33d4326836..8cd45c1cfda 100644
--- a/htdocs/accountancy/admin/defaultaccounts.php
+++ b/htdocs/accountancy/admin/defaultaccounts.php
@@ -190,5 +190,6 @@ print '
*
*
* ';
print '';
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php
index 1d1ec548853..606d3a5f201 100644
--- a/htdocs/admin/events.php
+++ b/htdocs/admin/events.php
@@ -114,6 +114,6 @@ print "";
print "\n";
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php
index eb18f904229..c851010635e 100644
--- a/htdocs/admin/expedition.php
+++ b/htdocs/admin/expedition.php
@@ -507,5 +507,6 @@ print ' $(function() {
}); ';
dol_fiche_end();
-llxFooter();
+// End of page
+llxFooter();
$db->close();
diff --git a/htdocs/admin/export.php b/htdocs/admin/export.php
index b6f12a723ff..292c3604799 100644
--- a/htdocs/admin/export.php
+++ b/htdocs/admin/export.php
@@ -6,7 +6,7 @@
* Copyright (C) 2004 Eric Seigne
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2011-2012 Juanjo Menent
- * Copyright (C) 2011-2015 Philippe Grand
+ * Copyright (C) 2011-2018 Philippe Grand
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -32,9 +32,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
// Load translation files required by the page
-$langs->loadLangs(array('admin', 'exports'));
-
-$langs->load('other');
+$langs->loadLangs(array('admin', 'exports', 'other'));
if (! $user->admin)
accessforbidden();
@@ -73,7 +71,7 @@ dol_fiche_head(
// Setup page goes here
$form=new Form($db);
-$var=false;
+
print '';
print '';
print ''.$langs->trans("ExportModel").' '."\n";
@@ -82,8 +80,7 @@ print ' '."\n";
// Example with a yes / no select
-$var=!$var;
-print ' ';
+print ' ';
print ''.$langs->trans("set_EXPORTS_SHARE_MODELS").' ';
print ' ';
print '';
@@ -94,9 +91,8 @@ echo ajax_constantonoff('EXPORTS_SHARE_MODELS');
print '';
print ' ';
-
print '
';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php
index e8683dfc4ee..e0f3f72f927 100644
--- a/htdocs/admin/external_rss.php
+++ b/htdocs/admin/external_rss.php
@@ -325,6 +325,6 @@ else
dol_print_error($db);
}
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php
index f00d125a4d5..6c28081e6fc 100644
--- a/htdocs/admin/facture.php
+++ b/htdocs/admin/facture.php
@@ -782,7 +782,6 @@ print '';
dol_fiche_end();
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php
index 19d4a4cc772..bed1d4d9bcb 100644
--- a/htdocs/admin/fckeditor.php
+++ b/htdocs/admin/fckeditor.php
@@ -234,6 +234,6 @@ else
*/
}
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php
index a216f2d4ab7..c714c0c6c1b 100644
--- a/htdocs/admin/fichinter.php
+++ b/htdocs/admin/fichinter.php
@@ -6,7 +6,7 @@
* Copyright (C) 2005-2014 Regis Houssin
* Copyright (C) 2008 Raphael Bertrand (Resultic)
* Copyright (C) 2011-2013 Juanjo Menent
- * Copyright (C) 2011-2017 Philippe Grand
+ * Copyright (C) 2011-2018 Philippe Grand
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -560,7 +560,6 @@ print "\n";
print '';
//Use draft Watermark
-
print "';
-
-
-
print '';
print '
';
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php
index 9c944324527..9f154591f0f 100644
--- a/htdocs/admin/geoipmaxmind.php
+++ b/htdocs/admin/geoipmaxmind.php
@@ -153,6 +153,6 @@ if ($geoip)
$geoip->close();
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php
index b199505d214..e2d1cfca145 100644
--- a/htdocs/admin/holiday.php
+++ b/htdocs/admin/holiday.php
@@ -517,5 +517,6 @@ print '';
dol_fiche_end();
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php
index 62f17d5cb1d..355f5ae44fd 100644
--- a/htdocs/admin/ihm.php
+++ b/htdocs/admin/ihm.php
@@ -578,6 +578,6 @@ else // Show
print ' ';
}
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php
index 6542cec1174..2f64793c28b 100644
--- a/htdocs/admin/index.php
+++ b/htdocs/admin/index.php
@@ -114,7 +114,6 @@ if (empty($reshook))
print '';
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php
index 6776cfb1480..052b2f38988 100644
--- a/htdocs/admin/ldap.php
+++ b/htdocs/admin/ldap.php
@@ -340,5 +340,6 @@ if (function_exists("ldap_connect"))
}
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php
index 3188bf6e58a..dd85a998383 100644
--- a/htdocs/admin/ldap_contacts.php
+++ b/htdocs/admin/ldap_contacts.php
@@ -318,6 +318,7 @@ if (function_exists("ldap_connect"))
}
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php
index 4ae6ce9ad97..2650fe4fe6e 100644
--- a/htdocs/admin/ldap_groups.php
+++ b/htdocs/admin/ldap_groups.php
@@ -251,5 +251,6 @@ if (function_exists("ldap_connect"))
}
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php
index 616eb99a8da..240901ec04d 100644
--- a/htdocs/admin/ldap_members.php
+++ b/htdocs/admin/ldap_members.php
@@ -442,7 +442,6 @@ if (function_exists("ldap_connect"))
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php
index e45857f2f38..e845fd37adc 100644
--- a/htdocs/admin/ldap_members_types.php
+++ b/htdocs/admin/ldap_members_types.php
@@ -241,5 +241,6 @@ if (function_exists("ldap_connect"))
}
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php
index 8b11069fc61..513aa63f035 100644
--- a/htdocs/admin/ldap_users.php
+++ b/htdocs/admin/ldap_users.php
@@ -470,5 +470,6 @@ if (function_exists("ldap_connect"))
}
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php
index e9389b0271d..d24891f80f6 100644
--- a/htdocs/admin/limits.php
+++ b/htdocs/admin/limits.php
@@ -306,7 +306,6 @@ else
*/
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php
index 88ce717f005..91fb9f964e4 100644
--- a/htdocs/admin/livraison.php
+++ b/htdocs/admin/livraison.php
@@ -478,6 +478,7 @@ print '';
print '';
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/livraison_extrafields.php b/htdocs/admin/livraison_extrafields.php
index c9fed1c6554..55fe6f10362 100644
--- a/htdocs/admin/livraison_extrafields.php
+++ b/htdocs/admin/livraison_extrafields.php
@@ -119,6 +119,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/livraisondet_extrafields.php b/htdocs/admin/livraisondet_extrafields.php
index 921e9cfee41..e70b4f2d09b 100644
--- a/htdocs/admin/livraisondet_extrafields.php
+++ b/htdocs/admin/livraisondet_extrafields.php
@@ -120,6 +120,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php
index 3349ac0056a..419f6efbee9 100644
--- a/htdocs/admin/loan.php
+++ b/htdocs/admin/loan.php
@@ -122,5 +122,6 @@ print "\n";
print '
';
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php
index 32fbdd4aeb6..d5b866d9d20 100644
--- a/htdocs/admin/mailing.php
+++ b/htdocs/admin/mailing.php
@@ -152,6 +152,6 @@ print '';
dol_fiche_end();
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php
index 083d78c03e5..225860e78ad 100644
--- a/htdocs/admin/menus.php
+++ b/htdocs/admin/menus.php
@@ -269,7 +269,6 @@ if ($action != 'edit')
print '';
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php
index 191db98a402..2864fe79df0 100644
--- a/htdocs/admin/menus/edit.php
+++ b/htdocs/admin/menus/edit.php
@@ -514,5 +514,6 @@ elseif ($action == 'edit')
print '
';
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php
index c3211fc2d75..2e6d8a91008 100644
--- a/htdocs/admin/menus/index.php
+++ b/htdocs/admin/menus/index.php
@@ -410,6 +410,6 @@ else
print '
';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php
index 7789c3fb21c..0446c59af1d 100644
--- a/htdocs/admin/menus/other.php
+++ b/htdocs/admin/menus/other.php
@@ -105,6 +105,6 @@ print '';
print '';
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php
index cf4596ccda2..1443be3c104 100644
--- a/htdocs/admin/modulehelp.php
+++ b/htdocs/admin/modulehelp.php
@@ -592,7 +592,6 @@ dol_fiche_end();
print '';
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index cb560b29d86..0cf1b646eff 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -672,7 +672,7 @@ if ($mode == 'common')
print '';
print $versiontrans;
if(!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)){
- require_once(DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php');
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
if (!empty($objMod->url_last_version)) {
$newversion = getURLContent($objMod->url_last_version);
if(isset($newversion['content'])){
@@ -1080,8 +1080,6 @@ if ($mode == 'develop')
dol_fiche_end();
}
-
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php
index d4a031a6148..edb2735b354 100644
--- a/htdocs/admin/multicurrency.php
+++ b/htdocs/admin/multicurrency.php
@@ -375,6 +375,6 @@ print '
';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php
index 43782816202..d93421ef6fb 100644
--- a/htdocs/admin/notification.php
+++ b/htdocs/admin/notification.php
@@ -272,7 +272,6 @@ print '\n";
print '';
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php
index 87a89f5d99b..9490a291729 100644
--- a/htdocs/admin/proxy.php
+++ b/htdocs/admin/proxy.php
@@ -205,5 +205,6 @@ print '';
print '';
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php
index 4465017bdc6..abe2fbea655 100644
--- a/htdocs/admin/receiptprinter.php
+++ b/htdocs/admin/receiptprinter.php
@@ -447,7 +447,7 @@ $object->barcode = '3700123862396';
//$printer->sendToPrinter($object, 1, 16);
//setEventMessages($printer->error, $printer->errors, 'errors');
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php
index e8f8bdba204..566e57e587b 100644
--- a/htdocs/admin/resource.php
+++ b/htdocs/admin/resource.php
@@ -137,6 +137,6 @@ print '';
dol_fiche_end();
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/resource_extrafields.php b/htdocs/admin/resource_extrafields.php
index 722e5d88a9c..b8ea860ac25 100644
--- a/htdocs/admin/resource_extrafields.php
+++ b/htdocs/admin/resource_extrafields.php
@@ -116,6 +116,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php
index 6c5281173c3..c5ec770e393 100644
--- a/htdocs/admin/salaries.php
+++ b/htdocs/admin/salaries.php
@@ -127,5 +127,6 @@ print '';
-
// Form to test upload
print '
';
$formfile=new FormFile($db);
@@ -188,5 +187,6 @@ $formfile->form_attach_new_file($_SERVER['PHP_SELF'], $langs->trans("FormToTestF
$filearray=dol_dir_list($upload_dir, "files", 0, '', '', 'name', SORT_ASC, 1);
$formfile->list_of_documents($filearray, null, 'admin_temp', '');
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php
index 6503ab10f77..0e3da947fa8 100644
--- a/htdocs/admin/security_other.php
+++ b/htdocs/admin/security_other.php
@@ -206,6 +206,6 @@ print '';
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php
index db1cb20b5e3..3dbc785d1d7 100644
--- a/htdocs/admin/sms.php
+++ b/htdocs/admin/sms.php
@@ -331,7 +331,6 @@ else
}
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php
index b9892fdf2a9..d179c66d58d 100644
--- a/htdocs/admin/spip.php
+++ b/htdocs/admin/spip.php
@@ -163,6 +163,6 @@ else
dol_fiche_end();
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php
index e1098ef262d..b83f87af162 100644
--- a/htdocs/admin/stock.php
+++ b/htdocs/admin/stock.php
@@ -566,7 +566,6 @@ if ($conf->global->PRODUIT_SOUSPRODUITS)
}
*/
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php
index 75a917dd185..367d1fe0d36 100644
--- a/htdocs/admin/supplier_invoice.php
+++ b/htdocs/admin/supplier_invoice.php
@@ -516,7 +516,6 @@ print " \n";
print '';
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php
index 695d25a963c..72050867dfa 100644
--- a/htdocs/admin/supplier_order.php
+++ b/htdocs/admin/supplier_order.php
@@ -589,7 +589,6 @@ print "\n";
print '';
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php
index c1f3a7cb25d..55fb311ccda 100644
--- a/htdocs/admin/supplier_payment.php
+++ b/htdocs/admin/supplier_payment.php
@@ -430,7 +430,6 @@ print '';
dol_fiche_end();
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php
index 99069447e81..eeb148e9d99 100644
--- a/htdocs/admin/supplier_proposal.php
+++ b/htdocs/admin/supplier_proposal.php
@@ -582,6 +582,7 @@ print "\n";
print "\n ".$langs->trans("PathDirectory")." \n ".$conf->supplier_proposal->dir_output." \n \n";
print "\n
";
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php
index 16da8bf7a5c..65ce01a4faf 100644
--- a/htdocs/admin/supplierinvoice_extrafields.php
+++ b/htdocs/admin/supplierinvoice_extrafields.php
@@ -123,6 +123,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/supplierinvoicedet_extrafields.php b/htdocs/admin/supplierinvoicedet_extrafields.php
index 4ca9fd516d7..cdf128871fd 100644
--- a/htdocs/admin/supplierinvoicedet_extrafields.php
+++ b/htdocs/admin/supplierinvoicedet_extrafields.php
@@ -119,6 +119,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php
index 58c0408510d..640b6375c57 100644
--- a/htdocs/admin/supplierorder_extrafields.php
+++ b/htdocs/admin/supplierorder_extrafields.php
@@ -117,6 +117,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/supplierorderdet_extrafields.php b/htdocs/admin/supplierorderdet_extrafields.php
index 7dfaa02545e..65fe0537ba7 100644
--- a/htdocs/admin/supplierorderdet_extrafields.php
+++ b/htdocs/admin/supplierorderdet_extrafields.php
@@ -118,6 +118,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php
index 45dc91a8b95..e163fc83de5 100644
--- a/htdocs/admin/syslog.php
+++ b/htdocs/admin/syslog.php
@@ -302,6 +302,6 @@ if(! empty($conf->loghandlers['mod_syslog_file']) && ! empty($conf->cron->enable
print '';
print "\n";
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php
index 61780d51386..e9ea61ac944 100644
--- a/htdocs/admin/system/about.php
+++ b/htdocs/admin/system/about.php
@@ -214,7 +214,6 @@ if ($showpromotemessage)
}
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/system/browser.php b/htdocs/admin/system/browser.php
index 4f2a53de88d..c5aeff70b88 100644
--- a/htdocs/admin/system/browser.php
+++ b/htdocs/admin/system/browser.php
@@ -66,7 +66,6 @@ print '';
print '';
print '
';
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php
index 82e8481c2dd..9d4c4fc3cec 100644
--- a/htdocs/admin/system/constall.php
+++ b/htdocs/admin/system/constall.php
@@ -249,7 +249,6 @@ if ($resql)
print '';
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php
index 556961cb565..17d72edf20a 100644
--- a/htdocs/admin/system/database-tables.php
+++ b/htdocs/admin/system/database-tables.php
@@ -212,5 +212,6 @@ else
}
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php
index 45ce3c087e6..d5a7bbcdbfd 100644
--- a/htdocs/admin/system/database.php
+++ b/htdocs/admin/system/database.php
@@ -126,6 +126,6 @@ else
}
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php
index cef493c95f8..392c083c382 100644
--- a/htdocs/admin/system/dbtable.php
+++ b/htdocs/admin/system/dbtable.php
@@ -138,6 +138,6 @@ else
}
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php
index 4b02e7941d2..4dd4ef9dc9b 100644
--- a/htdocs/admin/system/dolibarr.php
+++ b/htdocs/admin/system/dolibarr.php
@@ -453,7 +453,6 @@ if ($resql)
print '';
print '';
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php
index 9a9e2297cba..65a9354a19f 100644
--- a/htdocs/admin/system/filecheck.php
+++ b/htdocs/admin/system/filecheck.php
@@ -433,11 +433,8 @@ if (! $error && $xml)
print $out;
}
-
-
-
+// End of page
llxFooter();
-
$db->close();
exit($error);
diff --git a/htdocs/admin/system/index.php b/htdocs/admin/system/index.php
index 3d473640618..7ffef739993 100644
--- a/htdocs/admin/system/index.php
+++ b/htdocs/admin/system/index.php
@@ -25,9 +25,8 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
-$langs->load("admin");
-$langs->load("user");
-$langs->load("install");
+// Load translation files required by the page
+$langs->loadLangs(array("admin", "user", "install"));
if (! $user->admin) accessforbidden();
@@ -114,6 +113,6 @@ print '
';
//print "
\n";
print info_admin($langs->trans("SystemInfoDesc")).'
';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php
index 4a6967089e2..fda1946875a 100644
--- a/htdocs/admin/system/modules.php
+++ b/htdocs/admin/system/modules.php
@@ -159,5 +159,6 @@ foreach($rights_ids as $right_id)
$old = $right_id;
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/system/os.php b/htdocs/admin/system/os.php
index 01d48f2444d..251025a4c9e 100644
--- a/htdocs/admin/system/os.php
+++ b/htdocs/admin/system/os.php
@@ -49,6 +49,6 @@ $osversion=version_os();
print "".$langs->trans("Version")." ".$osversion." \n";
print '';
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php
index 1e757b72f63..85ac2aea006 100644
--- a/htdocs/admin/system/perf.php
+++ b/htdocs/admin/system/perf.php
@@ -491,7 +491,6 @@ print ''.$langs->trans("DatabaseStatistics").': ';
print '
';
*/
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php
index 8664a28b28a..aa502cde421 100644
--- a/htdocs/admin/system/phpinfo.php
+++ b/htdocs/admin/system/phpinfo.php
@@ -116,7 +116,6 @@ foreach($phparray as $key => $value)
print '
';
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/system/xcache.php b/htdocs/admin/system/xcache.php
index 53eaeec085f..b582e61619b 100644
--- a/htdocs/admin/system/xcache.php
+++ b/htdocs/admin/system/xcache.php
@@ -76,6 +76,6 @@ if ($action == 'clear')
}
*/
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php
index 7c4bf64909f..304f9b79bd0 100644
--- a/htdocs/admin/taxes.php
+++ b/htdocs/admin/taxes.php
@@ -273,6 +273,6 @@ if (! empty($conf->accounting->enabled))
print '
'.$langs->trans("AccountingAccountForSalesTaxAreDefinedInto", $langs->transnoentitiesnoconv("MenuAccountancy"), $langs->transnoentitiesnoconv("Setup")).'';
}
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php
index 95af411b813..38f0a8eb497 100644
--- a/htdocs/admin/ticket.php
+++ b/htdocs/admin/ticket.php
@@ -641,6 +641,6 @@ print '';
print '
';
print '';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/ticket_extrafields.php b/htdocs/admin/ticket_extrafields.php
index 0687a33c52b..07ace9fea0c 100644
--- a/htdocs/admin/ticket_extrafields.php
+++ b/htdocs/admin/ticket_extrafields.php
@@ -109,6 +109,6 @@ if ($action == 'edit' && !empty($attrname)) {
include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php
index 1c985e23090..c9ef19dae98 100644
--- a/htdocs/admin/tools/dolibarr_export.php
+++ b/htdocs/admin/tools/dolibarr_export.php
@@ -522,6 +522,6 @@ print $langs->trans("BackupDescX").'
';
close();
diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php
index f390c192159..aca900c1cbc 100644
--- a/htdocs/admin/tools/dolibarr_import.php
+++ b/htdocs/admin/tools/dolibarr_import.php
@@ -212,6 +212,6 @@ else if (in_array($type, array('pgsql')))
close();
diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php
index d3253c02514..9999734a8f8 100644
--- a/htdocs/admin/tools/eaccelerator.php
+++ b/htdocs/admin/tools/eaccelerator.php
@@ -335,7 +335,6 @@ if (function_exists('eaccelerator_get')) {
print "
";
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/tools/index.php b/htdocs/admin/tools/index.php
index 98a490550ca..c5a05ef2136 100644
--- a/htdocs/admin/tools/index.php
+++ b/htdocs/admin/tools/index.php
@@ -56,6 +56,6 @@ print '
';
//print '';
print ' '; // For a reason I don't know, the div class="center does not works, we must keep the
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php
index 48d3ef57fd5..db5157789e1 100644
--- a/htdocs/admin/tools/listevents.php
+++ b/htdocs/admin/tools/listevents.php
@@ -339,6 +339,6 @@ else
dol_print_error($db);
}
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php
index 70b0987732b..13b99d92f6d 100644
--- a/htdocs/admin/tools/listsessions.php
+++ b/htdocs/admin/tools/listsessions.php
@@ -208,5 +208,6 @@ print '';
print '
';
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php
index f415ed1692c..097fc507240 100644
--- a/htdocs/admin/tools/purge.php
+++ b/htdocs/admin/tools/purge.php
@@ -119,7 +119,6 @@ if (preg_match('/^confirm/i',$choice))
print $form->formconfirm($_SERVER["PHP_SELF"].'?choice=allfiles', $langs->trans('Purge'), $langs->trans('ConfirmPurge').img_warning().' ', 'purge', $formquestion, 'no', 2);
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php
index d0802d6b473..41923aa068d 100644
--- a/htdocs/admin/tools/update.php
+++ b/htdocs/admin/tools/update.php
@@ -142,7 +142,6 @@ print '
';
print $langs->trans("GoModuleSetupArea", DOL_URL_ROOT.'/admin/modules.php?mode=deploy', $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Modules"));
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php
index cc21a8ff717..4c215e9ae52 100644
--- a/htdocs/admin/translation.php
+++ b/htdocs/admin/translation.php
@@ -584,6 +584,6 @@ if (! empty($langcode))
dol_set_focus('#transvalue');
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php
index 1a1893e2eb0..cd2f33b4cb0 100644
--- a/htdocs/admin/triggers.php
+++ b/htdocs/admin/triggers.php
@@ -84,6 +84,6 @@ foreach ($triggers as $trigger)
print '';
print '';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php
index f888c8410bb..2cf8fc5b6f3 100644
--- a/htdocs/admin/user.php
+++ b/htdocs/admin/user.php
@@ -337,5 +337,6 @@ print "
";
dol_fiche_end();
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php
index 28f1ad6af2f..c1b55dcec6a 100644
--- a/htdocs/admin/usergroup.php
+++ b/htdocs/admin/usergroup.php
@@ -282,5 +282,6 @@ print "
";
dol_fiche_end();
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php
index 80ca0b29c0a..fcdeee79249 100644
--- a/htdocs/admin/website.php
+++ b/htdocs/admin/website.php
@@ -646,9 +646,7 @@ if ($id)
dol_fiche_end();
-//print '
';
-
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php
index c688da0e550..9d724b86390 100644
--- a/htdocs/admin/website_options.php
+++ b/htdocs/admin/website_options.php
@@ -143,9 +143,8 @@ else
dol_fiche_end();
-//print '
';
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php
index b5bdec73f3e..24a39ce827a 100644
--- a/htdocs/admin/workflow.php
+++ b/htdocs/admin/workflow.php
@@ -187,7 +187,6 @@ if ($nbqualified == 0)
}
print '';
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/asset/admin/assets_extrafields.php b/htdocs/asset/admin/assets_extrafields.php
index 1cdf78df4bf..109b0f1e94f 100644
--- a/htdocs/asset/admin/assets_extrafields.php
+++ b/htdocs/asset/admin/assets_extrafields.php
@@ -109,6 +109,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/asset/admin/assets_type_extrafields.php b/htdocs/asset/admin/assets_type_extrafields.php
index d828bffa4de..e8f1d71370b 100644
--- a/htdocs/asset/admin/assets_type_extrafields.php
+++ b/htdocs/asset/admin/assets_type_extrafields.php
@@ -107,6 +107,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php
index c240f350590..1168fd3ada3 100644
--- a/htdocs/asset/admin/setup.php
+++ b/htdocs/asset/admin/setup.php
@@ -107,9 +107,8 @@ else
print '';
}
-
-// Page end
dol_fiche_end();
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php
index 1cb580c8c8d..9126f80617f 100644
--- a/htdocs/asset/card.php
+++ b/htdocs/asset/card.php
@@ -25,8 +25,8 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php';
require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php';
-include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
-include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php');
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
// Load translation files required by the page
$langs->loadLangs(array("asset"));
diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php
index 66baaae196c..6427befd03e 100644
--- a/htdocs/asset/document.php
+++ b/htdocs/asset/document.php
@@ -148,6 +148,6 @@ else
accessforbidden('',0,0);
}
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/asset/info.php b/htdocs/asset/info.php
index 71460f31a2c..e8820ee5cfa 100644
--- a/htdocs/asset/info.php
+++ b/htdocs/asset/info.php
@@ -79,5 +79,6 @@ print '';
dol_fiche_end();
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/asset/note.php b/htdocs/asset/note.php
index cf0166df96f..775b3e8747e 100644
--- a/htdocs/asset/note.php
+++ b/htdocs/asset/note.php
@@ -144,6 +144,6 @@ if ($id > 0 || ! empty($ref))
dol_fiche_end();
}
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php
index f4409ee5417..001912f7de3 100644
--- a/htdocs/asset/type.php
+++ b/htdocs/asset/type.php
@@ -851,7 +851,6 @@ if ($rowid > 0)
}
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php
index 8cd5ff979a0..66ff541d499 100644
--- a/htdocs/asterisk/wrapper.php
+++ b/htdocs/asterisk/wrapper.php
@@ -190,5 +190,6 @@ else {
print 'Bad parameters in URL. Must be '.$_SERVER['PHP_SELF'].'?caller=99999&called=99999&login=xxxxx&password=xxxxx';
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php
index 26386052480..7086af7f17e 100644
--- a/htdocs/barcode/codeinit.php
+++ b/htdocs/barcode/codeinit.php
@@ -319,6 +319,6 @@ if ($conf->product->enabled || $conf->product->service)
print '';
print '
';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php
index 7dfec76b39e..6dd578993ca 100644
--- a/htdocs/barcode/printsheet.php
+++ b/htdocs/barcode/printsheet.php
@@ -441,6 +441,6 @@ print '
';
print '
';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php
index 326fea79c5d..8c2835d856c 100644
--- a/htdocs/blockedlog/admin/blockedlog.php
+++ b/htdocs/blockedlog/admin/blockedlog.php
@@ -178,5 +178,6 @@ if (GETPOST('withtab','alpha'))
print '
';
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php
index 8f5d47bf704..6bb1876b926 100644
--- a/htdocs/blockedlog/admin/blockedlog_list.php
+++ b/htdocs/blockedlog/admin/blockedlog_list.php
@@ -587,5 +587,6 @@ if (GETPOST('withtab','alpha'))
print '
';
+// End of page
llxFooter();
-$db->close();
+$db->close();
\ No newline at end of file
diff --git a/htdocs/bookmarks/admin/bookmark.php b/htdocs/bookmarks/admin/bookmark.php
index 25fa032902f..ed20f619b25 100644
--- a/htdocs/bookmarks/admin/bookmark.php
+++ b/htdocs/bookmarks/admin/bookmark.php
@@ -81,5 +81,6 @@ print '';
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php
index d450e476506..b82c2b11b6c 100644
--- a/htdocs/bookmarks/card.php
+++ b/htdocs/bookmarks/card.php
@@ -336,7 +336,6 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php
index ac5a89c66f3..10ce877c7e0 100644
--- a/htdocs/bookmarks/list.php
+++ b/htdocs/bookmarks/list.php
@@ -209,7 +209,7 @@ else
dol_print_error($db);
}
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php
index f4af16b3739..62867d855cb 100644
--- a/htdocs/cashdesk/admin/cashdesk.php
+++ b/htdocs/cashdesk/admin/cashdesk.php
@@ -185,5 +185,6 @@ print '\n";
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/cashdesk/affContenu.php b/htdocs/cashdesk/affContenu.php
index bd778f3422e..2a3c0279df8 100644
--- a/htdocs/cashdesk/affContenu.php
+++ b/htdocs/cashdesk/affContenu.php
@@ -87,7 +87,7 @@ print '';
print '';
print '';
-require ('tpl/liste_articles.tpl.php');
+require 'tpl/liste_articles.tpl.php';
print '';
print '';
diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php
index f52890b68d2..6a2889f6e71 100644
--- a/htdocs/cashdesk/facturation.php
+++ b/htdocs/cashdesk/facturation.php
@@ -163,4 +163,4 @@ $obj_facturation->paiementLe('RESET');
// Affichage des templates
-require ('tpl/facturation1.tpl.php');
+require 'tpl/facturation1.tpl.php';
diff --git a/htdocs/cashdesk/validation.php b/htdocs/cashdesk/validation.php
index 289c864ca32..ff1219861e2 100644
--- a/htdocs/cashdesk/validation.php
+++ b/htdocs/cashdesk/validation.php
@@ -24,5 +24,5 @@
$form=new Form($db);
// Affichage des templates
-require ('tpl/validation1.tpl.php');
+require 'tpl/validation1.tpl.php';
diff --git a/htdocs/cashdesk/validation_ok.php b/htdocs/cashdesk/validation_ok.php
index 70bf3d1b64f..c8c83a91f18 100644
--- a/htdocs/cashdesk/validation_ok.php
+++ b/htdocs/cashdesk/validation_ok.php
@@ -22,5 +22,5 @@
*/
// Affichage des templates
-require ('tpl/validation2.tpl.php');
+require 'tpl/validation2.tpl.php';
diff --git a/htdocs/cashdesk/validation_ticket.php b/htdocs/cashdesk/validation_ticket.php
index 577df309138..a98b50b0bc9 100644
--- a/htdocs/cashdesk/validation_ticket.php
+++ b/htdocs/cashdesk/validation_ticket.php
@@ -24,7 +24,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php';
require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php';
-include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
+require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
unset($_SESSION['serObjFacturation']);
@@ -35,7 +35,7 @@ $parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$obj_facturation);
if (empty($reshook))
{
- require ('tpl/ticket.tpl.php');
+ require 'tpl/ticket.tpl.php';
}
diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php
index 92e23a2199a..03adfdbb41e 100644
--- a/htdocs/categories/admin/categorie.php
+++ b/htdocs/categories/admin/categorie.php
@@ -122,5 +122,6 @@ print '';
print '';
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/categories/admin/categorie_extrafields.php b/htdocs/categories/admin/categorie_extrafields.php
index 3fbd29a640b..abea3f41eeb 100644
--- a/htdocs/categories/admin/categorie_extrafields.php
+++ b/htdocs/categories/admin/categorie_extrafields.php
@@ -111,6 +111,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php
index db56902347b..ce3324505eb 100644
--- a/htdocs/categories/card.php
+++ b/htdocs/categories/card.php
@@ -288,7 +288,6 @@ if ($user->rights->categorie->creer)
}
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php
index b420847f6fd..cdfac54fb9d 100644
--- a/htdocs/categories/edit.php
+++ b/htdocs/categories/edit.php
@@ -192,7 +192,6 @@ print '';
-
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php
index e57e51caf62..e634da4fe80 100644
--- a/htdocs/categories/index.php
+++ b/htdocs/categories/index.php
@@ -202,6 +202,6 @@ print "";
print '';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php
index 472a8eb9b95..095c0c611c5 100644
--- a/htdocs/categories/photos.php
+++ b/htdocs/categories/photos.php
@@ -273,6 +273,6 @@ else
print $langs->trans("ErrorUnknown");
}
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php
index 7d71b43a81b..dbcfca198d2 100644
--- a/htdocs/categories/traduction.php
+++ b/htdocs/categories/traduction.php
@@ -334,5 +334,6 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service
print '
';
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index 24e70e7d587..ba3580cea87 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -697,6 +697,6 @@ if ($type == Categorie::TYPE_PROJECT)
}
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/collab/index.php b/htdocs/collab/index.php
index 2c056cd0e07..d7d5e9a8bbd 100644
--- a/htdocs/collab/index.php
+++ b/htdocs/collab/index.php
@@ -456,9 +456,6 @@ if ($action == 'editcontent')
print "\n\n";
-
-
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 1d6a0286b68..dae5fb70617 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -1611,7 +1611,6 @@ if ($id > 0)
}
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index c6ec428e68f..6c863580203 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -1351,9 +1351,9 @@ class ActionComm extends CommonObject
{
global $conf,$langs,$dolibarr_main_url_root,$mysoc;
- require_once (DOL_DOCUMENT_ROOT ."/core/lib/xcal.lib.php");
- require_once (DOL_DOCUMENT_ROOT ."/core/lib/date.lib.php");
- require_once (DOL_DOCUMENT_ROOT ."/core/lib/files.lib.php");
+ require_once DOL_DOCUMENT_ROOT ."/core/lib/xcal.lib.php";
+ require_once DOL_DOCUMENT_ROOT ."/core/lib/date.lib.php";
+ require_once DOL_DOCUMENT_ROOT ."/core/lib/files.lib.php";
dol_syslog(get_class($this)."::build_exportfile Build export file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".count($filters), LOG_DEBUG);
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index 43e5b89f115..7fc12129cc5 100644
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -268,7 +268,6 @@ else
print $langs->trans("ErrorUnknown");
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index c361d275882..178e4bfb6d7 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -1250,8 +1250,8 @@ else // View by day
print "\n".'';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php
index 9a043a13690..2582e9b6b32 100644
--- a/htdocs/comm/action/info.php
+++ b/htdocs/comm/action/info.php
@@ -114,5 +114,6 @@ print '';
dol_fiche_end();
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php
index 2c11a1de977..319499d65fd 100644
--- a/htdocs/comm/action/list.php
+++ b/htdocs/comm/action/list.php
@@ -672,7 +672,6 @@ else
dol_print_error($db);
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php
index 2fdfa180319..9350de8f85c 100644
--- a/htdocs/comm/action/pertype.php
+++ b/htdocs/comm/action/pertype.php
@@ -730,10 +730,8 @@ jQuery(document).ready(function() {
});
';
-
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php
index 0cf056ef3a9..58690dc512b 100644
--- a/htdocs/comm/action/peruser.php
+++ b/htdocs/comm/action/peruser.php
@@ -865,10 +865,8 @@ jQuery(document).ready(function() {
});
';
-
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php
index 7e4108b470b..ff1c7746afa 100644
--- a/htdocs/comm/action/rapport/index.php
+++ b/htdocs/comm/action/rapport/index.php
@@ -209,5 +209,6 @@ else
dol_print_error($db);
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php
index 6a6aa12862a..becfabc949c 100644
--- a/htdocs/comm/admin/propal_extrafields.php
+++ b/htdocs/comm/admin/propal_extrafields.php
@@ -111,6 +111,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php
index 0816a4c035c..7172c0e5b7c 100644
--- a/htdocs/comm/admin/propaldet_extrafields.php
+++ b/htdocs/comm/admin/propaldet_extrafields.php
@@ -118,6 +118,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index 83db0e0f1d2..d7d5a3f4f5a 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -1346,5 +1346,4 @@ else
// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php
index aa8dae43140..b6d9f0922aa 100644
--- a/htdocs/comm/contact.php
+++ b/htdocs/comm/contact.php
@@ -176,6 +176,6 @@ else
dol_print_error($db);
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index e90a821b5e3..92757dcac36 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -884,6 +884,6 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
print '';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php
index b63ffac6efd..4d10120aaeb 100644
--- a/htdocs/comm/mailing/advtargetemailing.php
+++ b/htdocs/comm/mailing/advtargetemailing.php
@@ -471,5 +471,6 @@ if ($object->fetch($id) >= 0) {
}
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index 97746ad9d82..469db6f2a54 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -1358,5 +1358,6 @@ else
}
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php
index 08ed54d2fc3..6caa262500e 100644
--- a/htdocs/comm/mailing/cibles.php
+++ b/htdocs/comm/mailing/cibles.php
@@ -649,7 +649,6 @@ if ($object->fetch($id) >= 0)
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php
index 17693a1a73c..9cd1e8546d0 100644
--- a/htdocs/comm/mailing/index.php
+++ b/htdocs/comm/mailing/index.php
@@ -210,7 +210,6 @@ if ($langs->file_exists("html/spam.html",0)) {
print '
';
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php
index b4f2eaeb6f3..3c1e6e2cffa 100644
--- a/htdocs/comm/mailing/info.php
+++ b/htdocs/comm/mailing/info.php
@@ -75,5 +75,6 @@ if ($object->fetch($id) >= 0)
dol_fiche_end();
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php
index 87a390d4006..5087698b9ab 100644
--- a/htdocs/comm/mailing/list.php
+++ b/htdocs/comm/mailing/list.php
@@ -224,6 +224,6 @@ else
dol_print_error($db);
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/multiprix.php b/htdocs/comm/multiprix.php
index 1e8c5c82cf4..e9ddee12b22 100644
--- a/htdocs/comm/multiprix.php
+++ b/htdocs/comm/multiprix.php
@@ -177,5 +177,6 @@ if ($_socid > 0)
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php
index 5e21f493c64..4e017ff13d9 100644
--- a/htdocs/comm/propal/contact.php
+++ b/htdocs/comm/propal/contact.php
@@ -212,6 +212,6 @@ if ($object->id > 0)
}
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php
index 1c8d494214d..2f16cd54864 100644
--- a/htdocs/comm/propal/document.php
+++ b/htdocs/comm/propal/document.php
@@ -179,5 +179,6 @@ else
print $langs->trans("ErrorUnknown");
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php
index 0dbe2fb855e..b47a4506412 100644
--- a/htdocs/comm/propal/index.php
+++ b/htdocs/comm/propal/index.php
@@ -530,7 +530,6 @@ if (! empty($conf->propal->enabled))
//print '';
print '';
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php
index 317c9902d52..7879612b099 100644
--- a/htdocs/comm/propal/info.php
+++ b/htdocs/comm/propal/info.php
@@ -127,5 +127,6 @@ print '';
dol_fiche_end();
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 1a23c0b8728..45ca1c5212d 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -310,7 +310,7 @@ if ($search_country) $sql .= " AND s.fk_pays IN (".$db->escape($search_country).
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$db->escape($search_type_thirdparty).')';
if ($search_ref) $sql .= natural_search('p.ref', $search_ref);
if ($search_refcustomer) $sql .= natural_search('p.ref_client', $search_refcustomer);
-if ($search_refproject) $sql .= natural_search('pr.ref', $search_refprojet);
+if ($search_refproject) $sql .= natural_search('pr.ref', $search_refproject);
if ($search_availability) $sql .= " AND p.fk_availability IN (".$db->escape($search_availability).')';
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
@@ -432,7 +432,7 @@ if ($resql)
if ($search_year) $param.='&search_year='.urlencode($search_year);
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
if ($search_refcustomer) $param.='&search_refcustomer='.urlencode($search_refcustomer);
- if ($search_refprojet) $param.='&search_refprojet='.urlencode($search_refprojet);
+ if ($search_refproject) $param.='&search_refproject='.urlencode($search_refproject);
if ($search_societe) $param.='&search_societe='.urlencode($search_societe);
if ($search_user > 0) $param.='&search_user='.urlencode($search_user);
if ($search_sale > 0) $param.='&search_sale='.urlencode($search_sale);
@@ -988,27 +988,40 @@ if ($resql)
}
// Show total line
- if (isset($totalarray['totalhtfield'])
+ if (isset($totalarray['totalhtfield'])
|| isset($totalarray['totalvatfield'])
|| isset($totalarray['totalttcfield'])
|| isset($totalarray['totalamfield'])
|| isset($totalarray['totalrtpfield'])
+ || isset($totalarray['totalizable'])
)
{
print '';
$i=0;
while ($i < $totalarray['nbfield'])
{
- $i++;
- if ($i == 1)
- {
+ $i++;
+ if ($i == 1)
+ {
if ($num < $limit && empty($offset)) print ''.$langs->trans("Total").' ';
else print ''.$langs->trans("Totalforthispage").' ';
- }
- elseif ($totalarray['totalhtfield'] == $i) print ''.price($totalarray['totalht']).' ';
- elseif ($totalarray['totalvatfield'] == $i) print ''.price($totalarray['totalvat']).' ';
- elseif ($totalarray['totalttcfield'] == $i) print ''.price($totalarray['totalttc']).' ';
- else print ' ';
+ }
+ elseif ($totalarray['totalhtfield'] == $i) print ''.price($totalarray['totalht']).' ';
+ elseif ($totalarray['totalvatfield'] == $i) print ''.price($totalarray['totalvat']).' ';
+ elseif ($totalarray['totalttcfield'] == $i) print ''.price($totalarray['totalttc']).' ';
+ elseif ($totalarray['totalizable']) {
+ $printed = false;
+ foreach ($totalarray['totalizable'] as $totalizable) {
+ if ($totalizable['pos']==$i && ! $printed) {
+ print ''.price($totalizable['total']).' ';
+ $printed = true;
+ }
+ }
+ if (! $printed) {
+ print ' ';
+ }
+ }
+ else print ' ';
}
print ' ';
}
diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php
index 607cff245d9..a346f8df18f 100644
--- a/htdocs/comm/propal/note.php
+++ b/htdocs/comm/propal/note.php
@@ -144,6 +144,6 @@ if ($id > 0 || ! empty($ref))
}
}
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php
index ac6b42c45d8..00db6264377 100644
--- a/htdocs/comm/propal/stats/index.php
+++ b/htdocs/comm/propal/stats/index.php
@@ -344,7 +344,6 @@ print '';
dol_fiche_end();
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php
index 2273012696f..6d7e93af4be 100644
--- a/htdocs/comm/prospect/index.php
+++ b/htdocs/comm/prospect/index.php
@@ -275,6 +275,6 @@ if ($resql)
//print '';
print '';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/comm/prospect/recap-prospect.php b/htdocs/comm/prospect/recap-prospect.php
index 50127d719c8..93cfada8860 100644
--- a/htdocs/comm/prospect/recap-prospect.php
+++ b/htdocs/comm/prospect/recap-prospect.php
@@ -89,5 +89,6 @@ else
dol_print_error($db);
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php
index 6cd41c6c658..86c1bad0521 100644
--- a/htdocs/comm/recap-client.php
+++ b/htdocs/comm/recap-client.php
@@ -89,5 +89,6 @@ else
dol_print_error($db);
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php
index 6f3287b8831..f045e570c6e 100644
--- a/htdocs/comm/remise.php
+++ b/htdocs/comm/remise.php
@@ -129,8 +129,9 @@ if ($socid > 0)
print '';
- llxFooter();
- $db->close();
+ // End of page
+ llxFooter();
+ $db->close();
exit;
}
@@ -324,5 +325,6 @@ if ($socid > 0)
}
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php
index 3eec109e6b3..78e4643d5e3 100644
--- a/htdocs/comm/remx.php
+++ b/htdocs/comm/remx.php
@@ -998,5 +998,6 @@ if ($socid > 0)
}
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 0c3e4328505..10005f3004a 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -2678,5 +2678,6 @@ if ($action == 'create' && $user->rights->commande->creer)
}
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 4202f44720b..605be7e9b3f 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -3424,7 +3424,7 @@ class Commande extends CommonOrder
if (!$user->rights->commande->lire)
$option = 'nolink';
-
+
if ($option !== 'nolink')
{
// Add param to save lastsearch_values or not
@@ -3468,11 +3468,11 @@ class Commande extends CommonOrder
$linkstart.=$linkclose.'>';
$linkend='';
- if ($option == 'nolink') {
+ if ($option === 'nolink') {
$linkstart = '';
$linkend = '';
}
-
+
$result .= $linkstart;
if ($withpicto) $result.=img_object(($notooltip?'':$label), $this->picto, ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
if ($withpicto != 2) $result.= $this->ref;
diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php
index 7669239134a..bd00116e026 100644
--- a/htdocs/commande/contact.php
+++ b/htdocs/commande/contact.php
@@ -214,5 +214,6 @@ if ($id > 0 || ! empty($ref))
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php
index 9263ceb3f45..42def36ee28 100644
--- a/htdocs/commande/customer.php
+++ b/htdocs/commande/customer.php
@@ -190,7 +190,7 @@ else
dol_print_error($db);
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php
index ffebbaa260a..e7d0514a022 100644
--- a/htdocs/commande/document.php
+++ b/htdocs/commande/document.php
@@ -189,6 +189,6 @@ else
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php
index 5cfb87c7a25..4c596620c6c 100644
--- a/htdocs/commande/index.php
+++ b/htdocs/commande/index.php
@@ -479,6 +479,6 @@ if (! empty($conf->commande->enabled))
print '';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php
index 4bac4a3a447..6c0b5f42ec6 100644
--- a/htdocs/commande/info.php
+++ b/htdocs/commande/info.php
@@ -128,5 +128,6 @@ print '';
dol_fiche_end();
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 2b86ad2f18a..98c2333793f 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -1160,5 +1160,6 @@ else
dol_print_error($db);
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php
index 6cff3bfb3bc..bf02c9b993c 100644
--- a/htdocs/commande/note.php
+++ b/htdocs/commande/note.php
@@ -142,5 +142,6 @@ if ($id > 0 || ! empty($ref))
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php
index 03d379270b1..37768ade393 100644
--- a/htdocs/commande/orderstoinvoice.php
+++ b/htdocs/commande/orderstoinvoice.php
@@ -739,5 +739,6 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php
index 8f259808357..49e7d5cfb60 100644
--- a/htdocs/commande/stats/index.php
+++ b/htdocs/commande/stats/index.php
@@ -369,7 +369,6 @@ print '';
dol_fiche_end();
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php
index a786cf5ca28..5e1a10390e2 100644
--- a/htdocs/compta/bank/annuel.php
+++ b/htdocs/compta/bank/annuel.php
@@ -24,7 +24,7 @@
* \brief Page to report input-output of a bank account
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
@@ -494,5 +494,6 @@ else
print "\n
\n";
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php
index 8ddc3de0014..6c2ad4ef302 100644
--- a/htdocs/compta/bank/bankentries_list.php
+++ b/htdocs/compta/bank/bankentries_list.php
@@ -29,7 +29,7 @@
* \brief List of bank transactions
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
@@ -1529,6 +1529,6 @@ if ($_POST["action"] == "search" && ! $num)
print ''.$langs->trans("NoRecordFound").'';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/bank/bilan.php b/htdocs/compta/bank/bilan.php
index 5e5194d55c8..99856a2dea2 100644
--- a/htdocs/compta/bank/bilan.php
+++ b/htdocs/compta/bank/bilan.php
@@ -22,7 +22,7 @@
* \brief Page de bilan
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
// Load translation files required by the page
@@ -92,5 +92,6 @@ print "".$langs->trans("BankBalance")." ";
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php
index 280cd9bdbc0..ccec902bf7c 100644
--- a/htdocs/compta/bank/budget.php
+++ b/htdocs/compta/bank/budget.php
@@ -24,7 +24,7 @@
* \brief Page de budget
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
// Load translation files required by the page
@@ -96,5 +96,6 @@ else
}
print "";
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php
index db497733863..461d193d1fe 100644
--- a/htdocs/compta/bank/card.php
+++ b/htdocs/compta/bank/card.php
@@ -27,7 +27,7 @@
* \brief Page to create/view a bank account
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
@@ -1034,5 +1034,6 @@ else
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php
index be029fcb2f5..7ef798103d5 100644
--- a/htdocs/compta/bank/categ.php
+++ b/htdocs/compta/bank/categ.php
@@ -26,7 +26,7 @@
* \brief Page ajout de categories bancaires
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php';
@@ -144,4 +144,6 @@ if ($action != 'edit')
print '';
+// End of page
llxFooter();
+$db->close();
diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php
index 33e74dc3691..d41bbd77bbe 100644
--- a/htdocs/compta/bank/document.php
+++ b/htdocs/compta/bank/document.php
@@ -24,7 +24,7 @@
* \ingroup banque
* \brief Page de gestion des documents attaches a un compte bancaire
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . "/core/lib/bank.lib.php";
require_once DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php";
require_once DOL_DOCUMENT_ROOT . "/core/lib/images.lib.php";
@@ -147,7 +147,6 @@ else {
exit;
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php
index b829002a990..7dad720139a 100644
--- a/htdocs/compta/bank/graph.php
+++ b/htdocs/compta/bank/graph.php
@@ -23,7 +23,7 @@
* \brief Page graph des transactions bancaires
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
@@ -864,7 +864,6 @@ if ($mode == 'showalltime')
print '';
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/bank/info.php b/htdocs/compta/bank/info.php
index ab43b9374aa..7eaeb515aa9 100644
--- a/htdocs/compta/bank/info.php
+++ b/htdocs/compta/bank/info.php
@@ -21,7 +21,7 @@
* \brief Onglet info d'une ecriture bancaire
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
@@ -71,5 +71,6 @@ print ' ';
print '';
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php
index 10e549dd094..e75250a830c 100644
--- a/htdocs/compta/bank/ligne.php
+++ b/htdocs/compta/bank/ligne.php
@@ -28,12 +28,12 @@
* \brief Page to edit a bank transaction record
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
// Load translation files required by the page
-$langs->loadLangs(array('banks', 'categories', 'compta', 'bills'));
+$langs->loadLangs(array('banks', 'categories', 'compta', 'bills', 'other'));
if (! empty($conf->adherent->enabled)) $langs->load("members");
if (! empty($conf->don->enabled)) $langs->load("donations");
if (! empty($conf->loan->enabled)) $langs->load("loan");
@@ -98,8 +98,8 @@ if ($action == 'confirm_delete_categ' && $confirm == "yes" && $user->rights->ban
{
dol_print_error($db);
}
- }
- else
+ }
+ else
{
setEventMessages($langs->trans("MissingIds"), null, 'errors');
}
@@ -688,6 +688,6 @@ if ($result)
}
else dol_print_error($db);
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php
index e52e285742c..1f01355050c 100644
--- a/htdocs/compta/bank/list.php
+++ b/htdocs/compta/bank/list.php
@@ -27,7 +27,7 @@ use Stripe\BankAccount;
* \brief Home page of bank module
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
@@ -604,7 +604,6 @@ print "";
print "";
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php
index 1d9d5526700..3f1bede8e20 100644
--- a/htdocs/compta/bank/releve.php
+++ b/htdocs/compta/bank/releve.php
@@ -25,7 +25,7 @@
* \brief Page to show a bank statement report
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
@@ -813,7 +813,6 @@ else
}
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php
index 765001e75a5..7ad8bc2ad96 100644
--- a/htdocs/compta/bank/transfer.php
+++ b/htdocs/compta/bank/transfer.php
@@ -26,7 +26,7 @@
* \brief Page de saisie d'un virement
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
@@ -265,5 +265,6 @@ print '
";
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php
index 0fb8880ce87..2389d1fec77 100644
--- a/htdocs/compta/bank/treso.php
+++ b/htdocs/compta/bank/treso.php
@@ -330,5 +330,6 @@ else
print $langs->trans("ErrorBankAccountNotFound");
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php
index 1b4d7579892..9c30dfe3cd8 100644
--- a/htdocs/compta/bank/various_payment/card.php
+++ b/htdocs/compta/bank/various_payment/card.php
@@ -499,8 +499,6 @@ if ($id)
print "";
}
-
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php
index cf596860a4b..e11a608c7d0 100644
--- a/htdocs/compta/bank/various_payment/document.php
+++ b/htdocs/compta/bank/various_payment/document.php
@@ -154,6 +154,6 @@ else
print $langs->trans("ErrorUnknown");
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/bank/various_payment/index.php b/htdocs/compta/bank/various_payment/index.php
index 6535e0c0082..6e4060bbeb1 100644
--- a/htdocs/compta/bank/various_payment/index.php
+++ b/htdocs/compta/bank/various_payment/index.php
@@ -344,5 +344,6 @@ else
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/compta/bank/various_payment/info.php b/htdocs/compta/bank/various_payment/info.php
index bb66871d6c0..c39a6379000 100644
--- a/htdocs/compta/bank/various_payment/info.php
+++ b/htdocs/compta/bank/various_payment/info.php
@@ -58,6 +58,6 @@ print '';
print '';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php
index 6d369b696b9..50e5285cb14 100644
--- a/htdocs/compta/charges/index.php
+++ b/htdocs/compta/charges/index.php
@@ -568,7 +568,6 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
print '';
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php
index 05d509e268d..1e8fa358929 100644
--- a/htdocs/compta/deplacement/card.php
+++ b/htdocs/compta/deplacement/card.php
@@ -577,7 +577,6 @@ else if ($id)
}
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php
index 59d92140c86..c2b3595b476 100644
--- a/htdocs/compta/deplacement/document.php
+++ b/htdocs/compta/deplacement/document.php
@@ -129,6 +129,6 @@ else
print $langs->trans("ErrorUnknown");
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php
index a390023e280..98c939965a3 100644
--- a/htdocs/compta/deplacement/index.php
+++ b/htdocs/compta/deplacement/index.php
@@ -204,7 +204,6 @@ else dol_print_error($db);
print '';
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/deplacement/info.php b/htdocs/compta/deplacement/info.php
index 6a62484323f..f63b1765efb 100644
--- a/htdocs/compta/deplacement/info.php
+++ b/htdocs/compta/deplacement/info.php
@@ -59,5 +59,6 @@ if ($id)
print '';
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php
index bdbdad0a712..20d300d9da4 100644
--- a/htdocs/compta/deplacement/list.php
+++ b/htdocs/compta/deplacement/list.php
@@ -212,6 +212,6 @@ else
dol_print_error($db);
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php
index cf652948a6e..193e2c7e9a9 100644
--- a/htdocs/compta/deplacement/stats/index.php
+++ b/htdocs/compta/deplacement/stats/index.php
@@ -312,7 +312,6 @@ print '';
dol_fiche_end();
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/facture/admin/facture_cust_extrafields.php b/htdocs/compta/facture/admin/facture_cust_extrafields.php
index 4e44774e0c4..1fe26e82a54 100644
--- a/htdocs/compta/facture/admin/facture_cust_extrafields.php
+++ b/htdocs/compta/facture/admin/facture_cust_extrafields.php
@@ -114,6 +114,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php
index 54d3da8e18a..23c0d79a33c 100644
--- a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php
+++ b/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php
@@ -115,6 +115,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php
index c2490da4f42..0947f788719 100644
--- a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php
+++ b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php
@@ -113,6 +113,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php
index 28c70ea9024..46d9ed28335 100644
--- a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php
+++ b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php
@@ -113,6 +113,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 0688d8488ed..e411f8c5b1b 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -1705,8 +1705,8 @@ if (empty($reshook))
if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) {
$idprod = $res->fk_product_child;
- }
- else
+ }
+ else
{
setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors');
$error ++;
@@ -4886,5 +4886,6 @@ else if ($id > 0 || ! empty($ref))
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php
index a82f06ad851..06f33f3f69a 100644
--- a/htdocs/compta/facture/class/facture-rec.class.php
+++ b/htdocs/compta/facture/class/facture-rec.class.php
@@ -443,7 +443,7 @@ class FactureRec extends CommonInvoice
// Retreive all extrafield for line
// fetch optionals attributes and labels
- require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
+ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafieldsline=new ExtraFields($this->db);
$extrafieldsline=$extrafieldsline->fetch_name_optionals_label('facturedet_rec',true);
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index bb00620d056..4edce36b82f 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -3027,7 +3027,7 @@ class Facture extends CommonInvoice
{
global $mysoc,$user;
- include_once(DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php');
+ include_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php';
// Cap percentages to 100
if ($percent > 100) $percent = 100;
diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php
index af872a174ca..ab96700fc53 100644
--- a/htdocs/compta/facture/contact.php
+++ b/htdocs/compta/facture/contact.php
@@ -215,6 +215,6 @@ if ($id > 0 || ! empty($ref))
}
}
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php
index 828c77f1178..1fd8c40bf1f 100644
--- a/htdocs/compta/facture/document.php
+++ b/htdocs/compta/facture/document.php
@@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (! empty($conf->projet->enabled)) {
- require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
+ include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
// Load translation files required by the page
@@ -78,7 +78,7 @@ if ($object->fetch($id))
* Actions
*/
-include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
+require_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
/*
@@ -191,6 +191,6 @@ else
print $langs->trans("ErrorUnknown");
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php
index 6719e7091c8..a46b79d7d1b 100644
--- a/htdocs/compta/facture/fiche-rec.php
+++ b/htdocs/compta/facture/fiche-rec.php
@@ -35,8 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
if (! empty($conf->projet->enabled)) {
- require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
- //require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
+ include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
+ //include_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
}
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
@@ -546,7 +546,7 @@ if (empty($reshook))
}
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
{
- require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
+ include_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
$prodcustprice = new Productcustomerprice($db);
@@ -1734,6 +1734,6 @@ else
}
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php
index 8964b85203b..aff7cb362a8 100644
--- a/htdocs/compta/facture/info.php
+++ b/htdocs/compta/facture/info.php
@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
if (! empty($conf->projet->enabled)) {
- require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
+ include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
// Load translation files required by the page
@@ -122,5 +122,6 @@ print '';
dol_fiche_end();
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php
index 13db00a02c2..0cfb0347a2d 100644
--- a/htdocs/compta/facture/invoicetemplate_list.php
+++ b/htdocs/compta/facture/invoicetemplate_list.php
@@ -709,6 +709,6 @@ else
dol_print_error($db);
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 75dce3c01a3..7d989e4b63e 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -1245,5 +1245,6 @@ else
dol_print_error($db);
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php
index 58fc26030b7..c46d3ed690e 100644
--- a/htdocs/compta/facture/note.php
+++ b/htdocs/compta/facture/note.php
@@ -142,7 +142,6 @@ if ($id > 0 || ! empty($ref))
dol_fiche_end();
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php
index ecde973bd3b..d7766268989 100644
--- a/htdocs/compta/facture/prelevement.php
+++ b/htdocs/compta/facture/prelevement.php
@@ -696,6 +696,6 @@ if ($object->id > 0)
print '';
}
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php
index 0416e04f7b0..04603076b07 100644
--- a/htdocs/compta/facture/stats/index.php
+++ b/htdocs/compta/facture/stats/index.php
@@ -347,7 +347,6 @@ print '';
dol_fiche_end();
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php
index 69f3bd102df..428f55f9362 100644
--- a/htdocs/compta/paiement/cheque/card.php
+++ b/htdocs/compta/paiement/cheque/card.php
@@ -273,7 +273,7 @@ else if ($action == 'remove_file' && $user->rights->banque->cheque)
{
if ($object->fetch($id) > 0)
{
- require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$langs->load("other");
diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
index 528b01477a6..189afeda59f 100644
--- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php
+++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
@@ -593,8 +593,8 @@ class RemiseCheque extends CommonObject
$file = "pdf_".$model.".class.php";
if (file_exists($dir.$file))
{
- require_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php';
- require_once $dir.$file;
+ include_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php';
+ include_once $dir.$file;
$classname='BordereauCheque'.ucfirst($model);
$docmodel = new $classname($this->db);
diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php
index 527bd05e3a1..b6770e62d33 100644
--- a/htdocs/compta/paiement/cheque/index.php
+++ b/htdocs/compta/paiement/cheque/index.php
@@ -24,7 +24,7 @@
* \brief Home page for cheque receipts
*/
-require('../../../main.inc.php');
+require '../../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php
index 800f40b9694..44fd508dc3d 100644
--- a/htdocs/compta/paiement/cheque/list.php
+++ b/htdocs/compta/paiement/cheque/list.php
@@ -25,7 +25,7 @@
* \brief Page list of cheque deposits
*/
-require('../../../main.inc.php');
+require '../../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index 539c70f591b..53a17830c09 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -545,7 +545,7 @@ class Paiement extends CommonObject
$this->fk_account=$accountid;
- require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
dol_syslog("$user->id,$mode,$label,$this->fk_account,$emetteur_nom,$emetteur_banque");
@@ -1064,7 +1064,7 @@ class Paiement extends CommonObject
$arraybill = $this->getBillsArray();
if (is_array($arraybill) && count($arraybill) > 0)
{
- require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic=new Facture($this->db);
foreach ($arraybill as $billid)
{
@@ -1170,7 +1170,7 @@ class Paiement extends CommonObject
*/
function fetch_thirdparty($force_thirdparty_id=0)
{
- require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
+ include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
if (empty($force_thirdparty_id))
{
diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php
index 0cbaa9ce55e..c7fee1f70a8 100644
--- a/htdocs/compta/prelevement/bons.php
+++ b/htdocs/compta/prelevement/bons.php
@@ -24,7 +24,7 @@
* \brief Page liste des bons de prelevements
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php
index 343a45472b6..84c4087e451 100644
--- a/htdocs/compta/prelevement/card.php
+++ b/htdocs/compta/prelevement/card.php
@@ -23,7 +23,7 @@
* \brief Card of a direct debit
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php
index a6b0ec84317..94d5a764a38 100644
--- a/htdocs/compta/prelevement/class/bonprelevement.class.php
+++ b/htdocs/compta/prelevement/class/bonprelevement.class.php
@@ -762,16 +762,16 @@ class BonPrelevement extends CommonObject
dol_syslog(__METHOD__."::Bank=".$banque." Office=".$agence." mode=".$mode." format=".$format, LOG_DEBUG);
- require_once (DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
- require_once (DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
+ require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
+ require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
if (empty($format)) return 'ErrorBadParametersForDirectDebitFileCreate';
$error = 0;
$datetimeprev = time();
- //Choice the date of the execution direct debit
- if(!empty($executiondate)) $datetimeprev = $executiondate;
+ //Choice the date of the execution direct debit
+ if(!empty($executiondate)) $datetimeprev = $executiondate;
$month = strftime("%m", $datetimeprev);
$year = strftime("%Y", $datetimeprev);
diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php
index 74bd282d606..191a54b7484 100644
--- a/htdocs/compta/prelevement/create.php
+++ b/htdocs/compta/prelevement/create.php
@@ -25,7 +25,7 @@
* \brief Prelevement creation page
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php
index d20f92cb188..b5058b5c685 100644
--- a/htdocs/compta/prelevement/demandes.php
+++ b/htdocs/compta/prelevement/demandes.php
@@ -24,7 +24,7 @@
* \brief Page to list withdraw requests
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/modPrelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php
index 2eabd64873d..d4593a3dcef 100644
--- a/htdocs/compta/prelevement/factures.php
+++ b/htdocs/compta/prelevement/factures.php
@@ -24,7 +24,7 @@
* \brief Page liste des factures prelevees
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php';
diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php
index 113153bc896..ebf3876406b 100644
--- a/htdocs/compta/prelevement/fiche-rejet.php
+++ b/htdocs/compta/prelevement/fiche-rejet.php
@@ -24,7 +24,7 @@
* \brief Withdraw reject
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php';
diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php
index c126212f17c..e4371abfb5c 100644
--- a/htdocs/compta/prelevement/fiche-stat.php
+++ b/htdocs/compta/prelevement/fiche-stat.php
@@ -23,7 +23,7 @@
* \brief Prelevement statistics
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php
index de99b56eb19..83f14169d4c 100644
--- a/htdocs/compta/prelevement/index.php
+++ b/htdocs/compta/prelevement/index.php
@@ -26,7 +26,7 @@
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php
index 721cf62bcd7..8cad6ed70d5 100644
--- a/htdocs/compta/prelevement/ligne.php
+++ b/htdocs/compta/prelevement/ligne.php
@@ -24,7 +24,7 @@
* \brief card of withdraw line
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php';
diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php
index 8d657f00221..cac9e52b3c9 100644
--- a/htdocs/compta/prelevement/list.php
+++ b/htdocs/compta/prelevement/list.php
@@ -24,7 +24,7 @@
* \brief Page liste des prelevements
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php
index c8812bba1a9..2e340a2c801 100644
--- a/htdocs/compta/prelevement/rejets.php
+++ b/htdocs/compta/prelevement/rejets.php
@@ -24,7 +24,7 @@
* \brief Reject page
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php
index 20d213e820b..7c878787e89 100644
--- a/htdocs/compta/prelevement/stats.php
+++ b/htdocs/compta/prelevement/stats.php
@@ -24,7 +24,7 @@
* \brief Page with statistics on withdrawals
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php
index 45fee127642..30b4164e81b 100644
--- a/htdocs/compta/salaries/card.php
+++ b/htdocs/compta/salaries/card.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2011-2018 Alexandre Spangaro
* Copyright (C) 2014 Laurent Destailleur
* Copyright (C) 2015 Jean-François Ferry
* Copyright (C) 2015 Charlie BENKE
@@ -29,12 +29,20 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php';
+if (! empty($conf->projet->enabled))
+{
+ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
+}
// Load translation files required by the page
$langs->loadLangs(array("compta","banks","bills","users","salaries","hrm"));
+if (! empty($conf->projet->enabled)) $langs->load("projects");
$id=GETPOST("id",'int');
$action=GETPOST('action','aZ09');
+$cancel= GETPOST('cancel', 'aZ09');
+$projectid = (GETPOST('projectid','int') ? GETPOST('projectid', 'int') : GETPOST('fk_project','int'));
// Security check
$socid = GETPOST("socid","int");
@@ -52,20 +60,27 @@ $hookmanager->initHooks(array('salarycard','globalcard'));
* Actions
*/
-if ($_POST["cancel"] == $langs->trans("Cancel"))
+if ($cancel)
{
header("Location: index.php");
exit;
}
-if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
+// Link to a project
+if ($action == 'classin' && $user->rights->banque->modifier)
+{
+ $object->fetch($id);
+ $object->setProject(GETPOST('projectid'));
+}
+
+if ($action == 'add' && empty($cancel))
{
$error=0;
- $datep=dol_mktime(12,0,0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]);
- $datev=dol_mktime(12,0,0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]);
- $datesp=dol_mktime(12,0,0, $_POST["datespmonth"], $_POST["datespday"], $_POST["datespyear"]);
- $dateep=dol_mktime(12,0,0, $_POST["dateepmonth"], $_POST["dateepday"], $_POST["dateepyear"]);
+ $datep=dol_mktime(12,0,0, GETPOST("datepmonth",'int'), GETPOST("datepday",'int'), GETPOST("datepyear",'int'));
+ $datev=dol_mktime(12,0,0, GETPOST("datevmonth",'int'), GETPOST("datevday",'int'), GETPOST("datevyear",'int'));
+ $datesp=dol_mktime(12,0,0, GETPOST("datespmonth",'int'), GETPOST("datespday",'int'), GETPOST("datespyear",'int'));
+ $dateep=dol_mktime(12,0,0, GETPOST("dateepmonth",'int'), GETPOST("dateepday",'int'), GETPOST("dateepyear",'int'));
if (empty($datev)) $datev=$datep;
$type_payment = dol_getIdFromCode($db, GETPOST("paymenttype", 'alpha'), 'c_paiement', 'code', 'id', 1);
@@ -82,6 +97,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
$object->type_payment=($type_payment > 0 ? $type_payment : 0);
$object->num_payment=GETPOST("num_payment");
$object->fk_user_author=$user->id;
+ $object->fk_project= GETPOST('fk_project','int');
// Set user current salary as ref salaray for the payment
$fuser=new User($db);
@@ -187,6 +203,7 @@ if ($action == 'delete')
llxHeader("",$langs->trans("SalaryPayment"));
$form = new Form($db);
+if (! empty($conf->projet->enabled)) $formproject = new FormProjets($db);
if ($id)
{
@@ -278,6 +295,18 @@ if ($action == 'create')
print '';
print '';
+ // Project
+ if (! empty($conf->projet->enabled))
+ {
+ $formproject=new FormProjets($db);
+
+ print ''.$langs->trans("Project").' ';
+
+ $numproject=$formproject->select_projects(-1, $projectid,'fk_project',0,0,1,1);
+
+ print ' ';
+ }
+
// Bank
if (! empty($conf->banque->enabled))
{
@@ -335,14 +364,46 @@ if ($id)
dol_fiche_head($head, 'card', $langs->trans("SalaryPayment"), -1, 'payment');
- $linkback = ''.$langs->trans("BackToList").'';
+ $linkback = ''.$langs->trans("BackToList").'';
$morehtmlref='';
+ // Employee
$userstatic=new User($db);
$userstatic->fetch($object->fk_user);
-
$morehtmlref.=$langs->trans('Employee') . ' : ' . $userstatic->getNomUrl(1);
+
+ // Project
+ if (! empty($conf->projet->enabled))
+ {
+ $morehtmlref.='
'.$langs->trans('Project') . ' ';
+ if ($user->rights->salaries->write)
+ {
+ if ($action != 'classify')
+ $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ if ($action == 'classify') {
+ //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref.='';
+ } else {
+ $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
+ }
+ } else {
+ if (! empty($object->fk_project)) {
+ $proj = new Project($db);
+ $proj->fetch($object->fk_project);
+ $morehtmlref.='';
+ $morehtmlref.=$proj->ref;
+ $morehtmlref.='';
+ } else {
+ $morehtmlref.='';
+ }
+ }
+ }
$morehtmlref.='';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', '');
diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php
index 3a3f34b85b4..31c616ac00d 100644
--- a/htdocs/compta/salaries/class/paymentsalary.class.php
+++ b/htdocs/compta/salaries/class/paymentsalary.class.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2014 Juanjo Menent
+/* Copyright (C) 2011-2018 Alexandre Spangaro
+ * Copyright (C) 2014 Juanjo Menent
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,9 +17,9 @@
*/
/**
- * \file htdocs/compta/salaries/class/paymentsalary.class.php
- * \ingroup salaries
- * \brief Class for salaries module payment
+ * \file htdocs/compta/salaries/class/paymentsalary.class.php
+ * \ingroup salaries
+ * \brief Class for salaries module payment
*/
// Put here all includes required by your class file
@@ -40,6 +40,7 @@ class PaymentSalary extends CommonObject
public $datep;
public $datev;
public $amount;
+ public $fk_project;
public $type_payment;
public $num_payment;
public $label;
@@ -102,6 +103,7 @@ class PaymentSalary extends CommonObject
$sql.= " datep='".$this->db->idate($this->datep)."',";
$sql.= " datev='".$this->db->idate($this->datev)."',";
$sql.= " amount=".price2num($this->amount).",";
+ $sql.= " fk_projet='".$this->db->escape($this->fk_project)."',";
$sql.= " fk_typepayment=".$this->fk_typepayment."',";
$sql.= " num_payment='".$this->db->escape($this->num_payment)."',";
$sql.= " label='".$this->db->escape($this->label)."',";
@@ -161,6 +163,7 @@ class PaymentSalary extends CommonObject
$sql.= " s.datep,";
$sql.= " s.datev,";
$sql.= " s.amount,";
+ $sql.= " s.fk_projet as fk_project,";
$sql.= " s.fk_typepayment,";
$sql.= " s.num_payment,";
$sql.= " s.label,";
@@ -186,25 +189,26 @@ class PaymentSalary extends CommonObject
{
$obj = $this->db->fetch_object($resql);
- $this->id = $obj->rowid;
- $this->ref = $obj->rowid;
- $this->tms = $this->db->jdate($obj->tms);
- $this->fk_user = $obj->fk_user;
- $this->datep = $this->db->jdate($obj->datep);
- $this->datev = $this->db->jdate($obj->datev);
- $this->amount = $obj->amount;
- $this->type_payement = $obj->fk_typepayment;
- $this->num_payment = $obj->num_payment;
- $this->label = $obj->label;
- $this->datesp = $this->db->jdate($obj->datesp);
- $this->dateep = $this->db->jdate($obj->dateep);
- $this->note = $obj->note;
- $this->fk_bank = $obj->fk_bank;
- $this->fk_user_author = $obj->fk_user_author;
- $this->fk_user_modif = $obj->fk_user_modif;
- $this->fk_account = $obj->fk_account;
- $this->fk_type = $obj->fk_type;
- $this->rappro = $obj->rappro;
+ $this->id = $obj->rowid;
+ $this->ref = $obj->rowid;
+ $this->tms = $this->db->jdate($obj->tms);
+ $this->fk_user = $obj->fk_user;
+ $this->datep = $this->db->jdate($obj->datep);
+ $this->datev = $this->db->jdate($obj->datev);
+ $this->amount = $obj->amount;
+ $this->fk_project = $obj->fk_project;
+ $this->type_payement = $obj->fk_typepayment;
+ $this->num_payment = $obj->num_payment;
+ $this->label = $obj->label;
+ $this->datesp = $this->db->jdate($obj->datesp);
+ $this->dateep = $this->db->jdate($obj->dateep);
+ $this->note = $obj->note;
+ $this->fk_bank = $obj->fk_bank;
+ $this->fk_user_author = $obj->fk_user_author;
+ $this->fk_user_modif = $obj->fk_user_modif;
+ $this->fk_account = $obj->fk_account;
+ $this->fk_type = $obj->fk_type;
+ $this->rappro = $obj->rappro;
}
$this->db->free($resql);
@@ -276,12 +280,12 @@ class PaymentSalary extends CommonObject
$this->fk_user_modif='';
}
- /**
- * Create in database
- *
- * @param User $user User that create
- * @return int <0 if KO, >0 if OK
- */
+ /**
+ * Create in database
+ *
+ * @param User $user User that create
+ * @return int <0 if KO, >0 if OK
+ */
function create($user)
{
global $conf,$langs;
@@ -331,6 +335,7 @@ class PaymentSalary extends CommonObject
$sql.= ", datep";
$sql.= ", datev";
$sql.= ", amount";
+ $sql.= ", fk_projet";
$sql.= ", salary";
$sql.= ", fk_typepayment";
$sql.= ", num_payment";
@@ -348,6 +353,7 @@ class PaymentSalary extends CommonObject
$sql.= ", '".$this->db->idate($this->datep)."'";
$sql.= ", '".$this->db->idate($this->datev)."'";
$sql.= ", ".$this->amount;
+ $sql.= ", ".($this->fk_project > 0? $this->fk_project : 0);
$sql.= ", ".($this->salary > 0 ? $this->salary : "null");
$sql.= ", ".$this->db->escape($this->type_payment);
$sql.= ", '".$this->db->escape($this->num_payment)."'";
@@ -502,13 +508,11 @@ class PaymentSalary extends CommonObject
global $langs;
$result='';
- $label=$langs->trans("ShowSalaryPayment").': '.$this->ref;
+ $label=$langs->trans("ShowSalaryPayment").': '.$this->ref;
- $linkstart = '';
+ $linkstart = '';
$linkend='';
- $picto='payment';
-
$result .= $linkstart;
if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
if ($withpicto != 2) $result.= $this->ref;
diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php
index 101a934a524..697253b90eb 100644
--- a/htdocs/compta/sociales/card.php
+++ b/htdocs/compta/sociales/card.php
@@ -32,11 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if (! empty($conf->projet->enabled))
{
- require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
- require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
if (! empty($conf->accounting->enabled)) {
- require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
+ include_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
}
// Load translation files required by the page
diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
index ba9c671f755..114a2e78cf1 100644
--- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
+++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
@@ -518,7 +518,7 @@ class PaymentSocialContribution extends CommonObject
if (! empty($conf->banque->enabled))
{
- require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$acc = new Account($this->db);
$acc->fetch($accountid);
diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php
index 490dbf3a1fe..5f3fc5aa4eb 100644
--- a/htdocs/compta/sociales/document.php
+++ b/htdocs/compta/sociales/document.php
@@ -35,8 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (! empty($conf->projet->enabled))
{
- require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
- require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
// Load translation files required by the page
@@ -76,7 +76,7 @@ $modulepart='tax';
* Actions
*/
-include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
+require_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
if ($action == 'setlib' && $user->rights->tax->charges->creer)
{
diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php
index 1827c1597f8..4e184e2099f 100644
--- a/htdocs/compta/sociales/info.php
+++ b/htdocs/compta/sociales/info.php
@@ -27,8 +27,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
if (! empty($conf->projet->enabled))
{
- require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
- require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
// Load translation files required by the page
diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example
index 7475cf54ddb..886a6171818 100644
--- a/htdocs/conf/conf.php.example
+++ b/htdocs/conf/conf.php.example
@@ -14,7 +14,7 @@
// dolibarr_main_url_root
// This parameter defines the root URL of your Dolibarr index.php page without ending "/".
// It must link to the directory htdocs.
-// In most cases, this is autodetected but it's still required
+// In most cases, this is autodetected but it's still required
// * to show full url bookmarks for some services (ie: agenda rss export url, ...)
// * or when using Apache dir aliases (autodetect fails)
// * or when using nginx (autodetect fails)
@@ -40,7 +40,7 @@ $dolibarr_main_document_root='';
// dolibarr_main_url_root_alt
// This parameter defines the relative sub URLs to add to $dolibarr_main_url_root to
// forge alternative root directories (used by modules developers).
-// You can put several values, separated by a coma, but number of entries must match
+// You can put several values, separated by a coma, but number of entries must match
// number of entries into $dolibarr_main_document_root_alt.
// Examples:
// $dolibarr_main_url_root_alt='/custom';
@@ -52,7 +52,7 @@ $dolibarr_main_document_root='';
// dolibarr_main_document_root_alt
// This parameter contains absolute alternative root file system directories (used by
// modules developers).
-// You can put several values, separated by a coma, but number of entries must match
+// You can put several values, separated by a coma, but number of entries must match
// number of entries into $dolibarr_main_url_root_alt.
// Examples:
// $dolibarr_main_document_root_alt='/var/www/dolibarr/htdocs/custom';
@@ -162,7 +162,7 @@ $dolibarr_main_db_collation='utf8_unicode_ci';
// Default value: dolibarr
// Possible values: Any values found in files in htdocs/core/login directory after
// the "function_" string and before the ".php" string. You can also separate several
-// values using a ",". In this case, Dolibarr will check login/pass for each value in
+// values using a ",". In this case, Dolibarr will check login/pass for each value in
// order defined into value. However, note that this can't work with all values.
// Examples:
// $dolibarr_main_authentication='http';
@@ -207,10 +207,10 @@ $dolibarr_main_authentication='dolibarr';
// 0 = No forced redirect
// 1 = Force redirect to https, until SCRIPT_URI start with https into response
// 2 = Force redirect to https, until SERVER["HTTPS"] is 'on' into response
-// 'https://my.domain.com' = Force reditect to https using this domain name.
+// 'https://my.domain.com' = Force reditect to https using this domain name.
// Warning: If you enable this parameter, your web server must be configured to
-// respond URL with https protocol.
-// According to your web server setup, some values may works and other not. Try
+// respond URL with https protocol.
+// According to your web server setup, some values may works and other not. Try
// different values (1,2 or 'https://my.domain.com') if you experience problems.
// Default value: 0
// Possible values: 0, 1, 2 or 'https://my.domain.com'
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index d0120d130df..9c13a57112a 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -30,7 +30,7 @@
* \brief Page of a contract
*/
-require ("../main.inc.php");
+require "../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php
index 4d403198eb8..063e3ecb228 100644
--- a/htdocs/contrat/contact.php
+++ b/htdocs/contrat/contact.php
@@ -24,7 +24,7 @@
* \brief Onglet de gestion des contacts des contrats
*/
-require ("../main.inc.php");
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php
index 0208d68f80d..20a70830952 100644
--- a/htdocs/contrat/document.php
+++ b/htdocs/contrat/document.php
@@ -27,7 +27,7 @@
* \brief Page des documents joints sur les contrats
*/
-require ("../main.inc.php");
+require "../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php
index b78bf52b6be..f348cab8234 100644
--- a/htdocs/contrat/index.php
+++ b/htdocs/contrat/index.php
@@ -24,9 +24,9 @@
* \brief Home page of contract area
*/
-require ("../main.inc.php");
-require_once (DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php");
-require_once (DOL_DOCUMENT_ROOT."/product/class/product.class.php");
+require "../main.inc.php";
+require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php";
+require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
// Load translation files required by the page
$langs->loadLangs(array('products', 'companies', 'contracts'));
diff --git a/htdocs/contrat/info.php b/htdocs/contrat/info.php
index 8899351c284..c783ca4948c 100644
--- a/htdocs/contrat/info.php
+++ b/htdocs/contrat/info.php
@@ -22,7 +22,7 @@
* \brief Page des informations d'un contrat
*/
-require ("../main.inc.php");
+require "../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index 18e78c7ff0a..e616afefd99 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -28,7 +28,7 @@
* \brief Page liste des contrats
*/
-require ("../main.inc.php");
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php
index c160201191a..a5ea40e146c 100644
--- a/htdocs/contrat/note.php
+++ b/htdocs/contrat/note.php
@@ -24,7 +24,7 @@
* \brief Fiche de notes sur un contrat
*/
-require ("../main.inc.php");
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if (! empty($conf->projet->enabled)) {
diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php
index de44410e505..1ce48a7371d 100644
--- a/htdocs/contrat/services_list.php
+++ b/htdocs/contrat/services_list.php
@@ -25,10 +25,10 @@
* \brief Page to list services in contracts
*/
-require ("../main.inc.php");
-require_once (DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php");
-require_once (DOL_DOCUMENT_ROOT."/product/class/product.class.php");
-require_once (DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
+require "../main.inc.php";
+require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php";
+require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
+require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
// Load translation files required by the page
$langs->loadLangs(array('products', 'contracts', 'companies'));
diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php
index 599b847b49e..6b6d4b7a176 100644
--- a/htdocs/core/actions_extrafields.inc.php
+++ b/htdocs/core/actions_extrafields.inc.php
@@ -181,7 +181,9 @@ if ($action == 'add')
GETPOST('help','alpha'),
GETPOST('computed_value','alpha'),
(GETPOST('entitycurrentorall', 'alpha')?0:''),
- GETPOST('langfile', 'alpha')
+ GETPOST('langfile', 'alpha'),
+ 1,
+ (GETPOST('totalizable', 'alpha')?1:0)
);
if ($result > 0)
{
@@ -331,7 +333,7 @@ if ($action == 'update')
$visibility = GETPOST('list', 'alpha');
if ($type == 'separate') $visibility=3;
- $result=$extrafields->update(
+ $result=$extrafields->update(
GETPOST('attrname', 'alpha'),
GETPOST('label', 'alpha'),
$type,
@@ -348,7 +350,9 @@ if ($action == 'update')
GETPOST('default_value','alpha'),
GETPOST('computed_value','alpha'),
(GETPOST('entitycurrentorall', 'alpha')?0:''),
- GETPOST('langfile')
+ GETPOST('langfile'),
+ 1,
+ (GETPOST('totalizable', 'alpha')?1:0)
);
if ($result > 0)
{
diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php
index 646be9a3f92..4798861ac2d 100644
--- a/htdocs/core/actions_massactions.inc.php
+++ b/htdocs/core/actions_massactions.inc.php
@@ -378,7 +378,7 @@ if (! $error && $massaction == 'confirm_presend')
//var_dump($filepath);
// Send mail (substitutionarray must be done just before this)
- require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php');
+ require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
if ($mailfile->error)
{
@@ -433,7 +433,7 @@ if (! $error && $massaction == 'confirm_presend')
if (! empty($trigger_name))
{
// Appel des triggers
- include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
+ include_once DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php";
$interface=new Interfaces($db);
$result=$interface->run_triggers($trigger_name, $objectobj, $user, $langs, $conf);
if ($result < 0) { $error++; $errors=$interface->errors; }
@@ -703,7 +703,7 @@ if ($massaction == 'confirm_createbills')
if (! $error)
{
$db->commit();
- setEventMessage($langs->trans('BillCreated', $nb_bills_created));
+ setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs');
// Make a redirect to avoid to bill twice if we make a refresh or back
$param='';
diff --git a/htdocs/core/ajax/price.php b/htdocs/core/ajax/price.php
index 577f659b2cc..453fdc7bc82 100644
--- a/htdocs/core/ajax/price.php
+++ b/htdocs/core/ajax/price.php
@@ -25,7 +25,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
-require('../../main.inc.php');
+require '../../main.inc.php';
$output = GETPOST('output','alpha');
$amount = price2num(GETPOST('amount','alpha'));
diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php
index 976cbf1766c..29bc4410b82 100644
--- a/htdocs/core/boxes/box_project.php
+++ b/htdocs/core/boxes/box_project.php
@@ -23,7 +23,7 @@
* \ingroup projet
* \brief Module to show Projet activity of the current Year
*/
-include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php");
+include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
/**
* Class to manage the box to show last projet
@@ -80,7 +80,7 @@ class box_project extends ModeleBoxes
// list the summary of the orders
if ($user->rights->projet->lire) {
- include_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
+ include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$projectstatic = new Project($this->db);
$socid=$user->societe_id;
diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php
index 3a665243073..802195ca445 100644
--- a/htdocs/core/boxes/box_task.php
+++ b/htdocs/core/boxes/box_task.php
@@ -22,8 +22,8 @@
* \brief Module to Task activity of the current year
*/
-include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
+include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
/**
@@ -75,7 +75,7 @@ class box_task extends ModeleBoxes
$totalMnt = 0;
$totalnb = 0;
$totalDuree=0;
- include_once(DOL_DOCUMENT_ROOT."/projet/class/task.class.php");
+ include_once DOL_DOCUMENT_ROOT."/projet/class/task.class.php";
$taskstatic=new Task($db);
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index cd3e6c90fb5..9d8d718993b 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -9,6 +9,7 @@
* Copyright (C) 2015 Charles-Fr BENKE
* Copyright (C) 2016 Raphaël Doursenaud
* Copyright (C) 2017 Nicolas ZABOURI
+ * Copyright (C) 2018 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -516,14 +517,15 @@ class ExtraFields
* @param string $entity Entity of extrafields
* @param string $langfile Language file
* @param string $enabled Condition to have the field enabled or not
+ * @param int $totalizable Is extrafield totalizable on list
* @return int >0 if OK, <=0 if KO
*/
- function update($attrname, $label, $type, $length, $elementtype, $unique=0, $required=0, $pos=0, $param='', $alwayseditable=0, $perms='', $list='', $help='', $default='', $computed='', $entity='', $langfile='', $enabled='1')
+ function update($attrname, $label, $type, $length, $elementtype, $unique=0, $required=0, $pos=0, $param='', $alwayseditable=0, $perms='', $list='', $help='', $default='', $computed='', $entity='', $langfile='', $enabled='1', $totalizable=0)
{
if ($elementtype == 'thirdparty') $elementtype='societe';
if ($elementtype == 'contact') $elementtype='socpeople';
- $table=$elementtype.'_extrafields';
+ $table=$elementtype.'_extrafields';
if ($elementtype == 'categorie') $table='categories_extrafields';
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname))
@@ -568,7 +570,7 @@ class ExtraFields
{
if ($label)
{
- $result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique,$required,$pos,$param,$alwayseditable,$perms,$list,$help,$default,$computed,$entity,$langfile,$enabled);
+ $result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique,$required,$pos,$param,$alwayseditable,$perms,$list,$help,$default,$computed,$entity,$langfile,$enabled, $totalizable);
}
if ($result > 0)
{
@@ -625,12 +627,13 @@ class ExtraFields
* @param string $entity Entity of extrafields
* @param string $langfile Language file
* @param string $enabled Condition to have the field enabled or not
- * @return int <=0 if KO, >0 if OK
+ * @param int $totalizable Is extrafield totalizable on list
+ * @return int <=0 if KO, >0 if OK
*/
- private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list='0',$help='',$default='',$computed='',$entity='',$langfile='',$enabled='1')
+ private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list='0',$help='',$default='',$computed='',$entity='',$langfile='',$enabled='1', $totalizable=0)
{
global $conf, $user;
- dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$default.", ".$computed.", ".$entity.", ".$langfile.", ".$enabled);
+ dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$default.", ".$computed.", ".$entity.", ".$langfile.", ".$enabled.", ".$totalizable);
// Clean parameters
if ($elementtype == 'thirdparty') $elementtype='societe';
@@ -638,6 +641,9 @@ class ExtraFields
if (empty($pos)) $pos=0;
if (empty($list)) $list='0';
+ if (empty($totalizable)) {
+ $totalizable = 0;
+ }
if (empty($required)) $required=0;
if (empty($unique)) $unique=0;
if (empty($alwayseditable)) $alwayseditable=0;
@@ -681,6 +687,7 @@ class ExtraFields
$sql.= " alwayseditable,";
$sql.= " param,";
$sql.= " list,";
+ $sql.= " totalizable,";
$sql.= " fielddefault,";
$sql.= " fieldcomputed,";
$sql.= " fk_user_author,";
@@ -703,6 +710,7 @@ class ExtraFields
$sql.= " '".$this->db->escape($alwayseditable)."',";
$sql.= " '".$this->db->escape($params)."',";
$sql.= " '".$this->db->escape($list)."', ";
+ $sql.= " ".$totalizable.",";
$sql.= " ".(($default!='')?"'".$this->db->escape($default)."'":"null").",";
$sql.= " ".($computed?"'".$this->db->escape($computed)."'":"null").",";
$sql .= " " . $user->id . ",";
@@ -773,7 +781,7 @@ class ExtraFields
// We should not have several time this log. If we have, there is some optimization to do by calling a simple $object->fetch_optionals() that include cache management.
dol_syslog("fetch_name_optionals_label elementtype=".$elementtype);
- $sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,fielddefault,fieldcomputed,entity,enabled,help";
+ $sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,totalizable,fielddefault,fieldcomputed,entity,enabled,help";
$sql.= " FROM ".MAIN_DB_PREFIX."extrafields";
$sql.= " WHERE entity IN (0,".$conf->entity.")";
if ($elementtype) $sql.= " AND elementtype = '".$elementtype."'"; // Filed with object->table_element
@@ -807,6 +815,7 @@ class ExtraFields
$this->attribute_perms[$tab->name]=(strlen($tab->perms) == 0 ? 1 : $tab->perms);
$this->attribute_langfile[$tab->name]=$tab->langs;
$this->attribute_list[$tab->name]=$tab->list;
+ $this->attribute_totalizable[$tab->name]=$tab->totalizable;
$this->attribute_entityid[$tab->name]=$tab->entity;
$this->attribute_entitylabel[$tab->name]=(empty($labelmulticompany[$tab->entity])?'Entity'.$tab->entity:$labelmulticompany[$tab->entity]);
@@ -825,6 +834,7 @@ class ExtraFields
$this->attributes[$tab->elementtype]['perms'][$tab->name]=(strlen($tab->perms) == 0 ? 1 : $tab->perms);
$this->attributes[$tab->elementtype]['langfile'][$tab->name]=$tab->langs;
$this->attributes[$tab->elementtype]['list'][$tab->name]=$tab->list;
+ $this->attributes[$tab->elementtype]['totalizable'][$tab->name]=$tab->totalizable;
$this->attributes[$tab->elementtype]['entityid'][$tab->name]=$tab->entity;
$this->attributes[$tab->elementtype]['entitylabel'][$tab->name]=(empty($labelmulticompany[$tab->entity])?'Entity'.$tab->entity:$labelmulticompany[$tab->entity]);
$this->attributes[$tab->elementtype]['enabled'][$tab->name]=$tab->enabled;
@@ -886,6 +896,7 @@ class ExtraFields
$perms=dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1);
$langfile=$this->attributes[$extrafieldsobjectkey]['langfile'][$key];
$list=dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1);
+ $totalizable=$this->attributes[$extrafieldsobjectkey]['totalizable'][$key];
$help=$this->attributes[$extrafieldsobjectkey]['help'][$key];
$hidden=(empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
}
@@ -902,6 +913,7 @@ class ExtraFields
$param=$this->attribute_param[$key];
$langfile=$this->attribute_langfile[$key];
$list=$this->attribute_list[$key];
+ $totalizable=$this->attribute_totalizable[$key];
$hidden=(empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
}
@@ -1753,7 +1765,7 @@ class ExtraFields
$align='';
- if ($type == 'date')
+ if ($type == 'date')
{
$align="center";
}
@@ -1781,6 +1793,10 @@ class ExtraFields
{
$align="center";
}
+ elseif ($type == 'price')
+ {
+ $align="right";
+ }
return $align;
}
diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php
index f437920caf9..dcc282794b9 100644
--- a/htdocs/core/class/html.formprojet.class.php
+++ b/htdocs/core/class/html.formprojet.class.php
@@ -468,9 +468,10 @@ class FormProjets
* @param string $socid If of thirdparty to use as filter or 'id1,id2,...'
* @param string $morecss More CSS
* @param int $limitonstatus Add filters to limit length of list to opened status (for example to avoid ERR_RESPONSE_HEADERS_TOO_BIG on project/element.php page). TODO To implement
+ * @param string $projectkey Equivalent key to fk_projet for actual table_element
* @return int|string The HTML select list of element or '' if nothing or -1 if KO
*/
- function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2)
+ function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2,$projectkey="fk_projet")
{
global $conf, $langs;
@@ -480,7 +481,7 @@ class FormProjets
if (! in_array($table_element, array('don','expensereport_det','expensereport','loan','stock_mouvement','chargesociales'))) $linkedtothirdparty=true;
$sqlfilter='';
- $projectkey="fk_projet";
+
//print $table_element;
switch ($table_element)
{
diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php
index ffa9dafdfbe..7f0f8143cbd 100644
--- a/htdocs/core/class/smtps.class.php
+++ b/htdocs/core/class/smtps.class.php
@@ -656,7 +656,7 @@ class SMTPs
{
// If the path is not valid, this will NOT generate an error,
// it will simply return false.
- if ( ! @include ( $_strConfigPath ) )
+ if ( ! @include $_strConfigPath)
{
$this->_setErr(110, '"' . $_strConfigPath . '" is not a valid path.');
$_retVal = false;
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index eb3ef3698a4..0e7203ba748 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -1201,7 +1201,7 @@ function activateModulesRequiredByCountry($country_code)
{
activateModule($modName);
- setEventMessage($objMod->automatic_activation[$country_code],'warnings');
+ setEventMessages($objMod->automatic_activation[$country_code], null, 'warnings');
}
}
diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php
index 5e1e300520c..28584b60e32 100644
--- a/htdocs/core/lib/bank.lib.php
+++ b/htdocs/core/lib/bank.lib.php
@@ -356,9 +356,9 @@ function checkES($IentOfi, $InumCta)
$sum = 0;
for ($i = 0; $i < 11; $i++) {
- $sum += $values[$i] * substr($InumCta, $i, 1);
+ $sum += $values[$i] * (int) substr($InumCta, $i, 1);//int to cast result of substr to a number
}
-
+
$key = 11 - $sum % 11;
if ($key == 10)
diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php
index 866cf004ca6..f318f493417 100644
--- a/htdocs/core/lib/invoice2.lib.php
+++ b/htdocs/core/lib/invoice2.lib.php
@@ -23,8 +23,8 @@
* \brief Function to rebuild PDF and merge PDF files into one
*/
-require_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
-require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
+require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
/**
diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php
index 78f517b6768..3226745d6c0 100644
--- a/htdocs/core/modules/modExpenseReport.class.php
+++ b/htdocs/core/modules/modExpenseReport.class.php
@@ -23,7 +23,7 @@
* \ingroup expensereport
* \brief Description and activation file for module ExpenseReport
*/
-include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php");
+include_once DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php";
/**
diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php
index 6b9f81a5a1f..d713b4edc4a 100644
--- a/htdocs/core/modules/modHRM.class.php
+++ b/htdocs/core/modules/modHRM.class.php
@@ -20,7 +20,7 @@
* \ingroup HRM
* \brief Description and activation file for module HRM
*/
-include_once (DOL_DOCUMENT_ROOT . "/core/modules/DolibarrModules.class.php");
+include_once DOL_DOCUMENT_ROOT . "/core/modules/DolibarrModules.class.php";
/**
* Class to describe and activate the HRM module
diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php
index 0ba265e6089..eb1b727ea31 100644
--- a/htdocs/core/modules/modHoliday.class.php
+++ b/htdocs/core/modules/modHoliday.class.php
@@ -28,7 +28,7 @@
* \ingroup holiday
* \brief Description and activation file for module holiday
*/
-include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php");
+include_once DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php";
/**
diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php
index 23c1b2680b8..951a8ea5d63 100644
--- a/htdocs/core/modules/modOpenSurvey.class.php
+++ b/htdocs/core/modules/modOpenSurvey.class.php
@@ -23,7 +23,7 @@
* \ingroup opensurvey
* \brief Description and activation file for module OpenSurvey
*/
-include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php");
+include_once DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php";
/**
diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php
index 9e319c8bf41..e17035eda3d 100644
--- a/htdocs/core/modules/modSalaries.class.php
+++ b/htdocs/core/modules/modSalaries.class.php
@@ -5,7 +5,7 @@
* Copyright (C) 2004 Benoit Mortier
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2014 Juanjo Menent
- * Copyright (C) 2014 Alexandre Spangaro
+ * Copyright (C) 2014 Alexandre Spangaro
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,11 +23,11 @@
*/
/**
- * \defgroup salaries Module salaries
- * \brief Module to include salaries management
- * \file htdocs/core/modules/modSalaries.class.php
- * \ingroup salaries
- * \brief File to activate module salaries
+ * \defgroup salaries Module salaries
+ * \brief Module to include salaries management
+ * \file htdocs/core/modules/modSalaries.class.php
+ * \ingroup salaries
+ * \brief File to activate module salaries
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
@@ -184,7 +184,7 @@ class modSalaries extends DolibarrModules
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories
*
- * @param string $options Options when enabling module ('', 'noboxes')
+ * @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/
function init($options='')
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index 2f393e50002..92b3ea54a48 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -206,7 +206,7 @@ class doc_generic_project_odt extends ModelePDFProjects
$ret[$pc.'phone_mobile'] = $ct->phone_mobile;
// fetch external user extrafields
- require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
+ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label($ct->table_element, true);
$extrafields_num = $ct->fetch_optionals();
diff --git a/htdocs/core/modules/syslog/mod_syslog_chromephp.php b/htdocs/core/modules/syslog/mod_syslog_chromephp.php
index 7523588ac15..2617cdb269d 100644
--- a/htdocs/core/modules/syslog/mod_syslog_chromephp.php
+++ b/htdocs/core/modules/syslog/mod_syslog_chromephp.php
@@ -66,8 +66,8 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
}
set_include_path($conf->global->SYSLOG_CHROMEPHP_INCLUDEPATH);
- $res = @include_once('ChromePhp.php');
- if (! $res) $res=@include_once('ChromePhp.class.php');
+ $res = @include_once 'ChromePhp.php';
+ if (! $res) $res=@include_once 'ChromePhp.class.php';
restore_include_path();
@@ -152,12 +152,12 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
try
{
- // Warning ChromePHP must be into PHP include path. It is not possible to use into require_once() a constant from
+ // Warning ChromePHP must be into PHP include path. It is not possible to use into require_once a constant from
// database or config file because we must be able to log data before database or config file read.
$oldinclude=get_include_path();
set_include_path($conf->global->SYSLOG_CHROMEPHP_INCLUDEPATH);
- $res = @include_once('ChromePhp.php');
- if (! $res) $res=@include_once('ChromePhp.class.php');
+ $res = @include_once 'ChromePhp.php';
+ if (! $res) $res=@include_once 'ChromePhp.class.php';
set_include_path($oldinclude);
ob_start(); // To be sure headers are not flushed until all page is completely processed
diff --git a/htdocs/core/modules/syslog/mod_syslog_firephp.php b/htdocs/core/modules/syslog/mod_syslog_firephp.php
index f502022c4f6..98a3c7142af 100644
--- a/htdocs/core/modules/syslog/mod_syslog_firephp.php
+++ b/htdocs/core/modules/syslog/mod_syslog_firephp.php
@@ -153,7 +153,7 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
try
{
- // Warning FirePHPCore must be into PHP include path. It is not possible to use into require_once() a constant from
+ // Warning FirePHPCore must be into PHP include path. It is not possible to use into require_once a constant from
// database or config file because we must be able to log data before database or config file read.
$oldinclude=get_include_path();
set_include_path($conf->global->SYSLOG_FIREPHP_INCLUDEPATH);
diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php
index e80685154fc..2c971c7a553 100644
--- a/htdocs/core/tpl/admin_extrafields_add.tpl.php
+++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2010-2017 Laurent Destailleur
* Copyright (C) 2012 Regis Houssin
* Copyright (C) 2016 Charlie Benke
+ * Copyright (C) 2018 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -52,6 +53,7 @@ $langs->load("modulebuilder");
var required = jQuery("#required");
var alwayseditable = jQuery("#alwayseditable");
var list = jQuery("#list");
+ var totalizable = jQuery("#totalizable");
load("modulebuilder");
textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?>
+
+trans("Totalizable"); ?> >
textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?>
multicompany->enabled) { ?>
diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php
index cb5ef26bc57..d4dc2776fde 100644
--- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php
+++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php
@@ -1,6 +1,7 @@
* Copyright (C) 2012 Regis Houssin
+ * Copyright (C) 2018 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -51,6 +52,7 @@ $langs->load("modulebuilder");
var required = jQuery("#required");
var alwayseditable = jQuery("#alwayseditable");
var list = jQuery("#list");
+ var totalizable = jQuery("#totalizable");
attributes[$elementtype]['param'][$attrname];
$perms=$extrafields->attributes[$elementtype]['perms'][$attrname];
$langfile=$extrafields->attributes[$elementtype]['langfile'][$attrname];
$list=$extrafields->attributes[$elementtype]['list'][$attrname];
+$totalizable = $extrafields->attributes[$elementtype]['totalizable'][$attrname];
$help=$extrafields->attributes[$elementtype]['help'][$attrname];
$entitycurrentorall=$extrafields->attributes[$elementtype]['entityid'][$attrname];
@@ -251,6 +254,7 @@ else
trans("AlwaysEditable"); ?> >
textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?>
+textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")); ?> >
textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?>
multicompany->enabled) { ?>
diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php
index a03c06f2d1d..ebe7a49877d 100644
--- a/htdocs/core/tpl/admin_extrafields_view.tpl.php
+++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php
@@ -1,6 +1,7 @@
* Copyright (C) 2012-2017 Regis Houssin
+ * Copyright (C) 2018 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -61,6 +62,7 @@ print ''.$langs->trans("Unique").' ';
print ''.$langs->trans("Required").' ';
print ''.$langs->trans("AlwaysEditable").' ';
print ''.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).' ';
+print ''.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).' ';
if ($conf->multicompany->enabled) {
print ''.$langs->trans("Entities").' ';
}
@@ -88,6 +90,7 @@ if (is_array($extrafields->attributes[$elementtype]['type']) && count($extrafiel
print ''.yn($extrafields->attributes[$elementtype]['required'][$key])." \n";
print ''.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])." \n";
print ''.$extrafields->attributes[$elementtype]['list'][$key]." \n";
+ print ''.yn($extrafields->attributes[$elementtype]['totalizable'][$key])." \n";
if (! empty($conf->multicompany->enabled)) {
print ''.($extrafields->attributes[$elementtype]['entityid'][$key]==0?$langs->trans("All"):$extrafields->attributes[$elementtype]['entitylabel'][$key]).' ';
}
diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
index e59f50501ab..b506bda0793 100644
--- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
+++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
@@ -40,6 +40,14 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_
print $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey);
print '';
if (! $i) $totalarray['nbfield']++;
+
+ if ($extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key]) {
+ if (! $i) {
+ // we keep position for the first line
+ $totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield'];
+ }
+ $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey;
+ }
if (! empty($val['isameasure']))
{
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey;
diff --git a/htdocs/core/tpl/resource_add.tpl.php b/htdocs/core/tpl/resource_add.tpl.php
index af1d25aaee1..688d3aba221 100644
--- a/htdocs/core/tpl/resource_add.tpl.php
+++ b/htdocs/core/tpl/resource_add.tpl.php
@@ -9,7 +9,7 @@ if (empty($conf) || ! is_object($conf))
}
-require_once(DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php');
+require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php';
$form = new Form($db);
$formresources = new FormResource($db);
diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php
index 56bbd897f3d..3e28ea3e4ef 100644
--- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php
+++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php
@@ -152,9 +152,12 @@ class InterfaceTicketEmail extends DolibarrTriggers
}
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1);
- if ($mailfile->error) {
- setEventMessage($mailfile->error, 'errors');
- } else {
+ if ($mailfile->error)
+ {
+ setEventMessages($mailfile->error, $mailfile->errors, 'errors');
+ }
+ else
+ {
$result = $mailfile->sendfile();
}
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
diff --git a/htdocs/cron/admin/cron.php b/htdocs/cron/admin/cron.php
index 729772bcf7e..647aa8b96e3 100644
--- a/htdocs/cron/admin/cron.php
+++ b/htdocs/cron/admin/cron.php
@@ -25,7 +25,7 @@
*/
// Dolibarr environment
-$res = @include("../../main.inc.php"); // From htdocs directory
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php';
diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php
index e3235789d66..3ccf27ee676 100644
--- a/htdocs/cron/class/cronjob.class.php
+++ b/htdocs/cron/class/cronjob.class.php
@@ -22,7 +22,7 @@
*/
// Put here all includes required by your class file
-require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
+require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
/**
diff --git a/htdocs/dav/fileserver.php b/htdocs/dav/fileserver.php
index a1d145306f5..2fc4485dc76 100644
--- a/htdocs/dav/fileserver.php
+++ b/htdocs/dav/fileserver.php
@@ -28,7 +28,7 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOLOGIN')) define("NOLOGIN",1); // This means this output page does not require to be logged.
if (! defined('NOCSRFCHECK')) define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
-require ("../main.inc.php");
+require "../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/dav/dav.class.php';
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index ab860ced2e9..d56134b7726 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -276,7 +276,7 @@ if (empty($reshook))
// We try to set an amount
// Case we dont use the list of available qty for each warehouse/lot
// GUI does not allow this yet
- setEventMessage('StockIsRequiredToChooseWhichLotToUse', 'errors');
+ setEventMessages($langs->trans("StockIsRequiredToChooseWhichLotToUse"), null, 'errors');
}
}
}
@@ -504,7 +504,7 @@ if (empty($reshook))
// Action update
else if (
- ($action == 'settracking_number'
+ ($action == 'settracking_number'
|| $action == 'settracking_url'
|| $action == 'settrueWeight'
|| $action == 'settrueWidth'
@@ -2594,7 +2594,6 @@ else if ($id || $ref)
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 4042b202300..4974722166c 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -1114,7 +1114,7 @@ class Expedition extends CommonObject
// Stock control
if (! $error && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > 0)
{
- require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
+ require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php";
$langs->load("agenda");
diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php
index 3f557059600..acc2b5e1142 100644
--- a/htdocs/expedition/contact.php
+++ b/htdocs/expedition/contact.php
@@ -268,6 +268,6 @@ if ($id > 0 || ! empty($ref))
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php
index 4f9616df5ed..5d76a5f4918 100644
--- a/htdocs/expedition/document.php
+++ b/htdocs/expedition/document.php
@@ -185,7 +185,6 @@ else{
exit;
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php
index 042d107b58e..8dde7bf0125 100644
--- a/htdocs/expedition/index.php
+++ b/htdocs/expedition/index.php
@@ -291,6 +291,6 @@ else dol_print_error($db);
print '';
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index 14f9eb41f44..327a9394b77 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -632,5 +632,6 @@ else
dol_print_error($db);
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php
index fafaf10fe1f..f276b2d0cb4 100644
--- a/htdocs/expedition/note.php
+++ b/htdocs/expedition/note.php
@@ -152,7 +152,6 @@ if ($id > 0 || ! empty($ref))
dol_fiche_end();
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index cb058e44598..0d3111d9f12 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -926,7 +926,6 @@ if ($id > 0 || ! empty($ref))
}
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php
index 651be627b78..a167a447d7d 100644
--- a/htdocs/expedition/stats/index.php
+++ b/htdocs/expedition/stats/index.php
@@ -358,6 +358,6 @@ print '';
print '
';
print ''.$langs->trans("StatsOnShipmentsOnlyValidated").'';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/expedition/stats/month.php b/htdocs/expedition/stats/month.php
index b7d217217c2..27b01cc6f55 100644
--- a/htdocs/expedition/stats/month.php
+++ b/htdocs/expedition/stats/month.php
@@ -71,6 +71,6 @@ print $px->show();
print '';
print '';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 141260d36f3..75285bf35cf 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -1450,8 +1450,9 @@ else
print $langs->trans('NotUserRightToView');
print '';
- llxFooter();
- $db->close();
+ // End of page
+ llxFooter();
+ $db->close();
exit;
}
diff --git a/htdocs/expensereport/class/expensereportstats.class.php b/htdocs/expensereport/class/expensereportstats.class.php
index 07396663f42..2c15b1ffed5 100644
--- a/htdocs/expensereport/class/expensereportstats.class.php
+++ b/htdocs/expensereport/class/expensereportstats.class.php
@@ -22,8 +22,8 @@
* \ingroup expensereport
* \brief Fichier de la classe de gestion des stats des expensereport et notes de frais
*/
-include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php';
-include_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
+require_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php';
+require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
/**
* Classe permettant la gestion des stats des expensereports et notes de frais
diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php
index 0634ca16b7a..781b22d27e7 100644
--- a/htdocs/expensereport/class/paymentexpensereport.class.php
+++ b/htdocs/expensereport/class/paymentexpensereport.class.php
@@ -505,7 +505,7 @@ class PaymentExpenseReport extends CommonObject
if (! empty($conf->banque->enabled))
{
- require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$acc = new Account($this->db);
$acc->fetch($accountid);
diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php
index f0d61d0f80d..0ac498ca775 100644
--- a/htdocs/expensereport/document.php
+++ b/htdocs/expensereport/document.php
@@ -139,6 +139,6 @@ else
print $langs->trans("ErrorUnknown");
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/expensereport/export_csv.php b/htdocs/expensereport/export_csv.php
index 4bc461b4d13..8ea72191b1d 100644
--- a/htdocs/expensereport/export_csv.php
+++ b/htdocs/expensereport/export_csv.php
@@ -195,6 +195,6 @@ if (isset($_POST['action']))
print '';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php
index 0d988e4850d..758dd89afe2 100644
--- a/htdocs/expensereport/index.php
+++ b/htdocs/expensereport/index.php
@@ -231,6 +231,6 @@ else dol_print_error($db);
print '';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/expensereport/info.php b/htdocs/expensereport/info.php
index 6babfcd647c..67f70f3a984 100644
--- a/htdocs/expensereport/info.php
+++ b/htdocs/expensereport/info.php
@@ -79,6 +79,6 @@ if ($id > 0 || ! empty($ref))
dol_fiche_end();
}
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php
index e576889d363..d328cd21de2 100644
--- a/htdocs/expensereport/list.php
+++ b/htdocs/expensereport/list.php
@@ -26,7 +26,7 @@
* \brief list of expense reports
*/
-require "../main.inc.php";
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
@@ -861,7 +861,6 @@ else
dol_print_error($db);
}
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/expensereport/note.php b/htdocs/expensereport/note.php
index 7eb48443901..deb38abe8d6 100644
--- a/htdocs/expensereport/note.php
+++ b/htdocs/expensereport/note.php
@@ -56,7 +56,7 @@ $permissionnote=$user->rights->expensereport->creer; // Used by the include of a
* Actions
*/
-include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
+include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*
@@ -97,6 +97,6 @@ if ($id > 0 || ! empty($ref))
dol_fiche_end();
}
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php
index 2876d512c52..2c053d5cc35 100644
--- a/htdocs/expensereport/payment/card.php
+++ b/htdocs/expensereport/payment/card.php
@@ -310,6 +310,6 @@ if ($action == '')
print '';
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/expensereport/payment/info.php b/htdocs/expensereport/payment/info.php
index 97098ef2340..6c7f8dd99c6 100644
--- a/htdocs/expensereport/payment/info.php
+++ b/htdocs/expensereport/payment/info.php
@@ -77,5 +77,6 @@ print '';
dol_fiche_end();
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/expensereport/payment/payment.php b/htdocs/expensereport/payment/payment.php
index 23959c06e67..dc78b933055 100644
--- a/htdocs/expensereport/payment/payment.php
+++ b/htdocs/expensereport/payment/payment.php
@@ -336,5 +336,6 @@ if ($action == 'create' || empty($action))
print "\n";
}
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php
index b4f0327cd39..b97129a5779 100644
--- a/htdocs/expensereport/stats/index.php
+++ b/htdocs/expensereport/stats/index.php
@@ -305,7 +305,6 @@ print '';
dol_fiche_end();
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php
index bccf25f1be8..81027882b6b 100644
--- a/htdocs/exports/index.php
+++ b/htdocs/exports/index.php
@@ -145,7 +145,6 @@ print '';
//print '';
-
+// End of page
llxFooter();
-
$db->close();
diff --git a/htdocs/externalsite/frametop.php b/htdocs/externalsite/frametop.php
index 5abc4e840a3..ee746d745cc 100644
--- a/htdocs/externalsite/frametop.php
+++ b/htdocs/externalsite/frametop.php
@@ -22,7 +22,7 @@
* \brief Top frame to show external web application
*/
-require ("../main.inc.php");
+require "../main.inc.php";
// Load translation files required by the page
$langs->load("externalsite");
diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php
index 96d7e106b5a..08600d71ee5 100644
--- a/htdocs/fichinter/card-rec.php
+++ b/htdocs/fichinter/card-rec.php
@@ -29,12 +29,7 @@
* \brief Page to show predefined fichinter
*/
-$res=0;
-if (! $res && file_exists("../../main.inc.php"))
- $res=@include("../../main.inc.php"); // For root directory
-if (! $res && file_exists("../../../main.inc.php"))
- $res=@include("../../../main.inc.php"); // For "custom" directory
-
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinterrec.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
@@ -409,8 +404,7 @@ if ($action == 'create') {
$var=true;
while ($i < $num) {
$objp = $db->fetch_object($result);
- $var=!$var;
- print "";
+ print ' ';
// Show product and description
@@ -738,10 +732,8 @@ if ($action == 'create') {
$num = count($object->lines);
$i = 0;
- $var=true;
while ($i < $num) {
- $var=!$var;
-
+
// Show product and description
if (isset($object->lines[$i]->product_type))
$type=$object->lines[$i]->product_type;
@@ -753,7 +745,7 @@ if ($action == 'create') {
if (! empty($objp->date_end)) $type=1;
// Show line
- print " ";
+ print ' ';
print '';
$text = img_object($langs->trans('Service'), 'service');
print $text.' '.nl2br($object->lines[$i]->desc);
@@ -884,12 +876,10 @@ if ($action == 'create') {
// les filtres Ă faire ensuite
if ($num > 0) {
- $var=true;
while ($i < min($num, $limit)) {
$objp = $db->fetch_object($resql);
- $var=!$var;
- print " ";
+ print ' ';
print '';
print img_object($langs->trans("ShowIntervention"), "intervention").' '.$objp->titre;
print " \n";
@@ -964,7 +954,7 @@ if ($action == 'create') {
}
}
} else
- print ' '.$langs->trans("NoneF").' ';
+ print ''.$langs->trans("NoneF").' ';
print "";
$db->free($resql);
diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
index a72e225b535..910115d8822 100644
--- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
@@ -24,9 +24,9 @@
*/
// Put here all includes required by your class file
-require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
-//require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
-//require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
+require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
+//require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
+//require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
/**
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index e1670e0c4d0..bab095fe6fa 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -4,7 +4,7 @@
* Copyright (C) 2005 Eric Seigne
* Copyright (C) 2005-2016 Regis Houssin
* Copyright (C) 2010-2015 Juanjo Menent
- * Copyright (C) 2011-2015 Philippe Grand
+ * Copyright (C) 2011-2018 Philippe Grand
* Copyright (C) 2012-2016 Marcos GarcĂa
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2014 Ion Agorria
@@ -350,8 +350,10 @@ if (empty($reshook))
if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) {
$idprod = $res->fk_product_child;
- } else {
- setEventMessage($langs->trans('ErrorProductCombinationNotFound'), 'errors');
+ }
+ else
+ {
+ setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors');
$error ++;
}
}
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index 971f99717f4..25f3118ad14 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -425,7 +425,7 @@ if (empty($reshook))
if (! $error)
{
$db->commit();
- setEventMessage($langs->trans('BillCreated', $nb_bills_created));
+ setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs');
}
else
{
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index d409ba35b86..aefd04914ad 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -1160,8 +1160,10 @@ if (empty($reshook))
if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) {
$idprod = $res->fk_product_child;
- } else {
- setEventMessage($langs->trans('ErrorProductCombinationNotFound'), 'errors');
+ }
+ else
+ {
+ setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors');
$error ++;
}
}
diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php
index 943d4fa94e1..de8489ebb55 100644
--- a/htdocs/ftp/index.php
+++ b/htdocs/ftp/index.php
@@ -22,7 +22,7 @@
* \brief Main page for FTP section area
*/
-require('../main.inc.php');
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
@@ -378,7 +378,7 @@ jQuery(document).ready(function() {
$(".checkboxfordelete").prop('checked', false);
jQuery("#delconst").hide();
});
-
+
});
@@ -408,7 +408,7 @@ else
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1);
-
+
}
// Confirmation de la suppression d'une ligne categorie
@@ -486,7 +486,7 @@ else
$newsection=$section;
$newsectioniso=utf8_decode($section);
//$newsection='/home';
-
+
// List content of directory ($newsection = '/', '/home', ...)
if (! empty($conf->global->FTP_CONNECT_WITH_SFTP))
{
@@ -551,7 +551,7 @@ else
$is_directory=ftp_isdir($conn_id, $newremotefileiso);
}
-
+
print '';
// Name
print '';
@@ -615,14 +615,14 @@ else
print "";
-
+
if (! $ok)
{
print $mesg.'
'."\n";
setEventMessages($mesg, null, 'errors');
}
-
-
+
+
// Actions
/*
if ($user->rights->ftp->write && ! empty($section))
@@ -654,7 +654,7 @@ else
break;
}
$i++;
- }
+ }
if (! $foundsetup)
{
print $langs->trans("SetupOfFTPClientModuleNotComplete");
@@ -669,11 +669,11 @@ else
print '
';
// Close FTP connection
-if ($conn_id)
+if ($conn_id)
{
if (! empty($conf->global->FTP_CONNECT_WITH_SFTP))
{
-
+
}
else if (! empty($conf->global->FTP_CONNECT_WITH_SSL))
{
@@ -684,7 +684,7 @@ if ($conn_id)
ftp_close($conn_id);
}
}
-
+
llxFooter();
@@ -709,7 +709,7 @@ function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $sect
$ok=1;
$conn_id=null;
-
+
if (! is_numeric($ftp_port))
{
$mesg=$langs->transnoentitiesnoconv("FailedToConnectToFTPServer",$ftp_server,$ftp_port);
@@ -719,17 +719,17 @@ function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $sect
if ($ok)
{
$connecttimeout=(empty($conf->global->FTP_CONNECT_TIMEOUT)?40:$conf->global->FTP_CONNECT_TIMEOUT);
- if (! empty($conf->global->FTP_CONNECT_WITH_SFTP))
+ if (! empty($conf->global->FTP_CONNECT_WITH_SFTP))
{
dol_syslog('Try to connect with ssh2_ftp');
$tmp_conn_id = ssh2_connect($ftp_server, $ftp_port);
}
- else if (! empty($conf->global->FTP_CONNECT_WITH_SSL))
+ else if (! empty($conf->global->FTP_CONNECT_WITH_SSL))
{
dol_syslog('Try to connect with ftp_ssl_connect');
$conn_id = ftp_ssl_connect($ftp_server, $ftp_port, $connecttimeout);
}
- else
+ else
{
dol_syslog('Try to connect with ftp_connect');
$conn_id = ftp_connect($ftp_server, $ftp_port, $connecttimeout);
@@ -744,7 +744,7 @@ function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $sect
{
// Turn on passive mode transfers (must be after a successful login
//if ($ftp_passive) ftp_pasv($conn_id, true);
-
+
// Change the dir
$newsectioniso=utf8_decode($section);
//ftp_chdir($conn_id, $newsectioniso);
@@ -756,25 +756,25 @@ function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $sect
$error++;
}
}
- else
+ else
{
$mesg=$langs->transnoentitiesnoconv("FailedToConnectToFTPServerWithCredentials");
$ok=0;
$error++;
}
- }
+ }
else
{
if (ftp_login($conn_id, $ftp_user, $ftp_password))
{
// Turn on passive mode transfers (must be after a successful login
if ($ftp_passive) ftp_pasv($conn_id, true);
-
+
// Change the dir
$newsectioniso=utf8_decode($section);
ftp_chdir($conn_id, $newsectioniso);
}
- else
+ else
{
$mesg=$langs->transnoentitiesnoconv("FailedToConnectToFTPServerWithCredentials");
$ok=0;
diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php
index 494c572eaad..1b6046d50f8 100644
--- a/htdocs/holiday/card.php
+++ b/htdocs/holiday/card.php
@@ -26,7 +26,7 @@
* \brief Form and file creation of paid holiday.
*/
-require('../main.inc.php');
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php
index 55724549360..380f609ec6d 100644
--- a/htdocs/holiday/define_holiday.php
+++ b/htdocs/holiday/define_holiday.php
@@ -26,7 +26,7 @@
* \brief File that defines the balance of paid holiday of users.
*/
-require('../main.inc.php');
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php
index 5df3fdb314b..86ca95580b1 100644
--- a/htdocs/holiday/list.php
+++ b/htdocs/holiday/list.php
@@ -23,7 +23,7 @@
* \brief List of holiday
*/
-require('../main.inc.php');
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php
index 1e72122c2be..0faa2b56585 100644
--- a/htdocs/holiday/month_report.php
+++ b/htdocs/holiday/month_report.php
@@ -22,7 +22,7 @@
* \brief Monthly report of leave requests.
*/
-require('../main.inc.php');
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php
index 198b9a8854c..c36ccd1f4d7 100644
--- a/htdocs/holiday/view_log.php
+++ b/htdocs/holiday/view_log.php
@@ -23,7 +23,7 @@
* \ingroup holiday
*/
-require('../main.inc.php');
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php
index 996ddd58ed3..f52cb1afc61 100644
--- a/htdocs/hrm/admin/admin_establishment.php
+++ b/htdocs/hrm/admin/admin_establishment.php
@@ -20,7 +20,7 @@
* \ingroup HRM
* \brief HRM Establishment module setup page
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php';
require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php';
diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php
index a7a8b8a9352..ac47eec6292 100644
--- a/htdocs/hrm/admin/admin_hrm.php
+++ b/htdocs/hrm/admin/admin_hrm.php
@@ -20,7 +20,7 @@
* \ingroup HRM
* \brief HRM module setup page
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php
index db316098003..c95e886e792 100644
--- a/htdocs/hrm/establishment/card.php
+++ b/htdocs/hrm/establishment/card.php
@@ -19,7 +19,7 @@
* \file htdocs/hrm/establishment/card.php
* \brief Page to show an establishment
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php';
require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php
index 76eb236d1a1..6cd44861ad5 100644
--- a/htdocs/hrm/establishment/info.php
+++ b/htdocs/hrm/establishment/info.php
@@ -20,7 +20,7 @@
* \brief Page to show info of an establishment
*/
-require('../../main.inc.php');
+require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php';
diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php
index 365d40cca96..b49dfd92998 100644
--- a/htdocs/hrm/index.php
+++ b/htdocs/hrm/index.php
@@ -24,7 +24,7 @@
* \brief Home page for HRM area.
*/
-require('../main.inc.php');
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql
index 87ada98390b..be072b8bacb 100644
--- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql
+++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql
@@ -1,7 +1,7 @@
--
-- Be carefull to requests order.
-- This file must be loaded by calling /install/index.php page
--- when current version is 8.0.0 or higher.
+-- when current version is 9.0.0 or higher.
--
-- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y
-- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y
@@ -28,8 +28,8 @@
-- Note: fields with type BLOB/TEXT can't have default value.
-
ALTER TABLE llx_extrafields ADD COLUMN help text NULL;
+ALTER TABLE llx_extrafields ADD COLUMN totalizable boolean DEFAULT FALSE after list;
ALTER TABLE llx_user ADD COLUMN dateemploymentend date after dateemployment;
@@ -49,3 +49,4 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_DELETE','Intervention is deleted','Executed when a intervention is deleted','ficheinter',35);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',204);
+ALTER TABLE llx_payment_salary ADD COLUMN fk_projet integer DEFAULT NULL after amount;
diff --git a/htdocs/install/mysql/tables/llx_extrafields.sql b/htdocs/install/mysql/tables/llx_extrafields.sql
index 1a85fc28a5a..9f37383957a 100644
--- a/htdocs/install/mysql/tables/llx_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_extrafields.sql
@@ -36,6 +36,7 @@ create table llx_extrafields
alwayseditable integer DEFAULT 0, -- 1 if field can be edited whatever is element status
param text, -- extra parameters to define possible values of field
list varchar(255) DEFAULT '1', -- visibility of field. 0=Never visible, 1=Visible on list and forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing
+ totalizable boolean DEFAULT FALSE, -- is extrafield totalizable on list
langs varchar(64), -- example: fileofmymodule@mymodule
help text, -- to store help tooltip
fk_user_author integer, -- user making creation
diff --git a/htdocs/install/mysql/tables/llx_payment_salary.sql b/htdocs/install/mysql/tables/llx_payment_salary.sql
index e3bcd0a9c4a..4fcbc233f33 100644
--- a/htdocs/install/mysql/tables/llx_payment_salary.sql
+++ b/htdocs/install/mysql/tables/llx_payment_salary.sql
@@ -26,11 +26,12 @@ create table llx_payment_salary
datev date, -- value date (this field should not be here, only into bank tables)
salary double(24,8), -- salary of user when payment was done
amount double(24,8) NOT NULL DEFAULT 0,
+ fk_projet integer DEFAULT NULL,
fk_typepayment integer NOT NULL,
num_payment varchar(50), -- ref
label varchar(255),
datesp date, -- date start period
- dateep date, -- date end period
+ dateep date, -- date end period
entity integer DEFAULT 1 NOT NULL, -- multi company id
note text,
fk_bank integer,
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 72725d3d634..8b47c46cef9 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -733,6 +733,8 @@ Result=Result
ToTest=Test
ValidateBefore=Card must be validated before using this feature
Visibility=Visibility
+Totalizable=Totalizable
+TotalizableDesc=This field is totalizable in list
Private=Private
Hidden=Hidden
Resources=Resources
diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang
index 058fdee0637..9ab397f190c 100644
--- a/htdocs/langs/en_US/projects.lang
+++ b/htdocs/langs/en_US/projects.lang
@@ -91,6 +91,7 @@ ListFichinterAssociatedProject=List of interventions associated with the project
ListExpenseReportsAssociatedProject=List of expense reports associated with the project
ListDonationsAssociatedProject=List of donations associated with the project
ListVariousPaymentsAssociatedProject=List of miscellaneous payments associated with the project
+ListSalariesAssociatedProject=List of salaries associated with the project
ListActionsAssociatedProject=List of events associated with the project
ListTaskTimeUserProject=List of time consumed on tasks of project
ListTaskTimeForTask=List of time consumed on task
diff --git a/htdocs/langs/en_US/salaries.lang b/htdocs/langs/en_US/salaries.lang
index 1efb877673d..2ba84f19514 100644
--- a/htdocs/langs/en_US/salaries.lang
+++ b/htdocs/langs/en_US/salaries.lang
@@ -5,6 +5,7 @@ SALARIES_ACCOUNTING_ACCOUNT_CHARGE=Accounting account by default for wage paymen
Salary=Salary
Salaries=Salaries
NewSalaryPayment=New salary payment
+AddSalaryPayment=Add salary payment
SalaryPayment=Salary payment
SalariesPayments=Salaries payments
ShowSalaryPayment=Show salary payment
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 826f83356c4..797298c4653 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1732,7 +1732,7 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra
// Define $bookmarks
if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire)
{
- include_once (DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php');
+ include_once DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php';
$langs->load("bookmarks");
$bookmarks=printBookmarksList($db, $langs);
diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php
index eaa53aa8490..ced69451d9d 100644
--- a/htdocs/margin/admin/margin.php
+++ b/htdocs/margin/admin/margin.php
@@ -26,8 +26,8 @@ include '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
-require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
-require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
$langs->load("admin");
$langs->load("bills");
diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php
index 5350fd170f1..2eb20f48fea 100644
--- a/htdocs/modulebuilder/index.php
+++ b/htdocs/modulebuilder/index.php
@@ -1640,7 +1640,7 @@ elseif (! empty($module))
}
else
{
- $result = @include_once($dirread.'/'.$pathtoclass);
+ $result = @include_once $dirread.'/'.$pathtoclass;
}
if (class_exists($tabobj))
{
diff --git a/htdocs/modulebuilder/template/admin/about.php b/htdocs/modulebuilder/template/admin/about.php
index b72917daff0..e580c6c7457 100644
--- a/htdocs/modulebuilder/template/admin/about.php
+++ b/htdocs/modulebuilder/template/admin/about.php
@@ -25,15 +25,15 @@
// Load Dolibarr environment
$res=0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php");
+if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
-if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php");
-if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php");
+if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
+if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
// Try main.inc.php using relative path
-if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
-if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php");
+if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
+if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
if (! $res) die("Include of main fails");
// Libraries
diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php
index fd2c509233b..2cc6468729c 100644
--- a/htdocs/modulebuilder/template/admin/setup.php
+++ b/htdocs/modulebuilder/template/admin/setup.php
@@ -25,15 +25,15 @@
// Load Dolibarr environment
$res=0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php");
+if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
-if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php");
-if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php");
+if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
+if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
// Try main.inc.php using relative path
-if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
-if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php");
+if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
+if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
if (! $res) die("Include of main fails");
global $langs, $user;
diff --git a/htdocs/modulebuilder/template/css/mymodule.css.php b/htdocs/modulebuilder/template/css/mymodule.css.php
index 5787fa4f64c..486d860e7f5 100644
--- a/htdocs/modulebuilder/template/css/mymodule.css.php
+++ b/htdocs/modulebuilder/template/css/mymodule.css.php
@@ -35,15 +35,15 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
// Load Dolibarr environment
$res=0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php");
+if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
-if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php");
-if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/../main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/../main.inc.php");
+if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
+if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/../main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/../main.inc.php";
// Try main.inc.php using relative path
-if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
-if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php");
+if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
+if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
if (! $res) die("Include of main fails");
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
diff --git a/htdocs/modulebuilder/template/js/mymodule.js.php b/htdocs/modulebuilder/template/js/mymodule.js.php
index 07f44756615..6a3447625a5 100644
--- a/htdocs/modulebuilder/template/js/mymodule.js.php
+++ b/htdocs/modulebuilder/template/js/mymodule.js.php
@@ -38,15 +38,15 @@ if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
// Load Dolibarr environment
$res=0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php");
+if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
-if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php");
-if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/../main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/../main.inc.php");
+if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
+if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/../main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/../main.inc.php";
// Try main.inc.php using relative path
-if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
-if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php");
+if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
+if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
if (! $res) die("Include of main fails");
// Define js type
diff --git a/htdocs/modulebuilder/template/mymoduleindex.php b/htdocs/modulebuilder/template/mymoduleindex.php
index bf56d00ede0..f439d4fd9d8 100644
--- a/htdocs/modulebuilder/template/mymoduleindex.php
+++ b/htdocs/modulebuilder/template/mymoduleindex.php
@@ -27,16 +27,16 @@
// Load Dolibarr environment
$res=0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php");
+if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
-if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php");
-if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php");
+if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
+if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
// Try main.inc.php using relative path
-if (! $res && file_exists("../main.inc.php")) $res=@include("../main.inc.php");
-if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
-if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php");
+if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php";
+if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
+if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
if (! $res) die("Include of main fails");
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php
index 5c7303ba6a9..dfd69037baf 100644
--- a/htdocs/modulebuilder/template/myobject_agenda.php
+++ b/htdocs/modulebuilder/template/myobject_agenda.php
@@ -25,16 +25,16 @@
// Load Dolibarr environment
$res=0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php");
+if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
-if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php");
-if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php");
+if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
+if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
// Try main.inc.php using relative path
-if (! $res && file_exists("../main.inc.php")) $res=@include("../main.inc.php");
-if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
-if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php");
+if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php";
+if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
+if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
if (! $res) die("Include of main fails");
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index 137e394fe08..16a83ee7d0d 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -45,20 +45,20 @@
// Load Dolibarr environment
$res=0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php");
+if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
-if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php");
-if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php");
+if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
+if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
// Try main.inc.php using relative path
-if (! $res && file_exists("../main.inc.php")) $res=@include("../main.inc.php");
-if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
-if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php");
+if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php";
+if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
+if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
if (! $res) die("Include of main fails");
-include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
-include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php');
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
dol_include_once('/mymodule/class/myobject.class.php');
dol_include_once('/mymodule/lib/myobject.lib.php');
diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php
index c08a360835a..f005fbf8354 100644
--- a/htdocs/modulebuilder/template/myobject_document.php
+++ b/htdocs/modulebuilder/template/myobject_document.php
@@ -25,16 +25,16 @@
// Load Dolibarr environment
$res=0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php");
+if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
-if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php");
-if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php");
+if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
+if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
// Try main.inc.php using relative path
-if (! $res && file_exists("../main.inc.php")) $res=@include("../main.inc.php");
-if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
-if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php");
+if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php";
+if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
+if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
if (! $res) die("Include of main fails");
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index 21ab2d6cafe..4fe54aa63a4 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -43,19 +43,19 @@
// Load Dolibarr environment
$res=0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php");
+if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
-if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php");
-if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php");
+if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
+if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
// Try main.inc.php using relative path
-if (! $res && file_exists("../main.inc.php")) $res=@include("../main.inc.php");
-if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
-if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php");
+if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php";
+if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
+if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
if (! $res) die("Include of main fails");
-require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
dol_include_once('/mymodule/class/myobject.class.php');
@@ -563,7 +563,7 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb
$hidegeneratedfilelistifempty=1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0;
- require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php');
+ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
$formfile = new FormFile($db);
// Show list of available documents
diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php
index 5b438c32a7c..d240f07ef53 100644
--- a/htdocs/modulebuilder/template/myobject_note.php
+++ b/htdocs/modulebuilder/template/myobject_note.php
@@ -25,16 +25,16 @@
// Load Dolibarr environment
$res=0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php");
+if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
-if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php");
-if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php");
+if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
+if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
// Try main.inc.php using relative path
-if (! $res && file_exists("../main.inc.php")) $res=@include("../main.inc.php");
-if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
-if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php");
+if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php";
+if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
+if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
if (! $res) die("Include of main fails");
dol_include_once('/mymodule/class/myobject.class.php');
diff --git a/htdocs/modulebuilder/template/scripts/myobject.php b/htdocs/modulebuilder/template/scripts/myobject.php
index 0aad12e2e35..67bcdea1d74 100755
--- a/htdocs/modulebuilder/template/scripts/myobject.php
+++ b/htdocs/modulebuilder/template/scripts/myobject.php
@@ -47,12 +47,12 @@ $res=0;
// Try master.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
-if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/master.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/master.inc.php");
-if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/master.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/master.inc.php");
+if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/master.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/master.inc.php";
+if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/master.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/master.inc.php";
// Try master.inc.php using relative path
-if (! $res && file_exists("../master.inc.php")) $res=@include("../master.inc.php");
-if (! $res && file_exists("../../master.inc.php")) $res=@include("../../master.inc.php");
-if (! $res && file_exists("../../../master.inc.php")) $res=@include("../../../master.inc.php");
+if (! $res && file_exists("../master.inc.php")) $res=@include "../master.inc.php";
+if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.inc.php";
+if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php";
if (! $res) die("Include of master fails");
// After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file).
// $user is created but empty.
diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php
index fda06d67012..af75bf4783b 100644
--- a/htdocs/opensurvey/card.php
+++ b/htdocs/opensurvey/card.php
@@ -22,12 +22,12 @@
* \brief Page to edit survey
*/
-require_once('../main.inc.php');
-require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
-require_once(DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php");
-require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php");
+require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php";
+require_once DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php";
+require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php";
// Security check
diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php
index a2b6096d77c..d80bac70b79 100644
--- a/htdocs/opensurvey/class/opensurveysondage.class.php
+++ b/htdocs/opensurvey/class/opensurveysondage.class.php
@@ -24,9 +24,9 @@
*/
// Put here all includes required by your class file
-require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
-//require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
-//require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
+require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
+//require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
+//require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
/**
diff --git a/htdocs/opensurvey/exportcsv.php b/htdocs/opensurvey/exportcsv.php
index 90fd56cd4d1..b36a5256059 100644
--- a/htdocs/opensurvey/exportcsv.php
+++ b/htdocs/opensurvey/exportcsv.php
@@ -23,10 +23,10 @@
*/
-require_once('../main.inc.php');
-require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php");
+require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
+require_once DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php";
$action=GETPOST('action','aZ09');
$numsondage = '';
diff --git a/htdocs/opensurvey/index.php b/htdocs/opensurvey/index.php
index 663d4ad704a..3b800b748ff 100644
--- a/htdocs/opensurvey/index.php
+++ b/htdocs/opensurvey/index.php
@@ -21,9 +21,9 @@
* \brief Home page of opensurvey area
*/
-require_once('../main.inc.php');
-require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
+require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
// Security check
if (!$user->rights->opensurvey->read) accessforbidden();
diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php
index 0471abcddb9..de8feaad8da 100644
--- a/htdocs/opensurvey/list.php
+++ b/htdocs/opensurvey/list.php
@@ -22,10 +22,10 @@
* \brief Page to list surveys
*/
-require_once('../main.inc.php');
-require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php");
+require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
+require_once DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php";
// Security check
if (!$user->rights->opensurvey->read) accessforbidden();
diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php
index cd6e6ed3225..9672e310938 100644
--- a/htdocs/opensurvey/results.php
+++ b/htdocs/opensurvey/results.php
@@ -22,12 +22,11 @@
* \brief Page to preview votes of a survey
*/
-$res=0;
-require_once('../main.inc.php');
-require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php");
-require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php");
+require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
+require_once DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php";
+require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php";
// Security check
diff --git a/htdocs/opensurvey/wizard/choix_autre.php b/htdocs/opensurvey/wizard/choix_autre.php
index a415d6b4987..9acf9d441e2 100644
--- a/htdocs/opensurvey/wizard/choix_autre.php
+++ b/htdocs/opensurvey/wizard/choix_autre.php
@@ -22,10 +22,10 @@
* \brief Page to create a new survey (choice selection)
*/
-require_once('../../main.inc.php');
-require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php");
+require '../../main.inc.php';
+require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
+require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php";
// Security check
if (!$user->rights->opensurvey->write) accessforbidden();
diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php
index 7dd0168c77a..fb7312b891c 100644
--- a/htdocs/opensurvey/wizard/choix_date.php
+++ b/htdocs/opensurvey/wizard/choix_date.php
@@ -22,10 +22,10 @@
* \brief Page to create a new survey (date selection)
*/
-require_once('../../main.inc.php');
-require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php");
+require '../../main.inc.php';
+require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
+require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php";
// Security check
if (!$user->rights->opensurvey->write) accessforbidden();
diff --git a/htdocs/opensurvey/wizard/create_survey.php b/htdocs/opensurvey/wizard/create_survey.php
index 0dfc2505ce3..2e33d377ca2 100644
--- a/htdocs/opensurvey/wizard/create_survey.php
+++ b/htdocs/opensurvey/wizard/create_survey.php
@@ -23,11 +23,11 @@
* \brief Page to create a new survey
*/
-require_once('../../main.inc.php');
-require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
-require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php");
+require '../../main.inc.php';
+require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php";
+require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php";
// Security check
if (!$user->rights->opensurvey->write) accessforbidden();
diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php
index cbf47bbcd21..9b32720a9a8 100644
--- a/htdocs/product/admin/product.php
+++ b/htdocs/product/admin/product.php
@@ -180,13 +180,13 @@ if ($action == 'specimen') // For products
}
else
{
- setEventMessage($obj->error,'errors');
+ setEventMessages($obj->error, $obj->errors, 'errors');
dol_syslog($obj->error, LOG_ERR);
}
}
else
{
- setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
+ setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index b01aa8bc3f1..adb127d67f8 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -689,7 +689,7 @@ if (empty($reshook))
if (($result = $propal->defineBuyPrice($pu_ht, GETPOST('remise_percent'), $object->id)) < 0)
{
dol_syslog($langs->trans('FailedToGetCostPrice'));
- setEventMessage($langs->trans('FailedToGetCostPrice'), 'errors');
+ setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors');
}
else
{
@@ -732,7 +732,7 @@ if (empty($reshook))
if (($result = $commande->defineBuyPrice($pu_ht, GETPOST('remise_percent'), $object->id)) < 0)
{
dol_syslog($langs->trans('FailedToGetCostPrice'));
- setEventMessage($langs->trans('FailedToGetCostPrice'), 'errors');
+ setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors');
}
else
{
@@ -775,7 +775,7 @@ if (empty($reshook))
if (($result = $facture->defineBuyPrice($pu_ht, GETPOST('remise_percent'), $object->id)) < 0)
{
dol_syslog($langs->trans('FailedToGetCostPrice'));
- setEventMessage($langs->trans('FailedToGetCostPrice'), 'errors');
+ setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors');
}
else
{
diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php
index 48afbcc9dbb..b52514a4195 100644
--- a/htdocs/product/class/productbatch.class.php
+++ b/htdocs/product/class/productbatch.class.php
@@ -22,7 +22,7 @@
* \brief Manage record and specific data for batch number management
*/
-require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
+require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
/**
diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php
index 87fdd132878..92c6ffadca4 100644
--- a/htdocs/product/class/propalmergepdfproduct.class.php
+++ b/htdocs/product/class/propalmergepdfproduct.class.php
@@ -22,7 +22,7 @@
* \brief This file is an CRUD class file (Create/Read/Update/Delete)
*/
-require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
+require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php
index 74422cc2601..a5592c87f5d 100644
--- a/htdocs/product/inventory/list.php
+++ b/htdocs/product/inventory/list.php
@@ -525,7 +525,7 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb
$hidegeneratedfilelistifempty=1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0;
- require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php');
+ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
$formfile = new FormFile($db);
// Show list of available documents
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index 70e09114669..e68730acf64 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -6,7 +6,7 @@
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2014 Florian Henry
* Copyright (C) 2014-2016 Juanjo Menent
- * Copyright (C) 2014-2015 Philippe Grand
+ * Copyright (C) 2014-2018 Philippe Grand
* Copyright (C) 2014 Ion agorria
* Copyright (C) 2015 Alexandre Spangaro
* Copyright (C) 2015 Marcos GarcĂa
@@ -46,7 +46,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
}
// Load translation files required by the page
-$langs->loadLangs(array('products', 'bills', 'companies'));
+$langs->loadLangs(array('products', 'bills', 'companies', 'other'));
$mesg=''; $error=0; $errors=array();
@@ -464,8 +464,10 @@ if (empty($reshook))
$sql .= " WHERE rowid = " . $rowid;
$result = $db->query($sql);
- } else {
- setEventMessage('delete_price_by_qty Missing Ids','errors');
+ }
+ else
+ {
+ setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors');
}
}
@@ -477,8 +479,10 @@ if (empty($reshook))
$sql .= " WHERE fk_product_price = " . $priceid;
$result = $db->query($sql);
- } else {
- setEventMessage('delete_all_price_by_qty Missing Ids','errors');
+ }
+ else
+ {
+ setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors');
}
}
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index 7c18dc11281..d2da5abd3e0 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -135,7 +135,7 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer)
// Update
$pse->seuil_stock_alerte = $seuil_stock_alerte;
$pse->desiredstock = $desiredstock;
- if($pse->update($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseUpdated'));
+ if($pse->update($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseUpdated'), null, 'mesgs');
} else {
@@ -144,7 +144,7 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer)
$pse->fk_product = $id;
$pse->seuil_stock_alerte = GETPOST('seuil_stock_alerte');
$pse->desiredstock = GETPOST('desiredstock');
- if($pse->create($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseCreated'));
+ if($pse->create($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseCreated'), null, 'mesgs');
}
@@ -160,7 +160,7 @@ if($action == 'delete_productstockwarehouse' && !empty($user->rights->produit->c
$pse = new ProductStockEntrepot($db);
$pse->fetch(GETPOST('fk_productstockwarehouse'));
- if($pse->delete($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseDeleted'));
+ if($pse->delete($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseDeleted'), null, 'mesgs');
$action = '';
@@ -176,7 +176,7 @@ if ($action == 'setseuil_stock_alerte' && !empty($user->rights->produit->creer))
if ($result < 0)
setEventMessages($object->error, $object->errors, 'errors');
//else
- // setEventMessage($lans->trans("SavedRecordSuccessfully"));
+ // setEventMessages($lans->trans("SavedRecordSuccessfully"), null, 'mesgs');
$action='';
}
diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php
index 92719093650..53818220081 100644
--- a/htdocs/projet/activity/index.php
+++ b/htdocs/projet/activity/index.php
@@ -23,7 +23,7 @@
* \brief Page activite perso du module projet
*/
-require ("../../main.inc.php");
+require "../../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php
index 2b8996373e4..0943d8dd428 100644
--- a/htdocs/projet/activity/perday.php
+++ b/htdocs/projet/activity/perday.php
@@ -24,7 +24,7 @@
* \brief List activities of tasks (per day entry)
*/
-require ("../../main.inc.php");
+require "../../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php
index cf68f6ccc95..b22ed6ee71a 100644
--- a/htdocs/projet/activity/perweek.php
+++ b/htdocs/projet/activity/perweek.php
@@ -24,7 +24,7 @@
* \brief List activities of tasks (per week entry)
*/
-require ("../../main.inc.php");
+require "../../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 210ff9e09a9..e117dc3eb39 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -523,9 +523,10 @@ class Project extends CommonObject
* @param string $datefieldname name of date field for filter
* @param int $dates Start date
* @param int $datee End date
+ * @param string $projectkey Equivalent key to fk_projet for actual type
* @return mixed Array list of object ids linked to project, < 0 or string if error
*/
- function get_element_list($type, $tablename, $datefieldname='', $dates='', $datee='')
+ function get_element_list($type, $tablename, $datefieldname='', $dates='', $datee='', $projectkey='fk_projet')
{
$elements = array();
@@ -555,7 +556,7 @@ class Project extends CommonObject
}
else
{
- $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $tablename." WHERE fk_projet IN (". $ids .")";
+ $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $tablename." WHERE ".$projectkey." IN (". $ids .")";
}
if ($dates > 0)
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 5070c0a58d4..79b2be5b009 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -3,7 +3,7 @@
* Copyright (C) 2004-2015 Laurent Destailleur
* Copyright (C) 2005-2010 Regis Houssin
* Copyright (C) 2012-2016 Juanjo Menent
- * Copyright (C) 2015-2017 Alexandre Spangaro
+ * Copyright (C) 2015-2018 Alexandre Spangaro
* Copyright (C) 2015 Marcos GarcĂa
* Copyright (C) 2016 Josep LluĂs Amador
*
@@ -43,7 +43,7 @@ if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn
if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
-if (! empty($conf->expedition->enabled)) require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
+if (! empty($conf->expedition->enabled)) require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
if (! empty($conf->deplacement->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
if (! empty($conf->expensereport->enabled)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
@@ -52,17 +52,19 @@ if (! empty($conf->loan->enabled)) require_once DOL_DOCUMENT_ROOT.'/loan/class
if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
if (! empty($conf->tax->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
+if (! empty($conf->salaries->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
// Load translation files required by the page
$langs->loadLangs(array('projects', 'companies', 'suppliers', 'compta'));
-if (! empty($conf->facture->enabled)) $langs->load("bills");
-if (! empty($conf->commande->enabled)) $langs->load("orders");
-if (! empty($conf->propal->enabled)) $langs->load("propal");
+if (! empty($conf->facture->enabled)) $langs->load("bills");
+if (! empty($conf->commande->enabled)) $langs->load("orders");
+if (! empty($conf->propal->enabled)) $langs->load("propal");
if (! empty($conf->ficheinter->enabled)) $langs->load("interventions");
if (! empty($conf->deplacement->enabled)) $langs->load("trips");
if (! empty($conf->expensereport->enabled)) $langs->load("trips");
if (! empty($conf->don->enabled)) $langs->load("donations");
if (! empty($conf->loan->enabled)) $langs->load("loan");
+if (! empty($conf->salaries->enabled)) $langs->load("salaries");
$id=GETPOST('id','int');
$ref=GETPOST('ref','alpha');
@@ -438,6 +440,19 @@ $listofreferent=array(
'datefieldname'=>'datem',
'disableamount'=>0,
'test'=>($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW))),
+'salaries'=>array(
+ 'name'=>"Salaries",
+ 'title'=>"ListSalariesAssociatedProject",
+ 'class'=>'PaymentSalary',
+ 'table'=>'payment_salary',
+ 'datefieldname'=>'datev',
+ 'margin'=>'minus',
+ 'disableamount'=>0,
+ 'urlnew'=>DOL_URL_ROOT.'/compta/salaries/card.php?action=create&projectid='.$id,
+ 'lang'=>'salaries',
+ 'buttonnew'=>'AddSalariesPayment',
+ 'testnew'=>$user->rights->salaries->write,
+ 'test'=>$conf->salaries->enabled && $user->rights->salaries->read),
'variouspayment'=>array(
'name'=>"VariousPayments",
'title'=>"ListVariousPaymentsAssociatedProject",
@@ -560,11 +575,12 @@ foreach ($listofreferent as $key => $value)
$datefieldname=$value['datefieldname'];
$qualified=$value['test'];
$margin = $value['margin'];
+ $project_field = $value['project_field'];
if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'plus')
{
$element = new $classname($db);
- $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee);
+ $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, !empty($project_field)?$project_field:'fk_projet');
if (count($elementarray)>0 && is_array($elementarray))
{
@@ -695,6 +711,7 @@ foreach ($listofreferent as $key => $value)
$urlnew=$value['urlnew'];
$buttonnew=$value['buttonnew'];
$testnew=$value['testnew'];
+ $project_field=$value['project_field'];
if ($qualified)
{
@@ -717,7 +734,7 @@ foreach ($listofreferent as $key => $value)
if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty && !in_array($tablename, array('payment_various')))
{
- $selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300');
+ $selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300',-2,!empty($project_field)?$project_field:'fk_projet');
if (! $selectList || ($selectList<0))
{
setEventMessages($formproject->error,$formproject->errors,'errors');
@@ -768,7 +785,7 @@ foreach ($listofreferent as $key => $value)
print '';
if (in_array($tablename, array('projet_task')) && $key == 'project_task') print ''; // if $key == 'project_task', we don't want details per user
elseif (in_array($tablename, array('payment_various'))) print ''; // if $key == 'payment_various', we don't have any thirdparty
- elseif (in_array($tablename, array('expensereport_det','don','projet_task','stock_mouvement'))) print $langs->trans("User");
+ elseif (in_array($tablename, array('expensereport_det','don','projet_task','stock_mouvement','payment_salary'))) print $langs->trans("User");
else print $langs->trans("ThirdParty");
print ' ';
// Amount HT
@@ -785,7 +802,7 @@ foreach ($listofreferent as $key => $value)
else print ''.$langs->trans("Status").' ';
print ' ';
- $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee);
+ $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee,!empty($project_field)?$project_field:'fk_projet');
if (is_array($elementarray) && count($elementarray)>0)
{
$total_ht = 0;
@@ -866,7 +883,7 @@ foreach ($listofreferent as $key => $value)
}
else
{
- // Show ref with link
+ // Show ref with link
if ($element instanceof Task)
{
print $element->getNomUrl(1,'withproject','time');
@@ -901,6 +918,7 @@ foreach ($listofreferent as $key => $value)
$date=''; $total_time_by_line = null;
if ($tablename == 'expensereport_det') $date = $element->date; // No draft status on lines
elseif ($tablename == 'stock_mouvement') $date = $element->datem;
+ elseif ($tablename == 'payment_salary') $date = $element->datev;
elseif ($tablename == 'payment_various') $date = $element->datev;
elseif ($tablename == 'chargesociales') $date = $element->date_ech;
elseif (! empty($element->status) || ! empty($element->statut) || ! empty($element->fk_status))
@@ -946,6 +964,12 @@ foreach ($listofreferent as $key => $value)
$tmpuser->fetch($expensereport->fk_user_author);
print $tmpuser->getNomUrl(1,'',48);
}
+ else if ($tablename == 'payment_salary')
+ {
+ $tmpuser=new User($db);
+ $tmpuser->fetch($element->fk_user);
+ print $tmpuser->getNomUrl(1,'',48);
+ }
else if ($tablename == 'don' || $tablename == 'stock_mouvement')
{
if ($element->fk_user_author > 0)
@@ -967,7 +991,7 @@ foreach ($listofreferent as $key => $value)
{
$total_ht_by_line=null;
$othermessage='';
- if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various') $total_ht_by_line=$element->amount;
+ if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') $total_ht_by_line=$element->amount;
else if($tablename == 'fichinter') $total_ht_by_line=$element->getAmount();
elseif ($tablename == 'stock_mouvement') $total_ht_by_line=$element->price*abs($element->qty);
elseif (in_array($tablename, array('projet_task')))
@@ -1008,7 +1032,7 @@ foreach ($listofreferent as $key => $value)
if (empty($value['disableamount']))
{
$total_ttc_by_line=null;
- if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various') $total_ttc_by_line=$element->amount;
+ if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') $total_ttc_by_line=$element->amount;
else if($tablename == 'fichinter') $total_ttc_by_line=$element->getAmount();
elseif ($tablename == 'stock_mouvement') $total_ttc_by_line=$element->price*abs($element->qty);
elseif ($tablename == 'projet_task')
diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php
index 45a417a6dd2..da418680376 100644
--- a/htdocs/projet/ganttview.php
+++ b/htdocs/projet/ganttview.php
@@ -23,7 +23,7 @@
* \brief Gantt diagramm of a project
*/
-require ("../main.inc.php");
+require "../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index 5af0d6da9e5..bf2ddf33890 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -23,7 +23,7 @@
* \brief List all tasks of a project
*/
-require ("../main.inc.php");
+require "../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php
index ac527424721..6c4b7f56d3f 100644
--- a/htdocs/projet/tasks/comment.php
+++ b/htdocs/projet/tasks/comment.php
@@ -23,7 +23,7 @@
* \brief Page of a project task
*/
-require ("../../main.inc.php");
+require "../../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php
index 4d78aad4764..6ed9af89385 100644
--- a/htdocs/projet/tasks/contact.php
+++ b/htdocs/projet/tasks/contact.php
@@ -23,7 +23,7 @@
* \brief Actors of a task
*/
-require ("../../main.inc.php");
+require "../../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php
index 14703f6d3eb..7a97de16f52 100644
--- a/htdocs/projet/tasks/list.php
+++ b/htdocs/projet/tasks/list.php
@@ -24,7 +24,7 @@
* \brief List all task of a project
*/
-require ("../../main.inc.php");
+require "../../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php
index 9e6018ab5c5..2fd47827d6a 100644
--- a/htdocs/projet/tasks/note.php
+++ b/htdocs/projet/tasks/note.php
@@ -21,7 +21,7 @@
* \brief Page to show information on a task
*/
-require ("../../main.inc.php");
+require "../../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index 4809cfe1276..ace9ab21a29 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -23,7 +23,7 @@
* \brief Page of a project task
*/
-require ("../../main.inc.php");
+require "../../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php
index b11bf4cc42f..3bee8fd6434 100644
--- a/htdocs/public/cron/cron_run_jobs.php
+++ b/htdocs/public/cron/cron_run_jobs.php
@@ -36,11 +36,7 @@ if (is_numeric($entity)) define("DOLENTITY", $entity);
// librarie core
// Dolibarr environment
-$res = @include("../../main.inc.php"); // From htdocs directory
-if (! $res) {
- $res = @include("../../../main.inc.php"); // From "custom" directory
-}
-if (! $res) die("Include of master.inc.php fails");
+require '../../main.inc.php';
// librarie jobs
dol_include_once("/cron/class/cronjob.class.php");
@@ -51,10 +47,6 @@ global $langs, $conf;
$langs->load("admin");
$langs->load("cron");
-
-
-
-
/*
* View
*/
diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php
index 32cb5f2e1ba..a9bd8a0fb70 100644
--- a/htdocs/public/opensurvey/studs.php
+++ b/htdocs/public/opensurvey/studs.php
@@ -24,11 +24,11 @@
define("NOLOGIN",1); // This means this output page does not require to be logged.
define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
-require_once('../../main.inc.php');
-require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php");
-require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php");
+require '../../main.inc.php';
+require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
+require_once DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php";
+require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php";
// Init vars
diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php
index 748f1439687..42a732fcb21 100644
--- a/htdocs/public/stripe/ipn.php
+++ b/htdocs/public/stripe/ipn.php
@@ -21,9 +21,7 @@ define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
if (is_numeric($entity)) define("DOLENTITY", $entity);
-$res=0;
-if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php"); // to work if your module directory is into a subdir of root htdocs directory
-if (! $res) die("Include of main fails");
+require '../../main.inc.php';
if (empty($conf->stripe->enabled)) accessforbidden('',0,0,1);
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
@@ -110,7 +108,7 @@ if (! empty($conf->multicompany->enabled) && ! empty($conf->stripeconnect->enabl
$key=1;
}
$ret=$mc->switchEntity($key);
- if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
+ if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
if (! $res) die("Include of main fails");
}
diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php
index 066471fddff..c3c4979a843 100644
--- a/htdocs/public/ticket/create_ticket.php
+++ b/htdocs/public/ticket/create_ticket.php
@@ -177,7 +177,7 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
$action = "infos_success";
} else {
$object->db->rollback();
- setEventMessage($object->errors, 'errors');
+ setEventMessages($object->error, $object->errors, 'errors');
$action = 'create_ticket';
}
@@ -226,9 +226,12 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
}
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1);
- if ($mailfile->error) {
- setEventMessage($mailfile->error, 'errors');
- } else {
+ if ($mailfile->error || $mailfile->errors)
+ {
+ setEventMessages($mailfile->error, $mailfile->errors, 'errors');
+ }
+ else
+ {
$result = $mailfile->sendfile();
}
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
@@ -287,9 +290,12 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
}
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1);
- if ($mailfile->error) {
- setEventMessage($mailfile->error, 'errors');
- } else {
+ if ($mailfile->error || $mailfile->errors)
+ {
+ setEventMessages($mailfile->error, $mailfile->errors, 'errors');
+ }
+ else
+ {
$result = $mailfile->sendfile();
}
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
@@ -308,10 +314,12 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
$formmail->remove_attached_files($i);
}
- setEventMessage($langs->trans('YourTicketSuccessfullySaved'));
+ setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs');
}
- } else {
- setEventMessage($object->errors, 'errors');
+ }
+ else
+ {
+ setEventMessages($object->error, $object->errors, 'errors');
}
}
diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php
index d8290849f55..fe1dacbbbc7 100644
--- a/htdocs/public/ticket/list.php
+++ b/htdocs/public/ticket/list.php
@@ -121,8 +121,9 @@ if ($action == "view_ticketlist") {
}
}
- if ($error) {
- setEventMessage($object->errors, 'errors');
+ if ($error || $errors)
+ {
+ setEventMessages($object->error, $object->errors, 'errors');
$action = '';
}
}
diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php
index 5383133c42e..38fcb3c4991 100644
--- a/htdocs/public/ticket/view.php
+++ b/htdocs/public/ticket/view.php
@@ -112,8 +112,9 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" |
}
}
- if ($error) {
- setEventMessage($object->errors, 'errors');
+ if ($error || $errors)
+ {
+ setEventMessages($object->error, $object->errors, 'errors');
$action = '';
}
}
diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php
index 832f70f4ea1..e4a21ae9888 100644
--- a/htdocs/resource/card.php
+++ b/htdocs/resource/card.php
@@ -22,12 +22,7 @@
*/
-// Change this following line to use the correct relative path (../, ../../, etc)
-$res=0;
-$res=@include("../main.inc.php"); // For root directory
-if (! $res) $res=@include("../../main.inc.php"); // For "custom" directory
-if (! $res) die("Include of main fails");
-
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php';
diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php
index 7c3999db7c9..515f08f6053 100644
--- a/htdocs/resource/class/dolresource.class.php
+++ b/htdocs/resource/class/dolresource.class.php
@@ -491,7 +491,7 @@ class Dolresource extends CommonObject
$sql.= " t.fk_code_type_resource,";
$sql.= " t.tms,";
- require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
+ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
if (is_array($extralabels) && count($extralabels)>0) {
diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php
index 19bed957f74..ed667fad8ab 100644
--- a/htdocs/resource/class/html.formresource.class.php
+++ b/htdocs/resource/class/html.formresource.class.php
@@ -21,8 +21,8 @@
* \ingroup core
* \brief Class file to manage forms into resource module
*/
-require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php");
-require_once(DOL_DOCUMENT_ROOT ."/resource/class/dolresource.class.php");
+require_once DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php";
+require_once DOL_DOCUMENT_ROOT ."/resource/class/dolresource.class.php";
/**
diff --git a/htdocs/resource/contact.php b/htdocs/resource/contact.php
index 981a07d7e73..e350c746c12 100644
--- a/htdocs/resource/contact.php
+++ b/htdocs/resource/contact.php
@@ -2,7 +2,7 @@
/* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2007-2009 Laurent Destailleur
* Copyright (C) 2012 Juanjo Menent
- * Copyright (C) 2016 Gilles Poirier
+ * Copyright (C) 2016 Gilles Poirier
*
* This program is free software; you can redistribute it and/or modify
@@ -47,7 +47,7 @@ $result = $object->fetch($id,$ref);
/*
- * Ajout d'un nouveau contact
+ * Add a new contact
*/
if ($action == 'addcontact' && $user->rights->resource->write)
@@ -72,17 +72,17 @@ if ($action == 'addcontact' && $user->rights->resource->write)
$mesg = $object->error;
}
- setEventMessage($mesg, 'errors');
+ setEventMessages($mesg, null, 'errors');
}
}
-// bascule du statut d'un contact
+// Toggle the status of a contact
else if ($action == 'swapstatut' && $user->rights->resource->write)
{
$result=$object->swapContactStatus(GETPOST('ligne','int'));
}
-// Efface un contact
+// Erase a contact
else if ($action == 'deletecontact' && $user->rights->resource->write)
{
$result = $object->delete_contact(GETPOST('lineid','int'));
diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php
index 389d0236759..b844fce0f6c 100644
--- a/htdocs/resource/element_resource.php
+++ b/htdocs/resource/element_resource.php
@@ -23,11 +23,7 @@
*/
-$res=0;
-$res=@include("../main.inc.php"); // For root directory
-if (! $res) $res=@include("../../main.inc.php"); // For "custom" directory
-if (! $res) die("Include of main fails");
-
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php
index f1e56d4a359..e15c0864574 100644
--- a/htdocs/societe/checkvat/checkVatPopup.php
+++ b/htdocs/societe/checkvat/checkVatPopup.php
@@ -21,7 +21,7 @@
* \brief Popup screen to validate VAT
*/
-require ("../../main.inc.php");
+require "../../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once NUSOAP_PATH.'/nusoap.php';
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php
index 551f168ded3..947c35a2d5c 100644
--- a/htdocs/societe/consumption.php
+++ b/htdocs/societe/consumption.php
@@ -25,7 +25,7 @@
* \brief Add a tab on thirpdarty view to list all products/services bought or sells by thirdparty
*/
-require("../main.inc.php");
+require "../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php
index 3563283ba05..d00b3144185 100644
--- a/htdocs/societe/website.php
+++ b/htdocs/societe/website.php
@@ -535,7 +535,7 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb
$hidegeneratedfilelistifempty=1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0;
- require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php');
+ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
$formfile = new FormFile($db);
// Show list of available documents
diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php
index c61de994874..7aa22678d7a 100644
--- a/htdocs/stripe/config.php
+++ b/htdocs/stripe/config.php
@@ -54,4 +54,5 @@ else
}
\Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']);
-\Stripe\Stripe::setAppInfo("Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version
+\Stripe\Stripe::setAppInfo("Dolibarr Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version
+\Stripe\Stripe::setApiVersion("2018-07-27"); // force version API
diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php
index 1113d1428f5..8ad547a47ee 100644
--- a/htdocs/stripe/payment.php
+++ b/htdocs/stripe/payment.php
@@ -30,8 +30,7 @@
*/
// Load Dolibarr environment
-$res=@include("../main.inc.php"); // For root directory
-if (! $res) $res=@include("../../main.inc.php");
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php
index 3dc0ab39756..1fde15c5b29 100644
--- a/htdocs/ticket/class/ticket.class.php
+++ b/htdocs/ticket/class/ticket.class.php
@@ -25,8 +25,8 @@
// Put here all includes required by your class file
require_once DOL_DOCUMENT_ROOT . "/core/class/commonobject.class.php";
require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
-//require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
-//require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
+//require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
+//require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
/**
@@ -1614,9 +1614,12 @@ class Ticket extends CommonObject
}
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $info_sendto['email'], $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, 0);
- if ($mailfile->error) {
- setEventMessage($mailfile->error, 'errors');
- } else {
+ if ($mailfile->error || $mailfile->errors)
+ {
+ setEventMessages($mailfile->error, $mailfile->errors, 'errors');
+ }
+ else
+ {
$result = $mailfile->sendfile();
if ($result > 0) {
$nb_sent++;
@@ -1627,7 +1630,7 @@ class Ticket extends CommonObject
}
}
- setEventMessage($langs->trans('TicketNotificationNumberEmailSent', $nb_sent));
+ setEventMessages($langs->trans('TicketNotificationNumberEmailSent', $nb_sent), null, 'mesgs');
}
return $nb_sent;
diff --git a/htdocs/ticket/class/ticketlogs.class.php b/htdocs/ticket/class/ticketlogs.class.php
index ffa6a193415..b4a464f6a17 100644
--- a/htdocs/ticket/class/ticketlogs.class.php
+++ b/htdocs/ticket/class/ticketlogs.class.php
@@ -23,8 +23,8 @@
// Put here all includes required by your class file
require_once DOL_DOCUMENT_ROOT . "/core/class/commonobject.class.php";
-//require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
-//require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
+//require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
+//require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
/**
diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php
index c99ac7e7e3a..b23b4c5d27e 100644
--- a/htdocs/ticket/list.php
+++ b/htdocs/ticket/list.php
@@ -701,7 +701,7 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb
$hidegeneratedfilelistifempty=1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0;
- require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php');
+ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
$formfile = new FormFile($db);
// Show list of available documents
diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php
index dd4e60e4617..77e7f338e1a 100644
--- a/htdocs/user/class/api_users.class.php
+++ b/htdocs/user/class/api_users.class.php
@@ -231,38 +231,48 @@ class Users extends DolibarrApi
*
* @param int $id User ID
* @param int $group Group ID
+ * @param int $entity Entity ID (valid only for superadmin in multicompany transverse mode)
* @return int 1 if success
*
* @url GET {id}/setGroup/{group}
*/
- function setGroup($id, $group) {
+ function setGroup($id, $group, $entity = 1) {
global $conf;
//if (!DolibarrApiAccess::$user->rights->user->user->supprimer) {
//throw new RestException(401);
//}
- $result = $this->useraccount->fetch($id);
- if (!$result)
- {
- throw new RestException(404, 'User not found');
- }
+ $result = $this->useraccount->fetch($id);
+ if (!$result)
+ {
+ throw new RestException(404, 'User not found');
+ }
- if (!DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user'))
- {
- throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
- }
+ if (!DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user'))
+ {
+ throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
+ }
- // When using API, action is done on entity of logged user because a user of entity X with permission to create user should not be able to
- // hack the security by giving himself permissions on another entity.
- $result = $this->useraccount->SetInGroup($group, DolibarrApiAccess::$user->entity > 0 ? DolibarrApiAccess::$user->entity : $conf->entity);
- if (! ($result > 0))
- {
- throw new RestException(500, $this->useraccount->error);
- }
+ if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && ! empty(DolibarrApiAccess::$user->admin) && empty(DolibarrApiAccess::$user->entity))
+ {
+ $entity = (! empty($entity) ? $entity : $conf->entity);
+ }
+ else
+ {
+ // When using API, action is done on entity of logged user because a user of entity X with permission to create user should not be able to
+ // hack the security by giving himself permissions on another entity.
+ $entity = (DolibarrApiAccess::$user->entity > 0 ? DolibarrApiAccess::$user->entity : $conf->entity);
+ }
- return 1;
- }
+ $result = $this->useraccount->SetInGroup($group, $entity);
+ if (! ($result > 0))
+ {
+ throw new RestException(500, $this->useraccount->error);
+ }
+
+ return 1;
+ }
/**
* Delete account
diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php
index 882e9111b5d..9c2f3437fa4 100644
--- a/htdocs/user/class/usergroup.class.php
+++ b/htdocs/user/class/usergroup.class.php
@@ -27,7 +27,7 @@
*/
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
-if (! empty($conf->ldap->enabled)) require_once (DOL_DOCUMENT_ROOT."/core/class/ldap.class.php");
+if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
/**
diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php
index 307b8ae5bc9..e8914298ac3 100644
--- a/htdocs/user/notify/card.php
+++ b/htdocs/user/notify/card.php
@@ -1,7 +1,7 @@
* Copyright (C) 2004-2014 Laurent Destailleur
- * Copyright (C) 2010-2014 Juanjo Menent
+ * Copyright (C) 2010-2014 Juanjo Menent
* Copyright (C) 2015 Marcos GarcĂa
* Copyright (C) 2016 Abbes Bahfir
*
@@ -67,7 +67,7 @@ if ($action == 'add')
if ($actionid <= 0)
{
- setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")), 'errors');
+ setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")), null, 'errors');
$error++;
}
diff --git a/htdocs/variants/admin/admin.php b/htdocs/variants/admin/admin.php
index 4790961aba7..90fc2cd7bb7 100644
--- a/htdocs/variants/admin/admin.php
+++ b/htdocs/variants/admin/admin.php
@@ -31,13 +31,13 @@ if ($_POST) {
$value = GETPOST('PRODUIT_ATTRIBUTES_HIDECHILD');
if (dolibarr_set_const($db, 'PRODUIT_ATTRIBUTES_HIDECHILD', $value, 'chaine', 0, '', $conf->entity)) {
- setEventMessages($langs->trans('RecordSaved'), null);
+ setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
} else {
setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors');
}
if (dolibarr_set_const($db, 'PRODUIT_ATTRIBUTES_SEPARATOR', GETPOST('PRODUIT_ATTRIBUTES_SEPARATOR'), 'chaine', 0, '', $conf->entity)) {
- setEventMessages($langs->trans('RecordSaved'), null);
+ setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
} else {
setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors');
}
diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php
index f364f444a7f..6f508e0de44 100644
--- a/htdocs/variants/card.php
+++ b/htdocs/variants/card.php
@@ -53,7 +53,7 @@ if ($_POST) {
if ($object->update($user) < 1) {
setEventMessages($langs->trans('CoreErrorMessage'), $object->errors, 'errors');
} else {
- setEventMessages($langs->trans('RecordSaved'), null);
+ setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
header('Location: '.dol_buildpath('/variants/card.php?id='.$id, 2));
exit();
}
@@ -78,9 +78,9 @@ if ($_POST) {
if (! $error)
{
if ($objectval->update($user) > 0) {
- setEventMessages($langs->trans('RecordSaved'), null);
+ setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
} else {
- setEventMessages($langs->trans('CoreErrorMessage'), $objectval->errors, 'errors');
+ setEventMessage($langs->trans('CoreErrorMessage'), $objectval->errors, 'errors');
}
}
}
@@ -104,7 +104,7 @@ if ($confirm == 'yes') {
header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2));
} else {
$db->commit();
- setEventMessages($langs->trans('RecordSaved'), null);
+ setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
header('Location: '.dol_buildpath('/variants/list.php', 2));
}
exit();
@@ -116,7 +116,7 @@ if ($confirm == 'yes') {
if ($objectval->delete() < 1) {
setEventMessages($langs->trans('CoreErrorMessage'), $objectval->errors, 'errors');
} else {
- setEventMessages($langs->trans('RecordSaved'), null);
+ setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
}
header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2));
diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php
index 6aeaa6b92d3..4355e805532 100644
--- a/htdocs/variants/combinations.php
+++ b/htdocs/variants/combinations.php
@@ -148,7 +148,7 @@ if ($_POST) {
$result = $prodcomb->createProductCombination($object, $sanit_features, array(), $price_impact_percent, $price_impact, $weight_impact);
if ($result > 0)
{
- setEventMessages($langs->trans('RecordSaved'), null);
+ setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
unset($_SESSION['addvariant_'.$object->id]);
$db->commit();
@@ -215,7 +215,7 @@ if ($_POST) {
} else {
$db->commit();
- setEventMessages($langs->trans('RecordSaved'), null);
+ setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
}
}
@@ -231,7 +231,7 @@ if ($_POST) {
$prodcomb->variation_weight = $weight_impact;
if ($prodcomb->update($user) > 0) {
- setEventMessages($langs->trans('RecordSaved'), null);
+ setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
header('Location: '.dol_buildpath('/variants/combinations.php?id='.$id, 2));
exit();
} else {
@@ -251,7 +251,7 @@ if ($action === 'confirm_deletecombination') {
if ($prodcomb->delete($user) > 0 && $prodstatic->fetch($prodcomb->fk_product_child) > 0 && $prodstatic->delete($user) > 0) {
$db->commit();
- setEventMessages($langs->trans('RecordSaved'), null);
+ setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
header('Location: '.dol_buildpath('/variants/combinations.php?id='.$object->id, 2));
exit();
}
@@ -450,7 +450,7 @@ if (! empty($id) || ! empty($ref))
if($valueid > 0) {
print ''."\n";
}
-
+
print dol_fiche_head();
?>
diff --git a/htdocs/variants/create.php b/htdocs/variants/create.php
index 12f5eefcc30..5adc9540023 100644
--- a/htdocs/variants/create.php
+++ b/htdocs/variants/create.php
@@ -39,7 +39,7 @@ if ($_POST) {
$resid = $prodattr->create($user);
if ($resid > 0) {
- setEventMessages($langs->trans('RecordSaved'), null);
+ setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
if ($backtopage)
{
header('Location: '.$backtopage);
diff --git a/htdocs/variants/create_val.php b/htdocs/variants/create_val.php
index ab9918e9875..dcb692d71af 100644
--- a/htdocs/variants/create_val.php
+++ b/htdocs/variants/create_val.php
@@ -67,7 +67,7 @@ if ($action == 'add')
$objectval->value = $value;
if ($objectval->create($user) > 0) {
- setEventMessages($langs->trans('RecordSaved'), null);
+ setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
header('Location: '.DOL_URL_ROOT.'/variants/card.php?id='.$object->id);
exit();
} else {
diff --git a/htdocs/variants/generator.php b/htdocs/variants/generator.php
index 81795331754..c99b0af8a26 100644
--- a/htdocs/variants/generator.php
+++ b/htdocs/variants/generator.php
@@ -103,7 +103,7 @@ if ($_POST) {
$res = 1;
- foreach (cartesianArray($adapted_values) as $currcomb)
+ foreach (cartesianArray($adapted_values) as $currcomb)
{
$res = $combination->createProductCombination($product, $currcomb, $sanitized_values, $price_var_percent);
if ($res < 0) {
@@ -115,7 +115,7 @@ if ($_POST) {
if ($res > 0) {
$db->commit();
- setEventMessages($langs->trans('RecordSaved'), null);
+ setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
header('Location: '.dol_buildpath('/variants/combinations.php?id='.$id, 2));
exit;
}
@@ -146,17 +146,17 @@ if (! empty($id) || ! empty($ref)) {
{
$showbarcode=empty($conf->barcode->enabled)?0:1;
if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode=0;
-
+
$head=product_prepare_head($object);
$titre=$langs->trans("CardProduct".$object->type);
$picto=($object->type== Product::TYPE_SERVICE?'service':'product');
dol_fiche_head($head, 'combinations', $titre, 0, $picto);
-
+
$linkback = ''.$langs->trans("BackToList").'';
$object->next_prev_filter=" fk_product_type = ".$object->type;
-
+
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1);
-
+
dol_fiche_end();
}
diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php
index a00e014d88a..6a581b2ca0d 100644
--- a/htdocs/webservices/server_actioncomm.php
+++ b/htdocs/webservices/server_actioncomm.php
@@ -25,12 +25,12 @@
if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1');
-require_once("../master.inc.php");
-require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP
-require_once(DOL_DOCUMENT_ROOT."/core/lib/ws.lib.php");
+require "../master.inc.php";
+require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
+require_once DOL_DOCUMENT_ROOT."/core/lib/ws.lib.php";
-require_once(DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php");
-require_once(DOL_DOCUMENT_ROOT."/comm/action/class/cactioncomm.class.php");
+require_once DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php";
+require_once DOL_DOCUMENT_ROOT."/comm/action/class/cactioncomm.class.php";
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php
index 9ef07dda952..1096b9da923 100644
--- a/htdocs/webservices/server_category.php
+++ b/htdocs/webservices/server_category.php
@@ -23,10 +23,10 @@
if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1');
-require_once("../master.inc.php");
-require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP
+require "../master.inc.php";
+require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php';
-require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php");
+require_once DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php";
dol_syslog("Call Dolibarr webservices interfaces");
diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php
index 6791864ba8b..9ffde3cdf80 100644
--- a/htdocs/webservices/server_contact.php
+++ b/htdocs/webservices/server_contact.php
@@ -23,11 +23,11 @@
if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1');
-require_once("../master.inc.php");
-require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP
-require_once(DOL_DOCUMENT_ROOT."/core/lib/ws.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
-require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
+require "../master.inc.php";
+require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
+require_once DOL_DOCUMENT_ROOT."/core/lib/ws.lib.php";
+require_once DOL_DOCUMENT_ROOT."/contact/class/contact.class.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/extrafields.class.php";
dol_syslog("Call Contact webservices interfaces");
diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php
index c93605ab2ea..aed031fa9ca 100644
--- a/htdocs/webservices/server_invoice.php
+++ b/htdocs/webservices/server_invoice.php
@@ -23,7 +23,7 @@
if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1');
-require_once '../master.inc.php';
+require '../master.inc.php';
require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php';
diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php
index eb42dd74ce4..8cbe54e0b29 100644
--- a/htdocs/webservices/server_order.php
+++ b/htdocs/webservices/server_order.php
@@ -22,14 +22,13 @@
* \brief File that is entry point to call Dolibarr WebServices
*/
-if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1');
+if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1');
-require_once '../master.inc.php';
+require '../master.inc.php';
require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
-
-require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
+require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php";
dol_syslog("Call Dolibarr webservices interfaces");
@@ -660,7 +659,7 @@ function createOrder($authentication,$order)
{
global $db,$conf,$langs;
- require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$now=dol_now();
diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php
index 8ac519ae87e..895e5d55af4 100644
--- a/htdocs/webservices/server_other.php
+++ b/htdocs/webservices/server_other.php
@@ -22,7 +22,7 @@
if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1');
-require_once '../master.inc.php';
+require '../master.inc.php';
require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
diff --git a/htdocs/webservices/server_payment.php b/htdocs/webservices/server_payment.php
index d6cd261a686..9356b6a558a 100644
--- a/htdocs/webservices/server_payment.php
+++ b/htdocs/webservices/server_payment.php
@@ -27,7 +27,7 @@
// This is to make Dolibarr working with Plesk
set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
-require_once '../master.inc.php';
+require '../master.inc.php';
require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php';
diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php
index c4c4d40191e..f6c98599d93 100644
--- a/htdocs/webservices/server_productorservice.php
+++ b/htdocs/webservices/server_productorservice.php
@@ -25,14 +25,14 @@
if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1');
-require_once '../master.inc.php';
+require '../master.inc.php';
require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
-require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php");
+require_once DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php";
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
@@ -570,7 +570,7 @@ function createProductOrService($authentication,$product)
// Update stock if stock count is provided and differs from database after creation or update
if (isset($product['stock_real']) && $product['stock_real'] != '' && ! empty($conf->global->stock->enabled))
{
- require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
$savstockreal=$newobject->stock_reel;
$newobject->load_stock('novirtual,nobatch'); // This overwrite ->stock_reel, surely 0 because we have just created product
@@ -739,7 +739,7 @@ function updateProductOrService($authentication,$product)
// Update stock if stock count is provided and differs from database after creation or update
if (isset($product['stock_real']) && $product['stock_real'] != '' && ! empty($conf->global->stock->enabled))
{
- require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
$savstockreal=$newobject->stock_reel;
$newobject->load_stock('novirtual,nobatch'); // This overwrite ->stock_reel
diff --git a/htdocs/webservices/server_project.php b/htdocs/webservices/server_project.php
index bc26de37601..822081011aa 100644
--- a/htdocs/webservices/server_project.php
+++ b/htdocs/webservices/server_project.php
@@ -23,7 +23,7 @@
if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1');
-require_once '../master.inc.php';
+require '../master.inc.php';
require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
diff --git a/htdocs/webservices/server_supplier_invoice.php b/htdocs/webservices/server_supplier_invoice.php
index fcfd73270aa..50e5498dbe1 100644
--- a/htdocs/webservices/server_supplier_invoice.php
+++ b/htdocs/webservices/server_supplier_invoice.php
@@ -22,11 +22,10 @@
if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1');
-require_once '../master.inc.php';
+require '../master.inc.php';
require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
-
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php
index 9a1ad910672..0bc4428deb2 100644
--- a/htdocs/website/websiteaccount_card.php
+++ b/htdocs/website/websiteaccount_card.php
@@ -22,24 +22,11 @@
*/
// Load Dolibarr environment
-$res=0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php");
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
-while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
-if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php");
-if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php");
-// Try main.inc.php using relative path
-if (! $res && file_exists("../main.inc.php")) $res=@include("../main.inc.php");
-if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
-if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php");
-if (! $res) die("Include of main fails");
-
-include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
-include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php');
-include_once(DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php');
-include_once(DOL_DOCUMENT_ROOT.'/website/lib/websiteaccount.lib.php');
+require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
+require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php';
+require_once DOL_DOCUMENT_ROOT.'/website/lib/websiteaccount.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("website","other"));
diff --git a/scripts/accountancy/export-thirdpartyaccount.php b/scripts/accountancy/export-thirdpartyaccount.php
index 2d557768d7d..53136bf67b2 100755
--- a/scripts/accountancy/export-thirdpartyaccount.php
+++ b/scripts/accountancy/export-thirdpartyaccount.php
@@ -24,7 +24,7 @@
* \brief Page to detect empty accounting account
*/
-require_once($path."../../htdocs/master.inc.php");
+require_once $path."../../htdocs/master.inc.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
diff --git a/scripts/bank/export-bank-receipts.php b/scripts/bank/export-bank-receipts.php
index 398ec1d7a19..1124749fcf4 100755
--- a/scripts/bank/export-bank-receipts.php
+++ b/scripts/bank/export-bank-receipts.php
@@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
exit(-1);
}
-require_once($path."../../htdocs/master.inc.php");
+require_once $path."../../htdocs/master.inc.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
diff --git a/scripts/company/export-contacts-xls-example.php b/scripts/company/export-contacts-xls-example.php
index 5fd7806a26c..c4887cb5ee1 100755
--- a/scripts/company/export-contacts-xls-example.php
+++ b/scripts/company/export-contacts-xls-example.php
@@ -41,13 +41,13 @@ if (! isset($argv[1]) || ! $argv[1]) {
$now=$argv[1];
-require_once($path."../../htdocs/master.inc.php");
-//require_once(PHP_WRITEEXCEL_PATH."/class.writeexcel_workbook.inc.php");
-//require_once(PHP_WRITEEXCEL_PATH."/class.writeexcel_worksheet.inc.php");
+require_once $path."../../htdocs/master.inc.php";
+//require_once PHP_WRITEEXCEL_PATH."/class.writeexcel_workbook.inc.php";
+//require_once PHP_WRITEEXCEL_PATH."/class.writeexcel_worksheet.inc.php";
-require_once(PHPEXCEL_PATH."/PHPExcel.php");
-//require_once(PHPEXCEL_PATH."/PHPExcel/Writer/Excel2007.php");
-require_once(PHPEXCEL_PATH."/PHPExcel/Writer/Excel5.php");
+require_once PHPEXCEL_PATH."/PHPExcel.php";
+//require_once PHPEXCEL_PATH."/PHPExcel/Writer/Excel2007.php";
+require_once PHPEXCEL_PATH."/PHPExcel/Writer/Excel5.php";
// Global variables
$version=DOL_VERSION;
diff --git a/scripts/company/sync_contacts_dolibarr2ldap.php b/scripts/company/sync_contacts_dolibarr2ldap.php
index 900cdbc35ed..32260291aa7 100755
--- a/scripts/company/sync_contacts_dolibarr2ldap.php
+++ b/scripts/company/sync_contacts_dolibarr2ldap.php
@@ -35,10 +35,10 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
}
-require_once($path."../../htdocs/master.inc.php");
-require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
-require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php");
-require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php");
+require_once $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/contact/class/contact.class.php";
+require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
// Global variables
$version=DOL_VERSION;
diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php
index 0f5c91817db..4edf4fb261d 100755
--- a/scripts/contracts/email_expire_services_to_customers.php
+++ b/scripts/contracts/email_expire_services_to_customers.php
@@ -50,8 +50,8 @@ $mode=$argv[1];
$targettype=$argv[2];
-require($path."../../htdocs/master.inc.php");
-require_once (DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php");
+require $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php";
$langs->load('main');
$langs->load('contracts');
diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php
index ad7ccebcba7..7b15d52dff2 100755
--- a/scripts/contracts/email_expire_services_to_representatives.php
+++ b/scripts/contracts/email_expire_services_to_representatives.php
@@ -48,8 +48,8 @@ if (! isset($argv[1]) || ! $argv[1] || ! in_array($argv[1],array('test','confirm
$mode=$argv[1];
-require($path."../../htdocs/master.inc.php");
-require_once (DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php");
+require $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php";
$langs->load('main');
$langs->load('contracts');
diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php
index c690d7b63ef..88960766a68 100755
--- a/scripts/cron/cron_run_jobs.php
+++ b/scripts/cron/cron_run_jobs.php
@@ -41,9 +41,9 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
exit(-1);
}
-require_once ($path."../../htdocs/master.inc.php");
-require_once (DOL_DOCUMENT_ROOT."/cron/class/cronjob.class.php");
-require_once (DOL_DOCUMENT_ROOT.'/user/class/user.class.php');
+require_once $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/cron/class/cronjob.class.php";
+require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
// Check parameters
if (! isset($argv[1]) || ! $argv[1]) {
diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php
index ef9a35fc1ed..95b06f187e8 100755
--- a/scripts/emailings/mailing-send.php
+++ b/scripts/emailings/mailing-send.php
@@ -44,9 +44,9 @@ $id=$argv[1];
if (isset($argv[2]) || !empty($argv[2])) $login = $argv[2];
else $login = '';
-require_once ($path."../../htdocs/master.inc.php");
-require_once (DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php");
-require_once (DOL_DOCUMENT_ROOT."/comm/mailing/class/mailing.class.php");
+require_once $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php";
+require_once DOL_DOCUMENT_ROOT."/comm/mailing/class/mailing.class.php";
// Global variables
diff --git a/scripts/invoices/email_unpaid_invoices_to_customers.php b/scripts/invoices/email_unpaid_invoices_to_customers.php
index 02e9db2e0ce..428f8932ea3 100755
--- a/scripts/invoices/email_unpaid_invoices_to_customers.php
+++ b/scripts/invoices/email_unpaid_invoices_to_customers.php
@@ -50,8 +50,8 @@ $mode=$argv[1];
$targettype=$argv[2];
-require($path."../../htdocs/master.inc.php");
-require_once (DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php");
+require $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php";
$langs->load('main');
diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php
index e134d693d74..dd92a752dc3 100755
--- a/scripts/invoices/email_unpaid_invoices_to_representatives.php
+++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php
@@ -48,8 +48,8 @@ if (! isset($argv[1]) || ! $argv[1] || ! in_array($argv[1],array('test','confirm
$mode=$argv[1];
-require($path."../../htdocs/master.inc.php");
-require_once (DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php");
+require $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php";
$langs->load('main');
diff --git a/scripts/invoices/rebuild_merge_pdf.php b/scripts/invoices/rebuild_merge_pdf.php
index 30782d3b913..2c71d9cf750 100755
--- a/scripts/invoices/rebuild_merge_pdf.php
+++ b/scripts/invoices/rebuild_merge_pdf.php
@@ -34,12 +34,12 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
}
// Include Dolibarr environment
-require_once($path."../../htdocs/master.inc.php");
+require_once $path."../../htdocs/master.inc.php";
// After this $db is an opened handler to database. We close it at end of file.
-require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
-require_once(DOL_DOCUMENT_ROOT."/core/modules/facture/modules_facture.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
-require_once(DOL_DOCUMENT_ROOT.'/core/lib/invoice2.lib.php');
+require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
+require_once DOL_DOCUMENT_ROOT."/core/modules/facture/modules_facture.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
+require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice2.lib.php';
// Load main language strings
diff --git a/scripts/members/sync_members_dolibarr2ldap.php b/scripts/members/sync_members_dolibarr2ldap.php
index a0c393d01c2..e3ca5f38e0a 100755
--- a/scripts/members/sync_members_dolibarr2ldap.php
+++ b/scripts/members/sync_members_dolibarr2ldap.php
@@ -34,9 +34,9 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
exit(-1);
}
-require_once($path."../../htdocs/master.inc.php");
-require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php");
-require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php");
+require_once $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
+require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php";
$langs->load("main");
diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php
index e7adb80e733..8cf0005800f 100755
--- a/scripts/members/sync_members_ldap2dolibarr.php
+++ b/scripts/members/sync_members_ldap2dolibarr.php
@@ -34,11 +34,11 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
exit(-1);
}
-require_once($path."../../htdocs/master.inc.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php");
-require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php");
-require_once(DOL_DOCUMENT_ROOT."/adherents/class/subscription.class.php");
+require_once $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
+require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php";
+require_once DOL_DOCUMENT_ROOT."/adherents/class/subscription.class.php";
$langs->load("main");
$langs->load("errors");
diff --git a/scripts/members/sync_members_types_dolibarr2ldap.php b/scripts/members/sync_members_types_dolibarr2ldap.php
index 939a98c8728..dac7ccfd0bc 100755
--- a/scripts/members/sync_members_types_dolibarr2ldap.php
+++ b/scripts/members/sync_members_types_dolibarr2ldap.php
@@ -41,9 +41,9 @@ if (! isset($argv[1]) || ! $argv[1]) {
}
$now=$argv[1];
-require_once($path."../../htdocs/master.inc.php");
-require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php");
-require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php");
+require_once $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
+require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php";
// Global variables
$version=DOL_VERSION;
diff --git a/scripts/members/sync_members_types_ldap2dolibarr.php b/scripts/members/sync_members_types_ldap2dolibarr.php
index 55d5606cd30..1363f989e15 100755
--- a/scripts/members/sync_members_types_ldap2dolibarr.php
+++ b/scripts/members/sync_members_types_ldap2dolibarr.php
@@ -36,10 +36,10 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
exit(-1);
}
-require_once($path."../../htdocs/master.inc.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php");
-require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php");
+require_once $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
+require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php";
$langs->load("main");
$langs->load("errors");
diff --git a/scripts/modulebuilder/builddoc.php b/scripts/modulebuilder/builddoc.php
index f2c0eef421f..c0b44a0bed8 100755
--- a/scripts/modulebuilder/builddoc.php
+++ b/scripts/modulebuilder/builddoc.php
@@ -45,7 +45,7 @@ if (! isset($argv[1]) || ! $argv[1]) {
}
$modulename=$argv[1];
-require_once ($path."../../htdocs/master.inc.php");
+require_once $path."../../htdocs/master.inc.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
diff --git a/scripts/modulebuilder/initmodule.php b/scripts/modulebuilder/initmodule.php
index 6c9801878d3..bee931dc8fa 100755
--- a/scripts/modulebuilder/initmodule.php
+++ b/scripts/modulebuilder/initmodule.php
@@ -41,7 +41,7 @@ if (! isset($argv[1]) || ! $argv[1]) {
}
$modulename=$argv[1];
-require_once ($path."../../htdocs/master.inc.php");
+require_once $path."../../htdocs/master.inc.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
diff --git a/scripts/product/migrate_picture_path.php b/scripts/product/migrate_picture_path.php
index d72c60f05e5..69322b2f350 100755
--- a/scripts/product/migrate_picture_path.php
+++ b/scripts/product/migrate_picture_path.php
@@ -37,9 +37,9 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
define('EVEN_IF_ONLY_LOGIN_ALLOWED',1); // Set this define to 0 if you want to lock your script when dolibarr setup is "locked to admin user only".
// Include and load Dolibarr environment variables
-require_once($path."../../htdocs/master.inc.php");
-require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
+require_once $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
// After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file).
// $user is created but empty.
diff --git a/scripts/product/regenerate_thumbs.php b/scripts/product/regenerate_thumbs.php
index bc3e1f53a6b..a4d114746c2 100755
--- a/scripts/product/regenerate_thumbs.php
+++ b/scripts/product/regenerate_thumbs.php
@@ -37,10 +37,10 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
define('EVEN_IF_ONLY_LOGIN_ALLOWED',1); // Set this define to 0 if you want to lock your script when dolibarr setup is "locked to admin user only".
// Include and load Dolibarr environment variables
-require_once($path."../../htdocs/master.inc.php");
-require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/images.lib.php");
+require_once $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/images.lib.php";
// After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file).
// $user is created but empty.
diff --git a/scripts/user/sync_groups_dolibarr2ldap.php b/scripts/user/sync_groups_dolibarr2ldap.php
index e661a85beb5..ba304305696 100755
--- a/scripts/user/sync_groups_dolibarr2ldap.php
+++ b/scripts/user/sync_groups_dolibarr2ldap.php
@@ -40,9 +40,9 @@ if (! isset($argv[1]) || ! $argv[1]) {
}
$now=$argv[1];
-require_once($path."../../htdocs/master.inc.php");
-require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php");
-require_once(DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php");
+require_once $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
+require_once DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php";
// Global variables
$version=DOL_VERSION;
diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php
index cb745d9aff3..c78770c7a5c 100755
--- a/scripts/user/sync_groups_ldap2dolibarr.php
+++ b/scripts/user/sync_groups_ldap2dolibarr.php
@@ -35,11 +35,11 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
exit(-1);
}
-require_once($path."../../htdocs/master.inc.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php");
-require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php");
-require_once(DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php");
+require_once $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
+require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php";
+require_once DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php";
$langs->load("main");
$langs->load("errors");
diff --git a/scripts/user/sync_users_dolibarr2ldap.php b/scripts/user/sync_users_dolibarr2ldap.php
index dd5e3d18de4..fa97c871a50 100755
--- a/scripts/user/sync_users_dolibarr2ldap.php
+++ b/scripts/user/sync_users_dolibarr2ldap.php
@@ -40,9 +40,9 @@ if (! isset($argv[1]) || ! $argv[1]) {
}
$now=$argv[1];
-require_once($path."../../htdocs/master.inc.php");
-require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php");
-require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php");
+require_once $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
+require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php";
// Global variables
$version=DOL_VERSION;
diff --git a/scripts/user/sync_users_ldap2dolibarr.php b/scripts/user/sync_users_ldap2dolibarr.php
index 9a04f81c557..8c95bc0071f 100755
--- a/scripts/user/sync_users_ldap2dolibarr.php
+++ b/scripts/user/sync_users_ldap2dolibarr.php
@@ -34,10 +34,10 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
exit(-1);
}
-require_once($path."../../htdocs/master.inc.php");
-require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
-require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php");
-require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php");
+require_once $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
+require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
+require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php";
$langs->load("main");
$langs->load("errors");
diff --git a/scripts/withdrawals/build_withdrawal_file.php b/scripts/withdrawals/build_withdrawal_file.php
index d381c32676a..2f7ad26a1fe 100755
--- a/scripts/withdrawals/build_withdrawal_file.php
+++ b/scripts/withdrawals/build_withdrawal_file.php
@@ -34,11 +34,11 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
exit(-1);
}
-require_once($path."../../htdocs/master.inc.php");
-require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/class/bonprelevement.class.php");
-require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
-require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
-require_once(DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php");
+require_once $path."../../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/compta/prelevement/class/bonprelevement.class.php";
+require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
+require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
+require_once DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php";
// Global variables
$version=DOL_VERSION;
diff --git a/test/phpunit/ModulesTest.php b/test/phpunit/ModulesTest.php
index f8816f8b570..589a9116c78 100755
--- a/test/phpunit/ModulesTest.php
+++ b/test/phpunit/ModulesTest.php
@@ -136,7 +136,7 @@ class ModulesTest extends PHPUnit_Framework_TestCase
'Salaries','Service','Skype','Societe','Stock','Stripe','SupplierProposal','Syslog','Tax','Ticket','User','Variants','WebServices','WebServicesClient','Website','Workflow');
foreach($modulelist as $modlabel)
{
- require_once(DOL_DOCUMENT_ROOT.'/core/modules/mod'.$modlabel.'.class.php');
+ require_once DOL_DOCUMENT_ROOT.'/core/modules/mod'.$modlabel.'.class.php';
$class='mod'.$modlabel;
$mod=new $class($db);
$result=$mod->remove();
diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php
index fe896894d86..6f7ca3610cd 100644
--- a/test/phpunit/WebservicesInvoicesTest.php
+++ b/test/phpunit/WebservicesInvoicesTest.php
@@ -28,7 +28,7 @@ global $conf,$user,$langs,$db;
//require_once 'PHPUnit/Autoload.php';
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
-require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP
+require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
if (empty($user->id))
diff --git a/test/phpunit/WebservicesOrdersTest.php b/test/phpunit/WebservicesOrdersTest.php
index e81ee2d3604..7fb2d101184 100644
--- a/test/phpunit/WebservicesOrdersTest.php
+++ b/test/phpunit/WebservicesOrdersTest.php
@@ -28,7 +28,7 @@ global $conf,$user,$langs,$db;
//require_once 'PHPUnit/Autoload.php';
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
-require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP
+require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
if (empty($user->id)) {
diff --git a/test/phpunit/WebservicesOtherTest.php b/test/phpunit/WebservicesOtherTest.php
index e3725c8609c..45b01aa77d3 100644
--- a/test/phpunit/WebservicesOtherTest.php
+++ b/test/phpunit/WebservicesOtherTest.php
@@ -28,7 +28,7 @@ global $conf,$user,$langs,$db;
//require_once 'PHPUnit/Autoload.php';
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
-require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP
+require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
if (empty($user->id)) {
diff --git a/test/phpunit/WebservicesProductsTest.php b/test/phpunit/WebservicesProductsTest.php
index e3500a68f5b..bcbb37b0419 100644
--- a/test/phpunit/WebservicesProductsTest.php
+++ b/test/phpunit/WebservicesProductsTest.php
@@ -30,7 +30,7 @@ global $conf,$user,$langs,$db;
//require_once 'PHPUnit/Autoload.php';
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
-require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP
+require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
if (empty($user->id)) {
diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php
index 90698407527..e1c2249b62a 100644
--- a/test/phpunit/WebservicesThirdpartyTest.php
+++ b/test/phpunit/WebservicesThirdpartyTest.php
@@ -28,7 +28,7 @@ global $conf,$user,$langs,$db;
//require_once 'PHPUnit/Autoload.php';
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
-require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP
+require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
if (empty($user->id)) {
diff --git a/test/phpunit/WebservicesUserTest.php b/test/phpunit/WebservicesUserTest.php
index 5098da22e6e..bfcdb400cc6 100644
--- a/test/phpunit/WebservicesUserTest.php
+++ b/test/phpunit/WebservicesUserTest.php
@@ -28,7 +28,7 @@ global $conf,$user,$langs,$db;
//require_once 'PHPUnit/Autoload.php';
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
require_once dirname(__FILE__).'/../../htdocs/core/lib/date.lib.php';
-require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP
+require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
if (empty($user->id)) {