From 49e54d55d596ea74fbde3c855fe7dc613fad4e6a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Sep 2016 18:19:54 +0200 Subject: [PATCH] Removed old option PRODUCT_SHOW_WHEN_CREATE. It was bugged and not usable. --- htdocs/comm/propal/card.php | 46 ++----------------------------- htdocs/commande/card.php | 32 --------------------- htdocs/fourn/facture/card.php | 29 ------------------- htdocs/supplier_proposal/card.php | 46 ++----------------------------- 4 files changed, 6 insertions(+), 147 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 82223887b91..d045c5f0ea7 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -352,16 +352,6 @@ if (empty($reshook)) $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); } - for($i = 1; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i ++) - { - if ($_POST['idprod' . $i]) { - $xid = 'idprod' . $i; - $xqty = 'qty' . $i; - $xremise = 'remise' . $i; - $object->add_product($_POST[$xid], $_POST[$xqty], $_POST[$xremise]); - } - } - // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels, $object); if ($ret < 0) { @@ -1523,9 +1513,10 @@ if ($action == 'create') if (empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) print ''; - if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE) || ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '
'; if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) { + print '
'; + // For backward compatibility print ''; print ''; @@ -1558,42 +1549,11 @@ if ($action == 'create') } print ''; - if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) - print ''; - print ''; print ''; } - if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) - { - print ''; - } - if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE) || ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '
 
' . $langs->trans("CreateEmptyPropal") . '
'; - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { - $lib = $langs->trans("ProductsAndServices"); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - for($i = 1; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i ++) { - print ''; - print ''; - print ''; - print ''; - } - print "
' . $lib . '' . $langs->trans("Qty") . '' . $langs->trans("ReductionShort") . '
'; - // multiprix - if ($conf->global->PRODUIT_MULTIPRICES && $soc->price_level) - $form->select_produits('', "idprod" . $i, '', $conf->product->limit_size, $soc->price_level); - else - $form->select_produits('', "idprod" . $i, '', $conf->product->limit_size); - print '%
"; - } - print '
'; + if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) print ''; dol_fiche_end(); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 25e6606c16c..def950305d6 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1702,38 +1702,6 @@ if ($action == 'create' && $user->rights->commande->creer) print '' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; } } - else - { - if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) - { - /* - * Services/produits predefinis - */ - $NBLINES = 8; - - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - for($i = 1; $i <= $NBLINES; $i ++) { - print ''; - print ''; - print ''; - } - - print '
' . $langs->trans('ProductsAndServices') . '' . $langs->trans('Qty') . '' . $langs->trans('ReductionShort') . '
'; - // multiprix - if (! empty($conf->global->PRODUIT_MULTIPRICES)) - print $form->select_produits('', 'idprod' . $i, '', $conf->product->limit_size, $soc->price_level); - else - print $form->select_produits('', 'idprod' . $i, '', $conf->product->limit_size); - print '%
'; - print ''; - } - } print ''; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 7f7cbdf44eb..a64d4115186 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1455,35 +1455,6 @@ if ($action == 'create') print '' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . ""; } } - else - { - // TODO more bugs - if (1==2 && ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) - { - print ''; - print ' '; - print ''.$langs->trans('Label').''; - print ''.$langs->trans('PriceUHT').''; - print ''.$langs->trans('VAT').''; - print ''.$langs->trans('Qty').''; - print ''.$langs->trans('PriceUTTC').''; - print ''; - - for ($i = 1 ; $i < 9 ; $i++) - { - $value_qty = '1'; - $value_tauxtva = ''; - print ''.$i.''; - print ''; - print ''; - print ''; - print $form->load_tva('tauxtva'.$i,$value_tauxtva,$societe,$mysoc); - print ''; - print ''; - print ''; - } - } - } // Other options $parameters=array('colspan' => ' colspan="6"'); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 30700695b00..839ce87f945 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -282,16 +282,6 @@ if (empty($reshook)) $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); } - for($i = 1; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i ++) - { - if ($_POST['idprod' . $i]) { - $xid = 'idprod' . $i; - $xqty = 'qty' . $i; - $xremise = 'remise' . $i; - $object->add_product($_POST[$xid], $_POST[$xqty], $_POST[$xremise]); - } - } - // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels, $object); if ($ret < 0) { @@ -1207,9 +1197,10 @@ if ($action == 'create') if (empty($conf->global->SUPPLIER_PROPOSAL_CLONE_ON_CREATE_PAGE)) print ''; - if (! empty($conf->global->SUPPLIER_PROPOSAL_CLONE_ON_CREATE_PAGE) || ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '
'; if (! empty($conf->global->SUPPLIER_PROPOSAL_CLONE_ON_CREATE_PAGE)) { + print '
'; + // For backward compatibility print ''; print ''; @@ -1242,42 +1233,11 @@ if ($action == 'create') } print ''; - if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) - print ''; - print ''; print ''; } - if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) - { - print ''; - } - if (! empty($conf->global->SUPPLIER_PROPOSAL_CLONE_ON_CREATE_PAGE) || ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '
 
' . $langs->trans("CreateEmptyAsk") . '
'; - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { - $lib = $langs->trans("ProductsAndServices"); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - for($i = 1; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i ++) { - print ''; - print ''; - print ''; - print ''; - } - print "
' . $lib . '' . $langs->trans("Qty") . '' . $langs->trans("ReductionShort") . '
'; - // multiprix - if ($conf->global->PRODUIT_MULTIPRICES && $soc->price_level) - $form->select_produits('', "idprod" . $i, '', $conf->product->limit_size, $soc->price_level); - else - $form->select_produits('', "idprod" . $i, '', $conf->product->limit_size); - print '%
"; - } - print '
'; + if (! empty($conf->global->SUPPLIER_PROPOSAL_CLONE_ON_CREATE_PAGE)) print ''; dol_fiche_end();