forked from Wavyzz/dolibarr
Fix remove some warnings
Conflicts: htdocs/core/lib/pdf.lib.php
This commit is contained in:
@@ -768,9 +768,10 @@ abstract class CommonObject
|
||||
* @param int $statut Status of links to get (-1=all)
|
||||
* @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
|
||||
* @param int $list 0:Return array contains all properties, 1:Return array contains just id
|
||||
* @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...)
|
||||
* @return array Array of contacts
|
||||
*/
|
||||
function liste_contact($statut=-1,$source='external',$list=0)
|
||||
function liste_contact($statut=-1,$source='external',$list=0,$code='')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@@ -788,6 +789,7 @@ abstract class CommonObject
|
||||
$sql.= " WHERE ec.element_id =".$this->id;
|
||||
$sql.= " AND ec.fk_c_type_contact=tc.rowid";
|
||||
$sql.= " AND tc.element='".$this->element."'";
|
||||
if ($code) $sql.= " AND tc.code = '".$this->db->escape($code)."'";
|
||||
if ($source == 'internal') $sql.= " AND tc.source = 'internal'";
|
||||
if ($source == 'external' || $source == 'thirdparty') $sql.= " AND tc.source = 'external'";
|
||||
$sql.= " AND tc.active=1";
|
||||
@@ -825,7 +827,7 @@ abstract class CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1879,29 +1879,30 @@ function pdf_getLinkedObjects($object,$outputlangs)
|
||||
{
|
||||
$outputlangs->load('orders');
|
||||
$outputlangs->load('sendings');
|
||||
foreach($objects as $x => $elementobject)
|
||||
foreach($objects as $elementobject)
|
||||
{
|
||||
$elementobject->fetchObjectLinked();
|
||||
|
||||
$order = reset($elementobject->linkedObjects['commande']);
|
||||
|
||||
// We concat this record info into fields xxx_value. title is overwrote.
|
||||
if (! empty($object->linkedObjects['commande']) || $object->element == 'commande') // There is already a link to order or object is the order, so we show only info of shipment
|
||||
if (isset($elementobject->linkedObjects['commande']) && count($elementobject->linkedObjects['commande']) > 0)
|
||||
{
|
||||
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefSending");
|
||||
if (! empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'].=' / ';
|
||||
$linkedobjects[$objecttype]['ref_value'].= $outputlangs->transnoentities($elementobject->ref);
|
||||
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateSending");
|
||||
$linkedobjects[$objecttype]['date_value'].= dol_print_date($elementobject->date_delivery,'day','',$outputlangs);
|
||||
}
|
||||
else // We show both info of order and shipment.
|
||||
{
|
||||
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder") . ' / ' . $outputlangs->transnoentities("RefSending");
|
||||
if (empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] = $outputlangs->convToOutputCharset($order->ref) . ($order->ref_client ? ' ('.$order->ref_client.')' : '');
|
||||
$linkedobjects[$objecttype]['ref_value'].= ' / ' . $outputlangs->transnoentities($elementobject->ref);
|
||||
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate") . ($elementobject->date_delivery ? ' / ' . $outputlangs->transnoentities("DateSending") : '');
|
||||
if (empty($linkedobjects[$objecttype]['date_value'])) $linkedobjects[$objecttype]['date_value'] = dol_print_date($order->date,'day','',$outputlangs);
|
||||
$linkedobjects[$objecttype]['date_value'].= ($elementobject->date_delivery ? ' / ' . dol_print_date($elementobject->date_delivery,'day','',$outputlangs) : '');
|
||||
$order = reset($elementobject->linkedObjects['commande']); // Get first order
|
||||
|
||||
if (! empty($object->linkedObjects['commande'])) // There is already a link to order so we show only info of shipment
|
||||
{
|
||||
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefSending");
|
||||
$linkedobjects[$objecttype]['ref_value'].= $outputlangs->transnoentities($elementobject->ref);
|
||||
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateSending");
|
||||
$linkedobjects[$objecttype]['date_value'].= dol_print_date($elementobject->date_delivery,'day','',$outputlangs);
|
||||
}
|
||||
else // We show both info of order and shipment
|
||||
{
|
||||
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder") . ' / ' . $outputlangs->transnoentities("RefSending");
|
||||
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->convToOutputCharset($order->ref) . ($order->ref_client ? ' ('.$order->ref_client.')' : '');
|
||||
$linkedobjects[$objecttype]['ref_value'].= ' / ' . $outputlangs->transnoentities($elementobject->ref);
|
||||
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate") . ($elementobject->date_delivery ? ' / ' . $outputlangs->transnoentities("DateSending") : '');
|
||||
$linkedobjects[$objecttype]['date_value'] = dol_print_date($order->date,'day','',$outputlangs);
|
||||
$linkedobjects[$objecttype]['date_value'].= ($elementobject->date_delivery ? ' / ' . dol_print_date($elementobject->date_delivery,'day','',$outputlangs) : '');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user