| ';
@@ -585,7 +597,9 @@ function show_stats_for_company($product, $socid)
}
$parameters = array('socid'=>$socid);
$reshook = $hookmanager->executeHooks('addMoreProductStat', $parameters, $product, $nblines); // Note that $action and $object may have been modified by some hooks
- if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+ if ($reshook < 0) {
+ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+ }
print $hookmanager->resPrint;
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 47fb9b6f186..6c4dbeffd8a 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -21,9 +21,9 @@
*/
/**
- * \file htdocs/core/lib/project.lib.php
- * \brief Functions used by project module
- * \ingroup project
+ * \file htdocs/core/lib/project.lib.php
+ * \brief Functions used by project module
+ * \ingroup project
*/
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
@@ -487,11 +487,14 @@ function project_timesheet_prepare_head($mode, $fuser = null)
*/
function project_admin_prepare_head()
{
- global $langs, $conf, $user;
- $h = 0;
- $head = array();
+ global $langs, $conf, $user, $db;
+
+ $extrafields = new ExtraFields($db);
+ $extrafields->fetch_name_optionals_label('projet');
+ $extrafields->fetch_name_optionals_label('projet_task');
$h = 0;
+ $head = array();
$head[$h][0] = DOL_URL_ROOT."/projet/admin/project.php";
$head[$h][1] = $langs->trans("Projects");
@@ -502,11 +505,19 @@ function project_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT."/projet/admin/project_extrafields.php";
$head[$h][1] = $langs->trans("ExtraFieldsProject");
+ $nbExtrafields = $extrafields->attributes['projet']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ' '.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/projet/admin/project_task_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsProjectTask");
+ $nbExtrafields = $extrafields->attributes['projet_task']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ' '.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributes_task';
$h++;
diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php
index 71391f2e499..06fae0dd81d 100644
--- a/htdocs/core/lib/propal.lib.php
+++ b/htdocs/core/lib/propal.lib.php
@@ -18,9 +18,9 @@
*/
/**
- * \file htdocs/core/lib/propal.lib.php
- * \brief Ensemble de fonctions de base pour le module propal
- * \ingroup propal
+ * \file htdocs/core/lib/propal.lib.php
+ * \brief Ensemble de fonctions de base pour le module propal
+ * \ingroup propal
*/
/**
@@ -122,7 +122,11 @@ function propal_prepare_head($object)
*/
function propal_admin_prepare_head()
{
- global $langs, $conf, $user;
+ global $langs, $conf, $user, $db;
+
+ $extrafields = new ExtraFields($db);
+ $extrafields->fetch_name_optionals_label('propal');
+ $extrafields->fetch_name_optionals_label('propaldet');
$h = 0;
$head = array();
@@ -140,11 +144,19 @@ function propal_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/comm/admin/propal_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
+ $nbExtrafields = $extrafields->attributes['propal']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ' '.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/admin/propaldet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines");
+ $nbExtrafields = $extrafields->attributes['propaldet']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ' '.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributeslines';
$h++;
diff --git a/htdocs/core/lib/stock.lib.php b/htdocs/core/lib/stock.lib.php
index afad01ebcff..79844f5aed7 100644
--- a/htdocs/core/lib/stock.lib.php
+++ b/htdocs/core/lib/stock.lib.php
@@ -17,8 +17,8 @@
*/
/**
- * \file htdocs/core/lib/stock.lib.php
- * \brief Library file with function for stock module
+ * \file htdocs/core/lib/stock.lib.php
+ * \brief Library file with function for stock module
*/
/**
@@ -88,7 +88,12 @@ function stock_prepare_head($object)
*/
function stock_admin_prepare_head()
{
- global $langs, $conf, $user;
+ global $langs, $conf, $user, $db;
+
+ $extrafields = new ExtraFields($db);
+ $extrafields->fetch_name_optionals_label('entrepot');
+ $extrafields->fetch_name_optionals_label('stock_mouvement');
+ $extrafields->fetch_name_optionals_label('inventory');
$h = 0;
$head = array();
@@ -106,16 +111,28 @@ function stock_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/product/admin/stock_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
+ $nbExtrafields = $extrafields->attributes['entrepot']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ' '.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/product/admin/stock_mouvement_extrafields.php';
$head[$h][1] = $langs->trans("StockMouvementExtraFields");
+ $nbExtrafields = $extrafields->attributes['stock_mouvement']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ' '.$nbExtrafields.'';
+ }
$head[$h][2] = 'stockMouvementAttributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/product/admin/inventory_extrafields.php';
$head[$h][1] = $langs->trans("InventoryExtraFields");
+ $nbExtrafields = $extrafields->attributes['inventory']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ' '.$nbExtrafields.'';
+ }
$head[$h][2] = 'inventoryAttributes';
$h++;
diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php
index 5fd2682d175..eb814cb1295 100644
--- a/htdocs/core/lib/ticket.lib.php
+++ b/htdocs/core/lib/ticket.lib.php
@@ -18,9 +18,9 @@
*/
/**
- * \file core/lib/ticket.lib.php
- * \ingroup ticket
- * \brief This file is a library for Ticket module
+ * \file core/lib/ticket.lib.php
+ * \ingroup ticket
+ * \brief This file is a library for Ticket module
*/
/**
@@ -30,7 +30,10 @@
*/
function ticketAdminPrepareHead()
{
- global $langs, $conf;
+ global $langs, $conf, $db;
+
+ $extrafields = new ExtraFields($db);
+ $extrafields->fetch_name_optionals_label('ticket');
$langs->load("ticket");
@@ -44,6 +47,10 @@ function ticketAdminPrepareHead()
$head[$h][0] = DOL_URL_ROOT.'/admin/ticket_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsTicket");
+ $nbExtrafields = $extrafields->attributes['ticket']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ' '.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributes';
$h++;
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index 4b524f66b3e..79648eddd87 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -250,7 +250,11 @@ function group_prepare_head($object)
*/
function user_admin_prepare_head()
{
- global $langs, $conf, $user;
+ global $langs, $conf, $user, $db;
+
+ $extrafields = new ExtraFields($db);
+ $extrafields->fetch_name_optionals_label('user');
+ $extrafields->fetch_name_optionals_label('usergroup');
$langs->load("users");
$h = 0;
@@ -268,11 +272,19 @@ function user_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/user/admin/user_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("Users").")";
+ $nbExtrafields = $extrafields->attributes['user']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ' '.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/user/admin/group_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("Groups").")";
+ $nbExtrafields = $extrafields->attributes['usergroup']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ' '.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributes_group';
$h++;
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index afaad336f9e..130eb6192e5 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -114,7 +114,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'member', 'class="fa-fw paddingright pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 0 : 1),
- 'loadLangs' => array(),
+ 'loadLangs' => array("members"),
'submenus' => array(),
);
@@ -170,7 +170,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'product', 'class="fa-fw paddingright pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 0 : 1),
- 'loadLangs' => array("products"),
+ 'loadLangs' => array("products", "stocks"),
'submenus' => array(),
);
@@ -379,7 +379,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'hrm', 'class="fa-fw paddingright pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 0 : 1),
- 'loadLangs' => array("holiday"),
+ 'loadLangs' => array("hrm", "holiday"),
'submenus' => array(),
);
@@ -410,7 +410,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'ticket', 'class="fa-fw paddingright pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 0 : 1),
- 'loadLangs' => array("other"),
+ 'loadLangs' => array("ticket", "knowledgemanagement"),
'submenus' => array(),
);
diff --git a/htdocs/core/modules/action/rapport.class.php b/htdocs/core/modules/action/rapport.class.php
index 61579399247..4835c39c194 100644
--- a/htdocs/core/modules/action/rapport.class.php
+++ b/htdocs/core/modules/action/rapport.class.php
@@ -98,10 +98,10 @@ class CommActionRapport
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->title = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month;
$this->subject = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month;
diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php
index e313c612eb0..14815f169f2 100644
--- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php
+++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php
@@ -156,10 +156,10 @@ class pdf_standard_asset extends ModelePDFAsset
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
// Get source company
$this->emetteur = $mysoc;
diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php
index 3ab1cdcc193..bbbd82ec1c7 100644
--- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php
+++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php
@@ -67,10 +67,10 @@ class pdf_ban extends ModeleBankAccountDoc
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php
index 314a1fa7853..e09fef45bf0 100644
--- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php
+++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php
@@ -70,10 +70,10 @@ class pdf_sepamandate extends ModeleBankAccountDoc
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php
index 21c131ad2a6..f32b2306624 100644
--- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php
+++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php
@@ -63,10 +63,10 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
// Retrieves transmitter
$this->emetteur = $mysoc;
diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
index b1476b393d0..2b89f229730 100644
--- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
@@ -149,10 +149,10 @@ class pdf_einstein extends ModelePDFCommandes
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
index 34cdb41e6b8..df28616276d 100644
--- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
@@ -154,10 +154,10 @@ class pdf_eratosthene extends ModelePDFCommandes
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php
index 1875cfb833c..5b45d0014be 100644
--- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php
+++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php
@@ -145,10 +145,10 @@ class pdf_strato extends ModelePDFContract
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
index 7d880328663..550957511ba 100644
--- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
+++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
@@ -140,10 +140,10 @@ class pdf_storm extends ModelePDFDeliveryOrder
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php
index 2e0c3f2d05c..ad8e0bd71a5 100644
--- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php
+++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php
@@ -139,10 +139,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
index 9e2e5286874..485ff20951f 100644
--- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
@@ -134,10 +134,10 @@ class pdf_espadon extends ModelePdfExpedition
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
index e37977144d2..781d581aaf7 100644
--- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
@@ -135,10 +135,10 @@ class pdf_merou extends ModelePdfExpedition
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = round($formatarray['height'] / 2);
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
index 0237c294a0d..3872ad3d4a2 100644
--- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
@@ -135,10 +135,10 @@ class pdf_rouget extends ModelePdfExpedition
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
index f6536cbb1df..fae58f49419 100644
--- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
@@ -119,10 +119,10 @@ class pdf_standard extends ModeleExpenseReport
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index 2a94a94103e..76dc8950670 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -155,10 +155,10 @@ class pdf_crabe extends ModelePDFFactures
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
index ff7a91de9fa..1efca9070d0 100644
--- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
@@ -182,10 +182,10 @@ class pdf_sponge extends ModelePDFFactures
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
index bb4a6826278..2d3e89a6316 100644
--- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
+++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
@@ -137,10 +137,10 @@ class pdf_soleil extends ModelePDFFicheinter
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/modStockTransfer.class.php b/htdocs/core/modules/modStockTransfer.class.php
index 376cf9409f2..4f99039f8f7 100644
--- a/htdocs/core/modules/modStockTransfer.class.php
+++ b/htdocs/core/modules/modStockTransfer.class.php
@@ -1,8 +1,7 @@
* Copyright (C) 2018-2019 Nicolas ZABOURI
- * Copyright (C) 2019-2020 Frédéric France
- * Copyright (C) 2021 SuperAdmin
+ * Copyright (C) 2019-2022 Frédéric France
* Copyright (C) 2021 Gauthier VERDOL
*
* This program is free software; you can redistribute it and/or modify
@@ -63,8 +62,6 @@ class modStockTransfer extends DolibarrModules
$this->description = $langs->trans("ModuleStockTransferDesc");
// Used only if file README.md and README-LL.md not found.
$this->descriptionlong = "StockTransfer description (Long)";
- $this->editor_name = 'Editor name';
- $this->editor_url = 'https://www.example.com';
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
$this->version = 'development';
// Url to the file with your last numberversion of this module
@@ -127,7 +124,7 @@ class modStockTransfer extends DolibarrModules
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
$this->langfiles = array("stocktransfer@stocktransfer");
- $this->phpmin = array(5, 5); // Minimum version of PHP required by module
+ $this->phpmin = array(5, 6); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
$this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
diff --git a/htdocs/core/modules/modWebhook.class.php b/htdocs/core/modules/modWebhook.class.php
index fd7f658bd48..ef4bced304d 100644
--- a/htdocs/core/modules/modWebhook.class.php
+++ b/htdocs/core/modules/modWebhook.class.php
@@ -2,7 +2,6 @@
/* Copyright (C) 2004-2018 Laurent Destailleur
* Copyright (C) 2018-2019 Nicolas ZABOURI
* Copyright (C) 2019-2020 Frédéric France
- * Copyright (C) 2022 SuperAdmin
*
* 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
@@ -67,10 +66,6 @@ class modWebhook extends DolibarrModules
// Used only if file README.md and README-LL.md not found.
$this->descriptionlong = "WebhookDescription";
- // Author
- $this->editor_name = 'Editor name';
- $this->editor_url = 'https://www.example.com';
-
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
$this->version = 'development';
// Url to the file with your last numberversion of this module
diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php
index 6f2a6fcf694..d93a7d99076 100644
--- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php
@@ -116,10 +116,10 @@ class pdf_standard extends ModelePDFMovement
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_codestockservice = 0; // Display stock-service code
diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php
index ed10b5ee2bf..1a61a588ae3 100644
--- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php
+++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php
@@ -144,10 +144,10 @@ class pdf_vinci extends ModelePDFMo
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_multilang = 1; //Available in several languages
diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php
index e4bcc0e4f04..92cf586f848 100644
--- a/htdocs/core/modules/product/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php
@@ -97,10 +97,10 @@ class pdf_standard extends ModelePDFProduct
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_multilang = 1; // Available in several languages
diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php
index df013a2fad0..3bae695f511 100644
--- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php
+++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php
@@ -139,10 +139,10 @@ class pdf_baleine extends ModelePDFProjects
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php
index 1dc5b7bf3f9..c3ce64e3df7 100644
--- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php
+++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php
@@ -175,10 +175,10 @@ class pdf_beluga extends ModelePDFProjects
$this->page_hauteur = $formatarray['height'];
}
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php
index 9d118b2a555..02f3f0c8cfb 100644
--- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php
+++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php
@@ -138,10 +138,10 @@ class pdf_timespent extends ModelePDFProjects
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index c2971c9344e..ea95036b280 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -145,10 +145,10 @@ class pdf_azur extends ModelePDFPropales
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
index 9d52132db56..cdac495c393 100644
--- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
@@ -148,10 +148,10 @@ class pdf_cyan extends ModelePDFPropales
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php
index e4991a5830d..8cb10e0a0f8 100644
--- a/htdocs/core/modules/rapport/pdf_paiement.class.php
+++ b/htdocs/core/modules/rapport/pdf_paiement.class.php
@@ -54,10 +54,10 @@ class pdf_paiement
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->tab_top = 30;
diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php
index 050459d91d2..1b4588e57bb 100644
--- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php
+++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php
@@ -57,10 +57,10 @@ class pdf_squille extends ModelePdfReception
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php
index 3fd3917da2d..d3fa898d0a1 100644
--- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php
@@ -111,10 +111,10 @@ class pdf_standard extends ModelePDFStock
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_codestockservice = 0; // Display product-service code
diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php
index 87a6bcf0e38..2971741f078 100644
--- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php
+++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php
@@ -131,10 +131,10 @@ class pdf_eagle extends ModelePdfStockTransfer
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php
index fa49b0b6d44..493dd0f2f6f 100644
--- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php
+++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php
@@ -145,10 +145,10 @@ class pdf_eagle_proforma extends ModelePDFCommandes
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
index 39a9aab7e78..6e340a39981 100644
--- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
+++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
@@ -141,10 +141,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
index 00d1e2e28e7..a11983991cc 100644
--- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
@@ -143,10 +143,10 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
index 410a631fa62..5b9a572736b 100644
--- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
@@ -143,10 +143,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php
index 676c5768ea3..a6a272d6274 100644
--- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php
@@ -114,10 +114,10 @@ class pdf_standard extends ModelePDFSuppliersPayments
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_multilang = 1; // Available in several languages
diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php
index 55f6293a9d2..ad1a3b9934a 100644
--- a/htdocs/delivery/class/delivery.class.php
+++ b/htdocs/delivery/class/delivery.class.php
@@ -973,7 +973,7 @@ class Delivery extends CommonObject
$sqlSourceLine .= ", p.ref, p.label";
$sqlSourceLine .= " FROM ".MAIN_DB_PREFIX.$this->linkedObjectsIds[0]['type']."det as st";
$sqlSourceLine .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON st.fk_product = p.rowid";
- $sqlSourceLine .= " WHERE fk_".$this->linked_object[0]['type']." = ".((int) $this->linked_object[0]['linkid']);
+ $sqlSourceLine .= " WHERE fk_".$this->linked_objects[0]['type']." = ".((int) $this->linked_objects[0]['linkid']);
$resultSourceLine = $this->db->query($sqlSourceLine);
if ($resultSourceLine) {
@@ -986,12 +986,12 @@ class Delivery extends CommonObject
// Get lines of sources alread delivered
$sql = "SELECT ld.fk_origin_line, sum(ld.qty) as qty";
$sql .= " FROM ".MAIN_DB_PREFIX."deliverydet as ld, ".MAIN_DB_PREFIX."delivery as l,";
- $sql .= " ".MAIN_DB_PREFIX.$this->linked_object[0]['type']." as c";
- $sql .= ", ".MAIN_DB_PREFIX.$this->linked_object[0]['type']."det as cd";
+ $sql .= " ".MAIN_DB_PREFIX.$this->linked_objects[0]['type']." as c";
+ $sql .= ", ".MAIN_DB_PREFIX.$this->linked_objects[0]['type']."det as cd";
$sql .= " WHERE ld.fk_delivery = l.rowid";
$sql .= " AND ld.fk_origin_line = cd.rowid";
- $sql .= " AND cd.fk_".$this->linked_object[0]['type']." = c.rowid";
- $sql .= " AND cd.fk_".$this->linked_object[0]['type']." = ".((int) $this->linked_object[0]['linkid']);
+ $sql .= " AND cd.fk_".$this->linked_objects[0]['type']." = c.rowid";
+ $sql .= " AND cd.fk_".$this->linked_objects[0]['type']." = ".((int) $this->linked_objects[0]['linkid']);
$sql .= " AND ld.fk_origin_line = ".((int) $objSourceLine->rowid);
$sql .= " GROUP BY ld.fk_origin_line";
diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php
index 8e632f9d979..f5da262e0c1 100644
--- a/htdocs/emailcollector/class/emailcollector.class.php
+++ b/htdocs/emailcollector/class/emailcollector.class.php
@@ -16,37 +16,38 @@
*/
/**
- * \file emailcollector/class/emailcollector.class.php
- * \ingroup emailcollector
- * \brief This file is a CRUD class file for EmailCollector (Create/Read/Update/Delete)
+ * \file htdocs/emailcollector/class/emailcollector.class.php
+ * \ingroup emailcollector
+ * \brief This file is a CRUD class file for EmailCollector (Create/Read/Update/Delete)
*/
// 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/lib/files.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
-require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
-require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
-require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
-require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
-require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php';
+include_once DOL_DOCUMENT_ROOT .'/emailcollector/lib/emailcollector.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; // customer proposal
-require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; // customer order
-require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; // Shipment
-require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; // supplier invoice
-require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; // supplier order
-require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; // supplier proposal
-require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; // reception
-include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php';
-//require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; // Holidays (leave request)
-//require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; // expernse repor
+require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
+require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
+
+require_once DOL_DOCUMENT_ROOT .'/comm/propal/class/propal.class.php'; // Customer Proposal
+require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php'; // Customer Order
+require_once DOL_DOCUMENT_ROOT .'/compta/facture/class/facture.class.php'; // Customer Invoice
+require_once DOL_DOCUMENT_ROOT .'/contact/class/contact.class.php'; // Contact / Address
+require_once DOL_DOCUMENT_ROOT .'/expedition/class/expedition.class.php'; // Shipping / Delivery
+require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.commande.class.php'; // Supplier Order
+require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.facture.class.php'; // Supplier Invoice
+require_once DOL_DOCUMENT_ROOT .'/projet/class/project.class.php'; // Project
+require_once DOL_DOCUMENT_ROOT .'/reception/class/reception.class.php'; // Reception
+require_once DOL_DOCUMENT_ROOT .'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting
+require_once DOL_DOCUMENT_ROOT .'/societe/class/societe.class.php'; // Third-Party
+require_once DOL_DOCUMENT_ROOT .'/supplier_proposal/class/supplier_proposal.class.php'; // Supplier Proposal
+require_once DOL_DOCUMENT_ROOT .'/ticket/class/ticket.class.php'; // Ticket
+//require_once DOL_DOCUMENT_ROOT .'/expensereport/class/expensereport.class.php'; // Expense Report
+//require_once DOL_DOCUMENT_ROOT .'/holiday/class/holiday.class.php'; // Holidays (leave request)
// use Webklex\PHPIMAP;
-require DOL_DOCUMENT_ROOT.'/includes/webklex/php-imap/vendor/autoload.php';
-use Webklex\PHPIMAP\ClientManager;
+require DOL_DOCUMENT_ROOT .'/includes/webklex/php-imap/vendor/autoload.php';
+use Webklex\PHPIMAP\ClientManager;
use Webklex\PHPIMAP\Exceptions\ConnectionFailedException;
use Webklex\PHPIMAP\Exceptions\InvalidWhereQueryCriteriaException;
use Webklex\PHPIMAP\Exceptions\GetMessagesFailedException;
@@ -64,14 +65,17 @@ class EmailCollector extends CommonObject
* @var string ID to identify managed object
*/
public $element = 'emailcollector';
+
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'emailcollector_emailcollector';
+
/**
* @var int Does emailcollector support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
public $ismultientitymanaged = 1;
+
/**
* @var int Does emailcollector support extrafields ? 0=No, 1=Yes
*/
@@ -91,6 +95,7 @@ class EmailCollector extends CommonObject
* @var array List of child tables. To test if we can delete object.
*/
protected $childtables = array();
+
/**
* @var array List of child tables. To know object to delete on cascade.
*/
@@ -206,7 +211,6 @@ class EmailCollector extends CommonObject
*/
public $import_key;
-
public $host;
public $port;
public $hostcharset;
@@ -1747,61 +1751,61 @@ class EmailCollector extends CommonObject
$objectid = $reg[2];
// See also list into interface_50_modAgenda_ActionsAuto
- if ($reg[1] == 'thi') {
+ if ($reg[1] == 'thi') { // Third-party
$objectemail = new Societe($this->db);
}
- if ($reg[1] == 'ctc') {
+ if ($reg[1] == 'ctc') { // Contact
$objectemail = new Contact($this->db);
}
- if ($reg[1] == 'inv') { // customer invoices
+ if ($reg[1] == 'inv') { // Customer Invoice
$objectemail = new Facture($this->db);
}
- if ($reg[1] == 'sinv') { // supplier invoices
+ if ($reg[1] == 'sinv') { // Supplier Invoice
$objectemail = new FactureFournisseur($this->db);
}
- if ($reg[1] == 'pro') { // customer proposals
+ if ($reg[1] == 'pro') { // Customer Proposal
$objectemail = new Propal($this->db);
}
- if ($reg[1] == 'ord') { // customer orders
+ if ($reg[1] == 'ord') { // Customer Order
$objectemail = new Commande($this->db);
}
- if ($reg[1] == 'shi') { // shipments
+ if ($reg[1] == 'shi') { // Shipment
$objectemail = new Expedition($this->db);
}
- if ($reg[1] == 'spro') { // supplier proposal
+ if ($reg[1] == 'spro') { // Supplier Proposal
$objectemail = new SupplierProposal($this->db);
}
- if ($reg[1] == 'sord') { // supplier order
+ if ($reg[1] == 'sord') { // Supplier Order
$objectemail = new CommandeFournisseur($this->db);
}
- if ($reg[1] == 'rec') { // Reception
+ if ($reg[1] == 'rec') { // Reception
$objectemail = new Reception($this->db);
}
- if ($reg[1] == 'proj') {
+ if ($reg[1] == 'proj') { // Project
$objectemail = new Project($this->db);
}
- if ($reg[1] == 'tas') {
+ if ($reg[1] == 'tas') { // Task
$objectemail = new Task($this->db);
}
- if ($reg[1] == 'con') {
+ if ($reg[1] == 'con') { // Contact
$objectemail = new Contact($this->db);
}
- if ($reg[1] == 'use') {
+ if ($reg[1] == 'use') { // User
$objectemail = new User($this->db);
}
- if ($reg[1] == 'tic') {
+ if ($reg[1] == 'tic') { // Ticket
$objectemail = new Ticket($this->db);
}
- if ($reg[1] == 'recruitmentcandidature') {
+ if ($reg[1] == 'recruitmentcandidature') { // Recruiting Candidate
$objectemail = new RecruitmentCandidature($this->db);
}
- if ($reg[1] == 'mem') {
+ if ($reg[1] == 'mem') { // Member
$objectemail = new Adherent($this->db);
}
- /*if ($reg[1] == 'leav') {
+ /*if ($reg[1] == 'leav') { // Leave / Holiday
$objectemail = new Holiday($db);
}
- if ($reg[1] == 'exp') {
+ if ($reg[1] == 'exp') { // ExpenseReport
$objectemail = new ExpenseReport($db);
}*/
} elseif (preg_match('/<(.*@.*)>/', $reference, $reg)) {
@@ -2241,42 +2245,42 @@ class EmailCollector extends CommonObject
}
$arrayobject = array(
'propale' => array('table' => 'propal',
- 'fields' => array('ref'),
- 'class' => 'comm/propal/class/propal.class.php',
- 'object' => 'Propal'),
+ 'fields' => array('ref'),
+ 'class' => 'comm/propal/class/propal.class.php',
+ 'object' => 'Propal'),
'holiday' => array('table' => 'holiday',
- 'fields' => array('ref'),
- 'class' => 'holiday/class/holiday.class.php',
- 'object' => 'Holiday'),
+ 'fields' => array('ref'),
+ 'class' => 'holiday/class/holiday.class.php',
+ 'object' => 'Holiday'),
'expensereport' => array('table' => 'expensereport',
- 'fields' => array('ref'),
- 'class' => 'expensereport/class/expensereport.class.php',
- 'object' => 'ExpenseReport'),
+ 'fields' => array('ref'),
+ 'class' => 'expensereport/class/expensereport.class.php',
+ 'object' => 'ExpenseReport'),
'recruitment/recruitmentjobposition' => array('table' => 'recruitment_recruitmentjobposition',
- 'fields' => array('ref'),
- 'class' => 'recruitment/class/recruitmentjobposition.class.php',
- 'object' => 'RecruitmentJobPosition'),
+ 'fields' => array('ref'),
+ 'class' => 'recruitment/class/recruitmentjobposition.class.php',
+ 'object' => 'RecruitmentJobPosition'),
'recruitment/recruitmentjobposition' => array('table' => 'recruitment_recruitmentcandidature',
- 'fields' => array('ref'),
- 'class' => 'recruitment/class/recruitmentcandidature.class.php',
- 'object' => ' RecruitmentCandidature'),
+ 'fields' => array('ref'),
+ 'class' => 'recruitment/class/recruitmentcandidature.class.php',
+ 'object' => ' RecruitmentCandidature'),
'societe' => array('table' => 'societe',
'fields' => array('code_client', 'code_fournisseur'),
'class' => 'societe/class/societe.class.php',
'object' => 'Societe'),
- 'commande' => array('table' => 'commande',
+ 'commande' => array('table' => 'commande',
'fields' => array('ref'),
'class' => 'commande/class/commande.class.php',
'object' => 'Commande'),
- 'expedition' => array('table' => 'expedition',
+ 'expedition' => array('table' => 'expedition',
'fields' => array('ref'),
'class' => 'expedition/class/expedition.class.php',
'object' => 'Expedition'),
- 'contract' => array('table' => 'contrat',
+ 'contract' => array('table' => 'contrat',
'fields' => array('ref'),
'class' => 'contrat/class/contrat.class.php',
'object' => 'Contrat'),
- 'fichinter' => array('table' => 'fichinter',
+ 'fichinter' => array('table' => 'fichinter',
'fields' => array('ref'),
'class' => 'fichinter/class/fichinter.class.php',
'object' => 'Fichinter'),
@@ -2284,51 +2288,51 @@ class EmailCollector extends CommonObject
'fields' => array('ref'),
'class' => 'ticket/class/ticket.class.php',
'object' => ' Ticket'),
- 'knowledgemanagement' => array('table' => 'knowledgemanagement_knowledgerecord',
+ 'knowledgemanagement' => array('table' => 'knowledgemanagement_knowledgerecord',
'fields' => array('ref'),
'class' => 'knowledgemanagement/class/knowledgemanagement.class.php',
'object' => 'KnowledgeRecord'),
- 'supplier_proposal' => array('table' => 'supplier_proposal',
+ 'supplier_proposal' => array('table' => 'supplier_proposal',
'fields' => array('ref'),
'class' => 'supplier_proposal/class/supplier_proposal.class.php',
'object' => 'SupplierProposal'),
- 'fournisseur/commande' => array('table' => 'commande_fournisseur',
+ 'fournisseur/commande' => array('table' => 'commande_fournisseur',
'fields' => array('ref', 'ref_supplier'),
'class' => 'fourn/class/fournisseur.commande.class.php',
'object' => 'SupplierProposal'),
- 'facture' => array('table' => 'facture',
+ 'facture' => array('table' => 'facture',
'fields' => array('ref'),
'class' => 'compta/facture/class/facture.class.php',
'object' => 'Facture'),
- 'fournisseur/facture' => array('table' => 'facture_fourn',
+ 'fournisseur/facture' => array('table' => 'facture_fourn',
'fields' => array('ref', ref_client),
'class' => 'fourn/class/fournisseur.facture.class.php',
'object' => 'FactureFournisseur'),
- 'produit' => array('table' => 'product',
+ 'produit' => array('table' => 'product',
'fields' => array('ref'),
'class' => 'product/class/product.class.php',
'object' => 'Product'),
- 'productlot' => array('table' => 'product_lot',
+ 'productlot' => array('table' => 'product_lot',
'fields' => array('batch'),
'class' => 'product/stock/class/productlot.class.php',
'object' => 'Productlot'),
- 'projet' => array('table' => 'projet',
+ 'projet' => array('table' => 'projet',
'fields' => array('ref'),
'class' => 'projet/class/projet.class.php',
'object' => 'Project'),
- 'projet_task' => array('table' => 'projet_task',
+ 'projet_task' => array('table' => 'projet_task',
'fields' => array('ref'),
'class' => 'projet/class/task.class.php',
'object' => 'Task'),
- 'ressource' => array('table' => 'resource',
+ 'ressource' => array('table' => 'resource',
'fields' => array('ref'),
'class' => 'ressource/class/dolressource.class.php',
'object' => 'Dolresource'),
- 'bom' => array('table' => 'bom_bom',
+ 'bom' => array('table' => 'bom_bom',
'fields' => array('ref'),
'class' => 'bom/class/bom.class.php',
'object' => 'BOM'),
- 'mrp' => array('table' => 'mrp_mo',
+ 'mrp' => array('table' => 'mrp_mo',
'fields' => array('ref'),
'class' => 'mrp/class/mo.class.php',
'object' => 'Mo'),
@@ -2932,6 +2936,7 @@ class EmailCollector extends CommonObject
2.2.1 text/plain
2.2.2 text/html
*/
+
/**
* Sub function for getpart(). Only called by createPartArray() and itself.
*
@@ -3050,10 +3055,10 @@ class EmailCollector extends CommonObject
/**
* Converts a string from one encoding to another.
*
- * @param string $string String to convert
- * @param string $fromEncoding String encoding
- * @param string $toEncoding String return encoding
- * @return string Converted string if conversion was successful, or the original string if not
+ * @param string $string String to convert
+ * @param string $fromEncoding String encoding
+ * @param string $toEncoding String return encoding
+ * @return string Converted string if conversion was successful, or the original string if not
* @throws Exception
*/
protected function convertStringEncoding($string, $fromEncoding, $toEncoding = 'UTF-8')
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index db5182d0a4d..60b3695609d 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -11,7 +11,7 @@
* Copyright (C) 2015 Claudio Aschieri
* Copyright (C) 2016-2018 Ferran Marcet
* Copyright (C) 2016 Yasser Carreón
- * Copyright (C) 2018 Frédéric France
+ * Copyright (C) 2018-2022 Frédéric France
* Copyright (C) 2020 Lenin Rivas
* Copyright (C) 2022 Josep Lluís Amador
*
@@ -214,13 +214,13 @@ if (empty($reshook)) {
$db->begin();
$object->note = GETPOST('note', 'alpha');
- $object->origin = $origin;
+ $object->origin = $origin;
$object->origin_id = $origin_id;
$object->fk_project = GETPOST('projectid', 'int');
- $object->weight = GETPOST('weight', 'int') == '' ? "NULL" : GETPOST('weight', 'int');
- $object->sizeH = GETPOST('sizeH', 'int') == '' ? "NULL" : GETPOST('sizeH', 'int');
- $object->sizeW = GETPOST('sizeW', 'int') == '' ? "NULL" : GETPOST('sizeW', 'int');
- $object->sizeS = GETPOST('sizeS', 'int') == '' ? "NULL" : GETPOST('sizeS', 'int');
+ $object->weight = GETPOST('weight', 'int') == '' ? "NULL" : GETPOST('weight', 'int');
+ $object->sizeH = GETPOST('sizeH', 'int') == '' ? "NULL" : GETPOST('sizeH', 'int');
+ $object->sizeW = GETPOST('sizeW', 'int') == '' ? "NULL" : GETPOST('sizeW', 'int');
+ $object->sizeS = GETPOST('sizeS', 'int') == '' ? "NULL" : GETPOST('sizeS', 'int');
$object->size_units = GETPOST('size_units', 'int');
$object->weight_units = GETPOST('weight_units', 'int');
@@ -233,8 +233,8 @@ if (empty($reshook)) {
$object->ref_customer = GETPOST('ref_customer', 'alpha');
$object->model_pdf = GETPOST('model');
$object->date_delivery = $date_delivery; // Date delivery planed
- $object->fk_delivery_address = $objectsrc->fk_delivery_address;
- $object->shipping_method_id = GETPOST('shipping_method_id', 'int');
+ $object->fk_delivery_address = $objectsrc->fk_delivery_address;
+ $object->shipping_method_id = GETPOST('shipping_method_id', 'int');
$object->tracking_number = GETPOST('tracking_number', 'alpha');
$object->note_private = GETPOST('note_private', 'restricthtml');
$object->note_public = GETPOST('note_public', 'restricthtml');
@@ -265,7 +265,7 @@ if (empty($reshook)) {
$qty .= '_'.$j;
while (GETPOSTISSET($batch)) {
// save line of detail into sub_qty
- $sub_qty[$j]['q'] = GETPOST($qty, 'int'); // the qty we want to move for this stock record
+ $sub_qty[$j]['q'] = price2num(GETPOST($qty, 'alpha'), 'MS'); // the qty we want to move for this stock record
$sub_qty[$j]['id_batch'] = GETPOST($batch, 'int'); // the id into llx_product_batch of stock record to move
$subtotalqty += $sub_qty[$j]['q'];
@@ -481,7 +481,7 @@ if (empty($reshook)) {
// setEventMessages($object->error, $object->errors, 'errors');
// }
//}
- } elseif ($action == 'setdate_livraison' && $user->rights->expedition->creer) {
+ } elseif ($action == 'setdate_livraison' && !empty($user->rights->expedition->creer)) {
$datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
$object->fetch($id);
diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php
index 0d374f1c722..503fa92b108 100644
--- a/htdocs/expensereport/class/expensereport_ik.class.php
+++ b/htdocs/expensereport/class/expensereport_ik.class.php
@@ -120,13 +120,12 @@ class ExpenseReportIk extends CommonObject
public function fetch($id, $ref = null)
{
$result = $this->fetchCommon($id, $ref);
- if ($result > 0 && !empty($this->table_element_line)) {
- $this->fetchLines();
- }
+
return $result;
}
+
/**
* Update object into database
*
diff --git a/htdocs/expensereport/class/expensereport_rule.class.php b/htdocs/expensereport/class/expensereport_rule.class.php
index 02bf8b8ce5c..d695359229d 100644
--- a/htdocs/expensereport/class/expensereport_rule.class.php
+++ b/htdocs/expensereport/class/expensereport_rule.class.php
@@ -171,6 +171,19 @@ class ExpenseReportRule extends CommonObject
}
+ /**
+ * Load object lines in memory from the database
+ *
+ * @return int <0 if KO, 0 if not found, >0 if OK
+ */
+ public function fetchLines()
+ {
+ $this->lines = array();
+
+ $result = $this->fetchLinesCommon();
+ return $result;
+ }
+
/**
* Update object into database
*
diff --git a/htdocs/hrm/evaluation_note.php b/htdocs/hrm/evaluation_note.php
index 1b6b5a35564..5c02b533bb7 100644
--- a/htdocs/hrm/evaluation_note.php
+++ b/htdocs/hrm/evaluation_note.php
@@ -20,25 +20,27 @@
*/
/**
- * \file evaluation_note.php
- * \ingroup hrm
- * \brief Tab for notes on Evaluation
+ * \file htdocs/hrm/evaluation_note.php
+ * \ingroup hrm
+ * \brief Tab for notes on Evaluation
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php';
-require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
+require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php';
+
// Load translation files required by the page
-$langs->loadLangs(array("hrm", "companies"));
+$langs->loadLangs(array('hrm', 'companies'));
// Get parameters
-$id = GETPOST('id', 'int');
-$ref = GETPOST('ref', 'alpha');
-$action = GETPOST('action', 'aZ09');
+$id = GETPOST('id', 'int');
+$ref = GETPOST('ref', 'alpha');
+
+$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
@@ -47,6 +49,7 @@ $object = new Evaluation($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('evaluationnote', 'globalcard')); // Note that conf->hooks_modules contains array
+
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@@ -56,8 +59,9 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id;
}
-$permissionnote = $user->rights->hrm->evaluation->write; // Used by the include of actions_setnotes.inc.php
-$permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include of actions_addupdatedelete.inc.php
+// Permissions
+$permissionnote = $user->rights->hrm->evaluation->write; // Used by the include of actions_setnotes.inc.php
+$permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include of actions_addupdatedelete.inc.php
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php
index e8554c9da3d..05967606a8e 100644
--- a/htdocs/hrm/index.php
+++ b/htdocs/hrm/index.php
@@ -21,9 +21,9 @@
*/
/**
- * \file htdocs/hrm/index.php
- * \ingroup hrm
- * \brief Home page for HRM area.
+ * \file htdocs/hrm/index.php
+ * \ingroup hrm
+ * \brief Home page for HRM area.
*/
@@ -32,10 +32,10 @@ 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';
-require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
-require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
+require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
if (isModEnabled('deplacement')) {
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
diff --git a/htdocs/hrm/job_card.php b/htdocs/hrm/job_card.php
index a9ec4f77121..d8be48bce69 100644
--- a/htdocs/hrm/job_card.php
+++ b/htdocs/hrm/job_card.php
@@ -20,7 +20,7 @@
*/
/**
- * \file job_card.php
+ * \file htdocs/hrm/job_card.php
* \ingroup hrm
* \brief Page to create/edit/view job
*/
@@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
// Load translation files required by the page
-$langs->loadLangs(array("hrm", "other", 'products'));
+$langs->loadLangs(array('hrm', 'other', 'products')); // why products?
// Get parameters
$id = GETPOST('id', 'int');
@@ -76,9 +76,9 @@ if (empty($action) && empty($id) && empty($ref)) {
// Load object
include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
-
+// Permissions
$permissiontoread = $user->rights->hrm->all->read;
-$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
+$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->rights->hrm->all->delete;
$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/job';
diff --git a/htdocs/hrm/job_contact.php b/htdocs/hrm/job_contact.php
index 4a6c9995127..dc25ad6eae2 100644
--- a/htdocs/hrm/job_contact.php
+++ b/htdocs/hrm/job_contact.php
@@ -20,22 +20,23 @@
*/
/**
- * \file job_contact.php
- * \ingroup hrm
- * \brief Tab for contacts linked to Job
+ * \file htdocs/hrm/job_contact.php
+ * \ingroup hrm
+ * \brief Tab for contacts linked to Job
*/
// Load Dolibarr environment
require '../main.inc.php';
-require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
-require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
+require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
// Load translation files required by the page
-$langs->loadLangs(array("hrm", "companies", "other", "mails"));
+$langs->loadLangs(array('hrm', 'companies', 'other', 'mails'));
+// Get Parameters
$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
$ref = GETPOST('ref', 'alpha');
$lineid = GETPOST('lineid', 'int');
@@ -53,6 +54,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
+// Permissions
$permission = $user->rights->hrm->job->write;
// Security check (enable the most restrictive one)
diff --git a/htdocs/hrm/job_document.php b/htdocs/hrm/job_document.php
index 0e4d34e0412..eda504b07cd 100644
--- a/htdocs/hrm/job_document.php
+++ b/htdocs/hrm/job_document.php
@@ -20,9 +20,9 @@
*/
/**
- * \file job_document.php
- * \ingroup hrm
- * \brief Tab for documents linked to Job
+ * \file htdocs/hrm/job_document.php
+ * \ingroup hrm
+ * \brief Tab for documents linked to Job
*/
// Load Dolibarr environment
@@ -36,15 +36,15 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
// Load translation files required by the page
-$langs->loadLangs(array("hrm", "companies", "other", "mails"));
-
+$langs->loadLangs(array('hrm', 'companies', 'other', 'mails'));
+// Get parameters
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm');
$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
$ref = GETPOST('ref', 'alpha');
-// Get parameters
+
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
@@ -68,6 +68,7 @@ $object = new Job($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('jobdocument', 'globalcard')); // Note that conf->hooks_modules contains array
+
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@@ -78,6 +79,7 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->hrm->multidir_output[$object->entity ? $object->entity : $conf->entity]."/job/".get_exdir(0, 0, 0, 1, $object);
}
+// Permissions
$permissiontoread = $user->rights->hrm->all->read;
$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php
index 53cb43ad080..ed0fb480a3a 100644
--- a/htdocs/hrm/job_list.php
+++ b/htdocs/hrm/job_list.php
@@ -20,9 +20,9 @@
*/
/**
- * \file job_list.php
- * \ingroup hrm
- * \brief List page for job
+ * \file htdocs/hrm/job_list.php
+ * \ingroup hrm
+ * \brief List page of jobs
*/
@@ -40,8 +40,9 @@ require_once __DIR__.'/class/job.class.php';
//dol_include_once('/othermodule/class/otherobject.class.php');
// Load translation files required by the page
-$langs->loadLangs(array("hrm", "other"));
+$langs->loadLangs(array('hrm', 'other'));
+// Get Parameters
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
@@ -130,8 +131,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
+// Permissions
$permissiontoread = $user->rights->hrm->all->read;
-$permissiontoadd = $user->rights->hrm->all->write;
+$permissiontoadd = $user->rights->hrm->all->write;
$permissiontodelete = $user->rights->hrm->all->delete;
// Security check
diff --git a/htdocs/hrm/job_note.php b/htdocs/hrm/job_note.php
index 7205afec247..9e64e27d6ae 100644
--- a/htdocs/hrm/job_note.php
+++ b/htdocs/hrm/job_note.php
@@ -20,9 +20,9 @@
*/
/**
- * \file job_note.php
- * \ingroup hrm
- * \brief Tab for notes on Job
+ * \file htdocs/hrm/job_note.php
+ * \ingroup hrm
+ * \brief Tab for notes on Job
*/
@@ -33,12 +33,13 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
// Load translation files required by the page
-$langs->loadLangs(array("hrm", "companies"));
+$langs->loadLangs(array('hrm', 'companies'));
// Get parameters
-$id = GETPOST('id', 'int');
-$ref = GETPOST('ref', 'alpha');
-$action = GETPOST('action', 'aZ09');
+$id = GETPOST('id', 'int');
+$ref = GETPOST('ref', 'alpha');
+
+$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
@@ -47,6 +48,7 @@ $object = new Job($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('jobnote', 'globalcard')); // Note that conf->hooks_modules contains array
+
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@@ -56,6 +58,7 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id;
}
+// Permissions
$permissiontoread = $user->rights->hrm->all->read;
$permissionnote = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php
diff --git a/htdocs/hrm/lib/hrm.lib.php b/htdocs/hrm/lib/hrm.lib.php
index 508cbef22fd..d821c2f5216 100644
--- a/htdocs/hrm/lib/hrm.lib.php
+++ b/htdocs/hrm/lib/hrm.lib.php
@@ -4,6 +4,7 @@
* Copyright (C) 2021 Greg Rastklan
* Copyright (C) 2021 Jean-Pascal BOUDET
* Copyright (C) 2021 Grégory BLEMAND
+ * Copyright (C) 2022 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
@@ -21,7 +22,7 @@
/**
* \file hrm/lib/hrm.lib.php
- * \ingroup hr
+ * \ingroup hrm
* \brief Library files with common functions for Workstation
*/
@@ -32,10 +33,15 @@
*/
function hrmAdminPrepareHead()
{
- global $langs, $conf;
+ global $langs, $conf, $db;
$langs->load("hrm");
+ $extrafields = new ExtraFields($db);
+ $extrafields->fetch_name_optionals_label('hrm_evaluation');
+ $extrafields->fetch_name_optionals_label('hrm_job');
+ $extrafields->fetch_name_optionals_label('hrm_skill');
+
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT . "/admin/hrm.php";
@@ -43,37 +49,37 @@ function hrmAdminPrepareHead()
$head[$h][2] = 'settings';
$h++;
- $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_establishment.php';
- $head[$h][1] = $langs->trans("Establishments");
- $head[$h][2] = 'establishments';
- $h++;
-
- $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/evaluation_extrafields.php';
- $head[$h][1] = $langs->trans("EvaluationsExtraFields");
- $head[$h][2] = 'evaluationsAttributes';
- $h++;
-
- $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/job_extrafields.php';
- $head[$h][1] = $langs->trans("JobsExtraFields");
- $head[$h][2] = 'jobsAttributes';
- $h++;
-
- $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/skill_extrafields.php';
- $head[$h][1] = $langs->trans("SkillsExtraFields");
- $head[$h][2] = 'skillsAttributes';
- $h++;
-
- /*
- $head[$h][0] = dol_buildpath("/workstation/admin/myobject_extrafields.php", 1);
- $head[$h][1] = $langs->trans("ExtraFields");
- $head[$h][2] = 'myobject_extrafields';
+ $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_establishment.php';
+ $head[$h][1] = $langs->trans("Establishments");
+ $head[$h][2] = 'establishments';
$h++;
- */
- /*$head[$h][0] = require_once "/admin/about.php";
- $head[$h][1] = $langs->trans("About");
- $head[$h][2] = 'about';
- $h++;*/
+ $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/evaluation_extrafields.php';
+ $head[$h][1] = $langs->trans("EvaluationsExtraFields");
+ $nbExtrafields = $extrafields->attributes['hrm_evaluation']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ' '.$nbExtrafields.'';
+ }
+ $head[$h][2] = 'evaluationsAttributes';
+ $h++;
+
+ $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/job_extrafields.php';
+ $head[$h][1] = $langs->trans("JobsExtraFields");
+ $nbExtrafields = $extrafields->attributes['hrm_job']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ' '.$nbExtrafields.'';
+ }
+ $head[$h][2] = 'jobsAttributes';
+ $h++;
+
+ $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/skill_extrafields.php';
+ $head[$h][1] = $langs->trans("SkillsExtraFields");
+ $nbExtrafields = $extrafields->attributes['hrm_skill']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ' '.$nbExtrafields.'';
+ }
+ $head[$h][2] = 'skillsAttributes';
+ $h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
@@ -85,7 +91,7 @@ function hrmAdminPrepareHead()
//); // to remove a tab
complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin');
- complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin', 'remove');
+ complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin', 'remove');
return $head;
}
diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php
index fc90a24dec6..fa0e6ab3aed 100644
--- a/htdocs/hrm/position_agenda.php
+++ b/htdocs/hrm/position_agenda.php
@@ -20,9 +20,9 @@
*/
/**
- * \file position_agenda.php
- * \ingroup hrm
- * \brief Tab of events on Position
+ * \file htdocs/hrm/position_agenda.php
+ * \ingroup hrm
+ * \brief Tab of events on Position
*/
@@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
// Load translation files required by the page
-$langs->loadLangs(array("hrm", "other"));
+$langs->loadLangs(array('hrm', 'other'));
// Get parameters
$id = GETPOST('id', 'int');
@@ -79,6 +79,7 @@ $object = new Position($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('positionagenda', 'globalcard')); // Note that conf->hooks_modules contains array
+
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@@ -88,6 +89,7 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id;
}
+// Permissions
$permissiontoread = $user->rights->hrm->all->read;
$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php
diff --git a/htdocs/hrm/position_card.php b/htdocs/hrm/position_card.php
index 168756d9851..c3b9251b5ef 100644
--- a/htdocs/hrm/position_card.php
+++ b/htdocs/hrm/position_card.php
@@ -20,9 +20,9 @@
*/
/**
- * \file position_card.php
- * \ingroup hrm
- * \brief Page to create/edit/view position
+ * \file htdocs/hrm/position_card.php
+ * \ingroup hrm
+ * \brief Page to create/edit/view job position
*/
@@ -37,6 +37,7 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php';
//dol_include_once('/hrm/position.php');
+// Get Parameters
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$backtopage = GETPOST('backtopage', 'alpha');
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
@@ -50,6 +51,7 @@ if ($res < 0) {
dol_print_error($db, $object->error);
}
+// Permissions
$permissiontoread = $user->rights->hrm->all->read;
$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->rights->hrm->all->delete;
diff --git a/htdocs/hrm/position_contact.php b/htdocs/hrm/position_contact.php
index f443099a9e4..4d85987f4d6 100644
--- a/htdocs/hrm/position_contact.php
+++ b/htdocs/hrm/position_contact.php
@@ -20,22 +20,23 @@
*/
/**
- * \file position_contact.php
- * \ingroup hrm
- * \brief Tab for contacts linked to Position
+ * \file htdocs/hrm/position_contact.php
+ * \ingroup hrm
+ * \brief Tab for contacts linked to Job Position
*/
// Load Dolibarr environment
require '../main.inc.php';
-require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
-require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
+require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("hrm", "companies", "other", "mails"));
+// Get Parameters
$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
$ref = GETPOST('ref', 'alpha');
$lineid = GETPOST('lineid', 'int');
@@ -47,12 +48,14 @@ $object = new Position($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('positioncontact', 'globalcard')); // Note that conf->hooks_modules contains array
+
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
+// Permissions
$permission = $user->rights->hrm->position->write;
// Security check (enable the most restrictive one)
diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php
index e9eb83e12e4..e79af867a74 100644
--- a/htdocs/hrm/position_list.php
+++ b/htdocs/hrm/position_list.php
@@ -20,9 +20,9 @@
*/
/**
- * \file position_list.php
- * \ingroup hrm
- * \brief List page for position
+ * \file htdocs/hrm/position_list.php
+ * \ingroup hrm
+ * \brief List page for job positions
*/
@@ -40,8 +40,9 @@ require_once __DIR__.'/class/position.class.php';
//dol_include_once('/othermodule/class/otherobject.class.php');
// Load translation files required by the page
-$langs->loadLangs(array("hrm", "other"));
+$langs->loadLangs(array('hrm', 'other'));
+// Get Parameters
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
@@ -130,8 +131,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
-$permissiontoread = $user->rights->hrm->all->read;
-$permissiontoadd = $user->rights->hrm->all->write;
+// Permissions
+$permissiontoread = $user->rights->hrm->all->read;
+$permissiontoadd = $user->rights->hrm->all->write;
$permissiontodelete = $user->rights->hrm->all->delete;
// Security check
diff --git a/htdocs/hrm/position_note.php b/htdocs/hrm/position_note.php
index 99d6581247f..1ecd77b4bdc 100644
--- a/htdocs/hrm/position_note.php
+++ b/htdocs/hrm/position_note.php
@@ -20,26 +20,27 @@
*/
/**
- * \file position_note.php
- * \ingroup hrm
- * \ingroup hrm
- * \brief Tab for notes on Position
+ * \file htdocs/hrm/position_note.php
+ * \ingroup hrm
+ * \brief Tab for notes on Position
*/
// Load Dolibarr environment
require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';;
require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php';
-require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';;
+
// Load translation files required by the page
-$langs->loadLangs(array("hrm", "companies"));
+$langs->loadLangs(array('hrm', 'companies'));
+
// Get parameters
-$id = GETPOST('id', 'int');
-$ref = GETPOST('ref', 'alpha');
+$id = GETPOST('id', 'int');
+$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
@@ -58,7 +59,8 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id;
}
-$permissionnote = $user->rights->hrm->all->write;
+// Permissions
+$permissionnote = $user->rights->hrm->all->write;
$permissiontoread = $user->rights->hrm->all->read; // Used by the include of actions_addupdatedelete.inc.php
// Security check (enable the most restrictive one)
diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php
index ab5223697e6..3db5ef13ef5 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -198,15 +198,15 @@ if ($action=='downfield' || $action=='upfield')
}
}
*/
-if ($action == 'builddoc') {
- // Build import file
- $result = $objimport->build_file($user, GETPOST('model', 'alpha'), $datatoimport, $array_match_file_to_database);
- if ($result < 0) {
- setEventMessages($objimport->error, $objimport->errors, 'errors');
- } else {
- setEventMessages($langs->trans("FileSuccessfullyBuilt"), null, 'mesgs');
- }
-}
+// if ($action == 'builddoc') {
+// // Build import file
+// $result = $objimport->build_file($user, GETPOST('model', 'alpha'), $datatoimport, $array_match_file_to_database);
+// if ($result < 0) {
+// setEventMessages($objimport->error, $objimport->errors, 'errors');
+// } else {
+// setEventMessages($langs->trans("FileSuccessfullyBuilt"), null, 'mesgs');
+// }
+// }
if ($action == 'deleteprof') {
if (GETPOST("id", 'int')) {
diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
index 6d9aebf934f..f7e7a7a1ba5 100644
--- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
+++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
@@ -689,3 +689,6 @@ ALTER TABLE llx_cronjob ADD UNIQUE INDEX uk_cronjob (label, entity);
ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0;
ALTER TABLE llx_loan_schedule ADD UNIQUE INDEX uk_loan_schedule_ref (fk_loan, datep);
+
+-- We need when upgrade 15 to 16 with Dolibarr v17+ for upgrade2 function migrate_user_photospath2()
+ALTER TABLE llx_user CHANGE COLUMN note note_private text;
diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql
index 4d7bca3f7c9..d0e9cdc7b95 100644
--- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql
+++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql
@@ -175,5 +175,5 @@ create table llx_element_categorie
ALTER TABLE llx_element_categorie ADD UNIQUE INDEX idx_element_categorie_idx (fk_element, fk_categorie);
-ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_fk_categorie(rowid);
+ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_categorie(rowid);
diff --git a/htdocs/install/mysql/tables/llx_element_categorie.key.sql b/htdocs/install/mysql/tables/llx_element_categorie.key.sql
index 5ad41616d38..9bc70cf0863 100644
--- a/htdocs/install/mysql/tables/llx_element_categorie.key.sql
+++ b/htdocs/install/mysql/tables/llx_element_categorie.key.sql
@@ -19,4 +19,4 @@
ALTER TABLE llx_element_categorie ADD UNIQUE INDEX idx_element_categorie_idx (fk_element, fk_categorie);
-ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_fk_categorie(rowid);
+ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_categorie(rowid);
diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql
index 7b86b5c3396..e70716d90c4 100644
--- a/htdocs/install/mysql/tables/llx_user.sql
+++ b/htdocs/install/mysql/tables/llx_user.sql
@@ -75,8 +75,8 @@ create table llx_user
idpers2 varchar(128),
idpers3 varchar(128),
- note_public text,
- note_private text DEFAULT NULL,
+ note_public text,
+ note_private text DEFAULT NULL,
model_pdf varchar(255) DEFAULT NULL,
datelastlogin datetime,
datepreviouslogin datetime,
diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang
index 2a905a76530..1d17bc750ea 100644
--- a/htdocs/langs/fr_FR/mrp.lang
+++ b/htdocs/langs/fr_FR/mrp.lang
@@ -82,7 +82,7 @@ ProductsToProduce=Produits à produire
UnitCost=Coût unitaire
TotalCost=Coût total
BOMTotalCost=Le coût de production de cette nomenclature basé sur chaque quantité et produit à consommer (utilise le prix de revient si défini, sinon le PMP si défini, sinon le meilleur prix d'achat)
-BOMTotalCostService=Si le module "Poste de travail" est activé, alors le calcul est "quantité (convertie en heures) x thm du poste de travail", sinon "quantité (convertie en heures) x prix de revient du service"
+BOMTotalCostService=Si le module "Poste de travail" est activé et qu'un poste de travil est défini par défaut sur la ligne, alors le calcul est "quantité (convertie en heures) x thm du poste de travail", sinon "quantité (convertie en heures) x prix de revient du service"
BOMProductsList=Liste des composants
BOMServicesList=Liste des services
GoOnTabProductionToProduceFirst=Vous devez avoir la production pour clôturer un Ordre de Fabrication (voir onglet '%s'). Mais vous pouvez l'annuler.
diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
index 3990d49fa6d..382b5a0f0ab 100644
--- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
+++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
@@ -121,10 +121,10 @@ class pdf_standard_myobject extends ModelePDFMyObject
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
// Get source company
$this->emetteur = $mysoc;
diff --git a/htdocs/modulebuilder/template/lib/mymodule.lib.php b/htdocs/modulebuilder/template/lib/mymodule.lib.php
index ab8a647efe4..0ebae6eb74f 100644
--- a/htdocs/modulebuilder/template/lib/mymodule.lib.php
+++ b/htdocs/modulebuilder/template/lib/mymodule.lib.php
@@ -30,6 +30,10 @@ function mymoduleAdminPrepareHead()
{
global $langs, $conf;
+ // global $db;
+ // $extrafields = new ExtraFields($db);
+ // $extrafields->fetch_name_optionals_label('myobject');
+
$langs->load("mymodule@mymodule");
$h = 0;
@@ -43,6 +47,10 @@ function mymoduleAdminPrepareHead()
/*
$head[$h][0] = dol_buildpath("/mymodule/admin/myobject_extrafields.php", 1);
$head[$h][1] = $langs->trans("ExtraFields");
+ $nbExtrafields = is_countable($extrafields->attributes['myobject']['label']) ? count($extrafields->attributes['myobject']['label']) : 0;
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ' ' . $nbExtrafields . '';
+ }
$head[$h][2] = 'myobject_extrafields';
$h++;
*/
diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php
index ff6b180b9d8..9fa25f3cf54 100644
--- a/htdocs/mrp/mo_production.php
+++ b/htdocs/mrp/mo_production.php
@@ -1070,7 +1070,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ' '.img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.((int) $line->id).', \''.dol_escape_js($type).'\', \'qtymissingconsume\')"');
print ' | ';
print '';
- if (($action == 'consumeorproduce' || $action == 'consumeandproduceall')) print img_picto($langs->trans('SplitAllQuantity'), 'split.png', 'class="splitbutton splitallbutton field-error-icon" data-max-qty="1" onClick="addDispatchLine('.$line->id.', \'batch\', \'allmissingconsume\')"');
+ if (($action == 'consumeorproduce' || $action == 'consumeandproduceall') && $tmpproduct->status_batch == 2) print img_picto($langs->trans('SplitAllQuantity'), 'split.png', 'class="splitbutton splitallbutton field-error-icon" data-max-qty="1" onClick="addDispatchLine('.$line->id.', \'batch\', \'allmissingconsume\')"');
print ' | ';
}
print '';
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index d24b4e0d12b..5382f231322 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -371,7 +371,9 @@ if (empty($reshook)) {
foreach ($toselect as $toselectid) {
$result = $product->fetch($toselectid);
if ($result > 0 && $product->id > 0) {
- $product->setStatut($product->status ? 0 : 1, null, 'product', 'PRODUCT_MODIFY', 'tosell');
+ if ($product->setStatut($product->status ? 0 : 1, null, 'product', 'PRODUCT_MODIFY', 'tosell') < 0) {
+ setEventMessages($product->error, $product->errors, 'errors');
+ }
}
}
}
@@ -380,7 +382,9 @@ if (empty($reshook)) {
foreach ($toselect as $toselectid) {
$result = $product->fetch($toselectid);
if ($result > 0 && $product->id > 0) {
- $product->setStatut($product->status_buy ? 0 : 1, null, 'product', 'PRODUCT_MODIFY', 'tobuy');
+ if ($product->setStatut($product->status_buy ? 0 : 1, null, 'product', 'PRODUCT_MODIFY', 'tobuy') < 0) {
+ setEventMessages($product->error, $product->errors, 'errors');
+ }
}
}
}
diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php
index 19fd85ace7e..76b26b09a3b 100644
--- a/htdocs/public/onlinesign/newonlinesign.php
+++ b/htdocs/public/onlinesign/newonlinesign.php
@@ -426,6 +426,7 @@ if ($action == "dosign" && empty($cancel)) {
dataType: "text",
data: {
"action" : "importSignature",
+ "token" : \''.newToken().'\',
"signaturebase64" : signature,
"ref" : \''.dol_escape_js($REF).'\',
"securekey" : \''.dol_escape_js($SECUREKEY).'\',
diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php
index 2e85bfab121..bf267a475c6 100644
--- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php
+++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php
@@ -121,10 +121,10 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur);
- $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
- $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
- $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
- $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
+ $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
+ $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
+ $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
+ $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 4b612df0c00..90aafe95f5d 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -12,7 +12,7 @@
* Copyright (C) 2015 Raphaël Doursenaud
* Copyright (C) 2018 Nicolas ZABOURI
* Copyright (C) 2018 Ferran Marcet
- * Copyright (C) 2018-2021 Frédéric France
+ * Copyright (C) 2018-2022 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
@@ -342,6 +342,7 @@ if (empty($reshook)) {
if (!$error) {
//We finally remove the old thirdparty
if ($soc_origin->delete($soc_origin->id, $user) < 1) {
+ setEventMessages($soc_origin->error, $soc_origin->errors, 'errors');
$error++;
}
}
diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php
index df581d96fdc..4994faf5230 100644
--- a/htdocs/ticket/class/ticket.class.php
+++ b/htdocs/ticket/class/ticket.class.php
@@ -1724,9 +1724,10 @@ class Ticket extends CommonObject
* @param array $filename_list List of files to attach (full path of filename on file system)
* @param array $mimetype_list List of MIME type of attached files
* @param array $mimefilename_list List of attached file name in message
+ * @param boolean $send_email Whether the message is sent by email
* @return int <0 if KO, >0 if OK
*/
- public function createTicketMessage($user, $notrigger = 0, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array())
+ public function createTicketMessage($user, $notrigger = 0, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $send_email = false)
{
global $conf, $langs;
$error = 0;
@@ -1752,6 +1753,9 @@ class Ticket extends CommonObject
if ($this->private) {
$actioncomm->code = 'TICKET_MSG_PRIVATE';
}
+ if ($send_email) {
+ $actioncomm->type_code = 'AC_EMAIL';
+ }
$actioncomm->socid = $this->socid;
$actioncomm->label = $this->subject;
$actioncomm->note_private = $this->message;
@@ -2536,7 +2540,7 @@ class Ticket extends CommonObject
$listofnames = $resarray['listofnames'];
$listofmimes = $resarray['listofmimes'];
- $id = $object->createTicketMessage($user, 0, $listofpaths, $listofmimes, $listofnames);
+ $id = $object->createTicketMessage($user, 0, $listofpaths, $listofmimes, $listofnames, $send_email);
if ($id <= 0) {
$error++;
$this->error = $object->error;