New: Enhancement in actions list management. Show location in day view

This commit is contained in:
Laurent Destailleur 2011-02-02 14:41:31 +00:00
parent e17b26e988
commit 344219cb13
2 changed files with 32 additions and 6 deletions

View File

@ -61,6 +61,7 @@ class ActionComm extends CommonObject
var $priority; var $priority;
var $fulldayevent = 0; // 1=Event on full day var $fulldayevent = 0; // 1=Event on full day
var $punctual = 1; var $punctual = 1;
var $location;
var $usertodo; // Object user that must do action var $usertodo; // Object user that must do action
var $userdone; // Object user that did action var $userdone; // Object user that did action
@ -577,7 +578,12 @@ class ActionComm extends CommonObject
else $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$this->id.'">'; else $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$this->id.'">';
$lienfin='</a>'; $lienfin='</a>';
//print $this->libelle; //print $this->libelle;
if (empty($this->libelle)) if ($withpicto == 2)
{
$libelle=$langs->trans("Action".$this->type_code);
$libelleshort='';
}
else if (empty($this->libelle))
{ {
$libelle=$langs->trans("Action".$this->type_code); $libelle=$langs->trans("Action".$this->type_code);
$libelleshort=$langs->trans("Action".$this->type_code,'','','','',$maxlength); $libelleshort=$langs->trans("Action".$this->type_code,'','','','',$maxlength);

View File

@ -484,7 +484,7 @@ else // View by day
echo " </tr>\n"; echo " </tr>\n";
echo " <tr>\n"; echo " <tr>\n";
echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">'; echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">';
show_day_events ($db, $day, $month, $year, $month, $style, $actionarray, 0, 80, $newparam); show_day_events ($db, $day, $month, $year, $month, $style, $actionarray, 0, 80, $newparam, 1);
echo "</td>\n"; echo "</td>\n";
echo " </tr>\n"; echo " </tr>\n";
echo '</table>'; echo '</table>';
@ -510,10 +510,9 @@ llxFooter('$Date$ - $Revision$');
* @param $maxPrint Nb of actions to show each day on month view (0 means non limit) * @param $maxPrint Nb of actions to show each day on month view (0 means non limit)
* @param $maxnbofchar Nb of characters to show for event line * @param $maxnbofchar Nb of characters to show for event line
* @param $newparam Parameters on current URL * @param $newparam Parameters on current URL
* @param $companystatic Object thirdparty * @param $showinfo Add extended information (used by day view)
* @param $contactstatic Object contact
*/ */
function show_day_events($db, $day, $month, $year, $monthshown, $style, &$actionarray, $maxPrint=0, $maxnbofchar=14, $newparam='') function show_day_events($db, $day, $month, $year, $monthshown, $style, &$actionarray, $maxPrint=0, $maxnbofchar=14, $newparam='', $showinfo=0)
{ {
global $user, $conf, $langs; global $user, $conf, $langs;
global $filter, $filtera, $filtert, $filterd, $status; global $filter, $filtera, $filtert, $filterd, $status;
@ -565,6 +564,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$action
print '<td nowrap="nowrap">'; print '<td nowrap="nowrap">';
if ($action->type_code != 'BIRTHDAY') if ($action->type_code != 'BIRTHDAY')
{ {
if ($showinfo)
{
print $action->getNomUrl(2).' ';
}
if (empty($action->fulldayevent)) if (empty($action->fulldayevent))
{ {
// Show hours (start ... end) // Show hours (start ... end)
@ -599,7 +603,14 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$action
if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour) if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour)
print dol_print_date($action->date_end_in_calendar,'%H:%M'); print dol_print_date($action->date_end_in_calendar,'%H:%M');
} }
print '<br>'; print '<br>'."\n";
}
else
{
if ($showinfo)
{
print $langs->trans("EventOnFullDay").'<br>'."\n";
}
} }
// If action related to company / contact // If action related to company / contact
@ -635,6 +646,15 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$action
{ {
print $action->getNomUrl(1,$maxnbofchar,'cal_event','birthday','contact'); print $action->getNomUrl(1,$maxnbofchar,'cal_event','birthday','contact');
} }
// Show location
if ($showinfo)
{
if ($action->location)
{
print '<br>';
print $langs->trans("Location").': '.$action->location;
}
}
print '</td>'; print '</td>';
// Status - Percent // Status - Percent
print '<td align="right" nowrap="nowrap">'; print '<td align="right" nowrap="nowrap">';