Fix: Date sur page des actions mal alignes. Mutualisation code par utilisation des fonctions getNomUrl

This commit is contained in:
Laurent Destailleur 2007-03-28 12:17:28 +00:00
parent b1fc919453
commit 1172b6a396
5 changed files with 31 additions and 20 deletions

View File

@ -379,11 +379,11 @@ class ActionComm
/**
* \brief Renvoie nom clicable (avec eventuellement le picto)
* \param withpicto Inclut le picto dans le lien
* \param option Nombre de caractères max dans libellé
* \param maxlength Nombre de caractères max dans libellé
* \return string Chaine avec URL
* \remarks Utilise $this->id, $this->code et $this->libelle
*/
function getNomUrl($withpicto=0,$option)
function getNomUrl($withpicto=0,$maxlength)
{
global $langs;
@ -394,12 +394,12 @@ class ActionComm
if ($langs->trans("Action".$this->code) != "Action".$this->code)
{
$libelle=$langs->trans("Action".$this->code);
$libelleshort=$langs->trans("Action".$this->code,'','','','',$option);
$libelleshort=$langs->trans("Action".$this->code,'','','','',$maxlength);
}
else
{
$libelle=$this->libelle;
$libelleshort=dolibarr_trunc($this->libelle,$option);
$libelleshort=dolibarr_trunc($this->libelle,$maxlength);
}
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowTask").': '.$libelle,'task').$lienfin.' ');

View File

@ -80,7 +80,7 @@ if ($_GET["time"] == "today")
}
if ($socid)
{
$sql .= " AND s.idp = $socid";
$sql .= " AND s.idp = ".$socid;
}
if (!$user->rights->commercial->client->voir && !$socid) //restriction
{
@ -95,6 +95,7 @@ $resql=$db->query($sql);
if ($resql)
{
$actionstatic=new ActionComm($db);
$societestatic=new Societe($db);
$num = $db->num_rows($resql);
$title="DoneAndToDoActions";
@ -116,7 +117,6 @@ if ($resql)
$i = 0;
print "<table class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">';
// print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"a.datep",$param,'','colspan="4"',$sortfield);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"a.datep",$param,'','',$sortfield);
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"acode",$param,"","",$sortfield);
print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield);
@ -134,7 +134,7 @@ if ($resql)
print "<tr $bc[$var]>";
print '<td align="left">';
print '<td align="right" nowrap="nowrap">';
if ($oldyear == strftime("%Y",$obj->dp) )
{
}
@ -168,11 +168,12 @@ if ($resql)
// print '<td align="center">'.dolibarr_print_date($obj->dp)."</td>\n";
// Action (type)
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id.'">'.img_object($langs->trans("ShowTask"),"task").' ';
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print dolibarr_trunc($libelle,16);
print '</a></td>';
print '<td>';
$actionstatic->id=$obj->id;
$actionstatic->code=$obj->acode;
$actionstatic->libelle=$obj->libelle;
print $actionstatic->getNomUrl(1,12);
print '</td>';
// Titre
print '<td>';
@ -181,10 +182,11 @@ if ($resql)
// Société
print '<td>';
if ($obj->client == 1) $url=DOL_URL_ROOT.'/comm/fiche.php?socid=';
elseif ($obj->client == 2) $url=DOL_URL_ROOT.'/comm/prospect/fiche.php?id=';
else $url=DOL_URL_ROOT.'/soc.php?socid=';
print '&nbsp;<a href="'.$url.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($obj->societe,24).'</a></td>';
$societestatic->rowid=$obj->socid;
$societestatic->client=$obj->client;
$societestatic->nom=$obj->societe;
print $societestatic->getNomUrl(1,'',16);
print '</td>';
// Contact
print '<td>';

View File

@ -182,6 +182,7 @@ llxHeader('',$langs->trans('CustomerCard'));
$actionstatic=new ActionComm($db);
$facturestatic=new Facture($db);
$contactstatic = new Contact($db);
$userstatic=new User($db);
if ($socid > 0)
{
@ -844,7 +845,11 @@ if ($socid > 0)
print '<td>&nbsp;</td>';
}
print '<td width="50"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->fk_user_author.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.'</a></td>';
print '<td width="80" nowrap="nowrap">';
$userstatic->id=$obj->fk_user_author;
$userstatic->login=$obj->login;
print $userstatic->getLoginUrl(1);
print '</td>';
// Statut
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
@ -977,7 +982,11 @@ if ($socid > 0)
}
// Auteur
print '<td nowrap="nowrap" width="50"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>';
print '<td nowrap="nowrap" width="80">';
$userstatic->id=$obj->rowid;
$userstatic->login=$obj->login;
print $userstatic->getLoginUrl(1);
print '</td>';
// Statut
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';

View File

@ -671,7 +671,7 @@ class Contact
$lienfin='</a>';
}
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowContact"),'contact').$lienfin.' ');
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowContact").': '.$this->name.' '.$this->firstname,'contact').$lienfin.' ');
$result.=$lien.$this->name.' '.$this->firstname.$lienfin;
return $result;
}

View File

@ -1126,7 +1126,7 @@ class Societe
$lienfin='</a>';
}
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany"),'company').$lienfin.' ');
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$this->nom,'company').$lienfin.' ');
$result.=$lien.($maxlen?dolibarr_trunc($this->nom,$maxlen):$this->nom).$lienfin;
return $result;
}