Merge remote-tracking branch 'origin/3.6' into 3.7

Conflicts:
	htdocs/langs/en_US/users.lang
	htdocs/product/stock/class/mouvementstock.class.php
This commit is contained in:
Laurent Destailleur 2015-12-03 12:51:49 +01:00
commit 7105fabb79
4 changed files with 19 additions and 7 deletions

View File

@ -572,7 +572,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR')
if ((($timestampEnd - $timestampStart) % 86400) != 0) return 'ErrorDates must use same hours and must be GMT dates'; if ((($timestampEnd - $timestampStart) % 86400) != 0) return 'ErrorDates must use same hours and must be GMT dates';
$i=0; $i=0;
while ($timestampStart < $timestampEnd && ($i < 50000)) // Loop end when equals (Test on i is a security loop to avoid infinite loop) while ($timestampStart <= $timestampEnd && ($i < 50000)) // Loop end when equals (Test on i is a security loop to avoid infinite loop)
{ {
$ferie=false; $ferie=false;
$countryfound=0; $countryfound=0;

View File

@ -120,3 +120,4 @@ OpenIDURL=OpenID URL
LoginUsingOpenID=Use OpenID to login LoginUsingOpenID=Use OpenID to login
WeeklyHours=Weekly hours WeeklyHours=Weekly hours
ColorUser=Color of the user ColorUser=Color of the user
DisabledInMonoUserMode=Disabled in maintenance mode

View File

@ -497,7 +497,15 @@ class MouvementStock extends CommonObject
} }
function get_origin($fk_origin, $origintype) { /**
* Return Url link of origin object
*
* @param int $fk_origin Id origin
* @param int $origintype Type origin
* @return string
*/
function get_origin($fk_origin, $origintype)
{
switch ($origintype) { switch ($origintype) {
case 'commande': case 'commande':
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
@ -525,7 +533,10 @@ class MouvementStock extends CommonObject
break; break;
} }
$origin->fetch($fk_origin); if ($origin->fetch($fk_origin) > 0) {
return $origin->getNomUrl(1); return $origin->getNomUrl(1);
} }
return '';
}
} }

View File

@ -2413,7 +2413,7 @@ class Societe extends CommonObject
} }
//Verify duplicate entries //Verify duplicate entries
$sql = "SELECT COUNT(*) as idprof FROM ".MAIN_DB_PREFIX."societe WHERE ".$field." = '".$value."'"; $sql = "SELECT COUNT(*) as idprof FROM ".MAIN_DB_PREFIX."societe WHERE ".$field." = '".$value."' AND entity IN (".getEntity('societe',1).")";
if($socid) $sql .= " AND rowid <> ".$socid; if($socid) $sql .= " AND rowid <> ".$socid;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)