diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 4fe49999111..e08f5518c1f 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -534,9 +534,11 @@ class ActionComm extends CommonObject
* @param int $fk_element Id of element action is linked to
* @param string $elementtype Type of element action is linked to
* @param string $filter Other filter
+ * @param string $sortfield Sort on this field
+ * @param string $sortorder ASC or DESC
* @return array or string Error string if KO, array with actions if OK
*/
- static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='')
+ static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='', $sortorder='')
{
global $conf, $langs;
@@ -552,6 +554,7 @@ class ActionComm extends CommonObject
else $sql.= " AND a.fk_element = ".$fk_element." AND a.elementtype = '".$elementtype."'";
}
if (! empty($filter)) $sql.= $filter;
+ if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder);
dol_syslog(get_class()."::getActions", LOG_DEBUG);
$resql=$db->query($sql);
diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php
index 929600512c7..46e420866a2 100644
--- a/htdocs/comm/action/fiche.php
+++ b/htdocs/comm/action/fiche.php
@@ -638,7 +638,10 @@ if ($action == 'create')
print '';
// Location
- print '
'.$langs->trans("Location").'
';
+ if (empty($conf->global->AGENDA_DISABLE_LOCATION))
+ {
+ print '
'.$langs->trans("Location").'
';
+ }
// Assigned to
print '
'.$langs->trans("ActionAffectedTo").'
';
@@ -888,7 +891,10 @@ if ($id > 0)
print '
';
// Location
- print '
'.$langs->trans("Location").'
';
+ if (empty($conf->global->AGENDA_DISABLE_LOCATION))
+ {
+ print '
'.$langs->trans("Location").'
';
+ }
// Assigned to
print '
'.$langs->trans("ActionAffectedTo").'
';
@@ -1020,13 +1026,16 @@ if ($id > 0)
// Full day event
print '
'.$langs->trans("EventOnFullDay").'
'.yn($object->fulldayevent).'
';
+ $rowspan=4;
+ if (empty($conf->global->AGENDA_DISABLE_LOCATION)) $rowspan++;
+
// Date start
print '