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

This commit is contained in:
Laurent Destailleur 2017-01-16 10:58:45 +01:00
commit da64d4d398
10 changed files with 22 additions and 18 deletions

View File

@ -151,6 +151,9 @@ Dolibarr better:
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.
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 *****
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1

View File

@ -197,9 +197,10 @@ function checkBanForAccount($account)
$rib = strtr($rib, "abcdefghijklmnopqrstuvwxyz", "12345678912345678923456789");
// Separation du rib en 3 groupes de 7 + 1 groupe de 2.
// Multiplication de chaque groupe par les coef du tableau
var_dump($rib);
for ($i = 0, $s = 0; $i < 3; $i++) {
$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
$cle_rib = 97 - ($s % 97);

View File

@ -175,7 +175,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
$sTime='';
$sDay=0;
$sWeek='';
$sWeek=0;
if ($iSecond >= $lengthOfDay)
{
@ -218,7 +218,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
}
if ($format == 'allhourmin')
{
return sprintf("%02d",($sWeek*$lengthOfWeek*24 + $sDay*24 + (int) floor($iSecond/3600))).':'.sprintf("%02d",((int) floor(($iSecond % 3600)/60)));
return sprintf("%02d",($sWeek*$lengthOfWeek*24 + $sDay*24 + (int) floor($iSecond/3600))).':'.sprintf("%02d",((int) floor(($iSecond % 3600)/60)));
}
if ($format == 'allhour')
{

View File

@ -80,6 +80,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
$result=array();
// Clean parameters
if (empty($info_bits)) $info_bits=0;
if (empty($txtva)) $txtva=0;
if (empty($seller) || ! is_object($seller))
{

View File

@ -282,7 +282,7 @@ class Holiday extends CommonObject
$sql = "SELECT";
$sql.= " cp.rowid,";
$sql.= " cp.fk_user,";
$sql.= " cp.date_create,";
$sql.= " cp.description,";
@ -869,7 +869,7 @@ class Holiday extends CommonObject
{
$sql = "SELECT value";
$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);
$result = $this->db->query($sql);
@ -883,7 +883,7 @@ class Holiday extends CommonObject
if ($createifnotfound)
{
$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);
if ($result)
{
@ -948,7 +948,7 @@ class Holiday extends CommonObject
$nbUser = count($users);
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
$sql.= " value = '".$newdateforlastupdate."'";
$sql.= " value = '".$this->db->escape($newdateforlastupdate)."'";
$sql.= " WHERE name = 'lastUpdate'";
$result = $this->db->query($sql);
@ -1635,6 +1635,7 @@ class Holiday extends CommonObject
$this->date_fin=dol_now()+(24*3600);
$this->fk_validator=1;
$this->halfday=0;
$this->fk_type=1;
}
}

View File

@ -1909,10 +1909,9 @@ class Societe extends CommonObject
if (! empty($conf->accounting->enabled) && $this->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">';
//if (! is_object($form)) $form = new Form($db);
$label.= Form::showphoto('societe', $this, 80, 0, 0, 'photowithmargin', 'mini');
$label.= '</div><div style="clear: both;"></div>';
}

View File

@ -1090,9 +1090,9 @@ if (($action == 'create') || ($action == 'adduserldap'))
// Categories
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
print '<tr><td>' . fieldLabel( 'Categories', 'usercats' ) . '</td><td colspan="3">';
$cate_arbo = $form->select_all_categories( Categorie::TYPE_USER, null, 'parent', null, null, 1 );
print $form->multiselectarray( 'usercats', $cate_arbo, GETPOST( 'usercats', 'array' ), null, null, null,
print '<tr><td>' . fieldLabel('Categories', 'usercats') . '</td><td colspan="3">';
$cate_arbo = $form->select_all_categories('user', null, 'parent', null, null, 1);
print $form->multiselectarray('usercats', $cate_arbo, GETPOST('usercats', 'array'), null, null, null,
null, '90%' );
print "</td></tr>";
}

View File

@ -330,7 +330,7 @@ class User extends CommonObject
}
else
{
$this->error=$this->db->error();
$this->error=$this->db->lasterror();
return -1;
}

View File

@ -138,7 +138,6 @@ class MarginsLibTest extends PHPUnit_Framework_TestCase
$this->assertEquals(20,$result[2]);
$result=getMarginInfos(10, 10, 19.6, 0, 0, 0, 8);
var_dump($result);
print __METHOD__." result[0]=".$result[0]."\n";
$this->assertEquals(8,$result[0]);
print __METHOD__." result[1]=".$result[1]."\n";

View File

@ -154,7 +154,7 @@ class WebservicesUserTest extends PHPUnit_Framework_TestCase
// Test URL
$result='';
$parameters = array('authentication'=>$authentication,'ref'=>'admin');
$parameters = array('authentication'=>$authentication,'id'=>0,'ref'=>'admin');
print __METHOD__."Call method ".$WS_METHOD."\n";
try {
$result = $soapclient->call($WS_METHOD,$parameters,$ns,'');
@ -177,11 +177,11 @@ class WebservicesUserTest extends PHPUnit_Framework_TestCase
}
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
$result='';
$parameters = array('authentication'=>$authentication,'ref'=>'refthatdoesnotexists');
$parameters = array('authentication'=>$authentication,'id'=>0,'ref'=>'refthatdoesnotexists');
print __METHOD__."Call method ".$WS_METHOD."\n";
try {
$result = $soapclient->call($WS_METHOD,$parameters,$ns,'');
@ -200,7 +200,7 @@ class WebservicesUserTest extends PHPUnit_Framework_TestCase
}
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;
}