Fix: remove duplicate code
This commit is contained in:
parent
ebfd1846a3
commit
5b491a4d57
@ -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]))
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
/* Copyright (C) 2010-2018 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* 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
|
||||
|
||||
<tr>
|
||||
<td class="fieldrequired"><?php echo $langs->trans("Status").' ('.$langs->trans("Buy").')'; ?></td>
|
||||
<td><?php echo $form->selectarray('statut_buy',$statutarray,$object->status_tobuy); ?></td>
|
||||
<td><?php echo $form->selectarray('statut_buy',$statutarray,$object->status_buy); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if (! empty($conf->stock->enabled)) { ?>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
/* Copyright (C) 2010-2018 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* 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);
|
||||
|
||||
<tr>
|
||||
<td class="fieldrequired"><?php echo $langs->trans("Status").' ('.$langs->trans("Buy").')'; ?></td>
|
||||
<td><?php echo $form->selectarray('statut_buy',$statutarray,$object->status_tobuy); ?></td>
|
||||
<td><?php echo $form->selectarray('statut_buy',$statutarray,$object->status_buy); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if (! empty($conf->stock->enabled)) { ?>
|
||||
|
||||
@ -63,16 +63,6 @@ dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("Status").' ('.$langs->trans("Sell").')'; ?></td>
|
||||
<td><?php echo $object->status; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("Status").' ('.$langs->trans("Buy").')'; ?></td>
|
||||
<td><?php echo $object->status_buy; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="tdtop"><?php echo $langs->trans("Description"); ?></td>
|
||||
<td colspan="2"><?php echo $object->description; ?></td>
|
||||
|
||||
@ -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]))
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
/* Copyright (C) 2010-2018 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* 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
|
||||
|
||||
<tr>
|
||||
<td class="fieldrequired"><?php echo $langs->trans("Status").' ('.$langs->trans("Buy").')'; ?></td>
|
||||
<td><?php echo $form->selectarray('statut_buy',$statutarray,$object->status_tobuy); ?></td>
|
||||
<td><?php echo $form->selectarray('statut_buy',$statutarray,$object->status_buy); ?></td>
|
||||
</tr>
|
||||
|
||||
<tr><td><?php echo $langs->trans("Duration"); ?></td>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
/* Copyright (C) 2010-2018 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* 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);
|
||||
|
||||
<tr>
|
||||
<td class="fieldrequired"><?php echo $langs->trans("Status").' ('.$langs->trans("Buy").')'; ?></td>
|
||||
<td><?php echo $form->selectarray('statut_buy',$statutarray,$object->status_tobuy); ?></td>
|
||||
<td><?php echo $form->selectarray('statut_buy',$statutarray,$object->status_buy); ?></td>
|
||||
</tr>
|
||||
|
||||
<tr><td><?php echo $langs->trans("Duration"); ?></td>
|
||||
|
||||
@ -63,16 +63,6 @@ dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("Status").' ('.$langs->trans("Sell").')'; ?></td>
|
||||
<td><?php echo $object->status; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("Status").' ('.$langs->trans("Buy").')'; ?></td>
|
||||
<td><?php echo $object->status_buy; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="tdtop"><?php echo $langs->trans("Description"); ?></td>
|
||||
<td colspan="2"><?php echo $object->description; ?></td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user