Tooltip everywhere

This commit is contained in:
frederic34 2015-01-25 01:20:58 +01:00
parent 76bf95789d
commit 736bee565c
56 changed files with 709 additions and 390 deletions

View File

@ -897,9 +897,11 @@ class ActionComm extends CommonObject
global $conf,$langs;
$result='';
$label=$this->label;
$tooltip = '<u>' . $langs->trans('ShowAction'.$objp->code) . '</u>';
$tooltip .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->label;
$label = $this->label;
if (empty($label)) $label=$this->libelle; // For backward compatibility
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkclose = '" title="'.dol_escape_htmltag($tooltip, 1).'" class="classfortooltip">';
if ($option=='birthday') $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/contact/perso.php?id='.$this->id.$linkclose;
else $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id.$linkclose;
$lienfin='</a>';
@ -912,7 +914,7 @@ class ActionComm extends CommonObject
$libelleshort='';
}
else
{
{
$libelle=(empty($this->libelle)?$label:$this->libelle.(($label && $label != $this->libelle)?' '.$label:''));
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($libelle)) $libelle=($langs->transnoentities("Action".$this->type_code) != "Action".$this->type_code)?$langs->transnoentities("Action".$this->type_code):$this->type_label;
$libelleshort=dol_trunc($libelle,$maxlength);

View File

@ -500,8 +500,11 @@ if ($id > 0)
{
$propal_static = new Propal($db);
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht, p.ref, p.ref_client, p.remise, ";
$sql.= " p.datep as dp, p.fin_validite as datelimite";
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht";
$sql.= ", p.tva as total_tva";
$sql.= ", p.total as total_ttc";
$sql.= ", p.ref, p.ref_client, p.remise";
$sql.= ", p.datep as dp, p.fin_validite as datelimite";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
$sql.= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id";
$sql.= " AND s.rowid = ".$object->id;
@ -532,9 +535,12 @@ if ($id > 0)
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td class="nowrap">';
$propal_static->id=$objp->propalid;
$propal_static->ref=$objp->ref;
$propal_static->ref_client=$objp->ref_client;
$propal_static->id = $objp->propalid;
$propal_static->ref = $objp->ref;
$propal_static->ref_client = $objp->ref_client;
$propal_static->total_ht = $objp->total_ht;
$propal_static->total_tva = $objp->total_tva;
$propal_static->total_ttc = $objp->total_ttc;
print $propal_static->getNomUrl(1);
if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) {
print " ".img_warning();
@ -561,9 +567,12 @@ if ($id > 0)
{
$commande_static=new Commande($db);
$sql = "SELECT s.nom, s.rowid,";
$sql.= " c.rowid as cid, c.total_ht, c.ref, c.ref_client, c.fk_statut, c.facture,";
$sql.= " c.date_commande as dc";
$sql = "SELECT s.nom, s.rowid";
$sql.= ", c.rowid as cid, c.total_ht";
$sql.= ", c.tva as total_tva";
$sql.= ", c.total_ttc";
$sql.= ", c.ref, c.ref_client, c.fk_statut, c.facture";
$sql.= ", c.date_commande as dc";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
$sql.= " WHERE c.fk_soc = s.rowid ";
$sql.= " AND s.rowid = ".$object->id;
@ -610,9 +619,12 @@ if ($id > 0)
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td class="nowrap">';
$commande_static->id=$objp->cid;
$commande_static->ref=$objp->ref;
$commande_static->id = $objp->cid;
$commande_static->ref = $objp->ref;
$commande_static->ref_client=$objp->ref_client;
$commande_static->total_ht = $objp->total_ht;
$commande_static->total_tva = $objp->total_tva;
$commande_static->total_ttc = $objp->total_ttc;
print $commande_static->getNomUrl(1);
print '</td><td align="right" width="80">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n";
print '<td align="right" style="min-width: 60px">'.price($objp->total_ht).'</td>';
@ -751,15 +763,18 @@ if ($id > 0)
{
$facturestatic = new Facture($db);
$sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.amount, f.total, f.total_ttc,';
$sql.= ' f.datef as df, f.datec as dc, f.paye as paye, f.fk_statut as statut,';
$sql.= ' s.nom, s.rowid as socid,';
$sql.= ' SUM(pf.amount) as am';
$sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.amount';
$sql.= ', f.total';
$sql.= ', f.tva as total_tva';
$sql.= ', f.total_ttc';
$sql.= ', f.datef as df, f.datec as dc, f.paye as paye, f.fk_statut as statut';
$sql.= ', s.nom, s.rowid as socid';
$sql.= ', SUM(pf.amount) as am';
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON f.rowid=pf.fk_facture';
$sql.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$object->id;
$sql.= " AND f.entity = ".$conf->entity;
$sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.amount, f.total, f.total_ttc,';
$sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.amount, f.total, f.tva, f.total_ttc,';
$sql.= ' f.datef, f.datec, f.paye, f.fk_statut,';
$sql.= ' s.nom, s.rowid';
$sql.= " ORDER BY f.datef DESC, f.datec DESC";
@ -788,9 +803,12 @@ if ($id > 0)
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td class="nowrap">';
$facturestatic->id=$objp->facid;
$facturestatic->ref=$objp->facnumber;
$facturestatic->type=$objp->type;
$facturestatic->id = $objp->facid;
$facturestatic->ref = $objp->facnumber;
$facturestatic->type = $objp->type;
$facturestatic->total_ht = $objp->total;
$facturestatic->total_tva = $objp->total_tva;
$facturestatic->total_ttc = $objp->total_ttc;
print $facturestatic->getNomUrl(1);
print '</td>';
if ($objp->df > 0)

View File

@ -142,7 +142,7 @@ if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire)
*/
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, s.rowid as socid, s.nom as name, s.client, s.canvas";
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -173,6 +173,9 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
$propalstatic->id=$obj->rowid;
$propalstatic->ref=$obj->ref;
$propalstatic->ref_client=$obj->ref_client;
$propalstatic->total_ht = $obj->total_ht;
$propalstatic->total_tva = $obj->total_tva;
$propalstatic->total_ttc = $obj->total_ttc;
print $propalstatic->getNomUrl(1);
print '</td>';
print '<td class="nowrap">';
@ -210,7 +213,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
{
$langs->load("orders");
$sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
$sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -241,6 +244,9 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
$orderstatic->id=$obj->rowid;
$orderstatic->ref=$obj->ref;
$orderstatic->ref_client=$obj->ref_client;
$orderstatic->total_ht = $obj->total_ht;
$orderstatic->total_tva = $obj->total_tva;
$orderstatic->total_ttc = $obj->total_ttc;
print $orderstatic->getNomUrl(1);
print '</td>';
print '<td class="nowrap">';
@ -469,7 +475,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
$langs->load("propal");
$sql = "SELECT s.nom as name, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql = "SELECT s.nom as name, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.tva as total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."propal as p";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -506,6 +512,9 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
$propalstatic->id=$obj->propalid;
$propalstatic->ref=$obj->ref;
$propalstatic->ref_client=$obj->ref_client;
$propalstatic->total_ht = $obj->total_ht;
$propalstatic->total_tva = $obj->total_tva;
$propalstatic->total_ttc = $obj->total_ttc;
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowrap">';

View File

@ -2605,9 +2605,17 @@ class Propal extends CommonObject
global $langs;
$result='';
$label=$langs->trans("ShowPropal").': '.$this->ref;
$label = '<u>' . $langs->trans("ShowPropal") . '</u>';
if (! empty($this->ref))
$label.= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (! empty($this->ref_client))
$label.= '<br>'.$langs->trans('RefCustomer').': '.$this->ref_client;
$label.= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
if (! empty($this->total_ht))
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_tva))
$label.= '<br><b>' . $langs->trans('TVA') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_ttc))
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option == '') {
$lien = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$this->id. $get_params .$linkclose;
@ -2646,7 +2654,8 @@ class Propal extends CommonObject
$sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.fk_product_fournisseur_price as fk_fournprice, pt.buy_price_ht as pa_ht, pt.special_code, pt.localtax1_tx, pt.localtax2_tx,';
$sql.= ' pt.date_start, pt.date_end, pt.product_type, pt.rang, pt.fk_parent_line,';
$sql.= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid,';
$sql.= ' p.description as product_desc';
$sql.= ' p.description as product_desc,';
$sql.= ' p.entity';
$sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product=p.rowid';
$sql.= ' WHERE pt.fk_propal = '.$this->id;
@ -2670,9 +2679,10 @@ class Propal extends CommonObject
$this->lines[$i]->description = $obj->description;
$this->lines[$i]->fk_product = $obj->fk_product;
$this->lines[$i]->ref = $obj->ref;
$this->lines[$i]->entity = $obj->entity; // Product entity
$this->lines[$i]->product_label = $obj->product_label;
$this->lines[$i]->product_desc = $obj->product_desc;
$this->lines[$i]->fk_product_type = $obj->fk_product_type; // deprecated
$this->lines[$i]->fk_product_type = $obj->fk_product_type; // deprecated
$this->lines[$i]->product_type = $obj->product_type;
$this->lines[$i]->qty = $obj->qty;
$this->lines[$i]->subprice = $obj->subprice;

View File

@ -9,7 +9,7 @@
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -3104,7 +3104,8 @@ class Commande extends CommonOrder
$sql.= ' l.total_ht, l.total_tva, l.total_ttc, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht, l.localtax1_tx, l.localtax2_tx,';
$sql.= ' l.date_start, l.date_end,';
$sql.= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, ';
$sql.= ' p.description as product_desc, p.stock as stock_reel';
$sql.= ' p.description as product_desc, p.stock as stock_reel,';
$sql.= ' p.entity';
$sql.= ' FROM '.MAIN_DB_PREFIX.'commandedet as l';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product=p.rowid';
$sql.= ' WHERE l.fk_commande = '.$this->id;
@ -3126,6 +3127,7 @@ class Commande extends CommonOrder
$this->lines[$i]->description = $obj->description;
$this->lines[$i]->fk_product = $obj->fk_product;
$this->lines[$i]->ref = $obj->ref;
$this->lines[$i]->entity = $obj->entity; // Product entity
$this->lines[$i]->product_label = $obj->product_label;
$this->lines[$i]->product_desc = $obj->product_desc;
$this->lines[$i]->fk_product_type = $obj->fk_product_type;

View File

@ -935,7 +935,12 @@ class Account extends CommonObject
global $langs;
$result='';
$linkclose = '" title="'.dol_escape_htmltag($this->label, 1).'" class="classfortooltip">';
$label = '<u>' . $langs->trans("ShowAccount") . '</u>';
if (! empty($this->label))
$label .= '<br><b>' . $langs->trans('Account') . ':</b> ' . $this->label;
if (! empty($this->number))
$label .= '<br><b>' . $langs->trans('AccountNumber') . ':</b> ' . $this->number;
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if (empty($mode))
{
@ -948,7 +953,7 @@ class Account extends CommonObject
$lienfin='</a>';
}
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowAccount").': '.$this->label, 'account', 'class="classfortooltip"').$lienfin.' ');
if ($withpicto) $result.=($lien.img_object($label, 'account', 'class="classfortooltip"').$lienfin.' ');
$result.=$lien.$this->label.$lienfin;
return $result;
}

