diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index 379b80fd1eb..1ea02816043 100644 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -123,20 +123,6 @@ class ActionsCardProduct $this->tpl['tva_tx'] = $form->load_tva("tva_tx",-1,$mysoc,''); } - if ($action == 'create' || $action == 'edit') - { - // Status - $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell")); - $this->tpl['status'] = $form->selectarray('statut',$statutarray,$this->status); - - //To Buy - $statutarray=array('1' => $langs->trans("Yes"), '0' => $langs->trans("No")); - $this->tpl['tobuy'] = $form->selectarray('tobuy',$statutarray,$this->status_buy); - - $this->tpl['description'] = $this->description; - $this->tpl['note'] = $this->note; - } - if ($action == 'view') { $head = product_prepare_head($this->object); @@ -180,10 +166,13 @@ class ActionsCardProduct { // Status $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell")); - $this->tpl['status'] = $form->selectarray('statut',$statutarray,$_POST["statut"]); + $this->tpl['status'] = $form->selectarray('statut',$statutarray,$this->object->status); $statutarray=array('1' => $langs->trans("ProductStatusOnBuy"), '0' => $langs->trans("ProductStatusNotOnBuy")); - $this->tpl['status_buy'] = $form->selectarray('statut_buy',$statutarray,$_POST["statut_buy"]); + $this->tpl['status_buy'] = $form->selectarray('statut_buy',$statutarray,$this->object->status_buy); + + $this->tpl['description'] = $this->description; + $this->tpl['note'] = $this->note; // Finished $statutarray=array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); @@ -208,10 +197,6 @@ class ActionsCardProduct if ($action == 'view') { - // Status - $this->tpl['status'] = $this->object->getLibStatut(2,0); - $this->tpl['status_buy'] = $this->object->getLibStatut(2,1); - // Photo $this->tpl['nblignes'] = 4; if ($this->object->is_photo_available($conf->product->multidir_output[$this->object->entity])) diff --git a/htdocs/product/canvas/product/tpl/card_create.tpl.php b/htdocs/product/canvas/product/tpl/card_create.tpl.php index bc4b5409688..d3c29f32e2e 100644 --- a/htdocs/product/canvas/product/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_create.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2018 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -65,7 +65,7 @@ $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSe trans("Status").' ('.$langs->trans("Buy").')'; ?> -selectarray('statut_buy',$statutarray,$object->status_tobuy); ?> +selectarray('statut_buy',$statutarray,$object->status_buy); ?> stock->enabled)) { ?> diff --git a/htdocs/product/canvas/product/tpl/card_edit.tpl.php b/htdocs/product/canvas/product/tpl/card_edit.tpl.php index 6c13bddb6a1..8210cde95f3 100644 --- a/htdocs/product/canvas/product/tpl/card_edit.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_edit.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2018 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -65,7 +65,7 @@ dol_htmloutput_errors($object->error,$object->errors); trans("Status").' ('.$langs->trans("Buy").')'; ?> -selectarray('statut_buy',$statutarray,$object->status_tobuy); ?> +selectarray('statut_buy',$statutarray,$object->status_buy); ?> stock->enabled)) { ?> diff --git a/htdocs/product/canvas/product/tpl/card_view.tpl.php b/htdocs/product/canvas/product/tpl/card_view.tpl.php index 921cef87200..61964399e1c 100644 --- a/htdocs/product/canvas/product/tpl/card_view.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_view.tpl.php @@ -63,16 +63,6 @@ dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref'); - -trans("Status").' ('.$langs->trans("Sell").')'; ?> -status; ?> - - - -trans("Status").' ('.$langs->trans("Buy").')'; ?> -status_buy; ?> - - trans("Description"); ?> description; ?> diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index 4758f0de08a..827360a7e9d 100644 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -122,20 +122,6 @@ class ActionsCardService $this->tpl['tva_tx'] = $form->load_tva("tva_tx",-1,$mysoc,''); } - if ($action == 'create' || $action == 'edit') - { - // Status - $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell")); - $this->tpl['status'] = $form->selectarray('statut',$statutarray,$this->status); - - //To Buy - $statutarray=array('1' => $langs->trans("Yes"), '0' => $langs->trans("No")); - $this->tpl['tobuy'] = $form->selectarray('tobuy',$statutarray,$this->status_buy); - - $this->tpl['description'] = $this->description; - $this->tpl['note'] = $this->note; - } - if ($action == 'view') { $head = product_prepare_head($this->object); @@ -182,10 +168,13 @@ class ActionsCardService { // Status $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell")); - $this->tpl['status'] = $form->selectarray('statut',$statutarray,$_POST["statut"]); + $this->tpl['status'] = $form->selectarray('statut',$statutarray,$this->object->status); $statutarray=array('1' => $langs->trans("ProductStatusOnBuy"), '0' => $langs->trans("ProductStatusNotOnBuy")); - $this->tpl['status_buy'] = $form->selectarray('statut_buy',$statutarray,$_POST["statut_buy"]); + $this->tpl['status_buy'] = $form->selectarray('statut_buy',$statutarray,$this->object->status_buy); + + $this->tpl['description'] = $this->description; + $this->tpl['note'] = $this->note; // Duration unit // TODO creer fonction @@ -203,10 +192,6 @@ class ActionsCardService if ($action == 'view') { - // Status - $this->tpl['status'] = $this->object->getLibStatut(2,0); - $this->tpl['status_buy'] = $this->object->getLibStatut(2,1); - // Photo $this->tpl['nblignes'] = 4; if ($this->object->is_photo_available($conf->service->multidir_output[$this->object->entity])) diff --git a/htdocs/product/canvas/service/tpl/card_create.tpl.php b/htdocs/product/canvas/service/tpl/card_create.tpl.php index b9dc10fd5dc..443e9ee7401 100644 --- a/htdocs/product/canvas/service/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/service/tpl/card_create.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2018 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -62,7 +62,7 @@ $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSe trans("Status").' ('.$langs->trans("Buy").')'; ?> -selectarray('statut_buy',$statutarray,$object->status_tobuy); ?> +selectarray('statut_buy',$statutarray,$object->status_buy); ?> trans("Duration"); ?> diff --git a/htdocs/product/canvas/service/tpl/card_edit.tpl.php b/htdocs/product/canvas/service/tpl/card_edit.tpl.php index 6fc3bf3273a..ccbe1131120 100644 --- a/htdocs/product/canvas/service/tpl/card_edit.tpl.php +++ b/htdocs/product/canvas/service/tpl/card_edit.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2018 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -62,7 +62,7 @@ dol_htmloutput_errors($object->error,$object->errors); trans("Status").' ('.$langs->trans("Buy").')'; ?> -selectarray('statut_buy',$statutarray,$object->status_tobuy); ?> +selectarray('statut_buy',$statutarray,$object->status_buy); ?> trans("Duration"); ?> diff --git a/htdocs/product/canvas/service/tpl/card_view.tpl.php b/htdocs/product/canvas/service/tpl/card_view.tpl.php index 0ce5252b053..5826d78583f 100644 --- a/htdocs/product/canvas/service/tpl/card_view.tpl.php +++ b/htdocs/product/canvas/service/tpl/card_view.tpl.php @@ -63,16 +63,6 @@ dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref'); - -trans("Status").' ('.$langs->trans("Sell").')'; ?> -status; ?> - - - -trans("Status").' ('.$langs->trans("Buy").')'; ?> -status_buy; ?> - - trans("Description"); ?> description; ?>