From 4e8e0b82deb6754f44a7f2419f5256c12e567625 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Jul 2024 13:31:36 +0200 Subject: [PATCH 01/13] Debug v20 --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index ab5bf5d89c5..81abbdf02d9 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1383,7 +1383,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio if (getDolGlobalString('THIRDPARTY_SUPPLIER_BY_DEFAULT')) { $default = 1; } - print $form->selectyesno("fournisseur", (GETPOSTINT('fournisseur') != '' ? GETPOSTINT('fournisseur') : (GETPOSTINT("type") == '' ? $default : $object->fournisseur)), 1, 0, (GETPOSTINT("type") == '' ? 1 : 0), 1); + print $form->selectyesno("fournisseur", (GETPOSTINT('fournisseur') != '' ? GETPOSTINT('fournisseur') : (GETPOST("type") == '' ? $default : $object->fournisseur)), 1, 0, (GETPOST("type") == '' ? 1 : 0), 1); print ''; From 1e4cc39e3bd156e3eba187b5e2ea752d91fea12b Mon Sep 17 00:00:00 2001 From: atm-jonathan <146709163+atm-jonathan@users.noreply.github.com> Date: Mon, 8 Jul 2024 21:46:07 +0200 Subject: [PATCH 02/13] getNextValue() (#30316) --- htdocs/delivery/class/delivery.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 345ab2cce79..5b90acbe33c 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -422,7 +422,7 @@ class Delivery extends CommonObject $soc->fetch($this->socid); if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life - $numref = $objMod->delivery_get_num($soc, $this); + $numref = $objMod->getNextValue($soc, $this); } else { $numref = $this->ref; } From 58bba2d58cb82a5db5f7b89538bb453758c26f70 Mon Sep 17 00:00:00 2001 From: atm-jonathan <146709163+atm-jonathan@users.noreply.github.com> Date: Mon, 8 Jul 2024 21:46:59 +0200 Subject: [PATCH 03/13] missing token (#30313) --- htdocs/expedition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 6541faf6561..73ea528c6e5 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -455,7 +455,7 @@ if (empty($reshook)) { if ($result > 0) { $db->commit(); - header("Location: ".DOL_URL_ROOT.'/delivery/card.php?action=create_delivery&id='.$result); + header("Location: ".DOL_URL_ROOT.'/delivery/card.php?action=create_delivery&token='.newToken().'&id='.$result); exit; } else { $db->rollback(); From 2bf38d09eda6dd37fef6c60f0dc6c887a86e12df Mon Sep 17 00:00:00 2001 From: jyhere Date: Mon, 8 Jul 2024 23:44:58 +0200 Subject: [PATCH 04/13] FIX: $rappro property should match the updated value (Account::updateconciliation()) (#30311) --- htdocs/compta/bank/class/account.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 12243827cbf..09aca21d8bb 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -2522,7 +2522,7 @@ class AccountLine extends CommonObjectLine // TODO Do no try the insert if link already exists } - $this->rappro = 1; + $this->rappro = (int) $conciliated; $this->db->commit(); return 1; From 74d4c59b17bb0f16d07c9ebdb84b1add6d1f5448 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Jul 2024 16:33:10 +0200 Subject: [PATCH 05/13] CSS --- htdocs/install/step5.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index 4d8ca329baf..29166c03f5d 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -523,7 +523,7 @@ if ($action == "set") { print "
"; - $morehtml = '
'; + $morehtml = '

'; } else { @@ -533,7 +533,7 @@ if ($action == "set") { print "
"; - $morehtml = '
'; + $morehtml = '
'; } From 8a4f550d6457a6efd1c3dacc2b4909f5b67ffd37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Jul 2024 17:26:49 +0200 Subject: [PATCH 06/13] Debug v20 --- htdocs/adherents/list.php | 2 +- htdocs/admin/emailcollector_list.php | 10 +++++----- htdocs/admin/mails_senderprofile_list.php | 2 +- htdocs/asset/list.php | 2 +- htdocs/asset/model/list.php | 2 +- htdocs/bom/bom_list.php | 2 +- htdocs/bookcal/availabilities_list.php | 2 +- htdocs/bookcal/calendar_list.php | 2 +- htdocs/comm/propal/list.php | 2 +- htdocs/compta/cashcontrol/cashcontrol_list.php | 2 +- htdocs/compta/facture/list.php | 2 +- htdocs/contact/list.php | 2 +- htdocs/core/class/conf.class.php | 4 ++++ htdocs/eventorganization/conferenceorbooth_list.php | 2 +- .../conferenceorboothattendee_list.php | 2 +- htdocs/fourn/commande/list.php | 2 +- htdocs/hrm/evaluation_list.php | 10 +++++----- htdocs/hrm/job_list.php | 10 +++++----- htdocs/hrm/position.php | 2 +- htdocs/hrm/position_list.php | 10 +++++----- htdocs/hrm/skill_card.php | 2 +- htdocs/hrm/skill_list.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_list.php | 2 +- htdocs/loan/list.php | 2 +- htdocs/modulebuilder/template/myobject_list.php | 10 +++++----- htdocs/mrp/mo_list.php | 4 ++-- htdocs/partnership/admin/setup.php | 2 +- htdocs/partnership/partnership_list.php | 4 ++-- htdocs/product/inventory/list.php | 2 +- htdocs/product/list.php | 2 +- htdocs/product/stock/list.php | 2 +- htdocs/product/stock/productlot_list.php | 2 +- .../product/stock/stocktransfer/stocktransfer_list.php | 10 +++++----- htdocs/projet/list.php | 2 +- htdocs/recruitment/recruitmentcandidature_list.php | 2 +- htdocs/recruitment/recruitmentjobposition_list.php | 2 +- htdocs/salaries/list.php | 2 +- htdocs/salaries/payments.php | 2 +- htdocs/societe/card.php | 5 ++++- htdocs/societe/price.php | 2 +- htdocs/ticket/list.php | 2 +- htdocs/variants/list.php | 2 +- htdocs/webhook/target_list.php | 2 +- .../webportal/class/html.formlistwebportal.class.php | 2 +- htdocs/workstation/workstation_list.php | 6 +++--- 45 files changed, 79 insertions(+), 72 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 13d956aa38a..958e6d9940d 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -202,7 +202,7 @@ foreach ($object->fields as $key => $val) { $arrayfields[$tableprefix.'.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 7199bac6d5a..a01c9f1c6d9 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -119,11 +119,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 1173ebbf883..404d15d607b 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -110,7 +110,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index d397d3c312c..7efb3102429 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -109,7 +109,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index b787fc95605..b3cd864387c 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -109,7 +109,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index bf1e2a87269..1d57797083b 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -112,7 +112,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index dd7d6df9b2e..75f95910f84 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -132,7 +132,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/bookcal/calendar_list.php b/htdocs/bookcal/calendar_list.php index a67858255bb..0b9123a6f99 100644 --- a/htdocs/bookcal/calendar_list.php +++ b/htdocs/bookcal/calendar_list.php @@ -128,7 +128,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index d7d5aa122f1..23ea35a2f09 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -272,7 +272,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 984686af4d6..73e2c9170d4 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -110,7 +110,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index ed708fbcb17..c91a4e15a7f 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -287,7 +287,7 @@ foreach ($object->fields as $key => $val) { $arrayfields[$newkey] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => empty($val['help']) ? '' : $val['help'], ); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 6f5796526df..5b096009eb8 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -232,7 +232,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['p.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 08ce16ce1cd..8f766e8457e 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -1032,6 +1032,10 @@ class Conf extends stdClass $this->global->PRODUIT_MULTIPRICES_LIMIT = 5; } + if (!isset($this->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + $this->global->MAIN_CHECKBOX_LEFT_COLUMN = 1; + } + // For modules that want to disable top or left menu if (!empty($this->global->MAIN_HIDE_TOP_MENU)) { $this->dol_hide_topmenu = $this->global->MAIN_HIDE_TOP_MENU; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 43a6d1be07e..cd00973d845 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -122,7 +122,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 04d491ef5da..7186f6d0357 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -131,7 +131,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index bee99153ffe..2118a59f8bc 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -201,7 +201,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['cf.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 4f1bb1de9f8..8106d149b1c 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -119,11 +119,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index eb710892a92..01342b30a0b 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -118,11 +118,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index 8797dd4b772..fe81c3b76be 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -127,7 +127,7 @@ foreach ($objectposition->fields as $key => $val) { $arrayfields['t.' . $key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index 864c14d5cba..6bf6490cdcd 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -119,11 +119,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index d7b8e3d49ea..8c700d174d3 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -570,7 +570,7 @@ if ($action != "create" && $action != "edit") { $arrayfields['t.' . $key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 8d73bb14783..0adb700e0b9 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -128,7 +128,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 043ab6327b7..1fa05a34202 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -123,7 +123,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 8271a8869f9..af46c57738a 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -84,7 +84,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 0e817b7e80e..322ffd0cb58 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -173,11 +173,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 76caec517df..3b496588d00 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -117,7 +117,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); @@ -128,7 +128,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible <= 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/partnership/admin/setup.php b/htdocs/partnership/admin/setup.php index 843ae3fc9fe..eaa75fc3b5e 100644 --- a/htdocs/partnership/admin/setup.php +++ b/htdocs/partnership/admin/setup.php @@ -166,7 +166,7 @@ print ''; print ''.$langs->trans("PARTNERSHIP_BACKLINKS_TO_CHECK").''; print ''; -$backlinks = (!getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK') ? '' : $conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK); +$backlinks = getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK'); print ''; print ''; print 'dolibarr.org|dolibarr.fr|dolibarr.es'; diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 09dd60c7d29..fe8bb0ce5e2 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -138,7 +138,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); @@ -674,7 +674,7 @@ $newcardbutton = ''; $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); -$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/partnership/partnership_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); +$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/partnership/partnership_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF'].($socid > 0 ? '?socid='.$socid : '')), '', $permissiontoadd); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 6335bf3c68e..02344f08b15 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -115,7 +115,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 6a4eb772ef7..ccaaf1663d6 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -284,7 +284,7 @@ $arrayfields = array( $arrayfields['p.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'] ); } diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 9373a6d7014..0642d445335 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -124,7 +124,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 79e89258c99..e6d6842d75a 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -115,7 +115,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_list.php b/htdocs/product/stock/stocktransfer/stocktransfer_list.php index da87eb71191..89a72528d7a 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_list.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_list.php @@ -110,11 +110,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 05edffb1ddb..b9dd9b0e8fb 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -230,7 +230,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['p.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 2a31b345c4a..fd1ac85d7e5 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -119,7 +119,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 761483aaa92..30182793678 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -108,7 +108,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index df3717dabdb..2ad58926683 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -128,7 +128,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index 195494fe945..547eef70ad3 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -139,7 +139,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 81abbdf02d9..5255efafd43 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2665,7 +2665,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print ''; // Type Prospect/Customer/Supplier - print ''; @@ -2718,6 +2718,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio $NBPROFIDMAX = getDolGlobalInt('THIRDPARTY_MAX_NB_PROF_ID', 6); while ($i <= $NBPROFIDMAX) { $idprof = $langs->transcountry('ProfId'.$i, $object->country_code); + if (!empty($conf->dol_optimize_smallscreen)) { + $idprof = $langs->transcountry('ProfId'.$i.'Short', $object->country_code); + } if ($idprof != '-' && ($i <= $NBPROFIDMIN || !empty($langs->tab_translate['ProfId'.$i.$object->country_code]))) { print ''; print ''; print ''; // VAT print ''; // Price - print ''; + print ''; // Price multicurrency /*if (isModEnabled("multicurrency")) { @@ -1788,24 +1790,24 @@ if ($action == 'create') { }*/ // Quantity - print ''; + print ''; // Unit if (getDolGlobalInt('PRODUCT_USE_UNITS')) { print ''; } // Discount - print ''; + print ''; if (!empty($usemargins)) { print ''; + print ''; } print '
'.$langs->trans('NatureOfThirdParty').''; + print '
'.$langs->trans('NatureOfThirdParty').''; print $object->getTypeUrl(1); print '
'.$idprof.''; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 55d0091a80b..89b18c6fc60 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -547,7 +547,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index d7ccf72867c..d39b1fe9dc4 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -147,7 +147,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index a627c998cfc..ae3c9ee86ce 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -116,7 +116,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index 7fd775805b6..d37bb16779f 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -117,7 +117,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/webportal/class/html.formlistwebportal.class.php b/htdocs/webportal/class/html.formlistwebportal.class.php index 6412ce1de41..8dee9bb347b 100644 --- a/htdocs/webportal/class/html.formlistwebportal.class.php +++ b/htdocs/webportal/class/html.formlistwebportal.class.php @@ -191,7 +191,7 @@ class FormListWebPortal $arrayfields['t.' . $key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index 67e4ba8d2c2..1ece6dc7ded 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -119,7 +119,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); @@ -129,7 +129,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['wug.fk_usergroup'] = array( 'label' => $langs->trans('UserGroups'), 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => 1000, 'help' => empty($val['help']) ? '' : $val['help'], 'csslist' => 'minwidth100' @@ -139,7 +139,7 @@ $arrayfields['wug.fk_usergroup'] = array( $arrayfields['wr.fk_resource'] = array( 'label'=>$langs->trans('Resources'), 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>1001, 'help' => empty($val['help']) ? '' : $val['help'] ); From 1f7306b19e50427626680a87b5b1b049202b3433 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Jul 2024 17:49:34 +0200 Subject: [PATCH 07/13] Debug v20 --- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/core/tpl/commonfields_view.tpl.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 40f25fa3f59..ca326240d1e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10179,8 +10179,8 @@ function verifCond($strToEvaluate, $onlysimplestring = '1') if (isset($strToEvaluate) && $strToEvaluate !== '') { //var_dump($strToEvaluate); //$rep = dol_eval($strToEvaluate, 1, 0, '1'); // to show the error - $rep = (int) dol_eval($strToEvaluate, 1, 1, $onlysimplestring); // The dol_eval() must contains all the "global $xxx;" for all variables $xxx found into the string condition - $rights = $rep && (!is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false); + $rep = dol_eval($strToEvaluate, 1, 1, $onlysimplestring); // The dol_eval() must contains all the "global $xxx;" for all variables $xxx found into the string condition + $rights = (bool) $rep && (!is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false); //var_dump($rights); } return $rights; diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index 6065f64e189..4cb908025f4 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -47,10 +47,10 @@ foreach ($object->fields as $key => $val) { if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4 && abs($val['visible']) != 5) { continue; } - if (array_key_exists('enabled', $val) && isset($val['enabled']) && !verifCond($val['enabled'])) { continue; // We don't want this field } + if (in_array($key, array('ref', 'status'))) { continue; // Ref and status are already in dol_banner } From fce19af830ba1a8f1459075dea562e849dc0a612 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 9 Jul 2024 19:30:34 +0200 Subject: [PATCH 08/13] Use HasRight() (#30322) * Use HasRight() * se HasRight() --- htdocs/eventorganization/conferenceorbooth_card.php | 2 +- htdocs/eventorganization/conferenceorbooth_contact.php | 2 +- htdocs/eventorganization/conferenceorbooth_document.php | 2 +- htdocs/eventorganization/conferenceorboothattendee_card.php | 2 +- htdocs/mrp/mo_card.php | 5 +++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 5f00a49e9d6..e5b0f396a0e 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -88,7 +88,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ // Permissions $permissiontoread = $user->hasRight('eventorganization', 'read'); $permissiontoadd = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('eventorganization', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1]; diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index b2ae4685c89..89a6771fa30 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -79,7 +79,7 @@ $result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_so $permissiontoread = $user->hasRight('eventorganization', 'read'); $permissiontoadd = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('eventorganization', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1]; diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index da8471988d9..778711f9a86 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -93,7 +93,7 @@ if ($id > 0 || !empty($ref)) { // Permissions $permissiontoread = $user->hasRight('eventorganization', 'read'); $permissiontoadd = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('eventorganization', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1]; diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 4e6074703a6..5c260e275d0 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -115,7 +115,7 @@ if ($object->fk_project > 0) { // Permissions $permissiontoread = $user->hasRight('eventorganization', 'read'); $permissiontoadd = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('eventorganization', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1]; diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index df1f9e64683..17f5aefcb62 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2017-2020 Laurent Destailleur +/* Copyright (C) 2024 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 @@ -108,7 +109,7 @@ $result = restrictedArea($user, 'mrp', $object->id, 'mrp_mo', '', 'fk_soc', 'row $permissionnote = $user->hasRight('mrp', 'write'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('mrp', 'write'); // Used by the include of actions_dellink.inc.php $permissiontoadd = $user->hasRight('mrp', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->mrp->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('mrp', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $upload_dir = $conf->mrp->multidir_output[isset($object->entity) ? $object->entity : 1]; From 8bce9c3866c802822299a9cde1d12ed9c5f414e9 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Wed, 10 Jul 2024 18:48:57 +0200 Subject: [PATCH 09/13] fix: When update failed (extrafield check failed or 'date end' before 'date start' values inputed are lost (#30346) * fix: When update failed (extrafield check failed or 'date end' before 'date start'valur inputed are lost * fix: When update failed (extrafield check failed or 'date end' before 'date start'valur inputed are lost * fix: When update failed (extrafield check failed or 'date end' before 'date start' values inputed are lost * fix: When update failed (extrafield check failed or 'date end' before 'date start' values inputed are lost * Update card.php --------- Co-authored-by: Laurent Destailleur --- htdocs/contrat/card.php | 47 ++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index d3fb03dffa4..bb7ef944123 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -707,7 +707,6 @@ if (empty($reshook)) { if (!empty($date_start_update) && !empty($date_end_update) && $date_start_update > $date_end_update) { setEventMessages($langs->trans("Error").': '.$langs->trans("DateStartPlanned").' > '.$langs->trans("DateEndPlanned"), null, 'errors'); $action = 'editline'; - $_GET['rowid'] = GETPOST('elrowid'); // Keep $_GET here. Used by GETPOST('rowid') later $error++; } @@ -813,6 +812,7 @@ if (empty($reshook)) { $result = $objectline->update($user); if ($result < 0) { $error++; + $action = 'editline'; setEventMessages($objectline->error, $objectline->errors, 'errors'); } } @@ -1594,7 +1594,7 @@ if ($action == 'create') { // Line in view mode - if ($action != 'editline' || GETPOST('rowid') != $objp->rowid) { + if ($action != 'editline' || GETPOST('elrowid') != $objp->rowid) { $moreparam = ''; if (getDolGlobalString('CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT') && $objp->statut == ContratLigne::STATUS_CLOSED && $action != 'showclosedlines') { $moreparam = 'style="display: none;"'; @@ -1665,17 +1665,17 @@ if ($action == 'create') { print ''; if ($user->hasRight('contrat', 'creer') && is_array($arrayothercontracts) && count($arrayothercontracts) && ($object->statut >= 0)) { print ''; - print ''; + print ''; print img_picto($langs->trans("MoveToAnotherContract"), 'uparrow'); print ''; } if ($user->hasRight('contrat', 'creer') && ($object->statut >= 0)) { - print ''; + print ''; print img_edit(); print ''; } if ($user->hasRight('contrat', 'creer') && ($object->statut >= 0)) { - print ''; + print ''; print img_delete(); print ''; } @@ -1738,8 +1738,11 @@ if ($action == 'create') { // Ligne carac print '
'; + $currentLineProductId=GETPOSTISSET('idprod')?GETPOST('idprod'):(!empty($object->lines[$cursorline - 1]->fk_product) ? $object->lines[$cursorline - 1]->fk_product : 0); if ($objp->fk_product > 0) { $canchangeproduct = 1; + + // TODO: As $canchangeproduct is set just before, in what usecase it can be empty ? if (empty($canchangeproduct)) { $productstatic->id = $objp->fk_product; $productstatic->type = $objp->ptype; @@ -1747,19 +1750,19 @@ if ($action == 'create') { $productstatic->entity = $objp->pentity; print $productstatic->getNomUrl(1, '', 32); print $objp->label ? ' - '.dol_trunc($objp->label, 32) : ''; - print ''; + print ''; } else { $senderissupplier = 0; if (empty($senderissupplier)) { - print $form->select_produits((!empty($object->lines[$cursorline - 1]->fk_product) ? $object->lines[$cursorline - 1]->fk_product : 0), 'idprod'); + print $form->select_produits($currentLineProductId, 'idprod'); } else { - $form->select_produits_fournisseurs((!empty($object->lines[$cursorline - 1]->fk_product) ? $object->lines[$cursorline - 1]->fk_product : 0), 'idprod'); + $form->select_produits_fournisseurs($currentLineProductId, 'idprod'); } } print '
'; } else { print $objp->label ? $objp->label.'
' : ''; - print ''; + print ''; } // editeur wysiwyg @@ -1768,19 +1771,18 @@ if ($action == 'create') { if (getDolGlobalString('MAIN_INPUT_DESC_HEIGHT')) { $nbrows = getDolGlobalString('MAIN_INPUT_DESC_HEIGHT'); } - $enable = (isset($conf->global->FCKEDITOR_ENABLE_DETAILS) ? $conf->global->FCKEDITOR_ENABLE_DETAILS : 0); - $doleditor = new DolEditor('product_desc', $objp->description, '', 92, 'dolibarr_details', '', false, true, $enable, $nbrows, '90%'); + $doleditor = new DolEditor('product_desc', (GETPOSTISSET('product_desc')?GETPOST('product_desc'):$objp->description), '', 92, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), $nbrows, '90%'); $doleditor->Create(); print '
'; - print $form->load_tva("eltva_tx", $objp->tva_tx.($objp->vat_src_code ? (' ('.$objp->vat_src_code.')') : ''), $mysoc, $object->thirdparty, $objp->fk_product, $objp->info_bits, $objp->product_type, 0, 1); + print $form->load_tva("eltva_tx", $objp->tva_tx.($objp->vat_src_code ? (' ('.$objp->vat_src_code.')') : ''), $mysoc, $object->thirdparty, $currentLineProductId, $objp->info_bits, $objp->product_type, 0, 1); print ''; - print $form->selectUnits($objp->fk_unit, "unit"); + print $form->selectUnits((GETPOSTISSET('unit')?GETPOST('unit'):$objp->fk_unit), "unit"); print '%%'; if ($objp->fk_product) { print ''; } - print ''; print ''; @@ -1872,8 +1874,8 @@ if ($action == 'create') { /* * Confirmation to delete service line of contract */ - if ($action == 'deleteline' && !$_REQUEST["cancel"] && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == GETPOST('rowid')) { - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'), $langs->trans("DeleteContractLine"), $langs->trans("ConfirmDeleteContractLine"), "confirm_deleteline", '', 0, 1); + if ($action == 'deleteline' && !$_REQUEST["cancel"] && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == GETPOST('elrowid')) { + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('elrowid'), $langs->trans("DeleteContractLine"), $langs->trans("ConfirmDeleteContractLine"), "confirm_deleteline", '', 0, 1); if ($ret == 'html') { print '
'; } @@ -1882,7 +1884,7 @@ if ($action == 'create') { /* * Confirmation to move service toward another contract */ - if ($action == 'move' && !$_REQUEST["cancel"] && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == GETPOST('rowid')) { + if ($action == 'move' && !$_REQUEST["cancel"] && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == GETPOST('elrowid')) { $arraycontractid = array(); foreach ($arrayothercontracts as $contractcursor) { $arraycontractid[$contractcursor->id] = $contractcursor->ref; @@ -1893,7 +1895,7 @@ if ($action == 'create') { 'text' => $langs->trans("ConfirmMoveToAnotherContractQuestion"), 0 => array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid)); - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOSTINT('rowid'), $langs->trans("MoveToAnotherContract"), $langs->trans("ConfirmMoveToAnotherContract"), "confirm_move", $formquestion); + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOSTINT('elrowid'), $langs->trans("MoveToAnotherContract"), $langs->trans("ConfirmMoveToAnotherContract"), "confirm_move", $formquestion); print '
'; } @@ -2319,7 +2321,8 @@ $db->close(); + // TODO Why this ? To manage margin on contracts +?>