View File

@ -391,10 +391,9 @@ else
}
}
elseif ($links[$key]['type']=='company') {
print '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowCustomer'),'company').' ';
print dol_trunc($links[$key]['label'],24);
print '</a>';
$societestatic->id = $links[$key]['url_id'];
$societestatic->name = $links[$key]['label'];
print $societestatic->getNomUrl(1, 'company', 24);
$newline=0;
}
elseif ($links[$key]['type']=='member') {

View File

@ -858,9 +858,17 @@ class Facture extends CommonInvoice
if ($this->type == self::TYPE_CREDIT_NOTE) $picto.='a'; // Credit note
if ($this->type == self::TYPE_DEPOSIT) $picto.='d'; // Deposit invoice
$label=$langs->trans("ShowInvoice").': '.$this->ref;
$label = '<u>' . $langs->trans("ShowInvoice") . '</u>';
if (! empty($this->ref))
$label .= '<br><b>'.$langs->trans('Ref') . ':</b> ' . $this->ref;
if (! empty($this->ref_client))
$label.= '<br>' . $langs->trans('RefCustomer') . $this->ref_client;
$label .= '<br><b>' . $langs->trans('RefCustomer') . ':</b> ' . $this->ref_client;
if (! empty($this->total_ht))
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_tva))
$label.= '<br><b>' . $langs->trans('TVA') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_ttc))
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
if ($this->type == self::TYPE_REPLACEMENT) $label=$langs->transnoentitiesnoconv("ShowInvoiceReplace").': '.$this->ref;
if ($this->type == self::TYPE_CREDIT_NOTE) $label=$langs->transnoentitiesnoconv("ShowInvoiceAvoir").': '.$this->ref;
if ($this->type == self::TYPE_DEPOSIT) $label=$langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref;
@ -3330,7 +3338,8 @@ class Facture extends CommonInvoice
$sql.= ' l.total_ht, l.total_tva, l.total_ttc, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,';
$sql.= ' l.date_start, l.date_end,';
$sql.= ' p.ref as product_ref, p.fk_product_type, p.label as product_label,';
$sql.= ' p.description as product_desc';
$sql.= ' p.description as product_desc,';
$sql.= ' p.entity';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product=p.rowid';
$sql.= ' WHERE l.fk_facture = '.$this->id;
@ -3353,6 +3362,7 @@ class Facture extends CommonInvoice
$this->lines[$i]->description = $obj->description;
$this->lines[$i]->fk_product = $obj->fk_product;
$this->lines[$i]->ref = $obj->product_ref;
$this->lines[$i]->entity = $obj->entity; // Product entity
$this->lines[$i]->product_label = $obj->product_label;
$this->lines[$i]->product_desc = $obj->product_desc;
$this->lines[$i]->fk_product_type = $obj->fk_product_type;

View File

