From 4311a1ece8ae08226ae6d2bab94a3b2b0fede48f Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sun, 19 May 2019 01:58:20 +0200 Subject: [PATCH 1/3] fix: #11187 --- htdocs/projet/class/project.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index e63cbe80fee..9caa873f170 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -537,7 +537,7 @@ class Project extends CommonObject } elseif ($type == 'project_task') { - $sql = "SELECT DISTINCT pt.rowid FROM " . MAIN_DB_PREFIX . "projet_task as pt, " . MAIN_DB_PREFIX . "projet_task_time as ptt WHERE pt.rowid = ptt.fk_task AND pt.fk_projet IN (". $ids .")"; + $sql = "SELECT DISTINCT pt.rowid FROM " . MAIN_DB_PREFIX . "projet_task as pt WHERE pt.fk_projet IN (". $ids .")"; } elseif ($type == 'project_task_time') // Case we want to duplicate line foreach user { From e4d87ab2e7c1bdb09f9d7a302f621547ae37dd8f Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sun, 19 May 2019 02:05:13 +0200 Subject: [PATCH 2/3] fix: #11189 --- htdocs/core/class/extrafields.class.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index f8ae333935e..b3c257bfaaa 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1194,13 +1194,14 @@ class ExtraFields if ($value == $obj->rowid) { - foreach ($fields_label as $field_toshow) - { - $translabel=$langs->trans($obj->$field_toshow); - if ($translabel!=$obj->$field_toshow) { - $labeltoshow=dol_trunc($translabel,18).' '; - }else { - $labeltoshow=dol_trunc($obj->$field_toshow,18).' '; + if (! $notrans) { + foreach ($fields_label as $field_toshow) { + $translabel = $langs->trans($obj->$field_toshow); + if ($translabel != $obj->$field_toshow) { + $labeltoshow = dol_trunc($translabel, 18) . ' '; + } else { + $labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' '; + } } } $out.=''; From 2a2fcf6784843606297ab573cc86edf3425ed158 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 May 2019 15:38:33 +0200 Subject: [PATCH 3/3] FIX only profid1 to 4 were editable for pdf option to show. Not 5 and 6. --- htdocs/admin/pdf.php | 180 ++++++++++--------------------------------- 1 file changed, 40 insertions(+), 140 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 37c836043a0..70fa3dc38b7 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -61,6 +61,8 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", $_POST["MAIN_PROFID2_IN_ADDRESS"],'chaine',0,'', $conf->entity); dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", $_POST["MAIN_PROFID3_IN_ADDRESS"],'chaine',0,'', $conf->entity); dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'', $conf->entity); + dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", $_POST["MAIN_PROFID5_IN_ADDRESS"],'chaine',0,'', $conf->entity); + dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", $_POST["MAIN_PROFID6_IN_ADDRESS"],'chaine',0,'', $conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", $_POST["MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"],'chaine',0,'', $conf->entity); dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", $_POST["MAIN_TVAINTRA_NOT_IN_ADDRESS"],'chaine',0,'', $conf->entity); @@ -177,76 +179,25 @@ if ($action == 'edit') // Edit print $form->selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS',(! empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS))?$conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS:0,1); print ''; - // Show prof id 1 in address into pdf - - if (! $noCountryCode) + // Show prof id in address into pdf + for($i=1; $i<=6; $i++) { - $pid1=$langs->transcountry("ProfId1",$mysoc->country_code); - if ($pid1 == '-') $pid1=false; - } - else - { - $pid1 = img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; - } - if ($pid1) - { - print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid1.''; - print $form->selectyesno('MAIN_PROFID1_IN_ADDRESS',isset($conf->global->MAIN_PROFID1_IN_ADDRESS)?$conf->global->MAIN_PROFID1_IN_ADDRESS:0,1,$noCountryCode); - print ''; - } - - // Show prof id 2 in address into pdf - - if (! $noCountryCode) - { - $pid2=$langs->transcountry("ProfId2",$mysoc->country_code); - if ($pid2 == '-') $pid2=false; - } - else - { - $pid2 = img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; - } - if ($pid2) - { - print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid2.''; - print $form->selectyesno('MAIN_PROFID2_IN_ADDRESS',isset($conf->global->MAIN_PROFID2_IN_ADDRESS)?$conf->global->MAIN_PROFID2_IN_ADDRESS:0,1,$noCountryCode); - print ''; - } - - // Show prof id 3 in address into pdf - - if (! $noCountryCode) - { - $pid3=$langs->transcountry("ProfId3",$mysoc->country_code); - if ($pid3 == '-') $pid3=false; - } - else - { - $pid3 = img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; - } - if ($pid3) - { - print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid3.''; - print $form->selectyesno('MAIN_PROFID3_IN_ADDRESS',isset($conf->global->MAIN_PROFID3_IN_ADDRESS)?$conf->global->MAIN_PROFID3_IN_ADDRESS:0,1,$noCountryCode); - print ''; - } - - // Show prof id 4 in address into pdf - - if (! $noCountryCode) - { - $pid4=$langs->transcountry("ProfId4",$mysoc->country_code); - if ($pid4 == '-') $pid4=false; - } - else - { - $pid4 = img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; - } - if ($pid4) - { - print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid4.''; - print $form->selectyesno('MAIN_PROFID4_IN_ADDRESS',isset($conf->global->MAIN_PROFID4_IN_ADDRESS)?$conf->global->MAIN_PROFID4_IN_ADDRESS:0,1,$noCountryCode); - print ''; + if (! $noCountryCode) + { + $pid=$langs->transcountry("ProfId".$i, $mysoc->country_code); + if ($pid == '-') $pid=false; + } + else + { + $pid = img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; + } + if ($pid) + { + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid.''; + $keyforconstant = 'MAIN_PROFID'.$i.'_IN_ADDRESS'; + print $form->selectyesno($keyforconstant, isset($conf->global->$keyforconstant)?$conf->global->$keyforconstant:0, 1, $noCountryCode); + print ''; + } } print ''; @@ -419,77 +370,26 @@ else // Show print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS,1); print ''; - // Show prof id 1 in address into pdf - - if (! $noCountryCode) - { - $pid1=$langs->transcountry("ProfId1",$mysoc->country_code); - if ($pid1 == '-') $pid1=false; - } - else - { - $pid1 = img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; - } - if ($pid1) - { - print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid1.''; - print yn($conf->global->MAIN_PROFID1_IN_ADDRESS,1); - print ''; - } - - // Show prof id 2 in address into pdf - - if (! $noCountryCode) - { - $pid2=$langs->transcountry("ProfId2",$mysoc->country_code); - if ($pid2 == '-') $pid2=false; - } - else - { - $pid2 = img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; - } - if ($pid2) - { - print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid2.''; - print yn($conf->global->MAIN_PROFID2_IN_ADDRESS,1); - print ''; - } - - // Show prof id 3 in address into pdf - - if (! $noCountryCode) - { - $pid3=$langs->transcountry("ProfId3",$mysoc->country_code); - if ($pid3 == '-') $pid3=false; - } - else - { - $pid3 = img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; - } - if ($pid3) - { - print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid3.''; - print yn($conf->global->MAIN_PROFID3_IN_ADDRESS,1); - print ''; - } - - // Show prof id 4 in address into pdf - - if (! $noCountryCode) - { - $pid4=$langs->transcountry("ProfId4",$mysoc->country_code); - if ($pid4 == '-') $pid4=false; - } - else - { - $pid4 = img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; - } - if ($pid4) - { - print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid4.''; - print yn($conf->global->MAIN_PROFID4_IN_ADDRESS,1); - print ''; - } + // Show prof id in address into pdf + for ($i=1; $i<=6; $i++) + { + if (! $noCountryCode) + { + $pid=$langs->transcountry("ProfId".$i, $mysoc->country_code); + if ($pid == '-') $pid=false; + } + else + { + $pid = img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; + } + if ($pid) + { + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid.''; + $keyforconstant = 'MAIN_PROFID'.$i.'_IN_ADDRESS'; + print yn($conf->global->$keyforconstant, 1); + print ''; + } + } print ''."\n"; print '';