Merge pull request #12143 from frederic34/patch-19

NEW Add location into event tooltip. Use full day for fullday events
This commit is contained in:
Laurent Destailleur 2019-10-16 13:21:55 +02:00 committed by GitHub
commit a57b456aa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@
*/
/**
* \file htdocs/comm/action/list.php
* \file htdocs/comm/action/list.php
* \ingroup agenda
* \brief Page to list actions
*/
@ -239,7 +239,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
$sql = "SELECT";
if ($usergroup > 0) $sql.=" DISTINCT";
$sql.= " s.nom as societe, s.rowid as socid, s.client, s.email as socemail,";
$sql.= " a.id, a.label, a.note, a.datep as dp, a.datep2 as dp2,";
$sql.= " a.id, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location,";
$sql.= ' a.fk_user_author,a.fk_user_action,';
$sql.= " a.fk_contact, a.note, a.percent as percent,";
$sql.= " a.fk_element, a.elementtype, a.datec, a.tms as datem,";
@ -288,14 +288,14 @@ if (! empty($actioncode))
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND c.type = 'systemauto'";
else
{
if (is_array($actioncode))
{
$sql.=" AND c.code IN ('".implode("','", $actioncode)."')";
}
else
{
$sql.=" AND c.code IN ('".implode("','", explode(',', $actioncode))."')";
}
if (is_array($actioncode))
{
$sql.=" AND c.code IN ('".implode("','", $actioncode)."')";
}
else
{
$sql.=" AND c.code IN ('".implode("','", explode(',', $actioncode))."')";
}
}
}
}
@ -462,7 +462,7 @@ if ($resql)
print $form->selectDate($datestart, 'datestart', 0, 0, 1, '', 1, 0);
print '</td>';
}
if (! empty($arrayfields['a.datep2']['checked'])) {
if (! empty($arrayfields['a.datep2']['checked'])) {
print '<td class="liste_titre nowraponall" align="center">';
print $form->selectDate($dateend, 'dateend', 0, 0, 1, '', 1, 0);
print '</td>';
@ -550,6 +550,7 @@ if ($resql)
$actionstatic->type_label=$obj->type_label;
$actionstatic->type_picto=$obj->type_picto;
$actionstatic->label=$obj->label;
$actionstatic->location = $obj->location;
$actionstatic->note=dol_htmlentitiesbr($obj->note);
print '<tr class="oddeven">';
@ -611,11 +612,11 @@ if ($resql)
print $form->textwithtooltip(dol_trunc($text, 40), $actionstatic->note);
print '</td>';
}
$formatToUse = $obj->fulldayevent?'day':'dayhour';
// Start date
if (! empty($arrayfields['a.datep']['checked'])) {
print '<td align="center">';
print dol_print_date($db->jdate($obj->dp), "dayhour");
print dol_print_date($db->jdate($obj->dp), $formatToUse);
$late=0;
if ($obj->percent == 0 && $obj->dp && $db->jdate($obj->dp) < ($now - $delay_warning)) $late=1;
if ($obj->percent == 0 && ! $obj->dp && $obj->dp2 && $db->jdate($obj->dp) < ($now - $delay_warning)) $late=1;
@ -628,7 +629,7 @@ if ($resql)
// End date
if (! empty($arrayfields['a.datep2']['checked'])) {
print '<td align="center">';
print dol_print_date($db->jdate($obj->dp2), "dayhour");
print dol_print_date($db->jdate($obj->dp2), $formatToUse);
print '</td>';
}