@ -144,8 +144,12 @@ if (! empty($conf->don->enabled) && $user->rights->don->lire)
*/
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,";
$sql.= " s.nom as name, s.rowid as socid";
$sql = "SELECT f.facnumber";
$sql.= ", f.rowid, f.total as total_ht, f.tva as total_tva, f.total_ttc";
$sql.= ", f.type";
$sql.= ", s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ",s.code_client";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -180,13 +184,18 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print '<tr '.$bc[$var].'><td class="nowrap">';
$facturestatic->ref=$obj->facnumber;
$facturestatic->id=$obj->rowid;
$facturestatic->total_ht=$obj->total_ht;
$facturestatic->total_tva=$obj->total_tva;
$facturestatic->total_ttc=$obj->total_ttc;
$facturestatic->type=$obj->type;
print $facturestatic->getNomUrl(1,'');
print '</td>';
print '<td class="nowrap">';
$companystatic->id=$obj->socid;
$companystatic->name=$obj->name;
$companystatic->client=1;
$companystatic->client = 1;
$companystatic->code_client = $obj->code_client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
print $companystatic->getNomUrl(1,'',16);
print '</td>';
print '<td align="right" class="nowrap">'.price($obj->total_ttc).'</td>';
@ -218,8 +227,10 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
*/
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
{
$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.type,";
$sql.= " s.nom as name, s.rowid as socid";
$sql = "SELECT f.ref, f.rowid, f.total_ht, f.tva as total_tva, f.total_ttc, f.type";
$sql.= ", s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_fournisseur";
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.rowid = f.fk_soc AND f.fk_statut = 0";
@ -249,14 +260,19 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print '<tr '.$bc[$var].'><td class="nowrap">';
$facturesupplierstatic->ref=$obj->ref;
$facturesupplierstatic->id=$obj->rowid;
$facturesupplierstatic->total_ht=$obj->total_ht;
$facturesupplierstatic->total_tva=$obj->total_tva;
$facturesupplierstatic->total_ttc=$obj->total_ttc;
$facturesupplierstatic->type=$obj->type;
print $facturesupplierstatic->getNomUrl(1,'',16);
print '</td>';
print '<td>';
$companystatic->id=$obj->socid;
$companystatic->name=$obj->name;
$companystatic->client=1;
print $companystatic->getNomUrl(1,'',16);
$companystatic->fournisseur = 1;
$companystatic->code_client = $obj->code_client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
print $companystatic->getNomUrl(1,'supplier',16);
print '</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>';
print '</tr>';
@ -292,10 +308,12 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
$langs->load("boxes");
$facstatic=new Facture($db);
$sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.type, f.total, f.total_ttc, f.paye, f.tms,";
$sql.= " f.date_lim_reglement as datelimite,";
$sql.= " s.nom as name, s.rowid as socid,";
$sql.= " sum(pf.amount) as am";
$sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.type, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.paye, f.tms";
$sql.= ", f.date_lim_reglement as datelimite";
$sql.= ", s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_client";
$sql.= ", sum(pf.amount) as am";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -335,6 +353,9 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print '<td width="110" class="nobordernopadding nowrap">';
$facturestatic->ref=$obj->facnumber;
$facturestatic->id=$obj->rowid;
$facturestatic->total_ht=$obj->total_ht;
$facturestatic->total_tva=$obj->total_tva;
$facturestatic->total_ttc=$obj->total_ttc;
$facturestatic->type=$obj->type;
print $facturestatic->getNomUrl(1,'');
print '</td>';
@ -353,9 +374,11 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
$thirdpartystatic->id=$obj->socid;
$thirdpartystatic->name=$obj->name;
$thirdpartystatic->client=1;
$thirdpartystatic->code_client = $obj->code_client;
$thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
print $thirdpartystatic->getNomUrl(1,'customer',44);
print '</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total).'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->tms),'day').'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).'</td>';
@ -391,8 +414,10 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
$langs->load("boxes");
$facstatic=new FactureFournisseur($db);
$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.tms, ff.paye";
$sql.= ", s.nom as name, s.rowid as socid";
$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.tms, ff.paye";
$sql.= ", s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_fournisseur";
$sql.= ", SUM(pf.amount) as am";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
@ -401,7 +426,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
$sql.= " AND ff.entity = ".$conf->entity;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($socid) $sql.= " AND ff.fk_soc = ".$socid;
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.tms, ff.paye, s.nom, s.rowid";
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_ttc, ff.tms, ff.paye, s.nom, s.rowid";
$sql.= " ORDER BY ff.tms DESC ";
$sql.= $db->plimit($max, 0);
@ -427,13 +452,18 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
$obj = $db->fetch_object($resql);
print '<tr '.$bc[$var].'><td>';
$facstatic->ref=$obj->ref;
$facstatic->id=$obj->rowid;
$facstatic->id = $obj->rowid;
$facstatic->total_ht = $obj->total_ht;
$facstatic->total_tva = $obj->total_tva;
$facstatic->total_ttc = $obj->total_ttc;
print $facstatic->getNomUrl(1,'');
print '</td>';
print '<td>';
$thirdpartystatic->id=$obj->socid;
$thirdpartystatic->name=$obj->name;
$thirdpartystatic->fournisseur=1;
$thirdpartystatic->code_client = $obj->code_client;
$thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
print $thirdpartystatic->getNomUrl(1,'supplier',44);
print '</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
@ -612,9 +642,11 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
$commandestatic=new Commande($db);
$langs->load("orders");
$sql = "SELECT sum(f.total) as tot_fht, sum(f.total_ttc) as tot_fttc,";
$sql.= " s.nom as name, s.rowid as socid,";
$sql.= " c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.total_ttc";
$sql = "SELECT sum(f.total) as tot_fht, sum(f.total_ttc) as tot_fttc";
$sql.= ", s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_client";
$sql.= ", c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.tva as total_tva, c.total_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ", ".MAIN_DB_PREFIX."commande as c";
@ -677,6 +709,8 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
$societestatic->id=$obj->socid;
$societestatic->name=$obj->name;
$societestatic->client=1;
$societestatic->code_client = $obj->code_client;
$societestatic->code_fournisseur = $obj->code_fournisseur;
print $societestatic->getNomUrl(1,'customer',44);
print '</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
@ -715,10 +749,12 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$facstatic=new Facture($db);
$sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total, f.total_ttc, f.paye, f.tms,";
$sql.= " f.date_lim_reglement as datelimite,";
$sql.= " s.nom as name, s.rowid as socid,";
$sql.= " sum(pf.amount) as am";
$sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.paye, f.tms";
$sql.= ", f.date_lim_reglement as datelimite";
$sql.= ", s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_client";
$sql.= ", sum(pf.amount) as am";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -758,6 +794,9 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print '<td width="110" class="nobordernopadding nowrap">';
$facturestatic->ref=$obj->facnumber;
$facturestatic->id=$obj->rowid;
$facturestatic->total_ht=$obj->total_ht;
$facturestatic->total_tva=$obj->total_tva;
$facturestatic->total_ttc=$obj->total_ttc;
$facturestatic->type=$obj->type;
print $facturestatic->getNomUrl(1,'');
print '</td>';
@ -776,9 +815,11 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
$societestatic->id=$obj->socid;
$societestatic->name=$obj->name;
$societestatic->client=1;
$societestatic->code_client = $obj->code_client;
$societestatic->code_fournisseur = $obj->code_fournisseur;
print $societestatic->getNomUrl(1,'customer',44);
print '</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total).'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.price($obj->am).'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).'</td>';
@ -820,9 +861,12 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
{
$facstatic=new FactureFournisseur($db);
$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.paye,";
$sql.= " s.nom as name, s.rowid as socid,";
$sql.= " sum(pf.amount) as am";
$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.paye";
$sql.= ", s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_client";
$sql.= ", s.code_fournisseur";
$sql.= ", sum(pf.amount) as am";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -832,7 +876,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
$sql.= " AND ff.fk_statut = 1";
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($socid) $sql.= " AND ff.fk_soc = ".$socid;
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.paye,";
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_ttc, ff.paye,";
$sql.= " s.nom, s.rowid";
$resql=$db->query($sql);
@ -859,12 +903,17 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print '<tr '.$bc[$var].'><td>';
$facstatic->ref=$obj->ref;
$facstatic->id=$obj->rowid;
$facstatic->id = $obj->rowid;
$facstatic->total_ht = $obj->total_ht;
$facstatic->total_tva = $obj->total_tva;
$facstatic->total_ttc = $obj->total_ttc;
print $facstatic->getNomUrl(1,'');
print '</td>';
$societestatic->id=$obj->socid;
$societestatic->name=$obj->name;
$societestatic->client=0;
$societestatic->code_client = $obj->code_client;
$societestatic->code_fournisseur = $obj->code_fournisseur;
print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>';

View File

@ -887,7 +887,8 @@ class Contact extends CommonObject
global $langs;
$result='';
$label = $langs->trans("ShowContact").': '.$this->getFullName($langs);
$label = '<u>' . $langs->trans("ShowContact") . '</u>';
$label.= '<br><b>' . $langs->trans("Name") . ':</b> '.$this->getFullName($langs);
$lien = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Charles-Fr BENKE <charles.fr@benke.fr>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -55,15 +56,20 @@ class box_actions extends ModeleBoxes
$this->max=$max;
include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$actionstatic=new ActionComm($db);
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$societestatic = new Societe($db);
$actionstatic = new ActionComm($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastActionsToDo",$max));
if ($user->rights->agenda->myactions->read) {
$sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage,";
$sql.= " ta.code, ta.libelle as type_label,";
$sql.= " s.nom as name, s.rowid as socid";
$sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage";
$sql.= ", ta.code";
$sql.= ", ta.libelle as type_label";
$sql.= ", s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_client";
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, ";
$sql.= MAIN_DB_PREFIX."actioncomm AS a)";
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
@ -81,62 +87,52 @@ class box_actions extends ModeleBoxes
$result = $db->query($sql);
if ($result) {
$now=dol_now();
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
$delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
$num = $db->num_rows($result);
$i = 0;
while ($i < $num) {
$late = '';
$objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->dp);
$datelimite = $db->jdate($objp->dp);
$actionstatic->label = $objp->label;
$actionstatic->type_label = $objp->type_label;
$actionstatic->code = $objp->code;
$societestatic->id = $objp->socid;
$societestatic->name = $objp->name;
$societestatic->code_client = $objp->code_client;
if ($objp->percentage >= 0 && $objp->percentage < 100 && $datelimite < ($now - $delay_warning)) $late=img_warning($langs->trans("Late"));
if ($objp->percentage >= 0 && $objp->percentage < 100 && $datelimite < ($now - $delay_warning))
$late=img_warning($langs->trans("Late"));
//($langs->transnoentities("Action".$objp->code)!=("Action".$objp->code) ? $langs->transnoentities("Action".$objp->code) : $objp->label)
$label=empty($objp->label)?$objp->type_label:$objp->label;
$label = empty($objp->label)?$objp->type_label:$objp->label;
$tooltip = $langs->trans('Action'.$objp->code).': '.$label;
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => ("action"),
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/comm/action/card.php?id=".$objp->id,
);
$this->info_box_contents[$i][1] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => dol_trunc($label,32),
'text' => $actionstatic->getNomUrl(1),
'text2'=> $late,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/comm/action/card.php?id=".$objp->id,
'asis' => 1,
);
$tooltip = $langs->trans('Customer').': '.$objp->name;
$this->info_box_contents[$i][2] = array(
'td' => 'align="left" width="16"',
'logo' => ($objp->socid?'company':''),
'tooltip' => $tooltip,
'url' => ($objp->socid?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid:''),
);
$this->info_box_contents[$i][3] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => dol_trunc($objp->name,24),
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid,
'text' => $societestatic->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$i][4] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left" class="nowrap"',
'text' => dol_print_date($datelimite, "dayhour"),
);
$this->info_box_contents[$i][5] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => ($objp->percentage>= 0?$objp->percentage.'%':''),
);
$this->info_box_contents[$i][6] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right" width="18"',
'text' => $actionstatic->LibStatut($objp->percentage,3),
);

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2012 Charles-François BENKE <charles.fr@benke.fr>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Frederic France <frederic.france@free.fr>
* Copyright (C) 2014-2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -75,7 +75,6 @@ class box_activity extends ModeleBoxes
$totalnb = 0;
$i = 0;
$cachetime = 3600;
$cachedir = DOL_DATA_ROOT.'/cache/boxes';
$fileid = '-e'.$conf->entity.'-u'.$user->id.'-s'.$user->societe_id.'-r'.($user->rights->societe->client->voir?'1':'0').'.cache';
$now = dol_now();
$nbofyears=2;
@ -95,6 +94,7 @@ class box_activity extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic=new Facture($db);
$cachedir = DOL_DATA_ROOT.'/facture/temp';
$filename = '/boxactivity-invoice'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
@ -177,6 +177,7 @@ class box_activity extends ModeleBoxes
);
}
$cachedir = DOL_DATA_ROOT.'/facture/temp';
$filename = '/boxactivity-invoice2'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
@ -262,6 +263,7 @@ class box_activity extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$commandestatic=new Commande($db);
$cachedir = DOL_DATA_ROOT.'/commande/temp';
$filename = '/boxactivity-order'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array();
@ -344,6 +346,7 @@ class box_activity extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$propalstatic=new Propal($db);
$cachedir = DOL_DATA_ROOT.'/propale/temp';
$filename = '/boxactivity-propal'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array();
@ -383,7 +386,7 @@ class box_activity extends ModeleBoxes
if (! empty($data)) {
$j=0;
while ($i < count($data)) {
$this->info_box_contents[$i][0] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;viewstatut=".$data[$j]->fk_statut,
'tooltip' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0),
@ -391,12 +394,12 @@ class box_activity extends ModeleBoxes
);
$objp = $db->fetch_object($result);
$this->info_box_contents[$i][1] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0),
);
$this->info_box_contents[$i][2] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => $data[$j]->nb,
'tooltip' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0),
@ -404,12 +407,12 @@ class box_activity extends ModeleBoxes
);
$totalnb += $data[$j]->nb;
$this->info_box_contents[$i][3] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
);
$totalMnt += $data[$j]->Mnttot;
$this->info_box_contents[$i][4] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right" width="18"',
'text' => $propalstatic->LibStatut($data[$j]->fk_statut,3),
);

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -79,7 +80,13 @@ class box_clients extends ModeleBoxes
if ($user->rights->societe->lire)
{
$sql = "SELECT s.nom as name, s.rowid as socid, s.datec, s.tms, s.status";
$sql = "SELECT s.nom as name, s.rowid as socid";
$sql.= ", s.code_client";
$sql.= ", s.client";
$sql.= ", s.code_fournisseur";
$sql.= ", s.fournisseur";
$sql.= ", s.logo";
$sql.= ", s.datec, s.tms, s.status";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.client IN (1, 3)";
@ -103,26 +110,26 @@ class box_clients extends ModeleBoxes
$objp = $db->fetch_object($result);
$datec=$db->jdate($objp->datec);
$datem=$db->jdate($objp->tms);
$thirdpartystatic->id = $objp->socid;
$thirdpartystatic->name = $objp->name;
$thirdpartystatic->code_client = $objp->code_client;
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
$thirdpartystatic->client = $objp->client;
$thirdpartystatic->fournisseur = $objp->fournisseur;
$thirdpartystatic->logo = $objp->logo;
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $langs->trans('Customer').': '.$objp->name,
'url' => $url.$objp->socid
);
$this->info_box_contents[$i][1] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->name,
'tooltip' => $langs->trans('Customer').': '.$objp->name,
'url' => $url.$objp->socid
'text' => $thirdpartystatic->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$i][2] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => dol_print_date($datem, "day")
);
$this->info_box_contents[$i][3] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right" width="18"',
'text' => $thirdpartystatic->LibStatut($objp->status,3)
);

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -53,20 +54,33 @@ class box_commandes extends ModeleBoxes
{
global $user, $langs, $db, $conf;
$this->max=$max;
$this->max = $max;
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$commandestatic=new Commande($db);
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$commandestatic = new Commande($db);
$societestatic = new Societe($db);
$userstatic = new User($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."CustomerOrders",$max));
if ($user->rights->commande->lire)
{
$sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " c.ref, c.tms, c.rowid, c.date_commande,";
$sql.= " c.fk_statut, c.fk_user_valid, c.facture, c.total_ht";
$sql = "SELECT s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_client";
$sql.= ", s.logo";
$sql.= ", c.ref, c.tms";
$sql.= ", c.rowid";
$sql.= ", c.date_commande";
$sql.= ", c.ref_client";
$sql.= ", c.fk_statut";
$sql.= ", c.fk_user_valid";
$sql.= ", c.facture";
$sql.= ", c.total_ht";
$sql.= ", c.tva as total_tva";
$sql.= ", c.total_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."commande as c";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -89,32 +103,27 @@ class box_commandes extends ModeleBoxes
$objp = $db->fetch_object($result);
$date=$db->jdate($objp->date_commande);
$datem=$db->jdate($objp->tms);
$commandestatic->id = $objp->rowid;
$commandestatic->ref = $objp->ref;
$commandestatic->ref_client = $objp->ref_client;
$commandestatic->total_ht = $objp->total_ht;
$commandestatic->total_tva = $objp->total_tva;
$commandestatic->total_ttc = $objp->total_ttc;
$societestatic->id = $objp->socid;
$societestatic->name = $objp->name;
$societestatic->code_client = $objp->code_client;
$societestatic->logo = $objp->logo;
$this->info_box_contents[$i][] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $langs->trans('Order').': '.$objp->ref,
'url' => DOL_URL_ROOT."/commande/card.php?id=".$objp->rowid,
'td' => 'align="left"',
'text' => $commandestatic->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->ref,
'tooltip' => $langs->trans('Order').': '.$objp->ref,
'url' => DOL_URL_ROOT."/commande/card.php?id=".$objp->rowid,
);
$this->info_box_contents[$i][] = array(
'td' => 'align="left" width="16"',
'logo' => 'company',
'tooltip' => $langs->trans('Customer').': '.$objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
);
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->name,
'tooltip' => $langs->trans('Customer').': '.$objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
'text' => $societestatic->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$i][] = array(
@ -127,7 +136,7 @@ class box_commandes extends ModeleBoxes
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => (($objp->fk_user_valid > 0)?$userstatic->getNomUrl(1):''),
'url' => (($objp->fk_user_valid > 0)?DOL_URL_ROOT.'/user/card.php?id='.$objp->fk_user_valid:''),
'asis' => 1,
);
}

View File

@ -3,6 +3,7 @@
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -102,31 +103,24 @@ class box_comptes extends ModeleBoxes
$objp = $db->fetch_object($result);
$account_static->id = $objp->rowid;
$account_static->label = $objp->label;
$account_static->number = $objp->number;
$solde=$account_static->solde(0);
$solde_total[$objp->currency_code] += $solde;
$tooltip = $langs->trans('Account').': '.$objp->label . '<br>' . $langs->trans('AccountNumber').': '.$objp->number;
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid,
);
$this->info_box_contents[$i][1] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->label,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid,
'text' => $account_static->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$i][2] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->number,
);
$this->info_box_contents[$i][3] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => price($solde, 0, $langs, 0, -1, -1, $objp->currency_code)
);
@ -136,21 +130,17 @@ class box_comptes extends ModeleBoxes
// Total
foreach ($solde_total as $key=>$solde) {
$this->info_box_contents[$i][0] = array(
$this->info_box_contents[$i][] = array(
'tr' => 'class="liste_total"',
'td' => 'align="right" class="liste_total"',
'text' => '&nbsp;',
);
$this->info_box_contents[$i][1] = array(
'td' => 'align="left" class="liste_total"',
'text' => $langs->trans('Total').' '.$key,
);
$this->info_box_contents[$i][2] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right" class="liste_total"',
'text' => '&nbsp;'
);
$this->info_box_contents[$i][3] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right" class="liste_total"',
'text' => price($solde, 0, $langs, 0, -1, -1, $key)
);

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -92,35 +93,19 @@ class box_contacts extends ModeleBoxes
$societestatic->id=$objp->fk_soc;
$societestatic->name=$objp->socname;
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $langs->trans('Contact').': '.$contactstatic->getFullName($langs,0),
'url' => DOL_URL_ROOT."/contact/card.php?id=".$objp->rowid,
);
$this->info_box_contents[$i][1] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $contactstatic->getFullName($langs,0),
'tooltip' => $langs->trans('Contact').': '.$contactstatic->getFullName($langs,0),
'url' => DOL_URL_ROOT."/contact/card.php?id=".$objp->rowid,
'text' => $contactstatic->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$i][2] = array(
'td' => 'align="left" width="16"',
'logo' => ($objp->fk_soc > 0?'company':''),
'tooltip' => $societestatic->name,
'url' => ($objp->fk_soc > 0?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->fk_soc:''),
);
$this->info_box_contents[$i][3] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $societestatic->name,
'tooltip' => $societestatic->name,
'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->fk_soc,
'text' => $societestatic->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$i][4] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => dol_print_date($datem, "day"),
);

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -3,6 +3,7 @@
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -53,8 +54,11 @@ class box_factures extends ModeleBoxes
$this->max=$max;
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic=new Facture($db);
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$facturestatic=new Facture($db);
$societestatic = new Societe($db);
$text = $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."CustomerBills",$max);
$this->info_box_head = array(
@ -62,11 +66,16 @@ class box_factures extends ModeleBoxes
'limit'=> dol_strlen($text)
);
if ($user->rights->facture->lire)
{
$sql = "SELECT f.rowid as facid, f.facnumber, f.type, f.total as total_ht, f.datef as df";
if ($user->rights->facture->lire) {
$sql = "SELECT f.rowid as facid";
$sql.= ", f.facnumber, f.type, f.total as total_ht";
$sql.= ", f.tva as total_tva";
$sql.= ", f.total_ttc";
$sql.= ", f.datef as df";
$sql.= ", f.paye, f.fk_statut, f.datec, f.tms";
$sql.= ", s.nom as name, s.rowid as socid";
$sql.= ", s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_client";
$sql.= ", f.date_lim_reglement as datelimite";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -88,60 +97,48 @@ class box_factures extends ModeleBoxes
$i = 0;
$l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)';
while ($i < $num)
{
$objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->datelimite);
$date=$db->jdate($objp->df);
$datem=$db->jdate($objp->tms);
while ($i < $num) {
$objp = $db->fetch_object($result);
$datelimite = $db->jdate($objp->datelimite);
$date = $db->jdate($objp->df);
$datem = $db->jdate($objp->tms);
$facturestatic->id = $objp->facid;
$facturestatic->ref = $objp->facnumber;
$facturestatic->type = $objp->type;
$facturestatic->total_ht = $objp->total_ht;
$facturestatic->total_tva = $objp->total_tva;
$facturestatic->total_ttc = $objp->total_ttc;
$societestatic->id = $objp->socid;
$societestatic->name = $objp->name;
$societestatic->code_client = $objp->code_client;
$picto='bill';
if ($objp->type == 1) $picto.='r';
if ($objp->type == 2) $picto.='a';
$late = '';
if ($objp->paye == 0 && ($objp->fk_statut != 2 && $objp->fk_statut != 3) && $datelimite < ($now - $conf->facture->client->warning_delay)) { $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));}
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => $picto,
'tooltip' => $langs->trans('CustomerInvoice').': '.$objp->facnumber,
'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid,
);
$this->info_box_contents[$i][1] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->facnumber,
'text' => $facturestatic->getNomUrl(1),
'text2'=> $late,
'tooltip' => $langs->trans('CustomerInvoice').': '.$objp->facnumber,
'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid,
'asis' => 1,
);
$this->info_box_contents[$i][2] = array(
'td' => 'align="left" width="16"',
'logo' => 'company',
'tooltip' => $langs->trans('Customer').': '.$objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
);
$this->info_box_contents[$i][3] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->name,
'maxlength'=>40,
'tooltip' => $langs->trans('Customer').': '.$objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
'text' => $societestatic->getNomUrl(1, '', 40),
'asis' => 1,
);
$this->info_box_contents[$i][4] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => price($objp->total_ht),
);
$this->info_box_contents[$i][5] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => dol_print_date($date,'day'),
);
$this->info_box_contents[$i][6] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3),
);
@ -173,11 +170,11 @@ class box_factures extends ModeleBoxes
}
/**
* Method to show box
* Method to show box
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @return void
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @return void
*/
function showBox($head = null, $contents = null)
{

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -55,7 +56,10 @@ class box_factures_fourn extends ModeleBoxes
$this->max=$max;
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$facturestatic=new FactureFournisseur($db);
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$facturestatic = new FactureFournisseur($db);
$societestatic = new Societe($db);
$this->info_box_head = array(
'text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."SupplierBills",$max)
@ -64,7 +68,12 @@ class box_factures_fourn extends ModeleBoxes
if ($user->rights->fournisseur->facture->lire)
{
$sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.total_ht,";
$sql.= " s.code_fournisseur,";
$sql.= " s.logo,";
$sql.= " f.rowid as facid, f.ref, f.ref_supplier,";
$sql.= " f.total_ht,";
$sql.= " f.total_tva,";
$sql.= " f.total_ttc,";
$sql.= " f.paye, f.fk_statut,";
$sql.= ' f.datef as df,';
$sql.= ' f.datec as datec,';
@ -94,47 +103,41 @@ class box_factures_fourn extends ModeleBoxes
$datelimite=$db->jdate($objp->datelimite);
$date=$db->jdate($objp->df);
$datem=$db->jdate($objp->tms);
$facturestatic->id = $objp->facid;
$facturestatic->ref = $objp->ref;
$facturestatic->total_ht = $objp->total_ht;
$facturestatic->total_tva = $objp->total_tva;
$facturestatic->total_ttc = $objp->total_ttc;
$societestatic->id = $objp->socid;
$societestatic->name = $objp->name;
$societestatic->fournisseur = 1;
$societestatic->code_fournisseur = $objp->code_fournisseur;
$societestatic->logo = $objp->logo;
$late = '';
if ($objp->paye == 0 && $datelimite && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day')));
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'<br>'.$langs->trans('RefSupplier').': '.$objp->ref_supplier,
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
);
$this->info_box_contents[$i][1] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => ($objp->ref?$objp->ref:$objp->facid),
'text' => $facturestatic->getNomUrl(1),
'text2'=> $late,
'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'<br>'.$langs->trans('RefSupplier').': '.$objp->ref_supplier,
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
'asis' => 1,
);
$this->info_box_contents[$i][2] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->ref_supplier,
'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'<br>'.$langs->trans('RefSupplier').': '.$objp->ref_supplier,
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
);
$this->info_box_contents[$i][3] = array(
'td' => 'align="left" width="16"',
'logo' => 'company',
'tooltip' => $langs->trans('Supplier').': '.$objp->name,
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
);
$this->info_box_contents[$i][4] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $objp->name,
'tooltip' => $langs->trans('Supplier').': '.$objp->name,
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
'text' => $societestatic->getNomUrl(1, 'supplier'),
'asis' => 1,
);
$this->info_box_contents[$i][5] = array(
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => dol_print_date($date,'day'),
);

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -57,15 +58,24 @@ class box_factures_imp extends ModeleBoxes
$this->max=$max;
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic=new Facture($db);
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$facturestatic = new Facture($db);
$societestatic = new Societe($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpaidCustomerBills",$max));
if ($user->rights->facture->lire)
{
$sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " s.code_client,";
$sql.= " s.logo,";
$sql.= " f.facnumber, f.date_lim_reglement as datelimite,";
$sql.= " f.type,";
$sql.= " f.amount, f.datef as df,";
$sql.= " f.total as total_ht,";
$sql.= " f.tva as total_tva,";
$sql.= " f.total_ttc,";
$sql.= " f.paye, f.fk_statut, f.rowid as facid";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -92,34 +102,43 @@ class box_factures_imp extends ModeleBoxes
{
$objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->datelimite);
$facturestatic->id = $objp->facid;
$facturestatic->ref = $objp->facnumber;
$facturestatic->type = $objp->type;
$facturestatic->total_ht = $objp->total_ht;
$facturestatic->total_tva = $objp->total_tva;
$facturestatic->total_ttc = $objp->total_ttc;
$societestatic->id = $objp->socid;
$societestatic->name = $objp->name;
$societestatic->client = 1;
$societestatic->code_client = $objp->code_client;
$societestatic->logo = $objp->logo;
$late='';
if ($datelimite < ($now - $conf->facture->client->warning_delay)) $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
'logo' => $this->boximg,
'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid);
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $facturestatic->getNomUrl(1),
'text2'=> $late,
'asis' => 1,
);
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' => $objp->facnumber,
'text2'=> $late,
'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid);
$this->info_box_contents[$i][] = array(
'td' => 'align="left"',
'text' => $societestatic->getNomUrl(1, '', 44),
'asis' => 1,
);
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
'logo' => 'company',
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][] = array(
'td' => 'align="right"',
'text' => dol_print_date($datelimite,'day'),
);
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => $objp->name,
'maxlength'=>44,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
'text' => dol_print_date($datelimite,'day'),
);
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3));
$this->info_box_contents[$i][] = array(
'td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3),
);
$i++;
}
@ -130,14 +149,18 @@ class box_factures_imp extends ModeleBoxes
}
else
{
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql));
$this->info_box_contents[0][0] = array(
'td' => 'align="left"',
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql),
);
}
}
else {
$this->info_box_contents[0][0] = array('td' => 'align="left"',
'text' => $langs->trans("ReadPermissionNotAllowed"));
$this->info_box_contents[0][0] = array(
'td' => 'align="left"',
'text' => $langs->trans("ReadPermissionNotAllowed"),
);
}
}

