Merge remote-tracking branch 'Dolibarr/11.0' into 11

This commit is contained in:
Francis Appels 2020-02-23 17:02:08 +01:00
parent 145caacbea
commit 232f201007
13 changed files with 33 additions and 30 deletions

View File

@ -1156,6 +1156,14 @@ class Facture extends CommonInvoice
$line->date_start = $object->lines[$i]->date_start; $line->date_start = $object->lines[$i]->date_start;
$line->date_end = $object->lines[$i]->date_end; $line->date_end = $object->lines[$i]->date_end;
// Multicurrency
$line->fk_multicurrency = $object->lines[$i]->fk_multicurrency;
$line->multicurrency_code = $object->lines[$i]->multicurrency_code;
$line->multicurrency_subprice = $object->lines[$i]->multicurrency_subprice;
$line->multicurrency_total_ht = $object->lines[$i]->multicurrency_total_ht;
$line->multicurrency_total_tva = $object->lines[$i]->multicurrency_total_tva;
$line->multicurrency_total_ttc = $object->lines[$i]->multicurrency_total_ttc;
$line->fk_fournprice = $object->lines[$i]->fk_fournprice; $line->fk_fournprice = $object->lines[$i]->fk_fournprice;
$marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht);
$line->pa_ht = $marginInfos[0]; $line->pa_ht = $marginInfos[0];
@ -1170,6 +1178,7 @@ class Facture extends CommonInvoice
$this->socid = $object->socid; $this->socid = $object->socid;
$this->fk_project = $object->fk_project; $this->fk_project = $object->fk_project;
$this->fk_account = $object->fk_account;
$this->cond_reglement_id = $object->cond_reglement_id; $this->cond_reglement_id = $object->cond_reglement_id;
$this->mode_reglement_id = $object->mode_reglement_id; $this->mode_reglement_id = $object->mode_reglement_id;
$this->availability_id = $object->availability_id; $this->availability_id = $object->availability_id;

View File

@ -1401,7 +1401,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
foreach ($tblcateg as $cate) foreach ($tblcateg as $cate)
{ {
// Adding the descriptions if they are filled // Adding the descriptions if they are filled
$desccateg = $cate->add_description; $desccateg = $cate->description;
if ($desccateg) if ($desccateg)
$libelleproduitservice .= '__N__'.$desccateg; $libelleproduitservice .= '__N__'.$desccateg;
} }

View File

@ -1320,9 +1320,9 @@ class Cronjob extends CommonObject
if ($processing) $moretext = ' ('.$langs->trans("Running").')'; if ($processing) $moretext = ' ('.$langs->trans("Running").')';
elseif ($lastresult) $moretext .= ' ('.$langs->trans("Error").')'; elseif ($lastresult) $moretext .= ' ('.$langs->trans("Error").')';
$this->labelStatus[self::STATUS_DISABLED] = $langs->trans('Draft').$moretext; $this->labelStatus[self::STATUS_DISABLED] = $langs->trans('Disabled').$moretext;
$this->labelStatus[self::STATUS_ENABLED] = $langs->trans('Enabled').$moretext; $this->labelStatus[self::STATUS_ENABLED] = $langs->trans('Enabled').$moretext;
$this->labelStatusShort[self::STATUS_DISABLED] = $langs->trans('Draft'); $this->labelStatusShort[self::STATUS_DISABLED] = $langs->trans('Disabled');
$this->labelStatusShort[self::STATUS_ENABLED] = $langs->trans('Enabled'); $this->labelStatusShort[self::STATUS_ENABLED] = $langs->trans('Enabled');
} }

View File

