Fix sort of linked elements

This commit is contained in:
Laurent Destailleur 2019-06-17 15:54:54 +02:00
parent cf82587504
commit a74eaaff4d
4 changed files with 9 additions and 4 deletions

View File

@ -43,6 +43,8 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
// Load translation files required by the page
$langs->load("propal");
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc');
$total=0; $ilink=0;
foreach($linkedObjectBlock as $key => $objectlink)
{

View File

@ -39,6 +39,8 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
// Load translation files required by the page
$langs->load("orders");
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc');
$total=0; $ilink=0;
foreach($linkedObjectBlock as $key => $objectlink)
{

View File

@ -38,6 +38,8 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
$langs->load("bills");
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc');
$total=0; $ilink=0;
foreach($linkedObjectBlock as $key => $objectlink)
{

View File

@ -6480,7 +6480,7 @@ class Form
public function showLinkedObjectBlock($object, $morehtmlright = '', $compatibleImportElementsList = false)
{
global $conf,$langs,$hookmanager;
global $bc;
global $bc, $action;
$object->fetchObjectLinked();
@ -6525,6 +6525,7 @@ class Form
$showImportButton=true;
}
$regs = array();
if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs))
{
$element = $regs[1];
@ -6628,7 +6629,7 @@ class Form
public function showLinkToObjectBlock($object, $restrictlinksto = array(), $excludelinksto = array())
{
global $conf, $langs, $hookmanager;
global $bc;
global $bc, $action;
$linktoelem='';
$linktoelemlist='';
@ -6663,8 +6664,6 @@ class Form
);
}
global $action;
// Can complete the possiblelink array
$hookmanager->initHooks(array('commonobject'));
$parameters=array('listofidcompanytoscan' => $listofidcompanytoscan);