View File

@ -1,20 +1,21 @@
<?php
/* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/boxes/box_ficheinter.php

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2004-2006 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2012 Maxime Kohlhaas <mko@atm-consulting.fr>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,8 @@
<?php
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -3,6 +3,7 @@
/* Copyright (C) 2004-2006 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -99,13 +100,13 @@ class box_task extends ModeleBoxes
$objp = $db->fetch_object($result);
$this->info_box_contents[$i][1] = array(
'td' => 'align="left"',
'text' =>$langs->trans("Task")."&nbsp;".$taskstatic->LibStatut($objp->fk_statut,0)
'text' =>$langs->trans("Task")."&nbsp;".$taskstatic->LibStatut($objp->fk_statut,0),
);
$this->info_box_contents[$i][2] = array(
'td' => 'align="right"',
'text' => $objp->nb."&nbsp;".$langs->trans("Tasks"),
'url' => DOL_URL_ROOT."/projet/tasks/index.php?leftmenu=projects&viewstatut=".$objp->fk_statut
'url' => DOL_URL_ROOT."/projet/tasks/index.php?leftmenu=projects&viewstatut=".$objp->fk_statut,
);
$totalnb += $objp->nb;
$this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5));

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -183,13 +184,13 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
$MAXLENGTHBOX=60; // Mettre 0 pour pas de limite
$bcx=array();
$bcx = array();
$bcx[0] = 'class="box_pair"';
$bcx[1] = 'class="box_impair"';
$var = false;
$cachetime = 900; // 900 : 15mn
$cachedir = DOL_DATA_ROOT.'/cache/boxes';
$cachedir = DOL_DATA_ROOT.'/boxes/temp';
$fileid = get_class($this).'id-'.$this->box_id.'-e'.$conf->entity.'-u'.$user->id.'-s'.$user->societe_id.'.cache';
$filename = '/box-'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);

View File

@ -2691,6 +2691,8 @@ abstract class CommonObject
$product_static->type=$line->fk_product_type;
$product_static->id=$line->fk_product;
$product_static->ref=$line->ref;
if (! empty($line->entity))
$product_static->entity=$line->entity;
$text=$product_static->getNomUrl(1);
// Define output language and label

View File

@ -2,11 +2,12 @@
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <contact@altairis.fr>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -988,9 +989,11 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
}
$out.='<td width="80" class="nowrap">';
$userstatic->id=$obj->fk_user_author;
$userstatic->login=$obj->login;
$out.=$userstatic->getLoginUrl(1);
//$userstatic->id=$obj->fk_user_author;
//$userstatic->login=$obj->login;
//$out.=$userstatic->getLoginUrl(1);
$userstatic->fetch($obj->fk_user_author);
$out.=$userstatic->getNomUrl(1);
$out.='</td>';
// Statut
@ -1235,22 +1238,36 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
{
if ($histo[$key]['elementtype'] == 'propal' && ! empty($conf->propal->enabled))
{
$propalstatic->ref=$langs->trans("ProposalShort");
$propalstatic->id=$histo[$key]['fk_element'];
$out.=$propalstatic->getNomUrl(1);
}
//$propalstatic->ref=$langs->trans("ProposalShort");
//$propalstatic->id=$histo[$key]['fk_element'];
if ($propalstatic->fetch($histo[$key]['fk_element'])>0) {
$propalstatic->type=$histo[$key]['ftype'];
$out.=$propalstatic->getNomUrl(1);
} else {
$out.= $langs->trans("ProposalDeleted");
}
}
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);
}
//$orderstatic->ref=$langs->trans("Order");
//$orderstatic->id=$histo[$key]['fk_element'];
if ($orderstatic->fetch($histo[$key]['fk_element'])>0) {
$orderstatic->type=$histo[$key]['ftype'];
$out.=$orderstatic->getNomUrl(1);
} else {
$out.= $langs->trans("OrderDeleted");
}
}
elseif (($histo[$key]['elementtype'] == 'invoice' || $histo[$key]['elementtype'] == 'facture') && ! empty($conf->facture->enabled))
{
$facturestatic->ref=$langs->trans("Invoice");
$facturestatic->id=$histo[$key]['fk_element'];
$facturestatic->type=$histo[$key]['ftype'];
$out.=$facturestatic->getNomUrl(1,'compta');
//$facturestatic->ref=$langs->trans("Invoice");
//$facturestatic->id=$histo[$key]['fk_element'];
if ($facturestatic->fetch($histo[$key]['fk_element'])>0) {
$facturestatic->type=$histo[$key]['ftype'];
$out.=$facturestatic->getNomUrl(1,'compta');
} else {
$out.= $langs->trans("InvoiceDeleted");
}
}
else $out.='&nbsp;';
}
@ -1272,9 +1289,11 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
// Auteur
$out.='<td class="nowrap" width="80">';
$userstatic->id=$histo[$key]['userid'];
$userstatic->login=$histo[$key]['login'];
$out.=$userstatic->getLoginUrl(1);
//$userstatic->id=$histo[$key]['userid'];
//$userstatic->login=$histo[$key]['login'];
//$out.=$userstatic->getLoginUrl(1);
$userstatic->fetch($histo[$key]['userid']);
$out.=$userstatic->getNomUrl(1);
$out.='</td>';
// Statut

View File

@ -1217,7 +1217,9 @@ class Expedition extends CommonObject
global $langs;
$result='';
$label=$langs->trans("ShowSending").': '.$this->ref;
$label = '<u>' . $langs->trans("ShowSending") . '</u>';
if (! empty($this->ref))
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> '.$this->ref;
$url = DOL_URL_ROOT.'/expedition/card.php?id='.$this->id;

View File

@ -69,7 +69,7 @@ $shipment=new Expedition($db);
$helpurl='EN:Module_Shipments|FR:Module_Exp&eacute;ditions|ES:M&oacute;dulo_Expediciones';
llxHeader('',$langs->trans('ListOfSendings'),$helpurl);
$sql = "SELECT e.rowid, e.ref, e.date_delivery as date_expedition, l.date_delivery as date_livraison, e.fk_statut";
$sql = "SELECT e.rowid, e.ref, e.date_expedition as date_expedition, e.date_delivery as date_livraison, l.date_delivery as date_reception, e.fk_statut";
$sql.= ", s.nom as socname, s.rowid as socid";
$sql.= " FROM (".MAIN_DB_PREFIX."expedition as e";
if (!$user->rights->societe->client->voir && !$socid) // Internal user with no permission to see all
@ -120,8 +120,10 @@ if ($resql)
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"e.ref","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"],"s.nom", "", $param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateDeliveryPlanned"), $_SERVER["PHP_SELF"],"e.date_delivery","",$param, 'align="center"',$sortfield,$sortorder);
if($conf->livraison_bon->enabled) {
if($conf->expedition_bon->enabled) {
print_liste_field_titre($langs->trans("DeliveryOrder"), $_SERVER["PHP_SELF"],"e.date_expedition","",$param, '',$sortfield,$sortorder);
}
if($conf->livraison_bon->enabled) {
print_liste_field_titre($langs->trans("DateReceived"), $_SERVER["PHP_SELF"],"e.date_expedition","",$param, 'align="center"',$sortfield,$sortorder);
}
print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"],"e.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
@ -137,10 +139,12 @@ if ($resql)
print '<input class="flat" type="text" size="10" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
print '</td>';
print '<td class="liste_titre">&nbsp;</td>';
if($conf->livraison_bon->enabled) {
if($conf->expedition_bon->enabled) {
print '<td class="liste_titre">';
print '<input class="flat" size="10" type="text" name="search_ref_liv" value="'.$search_ref_liv.'"';
print '</td>';
}
if($conf->livraison_bon->enabled) {
print '<td class="liste_titre">&nbsp;</td>';
}
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
@ -178,17 +182,22 @@ if ($resql)
// Date delivery planed
print "<td align=\"center\">";
print dol_print_date($db->jdate($objp->date_expedition),"day");
print dol_print_date($db->jdate($objp->date_livraison),"day");
/*$now = time();
if ( ($now - $db->jdate($objp->date_expedition)) > $conf->warnings->lim && $objp->statutid == 1 )
{
}*/
print "</td>\n";
if($conf->livraison_bon->enabled) {
if($conf->expedition_bon->enabled) {
// Date real
print "<td align=\"center\">";
print dol_print_date($db->jdate($objp->date_livraison),"day");
print "</td>\n";
print '<td align="center">';
print dol_print_date($db->jdate($objp->date_expedition),"day");
print '</td>'."\n";
}
if($conf->livraison_bon->enabled) {
print '<td align="center">';
print dol_print_date($db->jdate($objp->date_reception),"day");
print '</td>'."\n";
}
print '<td align="right">'.$expedition->LibStatut($objp->fk_statut,5).'</td>';

View File

@ -380,7 +380,7 @@ if ($id > 0 || ! empty($ref))
$sql.= " cd.qty,";
$sql.= ' cd.date_start,';
$sql.= ' cd.date_end,';
$sql.= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid,';
$sql.= ' p.label as product_label, p.entity, p.ref, p.fk_product_type, p.rowid as prodid,';
$sql.= ' p.description as product_desc, p.fk_product_type as product_type';
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
@ -436,7 +436,8 @@ if ($id > 0 || ! empty($ref))
$commande->fetch_thirdparty();
$prod = new Product($db);
$prod->id=$objp->fk_product;
$prod->id = $objp->fk_product;
$prod->entity = $objp->entity;
$prod->getMultiLangs();
$outputlangs = $langs;
@ -461,9 +462,11 @@ if ($id > 0 || ! empty($ref))
$product_static->type=$objp->fk_product_type;
$product_static->id=$objp->fk_product;
$product_static->ref=$objp->ref;
$product_static->entity = $objp->entity;
$text=$product_static->getNomUrl(1);
$text.= ' - '.$label;
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description));
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description)).'<br>';
$description.= $product_static->show_photos($conf->product->multidir_output[$product_static->entity],1,1,0,0,0,80);
print $form->textwithtooltip($text,$description,3,'','',$i);
// Show range

