From 68b54f5cac811228d7bc1fa3b424a43977b6b321 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Mar 2014 19:52:04 +0100 Subject: [PATCH] New: Add hidden option PRODUCT_DISABLE_CUSTOM_INFO to disable custom info management (used for export activity only) --- htdocs/product/fiche.php | 63 +++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 11826de4570..6df26f1a24f 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -745,7 +745,7 @@ else } } - print '
'; + print ''; print ''; print ''; print ''."\n"; @@ -784,8 +784,9 @@ else print $form->selectarray('statut_buy',$statutarray,GETPOST('statut_buy')); print ''; - // batch number management - if ($conf->productbatch->enabled) { + // Batch number management + if ($conf->productbatch->enabled) + { print ''.$langs->trans("Status").' ('.$langs->trans("Batch").')'; $statutarray=array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch")); print $form->selectarray('status_batch',$statutarray,GETPOST('status_batch')); @@ -891,14 +892,17 @@ else print ''; } - // Customs code - print ''.$langs->trans("CustomCode").''; - // Origin country - print ''.$langs->trans("CountryOrigin").''; - print $form->select_country(GETPOST('country_id','int'),'country_id'); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); - print ''; - + // Custom code + if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) + { + print ''.$langs->trans("CustomCode").''; + // Origin country + print ''.$langs->trans("CountryOrigin").''; + print $form->select_country(GETPOST('country_id','int'),'country_id'); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + print ''; + } + // Other attributes $parameters=array('colspan' => 3); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook @@ -1156,14 +1160,17 @@ else print ''; } - // Customs code - print ''.$langs->trans("CustomCode").''; - // Origin country - print ''.$langs->trans("CountryOrigin").''; - print $form->select_country($object->country_id,'country_id'); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); - print ''; - + // Custom code + if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) + { + print ''.$langs->trans("CustomCode").''; + // Origin country + print ''.$langs->trans("CountryOrigin").''; + print $form->select_country($object->country_id,'country_id'); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + print ''; + } + // Other attributes $parameters=array('colspan' => ' colspan="2"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook @@ -1236,10 +1243,11 @@ else // Label print ''.$langs->trans("Label").''.$object->libelle.''; - $nblignes=8; + $nblignes=7; if (! empty($conf->produit->enabled) && ! empty($conf->service->enabled)) $nblignes++; if ($showbarcode) $nblignes+=2; if ($object->type!=1) $nblignes++; + if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) $nblignes+=2; if ($object->isservice()) $nblignes++; else $nblignes+=4; @@ -1425,12 +1433,15 @@ else print "\n"; } - // Customs code - print ''.$langs->trans("CustomCode").''.$object->customcode.''; - - // Origin country code - print ''.$langs->trans("CountryOrigin").''.getCountry($object->country_id,0,$db).''; - + // Custom code + if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) + { + print ''.$langs->trans("CustomCode").''.$object->customcode.''; + + // Origin country code + print ''.$langs->trans("CountryOrigin").''.getCountry($object->country_id,0,$db).''; + } + // Other attributes $parameters=array('colspan' => ' colspan="'.(2+(($showphoto||$showbarcode)?1:0)).'"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook