NEW Summary of last events on a card are sorted on decreasing date.

This commit is contained in:
Laurent Destailleur
2017-09-16 10:12:44 +02:00
parent 4e7e6cc658
commit bd7c4fe940
3 changed files with 15 additions and 12 deletions

View File

@@ -863,7 +863,7 @@ class ActionComm extends CommonObject
* @param string $limit Limit number of answers * @param string $limit Limit number of answers
* @return array or string Error string if KO, array with actions if OK * @return array or string Error string if KO, array with actions if OK
*/ */
static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='datep', $sortorder='DESC', $limit=0) static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='a.datep', $sortorder='DESC', $limit=0)
{ {
global $conf, $langs; global $conf, $langs;

View File

@@ -166,7 +166,10 @@ class FormActions
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement, '', '', '', ($max?($max+1):0)); $sortfield='a.datep';
$sortorder='DESC';
$listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement, '', $sortfield, $sortorder, ($max?($max+1):0));
if (! is_array($listofactions)) dol_print_error($this->db,'FailedToGetActions'); if (! is_array($listofactions)) dol_print_error($this->db,'FailedToGetActions');
$num = count($listofactions); $num = count($listofactions);
@@ -192,19 +195,19 @@ class FormActions
$buttontoaddnewevent.= '</a>'; $buttontoaddnewevent.= '</a>';
print load_fiche_titre($title, $buttontoaddnewevent, ''); print load_fiche_titre($title, $buttontoaddnewevent, '');
$page=0; $param=''; $sortfield='a.datep'; $page=0; $param='';
$total = 0; $total = 0;
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="noborder'.($morecss?' '.$morecss:'').'" width="100%">'; print '<table class="noborder'.($morecss?' '.$morecss:'').'" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], '', $page, $param, ''); print getTitleFieldOfList('Ref', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
print_liste_field_titre('Action', $_SERVER["PHP_SELF"], '', $page, $param, ''); print getTitleFieldOfList('Action', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
print_liste_field_titre('Type', $_SERVER["PHP_SELF"], '', $page, $param, ''); print getTitleFieldOfList('Type', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
print_liste_field_titre('Date', $_SERVER["PHP_SELF"], '', $page, $param, 'align="center"'); print getTitleFieldOfList('Date', 0, $_SERVER["PHP_SELF"], 'a.datep', $page, $param, 'align="center"', $sortfield, $sortorder, '', 1);
print_liste_field_titre('By', $_SERVER["PHP_SELF"], '', $page, $param, ''); print getTitleFieldOfList('By', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $page, $param, 'align="right"'); print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', $page, $param, 'align="right"', $sortfield, $sortorder, '', 1);
print '</tr>'; print '</tr>';
print "\n"; print "\n";

View File

@@ -3353,16 +3353,16 @@ function dol_print_error_email($prefixcode, $errormessage='')
* @param string $field Field to use for new sorting * @param string $field Field to use for new sorting
* @param string $begin ("" by defaut) * @param string $begin ("" by defaut)
* @param string $moreparam Add more parameters on sort url links ("" by default) * @param string $moreparam Add more parameters on sort url links ("" by default)
* @param string $td Options of attribute td ("" by defaut, example: 'align="center"') * @param string $moreattrib Options of attribute td ("" by defaut, example: 'align="center"')
* @param string $sortfield Current field used to sort * @param string $sortfield Current field used to sort
* @param string $sortorder Current sort order * @param string $sortorder Current sort order
* @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag. * @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag.
* @param string $tooltip Tooltip * @param string $tooltip Tooltip
* @return void * @return void
*/ */
function print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $td="", $sortfield="", $sortorder="", $prefix="", $tooltip="") function print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="")
{ {
print getTitleFieldOfList($name, 0, $file, $field, $begin, $moreparam, $td, $sortfield, $sortorder, $prefix, 0, $tooltip); print getTitleFieldOfList($name, 0, $file, $field, $begin, $moreparam, $moreattrib, $sortfield, $sortorder, $prefix, 0, $tooltip);
} }
/** /**