Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
da64d4d398
@ -151,6 +151,9 @@ Dolibarr better:
|
|||||||
no more required, were also removed. Use this new one if you were using one of them.
|
no more required, were also removed. Use this new one if you were using one of them.
|
||||||
- The trigger that activate or close a contract line is run on a contract line, not on contract.
|
- The trigger that activate or close a contract line is run on a contract line, not on contract.
|
||||||
|
|
||||||
|
Dolibarr 5.0 was frozen before PHP 7.1 was released. Unit tests are successful on PHP 7.1 but we don't have enough
|
||||||
|
feedback to confirm all application is compatible. Current officiel supported PHP versions are PHP 5.3 to 7.0.
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 4.0.3 to 4.0.2 *****
|
***** ChangeLog for 4.0.3 to 4.0.2 *****
|
||||||
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
|
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
|
||||||
|
|||||||
@ -197,9 +197,10 @@ function checkBanForAccount($account)
|
|||||||
$rib = strtr($rib, "abcdefghijklmnopqrstuvwxyz", "12345678912345678923456789");
|
$rib = strtr($rib, "abcdefghijklmnopqrstuvwxyz", "12345678912345678923456789");
|
||||||
// Separation du rib en 3 groupes de 7 + 1 groupe de 2.
|
// Separation du rib en 3 groupes de 7 + 1 groupe de 2.
|
||||||
// Multiplication de chaque groupe par les coef du tableau
|
// Multiplication de chaque groupe par les coef du tableau
|
||||||
|
var_dump($rib);
|
||||||
for ($i = 0, $s = 0; $i < 3; $i++) {
|
for ($i = 0, $s = 0; $i < 3; $i++) {
|
||||||
$code = substr($rib, 7 * $i, 7);
|
$code = substr($rib, 7 * $i, 7);
|
||||||
$s += (0 + $code) * $coef[$i];
|
$s += (0 + (int) $code) * $coef[$i];
|
||||||
}
|
}
|
||||||
// Soustraction du modulo 97 de $s a 97 pour obtenir la cle
|
// Soustraction du modulo 97 de $s a 97 pour obtenir la cle
|
||||||
$cle_rib = 97 - ($s % 97);
|
$cle_rib = 97 - ($s % 97);
|
||||||
|
|||||||
@ -175,7 +175,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
|
|||||||
|
|
||||||
$sTime='';
|
$sTime='';
|
||||||
$sDay=0;
|
$sDay=0;
|
||||||
$sWeek='';
|
$sWeek=0;
|
||||||
|
|
||||||
if ($iSecond >= $lengthOfDay)
|
if ($iSecond >= $lengthOfDay)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -80,6 +80,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
|
|||||||
$result=array();
|
$result=array();
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
|
if (empty($info_bits)) $info_bits=0;
|
||||||
if (empty($txtva)) $txtva=0;
|
if (empty($txtva)) $txtva=0;
|
||||||
if (empty($seller) || ! is_object($seller))
|
if (empty($seller) || ! is_object($seller))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -869,7 +869,7 @@ class Holiday extends CommonObject
|
|||||||
{
|
{
|
||||||
$sql = "SELECT value";
|
$sql = "SELECT value";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_config";
|
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_config";
|
||||||
$sql.= " WHERE name = '".$name."'";
|
$sql.= " WHERE name = '".$this->db->escape($name)."'";
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::getConfCP name='.$name.' createifnotfound='.$createifnotfound, LOG_DEBUG);
|
dol_syslog(get_class($this).'::getConfCP name='.$name.' createifnotfound='.$createifnotfound, LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@ -883,7 +883,7 @@ class Holiday extends CommonObject
|
|||||||
if ($createifnotfound)
|
if ($createifnotfound)
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday_config(name, value)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday_config(name, value)";
|
||||||
$sql.= " VALUES('".$name."', '".$createifnotfound."')";
|
$sql.= " VALUES('".$this->db->escape($name)."', '".$this->db->escape($createifnotfound)."')";
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
@ -948,7 +948,7 @@ class Holiday extends CommonObject
|
|||||||
$nbUser = count($users);
|
$nbUser = count($users);
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
|
||||||
$sql.= " value = '".$newdateforlastupdate."'";
|
$sql.= " value = '".$this->db->escape($newdateforlastupdate)."'";
|
||||||
$sql.= " WHERE name = 'lastUpdate'";
|
$sql.= " WHERE name = 'lastUpdate'";
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
@ -1635,6 +1635,7 @@ class Holiday extends CommonObject
|
|||||||
$this->date_fin=dol_now()+(24*3600);
|
$this->date_fin=dol_now()+(24*3600);
|
||||||
$this->fk_validator=1;
|
$this->fk_validator=1;
|
||||||
$this->halfday=0;
|
$this->halfday=0;
|
||||||
|
$this->fk_type=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1909,10 +1909,9 @@ class Societe extends CommonObject
|
|||||||
if (! empty($conf->accounting->enabled) && $this->fournisseur)
|
if (! empty($conf->accounting->enabled) && $this->fournisseur)
|
||||||
$label.= '<br><b>' . $langs->trans('SupplierAccountancyCode') . ':</b> '. $this->code_compta_fournisseur;
|
$label.= '<br><b>' . $langs->trans('SupplierAccountancyCode') . ':</b> '. $this->code_compta_fournisseur;
|
||||||
|
|
||||||
if (! empty($this->logo))
|
if (! empty($this->logo) && class_exists('Form'))
|
||||||
{
|
{
|
||||||
$label.= '</br><div class="photointooltip">';
|
$label.= '</br><div class="photointooltip">';
|
||||||
//if (! is_object($form)) $form = new Form($db);
|
|
||||||
$label.= Form::showphoto('societe', $this, 80, 0, 0, 'photowithmargin', 'mini');
|
$label.= Form::showphoto('societe', $this, 80, 0, 0, 'photowithmargin', 'mini');
|
||||||
$label.= '</div><div style="clear: both;"></div>';
|
$label.= '</div><div style="clear: both;"></div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1090,9 +1090,9 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||||||
// Categories
|
// Categories
|
||||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
||||||
{
|
{
|
||||||
print '<tr><td>' . fieldLabel( 'Categories', 'usercats' ) . '</td><td colspan="3">';
|
print '<tr><td>' . fieldLabel('Categories', 'usercats') . '</td><td colspan="3">';
|
||||||
$cate_arbo = $form->select_all_categories( Categorie::TYPE_USER, null, 'parent', null, null, 1 );
|
$cate_arbo = $form->select_all_categories('user', null, 'parent', null, null, 1);
|
||||||
print $form->multiselectarray( 'usercats', $cate_arbo, GETPOST( 'usercats', 'array' ), null, null, null,
|
print $form->multiselectarray('usercats', $cate_arbo, GETPOST('usercats', 'array'), null, null, null,
|
||||||
null, '90%' );
|
null, '90%' );
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -330,7 +330,7 @@ class User extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->lasterror();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -138,7 +138,6 @@ class MarginsLibTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals(20,$result[2]);
|
$this->assertEquals(20,$result[2]);
|
||||||
|
|
||||||
$result=getMarginInfos(10, 10, 19.6, 0, 0, 0, 8);
|
$result=getMarginInfos(10, 10, 19.6, 0, 0, 0, 8);
|
||||||
var_dump($result);
|
|
||||||
print __METHOD__." result[0]=".$result[0]."\n";
|
print __METHOD__." result[0]=".$result[0]."\n";
|
||||||
$this->assertEquals(8,$result[0]);
|
$this->assertEquals(8,$result[0]);
|
||||||
print __METHOD__." result[1]=".$result[1]."\n";
|
print __METHOD__." result[1]=".$result[1]."\n";
|
||||||
|
|||||||
@ -154,7 +154,7 @@ class WebservicesUserTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
// Test URL
|
// Test URL
|
||||||
$result='';
|
$result='';
|
||||||
$parameters = array('authentication'=>$authentication,'ref'=>'admin');
|
$parameters = array('authentication'=>$authentication,'id'=>0,'ref'=>'admin');
|
||||||
print __METHOD__."Call method ".$WS_METHOD."\n";
|
print __METHOD__."Call method ".$WS_METHOD."\n";
|
||||||
try {
|
try {
|
||||||
$result = $soapclient->call($WS_METHOD,$parameters,$ns,'');
|
$result = $soapclient->call($WS_METHOD,$parameters,$ns,'');
|
||||||
@ -177,11 +177,11 @@ class WebservicesUserTest extends PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertEquals('OK',$result['result']['result_code']);
|
$this->assertEquals('OK', $result['result']['result_code'], 'Test on ref admin');
|
||||||
|
|
||||||
// Test URL
|
// Test URL
|
||||||
$result='';
|
$result='';
|
||||||
$parameters = array('authentication'=>$authentication,'ref'=>'refthatdoesnotexists');
|
$parameters = array('authentication'=>$authentication,'id'=>0,'ref'=>'refthatdoesnotexists');
|
||||||
print __METHOD__."Call method ".$WS_METHOD."\n";
|
print __METHOD__."Call method ".$WS_METHOD."\n";
|
||||||
try {
|
try {
|
||||||
$result = $soapclient->call($WS_METHOD,$parameters,$ns,'');
|
$result = $soapclient->call($WS_METHOD,$parameters,$ns,'');
|
||||||
@ -200,7 +200,7 @@ class WebservicesUserTest extends PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertEquals('NOT_FOUND',$result['result']['result_code']);
|
$this->assertEquals('NOT_FOUND', $result['result']['result_code'], 'Test on ref that does not exists');
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user