';
print $langs->trans("NotificationDisableConfirmMessageUser").' ';
print '';
From f4d4733b15fac96d2fe011464fa40ee600900702 Mon Sep 17 00:00:00 2001
From: Adrien Raze
Date: Thu, 19 Aug 2021 15:37:32 +0200
Subject: [PATCH 007/134] NEW : Select for BOM workable + JS to fill it
according to the product selected
---
htdocs/bom/bom_card.php | 25 ++++++++++++++++++++
htdocs/bom/script/interface.php | 29 ++++++++++++++++++++++++
htdocs/bom/tpl/objectline_create.tpl.php | 4 ++++
htdocs/bom/tpl/objectline_title.tpl.php | 3 +++
htdocs/bom/tpl/objectline_view.tpl.php | 2 ++
htdocs/langs/en_US/mrp.lang | 1 +
htdocs/langs/fr_FR/mrp.lang | 1 +
7 files changed, 65 insertions(+)
create mode 100644 htdocs/bom/script/interface.php
diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php
index cd530994b9b..7bcbcc19e46 100644
--- a/htdocs/bom/bom_card.php
+++ b/htdocs/bom/bom_card.php
@@ -570,6 +570,31 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
print '';
}
+ ?>
+
+ ';
print "\n";
diff --git a/htdocs/bom/script/interface.php b/htdocs/bom/script/interface.php
new file mode 100644
index 00000000000..d5811db0414
--- /dev/null
+++ b/htdocs/bom/script/interface.php
@@ -0,0 +1,29 @@
+query($sql);
+ if ($resql && $db->num_rows($resql) > 0) {
+ $options = array();
+ $cpt=0;
+ while ($obj = $db->fetch_object($resql)){
+
+ $options[$obj->rowid] = $obj->ref.' - '.$obj->label;
+ $cpt++;
+ }
+ print json_encode($options);
+ }
+
+ break;
+}
diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php
index 7cc2873b261..5835849e9ff 100644
--- a/htdocs/bom/tpl/objectline_create.tpl.php
+++ b/htdocs/bom/tpl/objectline_create.tpl.php
@@ -107,6 +107,10 @@ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
echo '';
}
+$coldisplay++;
+print '';
+print ' ';
+print ' ';
$coldisplay++;
print ' ';
diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php
index d1b29ee03b0..6b7f04b58f0 100644
--- a/htdocs/bom/tpl/objectline_title.tpl.php
+++ b/htdocs/bom/tpl/objectline_title.tpl.php
@@ -52,6 +52,9 @@ if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
// Description
print ''.$langs->trans('Description').' ';
+// Linked BOM
+print ''.$langs->trans('BOM').' ';
+
// Qty
print ''.$form->textwithpicto($langs->trans('Qty'), $langs->trans("QtyRequiredIfNoLoss")).' ';
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index fff9d077a08..d3559857a2a 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -83,6 +83,8 @@ $tmpproduct->fetch($line->fk_product);
print $tmpproduct->getNomUrl(1);
print ' - '.$tmpproduct->label;
print ' ';
+
+print ' ';
print '';
$coldisplay++;
echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price
diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang
index 2414a92cefb..8aaf345feed 100644
--- a/htdocs/langs/en_US/mrp.lang
+++ b/htdocs/langs/en_US/mrp.lang
@@ -101,3 +101,4 @@ HumanMachine=Human / Machine
WorkstationArea=Workstation area
Machines=Machines
THMEstimatedHelp=This rate makes it possible to define a forecast cost of the item
+BOM=Nomenclature
diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang
index e0a2e73365e..2db57d53bfb 100644
--- a/htdocs/langs/fr_FR/mrp.lang
+++ b/htdocs/langs/fr_FR/mrp.lang
@@ -101,3 +101,4 @@ HumanMachine=Humain/machine
WorkstationArea=Espace Poste de travail
Machines=Machines
THMEstimatedHelp=Ce taux permet de définir un coût prévisionnel de l'article
+BOM=Nomenclature
From 6de7d9b0af679fd56f68cebd8d604bbb31e598f3 Mon Sep 17 00:00:00 2001
From: Adrien Raze
Date: Fri, 20 Aug 2021 13:37:28 +0200
Subject: [PATCH 008/134] NEW : Add sub-BOM lines on BOM card
---
htdocs/bom/bom_card.php | 11 ++++-
htdocs/bom/class/bom.class.php | 6 +++
htdocs/bom/tpl/objectline_view.tpl.php | 56 +++++++++++++++++++++++++-
3 files changed, 71 insertions(+), 2 deletions(-)
diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php
index 7bcbcc19e46..1126e04785e 100644
--- a/htdocs/bom/bom_card.php
+++ b/htdocs/bom/bom_card.php
@@ -140,6 +140,7 @@ if (empty($reshook)) {
// Set if we used free entry or predefined product
$idprod = (int) GETPOST('idprod', 'int');
+ $bom_child = (int) GETPOST('bom_select', 'int');
$qty = price2num(GETPOST('qty', 'alpha'), 'MS');
$qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS');
$disable_stock_change = GETPOST('disable_stock_change', 'int');
@@ -163,6 +164,7 @@ if (empty($reshook)) {
$bomline = new BOMLine($db);
$bomline->fk_bom = $id;
$bomline->fk_product = $idprod;
+ $bomline->fk_bom_child = $bom_child;
$bomline->qty = $qty;
$bomline->qty_frozen = (int) $qty_frozen;
$bomline->disable_stock_change = (int) $disable_stock_change;
@@ -574,18 +576,25 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
+
+ ';
*/
$coldisplay++;
+// For BOM
+print ' ';
print '';
if (($line->info_bits & 2) != 2) {
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index 623fdab1474..c869a617b2a 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -81,9 +81,9 @@ $coldisplay++;
$tmpproduct = new Product($object->db);
$tmpproduct->fetch($line->fk_product);
$tmpbom = new BOM($object->db);
-$res = $tmpbom->fetch($line->fk_bom_child);
+$tmpbom->fetch($line->fk_bom_child);
if (!empty($tmpbom->id)){
- print '' . (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? '(+)' : '(-)') . ' ';
+ print '' . (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? '(+)' : '(-)') . ' ';
}
print $tmpproduct->getNomUrl(1);
print ' - '.$tmpproduct->label;
@@ -193,15 +193,15 @@ if ($resql){
$sub_bom_line = new BOMLine($object->db);
$sub_bom_line->fetch($obj->rowid);
- print ' ';
+ print ' ';
- print ''.$sub_bom_product->getNomUrl(1).' ';
+ print ' '.$sub_bom_product->getNomUrl(1).' ';
if ($sub_bom_line->fk_bom_child > 0) {
print ''.$sub_bom->getNomUrl(1).' ';
} else {
print ' ';
}
- print ''.price($sub_bom_line->qty, 0, '', 0, 0).' ';
+ print ''.price($sub_bom_line->qty * $line->qty, 0, '', 0, 0).' ';
if ($sub_bom_line->qty_frozen > 0) {
print ''.$sub_bom_line->qty_frozen.' ';
} else {
@@ -215,7 +215,7 @@ if ($resql){
}
print ''.$sub_bom_line->efficiency.' ';
- print ''.price($sub_bom_line->total_cost).' ';
+ print ''.price($sub_bom_line->total_cost * $line->qty).' ';
print ' ';
print ' ';
print ' ';
From 2343ff2ed4a06690230c95204cf0ca7d307870f7 Mon Sep 17 00:00:00 2001
From: Adrien Raze
Date: Mon, 23 Aug 2021 11:58:15 +0200
Subject: [PATCH 010/134] NEW : ShowAll/HideAll Options
---
htdocs/bom/bom_card.php | 9 ++++-----
htdocs/bom/tpl/objectline_title.tpl.php | 2 ++
htdocs/bom/tpl/objectline_view.tpl.php | 2 +-
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php
index 2df4278ecbe..71c64087419 100644
--- a/htdocs/bom/bom_card.php
+++ b/htdocs/bom/bom_card.php
@@ -615,7 +615,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$(".collapse_bom").click(function() {
var id_bom_line = $(this).attr('id').replace('collapse-', '');
- console.log('tr [parentid="'+ id_bom_line +'"]')
if($(this).text().indexOf('+') > 0) {
$('[parentid="'+ id_bom_line +'"]').show();
$(this).html('(-) ');
@@ -630,14 +629,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
//TODO : SHOW ALL / COLLAPSE ALL
$("#show_all").click(function() {
- $("[class^=batch_warehouse]").show();
- $("[class^=collapse_batch]").html('(-) ');
+ $("[class^=sub_bom_lines]").show();
+ $("[class^=collapse_bom]").html('(-) ');
return false;
});
$("#hide_all").click(function() {
- $("[class^=batch_warehouse]").hide();
- $("[class^=collapse_batch]").html('(+) ');
+ $("[class^=sub_bom_lines]").hide();
+ $("[class^=collapse_bom]").html('(+) ');
return false;
});
diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php
index 6b7f04b58f0..0656f23aed9 100644
--- a/htdocs/bom/tpl/objectline_title.tpl.php
+++ b/htdocs/bom/tpl/objectline_title.tpl.php
@@ -43,6 +43,8 @@ print "\n";
print "\n";
print '';
+print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").' ';
+print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").' ';
// Adds a line numbering column
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index c869a617b2a..87013582fac 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -193,7 +193,7 @@ if ($resql){
$sub_bom_line = new BOMLine($object->db);
$sub_bom_line->fetch($obj->rowid);
- print ' ';
+ print ' ';
print ' '.$sub_bom_product->getNomUrl(1).' ';
if ($sub_bom_line->fk_bom_child > 0) {
From 6cd92ca82971b3cbf5654a3b8eb35651b0fe9ad5 Mon Sep 17 00:00:00 2001
From: Adrien Raze
Date: Mon, 23 Aug 2021 12:15:09 +0200
Subject: [PATCH 011/134] NEW : Trad + Comments + Adding tooltips for conf
---
htdocs/bom/bom_card.php | 4 ++--
htdocs/bom/tpl/objectline_title.tpl.php | 2 ++
htdocs/langs/en_US/mrp.lang | 4 +++-
htdocs/langs/fr_FR/mrp.lang | 1 +
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php
index 71c64087419..85ce0a0366d 100644
--- a/htdocs/bom/bom_card.php
+++ b/htdocs/bom/bom_card.php
@@ -627,13 +627,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
return false;
});
- //TODO : SHOW ALL / COLLAPSE ALL
+ //To Show all the sub bom lines
$("#show_all").click(function() {
$("[class^=sub_bom_lines]").show();
$("[class^=collapse_bom]").html('(-) ');
return false;
});
-
+ //To Hide all the sub bom lines
$("#hide_all").click(function() {
$("[class^=sub_bom_lines]").hide();
$("[class^=collapse_bom]").html('(+) ');
diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php
index 0656f23aed9..ce811096d33 100644
--- a/htdocs/bom/tpl/objectline_title.tpl.php
+++ b/htdocs/bom/tpl/objectline_title.tpl.php
@@ -45,6 +45,8 @@ print "\n";
print '';
print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").' ';
print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").' ';
+$form = new Form($object->db);
+print $form->textwithpicto('', $langs->trans('CollapseBOMHelp'), 1, 'help', '');
// Adds a line numbering column
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang
index 8aaf345feed..c414a219894 100644
--- a/htdocs/langs/en_US/mrp.lang
+++ b/htdocs/langs/en_US/mrp.lang
@@ -101,4 +101,6 @@ HumanMachine=Human / Machine
WorkstationArea=Workstation area
Machines=Machines
THMEstimatedHelp=This rate makes it possible to define a forecast cost of the item
-BOM=Nomenclature
+BOM=Bill Of Materials
+CollapseBOMHelp=You can define the default display of the details of the nomenclature in the configuration of the BOM module
+
diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang
index 2db57d53bfb..12873fd5093 100644
--- a/htdocs/langs/fr_FR/mrp.lang
+++ b/htdocs/langs/fr_FR/mrp.lang
@@ -102,3 +102,4 @@ WorkstationArea=Espace Poste de travail
Machines=Machines
THMEstimatedHelp=Ce taux permet de définir un coût prévisionnel de l'article
BOM=Nomenclature
+CollapseBOMHelp=Vous pouvez définir l'affichage par défaut du détail des nomenclature dans la configuration du module "Nomenclature Produits"
From e282feb3970ef6f99b89b9ed1ced4364e91bd331 Mon Sep 17 00:00:00 2001
From: Adrien Raze
Date: Mon, 23 Aug 2021 14:43:17 +0200
Subject: [PATCH 012/134] NEW : Delete conf
---
htdocs/bom/tpl/objectline_title.tpl.php | 2 --
htdocs/bom/tpl/objectline_view.tpl.php | 8 ++++++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php
index ce811096d33..0656f23aed9 100644
--- a/htdocs/bom/tpl/objectline_title.tpl.php
+++ b/htdocs/bom/tpl/objectline_title.tpl.php
@@ -45,8 +45,6 @@ print "\n";
print '';
print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").' ';
print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").' ';
-$form = new Form($object->db);
-print $form->textwithpicto('', $langs->trans('CollapseBOMHelp'), 1, 'help', '');
// Adds a line numbering column
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index 87013582fac..fbfb02576df 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -81,7 +81,7 @@ $coldisplay++;
$tmpproduct = new Product($object->db);
$tmpproduct->fetch($line->fk_product);
$tmpbom = new BOM($object->db);
-$tmpbom->fetch($line->fk_bom_child);
+$res = $tmpbom->fetch($line->fk_bom_child);
if (!empty($tmpbom->id)){
print '' . (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? '(+)' : '(-)') . ' ';
}
@@ -193,7 +193,11 @@ if ($resql){
$sub_bom_line = new BOMLine($object->db);
$sub_bom_line->fetch($obj->rowid);
- print ' ';
+ if (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT)){
+ print ' ';
+ } else {
+ print ' ';
+ }
print ' '.$sub_bom_product->getNomUrl(1).' ';
if ($sub_bom_line->fk_bom_child > 0) {
From 7474d2eef57aaec32713309ece7f84f7b85d8d88 Mon Sep 17 00:00:00 2001
From: Adrien Raze
Date: Mon, 23 Aug 2021 15:08:32 +0200
Subject: [PATCH 013/134] FIX : Add BOM column for create view
---
htdocs/bom/tpl/objectline_create.tpl.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php
index 5835849e9ff..1a60029c439 100644
--- a/htdocs/bom/tpl/objectline_create.tpl.php
+++ b/htdocs/bom/tpl/objectline_create.tpl.php
@@ -61,6 +61,8 @@ if ($nolinesbefore) {
print '';
print '
'.$langs->trans('AddNewLine').' ';
print ' ';
+ // Linked BOM
+ print ''.$langs->trans('BOM').' ';
print ''.$langs->trans('Qty').' ';
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
print '';
From 2ecc448bc032e626436544c5eb6c7d95598fd480 Mon Sep 17 00:00:00 2001
From: Adrien Raze
Date: Wed, 25 Aug 2021 11:21:54 +0200
Subject: [PATCH 014/134] FIX : Set total_cost for parent line by additionning
total_cost of the children lines
---
htdocs/bom/tpl/objectline_view.tpl.php | 33 +++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index fbfb02576df..0d83754dd60 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -123,7 +123,8 @@ $coldisplay++;
echo $line->efficiency;
print ' ';
-print '';
+$total_cost = 0;
+print ' ';
$coldisplay++;
echo price($line->total_cost);
print ' ';
@@ -199,7 +200,7 @@ if ($resql){
print '';
}
- print ' '.$sub_bom_product->getNomUrl(1).' ';
+ print ''.$sub_bom_product->getNomUrl(1).' ';
if ($sub_bom_line->fk_bom_child > 0) {
print ''.$sub_bom->getNomUrl(1).' ';
} else {
@@ -219,13 +220,39 @@ if ($resql){
}
print ''.$sub_bom_line->efficiency.' ';
- print ''.price($sub_bom_line->total_cost * $line->qty).' ';
+ if ($sub_bom_product->cost_price > 0) {
+ print ''.price($sub_bom_product->cost_price * $line->qty).' ';
+ $total_cost.= $sub_bom_product->cost_price * $line->qty;
+ } else if ($sub_bom_product->pmp > 0) {
+ print ''.price($sub_bom_product->pmp * $line->qty).' ';
+ $total_cost.= $sub_bom_product->pmp * $line->qty;
+ } else {
+ $sql_supplier_price = 'SELECT MIN(price) AS min_price FROM '.MAIN_DB_PREFIX.'product_fournisseur_price';
+ $sql_supplier_price.= ' WHERE fk_product = '.$sub_bom_product->id;
+ $resql_supplier_price = $object->db->query($sql_supplier_price);
+ if ($resql_supplier_price) {
+ $obj = $object->db->fetch_object($resql_supplier_price);
+ print ''.price($obj->min_price * $line->qty).' ';
+ $total_cost+= $obj->min_price * $line->qty;
+ }
+ }
+
print ' ';
print ' ';
print ' ';
}
}
+if ($total_cost > 0) {
+ $line->total_cost = price($total_cost);
+ ?>
+
+ showOptionals($extrafields, 'view', array('style'=>'class="drag drop oddeven"', 'colspan'=>$coldisplay), '', '', 1, 'line');
From 5bf8685f72182994c38bde5dd35cabe75d516763 Mon Sep 17 00:00:00 2001
From: Adrien Raze
Date: Wed, 25 Aug 2021 16:58:22 +0200
Subject: [PATCH 015/134] NEW : Add comments
---
htdocs/bom/tpl/objectline_view.tpl.php | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index 0d83754dd60..26f4d070876 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -89,6 +89,7 @@ print $tmpproduct->getNomUrl(1);
print ' - '.$tmpproduct->label;
print '';
+// To show BOM links in the list
if ($res > 0) {
print ''.$tmpbom->getNomUrl(1).' ';
} else {
@@ -179,11 +180,13 @@ if ($action == 'selectlines') {
print ' ';
+// Select of all the sub-BOM lines
$sql = 'SELECT rowid, fk_bom_child, fk_product FROM '.MAIN_DB_PREFIX.'bom_bomline AS bl';
$sql.= ' WHERE fk_bom = '.$tmpbom->id;
$resql = $object->db->query($sql);
if ($resql){
+ // Loop on all the sub-BOM lines if they exist
while ($obj = $object->db->fetch_object($resql)){
$sub_bom_product = new Product($object->db);
$sub_bom_product->fetch($obj->fk_product);
@@ -194,18 +197,24 @@ if ($resql){
$sub_bom_line = new BOMLine($object->db);
$sub_bom_line->fetch($obj->rowid);
+ //If hidden conf is set, we show directly all the sub-BOM lines
if (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT)){
print '';
} else {
print ' ';
}
+ // Product
print ''.$sub_bom_product->getNomUrl(1).' ';
+
+ // Sub-BOM
if ($sub_bom_line->fk_bom_child > 0) {
print ''.$sub_bom->getNomUrl(1).' ';
} else {
print ' ';
}
+
+ // Qty
print ''.price($sub_bom_line->qty * $line->qty, 0, '', 0, 0).' ';
if ($sub_bom_line->qty_frozen > 0) {
print ''.$sub_bom_line->qty_frozen.' ';
@@ -213,20 +222,28 @@ if ($resql){
print ' ';
}
+ // Disable stock change
if ($sub_bom_line->disable_stock_change > 0) {
print ''.$sub_bom_line->disable_stock_change.' ';
} else {
print ' ';
}
+ // Efficiency
print ''.$sub_bom_line->efficiency.' ';
+
+ // Cost price if it's defined
if ($sub_bom_product->cost_price > 0) {
print ''.price($sub_bom_product->cost_price * $line->qty).' ';
$total_cost.= $sub_bom_product->cost_price * $line->qty;
- } else if ($sub_bom_product->pmp > 0) {
+ }
+ // PMP if cost price isn't defined
+ else if ($sub_bom_product->pmp > 0) {
print ''.price($sub_bom_product->pmp * $line->qty).' ';
$total_cost.= $sub_bom_product->pmp * $line->qty;
- } else {
+ }
+ // Minimum purchase price if cost price and PMP aren't defined
+ else {
$sql_supplier_price = 'SELECT MIN(price) AS min_price FROM '.MAIN_DB_PREFIX.'product_fournisseur_price';
$sql_supplier_price.= ' WHERE fk_product = '.$sub_bom_product->id;
$resql_supplier_price = $object->db->query($sql_supplier_price);
@@ -243,6 +260,7 @@ if ($resql){
}
}
+// Replace of the total_cost value by the sum of all sub-BOM lines total_cost
if ($total_cost > 0) {
$line->total_cost = price($total_cost);
?>
From 3a7d062d7deee5461391351bdb1cbbe6b60c863b Mon Sep 17 00:00:00 2001
From: stickler-ci
Date: Wed, 25 Aug 2021 15:24:03 +0000
Subject: [PATCH 016/134] Fixing style errors.
---
htdocs/bom/script/interface.php | 5 ++---
htdocs/bom/tpl/objectline_view.tpl.php | 10 +++++-----
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/htdocs/bom/script/interface.php b/htdocs/bom/script/interface.php
index d5811db0414..c93b54fdc33 100644
--- a/htdocs/bom/script/interface.php
+++ b/htdocs/bom/script/interface.php
@@ -7,7 +7,7 @@ $current_bom_id = GETPOST('current_bom_id', 'alphanohtml');
global $db;
-switch ($action){
+switch ($action) {
case 'select_BOM':
//Selection of nomenclatures corresponding to the selected product
$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product, p.label AS product_label FROM '.MAIN_DB_PREFIX.'bom_bom AS b ';
@@ -17,8 +17,7 @@ switch ($action){
if ($resql && $db->num_rows($resql) > 0) {
$options = array();
$cpt=0;
- while ($obj = $db->fetch_object($resql)){
-
+ while ($obj = $db->fetch_object($resql)) {
$options[$obj->rowid] = $obj->ref.' - '.$obj->label;
$cpt++;
}
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index 26f4d070876..a25cdeb87ec 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -82,7 +82,7 @@ $tmpproduct = new Product($object->db);
$tmpproduct->fetch($line->fk_product);
$tmpbom = new BOM($object->db);
$res = $tmpbom->fetch($line->fk_bom_child);
-if (!empty($tmpbom->id)){
+if (!empty($tmpbom->id)) {
print '' . (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? '(+)' : '(-)') . ' ';
}
print $tmpproduct->getNomUrl(1);
@@ -185,9 +185,9 @@ $sql = 'SELECT rowid, fk_bom_child, fk_product FROM '.MAIN_DB_PREFIX.'bom_bomlin
$sql.= ' WHERE fk_bom = '.$tmpbom->id;
$resql = $object->db->query($sql);
-if ($resql){
+if ($resql) {
// Loop on all the sub-BOM lines if they exist
- while ($obj = $object->db->fetch_object($resql)){
+ while ($obj = $object->db->fetch_object($resql)) {
$sub_bom_product = new Product($object->db);
$sub_bom_product->fetch($obj->fk_product);
@@ -198,7 +198,7 @@ if ($resql){
$sub_bom_line->fetch($obj->rowid);
//If hidden conf is set, we show directly all the sub-BOM lines
- if (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT)){
+ if (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT)) {
print '';
} else {
print ' ';
@@ -238,7 +238,7 @@ if ($resql){
$total_cost.= $sub_bom_product->cost_price * $line->qty;
}
// PMP if cost price isn't defined
- else if ($sub_bom_product->pmp > 0) {
+ elseif ($sub_bom_product->pmp > 0) {
print ''.price($sub_bom_product->pmp * $line->qty).' ';
$total_cost.= $sub_bom_product->pmp * $line->qty;
}
From a79abfd4e01e70850c8893c1c5b645bd5fdb962c Mon Sep 17 00:00:00 2001
From: henrynopo
Date: Thu, 26 Aug 2021 10:37:03 +0800
Subject: [PATCH 017/134] Update card.php
---
htdocs/compta/facture/card.php | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 31de2bbd4ff..4658c10873d 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -4052,6 +4052,8 @@ if ($action == 'create') {
$i++;
$close[$i]['code'] = 'badcustomer';
$i++;
+ $close[$i]['code'] = 'bankcharge';
+ $i++;
$close[$i]['code'] = 'other';
$i++;
// Help
@@ -4060,6 +4062,8 @@ if ($action == 'create') {
$i++;
$close[$i]['label'] = $langs->trans("ConfirmClassifyPaidPartiallyReasonBadCustomerDesc");
$i++;
+ $close[$i]['label'] = $langs->trans("ConfirmClassifyPaidPartiallyReasonBankChargeDesc");
+ $i++;
$close[$i]['label'] = $langs->trans("Other");
$i++;
// Texte
@@ -4068,6 +4072,8 @@ if ($action == 'create') {
$i++;
$close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer", $resteapayer, $langs->trans("Currency".$conf->currency)), $close[$i]['label'], 1);
$i++;
+ $close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBankCharge", $resteapayer, $langs->trans("Currency".$conf->currency)), $close[$i]['label'], 1);
+ $i++;
$close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("Other"), $close[$i]['label'], 1);
$i++;
// arrayreasons[code]=reason
From a25580f97cfeda3e314926264063d85e0d251a18 Mon Sep 17 00:00:00 2001
From: henrynopo
Date: Thu, 26 Aug 2021 10:38:53 +0800
Subject: [PATCH 018/134] Update bills.lang
---
htdocs/langs/en_US/bills.lang | 2 ++
1 file changed, 2 insertions(+)
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index a921aac9e48..6a88f2599dd 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -192,6 +192,7 @@ ConfirmClassifyPaidPartiallyReasonDiscount=Remaining unpaid (%s %s) is a
ConfirmClassifyPaidPartiallyReasonDiscountNoVat=Remaining unpaid (%s %s) is a discount granted because payment was made before term. I accept to lose the VAT on this discount.
ConfirmClassifyPaidPartiallyReasonDiscountVat=Remaining unpaid (%s %s) is a discount granted because payment was made before term. I recover the VAT on this discount without a credit note.
ConfirmClassifyPaidPartiallyReasonBadCustomer=Bad customer
+ConfirmClassifyPaidPartiallyReasonBankCharge=Deduction by bank (intermediary bank fees)
ConfirmClassifyPaidPartiallyReasonProductReturned=Products partially returned
ConfirmClassifyPaidPartiallyReasonOther=Amount abandoned for other reason
ConfirmClassifyPaidPartiallyReasonDiscountNoVatDesc=This choice is possible if your invoice has been provided with suitable comments. (Example «Only the tax corresponding to the price that has been actually paid gives rights to deduction»)
@@ -199,6 +200,7 @@ ConfirmClassifyPaidPartiallyReasonDiscountVatDesc=In some countries, this choice
ConfirmClassifyPaidPartiallyReasonAvoirDesc=Use this choice if all other does not suit
ConfirmClassifyPaidPartiallyReasonBadCustomerDesc=A bad customer is a customer that refuses to pay his debt.
ConfirmClassifyPaidPartiallyReasonProductReturnedDesc=This choice is used when payment is not complete because some of products were returned
+ConfirmClassifyPaidPartiallyReasonBankChargeDesc=The unpaid amount is intermediary bank fees , deducted directly from the correct amount paid by the Customer.
ConfirmClassifyPaidPartiallyReasonOtherDesc=Use this choice if all others are not suitable, for example in following situation: - payment not complete because some products were shipped back - amount claimed too important because a discount was forgotten In all cases, amount over-claimed must be corrected in accountancy system by creating a credit note.
ConfirmClassifyAbandonReasonOther=Other
ConfirmClassifyAbandonReasonOtherDesc=This choice will be used in all other cases. For example because you plan to create a replacing invoice.
From 0463846df1c65a23e128e51bb96a5f7a06bc333b Mon Sep 17 00:00:00 2001
From: Adrien Raze
Date: Thu, 26 Aug 2021 09:27:03 +0200
Subject: [PATCH 019/134] FIX : Stickler
---
htdocs/bom/tpl/objectline_view.tpl.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index 26f4d070876..3e1922db7fc 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -237,11 +237,13 @@ if ($resql){
print ''.price($sub_bom_product->cost_price * $line->qty).' ';
$total_cost.= $sub_bom_product->cost_price * $line->qty;
}
+
// PMP if cost price isn't defined
else if ($sub_bom_product->pmp > 0) {
print ''.price($sub_bom_product->pmp * $line->qty).' ';
$total_cost.= $sub_bom_product->pmp * $line->qty;
}
+
// Minimum purchase price if cost price and PMP aren't defined
else {
$sql_supplier_price = 'SELECT MIN(price) AS min_price FROM '.MAIN_DB_PREFIX.'product_fournisseur_price';
From 578de93dc4e98e3360223ca2053829605e73b676 Mon Sep 17 00:00:00 2001
From: stickler-ci
Date: Thu, 26 Aug 2021 07:30:36 +0000
Subject: [PATCH 020/134] Fixing style errors.
---
htdocs/bom/tpl/objectline_view.tpl.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index 1ee64890384..6aa00e79835 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -243,7 +243,7 @@ if ($resql) {
print ''.price($sub_bom_product->pmp * $line->qty).' ';
$total_cost.= $sub_bom_product->pmp * $line->qty;
}
-
+
// Minimum purchase price if cost price and PMP aren't defined
else {
$sql_supplier_price = 'SELECT MIN(price) AS min_price FROM '.MAIN_DB_PREFIX.'product_fournisseur_price';
From 0222df7ecc65c0589a32fb911102d9c18facf991 Mon Sep 17 00:00:00 2001
From: Adrien Raze
Date: Thu, 26 Aug 2021 09:34:30 +0200
Subject: [PATCH 021/134] FIX : Expected 1 space after closing brace; newline
found
---
htdocs/bom/tpl/objectline_view.tpl.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index 1ee64890384..b8d054d9ecc 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -236,14 +236,14 @@ if ($resql) {
if ($sub_bom_product->cost_price > 0) {
print ''.price($sub_bom_product->cost_price * $line->qty).' ';
$total_cost.= $sub_bom_product->cost_price * $line->qty;
- }
+ }
// PMP if cost price isn't defined
elseif ($sub_bom_product->pmp > 0) {
print ''.price($sub_bom_product->pmp * $line->qty).' ';
$total_cost.= $sub_bom_product->pmp * $line->qty;
}
-
+
// Minimum purchase price if cost price and PMP aren't defined
else {
$sql_supplier_price = 'SELECT MIN(price) AS min_price FROM '.MAIN_DB_PREFIX.'product_fournisseur_price';
From bdcddebb5fdc47084a5279b68ec65957cae47e54 Mon Sep 17 00:00:00 2001
From: stickler-ci
Date: Thu, 26 Aug 2021 07:37:39 +0000
Subject: [PATCH 022/134] Fixing style errors.
---
htdocs/bom/tpl/objectline_view.tpl.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index b8d054d9ecc..6aa00e79835 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -236,7 +236,7 @@ if ($resql) {
if ($sub_bom_product->cost_price > 0) {
print ''.price($sub_bom_product->cost_price * $line->qty).' ';
$total_cost.= $sub_bom_product->cost_price * $line->qty;
- }
+ }
// PMP if cost price isn't defined
elseif ($sub_bom_product->pmp > 0) {
From 05444078bdffd9fd880fd9b9a7cd537c3d34a58b Mon Sep 17 00:00:00 2001
From: Adrien Raze
Date: Thu, 26 Aug 2021 09:43:50 +0200
Subject: [PATCH 023/134] FIX : stickler
---
htdocs/bom/tpl/objectline_view.tpl.php | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index b8d054d9ecc..41ff84b4d13 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -236,16 +236,10 @@ if ($resql) {
if ($sub_bom_product->cost_price > 0) {
print ''.price($sub_bom_product->cost_price * $line->qty).' ';
$total_cost.= $sub_bom_product->cost_price * $line->qty;
- }
-
- // PMP if cost price isn't defined
- elseif ($sub_bom_product->pmp > 0) {
+ } elseif ($sub_bom_product->pmp > 0) { // PMP if cost price isn't defined
print ''.price($sub_bom_product->pmp * $line->qty).' ';
$total_cost.= $sub_bom_product->pmp * $line->qty;
- }
-
- // Minimum purchase price if cost price and PMP aren't defined
- else {
+ } else { // Minimum purchase price if cost price and PMP aren't defined
$sql_supplier_price = 'SELECT MIN(price) AS min_price FROM '.MAIN_DB_PREFIX.'product_fournisseur_price';
$sql_supplier_price.= ' WHERE fk_product = '.$sub_bom_product->id;
$resql_supplier_price = $object->db->query($sql_supplier_price);
From ff7727466ad129070c0b56965eb0457f0ddf1795 Mon Sep 17 00:00:00 2001
From: atm-lena
Date: Thu, 14 Oct 2021 17:13:44 +0200
Subject: [PATCH 024/134] Function updateExtrafield : replace empty value to
null
---
htdocs/core/class/commonobject.class.php | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 5a5e1a58928..50c6f1893ea 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -5492,7 +5492,6 @@ abstract class CommonObject
}
$sql .= ")";
-
$resql = $this->db->query($sql);
if (!$resql)
{
@@ -5792,7 +5791,7 @@ abstract class CommonObject
}
if ($linealreadyfound) {
- if ($this->array_options["options_".$key] === null) {
+ if ($this->array_options["options_".$key] === '') {
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = null";
} else {
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = '".$this->db->escape($this->array_options["options_".$key])."'";
From 8daa1a810a6b51606863e9ba7fad1de504ed16a6 Mon Sep 17 00:00:00 2001
From: Adrien Raze
Date: Tue, 19 Oct 2021 16:44:59 +0200
Subject: [PATCH 025/134] FIX : Move interface.php to ajax/
---
htdocs/bom/{script => ajax}/interface.php | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename htdocs/bom/{script => ajax}/interface.php (100%)
diff --git a/htdocs/bom/script/interface.php b/htdocs/bom/ajax/interface.php
similarity index 100%
rename from htdocs/bom/script/interface.php
rename to htdocs/bom/ajax/interface.php
From 48b131b3f08772bf231b9de789bd610007e3b2e3 Mon Sep 17 00:00:00 2001
From: Adrien Raze
Date: Tue, 19 Oct 2021 16:50:15 +0200
Subject: [PATCH 026/134] FIX : Retours
---
htdocs/bom/ajax/interface.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/htdocs/bom/ajax/interface.php b/htdocs/bom/ajax/interface.php
index c93b54fdc33..1416f44f922 100644
--- a/htdocs/bom/ajax/interface.php
+++ b/htdocs/bom/ajax/interface.php
@@ -2,8 +2,8 @@
require '../../main.inc.php';
$action = GETPOST('action', 'alphanohtml');
-$select_product_val = GETPOST('select_product_val', 'alphanohtml');
-$current_bom_id = GETPOST('current_bom_id', 'alphanohtml');
+$select_product_val = GETPOST('select_product_val', 'int');
+$current_bom_id = GETPOST('current_bom_id', 'int');
global $db;
@@ -12,7 +12,7 @@ switch ($action) {
//Selection of nomenclatures corresponding to the selected product
$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product, p.label AS product_label FROM '.MAIN_DB_PREFIX.'bom_bom AS b ';
$sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'product AS p ON b.fk_product=p.rowid';
- $sql.= ' WHERE fk_product='.$select_product_val.' AND b.rowid!='.$current_bom_id;
+ $sql.= ' WHERE fk_product='.(int)$select_product_val.' AND b.rowid<>'. (int)$current_bom_id;
$resql = $db->query($sql);
if ($resql && $db->num_rows($resql) > 0) {
$options = array();
From d3035975cf038e24b4c1cfa853e97012a8446323 Mon Sep 17 00:00:00 2001
From: stickler-ci
Date: Tue, 19 Oct 2021 14:52:56 +0000
Subject: [PATCH 027/134] Fixing style errors.
---
htdocs/bom/ajax/interface.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/bom/ajax/interface.php b/htdocs/bom/ajax/interface.php
index 1416f44f922..23b208e25ba 100644
--- a/htdocs/bom/ajax/interface.php
+++ b/htdocs/bom/ajax/interface.php
@@ -12,7 +12,7 @@ switch ($action) {
//Selection of nomenclatures corresponding to the selected product
$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product, p.label AS product_label FROM '.MAIN_DB_PREFIX.'bom_bom AS b ';
$sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'product AS p ON b.fk_product=p.rowid';
- $sql.= ' WHERE fk_product='.(int)$select_product_val.' AND b.rowid<>'. (int)$current_bom_id;
+ $sql.= ' WHERE fk_product='.(int) $select_product_val.' AND b.rowid<>'. (int) $current_bom_id;
$resql = $db->query($sql);
if ($resql && $db->num_rows($resql) > 0) {
$options = array();
From a3e8d43cf582063da9acf7efc61879dd90e624bf Mon Sep 17 00:00:00 2001
From: Adrien Raze
Date: Tue, 19 Oct 2021 17:25:51 +0200
Subject: [PATCH 028/134] FIX : Travis
---
htdocs/bom/tpl/objectline_view.tpl.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index 96653773d65..2fa8b3c70dc 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -182,7 +182,7 @@ print ' ';
// Select of all the sub-BOM lines
$sql = 'SELECT rowid, fk_bom_child, fk_product FROM '.MAIN_DB_PREFIX.'bom_bomline AS bl';
-$sql.= ' WHERE fk_bom = '.$tmpbom->id;
+$sql.= ' WHERE fk_bom ='. (int) $tmpbom->id;
$resql = $object->db->query($sql);
if ($resql) {
From 2ae38ff1a99f47710c47f7f2fa5029073f1cacaa Mon Sep 17 00:00:00 2001
From: Adrien Raze
Date: Wed, 20 Oct 2021 10:15:31 +0200
Subject: [PATCH 029/134] FIX : Travis
---
htdocs/bom/tpl/objectline_view.tpl.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index 2fa8b3c70dc..8256019bd98 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -241,7 +241,7 @@ if ($resql) {
$total_cost.= $sub_bom_product->pmp * $line->qty;
} else { // Minimum purchase price if cost price and PMP aren't defined
$sql_supplier_price = 'SELECT MIN(price) AS min_price FROM '.MAIN_DB_PREFIX.'product_fournisseur_price';
- $sql_supplier_price.= ' WHERE fk_product = '.$sub_bom_product->id;
+ $sql_supplier_price.= ' WHERE fk_product = '. (int) $sub_bom_product->id;
$resql_supplier_price = $object->db->query($sql_supplier_price);
if ($resql_supplier_price) {
$obj = $object->db->fetch_object($resql_supplier_price);
From 02bb39d4384933a052e38e551f73c6c7b109d985 Mon Sep 17 00:00:00 2001
From: Alexandre SPANGARO
Date: Thu, 21 Oct 2021 05:06:50 +0200
Subject: [PATCH 030/134] FIX Accountancy simplified - Salaries are not present
in report
---
htdocs/compta/resultat/clientfourn.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index f2f192271ac..0b38a8f66c9 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -862,7 +862,8 @@ if ($modecompta == 'BOOKKEEPING') {
$sql = "SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
- $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user";
+ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid=p.fk_salary";
+ $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=s.fk_user";
$sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
if (!empty($date_start) && !empty($date_end)) {
$sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
From be7c1c8a235a58ca8300cd7b0c765fc7010e85b2 Mon Sep 17 00:00:00 2001
From: Alexandre SPANGARO
Date: Thu, 21 Oct 2021 05:18:56 +0200
Subject: [PATCH 031/134] Typo & translation
---
htdocs/compta/resultat/clientfourn.php | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index 0b38a8f66c9..2de55d1801f 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -9,6 +9,7 @@
* Copyright (C) 2014 Florian Henry
* Copyright (C) 2018 Frédéric France
* Copyright (C) 2020 Maxime DEMAREST
+ * Copyright (C) 2021 Alexandre Spangaro
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -366,7 +367,7 @@ if ($modecompta == 'BOOKKEEPING') {
}
} else {
/*
- * Factures clients
+ * Customer invoices
*/
print ''.$langs->trans("CustomersInvoices").' ';
@@ -386,8 +387,8 @@ if ($modecompta == 'BOOKKEEPING') {
}
} elseif ($modecompta == 'RECETTES-DEPENSES') {
/*
- * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les
- * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin)
+ * List of payments (old payments are not seen by this query because, on older versions, they were not linked via payment_invoice.
+ * old versions, they were not linked via payment_invoice. They are added later)
*/
$sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
@@ -434,7 +435,7 @@ if ($modecompta == 'BOOKKEEPING') {
dol_print_error($db);
}
- // On ajoute les paiements clients anciennes version, non lie par paiement_facture
+ // We add the old customer payments, not linked by payment_invoice
if ($modecompta == 'RECETTES-DEPENSES') {
$sql = "SELECT 'Autres' as name, '0' as idp, sum(p.amount) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
@@ -673,7 +674,7 @@ if ($modecompta == 'BOOKKEEPING') {
/*
- * Charges sociales non deductibles
+ * Social / Fiscal contributions who are not deductible
*/
print ''.$langs->trans("SocialContributionsNondeductibles").' ';
@@ -760,7 +761,7 @@ if ($modecompta == 'BOOKKEEPING') {
/*
- * Charges sociales deductibles
+ * Social / Fiscal contributions who are deductible
*/
print ''.$langs->trans("SocialContributionsDeductibles").' ';
@@ -932,7 +933,7 @@ if ($modecompta == 'BOOKKEEPING') {
/*
- * Expense
+ * Expense report
*/
if (!empty($conf->expensereport->enabled)) {
@@ -1088,7 +1089,7 @@ if ($modecompta == 'BOOKKEEPING') {
}
/*
- * Payement Loan
+ * Payment Loan
*/
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
@@ -1209,7 +1210,7 @@ if ($modecompta == 'BOOKKEEPING') {
print ''.price($amount)." \n";
print " \n";
- // VAT to retreive
+ // VAT to retrieve
$amount = 0;
$sql = "SELECT date_format(f.datef,'%Y-%m') as dm, sum(f.total_tva) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
From a1c0e1ad1f4fae5d30c929e6b042450b655a2bcb Mon Sep 17 00:00:00 2001
From: Alexandre SPANGARO
Date: Thu, 21 Oct 2021 05:45:37 +0200
Subject: [PATCH 032/134] Better fix with backward compatibility with old
salary module
---
htdocs/compta/resultat/clientfourn.php | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index 2de55d1801f..e5984e527ae 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -869,8 +869,19 @@ if ($modecompta == 'BOOKKEEPING') {
if (!empty($date_start) && !empty($date_end)) {
$sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
}
+ $sql .= " GROUP BY u.rowid, u.firstname, u.lastname, s.fk_user, p.label, dm";
+ // For backward compatibility with old module salary
+ $sql .= " UNION ";
+ $sql .= " SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
+ $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
+ $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user";
+ $sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
+ if (!empty($date_start) && !empty($date_end)) {
+ $sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
+ }
$sql .= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm";
+
$newsortfield = $sortfield;
if ($newsortfield == 's.nom, s.rowid') {
$newsortfield = 'u.firstname, u.lastname';
From d2b96fe0f64a7bf3563ece5fe3c8051ad8a1398c Mon Sep 17 00:00:00 2001
From: Alexandre SPANGARO
Date: Thu, 21 Oct 2021 06:08:48 +0200
Subject: [PATCH 033/134] Correct link to salary list with user search
---
htdocs/compta/resultat/clientfourn.php | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index e5984e527ae..1d2edd5c918 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -34,6 +34,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
+require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
@@ -861,7 +862,7 @@ if ($modecompta == 'BOOKKEEPING') {
$column = 'p.datep';
}
- $sql = "SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
+ $sql = "SELECT u.rowid, u.firstname, u.lastname, s.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid=p.fk_salary";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=s.fk_user";
@@ -873,7 +874,7 @@ if ($modecompta == 'BOOKKEEPING') {
// For backward compatibility with old module salary
$sql .= " UNION ";
- $sql .= " SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
+ $sql .= " SELECT u.rowid, u.firstname, u.lastname, p.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user";
$sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
@@ -913,7 +914,10 @@ if ($modecompta == 'BOOKKEEPING') {
print ' ';
- print "".$langs->trans("Salary")." fk_user."\">".$obj->firstname." ".$obj->lastname." \n";
+ $userstatic = new User($db);
+ $userstatic->fetch($obj->fk_user);
+
+ print "".$langs->trans("Salary")." getFullName($langs)."\">".$obj->firstname." ".$obj->lastname." \n";
if ($modecompta == 'CREANCES-DETTES') {
print ''.price(-$obj->amount).' ';
From 806c53d4c4c343299ffe4e6690f2889a9d50c2d8 Mon Sep 17 00:00:00 2001
From: atm-lena
Date: Thu, 21 Oct 2021 09:49:14 +0200
Subject: [PATCH 034/134] FIX Ret PR
---
htdocs/core/class/commonobject.class.php | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 50c6f1893ea..a4fc828ef4b 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -5745,6 +5745,11 @@ abstract class CommonObject
$this->array_options["options_".$key] = $this->db->idate($this->array_options["options_".$key]);
}
break;
+ case 'boolean':
+ if (empty($this->array_options["options_".$key])) {
+ $this->array_options["options_".$key] = null;
+ }
+ break;
/*
case 'link':
$param_list = array_keys($attributeParam['options']);
@@ -5791,7 +5796,7 @@ abstract class CommonObject
}
if ($linealreadyfound) {
- if ($this->array_options["options_".$key] === '') {
+ if ($this->array_options["options_".$key] === null) {
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = null";
} else {
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = '".$this->db->escape($this->array_options["options_".$key])."'";
From 0c8291b60fd4ecf936e221220b3a79d46c55a161 Mon Sep 17 00:00:00 2001
From: Alexandre SPANGARO
Date: Fri, 22 Oct 2021 04:35:23 +0200
Subject: [PATCH 035/134] Fix INNER JOIN & Add urlencode()
---
htdocs/compta/resultat/clientfourn.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index 1d2edd5c918..b5aca49aaae 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -864,7 +864,7 @@ if ($modecompta == 'BOOKKEEPING') {
$sql = "SELECT u.rowid, u.firstname, u.lastname, s.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
- $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid=p.fk_salary";
+ $sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid=p.fk_salary";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=s.fk_user";
$sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
if (!empty($date_start) && !empty($date_end)) {
@@ -917,7 +917,7 @@ if ($modecompta == 'BOOKKEEPING') {
$userstatic = new User($db);
$userstatic->fetch($obj->fk_user);
- print "".$langs->trans("Salary")." getFullName($langs)."\">".$obj->firstname." ".$obj->lastname." \n";
+ print "".$langs->trans("Salary")." getFullName($langs))."\">".$obj->firstname." ".$obj->lastname." \n";
if ($modecompta == 'CREANCES-DETTES') {
print ''.price(-$obj->amount).' ';
From fa21b27cedc3c67a5097932bae90114156820fa8 Mon Sep 17 00:00:00 2001
From: atm-lena
Date: Fri, 22 Oct 2021 15:27:16 +0200
Subject: [PATCH 036/134] Validate Holiday : keep files
---
htdocs/holiday/card.php | 1 +
htdocs/holiday/class/holiday.class.php | 39 ++++++++++++++++++++++++++
2 files changed, 40 insertions(+)
diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php
index 150a9c0754b..93e748a51d2 100644
--- a/htdocs/holiday/card.php
+++ b/htdocs/holiday/card.php
@@ -266,6 +266,7 @@ if (empty($reshook)) {
// If update and we are an approver, we can update with another approver
if ($action == 'update' && GETPOSTISSET('savevalidator') && !empty($user->rights->holiday->approve)) {
+
$object->fetch($id);
$object->oldcopy = dol_clone($object);
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index 5ecc4d7325a..665e43c6ffd 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -701,6 +701,7 @@ class Holiday extends CommonObject
public function validate($user = null, $notrigger = 0)
{
global $conf, $langs;
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$error = 0;
// Define new ref
@@ -740,6 +741,44 @@ class Holiday extends CommonObject
}
}
+ if (!$error) {
+ $this->oldref = $this->ref;
+
+ // Rename directory if dir was a temporary ref
+ if (preg_match('/^[\(]?PROV/i', $this->ref)) {
+ // Now we rename also files into index
+ $sql = 'UPDATE ' . MAIN_DB_PREFIX . "ecm_files set filename = CONCAT('" . $this->db->escape($this->newref) . "', SUBSTR(filename, " . (strlen($this->ref) + 1) . ")), filepath = 'holiday/" . $this->db->escape($this->newref) . "'";
+ $sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'holiday/" . $this->db->escape($this->ref) . "' and entity = " . ((int)$conf->entity);
+ $resql = $this->db->query($sql);
+ if (!$resql) {
+ $error++;
+ $this->error = $this->db->lasterror();
+ }
+
+ // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
+ $oldref = dol_sanitizeFileName($this->ref);
+ $newref = dol_sanitizeFileName($num);
+ $dirsource = $conf->holiday->multidir_output[$this->entity] . '/' . $oldref;
+ $dirdest = $conf->holiday->multidir_output[$this->entity] . '/' . $newref;
+ if (!$error && file_exists($dirsource)) {
+ dol_syslog(get_class($this) . "::validate rename dir " . $dirsource . " into " . $dirdest);
+ if (@rename($dirsource, $dirdest)) {
+ dol_syslog("Rename ok");
+ // Rename docs starting with $oldref with $newref
+ $listoffiles = dol_dir_list($dirdest, 'files', 1, '^' . preg_quote($oldref, '/'));
+ foreach ($listoffiles as $fileentry) {
+ $dirsource = $fileentry['name'];
+ $dirdest = preg_replace('/^' . preg_quote($oldref, '/') . '/', $newref, $dirsource);
+ $dirsource = $fileentry['path'] . '/' . $dirsource;
+ $dirdest = $fileentry['path'] . '/' . $dirdest;
+ @rename($dirsource, $dirdest);
+ }
+ }
+ }
+ }
+ }
+
+
// Commit or rollback
if ($error) {
foreach ($this->errors as $errmsg) {
From 87b4805bc041237a87ab3da8788020a1306e40cf Mon Sep 17 00:00:00 2001
From: stickler-ci
Date: Fri, 22 Oct 2021 13:35:30 +0000
Subject: [PATCH 037/134] Fixing style errors.
---
htdocs/holiday/card.php | 1 -
htdocs/holiday/class/holiday.class.php | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php
index 93e748a51d2..150a9c0754b 100644
--- a/htdocs/holiday/card.php
+++ b/htdocs/holiday/card.php
@@ -266,7 +266,6 @@ if (empty($reshook)) {
// If update and we are an approver, we can update with another approver
if ($action == 'update' && GETPOSTISSET('savevalidator') && !empty($user->rights->holiday->approve)) {
-
$object->fetch($id);
$object->oldcopy = dol_clone($object);
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index 665e43c6ffd..6271f1d43e8 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -748,7 +748,7 @@ class Holiday extends CommonObject
if (preg_match('/^[\(]?PROV/i', $this->ref)) {
// Now we rename also files into index
$sql = 'UPDATE ' . MAIN_DB_PREFIX . "ecm_files set filename = CONCAT('" . $this->db->escape($this->newref) . "', SUBSTR(filename, " . (strlen($this->ref) + 1) . ")), filepath = 'holiday/" . $this->db->escape($this->newref) . "'";
- $sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'holiday/" . $this->db->escape($this->ref) . "' and entity = " . ((int)$conf->entity);
+ $sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'holiday/" . $this->db->escape($this->ref) . "' and entity = " . ((int) $conf->entity);
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
From 29f847c13a9c54f43da959588318024e053fddaa Mon Sep 17 00:00:00 2001
From: Theo
Date: Fri, 22 Oct 2021 15:48:39 +0200
Subject: [PATCH 038/134] add: quick link categories to project
---
htdocs/categories/viewcat.php | 27 +++-
htdocs/core/class/html.form.class.php | 206 ++++++++++++++++++++++++++
htdocs/langs/fr_FR/categories.lang | 1 +
3 files changed, 233 insertions(+), 1 deletion(-)
diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index 7ccd80eb4bd..0f3d6d075a5 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -173,7 +173,8 @@ if ($elemid && $action == 'addintocategory' &&
(($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer)) ||
($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer) ||
($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer) ||
- ($type == Categorie::TYPE_TICKET && $user->rights->ticket->write)
+ ($type == Categorie::TYPE_TICKET && $user->rights->ticket->write) ||
+ ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer)
)) {
if ($type == Categorie::TYPE_PRODUCT) {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@@ -191,6 +192,10 @@ if ($elemid && $action == 'addintocategory' &&
require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
$newobject = new Ticket($db);
$elementtype = 'ticket';
+ } elseif ($type == Categorie::TYPE_PROJECT) {
+ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+ $newobject = new Project($db);
+ $elementtype = 'project';
}
$result = $newobject->fetch($elemid);
@@ -874,6 +879,26 @@ if ($type == Categorie::TYPE_PROJECT) {
if ($objects < 0) {
dol_print_error($db, $object->error, $object->errors);
} else {
+ // Form to add record into a category
+ $showclassifyform = 1;
+ if ($showclassifyform) {
+ print ' ';
+ print '';
+ }
+
print ' ';
- $totalarray = array();
print '';
if (!empty($arrayfields['aa.account_number']['checked'])) {
print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
- $totalarray['nbfield']++;
}
if (!empty($arrayfields['aa.label']['checked'])) {
print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"], "aa.label", "", $param, '', $sortfield, $sortorder);
- $totalarray['nbfield']++;
}
if (!empty($arrayfields['aa.labelshort']['checked'])) {
print_liste_field_titre($arrayfields['aa.labelshort']['label'], $_SERVER["PHP_SELF"], "aa.labelshort", "", $param, '', $sortfield, $sortorder);
- $totalarray['nbfield']++;
}
if (!empty($arrayfields['aa.account_parent']['checked'])) {
print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"], "aa.account_parent", "", $param, '', $sortfield, $sortorder, 'left ');
- $totalarray['nbfield']++;
}
if (!empty($arrayfields['aa.pcg_type']['checked'])) {
print_liste_field_titre($arrayfields['aa.pcg_type']['label'], $_SERVER["PHP_SELF"], 'aa.pcg_type,aa.account_number', '', $param, '', $sortfield, $sortorder, '', $arrayfields['aa.pcg_type']['help'], 1);
- $totalarray['nbfield']++;
}
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
if (!empty($arrayfields['aa.reconcilable']['checked'])) {
print_liste_field_titre($arrayfields['aa.reconcilable']['label'], $_SERVER["PHP_SELF"], 'aa.reconcilable', '', $param, '', $sortfield, $sortorder);
- $totalarray['nbfield']++;
}
}
if (!empty($arrayfields['aa.active']['checked'])) {
print_liste_field_titre($arrayfields['aa.active']['label'], $_SERVER["PHP_SELF"], 'aa.active', '', $param, '', $sortfield, $sortorder);
- $totalarray['nbfield']++;
}
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print " \n";
$accountstatic = new AccountingAccount($db);
$accountparent = new AccountingAccount($db);
+ $totalarray = array();
+ $totalarray['nbfield'] = 0;
$i = 0;
while ($i < min($num, $limit)) {
From 93e223bf84186245c13d7f87a9e7735f1cf92a4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 07:38:10 +0200
Subject: [PATCH 051/134] fix warnings
---
htdocs/accountancy/admin/defaultaccounts.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php
index 061752c11c5..5d78036159a 100644
--- a/htdocs/accountancy/admin/defaultaccounts.php
+++ b/htdocs/accountancy/admin/defaultaccounts.php
@@ -186,7 +186,7 @@ foreach ($list_account as $key) {
print ''.$label.' ';
// Value
print ''; // Do not force class=right, or it align also the content of the select box
- print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
+ print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
print ' ';
print ' ';
}
From 21aaed4a862fb50d4fcba2a5546bceb0c2c8201d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 07:40:36 +0200
Subject: [PATCH 052/134] Update closure.php
---
htdocs/accountancy/admin/closure.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/accountancy/admin/closure.php b/htdocs/accountancy/admin/closure.php
index 8efb869ffaf..437ff1b7116 100644
--- a/htdocs/accountancy/admin/closure.php
+++ b/htdocs/accountancy/admin/closure.php
@@ -109,7 +109,7 @@ foreach ($list_account_main as $key) {
print '';
// Value
print ''; // Do not force class=right, or it align also the content of the select box
- print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1);
+ print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1);
print ' ';
print '';
}
From febb48d345c436610cac62c9b617d3e0f39ed64e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 07:41:40 +0200
Subject: [PATCH 053/134] Update loan.php
---
htdocs/admin/loan.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php
index 0769ee5c0a0..59b7eb8b463 100644
--- a/htdocs/admin/loan.php
+++ b/htdocs/admin/loan.php
@@ -105,7 +105,7 @@ foreach ($list as $key) {
// Value
print '';
if (!empty($conf->accounting->enabled)) {
- print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1);
+ print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1);
} else {
print ' ';
}
From 4fa050bd1a18dd2c2970c0420fc8555c28ac1a01 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 07:42:29 +0200
Subject: [PATCH 054/134] Update salaries.php
---
htdocs/salaries/admin/salaries.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/salaries/admin/salaries.php b/htdocs/salaries/admin/salaries.php
index f8ed3f3f7ce..1c9eeec6464 100644
--- a/htdocs/salaries/admin/salaries.php
+++ b/htdocs/salaries/admin/salaries.php
@@ -120,7 +120,7 @@ foreach ($list as $key) {
// Value
print '';
if (!empty($conf->accounting->enabled)) {
- print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1);
+ print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1);
} else {
print ' ';
}
From a194737f1c711d57ba459f553ca331e2683da962 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 07:58:35 +0200
Subject: [PATCH 055/134] fix permission
---
htdocs/opensurvey/list.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php
index 3dc42def482..b05abe3fd40 100644
--- a/htdocs/opensurvey/list.php
+++ b/htdocs/opensurvey/list.php
@@ -107,7 +107,8 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
$permissiontoread = $user->rights->opensurvey->read;
$permissiontoadd = $user->rights->opensurvey->write;
-$permissiontodelete = $user->rights->opensurvey->delete;
+// permission delete doesn't exists
+$permissiontodelete = $user->rights->opensurvey->write;
/*
From c19ea8b220db432a4fdcb0993ef8e7844b7c2836 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:37:07 +0200
Subject: [PATCH 056/134] clean code
---
htdocs/hrm/evaluation_note.php | 53 ++--------------------------------
1 file changed, 2 insertions(+), 51 deletions(-)
diff --git a/htdocs/hrm/evaluation_note.php b/htdocs/hrm/evaluation_note.php
index aae7b56acaf..1b6b5a35564 100644
--- a/htdocs/hrm/evaluation_note.php
+++ b/htdocs/hrm/evaluation_note.php
@@ -25,57 +25,8 @@
* \brief Tab for notes on Evaluation
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
-
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+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';
@@ -86,7 +37,7 @@ $langs->loadLangs(array("hrm", "companies"));
// Get parameters
$id = GETPOST('id', 'int');
-$ref = GETPOST('ref', 'alpha');
+$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
From 8dd237b96470e50deefd573ee80656eb30ea0fb3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:38:27 +0200
Subject: [PATCH 057/134] Update evaluation_list.php
---
htdocs/hrm/evaluation_list.php | 50 +---------------------------------
1 file changed, 1 insertion(+), 49 deletions(-)
diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php
index a713b37ca48..35189f11b87 100644
--- a/htdocs/hrm/evaluation_list.php
+++ b/htdocs/hrm/evaluation_list.php
@@ -25,57 +25,9 @@
* \brief List page for evaluation
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
From a81da58639f96f4ebbbbe3c8f3f9bdbb5b5b80d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:39:10 +0200
Subject: [PATCH 058/134] Update evaluation_document.php
---
htdocs/hrm/evaluation_document.php | 50 +-----------------------------
1 file changed, 1 insertion(+), 49 deletions(-)
diff --git a/htdocs/hrm/evaluation_document.php b/htdocs/hrm/evaluation_document.php
index 06cbd7a621a..7318819644e 100644
--- a/htdocs/hrm/evaluation_document.php
+++ b/htdocs/hrm/evaluation_document.php
@@ -25,57 +25,9 @@
* \brief Tab for documents linked to Evaluation
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
From cf4954e1c59fbd5a434ab4e7f448378d35435076 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:39:37 +0200
Subject: [PATCH 059/134] Update evaluation_contact.php
---
htdocs/hrm/evaluation_contact.php | 30 +-----------------------------
1 file changed, 1 insertion(+), 29 deletions(-)
diff --git a/htdocs/hrm/evaluation_contact.php b/htdocs/hrm/evaluation_contact.php
index 540154b77ef..61af793b28a 100644
--- a/htdocs/hrm/evaluation_contact.php
+++ b/htdocs/hrm/evaluation_contact.php
@@ -26,35 +26,7 @@
*/
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+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';
From 7792a69d8bf00a81c4511f9ce9014333e9b0cb21 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:40:02 +0200
Subject: [PATCH 060/134] Update evaluation_card.php
---
htdocs/hrm/evaluation_card.php | 51 +---------------------------------
1 file changed, 1 insertion(+), 50 deletions(-)
diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php
index 64b54b4c80b..2716bbf8a83 100644
--- a/htdocs/hrm/evaluation_card.php
+++ b/htdocs/hrm/evaluation_card.php
@@ -25,57 +25,8 @@
* \brief Page to create/edit/view evaluation
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
-
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
From 1c32847c07ad4cc5643e5c93b821bb3add8cb7c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:40:29 +0200
Subject: [PATCH 061/134] Update evaluation_agenda.php
---
htdocs/hrm/evaluation_agenda.php | 50 +-------------------------------
1 file changed, 1 insertion(+), 49 deletions(-)
diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php
index 8524f6df3d9..91a0615bc95 100644
--- a/htdocs/hrm/evaluation_agenda.php
+++ b/htdocs/hrm/evaluation_agenda.php
@@ -25,57 +25,9 @@
* \brief Tab of events on Evaluation
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
From fa516a146087b9433f56eeecbc87b78844c3642e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:42:42 +0200
Subject: [PATCH 062/134] Update skill_tab.php
---
htdocs/hrm/skill_tab.php | 55 ++--------------------------------------
1 file changed, 2 insertions(+), 53 deletions(-)
diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php
index 2aada2a771e..9a9ea39e31d 100644
--- a/htdocs/hrm/skill_tab.php
+++ b/htdocs/hrm/skill_tab.php
@@ -25,61 +25,10 @@
* \brief Page to add/delete/view skill to jobs/users
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
+
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"] . "/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
-$tmp2 = realpath(__FILE__);
-$i = strlen($tmp) - 1;
-$j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--;
- $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)) . "/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1)) . "/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1))) . "/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1))) . "/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
From b1d948a0f39aade3b717b30a341659f377f2769b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:43:07 +0200
Subject: [PATCH 063/134] Update skill_note.php
---
htdocs/hrm/skill_note.php | 50 +--------------------------------------
1 file changed, 1 insertion(+), 49 deletions(-)
diff --git a/htdocs/hrm/skill_note.php b/htdocs/hrm/skill_note.php
index 000c5e1b41b..1510f746e5e 100644
--- a/htdocs/hrm/skill_note.php
+++ b/htdocs/hrm/skill_note.php
@@ -25,57 +25,9 @@
* \brief Tab for notes on skill
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php';
From cbead902dfa1d405625f6bce4bb565e2045694f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:43:31 +0200
Subject: [PATCH 064/134] Update skill_list.php
---
htdocs/hrm/skill_list.php | 50 +--------------------------------------
1 file changed, 1 insertion(+), 49 deletions(-)
diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php
index fc2998d046a..1fc5440e589 100644
--- a/htdocs/hrm/skill_list.php
+++ b/htdocs/hrm/skill_list.php
@@ -25,57 +25,9 @@
* \brief List page for skill
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
From 3c8b135de1d3c169036d4660a519aa2ef828be96 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:43:59 +0200
Subject: [PATCH 065/134] Update skill_document.php
---
htdocs/hrm/skill_document.php | 50 +----------------------------------
1 file changed, 1 insertion(+), 49 deletions(-)
diff --git a/htdocs/hrm/skill_document.php b/htdocs/hrm/skill_document.php
index ca13044f712..77f3325de15 100644
--- a/htdocs/hrm/skill_document.php
+++ b/htdocs/hrm/skill_document.php
@@ -25,57 +25,9 @@
* \brief Tab for documents linked to skill
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
From 5f2269761c9f8f723b57c13a97f490fe1c963f0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:44:27 +0200
Subject: [PATCH 066/134] Update skill_contact.php
---
htdocs/hrm/skill_contact.php | 30 +-----------------------------
1 file changed, 1 insertion(+), 29 deletions(-)
diff --git a/htdocs/hrm/skill_contact.php b/htdocs/hrm/skill_contact.php
index a535e00696b..f8ea2a04a9f 100644
--- a/htdocs/hrm/skill_contact.php
+++ b/htdocs/hrm/skill_contact.php
@@ -26,35 +26,7 @@
*/
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+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';
From c5d60f44e3c279a2e9e832ec30f2f0d1ed44b9fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:44:54 +0200
Subject: [PATCH 067/134] Update skill_card.php
---
htdocs/hrm/skill_card.php | 55 +--------------------------------------
1 file changed, 1 insertion(+), 54 deletions(-)
diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php
index 2a5b58cd788..3b649ebf485 100644
--- a/htdocs/hrm/skill_card.php
+++ b/htdocs/hrm/skill_card.php
@@ -25,62 +25,9 @@
* \brief Page to create/edit/view skill
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"] . "/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
-$tmp2 = realpath(__FILE__);
-$i = strlen($tmp) - 1;
-$j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--;
- $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)) . "/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1)) . "/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1))) . "/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1))) . "/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
-
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
From ad6d57502f7b3a5f9f7aa5631549453e251fb38b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:45:29 +0200
Subject: [PATCH 068/134] Update skill_agenda.php
---
htdocs/hrm/skill_agenda.php | 50 +------------------------------------
1 file changed, 1 insertion(+), 49 deletions(-)
diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php
index 0b854ccb028..9c1821fb8d7 100644
--- a/htdocs/hrm/skill_agenda.php
+++ b/htdocs/hrm/skill_agenda.php
@@ -25,57 +25,9 @@
* \brief Tab of events on skill
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
From d990b2dc3865fb31243475bbb6045e737a120184 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:45:59 +0200
Subject: [PATCH 069/134] Update position_note.php
---
htdocs/hrm/position_note.php | 50 +-----------------------------------
1 file changed, 1 insertion(+), 49 deletions(-)
diff --git a/htdocs/hrm/position_note.php b/htdocs/hrm/position_note.php
index 81548761326..1eea4b82676 100644
--- a/htdocs/hrm/position_note.php
+++ b/htdocs/hrm/position_note.php
@@ -26,57 +26,9 @@
* \brief Tab for notes on Position
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php';
From 445473f1ca4d09eccb58f1140b15f9f9823d6731 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:46:27 +0200
Subject: [PATCH 070/134] Update position_list.php
---
htdocs/hrm/position_list.php | 50 +-----------------------------------
1 file changed, 1 insertion(+), 49 deletions(-)
diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php
index 3877a6ea14d..d6ed72c2612 100644
--- a/htdocs/hrm/position_list.php
+++ b/htdocs/hrm/position_list.php
@@ -25,57 +25,9 @@
* \brief List page for position
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
From a7704d858e25bce58195e1e6d234b143d179bb2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:46:57 +0200
Subject: [PATCH 071/134] Update position_document.php
---
htdocs/hrm/position_document.php | 51 +-------------------------------
1 file changed, 1 insertion(+), 50 deletions(-)
diff --git a/htdocs/hrm/position_document.php b/htdocs/hrm/position_document.php
index 1ae41c193ab..7a820310ee2 100644
--- a/htdocs/hrm/position_document.php
+++ b/htdocs/hrm/position_document.php
@@ -25,57 +25,8 @@
* \brief Tab for documents linked to Position
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
-
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
From c37a5007490c9dbd29fc37079ca1f369c6926a26 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:47:22 +0200
Subject: [PATCH 072/134] Update position_contact.php
---
htdocs/hrm/position_contact.php | 30 +-----------------------------
1 file changed, 1 insertion(+), 29 deletions(-)
diff --git a/htdocs/hrm/position_contact.php b/htdocs/hrm/position_contact.php
index 56a4fc8ff8f..a7246e3a82b 100644
--- a/htdocs/hrm/position_contact.php
+++ b/htdocs/hrm/position_contact.php
@@ -26,35 +26,7 @@
*/
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+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';
From 8c28751d0354f05cb5adbae58271cf3384b2234b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:47:53 +0200
Subject: [PATCH 073/134] Update position_card.php
---
htdocs/hrm/position_card.php | 54 +-----------------------------------
1 file changed, 1 insertion(+), 53 deletions(-)
diff --git a/htdocs/hrm/position_card.php b/htdocs/hrm/position_card.php
index 8cb8ba9de8c..4e003372a1c 100644
--- a/htdocs/hrm/position_card.php
+++ b/htdocs/hrm/position_card.php
@@ -25,61 +25,9 @@
* \brief Page to create/edit/view position
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"] . "/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
-$tmp2 = realpath(__FILE__);
-$i = strlen($tmp) - 1;
-$j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--;
- $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)) . "/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1)) . "/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1))) . "/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1))) . "/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
From 72418ffbcee44fd1f75beca9b3bcbae57dee7222 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:48:26 +0200
Subject: [PATCH 074/134] Update position_agenda.php
---
htdocs/hrm/position_agenda.php | 50 +---------------------------------
1 file changed, 1 insertion(+), 49 deletions(-)
diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php
index 670ec51304b..b3b68d9bcbc 100644
--- a/htdocs/hrm/position_agenda.php
+++ b/htdocs/hrm/position_agenda.php
@@ -25,57 +25,9 @@
* \brief Tab of events on Position
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
From a54fccf933e13264eac4628c28879d19e8870544 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:48:53 +0200
Subject: [PATCH 075/134] Update job_note.php
---
htdocs/hrm/job_note.php | 50 +----------------------------------------
1 file changed, 1 insertion(+), 49 deletions(-)
diff --git a/htdocs/hrm/job_note.php b/htdocs/hrm/job_note.php
index 85a1cd1dc84..7205afec247 100644
--- a/htdocs/hrm/job_note.php
+++ b/htdocs/hrm/job_note.php
@@ -25,57 +25,9 @@
* \brief Tab for notes on Job
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
From b1a6094cc15f995568244ad3d4d2065748a1ae1f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:49:16 +0200
Subject: [PATCH 076/134] Update job_list.php
---
htdocs/hrm/job_list.php | 50 +----------------------------------------
1 file changed, 1 insertion(+), 49 deletions(-)
diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php
index ebd4535e6e7..55363d729b5 100644
--- a/htdocs/hrm/job_list.php
+++ b/htdocs/hrm/job_list.php
@@ -25,57 +25,9 @@
* \brief List page for job
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
From fe78912aee0a0c280d854f4d6963b0411fe5e51f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:49:46 +0200
Subject: [PATCH 077/134] Update job_document.php
---
htdocs/hrm/job_document.php | 51 +------------------------------------
1 file changed, 1 insertion(+), 50 deletions(-)
diff --git a/htdocs/hrm/job_document.php b/htdocs/hrm/job_document.php
index a32f02915e9..a055fbbc325 100644
--- a/htdocs/hrm/job_document.php
+++ b/htdocs/hrm/job_document.php
@@ -25,57 +25,8 @@
* \brief Tab for documents linked to Job
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
-
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
From 2a6e6edc5d4f981f25fc9192746737a9412c100f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:50:07 +0200
Subject: [PATCH 078/134] Update job_contact.php
---
htdocs/hrm/job_contact.php | 30 +-----------------------------
1 file changed, 1 insertion(+), 29 deletions(-)
diff --git a/htdocs/hrm/job_contact.php b/htdocs/hrm/job_contact.php
index cbc961d3f9e..67da8ecfd91 100644
--- a/htdocs/hrm/job_contact.php
+++ b/htdocs/hrm/job_contact.php
@@ -26,35 +26,7 @@
*/
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+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';
From f76a6c024106fb8111b5201bdced44bb25ea38c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:50:41 +0200
Subject: [PATCH 079/134] Update job_card.php
---
htdocs/hrm/job_card.php | 54 +----------------------------------------
1 file changed, 1 insertion(+), 53 deletions(-)
diff --git a/htdocs/hrm/job_card.php b/htdocs/hrm/job_card.php
index 19b40048f7b..23343c5c09b 100644
--- a/htdocs/hrm/job_card.php
+++ b/htdocs/hrm/job_card.php
@@ -25,61 +25,9 @@
* \brief Page to create/edit/view job
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"] . "/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
-$tmp2 = realpath(__FILE__);
-$i = strlen($tmp) - 1;
-$j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--;
- $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)) . "/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1)) . "/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1))) . "/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1))) . "/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
From 46cfa7537eb350e568020e139bf4c75c15758f51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 23 Oct 2021 08:51:15 +0200
Subject: [PATCH 080/134] Update job_agenda.php
---
htdocs/hrm/job_agenda.php | 50 +--------------------------------------
1 file changed, 1 insertion(+), 49 deletions(-)
diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php
index 77dd464a7f0..d7772763d8d 100644
--- a/htdocs/hrm/job_agenda.php
+++ b/htdocs/hrm/job_agenda.php
@@ -25,57 +25,9 @@
* \brief Tab of events on Job
*/
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
-//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
-//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
-//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
-//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
-//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
-//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
-//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
-//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
-//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
-//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
-//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
-//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
-//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
-//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
-//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
-//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
-//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
// Load Dolibarr environment
-$res = 0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
- $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-}
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
-while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
-}
-if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
- $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
-}
-if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
- $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
-}
-// Try main.inc.php using relative path
-if (!$res && file_exists("../main.inc.php")) {
- $res = @include "../main.inc.php";
-}
-if (!$res && file_exists("../../main.inc.php")) {
- $res = @include "../../main.inc.php";
-}
-if (!$res && file_exists("../../../main.inc.php")) {
- $res = @include "../../../main.inc.php";
-}
-if (!$res) {
- die("Include of main fails");
-}
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
From 452a8cfe18199dc81c80cd95cc667b4e9600bf80 Mon Sep 17 00:00:00 2001
From: Regis Houssin
Date: Sat, 23 Oct 2021 10:27:24 +0200
Subject: [PATCH 081/134] FIX wrong position of error message
---
htdocs/societe/card.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 5c9c0f63e94..e5a624ec07f 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -2509,7 +2509,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ' ';
print '';
print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client));
- print ' ';
$tmpcheck = $object->check_codeclient();
if ($tmpcheck != 0 && $tmpcheck != -5) {
print ' ('.$langs->trans("WrongCustomerCode").') ';
From 9d927973a7651fccbfc51cf5931117ec8c021bd9 Mon Sep 17 00:00:00 2001
From: Nicolas Domenech
Date: Sat, 23 Oct 2021 10:32:50 +0200
Subject: [PATCH 082/134] fix: redirection after creation contact
---
htdocs/contact/card.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index 8ae2deae1cf..8493fd03f3c 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -296,7 +296,7 @@ if (empty($reshook)) {
if (empty($error) && $id > 0) {
$db->commit();
if (!empty($backtopage)) {
- $url = $backtopage;
+ $url = str_replace('__ID__', $id, $backtopage);
} else {
$url = 'card.php?id='.$id;
}
From 953a56b08c27fbe72c82b7ffd575241e462fbf81 Mon Sep 17 00:00:00 2001
From: Lucas Marcouiller
Date: Sat, 23 Oct 2021 10:57:03 +0200
Subject: [PATCH 083/134] Fix: PHP 8.0 Warnings
---
htdocs/compta/bank/list.php | 8 +++++++-
htdocs/core/class/dolgraph.class.php | 4 ++--
htdocs/projet/index.php | 2 --
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php
index cd6e6cfd365..1463a0c44eb 100644
--- a/htdocs/compta/bank/list.php
+++ b/htdocs/compta/bank/list.php
@@ -506,6 +506,8 @@ print "\n";
$totalarray = array();
$totalarray['nbfield'] = 0;
+$totalarray['val'] = array('balance'=>0);
+$total = array();
$found = 0;
$i = 0;
$lastcurrencycode = '';
@@ -714,7 +716,11 @@ foreach ($accounts as $key => $type) {
print '';
- $total[$objecttmp->currency_code] += $solde;
+ if (empty($total[$objecttmp->currency_code])) {
+ $total[$objecttmp->currency_code] = $solde;
+ }else{
+ $total[$objecttmp->currency_code] += $solde;
+ }
$i++;
}
diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php
index 26701cde6ff..e52ab780195 100644
--- a/htdocs/core/class/dolgraph.class.php
+++ b/htdocs/core/class/dolgraph.class.php
@@ -1415,12 +1415,12 @@ class DolGraph
$color = 'rgb(' . $newcolor[0] . ', ' . $newcolor[1] . ', ' . $newcolor[2] . ', 0.9)';
$bordercolor = 'rgb(' . $newcolor[0] . ', ' . $newcolor[1] . ', ' . $newcolor[2] . ')';
} else { // We do not use a 'group by'
- if (is_array($this->datacolor[$i])) {
+ if (!empty($this->bordercolor[$i]) && is_array($this->datacolor[$i])) {
$color = 'rgb(' . $this->datacolor[$i][0] . ', ' . $this->datacolor[$i][1] . ', ' . $this->datacolor[$i][2] . ', 0.9)';
} else {
$color = $this->datacolor[$i];
}
- if (is_array($this->bordercolor[$i])) {
+ if (!empty($this->bordercolor[$i]) && is_array($this->bordercolor[$i])) {
$color = 'rgb(' . $this->bordercolor[$i][0] . ', ' . $this->bordercolor[$i][1] . ', ' . $this->bordercolor[$i][2] . ', 0.9)';
} else {
if ($type != 'horizontalBar') {
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index 213691f4e25..d0e7773a06d 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -239,8 +239,6 @@ if ($resql) {
$projectstatic->id = $obj->rowid;
$projectstatic->ref = $obj->ref;
$projectstatic->title = $obj->title;
- $projectstatic->dateo = $obj->dateo;
- $projectstatic->datep = $obj->datep;
$projectstatic->thirdparty_name = $obj->name;
$projectstatic->status = $obj->status;
From 0270d1c1b717f056bc23af566e7d89067e403f2d Mon Sep 17 00:00:00 2001
From: Lucas Marcouiller
Date: Sat, 23 Oct 2021 10:57:21 +0200
Subject: [PATCH 084/134] fix syntax
---
htdocs/compta/bank/list.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php
index 1463a0c44eb..ea656141639 100644
--- a/htdocs/compta/bank/list.php
+++ b/htdocs/compta/bank/list.php
@@ -718,7 +718,7 @@ foreach ($accounts as $key => $type) {
if (empty($total[$objecttmp->currency_code])) {
$total[$objecttmp->currency_code] = $solde;
- }else{
+ } else {
$total[$objecttmp->currency_code] += $solde;
}
From d1ec71197a6406442f66a125606b9d584e6b3b41 Mon Sep 17 00:00:00 2001
From: Lucas Marcouiller
Date: Sat, 23 Oct 2021 11:10:58 +0200
Subject: [PATCH 085/134] Fix : scrutinizer errors
---
htdocs/commande/class/api_orders.class.php | 2 +-
htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php
index 0887c22a8f3..6d0b5a5d297 100644
--- a/htdocs/commande/class/api_orders.class.php
+++ b/htdocs/commande/class/api_orders.class.php
@@ -981,6 +981,7 @@ class Orders extends DolibarrApi
if (!DolibarrApiAccess::$user->rights->expedition->lire) {
throw new RestException(401);
}
+ $obj_ret = array();
$sql = "SELECT e.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."expedition as e";
$sql .= " JOIN ".MAIN_DB_PREFIX."expeditiondet as edet";
@@ -1054,7 +1055,6 @@ class Orders extends DolibarrApi
if ($result <= 0) {
throw new RestException(500, 'Error on creating expedition lines:'.$this->db->lasterror());
}
- $i++;
}
return $shipment->id;
}
diff --git a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php
index f37bda11104..83acae25b45 100644
--- a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php
+++ b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php
@@ -65,7 +65,7 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
public function loadBox($max = 5)
{
global $conf, $user, $langs;
- $dataseries = "";
+ $dataseries = array();
$graphtoshow = "";
$badgeStatus0 = '#cbd3d3'; // draft
@@ -118,7 +118,6 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
if ($resql) {
$num = $this->db->num_rows($resql);
$i = 0;
- $dataseries = array();
while ($i < $num) {
$objp = $this->db->fetch_object($resql);
while ($minimumdatecformated < $objp->datec) {
From 6ccd8ce83acde5e10a86b379a0d7466bc6aa4d3c Mon Sep 17 00:00:00 2001
From: Lucas Marcouiller
Date: Sat, 23 Oct 2021 11:45:06 +0200
Subject: [PATCH 086/134] Fix : PHP errors 8.0
---
htdocs/core/class/html.form.class.php | 2 +-
.../class/DataCollector/DolLogsCollector.php | 2 +-
.../class/DataCollector/DolibarrCollector.php | 12 ++++++------
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 88151e7c288..6293dd9e9ec 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -2602,7 +2602,7 @@ class Form
if (!$forcecombo) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
- $out .= ajax_combobox($htmlname, $events, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT);
+ $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
}
$out .= '';
diff --git a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php
index 520a0a20a72..220b76f4356 100644
--- a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php
+++ b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php
@@ -73,7 +73,7 @@ class DolLogsCollector extends MessagesCollector
{
global $conf;
- $uselogfile = $conf->global->DEBUGBAR_USE_LOGFILE;
+ $uselogfile = getDolGlobalString("->DEBUGBAR_USE_LOGFILE");
if ($uselogfile) {
$this->getStorageLogs($this->path);
diff --git a/htdocs/debugbar/class/DataCollector/DolibarrCollector.php b/htdocs/debugbar/class/DataCollector/DolibarrCollector.php
index 2e11887360f..c69ebb9a121 100644
--- a/htdocs/debugbar/class/DataCollector/DolibarrCollector.php
+++ b/htdocs/debugbar/class/DataCollector/DolibarrCollector.php
@@ -86,12 +86,12 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid
global $conf, $langs;
global $dolibarr_mailing_limit_sendbyweb;
- $info = $langs->trans('Method').': '.$conf->global->MAIN_MAIL_SENDMODE.' ';
- $info .= $langs->trans('Server').': '.$conf->global->MAIN_MAIL_SMTP_SERVER.' ';
- $info .= $langs->trans('Port').': '.$conf->global->MAIN_MAIL_SMTP_PORT.' ';
- $info .= $langs->trans('ID').': '.$conf->global->MAIN_MAIL_SMTPS_ID.' ';
- $info .= $langs->trans('Pwd').': '.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW).' ';
- $info .= $langs->trans('TLS/STARTTLS').': '.(empty($conf->global->MAIN_MAIL_EMAIL_TLS) ? '' : $conf->global->MAIN_MAIL_EMAIL_TLS).' / '.(empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) ? '' : $conf->global->MAIN_MAIL_EMAIL_STARTTLS).' ';
+ $info = $langs->trans('Method').': '.getDolGlobalString("MAIN_MAIL_SENDMODE").' ';
+ $info .= $langs->trans('Server').': '.getDolGlobalString("MAIN_MAIL_SMTP_SERVER").' ';
+ $info .= $langs->trans('Port').': '.getDolGlobalString("MAIN_MAIL_SMTP_PORT").' ';
+ $info .= $langs->trans('ID').': '.getDolGlobalString("MAIN_MAIL_SMTPS_IDT").' ';
+ $info .= $langs->trans('Pwd').': '.preg_replace('/./', '*', getDolGlobalString("MAIN_MAIL_SMTPS_PW")).' ';
+ $info .= $langs->trans('TLS/STARTTLS').': '.getDolGlobalString("MAIN_MAIL_EMAIL_TLS").' / '.getDolGlobalString("MAIN_MAIL_EMAIL_STARTTLS").' ';
$info .= $langs->trans('MAIN_DISABLE_ALL_MAILS').': '.(empty($conf->global->MAIN_DISABLE_ALL_MAILS) ? $langs->trans('No') : $langs->trans('Yes')).' ';
$info .= 'dolibarr_mailing_limit_sendbyweb = '.$dolibarr_mailing_limit_sendbyweb.' ';
From 3a9ce1476de52e43e8d0df4bad72ffd763705980 Mon Sep 17 00:00:00 2001
From: Lucas Marcouiller
Date: Sat, 23 Oct 2021 11:45:27 +0200
Subject: [PATCH 087/134] fix error
---
htdocs/debugbar/class/DataCollector/DolLogsCollector.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php
index 220b76f4356..6610c841747 100644
--- a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php
+++ b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php
@@ -73,7 +73,7 @@ class DolLogsCollector extends MessagesCollector
{
global $conf;
- $uselogfile = getDolGlobalString("->DEBUGBAR_USE_LOGFILE");
+ $uselogfile = getDolGlobalString("DEBUGBAR_USE_LOGFILE");
if ($uselogfile) {
$this->getStorageLogs($this->path);
From ce758067281724c5b4218b2fcad2d7e16b4c3f9c Mon Sep 17 00:00:00 2001
From: Philippe GRAND
Date: Sat, 23 Oct 2021 11:46:54 +0200
Subject: [PATCH 088/134] fix scrutinizer : The property datef does not exist
on Facture
---
htdocs/accountancy/customer/list.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php
index 24a64bac872..020fbab1e4d 100644
--- a/htdocs/accountancy/customer/list.php
+++ b/htdocs/accountancy/customer/list.php
@@ -613,7 +613,7 @@ if ($result) {
// Ref Invoice
print ''.$facture_static->getNomUrl(1).' ';
- print ''.dol_print_date($db->jdate($facture_static->datef), 'day').' ';
+ print ''.dol_print_date($db->jdate($facture_static->date), 'day').' ';
// Ref Product
print '';
From a95a99afef7d088da15c562c2612b77f6db11153 Mon Sep 17 00:00:00 2001
From: andreubisquerra
Date: Sat, 23 Oct 2021 11:59:40 +0200
Subject: [PATCH 089/134] TakePOS Split Sale fixes and improvements
---
htdocs/takepos/split.php | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/htdocs/takepos/split.php b/htdocs/takepos/split.php
index 4de053513f5..75599d0160f 100644
--- a/htdocs/takepos/split.php
+++ b/htdocs/takepos/split.php
@@ -103,12 +103,10 @@ if ($action=="split") {
dol_htmloutput_errors($invoice->error, $invoice->errors, 1);
}
$sql = "UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid=".$placeid;
- echo $sql;
$db->query($sql);
}
}
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set fk_facture=".$placeid." where rowid=".$line;
- echo $sql;
$db->query($sql);
}
$invoice->fetch('', '(PROV-POS'.$_SESSION["takeposterminal"].'-SPLIT)');
@@ -167,11 +165,11 @@ if ($conf->global->TAKEPOS_COLOR_THEME == 1) {