Fix sort order

This commit is contained in:
Laurent Destailleur 2017-11-25 16:21:44 +01:00
parent 5ba4a57b61
commit 1ea9137863
2 changed files with 24 additions and 15 deletions

View File

@ -168,7 +168,7 @@ class FormActions
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$sortfield='a.datep,a.id';
$sortorder='DESC';
$sortorder='DESC,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');
@ -227,7 +227,9 @@ class FormActions
$label=$action->getNomUrl(0,38);
print '<tr class="oddeven">';
// Ref
print '<td>'.$ref.'</td>';
// Onwer
print '<td>';
if (! empty($action->userownerid))
{
@ -235,20 +237,27 @@ class FormActions
print $userstatic->getNomUrl(-1, '', 0, 0, 16, 0, '', '');
}
print '</td>';
print '<td>';
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
if ($action->type_picto) print img_picto('', $action->type_picto);
else {
if ($action->type_code == 'AC_RDV') print img_picto('', 'object_group').' ';
if ($action->type_code == 'AC_TEL') print img_picto('', 'object_phoning').' ';
if ($action->type_code == 'AC_FAX') print img_picto('', 'object_phoning_fax').' ';
if ($action->type_code == 'AC_EMAIL') print img_picto('', 'object_email').' ';
}
}
// Type
print '<td>';
$imgpicto='';
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
if ($action->type_picto) $imgpicto=img_picto('', $action->type_picto);
else {
if ($action->type_code == 'AC_RDV') $imgpicto=img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' ';
elseif ($action->type_code == 'AC_TEL') $imgpicto=img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' ';
elseif ($action->type_code == 'AC_FAX') $imgpicto=img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' ';
elseif ($action->type_code == 'AC_EMAIL') $imgpicto=img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
elseif ($action->type_code == 'AC_INT') $imgpicto=img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' ';
elseif (! preg_match('/_AUTO/', $action->type_code)) $imgpicto=img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').' ';
}
}
print $imgpicto;
print $action->type_short ? $action->type_short : $action->type;
print '</td>';
// Label
print '<td>'.$label.'</td>';
// Date
print '<td align="center">'.dol_print_date($action->datep, 'dayhour', 'tzuserrel');
if ($action->datef)
{

View File

@ -220,9 +220,9 @@ abstract class DoliDB implements Database
/**
* Define sort criteria of request
*
* @param string $sortfield List of sort fields, separated by comma. Example: 't1.fielda, t2.fieldb'
* @param 'ASC'|'DESC' $sortorder Sort order
* @return string String to provide syntax of a sort sql string
* @param string $sortfield List of sort fields, separated by comma. Example: 't1.fielda, t2.fieldb'
* @param string $sortorder Sort order, separated by comma. Example: 'ASC, DESC';
* @return string String to provide syntax of a sort sql string
*/
function order($sortfield=null,$sortorder=null)
{