From 190da9cb8c3e307d1597459044046aa8fa45b489 Mon Sep 17 00:00:00 2001 From: Francis <162715304+le-reparateur@users.noreply.github.com> Date: Sun, 30 Nov 2025 12:01:46 +0100 Subject: [PATCH 1/4] Add default supplier type handling in card.php in creation mode Hi By default supplier is a professional in creation mode. --- htdocs/societe/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 7d1ff903a2f..119669da48f 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1010,7 +1010,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio if (empty($private)) { $private = 0; } - + // by default supplier is a professional + if (GETPOST("type", 'aZ') == 'f') $private = 0; + // Load object modCodeClient $module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard'); if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { From 7b2ceaf17760b7120c4e7a30ef2ee2161fb849c8 Mon Sep 17 00:00:00 2001 From: Francis <162715304+le-reparateur@users.noreply.github.com> Date: Sun, 30 Nov 2025 12:11:16 +0100 Subject: [PATCH 2/4] Add default supplier type handling in card.php in creation mode --- htdocs/societe/card.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 119669da48f..1e90bf0a510 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1011,8 +1011,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio $private = 0; } // by default supplier is a professional - if (GETPOST("type", 'aZ') == 'f') $private = 0; - + if (GETPOST("type", 'aZ') == 'f') { + $private = 0; + } // Load object modCodeClient $module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard'); if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { From ca30a6d6927924f4ccb19d040d2b045c0f6fd795 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Dec 2025 14:07:28 +0100 Subject: [PATCH 3/4] Update card.php --- htdocs/societe/card.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 1e90bf0a510..13dc1441b3c 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1004,16 +1004,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio * Creation */ $private = GETPOSTINT("private"); - if (getDolGlobalString('THIRDPARTY_DEFAULT_CREATE_CONTACT') && !GETPOSTISSET('private')) { + if (getDolGlobalString('THIRDPARTY_DEFAULT_CREATE_CONTACT') && !GETPOSTISSET('private') && GETPOST("type", 'aZ') != 'f') { $private = 1; } if (empty($private)) { $private = 0; } - // by default supplier is a professional - if (GETPOST("type", 'aZ') == 'f') { - $private = 0; - } // Load object modCodeClient $module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard'); if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { From 14eab317ef27b081834c3043e37979d7551552ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Dec 2025 14:08:11 +0100 Subject: [PATCH 4/4] Fix formatting and add new line in card.php --- htdocs/societe/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 13dc1441b3c..0c0e4306115 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1010,6 +1010,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio if (empty($private)) { $private = 0; } + // Load object modCodeClient $module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard'); if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {