Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0

Conflicts:
	htdocs/core/lib/pdf.lib.php
This commit is contained in:
Laurent Destailleur 2020-08-23 19:20:50 +02:00
commit 38d53cc03d
2 changed files with 9 additions and 4 deletions

View File

@ -2107,7 +2107,7 @@ function pdf_getTotalQty($object, $type, $outputlangs)
*/
function pdf_getLinkedObjects($object, $outputlangs)
{
global $hookmanager;
global $db, $hookmanager;
$linkedobjects = array();
@ -2174,8 +2174,13 @@ function pdf_getLinkedObjects($object, $outputlangs)
// We concat this record info into fields xxx_value. title is overwrote.
if (empty($object->linkedObjects['commande']) && $object->element != 'commande') // There is not already a link to order and object is not the order, so we show also info with order
{
$elementobject->fetchObjectLinked();
if (!empty($elementobject->linkedObjects['commande'])) $order = reset($elementobject->linkedObjects['commande']);
$elementobject->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0);
if (! empty($elementobject->linkedObjectsIds['commande'])){
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$order = new Commande($db);
$ret = $order->fetch(reset($elementobject->linkedObjectsIds['commande']));
if ($ret < 1) { $order=null; }
}
}
if (!is_object($order))
{

View File

@ -242,7 +242,7 @@ class DoliStorage implements TokenStorageInterface
$sql.= " WHERE service='".$this->db->escape($service)."'";
$resql = $this->db->query($sql);
$result = $this->db->fetch_array($resql);
$states[$service] = $result[state];
$states[$service] = $result['state'];
$this->states[$service] = $states[$service];
return is_array($states)