From 9cf2ea492cc7b782c7d84e4f143886dcbd2b5ab8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 21 May 2012 18:44:09 +0200 Subject: [PATCH] Fix: broken features with external module --- htdocs/comm/propal.php | 15 +++------------ htdocs/commande/fiche.php | 15 +++------------ htdocs/compta/facture.php | 15 +++------------ htdocs/expedition/fiche.php | 15 +++------------ htdocs/fichinter/fiche.php | 15 +++------------ htdocs/fourn/commande/fiche.php | 15 +++------------ htdocs/fourn/facture/fiche.php | 15 +++------------ 7 files changed, 21 insertions(+), 84 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 68b413a8d17..c6b4a607520 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -65,18 +65,9 @@ $year=GETPOST("year"); $month=GETPOST("month"); //PDF -if ($conf->global->MAIN_FEATURES_LEVEL > 1) -{ - $hidedetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS)?0:1; - $hidedesc = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC)?0:1; - $hideref = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF)?0:1; -} -else -{ - $hidedetails= GETPOST('hidedetails'); - $hidedesc = GETPOST('hidedesc'); - $hideref = GETPOST('hideref'); -} +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); // Nombre de ligne pour choix de produit/service predefinis $NBLINES=4; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 2e8b723feb6..3008771d340 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -59,18 +59,9 @@ $lineid = GETPOST('lineid'); $mesg = GETPOST('mesg'); //PDF -if ($conf->global->MAIN_FEATURES_LEVEL > 1) -{ - $hidedetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS)?0:1; - $hidedesc = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC)?0:1; - $hideref = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF)?0:1; -} -else -{ - $hidedetails= GETPOST('hidedetails'); - $hidedesc = GETPOST('hidedesc'); - $hideref = GETPOST('hideref'); -} +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); // Security check if ($user->societe_id) $socid=$user->societe_id; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 8f65b25edf8..6d30f8c34d4 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -70,18 +70,9 @@ $search_montant_ht=GETPOST('search_montant_ht','alpha'); $search_montant_ttc=GETPOST('search_montant_ttc','alpha'); //PDF -if ($conf->global->MAIN_FEATURES_LEVEL > 1) -{ - $hidedetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS)?0:1; - $hidedesc = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC)?0:1; - $hideref = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF)?0:1; -} -else -{ - $hidedetails= GETPOST('hidedetails'); - $hidedesc = GETPOST('hidedesc'); - $hideref = GETPOST('hideref'); -} +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); // Security check $fieldid = (! empty($ref)?'facnumber':'rowid'); diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index fd0ae55bf8e..ac45f0db7f3 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -61,18 +61,9 @@ $action = GETPOST('action','alpha'); $confirm = GETPOST('confirm','alpha'); //PDF -if ($conf->global->MAIN_FEATURES_LEVEL > 1) -{ - $hidedetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS)?0:1; - $hidedesc = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC)?0:1; - $hideref = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF)?0:1; -} -else -{ - $hidedetails= GETPOST('hidedetails'); - $hidedesc = GETPOST('hidedesc'); - $hideref = GETPOST('hideref'); -} +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); $object = new Expedition($db); diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 0825c5a7e44..9d79d668638 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -51,18 +51,9 @@ $confirm = GETPOST('confirm','alpha'); $mesg = GETPOST('msg','alpha'); //PDF -if ($conf->global->MAIN_FEATURES_LEVEL > 1) -{ - $hidedetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS)?0:1; - $hidedesc = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC)?0:1; - $hideref = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF)?0:1; -} -else -{ - $hidedetails= GETPOST('hidedetails'); - $hidedesc = GETPOST('hidedesc'); - $hideref = GETPOST('hideref'); -} +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); // Security check if ($user->societe_id) $socid=$user->societe_id; diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 4f7b5fdd6b6..e8fd1a83ef3 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -56,18 +56,9 @@ $socid = GETPOST('socid','int'); $projectid = GETPOST('projectid','int'); //PDF -if ($conf->global->MAIN_FEATURES_LEVEL > 1) -{ - $hidedetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS)?0:1; - $hidedesc = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC)?0:1; - $hideref = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF)?0:1; -} -else -{ - $hidedetails = GETPOST('hidedetails','alpha'); - $hidedesc = GETPOST('hidedesc','alpha'); - $hideref = GETPOST('hideref','alpha'); -} +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); // Security check diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index c59c7c933b0..be0b0acd31b 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -47,18 +47,9 @@ $action = GETPOST("action"); $confirm = GETPOST("confirm"); //PDF -if ($conf->global->MAIN_FEATURES_LEVEL > 1) -{ - $hidedetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS)?0:1; - $hidedesc = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC)?0:1; - $hideref = empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF)?0:1; -} -else -{ - $hidedetails= GETPOST('hidedetails'); - $hidedesc = GETPOST('hidedesc'); - $hideref = GETPOST('hideref'); -} +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); // Security check if ($user->societe_id) $socid=$user->societe_id;