View File

@ -547,7 +547,9 @@ class Fichinter extends CommonObject
global $langs;
$result='';
$label=$langs->trans("Show").': '.$this->ref;
$label = '<u>' . $langs->trans("ShowIntervention") . '</u>';
if (! empty($this->ref))
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/fichinter/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';

View File

@ -336,7 +336,7 @@ if ($object->id > 0)
}
// TODO move to DAO class
$sql = "SELECT p.rowid,p.ref, p.date_commande as dc, p.fk_statut";
$sql = "SELECT p.rowid,p.ref, p.date_commande as dc, p.fk_statut, p.total_ht, p.tva as total_tva, p.total_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
$sql.= " WHERE p.fk_soc =".$object->id;
$sql.= " AND p.entity =".$conf->entity;
@ -368,8 +368,11 @@ if ($object->id > 0)
print "<tr ".$bc[$var].">";
print '<td class="nowrap">';
$orderstatic->id=$obj->rowid;
$orderstatic->ref=$obj->ref;
$orderstatic->id = $obj->rowid;
$orderstatic->ref = $obj->ref;
$orderstatic->total_ht = $obj->total_ht;
$orderstatic->total_tva = $obj->total_tva;
$orderstatic->total_ttc = $obj->total_ttc;
print $orderstatic->getNomUrl(1);
print '</td>';
print '<td align="center" width="80">';
@ -407,7 +410,7 @@ if ($object->id > 0)
if ($user->rights->fournisseur->facture->lire)
{
// TODO move to DAO class
$sql = 'SELECT f.rowid,f.libelle,f.ref,f.ref_supplier,f.fk_statut,f.datef as df,f.total_ttc as amount,f.paye,';
$sql = 'SELECT f.rowid,f.libelle,f.ref,f.ref_supplier,f.fk_statut,f.datef as df, f.total_ht, f.total_tva, f.total_ttc as amount,f.paye,';
$sql.= ' SUM(pf.amount) as am';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn';
@ -440,6 +443,10 @@ if ($object->id > 0)
print '<a href="facture/card.php?facid='.$obj->rowid.'">';
$facturestatic->id=$obj->rowid;
$facturestatic->ref=($obj->ref?$obj->ref:$obj->rowid).($obj->ref_supplier?' - '.$obj->ref_supplier:'');
$facturestatic->ref_supplier = $obj->ref_supplier;
$facturestatic->total_ht = $obj->total_ht;
$facturestatic->total_tva = $obj->total_tva;
$facturestatic->total_ttc = $obj->total_ttc;
//$facturestatic->ref_supplier=$obj->ref_supplier;
print $facturestatic->getNomUrl(1);
//print img_object($langs->trans('ShowBill'),'bill').' '.($obj->ref?$obj->ref:$obj->rowid).' - '.$obj->ref_supplier.'</a>';

View File

@ -1472,8 +1472,17 @@ class FactureFournisseur extends CommonInvoice
global $langs;
$result='';
$label=$langs->trans("ShowInvoice").': '.$this->ref;
if ($this->ref_supplier) $label.=' / '.$this->ref_supplier;
$label = '<u>' . $langs->trans("ShowSupplierInvoice") . '</u>';
if (! empty($this->ref))
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
if (! empty($this->ref_supplier))
$label.= '<br><b>' . $langs->trans('RefSupplier') . ':</b> ' . $this->ref_supplier;
if (! empty($this->total_ht))
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_tva))
$label.= '<br><b>' . $langs->trans('TVA') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_ttc))
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
if ($option == 'document')
{

View File

@ -98,10 +98,14 @@ $offset = $conf->liste_limit * $page ;
* Mode Liste
*/
$sql = "SELECT s.rowid as socid, s.nom as name, cf.date_commande as dc,";
$sql.= " cf.rowid,cf.ref, cf.ref_supplier, cf.fk_statut, cf.total_ht, cf.tva as total_tva, cf.total_ttc, cf.fk_user_author,cf.date_livraison,";
$sql.= " p.rowid as project_id, p.ref as project_ref,";
$sql.= " u.login";
$sql = "SELECT s.rowid as socid, s.nom as name, cf.date_commande as dc";
$sql.= ", cf.rowid,cf.ref, cf.ref_supplier, cf.fk_statut, cf.total_ht, cf.tva as total_tva, cf.total_ttc, cf.fk_user_author,cf.date_livraison";
$sql.= ", p.rowid as project_id";
$sql.= ", p.ref as project_ref";
$sql.= ", u.firstname";
$sql.= ", u.lastname";
$sql.= ", u.photo";
$sql.= ", u.login";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,";
$sql.= " ".MAIN_DB_PREFIX."commande_fournisseur as cf";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON cf.fk_user_author = u.rowid";
@ -257,11 +261,14 @@ if ($resql)
print '</td>';
}
// Author
$userstatic->id=$obj->fk_user_author;
$userstatic->login=$obj->login;
// Author
$userstatic->id = $obj->fk_user_author;
$userstatic->lastname = $obj->lastname;
$userstatic->firstname = $obj->firstname;
$userstatic->login = $obj->login;
$userstatic->photo = $obj->photo;
print "<td>";
if ($userstatic->id) print $userstatic->getLoginUrl(1);
if ($userstatic->id) print $userstatic->getNomUrl(1);
else print "&nbsp;";
print "</td>";

