Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2019-03-16 14:48:50 +01:00
commit 0ecdb246e8
2 changed files with 70 additions and 79 deletions

View File

@ -63,7 +63,7 @@ class AccountancyCategory // extends CommonObject
public $id;
/**
* @var mixed Sample property 1
* @var string Accountancy code
*/
public $code;
@ -73,7 +73,7 @@ class AccountancyCategory // extends CommonObject
public $label;
/**
* @var mixed Sample property 1
* @var string Accountancy range account
*/
public $range_account;
@ -83,37 +83,37 @@ class AccountancyCategory // extends CommonObject
public $sens;
/**
* @var mixed Sample property 1
* @var int Category type of accountancy
*/
public $category_type;
/**
* @var mixed Sample property 1
* @var string Formula
*/
public $formula;
/**
* @var mixed Sample property 1
* @var int Position
*/
public $position;
/**
* @var mixed Sample property 1
* @var int country id
*/
public $fk_country;
/**
* @var mixed Sample property 1
* @var int Is active
*/
public $active;
/**
* @var mixed Sample property 1
* @var array Lines cptbk
*/
public $lines_cptbk;
/**
* @var mixed Sample property 1
* @var array Lines display
*/
public $lines_display;
@ -151,12 +151,12 @@ class AccountancyCategory // extends CommonObject
if (isset($this->code)) $this->code=trim($this->code);
if (isset($this->label)) $this->label=trim($this->label);
if (isset($this->range_account)) $this->range_account=trim($this->range_account);
if (isset($this->sens)) $this->sens=trim($this->sens);
if (isset($this->category_type)) $this->category_type=trim($this->category_type);
if (isset($this->sens)) $this->sens = (int) $this->sens;
if (isset($this->category_type)) $this->category_type = (int) $this->category_type;
if (isset($this->formula)) $this->formula=trim($this->formula);
if (isset($this->position)) $this->position=trim($this->position);
if (isset($this->fk_country)) $this->fk_country=trim($this->fk_country);
if (isset($this->active)) $this->active=trim($this->active);
if (isset($this->position)) $this->position = (int) $this->position;
if (isset($this->fk_country)) $this->fk_country = (int) $this->fk_country;
if (isset($this->active)) $this->active = (int) $this->active;
// Check parameters
// Put here code to add control on parameters values
@ -308,12 +308,12 @@ class AccountancyCategory // extends CommonObject
if (isset($this->code)) $this->code=trim($this->code);
if (isset($this->label)) $this->label=trim($this->label);
if (isset($this->range_account)) $this->range_account=trim($this->range_account);
if (isset($this->sens)) $this->sens=trim($this->sens);
if (isset($this->category_type)) $this->category_type=trim($this->category_type);
if (isset($this->sens)) $this->sens = (int) $this->sens;
if (isset($this->category_type)) $this->category_type = (int) $this->category_type;
if (isset($this->formula)) $this->formula=trim($this->formula);
if (isset($this->position)) $this->position=trim($this->position);
if (isset($this->fk_country)) $this->fk_country=trim($this->fk_country);
if (isset($this->active)) $this->active=trim($this->active);
if (isset($this->position)) $this->position = (int) $this->position;
if (isset($this->fk_country)) $this->fk_country = (int) $this->fk_country;
if (isset($this->active)) $this->active = (int) $this->active;
// Check parameters
@ -338,8 +338,8 @@ class AccountancyCategory // extends CommonObject
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error)
{
//if (! $error)
//{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
//if (! $notrigger)
@ -351,7 +351,7 @@ class AccountancyCategory // extends CommonObject
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
//}
}
//}
// Commit or rollback
if ($error)
@ -393,8 +393,8 @@ class AccountancyCategory // extends CommonObject
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error)
{
//if (! $error)
//{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
//if (! $notrigger)
@ -406,7 +406,7 @@ class AccountancyCategory // extends CommonObject
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
//}
}
//}
// Commit or rollback
if ($error)

View File

