New | Add AGENDA_SORT_EVENT_TYPE_BY_POSITION_FIRST hidden conf to change sort method of actions (#25375)

* Position defined in dictionnary must be main sort criterion

The position defined in the dictionary must be the main sort criterion.

* Use AGENDA_SORT_EVENT_TYPE_BY_POSITION_FIRST hidden conf to sort by position
This commit is contained in:
Pascal Hubrecht
2023-10-12 17:18:50 +02:00
committed by GitHub
parent de5b97c7e7
commit bd1ae42ece

View File

@@ -178,7 +178,13 @@ class CActionComm
if ($morefilter) {
$sql .= " AND ".$morefilter;
}
$sql .= " ORDER BY type, position, module";
// If AGENDA_SORT_EVENT_TYPE_BY_POSITION_FIRST is defined, we use position as main sort criterion
// otherwise we use type as main sort criterion
if (!empty($conf->global->AGENDA_SORT_EVENT_TYPE_BY_POSITION_FIRST)) {
$sql .= " ORDER BY position, type, module";
} else {
$sql .= " ORDER BY type, position, module";
}
dol_syslog(get_class($this)."::liste_array", LOG_DEBUG);
$resql = $this->db->query($sql);