diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index ea6f8d6c4a1..fa1a5bea7c7 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2011 Regis Houssin * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2014 Marcos GarcĂ­a + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,12 +35,12 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; $langs->load("bills"); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); +'@phan-var-force array $linkedObjectBlock'; $total = 0; $ilink = 0; foreach ($linkedObjectBlock as $key => $objectlink) { $ilink++; - $trclass = 'oddeven'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) { $trclass .= ' liste_sub_total'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index dc417d38a7e..112ac2a08fd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9579,13 +9579,13 @@ function dol_htmloutput_errors($mesgstring = '', $mesgarray = array(), $keepembe * or descending output and uses optionally natural case insensitive sorting (which * can be optionally case sensitive as well). * - * @param array $array Array to sort (array of array('key1'=>val1,'key2'=>val2,'key3'...) or array of objects) + * @param array $array Array to sort (array of array('key1'=>val1,'key2'=>val2,'key3'...) or array of objects) * @param string $index Key in array to use for sorting criteria * @param string $order Sort order ('asc' or 'desc') * @param int $natsort If values are strings (I said value not type): 0=Use alphabetical order, 1=use "natural" sort (natsort) * If values are numeric (I said value not type): 0=Use numeric order (even if type is string) so use a "natural" sort, 1=use "natural" sort too (same than 0), -1=Force alphabetical order * @param int $case_sensitive 1=sort is case sensitive, 0=not case sensitive - * @param int $keepindex If 0 and index key of array to sort is a numeric, than index will be rewrote. If 1 or index key is not numeric, key for index is kept after sorting. + * @param int $keepindex If 0 and index key of array to sort is a numeric, then index will be rewritten. If 1 or index key is not numeric, key for index is kept after sorting. * @return array Sorted array */ function dol_sort_array(&$array, $index, $order = 'asc', $natsort = 0, $case_sensitive = 0, $keepindex = 0)