Qual: Mutualize and uniformize code
This commit is contained in:
parent
3dfad63473
commit
5a80ce5141
@ -60,6 +60,8 @@ $pagenext = $page + 1;
|
|||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
|
$thirdpartystatic=new Societe($db);
|
||||||
|
|
||||||
if ($action == 'attribute_prefix')
|
if ($action == 'attribute_prefix')
|
||||||
{
|
{
|
||||||
$societe = new Societe($db, $socid);
|
$societe = new Societe($db, $socid);
|
||||||
@ -96,7 +98,7 @@ if ($mode == 'search') {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT s.rowid, s.nom, s.ville, s.datec, s.datea";
|
$sql = "SELECT s.rowid, s.nom, s.client, s.ville, s.datec, s.datea";
|
||||||
$sql.= ", st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta ";
|
$sql.= ", st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta ";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st";
|
||||||
@ -199,9 +201,12 @@ if ($resql)
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->rowid.'">';
|
print '<td>';
|
||||||
print img_object($langs->trans("ShowCustomer"),"company");
|
$thirdpartystatic->id=$obj->rowid;
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->rowid.'">'.$obj->nom.'</a></td>';
|
$thirdpartystatic->nom=$obj->nom;
|
||||||
|
$thirdpartystatic->client=$obj->client;
|
||||||
|
print $thirdpartystatic->getNomUrl(1,'compta');
|
||||||
|
print '</td>';
|
||||||
print '<td>'.$obj->ville.' </td>';
|
print '<td>'.$obj->ville.' </td>';
|
||||||
print '<td align="left">'.$obj->code_client.' </td>';
|
print '<td align="left">'.$obj->code_client.' </td>';
|
||||||
print '<td align="left">'.$obj->code_compta.' </td>';
|
print '<td align="left">'.$obj->code_compta.' </td>';
|
||||||
|
|||||||
@ -1307,7 +1307,7 @@ class Societe extends CommonObject
|
|||||||
$result='';
|
$result='';
|
||||||
$lien=$lienfin='';
|
$lien=$lienfin='';
|
||||||
|
|
||||||
if ($option == 'customer')
|
if ($option == 'customer' || $option == 'compta')
|
||||||
{
|
{
|
||||||
if ($this->client == 1)
|
if ($this->client == 1)
|
||||||
{
|
{
|
||||||
@ -1325,11 +1325,6 @@ class Societe extends CommonObject
|
|||||||
$lien = '<a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$this->id.'">';
|
$lien = '<a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$this->id.'">';
|
||||||
$lienfin='</a>';
|
$lienfin='</a>';
|
||||||
}
|
}
|
||||||
if ($option == 'compta')
|
|
||||||
{
|
|
||||||
$lien = '<a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$this->id.'">';
|
|
||||||
$lienfin='</a>';
|
|
||||||
}
|
|
||||||
if (empty($lien))
|
if (empty($lien))
|
||||||
{
|
{
|
||||||
$lien = '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$this->id.'">';
|
$lien = '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$this->id.'">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user