Skip to content

Commit

Permalink
Merge pull request #3371 from atm-gauthier/new_add_event_type_on_thir…
Browse files Browse the repository at this point in the history
…d_party_card_agenda_tab

NEW : print event type on third party card tab agenda list (only if A…
  • Loading branch information
Juanjo Menent committed Aug 12, 2015
2 parents 6964f80 + f18c983 commit 993037e
Showing 1 changed file with 41 additions and 11 deletions.
52 changes: 41 additions & 11 deletions htdocs/core/lib/company.lib.php
Expand Up @@ -897,7 +897,7 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='')
*/
function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
{
global $bc,$user;
global $bc,$user,$conf;

// Check parameters
if (! is_object($object)) dol_print_error('','BadParameter');
Expand All @@ -915,12 +915,22 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
$out.="\n";
$out.='<table width="100%" class="noborder">';
$out.='<tr class="liste_titre">';
$out.='<td colspan="2">';
if($conf->global->AGENDA_USE_EVENT_TYPE) $out.='<td colspan="3">';
else $out.='<td colspan="2">';
if (get_class($object) == 'Societe') $out.='<a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?socid='.$object->id.'&amp;status=todo">';
$out.=$langs->trans("ActionsToDoShort");
if (get_class($object) == 'Societe') $out.='</a>';
$out.='</td>';
$out.='<td colspan="5" align="right">';

if($conf->global->AGENDA_USE_EVENT_TYPE) {
$out.='<td>';
$out.=$langs->trans("Type");
$out.='</td>';
$out.='<td colspan="4" align="right">';
} else {
$out.='<td colspan="5" align="right">';
}

$out.='</td>';
$out.='</tr>';

Expand Down Expand Up @@ -965,7 +975,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
$var = !$var;

$obj = $db->fetch_object($result);

$actionstatic->fetch($obj->id);
$datep=$db->jdate($obj->dp);
$datep2=$db->jdate($obj->dp2);

Expand Down Expand Up @@ -999,8 +1009,13 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)

// Title of event
//$out.='<td colspan="2">'.dol_trunc($obj->label,40).'</td>';
$out.='<td colspan="2">'.$actionstatic->getNomUrl(1,120).'</td>';

$out.='<td>'.$actionstatic->getNomUrl(1,120).'</td>';

if($conf->global->AGENDA_USE_EVENT_TYPE) {
$out.= '<td>';
$out.=$actionstatic->type;
$out.='</td>';
}
// Contact pour cette action
if (empty($objcon->id) && $obj->fk_contact > 0)
{
Expand Down Expand Up @@ -1063,7 +1078,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
*/
function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
{
global $bc,$user;
global $bc,$user,$conf;

// Check parameters
if (! is_object($object)) dol_print_error('','BadParameter');
Expand Down Expand Up @@ -1202,20 +1217,30 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
$out.="\n";
$out.='<table class="noborder" width="100%">';
$out.='<tr class="liste_titre">';
$out.='<td colspan="2">';
if($conf->global->AGENDA_USE_EVENT_TYPE) $out.='<td colspan="3">';
else $out.='<td colspan="2">';
if (get_class($object) == 'Societe') $out.='<a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?socid='.$object->id.'&amp;status=done">';
$out.=$langs->trans("ActionsDoneShort");
if (get_class($object) == 'Societe') $out.='</a>';
$out.='</td>';
$out.='<td colspan="5" align="right">';

if($conf->global->AGENDA_USE_EVENT_TYPE) {
$out.='<td>';
$out.=$langs->trans("Type");
$out.='</td>';
$out.='<td colspan="4" align="right">';
} else {
$out.='<td colspan="5" align="right">';
}

$out.='</td>';
$out.='</tr>';

foreach ($histo as $key=>$value)
{
$var=!$var;
$out.="<tr ".$bc[$var].">";

$actionstatic->fetch($histo[$key]['id']);
// Champ date
$out.='<td width="120" class="nowrap">';
$out.=dol_print_date($histo[$key]['datestart'],'dayhour');
Expand Down Expand Up @@ -1251,7 +1276,12 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
$out.=dol_trunc($libelle,120);
}
$out.='</td>';


if($conf->global->AGENDA_USE_EVENT_TYPE) {
$out.='<td>';
$out.=$actionstatic->type;
$out.='</td>';
}
// Title of event
//$out.='<td>'.dol_trunc($histo[$key]['note'], 40).'</td>';

Expand Down

0 comments on commit 993037e

Please sign in to comment.