@ -263,12 +263,6 @@ class AutoLoader
* @return bool false unless className now exists * @return bool false unless className now exists
*/ */
private function loadLastResort($className, $loader = null) { private function loadLastResort($className, $loader = null) {
// @CHANGE LDR Add protection to avoid conflict with other autoloader
/*print 'Try to load '.$className."\n";
if (in_array($className, array('Google_Client')))
{
return false;
}*/
$loaders = array_unique(static::$rogueLoaders); $loaders = array_unique(static::$rogueLoaders);
if (isset($loader)) { if (isset($loader)) {
if (false === array_search($loader, $loaders)) if (false === array_search($loader, $loaders))

View File

@ -159,7 +159,7 @@ class CommentParser
$addNewline = true; $addNewline = true;
} }
continue; continue;
} elseif ($line{0} == '@') { } elseif ($line[0] == '@') {
$mode = 2; $mode = 2;
$newParam = true; $newParam = true;
} }
@ -353,7 +353,7 @@ class CommentParser
$data = $format->decode($str); $data = $format->decode($str);
} }
} else { // auto detect } else { // auto detect
if ($str{0} == '{') { if ($str[0] == '{') {
$d = json_decode($str, true); $d = json_decode($str, true);
if (json_last_error() != JSON_ERROR_NONE) { if (json_last_error() != JSON_ERROR_NONE) {
throw new Exception('Error parsing embedded JSON data' throw new Exception('Error parsing embedded JSON data'
@ -445,7 +445,7 @@ class CommentParser
{ {
$r = array(); $r = array();
$email = end($value); $email = end($value);
if ($email{0} == '<') { if ($email[0] == '<') {
$email = substr($email, 1, -1); $email = substr($email, 1, -1);
array_pop($value); array_pop($value);
$r['email'] = $email; $r['email'] = $email;
@ -470,7 +470,7 @@ class CommentParser
$data = array_shift($value); $data = array_shift($value);
if (empty($data)) { if (empty($data)) {
$r['type'] = 'mixed'; $r['type'] = 'mixed';
} elseif ($data{0} == '$') { } elseif ($data[0] == '$') {
$r['name'] = substr($data, 1); $r['name'] = substr($data, 1);
$r['type'] = 'mixed'; $r['type'] = 'mixed';
} else { } else {
@ -478,7 +478,7 @@ class CommentParser
$r['type'] = count($data) == 1 ? $data[0] : $data; $r['type'] = count($data) == 1 ? $data[0] : $data;
$data = array_shift($value); $data = array_shift($value);
if (!empty($data) && $data{0} == '$') { if (!empty($data) && $data[0] == '$') {
$r['name'] = substr($data, 1); $r['name'] = substr($data, 1);
} }
} }
@ -498,7 +498,7 @@ class CommentParser
$data = array_shift($value); $data = array_shift($value);
if (empty($data)) { if (empty($data)) {
$r['type'] = 'mixed'; $r['type'] = 'mixed';
} elseif ($data{0} == '$') { } elseif ($data[0] == '$') {
$r['name'] = substr($data, 1); $r['name'] = substr($data, 1);
$r['type'] = 'mixed'; $r['type'] = 'mixed';
} else { } else {

View File

@ -221,7 +221,7 @@ class XmlFormat extends Format
$namespaces = $xml->getNamespaces(); $namespaces = $xml->getNamespaces();
if (count($namespaces)) { if (count($namespaces)) {
$p = strpos($data, $xml->getName()); $p = strpos($data, $xml->getName());
if ($p && $data{$p - 1} == ':') { if ($p && $data[$p - 1] == ':') {
$s = strpos($data, '<') + 1; $s = strpos($data, '<') + 1;
$prefix = substr($data, $s, $p - $s - 1); $prefix = substr($data, $s, $p - $s - 1);
static::$namespacedProperties[static::$rootName] = $prefix; static::$namespacedProperties[static::$rootName] = $prefix;

View File

@ -198,7 +198,7 @@ class Resources implements iUseAuthentication, iProvideMultiVersionApi
} elseif (false !== ($pos = strpos($id, '-v'))) { } elseif (false !== ($pos = strpos($id, '-v'))) {
//$version = intval(substr($id, $pos + 2)); //$version = intval(substr($id, $pos + 2));
$id = substr($id, 0, $pos); $id = substr($id, 0, $pos);
} elseif ($id{0} == 'v' && is_numeric($v = substr($id, 1))) { } elseif ($id[0] == 'v' && is_numeric($v = substr($id, 1))) {
$id = ''; $id = '';
//$version = $v; //$version = $v;
} elseif ($id == 'root' || $id == 'index') { } elseif ($id == 'root' || $id == 'index') {
@ -233,7 +233,7 @@ class Resources implements iUseAuthentication, iProvideMultiVersionApi
if ($tSlash) { if ($tSlash) {
if ($fLen != $tLen && !Text::beginsWith($fullPath, $target . '/')) if ($fLen != $tLen && !Text::beginsWith($fullPath, $target . '/'))
continue; continue;
} elseif ($fLen > $tLen + 1 && $fullPath{$tLen + 1} != '{' && !Text::beginsWith($fullPath, '{')) { } elseif ($fLen > $tLen + 1 && $fullPath[$tLen + 1] != '{' && !Text::beginsWith($fullPath, '{')) {
//when mapped to root exclude paths that have static parts //when mapped to root exclude paths that have static parts
//they are listed else where under that static part name //they are listed else where under that static part name
continue; continue;
@ -275,7 +275,7 @@ class Resources implements iUseAuthentication, iProvideMultiVersionApi
if (count($parts) == 1 && $httpMethod == 'GET') { if (count($parts) == 1 && $httpMethod == 'GET') {
} else { } else {
for ($i = 0; $i < count($parts); $i++) { for ($i = 0; $i < count($parts); $i++) {
if (strlen($parts[$i]) && $parts[$i]{0} == '{') { if (strlen($parts[$i]) && $parts[$i][0] == '{') {
$pos = $i - 1; $pos = $i - 1;
break; break;
} }

View File

@ -533,7 +533,7 @@ class Restler extends EventDispatcher
rtrim($path, '/') //remove trailing slash if found rtrim($path, '/') //remove trailing slash if found
); );
if (Defaults::$useUrlBasedVersioning && strlen($path) && $path{0} == 'v') { if (Defaults::$useUrlBasedVersioning && strlen($path) && $path[0] == 'v') {
$version = intval(substr($path, 1)); $version = intval(substr($path, 1));
if ($version && $version <= $this->apiVersion) { if ($version && $version <= $this->apiVersion) {
$this->requestedApiVersion = $version; $this->requestedApiVersion = $version;
@ -1599,7 +1599,7 @@ class Restler extends EventDispatcher
*/ */
public function __get($name) public function __get($name)
{ {
if ($name{0} == '_') { if ($name[0] == '_') {
$hiddenProperty = substr($name, 1); $hiddenProperty = substr($name, 1);
if (isset($this->$hiddenProperty)) { if (isset($this->$hiddenProperty)) {
return $this->$hiddenProperty; return $this->$hiddenProperty;

View File

@ -87,7 +87,7 @@ class Routes
foreach ($methods as $method) { foreach ($methods as $method) {
$methodUrl = strtolower($method->getName()); $methodUrl = strtolower($method->getName());
//method name should not begin with _ //method name should not begin with _
if ($methodUrl{0} == '_') { if ($methodUrl[0] == '_') {
continue; continue;
} }
$doc = $method->getDocComment(); $doc = $method->getDocComment();
@ -330,7 +330,7 @@ class Routes
if (!$type) { if (!$type) {
return 's'; return 's';
} }
switch ($type{0}) { switch ($type[0]) {
case 'i': case 'i':
case 'f': case 'f':
return 'n'; return 'n';
@ -428,7 +428,7 @@ class Routes
} }
$index = intval(substr($k, 1)); $index = intval(substr($k, 1));
$details = $value[$httpMethod]['metadata']['param'][$index]; $details = $value[$httpMethod]['metadata']['param'][$index];
if ($k{0} == 's' || strpos($k, static::pathVarTypeOf($v)) === 0) { if ($k[0] == 's' || strpos($k, static::pathVarTypeOf($v)) === 0) {
//remove the newlines //remove the newlines
$data[$details['name']] = trim($v, PHP_EOL); $data[$details['name']] = trim($v, PHP_EOL);
} else { } else {

View File

@ -203,7 +203,7 @@ class Scope
$divider = '\\'; $divider = '\\';
$qualified = false; $qualified = false;
if ($className{0} == $divider) { if ($className[0] == $divider) {
$qualified = trim($className, $divider); $qualified = trim($className, $divider);
} elseif (array_key_exists($className, $scope)) { } elseif (array_key_exists($className, $scope)) {
$qualified = $scope[$className]; $qualified = $scope[$className];

View File

@ -356,7 +356,7 @@ class Emmet
$pos = strpos($string, $f, $start); $pos = strpos($string, $f, $start);
$tokens = array(); $tokens = array();
for ($i = $start; $i < $pos; $i++) { for ($i = $start; $i < $pos; $i++) {
$token = $string{$i}; $token = $string[$i];
if (('#' == $token || '.' == $token) && if (('#' == $token || '.' == $token) &&
(!empty($tokens) || $i == 0) (!empty($tokens) || $i == 0)
) { ) {
@ -368,7 +368,7 @@ class Emmet
$r[] = $f; $r[] = $f;
} while (false != ($f = strtok(static::DELIMITERS))); } while (false != ($f = strtok(static::DELIMITERS)));
for ($i = $pos; $i < strlen($string); $i++) { for ($i = $pos; $i < strlen($string); $i++) {
$token = $string{$i}; $token = $string[$i];
$r[] = $tokens[] = $token; $r[] = $tokens[] = $token;
} }
return $r; return $r;

View File

@ -606,7 +606,7 @@ foreach ($listofreferent as $key => $value)
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, !empty($project_field)?$project_field:'fk_projet'); $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, !empty($project_field)?$project_field:'fk_projet');
if (count($elementarray)>0 && is_array($elementarray)) if (is_array($elementarray) && count($elementarray) > 0)
{ {
$total_ht = 0; $total_ht = 0;
$total_ttc = 0; $total_ttc = 0;

View File

@ -1297,7 +1297,7 @@ div.fichetwothirdright {
<?php if ($conf->browser->layout == 'phone') { print "padding-bottom: 6px\n"; } ?> <?php if ($conf->browser->layout == 'phone') { print "padding-bottom: 6px\n"; } ?>
} }
div.fichetwothirdright div.ficheaddleft { div.fichetwothirdright div.ficheaddleft {
padding-left: 20px; padding-<?php echo $left; ?>: 20px;
} }
div.fichehalfleft { div.fichehalfleft {
<?php if ($conf->browser->layout != 'phone') { print "float: ".$left.";\n"; } ?> <?php if ($conf->browser->layout != 'phone') { print "float: ".$left.";\n"; } ?>