View File

@ -1401,6 +1401,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
$form=new Form($db);
// Define link to login card
/*
$loginhtmltext=''; $logintext='';
if ($user->societe_id)
{
@ -1421,9 +1422,9 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
$loginhtmltext.='<br><b>'.$langs->trans("Administrator").'</b>: '.yn($user->admin);
$type=($user->societe_id?$langs->trans("External").$company:$langs->trans("Internal"));
$loginhtmltext.='<br><b>'.$langs->trans("Type").'</b>: '.$type;
$loginhtmltext.='<br><b>'.$langs->trans("IPAddress").'</b>: '.$_SERVER["REMOTE_ADDR"];
$loginhtmltext.='<br>';
$loginhtmltext.='<br><u>'.$langs->trans("Connection").'</u>';
$loginhtmltext.='<br><b>'.$langs->trans("IPAddress").'</b>: '.$_SERVER["REMOTE_ADDR"];
if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $loginhtmltext.='<br><b>'.$langs->trans("ConnectedOnMultiCompany").'</b>: '.$conf->entity.' (user entity '.$user->entity.')';
$loginhtmltext.='<br><b>'.$langs->trans("AuthenticationMode").'</b>: '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo)?'':' (demo)');
$loginhtmltext.='<br><b>'.$langs->trans("ConnectedSince").'</b>: '.dol_print_date($user->datelastlogin,"dayhour");
@ -1435,6 +1436,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
$loginhtmltext.='<br><b>'.$langs->trans("Browser").'</b>: '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')';
if (! empty($conf->browser->phone)) $loginhtmltext.='<br><b>'.$langs->trans("Phone").'</b>: '.$conf->browser->phone;
if (! empty($_SESSION["disablemodules"])) $loginhtmltext.='<br><b>'.$langs->trans("DisabledModules").'</b>: <br>'.join(', ',explode(',',$_SESSION["disablemodules"]));
*/
$appli='Dolibarr';
if (! empty($conf->global->MAIN_APPLICATION_TITLE))
@ -1468,7 +1470,8 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
$toprightmenu.='<div class="login_block_user">';
// Add login user link
$toprightmenu.=$form->textwithtooltip('',$loginhtmltext,2,1,$logintext,'login_block_elem2',2); // This include div class="login"
//$toprightmenu.=$form->textwithtooltip('',$loginhtmltext,2,1,$logintext,'login_block_elem2',2); // This include div class="login"
$toprightmenu.= $user->getNomurl(0, '', 1);
$toprightmenu.='</div>';
$toprightmenu.='<div class="login_block_other">';

View File

