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

Conflicts:
	htdocs/admin/bank.php
	htdocs/core/lib/functions.lib.php
This commit is contained in:
Laurent Destailleur
2017-08-23 17:02:53 +02:00
40 changed files with 320 additions and 166 deletions

View File

@@ -190,8 +190,9 @@ function getBrowserInfo($user_agent)
}
// OS
if (preg_match('/linux/i', $user_agent)) { $os='linux'; }
if (preg_match('/linux/i', $user_agent)) { $os='linux'; }
elseif (preg_match('/macintosh/i', $user_agent)) { $os='macintosh'; }
elseif (preg_match('/windows/i', $user_agent)) { $os='windows'; }
// Name
if (preg_match('/firefox(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='firefox'; $version=$reg[2]; }
@@ -201,7 +202,8 @@ function getBrowserInfo($user_agent)
elseif (preg_match('/epiphany/i', $user_agent)) { $name='epiphany'; }
elseif (preg_match('/safari(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='safari'; $version=$reg[2]; } // Safari is often present in string for mobile but its not.
elseif (preg_match('/opera(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='opera'; $version=$reg[2]; }
elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];\srv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end
elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];.*rv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end
elseif (preg_match('/(Windows NT\s([0-9]+\.[0-9])).*(Trident\/[0-9]+.[0-9];.*rv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end
elseif (preg_match('/l(i|y)n(x|ks)(\(|\/|\s)*([\d\.]+)/i', $user_agent, $reg)) { $name='lynxlinks'; $version=$reg[4]; }
if ($tablet) {
@@ -1190,10 +1192,10 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$nophoto='';
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"></div>';
}
elseif ($conf->browser->layout != 'phone') { // Show no photo link
//elseif ($conf->browser->layout != 'phone') { // Show no photo link
$nophoto='/public/theme/common/nophoto.png';
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').' src="'.DOL_URL_ROOT.$nophoto.'"></div>';
}
//}
}
}
else
@@ -1270,7 +1272,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
}
}
if (! $phototoshow && $conf->browser->layout != 'phone') // Show No photo link (picto of pbject)
if (! $phototoshow) // Show No photo link (picto of pbject)
{
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">';
if ($object->element == 'action')
@@ -1288,6 +1290,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
}
$morehtmlleft.='<!-- No photo to show -->';
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').' src="'.$nophoto.'"></div></div>';
$morehtmlleft.='</div>';
}
}
@@ -6454,7 +6457,7 @@ function dol_mimetype($file,$default='application/octet-stream',$mode=0)
/**
* Return value from dictionary
*
*
* @param string $tablename name of dictionary
* @param string $field the value to return
* @param int $id id of line
@@ -6464,13 +6467,13 @@ function dol_mimetype($file,$default='application/octet-stream',$mode=0)
function getDictvalue($tablename, $field, $id, $checkentity=false, $rowidfield='rowid')
{
global $dictvalues,$db,$langs;
if (!isset($dictvalues[$tablename]))
{
$dictvalues[$tablename] = array();
$sql = 'SELECT * FROM '.$tablename.' WHERE 1';
if ($checkentity) $sql.= ' entity IN (0,'.getEntity('').')';
$resql = $db->query($sql);
if ($resql)
{
@@ -6484,7 +6487,7 @@ function getDictvalue($tablename, $field, $id, $checkentity=false, $rowidfield='
dol_print_error($db);
}
}
if (!empty($dictvalues[$tablename][$id])) return $dictvalues[$tablename][$id]->{$field}; // Found
else // Not found
{