From d6caa057f29080ac78c879e70ff244c96e09f14a Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 13 Apr 2021 10:23:05 +0200 Subject: [PATCH 1/4] FIX: project visibility field with two option If two option of disabled visibility are add on constant, combo is not display --- htdocs/projet/card.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 7a12f797913..c72f08f8020 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -612,7 +612,18 @@ if ($action == 'create' && $user->rights->projet->creer) $array = array(); if (empty($conf->global->PROJECT_DISABLE_PRIVATE_PROJECT)) $array[0] = $langs->trans("PrivateProject"); if (empty($conf->global->PROJECT_DISABLE_PUBLIC_PROJECT)) $array[1] = $langs->trans("SharedProject"); - print $form->selectarray('public', $array, GETPOST('public') ?GETPOST('public') : $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1); + + if (count($array) > 0) + { + print $form->selectarray('public', $array, GETPOSTISSET('public') ? GETPOST('public') : $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1); + } + else + { + print ''; + + if ( (GETPOSTISSET('public') ? GETPOST('public') : $object->public)==0) print $langs->trans("PrivateProject"); + else print $langs->trans("SharedProject"); + } print ''; // Date start @@ -886,7 +897,18 @@ if ($action == 'create' && $user->rights->projet->creer) $array = array(); if (empty($conf->global->PROJECT_DISABLE_PRIVATE_PROJECT)) $array[0] = $langs->trans("PrivateProject"); if (empty($conf->global->PROJECT_DISABLE_PUBLIC_PROJECT)) $array[1] = $langs->trans("SharedProject"); - print $form->selectarray('public', $array, $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1); + + if (count($array) > 0) + { + print $form->selectarray('public', $array, $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1); + } + else + { + print ''; + + if ($object->public==0) print $langs->trans("PrivateProject"); + else print $langs->trans("SharedProject"); + } print ''; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) From 6ab0de145b49b72d765736757058d6d88f85094f Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 13 Apr 2021 08:33:57 +0000 Subject: [PATCH 2/4] Fixing style errors. --- htdocs/projet/card.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index c72f08f8020..38db7ec1fd6 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -617,8 +617,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print $form->selectarray('public', $array, GETPOSTISSET('public') ? GETPOST('public') : $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1); } - else - { + else { print ''; if ( (GETPOSTISSET('public') ? GETPOST('public') : $object->public)==0) print $langs->trans("PrivateProject"); @@ -902,8 +901,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print $form->selectarray('public', $array, $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1); } - else - { + else { print ''; if ($object->public==0) print $langs->trans("PrivateProject"); From de73c0adb279efcdf4583c3bbfe233c6016e95c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Apr 2021 15:38:51 +0200 Subject: [PATCH 3/4] Update card.php --- htdocs/projet/card.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 38db7ec1fd6..b93f7168b9f 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -613,15 +613,16 @@ if ($action == 'create' && $user->rights->projet->creer) if (empty($conf->global->PROJECT_DISABLE_PRIVATE_PROJECT)) $array[0] = $langs->trans("PrivateProject"); if (empty($conf->global->PROJECT_DISABLE_PUBLIC_PROJECT)) $array[1] = $langs->trans("SharedProject"); - if (count($array) > 0) - { + if (count($array) > 0) { print $form->selectarray('public', $array, GETPOSTISSET('public') ? GETPOST('public') : $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1); - } - else { + } else { print ''; - if ( (GETPOSTISSET('public') ? GETPOST('public') : $object->public)==0) print $langs->trans("PrivateProject"); - else print $langs->trans("SharedProject"); + if ( (GETPOSTISSET('public') ? GETPOST('public') : $object->public)==0) { + print $langs->trans("PrivateProject"); + } else { + print $langs->trans("SharedProject"); + } } print ''; From ee07796131ae28e6f43926bb46539cfa495ca6c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Apr 2021 15:39:34 +0200 Subject: [PATCH 4/4] Update card.php --- htdocs/projet/card.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index b93f7168b9f..5ce32767c4c 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -898,20 +898,20 @@ if ($action == 'create' && $user->rights->projet->creer) if (empty($conf->global->PROJECT_DISABLE_PRIVATE_PROJECT)) $array[0] = $langs->trans("PrivateProject"); if (empty($conf->global->PROJECT_DISABLE_PUBLIC_PROJECT)) $array[1] = $langs->trans("SharedProject"); - if (count($array) > 0) - { + if (count($array) > 0) { print $form->selectarray('public', $array, $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1); - } - else { + } else { print ''; - if ($object->public==0) print $langs->trans("PrivateProject"); - else print $langs->trans("SharedProject"); + if ($object->public == 0) { + print $langs->trans("PrivateProject"); + } else { + print $langs->trans("SharedProject"); + } } print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) - { + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $classfortr = ($object->usage_opportunity ? '' : ' hideobject'); // Opportunity status print ''.$langs->trans("OpportunityStatus").'';