@ -2809,7 +2809,7 @@ class Product extends CommonObject
*/
function getNomUrl($withpicto=0,$option='',$maxlength=0)
{
global $langs;
global $conf, $langs;
$result='';
$newref=$this->ref;
@ -2817,10 +2817,13 @@ class Product extends CommonObject
if ($this->type == 0) $label = '<u>' . $langs->trans("ShowProduct") . '</u>';
if ($this->type == 1) $label = '<u>' . $langs->trans("ShowService") . '</u>';
if (! empty($this->ref))
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
$label .= '<br><b>' . $langs->trans('ProductRef') . ':</b> ' . $this->ref;
if (! empty($this->label))
$label .= '<br><b>' . $langs->trans('Label') . ':</b> ' . $this->label;
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$label .= '<br><b>' . $langs->trans('ProductLabel') . ':</b> ' . $this->label;
if (! empty($this->entity))
$label .= '<br>' . $this->show_photos($conf->product->multidir_output[$this->entity],1,1,0,0,0,80);
$linkclose = '" title="'.str_replace('\n', '', dol_escape_htmltag($label, 1)).'" class="classfortooltip">';
if ($option == 'supplier') {
$lien = '<a href="'.DOL_URL_ROOT.'/product/fournisseurs.php?id='.$this->id.$linkclose;

View File

@ -233,6 +233,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
*/
$max=15;
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.tosell, p.tobuy,";
$sql.= " p.entity,";
$sql.= " p.tms as datem";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " WHERE p.entity IN (".getEntity($product_static->element, 1).")";
@ -288,7 +289,9 @@ if ($result)
print '<td class="nowrap">';
$product_static->id=$objp->rowid;
$product_static->ref=$objp->ref;
$product_static->label = $objp->label;
$product_static->type=$objp->fk_product_type;
$product_static->entity = $objp->entity;
print $product_static->getNomUrl(1,'',16);
print "</td>\n";
print '<td>'.dol_trunc($objp->label,32).'</td>';

View File

@ -306,6 +306,7 @@ if ($resql)
print '<tr '.$bc[$var].'><td class="nowrap">';
$product_static->ref=$objp->ref;
$product_static->id=$objp->rowid;
$product_static->label = $objp->label;
$product_static->type=$objp->fk_product_type;
print $product_static->getNomUrl(1,'',16);
//if ($objp->stock_theorique < $objp->seuil_stock_alerte) print ' '.img_warning($langs->trans("StockTooLow"));

View File

@ -435,7 +435,8 @@ else
print "<tr ".$bc[$var].">";
print "<td>";
$productstatic->id=$objp->rowid;
$productstatic->ref=$objp->ref;
$productstatic->ref = $objp->ref;
$productstatic->label = $objp->produit;
$productstatic->type=$objp->type;
print $productstatic->getNomUrl(1,'stock',16);
print '</td>';

View File

@ -119,7 +119,7 @@ $formother=new FormOther($db);
$formproduct=new FormProduct($db);
$sql = "SELECT p.rowid, p.ref as product_ref, p.label as produit, p.fk_product_type as type,";
$sql.= " e.label as stock, e.rowid as entrepot_id,";
$sql.= " e.label as stock, e.rowid as entrepot_id, e.lieu,";
$sql.= " m.rowid as mid, m.value, m.datem, m.fk_user_author, m.label, m.fk_origin, m.origintype,";
$sql.= " u.login";
$sql.= " FROM (".MAIN_DB_PREFIX."entrepot as e,";
@ -501,6 +501,7 @@ if ($resql)
print '<td>';
$productstatic->id=$objp->rowid;
$productstatic->ref=$objp->product_ref;
$productstatic->label=$objp->produit;
$productstatic->type=$objp->type;
print $productstatic->getNomUrl(1,'',16);
print "</td>\n";
@ -515,6 +516,7 @@ if ($resql)
print '<td>';
$warehousestatic->id=$objp->entrepot_id;
$warehousestatic->libelle=$objp->stock;
$warehousestatic->lieu=$objp->lieu;
print $warehousestatic->getNomUrl(1);
print "</td>\n";
// Author

View File

@ -751,7 +751,7 @@ if ( (! empty($conf->productbatch->enabled)) && $product->hasbatch()) {
print '</tr>';
}
$sql = "SELECT e.rowid, e.label, ps.reel, ps.pmp, ps.rowid as product_stock_id";
$sql = "SELECT e.rowid, e.label, e.lieu, ps.reel, ps.pmp, ps.rowid as product_stock_id";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e,";
$sql.= " ".MAIN_DB_PREFIX."product_stock as ps";
$sql.= " WHERE ps.reel != 0";
@ -775,6 +775,7 @@ if ($resql)
$obj = $db->fetch_object($resql);
$entrepotstatic->id=$obj->rowid;
$entrepotstatic->libelle=$obj->label;
$entrepotstatic->lieu=$obj->lieu;
print '<tr '.$bc[$var].'>';
print '<td colspan="4">'.$entrepotstatic->getNomUrl(1).'</td>';
print '<td align="right">'.$obj->reel.($obj->reel<0?' '.img_warning():'').'</td>';

View File

@ -789,7 +789,11 @@ class Project extends CommonObject
$result = '';
$lien = '';
$lienfin = '';
$label = $langs->trans("ShowProject") . ': ' . $this->ref . ($this->title ? ' - ' . $this->title : '');
$label = '<u>' . $langs->trans("ShowProject") . '</u>';
if (! empty($this->ref))
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
if (! empty($this->title))
$label .= '<br><b>' . $langs->trans('Name') . ':</b> ' . $this->title;
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option != 'nolink') {

View File

@ -1720,35 +1720,56 @@ class Societe extends CommonObject
$result='';
$lien=$lienfin='';
$label = '<table width="100%">';
$label.= '<tr>';
$label.= '<td valign="top">';
if ($option == 'customer' || $option == 'compta')
{
$label.= '<u>' . $langs->trans("ShowCustomer") . '</u>';
$lien = '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id;
}
else if ($option == 'prospect' && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
{
$label.= '<u>' . $langs->trans("ShowProspect") . '</u>';
$lien = '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id;
}
else if ($option == 'supplier')
{
$label.= '<u>' . $langs->trans("ShowSupplier") . '</u>';
$lien = '<a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$this->id;
}
else if ($option == 'category')
{
$label.= '<u>' . $langs->trans("ShowCategory") . '</u>';
$lien = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=2';
}
else if ($option == 'category_supplier')
{
$label.= '<u>' . $langs->trans("ShowCategorySupplier") . '</u>';
$lien = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=1';
}
// By default
if (empty($lien))
{
$label.= '<u>' . $langs->trans("ShowCompany") . '</u>';
$lien = '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$this->id;
}
$label = $langs->trans("ShowCompany").': '.$name;
if (! empty($this->name))
$label.= '<br><b>' . $langs->trans('Name') . ':</b> '. $this->name;
if (! empty($this->code_client))
$label.= '<br><b>' . $langs->trans('CustomerCode') . ':</b> '. $this->code_client;
if (! empty($this->code_fournisseur))
$label.= '<br><b>' . $langs->trans('SupplierCode') . ':</b> '. $this->code_fournisseur;
$label.= '</td>';
if (! empty($this->logo)) {
$form = new Form($db);
$label .= '<td>&nbsp;&nbsp;</td><td align="right">' . $form->showphoto('societe', $this, 80) . '</td>';
}
$label.= '</tr></table>';
// Add type of canvas
$lien.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';

View File

@ -245,7 +245,9 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
* Last third parties modified
*/
$max=15;
$sql = "SELECT s.rowid, s.nom as name, s.client, s.fournisseur, s.canvas, s.tms as datem, s.status as status";
$sql = "SELECT s.rowid, s.nom as name, s.client, s.fournisseur";
$sql.= ", s.logo";
$sql.= ", s.canvas, s.tms as datem, s.status as status";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ' WHERE s.entity IN ('.getEntity('societe', 1).')';
@ -289,29 +291,49 @@ if ($result)
$thirdparty_static->name=$objp->name;
$thirdparty_static->client=$objp->client;
$thirdparty_static->fournisseur=$objp->fournisseur;
$thirdparty_static->logo = $objp->logo;
$thirdparty_static->datem=$db->jdate($objp->datem);
$thirdparty_static->status=$objp->status;
$thirdparty_static->canvas=$objp->canvas;
print $thirdparty_static->getNomUrl(1);
print "</td>\n";
//print $thirdparty_static->getNomUrl(1);
//print "</td>\n";
// Type
print '<td align="center">';
//print '<td align="center">';
if ($thirdparty_static->client==1 || $thirdparty_static->client==3)
{
$thirdparty_static->name=$langs->trans("Customer");
print $thirdparty_static->getNomUrl(0,'customer');
print $thirdparty_static->getNomUrl(1, 'customer');
print "</td>\n";
// Type
print '<td align="center">';
print $langs->trans("Customer");
}
if ($thirdparty_static->client == 3 && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
print $thirdparty_static->getNomUrl(1);
print "</td>\n";
// Type
print '<td align="center">';
print " / ";
}
if ($thirdparty_static->client == 3 && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print " / ";
if (($thirdparty_static->client==2 || $thirdparty_static->client==3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
{
$thirdparty_static->name=$langs->trans("Prospect");
print $thirdparty_static->getNomUrl(0,'prospect');
print $thirdparty_static->getNomUrl(1, 'prospect');
print "</td>\n";
// Type
print '<td align="center">';
print $langs->trans("Prospect");
}
if (! empty($conf->fournisseur->enabled) && $thirdparty_static->fournisseur)
{
if ($thirdparty_static->client) print " / ";
$thirdparty_static->name=$langs->trans("Supplier");
print $thirdparty_static->getNomUrl(0,'supplier');
if (! $thirdparty_static->client) {
print $thirdparty_static->getNomUrl(1, 'supplier');
print "</td>\n";
print '<td align="center">';
print $langs->trans("Supplier");
} else {
// Type
print " / ";
print $langs->trans("Supplier");
}
}
print '</td>';
// Last modified date

View File

@ -1781,12 +1781,58 @@ class User extends CommonObject
* @param string $option On what the link point to
* @return string String with URL
*/
function getNomUrl($withpicto=0,$option='')
function getNomUrl($withpicto=0, $option='', $infologin=0)
{
global $langs;
global $langs, $conf, $db;
global $dolibarr_main_authentication, $dolibarr_main_demo;
$result = '';
$companylink = '';
$label = '<u>' . $langs->trans("User") . '</u>';
$label.= '<table class="login" width="100%">';
$label.= '<tr>';
$label.= '<td valign="top">';
$label .= '<b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs,'','',24);
if (! empty($this->login))
$label .= '<br><b>' . $langs->trans('Login') . ':</b> ' . $this->login;
if (! empty($this->email))
$label .= '<br><b>' . $langs->trans("EMail").':</b> '.$this->email;
if (! empty($this->admin))
$label .= '<br><b>' . $langs->trans("Administrator").'</b>: '.yn($this->admin);
if (! empty($this->societe_id)) {
$thirdpartystatic = new Societe($db);
$thirdpartystatic->fetch($this->societe_id);
$companylink = ' ('.$thirdpartystatic->getNomUrl('','').')';
$company=' ('.$langs->trans("Company").': '.$thirdpartystatic->name.')';
}
$type=($this->societe_id?$langs->trans("External").$company:$langs->trans("Internal"));
$label .= '<br><b>' . $langs->trans("Type") . ':</b> ' . $type;
if (! empty($this->photo)) {
$form = new Form($db);
$label .= '<td>&nbsp;&nbsp;</td><td align="right">' . $form->showphoto('userphoto', $this, 80) . '</td>';
}
$label.= '</tr></table>';
// Info Login
if ($infologin) {
$label.= '<br>';
$label.= '<br><u>'.$langs->trans("Connection").'</u>';
$label.= '<br><b>'.$langs->trans("IPAddress").'</b>: '.$_SERVER["REMOTE_ADDR"];
if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $label.= '<br><b>'.$langs->trans("ConnectedOnMultiCompany").':</b> '.$conf->entity.' (user entity '.$this->entity.')';
$label.= '<br><b>'.$langs->trans("AuthenticationMode").':</b> '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo)?'':' (demo)');
$label.= '<br><b>'.$langs->trans("ConnectedSince").':</b> '.dol_print_date($this->datelastlogin,"dayhour");
$label.= '<br><b>'.$langs->trans("PreviousConnexion").':</b> '.dol_print_date($this->datepreviouslogin,"dayhour");
$label.= '<br><b>'.$langs->trans("CurrentTheme").':</b> '.$conf->theme;
$label.= '<br><b>'.$langs->trans("CurrentMenuManager").':</b> '.$menumanager->name;
$s=picto_from_langcode($langs->getDefaultLang());
$label.= '<br><b>'.$langs->trans("CurrentUserLanguage").':</b> '.($s?$s.' ':'').$langs->getDefaultLang();
$label.= '<br><b>'.$langs->trans("Browser").':</b> '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')';
if (! empty($conf->browser->phone)) $label.= '<br><b>'.$langs->trans("Phone").':</b> '.$conf->browser->phone;
if (! empty($_SESSION["disablemodules"])) $label.= '<br><b>'.$langs->trans("DisabledModules").':</b> <br>'.join(', ',explode(',',$_SESSION["disablemodules"]));
}
$result='';
$label = $langs->trans("ShowUser").': '.$this->getFullName($langs,'','',24);
$lien = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
@ -1795,7 +1841,7 @@ class User extends CommonObject
$result.=($lien.img_object($label, 'user', 'class="classfortooltip"').$lienfin);
if ($withpicto != 2) $result.=' ';
}
$result.=$lien.$this->getFullName($langs,'','',24).$lienfin;
$result.= $lien . $this->getFullName($langs,'','',24) . $companylink . $lienfin;
return $result;
}

View File

@ -98,8 +98,16 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
*/
$max=10;
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.admin, u.login, u.fk_societe, u.datec, u.statut, u.entity, u.ldap_sid,";
$sql.= " s.nom as name, s.canvas";
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.admin, u.login, u.fk_societe, u.datec, u.statut";
$sql.= ", u.entity";
$sql.= ", u.ldap_sid";
$sql.= ", u.photo";
$sql.= ", u.admin";
$sql.= ", u.email";
$sql.= ", u.skype";
$sql.= ", s.nom as name";
$sql.= ", s.code_client";
$sql.= ", s.canvas";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_societe = s.rowid";
if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->multicompany->transverse_mode || ($user->admin && ! $user->entity)))
@ -129,7 +137,18 @@ if ($resql)
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),"user").' '.dolGetFirstLastname($obj->firstname,$obj->lastname).'</a>';
print '<td>';
$fuserstatic->id = $obj->rowid;
$fuserstatic->statut = $obj->statut;
$fuserstatic->lastname = $obj->lastname;
$fuserstatic->firstname = $obj->firstname;
$fuserstatic->login = $obj->login;
$fuserstatic->photo = $obj->photo;
$fuserstatic->admin = $obj->admin;
$fuserstatic->email = $obj->email;
$fuserstatic->skype = $obj->skype;
$fuserstatic->societe_id = $obj->fk_societe;
print $fuserstatic->getNomUrl(1);
if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity)
{
print img_picto($langs->trans("SuperAdministrator"),'redstar');
@ -145,6 +164,7 @@ if ($resql)
{
$companystatic->id=$obj->fk_societe;
$companystatic->name=$obj->name;
$companystatic->code_client = $obj->code_client;
$companystatic->canvas=$obj->canvas;
print $companystatic->getNomUrl(1);
}
@ -175,8 +195,6 @@ if ($resql)
print '</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->datec),'dayhour').'</td>';
print '<td align="right">';
$fuserstatic->id=$obj->rowid;
$fuserstatic->statut=$obj->statut;
print $fuserstatic->getLibStatut(3);
print '</td>';