Merge pull request #7411 from joseplluis/patch-1

Fix: Custom info view in services
This commit is contained in:
Laurent Destailleur 2019-03-16 14:23:06 +01:00 committed by GitHub
commit ce8caabd62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,19 +2,20 @@
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2006 Auguria SARL <info@auguria.org> * Copyright (C) 2006 Auguria SARL <info@auguria.org>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013-2016 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2013-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012-2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2011-2019 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2011-2017 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Cédric Gross <c.gross@kreiz-it.fr> * Copyright (C) 2014 Cédric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2014-2015 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2014-2015 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com> * Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2016 Meziane Sof <virtualsof@yahoo.fr> * Copyright (C) 2016 Meziane Sof <virtualsof@yahoo.fr>
* Copyright (C) 2017 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -1020,15 +1021,6 @@ else
print '<input name="desiredstock" type="hidden" value="0">'; print '<input name="desiredstock" type="hidden" value="0">';
} }
// Nature
if ($type != 1)
{
print '<tr><td>'.$langs->trans("Nature").'</td><td colspan="3">';
$statutarray=array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial"));
print $form->selectarray('finished', $statutarray, GETPOST('finished'), 1);
print '</td></tr>';
}
// Duration // Duration
if ($type == 1) if ($type == 1)
{ {
@ -1042,8 +1034,14 @@ else
print '</td></tr>'; print '</td></tr>';
} }
if ($type != 1) // Le poids et le volume ne concerne que les produits et pas les services if ($type != 1) // Nature, Weight and volume only applies to products and not to services
{ {
// Nature
print '<tr><td>'.$langs->trans("Nature").'</td><td colspan="3">';
$statutarray=array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial"));
print $form->selectarray('finished', $statutarray, GETPOST('finished','alpha'), 1);
print '</td></tr>';
// Weight // Weight
print '<tr><td>'.$langs->trans("Weight").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Weight").'</td><td colspan="3">';
print '<input name="weight" size="4" value="'.GETPOST('weight').'">'; print '<input name="weight" size="4" value="'.GETPOST('weight').'">';
@ -1403,15 +1401,6 @@ else
print '<input name="desiredstock" type="hidden" value="'.$object->desiredstock.'">'; print '<input name="desiredstock" type="hidden" value="'.$object->desiredstock.'">';
}*/ }*/
// Nature
if($object->type!= Product::TYPE_SERVICE)
{
print '<tr><td>'.$langs->trans("Nature").'</td><td colspan="3">';
$statutarray=array('-1'=>'&nbsp;', '1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial"));
print $form->selectarray('finished', $statutarray, $object->finished);
print '</td></tr>';
}
if ($object->isService()) if ($object->isService())
{ {
// Duration // Duration
@ -1432,6 +1421,12 @@ else
} }
else else
{ {
// Nature
print '<tr><td>'.$langs->trans("Nature").'</td><td colspan="3">';
$statutarray=array('-1'=>'&nbsp;', '1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial"));
print $form->selectarray('finished' ,$statutarray, $object->finished);
print '</td></tr>';
// Weight // Weight
print '<tr><td>'.$langs->trans("Weight").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Weight").'</td><td colspan="3">';
print '<input name="weight" size="5" value="'.$object->weight.'"> '; print '<input name="weight" size="5" value="'.$object->weight.'"> ';
@ -1823,14 +1818,6 @@ else
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">'; print '<table class="border tableforfield" width="100%">';
// Nature
if($object->type!= Product::TYPE_SERVICE)
{
print '<tr><td class="titlefield">'.$langs->trans("Nature").'</td><td colspan="2">';
print $object->getLibFinished();
print '</td></tr>';
}
if ($object->isService()) if ($object->isService())
{ {
// Duration // Duration
@ -1849,6 +1836,10 @@ else
} }
else else
{ {
// Nature
print '<tr><td class="titlefield">'.$langs->trans("Nature").'</td><td colspan="2">';
print $object->getLibFinished();
print '</td></tr>';
// Weight // Weight
print '<tr><td class="titlefield">'.$langs->trans("Weight").'</td><td colspan="2">'; print '<tr><td class="titlefield">'.$langs->trans("Weight").'</td><td colspan="2">';
if ($object->weight != '') if ($object->weight != '')