From 4d8bd95722b120c9a3dbb8c94e6c9b2c3c65e187 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Sep 2011 22:44:18 +0000 Subject: [PATCH] Fix: label if id not defined for country --- htdocs/admin/pdf.php | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index a9fdcea608a..c83b8714bbe 100755 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -113,25 +113,33 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') // Edit // Show prof id 1 in address into pdf $var=!$var; - print ''.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId1",$mysoc->pays_code).''; + $pid1=$langs->transcountry("ProfId1",$mysoc->pays_code); + if ($pid1 == '-') $pid1=$langs->transcountry("ProfId1"); + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid1.''; print $html->selectyesno('MAIN_PROFID1_IN_ADDRESS',isset($conf->global->MAIN_PROFID1_IN_ADDRESS)?$conf->global->MAIN_PROFID1_IN_ADDRESS:0,1); print ''; // Show prof id 2 in address into pdf $var=!$var; - print ''.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId2",$mysoc->pays_code).''; + $pid2=$langs->transcountry("ProfId2",$mysoc->pays_code); + if ($pid2 == '-') $pid2=$langs->transcountry("ProfId2"); + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid2.''; print $html->selectyesno('MAIN_PROFID2_IN_ADDRESS',isset($conf->global->MAIN_PROFID2_IN_ADDRESS)?$conf->global->MAIN_PROFID2_IN_ADDRESS:0,1); print ''; // Show prof id 3 in address into pdf $var=!$var; - print ''.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId3",$mysoc->pays_code).''; + $pid3=$langs->transcountry("ProfId3",$mysoc->pays_code); + if ($pid3 == '-') $pid3=$langs->transcountry("ProfId3"); + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid3.''; print $html->selectyesno('MAIN_PROFID3_IN_ADDRESS',isset($conf->global->MAIN_PROFID3_IN_ADDRESS)?$conf->global->MAIN_PROFID3_IN_ADDRESS:0,1); print ''; // Show prof id 4 in address into pdf $var=!$var; - print ''.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId4",$mysoc->pays_code).''; + $pid4=$langs->transcountry("ProfId4",$mysoc->pays_code); + if ($pid4 == '-') $pid4=$langs->transcountry("ProfId4"); + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid4.''; print $html->selectyesno('MAIN_PROFID4_IN_ADDRESS',isset($conf->global->MAIN_PROFID4_IN_ADDRESS)?$conf->global->MAIN_PROFID4_IN_ADDRESS:0,1); print ''; @@ -199,25 +207,33 @@ else // Show // Show prof id 1 in address into pdf $var=!$var; - print ''.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId1",$mysoc->pays_code).''; + $pid1=$langs->transcountry("ProfId1",$mysoc->pays_code); + if ($pid1 == '-') $pid1=$langs->transcountry("ProfId1"); + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid1.''; print yn($conf->global->MAIN_PROFID1_IN_ADDRESS,1); print ''; // Show prof id 2 in address into pdf $var=!$var; - print ''.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId2",$mysoc->pays_code).''; + $pid2=$langs->transcountry("ProfId2",$mysoc->pays_code); + if ($pid2 == '-') $pid2=$langs->transcountry("ProfId2"); + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid2.''; print yn($conf->global->MAIN_PROFID2_IN_ADDRESS,1); print ''; // Show prof id 3 in address into pdf $var=!$var; - print ''.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId3",$mysoc->pays_code).''; + $pid3=$langs->transcountry("ProfId3",$mysoc->pays_code); + if ($pid3 == '-') $pid3=$langs->transcountry("ProfId3"); + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid3.''; print yn($conf->global->MAIN_PROFID3_IN_ADDRESS,1); print ''; // Show prof id 4 in address into pdf $var=!$var; - print ''.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId4",$mysoc->pays_code).''; + $pid4=$langs->transcountry("ProfId4",$mysoc->pays_code); + if ($pid4 == '-') $pid4=$langs->transcountry("ProfId4"); + print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid4.''; print yn($conf->global->MAIN_PROFID4_IN_ADDRESS,1); print '';