@ -1,20 +1,21 @@
<?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2006 Auguria SARL <info@auguria.org>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2011-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2014 Cédric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2014-2015 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2016 Meziane Sof <virtualsof@yahoo.fr>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2006 Auguria SARL <info@auguria.org>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2013 Cédric Salvador <csalvador@gpcsolutions.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-2015 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* 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>
*
* This program is free software; you can redistribute it and/or modify
@ -1020,21 +1021,12 @@ else
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
if ($type == 1)
{
print '<tr><td>' . $langs->trans("Duration") . '</td><td colspan="3"><input name="duration_value" size="6" maxlength="5" value="' . $duration_value . '"> &nbsp;';
print '<input name="duration_unit" type="radio" value="i">'.$langs->trans("Minute").'&nbsp;';
print '<input name="duration_unit" type="radio" value="h">'.$langs->trans("Hour").'&nbsp;';
print '<input name="duration_unit" type="radio" value="h">'.$langs->trans("Hour").'&nbsp;';
print '<input name="duration_unit" type="radio" value="d">'.$langs->trans("Day").'&nbsp;';
print '<input name="duration_unit" type="radio" value="w">'.$langs->trans("Week").'&nbsp;';
print '<input name="duration_unit" type="radio" value="m">'.$langs->trans("Month").'&nbsp;';
@ -1042,8 +1034,14 @@ else
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
print '<tr><td>'.$langs->trans("Weight").'</td><td colspan="3">';
print '<input name="weight" size="4" value="'.GETPOST('weight').'">';
@ -1375,7 +1373,7 @@ else
// Public Url
print '<tr><td>'.$langs->trans("PublicUrl").'</td><td colspan="3">';
print '<input type="text" name="url" class="quatrevingtpercent" value="'.$object->url.'">';
print '<input type="text" name="url" class="quatrevingtpercent" value="'.$object->url.'">';
print '</td></tr>';
// Stock
@ -1403,22 +1401,13 @@ else
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())
{
// Duration
print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3"><input name="duration_value" size="3" maxlength="5" value="'.$object->duration_value.'">';
print '&nbsp; ';
print '<input name="duration_unit" type="radio" value="i"'.($object->duration_unit=='i'?' checked':'').'>'.$langs->trans("Minute");
print '&nbsp; ';
print '&nbsp; ';
print '<input name="duration_unit" type="radio" value="h"'.($object->duration_unit=='h'?' checked':'').'>'.$langs->trans("Hour");
print '&nbsp; ';
print '<input name="duration_unit" type="radio" value="d"'.($object->duration_unit=='d'?' checked':'').'>'.$langs->trans("Day");
@ -1431,7 +1420,13 @@ else
print '</td></tr>';
}
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
print '<tr><td>'.$langs->trans("Weight").'</td><td colspan="3">';
print '<input name="weight" size="5" value="'.$object->weight.'"> ';
@ -1439,13 +1434,13 @@ else
print '</td></tr>';
if (empty($conf->global->PRODUCT_DISABLE_SIZE))
{
// Length
print '<tr><td>'.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").'</td><td colspan="3">';
print '<input name="size" size="5" value="'.$object->length.'">x';
print '<input name="sizewidth" size="5" value="'.$object->width.'">x';
print '<input name="sizeheight" size="5" value="'.$object->height.'"> ';
print $formproduct->select_measuring_units("size_units", "size", $object->length_units);
print '</td></tr>';
// Length
print '<tr><td>'.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").'</td><td colspan="3">';
print '<input name="size" size="5" value="'.$object->length.'">x';
print '<input name="sizewidth" size="5" value="'.$object->width.'">x';
print '<input name="sizeheight" size="5" value="'.$object->height.'"> ';
print $formproduct->select_measuring_units("size_units", "size", $object->length_units);
print '</td></tr>';
}
if (empty($conf->global->PRODUCT_DISABLE_SURFACE))
{
@ -1823,14 +1818,6 @@ else
print '<div class="underbanner clearboth"></div>';
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())
{
// Duration
@ -1849,6 +1836,10 @@ else
}
else
{
// Nature
print '<tr><td class="titlefield">'.$langs->trans("Nature").'</td><td colspan="2">';
print $object->getLibFinished();
print '</td></tr>';
// Weight
print '<tr><td class="titlefield">'.$langs->trans("Weight").'</td><td colspan="2">';
if ($object->weight != '')
@ -1920,7 +1911,7 @@ else
}
// Custom code
if (! $object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO))
if (! $object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO))
{
print '<tr><td>'.$langs->trans("CustomCode").'</td><td colspan="2">'.$object->customcode.'</td>';