Fix: Link to linked object was not working for invoice and order.
Fix: end date
This commit is contained in:
parent
eea034e0e5
commit
2b95bd2fcc
@ -929,7 +929,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
|
||||
$sql = "SELECT a.id, a.label,";
|
||||
$sql.= " a.datep as dp,";
|
||||
$sql.= " a.datea as da,";
|
||||
$sql.= " a.datep2 as dp2,";
|
||||
$sql.= " a.percent,";
|
||||
$sql.= " a.fk_user_author, a.fk_contact,";
|
||||
$sql.= " a.fk_element, a.elementtype,";
|
||||
@ -970,10 +970,20 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$datep=$db->jdate($obj->dp);
|
||||
$datep2=$db->jdate($obj->dp2);
|
||||
|
||||
$out.="<tr ".$bc[$var].">";
|
||||
|
||||
$out.='<td width="120" align="left" class="nowrap">'.dol_print_date($datep,'dayhour')."</td>\n";
|
||||
$out.='<td width="120" align="left" class="nowrap">';
|
||||
$out.=dol_print_date($datep,'dayhour');
|
||||
if ($datep2 && $datep2 != $datep)
|
||||
{
|
||||
$tmpa=dol_getdate($datep);
|
||||
$tmpb=dol_getdate($datep2);
|
||||
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $out.='-'.dol_print_date($datep2,'hour');
|
||||
else $out.='-'.dol_print_date($datep2,'dayhour');
|
||||
}
|
||||
$out.="</td>\n";
|
||||
|
||||
// Picto warning
|
||||
$out.='<td width="16">';
|
||||
@ -1103,7 +1113,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
'type'=>'action',
|
||||
'id'=>$obj->id,
|
||||
'datestart'=>$db->jdate($obj->dp),
|
||||
'date'=>$db->jdate($obj->dp2),
|
||||
'dateend'=>$db->jdate($obj->dp2),
|
||||
'note'=>$obj->label,
|
||||
'percent'=>$obj->percent,
|
||||
'acode'=>$obj->acode,
|
||||
@ -1154,7 +1164,8 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
$histo[$numaction]=array(
|
||||
'type'=>'mailing',
|
||||
'id'=>$obj->id,
|
||||
'date'=>$db->jdate($obj->da),
|
||||
'datestart'=>$db->jdate($obj->da),
|
||||
'dateend'=>$db->jdate($obj->da),
|
||||
'note'=>$obj->note,
|
||||
'percent'=>$obj->percentage,
|
||||
'acode'=>$obj->acode,
|
||||
@ -1217,8 +1228,14 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
|
||||
// Champ date
|
||||
$out.='<td width="120" class="nowrap">';
|
||||
if ($histo[$key]['date']) $out.=dol_print_date($histo[$key]['date'],'dayhour');
|
||||
else if ($histo[$key]['datestart']) $out.=dol_print_date($histo[$key]['datestart'],'dayhour');
|
||||
$out.=dol_print_date($histo[$key]['datestart'],'dayhour');
|
||||
if ($histo[$key]['dateend'] && $histo[$key]['dateend'] != $histo[$key]['datestart'])
|
||||
{
|
||||
$tmpa=dol_getdate($histo[$key]['datestart']);
|
||||
$tmpb=dol_getdate($histo[$key]['dateend']);
|
||||
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $out.='-'.dol_print_date($histo[$key]['dateend'],'hour');
|
||||
else $out.='-'.dol_print_date($histo[$key]['dateend'],'dayhour');
|
||||
}
|
||||
$out.="</td>\n";
|
||||
|
||||
// Picto
|
||||
@ -1251,6 +1268,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
// Objet lie
|
||||
// TODO uniformize
|
||||
$out.='<td>';
|
||||
//var_dump($histo[$key]['elementtype']);
|
||||
if (isset($histo[$key]['elementtype']))
|
||||
{
|
||||
if ($histo[$key]['elementtype'] == 'propal' && ! empty($conf->propal->enabled))
|
||||
@ -1259,13 +1277,13 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
$propalstatic->id=$histo[$key]['fk_element'];
|
||||
$out.=$propalstatic->getNomUrl(1);
|
||||
}
|
||||
elseif ($histo[$key]['elementtype'] == 'commande' && ! empty($conf->commande->enabled))
|
||||
elseif (($histo[$key]['elementtype'] == 'order' || $histo[$key]['elementtype'] == 'commande') && ! empty($conf->commande->enabled))
|
||||
{
|
||||
$orderstatic->ref=$langs->trans("Order");
|
||||
$orderstatic->id=$histo[$key]['fk_element'];
|
||||
$out.=$orderstatic->getNomUrl(1);
|
||||
}
|
||||
elseif ($histo[$key]['elementtype'] == 'facture' && ! empty($conf->facture->enabled))
|
||||
elseif (($histo[$key]['elementtype'] == 'invoice' || $histo[$key]['elementtype'] == 'facture') && ! empty($conf->facture->enabled))
|
||||
{
|
||||
$facturestatic->ref=$langs->trans("Invoice");
|
||||
$facturestatic->id=$histo[$key]['fk_element'];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user