Qual: Utilisation des methodes communes plutot que code en dur
This commit is contained in:
parent
5edbacef75
commit
5ed391df02
@ -33,6 +33,7 @@ require_once("./pre.inc.php");
|
|||||||
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
|
||||||
if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
|
if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
|
||||||
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
|
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
|
||||||
if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php");
|
if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php");
|
||||||
@ -68,13 +69,16 @@ if (!$user->rights->commercial->client->voir && $socid && !$user->societe_id > 0
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$sortorder=$_GET["sortorder"];
|
$sortorder=$_GET["sortorder"];
|
||||||
$sortfield=$_GET["sortfield"];
|
$sortfield=$_GET["sortfield"];
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
if (! $sortfield) $sortfield="nom";
|
if (! $sortfield) $sortfield="nom";
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
if ($_GET["action"] == 'attribute_prefix' && $user->rights->societe->creer)
|
if ($_GET["action"] == 'attribute_prefix' && $user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
$societe = new Societe($db, $_GET["socid"]);
|
$societe = new Societe($db, $_GET["socid"]);
|
||||||
@ -167,14 +171,18 @@ if ($mode == 'search') {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
llxHeader('',$langs->trans('CustomerCard'));
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************************
|
/*********************************************************************************
|
||||||
*
|
*
|
||||||
* Mode fiche
|
* Mode fiche
|
||||||
*
|
*
|
||||||
*********************************************************************************/
|
*********************************************************************************/
|
||||||
|
|
||||||
|
llxHeader('',$langs->trans('CustomerCard'));
|
||||||
|
|
||||||
|
$actionstatic=new ActionComm($db);
|
||||||
|
$facturestatic=new Facture($db);
|
||||||
|
$contactstatic = new Contact($db);
|
||||||
|
|
||||||
if ($socid > 0)
|
if ($socid > 0)
|
||||||
{
|
{
|
||||||
// On recupere les donnees societes par l'objet
|
// On recupere les donnees societes par l'objet
|
||||||
@ -696,10 +704,10 @@ if ($socid > 0)
|
|||||||
$var = !$var;
|
$var = !$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print '<td>';
|
$contactstatic->id=$obj->idp;
|
||||||
print '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->idp.'">';
|
$contactstatic->name=$obj->name;
|
||||||
print img_object($langs->trans("Show"),"contact");
|
$contactstatic->firstname=$obj->firstname;
|
||||||
print ' '.$obj->firstname.' '. $obj->name.'</a> ';
|
print '<td>'.$contactstatic->getNomUrl(1).'</td>';
|
||||||
|
|
||||||
if (trim($obj->note))
|
if (trim($obj->note))
|
||||||
{
|
{
|
||||||
@ -737,8 +745,6 @@ if ($socid > 0)
|
|||||||
print "<br>";
|
print "<br>";
|
||||||
|
|
||||||
|
|
||||||
$actionstatic=new ActionComm($db);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Listes des actions a faire
|
* Listes des actions a faire
|
||||||
*
|
*
|
||||||
@ -819,20 +825,22 @@ if ($socid > 0)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td><a href="action/fiche.php?id='.$obj->id.'">'.img_object($langs->trans("ShowAction"),"task");
|
$actionstatic->code=$obj->acode;
|
||||||
$transcode=$langs->trans("Action".$obj->acode);
|
$actionstatic->libelle=$obj->libelle;
|
||||||
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
|
$actionstatic->id=$obj->id;
|
||||||
print $libelle;
|
print '<td>'.$actionstatic->getNomUrl(1,16).'</td>';
|
||||||
print '</a></td>';
|
|
||||||
}
|
}
|
||||||
print '<td colspan="2">'.$obj->label.'</td>';
|
print '<td colspan="2">'.$obj->label.'</td>';
|
||||||
|
|
||||||
// Contact pour cette action
|
// Contact pour cette action
|
||||||
if ($obj->fk_contact) {
|
if ($obj->fk_contact > 0)
|
||||||
|
{
|
||||||
$contact = new Contact($db);
|
$contact = new Contact($db);
|
||||||
$contact->fetch($obj->fk_contact);
|
$contact->fetch($obj->fk_contact);
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$contact->id.'">'.img_object($langs->trans("ShowContact"),"contact").' '.$contact->fullname.'</a></td>';
|
print '<td>'.$contact->getNomUrl(1).'</td>';
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -929,11 +937,10 @@ if ($socid > 0)
|
|||||||
|
|
||||||
// Action
|
// Action
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id.'">'.img_object($langs->trans("ShowTask"),"task");
|
$actionstatic->code=$obj->acode;
|
||||||
$transcode=$langs->trans("Action".$obj->acode);
|
$actionstatic->libelle=$obj->libelle;
|
||||||
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
|
$actionstatic->id=$obj->id;
|
||||||
print $libelle;
|
print $actionstatic->getNomUrl(1,16);
|
||||||
print '</a>';
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Objet lié
|
// Objet lié
|
||||||
@ -946,9 +953,10 @@ if ($socid > 0)
|
|||||||
}
|
}
|
||||||
if ($obj->fk_facture)
|
if ($obj->fk_facture)
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->fk_facture.'">'.img_object($langs->trans("ShowBill"),"bill");
|
$facturestatic->ref=$langs->trans("Invoice");
|
||||||
print $langs->trans("Invoice");
|
$facturestatic->id=$obj->rowid;
|
||||||
print '</a>';
|
$facturestatic->type=$obj->type;
|
||||||
|
print $facturestatic->getNomUrl(1,'compta');
|
||||||
}
|
}
|
||||||
else print ' ';
|
else print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -957,11 +965,11 @@ if ($socid > 0)
|
|||||||
print "<td>$obj->label</td>";
|
print "<td>$obj->label</td>";
|
||||||
|
|
||||||
// Contact pour cette action
|
// Contact pour cette action
|
||||||
if ($obj->fk_contact)
|
if ($obj->fk_contact > 0)
|
||||||
{
|
{
|
||||||
$contact = new Contact($db);
|
$contact = new Contact($db);
|
||||||
$contact->fetch($obj->fk_contact);
|
$contact->fetch($obj->fk_contact);
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$contact->id.'">'.img_object($langs->trans("ShowContact"),"contact").' '.$contact->fullname.'</a></td>';
|
print '<td>'.$contact->getNomUrl(1).'</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -756,6 +756,7 @@ class Contact
|
|||||||
* \param withpicto Inclut le picto dans le lien
|
* \param withpicto Inclut le picto dans le lien
|
||||||
* \param option Sur quoi pointe le lien
|
* \param option Sur quoi pointe le lien
|
||||||
* \return string Chaine avec URL
|
* \return string Chaine avec URL
|
||||||
|
* \remarks Utilise $this->id, $this->name et $this->firstname
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0,$option='')
|
function getNomUrl($withpicto=0,$option='')
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user