frederic34-tooltip

Conflicts:
	htdocs/core/boxes/box_produits.php
	htdocs/core/boxes/box_produits_alerte_stock.php
	htdocs/product/index.php
This commit is contained in:
Laurent Destailleur 2015-01-31 15:41:33 +01:00
commit d66d4f53a5
74 changed files with 1429 additions and 783 deletions

View File

@ -1563,7 +1563,8 @@ class Adherent extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowMember").': '.$this->ref; $label = '<u>' . $langs->trans("ShowMember") . '</u>';
$label.= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option == 'card') if ($option == 'card')

View File

@ -63,6 +63,7 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_ACTIVATE_HTML5", $_POST["MAIN_ACTIVATE_HTML5"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_ACTIVATE_HTML5", $_POST["MAIN_ACTIVATE_HTML5"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_ACTIVATE_FILECACHE", $_POST["MAIN_ACTIVATE_FILECACHE"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity);
@ -173,7 +174,7 @@ if ($action == 'edit') // Edit
print '</td>'; print '</td>';
print '<td width="20">&nbsp;</td>'; print '<td width="20">&nbsp;</td>';
print '</tr>'; print '</tr>';
// Activate Html5 - Developement - Only available on Eldy template // Activate Html5 - Developement - Only available on Eldy template
if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_HTML5)) if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_HTML5))
{ {
@ -185,6 +186,16 @@ if ($action == 'edit') // Edit
print '</tr>'; print '</tr>';
} }
// Activate FileCache - Developement
if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableFileCache").'</td><td>';
print $form->selectyesno('MAIN_ACTIVATE_FILECACHE',$conf->global->MAIN_ACTIVATE_FILECACHE,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
}
// Max size of lists // Max size of lists
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeList").'</td><td><input class="flat" name="main_size_liste_limit" size="4" value="' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '"></td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeList").'</td><td><input class="flat" name="main_size_liste_limit" size="4" value="' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '"></td>';
@ -363,7 +374,7 @@ else // Show
print '<tr '.$bc[$var].'><td>'.$langs->trans("EnableShowLogo").'</td><td>' . yn($conf->global->MAIN_SHOW_LOGO) . '</td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("EnableShowLogo").'</td><td>' . yn($conf->global->MAIN_SHOW_LOGO) . '</td>';
print '<td width="20">&nbsp;</td>'; print '<td width="20">&nbsp;</td>';
print "</tr>"; print "</tr>";
// Activate Html5 - Developement - Only available on Eldy template // Activate Html5 - Developement - Only available on Eldy template
if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_HTML5)) if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_HTML5))
{ {
@ -373,6 +384,14 @@ else // Show
print "</tr>"; print "</tr>";
} }
// Activate FileCache - Developement
if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("EnableFileCache").'</td><td>' . yn($conf->global->MAIN_ACTIVATE_FILECACHE) . '</td>';
print '<td width="20">&nbsp;</td>';
print "</tr>";
}
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeList").'</td><td>' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '</td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeList").'</td><td>' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '</td>';
print '<td width="20">&nbsp;</td>'; print '<td width="20">&nbsp;</td>';

View File

@ -897,9 +897,11 @@ class ActionComm extends CommonObject
global $conf,$langs; global $conf,$langs;
$result=''; $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 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; 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; else $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id.$linkclose;
$lienfin='</a>'; $lienfin='</a>';
@ -912,7 +914,7 @@ class ActionComm extends CommonObject
$libelleshort=''; $libelleshort='';
} }
else else
{ {
$libelle=(empty($this->libelle)?$label:$this->libelle.(($label && $label != $this->libelle)?' '.$label:'')); $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; 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); $libelleshort=dol_trunc($libelle,$maxlength);

View File

@ -501,8 +501,11 @@ if ($id > 0)
{ {
$propal_static = new Propal($db); $propal_static = new Propal($db);
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht, p.ref, p.remise, "; $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht";
$sql.= " p.datep as dp, p.fin_validite as datelimite"; $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.= " 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.= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id";
$sql.= " AND s.rowid = ".$object->id; $sql.= " AND s.rowid = ".$object->id;
@ -533,8 +536,12 @@ if ($id > 0)
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td class="nowrap">'; print '<td class="nowrap">';
$propal_static->id=$objp->propalid; $propal_static->id = $objp->propalid;
$propal_static->ref=$objp->ref; $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); print $propal_static->getNomUrl(1);
if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) { if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) {
print " ".img_warning(); print " ".img_warning();
@ -561,9 +568,12 @@ if ($id > 0)
{ {
$commande_static=new Commande($db); $commande_static=new Commande($db);
$sql = "SELECT s.nom, s.rowid,"; $sql = "SELECT s.nom, s.rowid";
$sql.= " c.rowid as cid, c.total_ht, c.ref, c.fk_statut, c.facture,"; $sql.= ", c.rowid as cid, c.total_ht";
$sql.= " c.date_commande as dc"; $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.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
$sql.= " WHERE c.fk_soc = s.rowid "; $sql.= " WHERE c.fk_soc = s.rowid ";
$sql.= " AND s.rowid = ".$object->id; $sql.= " AND s.rowid = ".$object->id;
@ -610,8 +620,12 @@ if ($id > 0)
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td class="nowrap">'; print '<td class="nowrap">';
$commande_static->id=$objp->cid; $commande_static->id = $objp->cid;
$commande_static->ref=$objp->ref; $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 $commande_static->getNomUrl(1);
print '</td><td align="right" width="80">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n"; 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>'; print '<td align="right" style="min-width: 60px">'.price($objp->total_ht).'</td>';
@ -750,15 +764,18 @@ if ($id > 0)
{ {
$facturestatic = new Facture($db); $facturestatic = new Facture($db);
$sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.amount, f.total, f.total_ttc,'; $sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.amount';
$sql.= ' f.datef as df, f.datec as dc, f.paye as paye, f.fk_statut as statut,'; $sql.= ', f.total';
$sql.= ' s.nom, s.rowid as socid,'; $sql.= ', f.tva as total_tva';
$sql.= ' SUM(pf.amount) as am'; $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.= " 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.= ' 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.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$object->id;
$sql.= " AND f.entity = ".$conf->entity; $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.= ' f.datef, f.datec, f.paye, f.fk_statut,';
$sql.= ' s.nom, s.rowid'; $sql.= ' s.nom, s.rowid';
$sql.= " ORDER BY f.datef DESC, f.datec DESC"; $sql.= " ORDER BY f.datef DESC, f.datec DESC";
@ -787,9 +804,12 @@ if ($id > 0)
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td class="nowrap">'; print '<td class="nowrap">';
$facturestatic->id=$objp->facid; $facturestatic->id = $objp->facid;
$facturestatic->ref=$objp->facnumber; $facturestatic->ref = $objp->facnumber;
$facturestatic->type=$objp->type; $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 $facturestatic->getNomUrl(1);
print '</td>'; print '</td>';
if ($objp->df > 0) 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) 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.= " FROM ".MAIN_DB_PREFIX."propal as p";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; 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->id=$obj->rowid;
$propalstatic->ref=$obj->ref; $propalstatic->ref=$obj->ref;
$propalstatic->ref_client=$obj->ref_client; $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 $propalstatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td class="nowrap">'; print '<td class="nowrap">';
@ -210,7 +213,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
{ {
$langs->load("orders"); $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.= " FROM ".MAIN_DB_PREFIX."commande as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; 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->id=$obj->rowid;
$orderstatic->ref=$obj->ref; $orderstatic->ref=$obj->ref;
$orderstatic->ref_client=$obj->ref_client; $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 $orderstatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td class="nowrap">'; print '<td class="nowrap">';
@ -469,7 +475,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{ {
$langs->load("propal"); $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.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."propal as p"; $sql.= ", ".MAIN_DB_PREFIX."propal as p";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; 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->id=$obj->propalid;
$propalstatic->ref=$obj->ref; $propalstatic->ref=$obj->ref;
$propalstatic->ref_client=$obj->ref_client; $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 '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowrap">'; print '<td class="nobordernopadding nowrap">';

View File

@ -2606,9 +2606,17 @@ class Propal extends CommonObject
global $langs; global $langs;
$result=''; $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)) 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">'; $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option == '') { if ($option == '') {
$lien = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$this->id. $get_params .$linkclose; $lien = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$this->id. $get_params .$linkclose;
@ -2647,7 +2655,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.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.= ' 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.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.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product=p.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product=p.rowid';
$sql.= ' WHERE pt.fk_propal = '.$this->id; $sql.= ' WHERE pt.fk_propal = '.$this->id;
@ -2671,9 +2680,10 @@ class Propal extends CommonObject
$this->lines[$i]->description = $obj->description; $this->lines[$i]->description = $obj->description;
$this->lines[$i]->fk_product = $obj->fk_product; $this->lines[$i]->fk_product = $obj->fk_product;
$this->lines[$i]->ref = $obj->ref; $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_label = $obj->product_label;
$this->lines[$i]->product_desc = $obj->product_desc; $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]->product_type = $obj->product_type;
$this->lines[$i]->qty = $obj->qty; $this->lines[$i]->qty = $obj->qty;
$this->lines[$i]->subprice = $obj->subprice; $this->lines[$i]->subprice = $obj->subprice;

View File

@ -51,8 +51,8 @@ foreach($linkedObjectBlock as $object)
{ {
$var=!$var; $var=!$var;
?> ?>
<tr <?php echo $bc[$var]; ?> ><td> <tr <?php echo $bc[$var]; ?> >
<a href="<?php echo DOL_URL_ROOT.'/comm/propal.php?id='.$object->id ?>"><?php echo img_object($langs->trans("ShowPropal"),"propal").' '.$object->ref; ?></a></td> <td><?php echo $object->getNomUrl(1); ?></td>
<td><?php echo $object->ref_client; ?></td> <td><?php echo $object->ref_client; ?></td>
<td align="center"><?php echo dol_print_date($object->date,'day'); ?></td> <td align="center"><?php echo dol_print_date($object->date,'day'); ?></td>
<td align="right"><?php <td align="right"><?php

View File

@ -9,7 +9,7 @@
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * 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 * 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 * it under the terms of the GNU General Public License as published by

View File

@ -2887,10 +2887,18 @@ class Commande extends CommonOrder
if ($short) return $url; if ($short) return $url;
$picto='order'; $picto = 'order';
$label=$langs->trans("ShowOrder").': '.$this->ref; $label = '<u>' . $langs->trans("ShowOrder") . '</u>';
if (! empty($this->ref))
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
if (! empty($this->ref_client)) 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);
$linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>'; $linkend='</a>';
@ -3099,7 +3107,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.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.= ' l.date_start, l.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.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.= ' FROM '.MAIN_DB_PREFIX.'commandedet as l';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product=p.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product=p.rowid';
$sql.= ' WHERE l.fk_commande = '.$this->id; $sql.= ' WHERE l.fk_commande = '.$this->id;
@ -3121,6 +3130,7 @@ class Commande extends CommonOrder
$this->lines[$i]->description = $obj->description; $this->lines[$i]->description = $obj->description;
$this->lines[$i]->fk_product = $obj->fk_product; $this->lines[$i]->fk_product = $obj->fk_product;
$this->lines[$i]->ref = $obj->ref; $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_label = $obj->product_label;
$this->lines[$i]->product_desc = $obj->product_desc; $this->lines[$i]->product_desc = $obj->product_desc;
$this->lines[$i]->fk_product_type = $obj->fk_product_type; $this->lines[$i]->fk_product_type = $obj->fk_product_type;

View File

@ -6,6 +6,7 @@
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -109,7 +110,7 @@ $companystatic = new Societe($db);
$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes"; $help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
llxHeader('',$langs->trans("Orders"),$help_url); llxHeader('',$langs->trans("Orders"),$help_url);
$sql = 'SELECT s.nom as name, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,'; $sql = 'SELECT s.nom as name, s.rowid as socid, s.client, s.code_client, c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client,';
$sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison, c.fk_statut, c.facture as facturee'; $sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison, c.fk_statut, c.facture as facturee';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql.= ', '.MAIN_DB_PREFIX.'commande as c'; $sql.= ', '.MAIN_DB_PREFIX.'commande as c';
@ -334,6 +335,10 @@ if ($resql)
$generic_commande->id=$objp->rowid; $generic_commande->id=$objp->rowid;
$generic_commande->ref=$objp->ref; $generic_commande->ref=$objp->ref;
$generic_commande->ref_client = $objp->ref_client;
$generic_commande->total_ht = $objp->total_ht;
$generic_commande->total_tva = $objp->total_tva;
$generic_commande->total_ttc = $objp->total_ttc;
$generic_commande->lines=array(); $generic_commande->lines=array();
$generic_commande->getLinesArray(); $generic_commande->getLinesArray();
@ -421,6 +426,7 @@ if ($resql)
// Company // Company
$companystatic->id=$objp->socid; $companystatic->id=$objp->socid;
$companystatic->code_client = $objp->code_client;
$companystatic->name=$objp->name; $companystatic->name=$objp->name;
$companystatic->client=$objp->client; $companystatic->client=$objp->client;
print '<td>'; print '<td>';

View File

@ -36,6 +36,7 @@ print_titre($langs->trans('RelatedOrders'));
<table class="noborder allwidth"> <table class="noborder allwidth">
<tr class="liste_titre"> <tr class="liste_titre">
<td><?php echo $langs->trans("Ref"); ?></td> <td><?php echo $langs->trans("Ref"); ?></td>
<td align="center"><?php echo $langs->trans("RefCustomer"); ?></td>
<td align="center"><?php echo $langs->trans("Date"); ?></td> <td align="center"><?php echo $langs->trans("Date"); ?></td>
<td align="right"><?php echo $langs->trans("AmountHTShort"); ?></td> <td align="right"><?php echo $langs->trans("AmountHTShort"); ?></td>
<td align="right"><?php echo $langs->trans("Status"); ?></td> <td align="right"><?php echo $langs->trans("Status"); ?></td>
@ -47,8 +48,9 @@ foreach($linkedObjectBlock as $object)
{ {
$var=!$var; $var=!$var;
?> ?>
<tr <?php echo $GLOBALS['bc'][$var]; ?> ><td> <tr <?php echo $GLOBALS['bc'][$var]; ?> >
<a href="<?php echo DOL_URL_ROOT.'/commande/card.php?id='.$object->id ?>"><?php echo img_object($langs->trans("ShowOrder"),"order").' '.$object->ref; ?></a></td> <td><?php echo $object->getNomUrl(1); ?></td>
<td align="center"><?php echo $object->ref_client; ?></td>
<td align="center"><?php echo dol_print_date($object->date,'day'); ?></td> <td align="center"><?php echo dol_print_date($object->date,'day'); ?></td>
<td align="right"><?php <td align="right"><?php
if ($user->rights->commande->lire) { if ($user->rights->commande->lire) {
@ -62,7 +64,7 @@ foreach($linkedObjectBlock as $object)
?> ?>
<tr class="liste_total"> <tr class="liste_total">
<td align="left" colspan="2"><?php echo $langs->trans('TotalHT'); ?></td> <td align="left" colspan="3"><?php echo $langs->trans('TotalHT'); ?></td>
<td align="right"><?php <td align="right"><?php
if ($user->rights->commande->lire) { if ($user->rights->commande->lire) {
echo price($total); echo price($total);

View File

@ -935,7 +935,12 @@ class Account extends CommonObject
global $langs; global $langs;
$result=''; $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)) if (empty($mode))
{ {
@ -948,7 +953,7 @@ class Account extends CommonObject
$lienfin='</a>'; $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; $result.=$lien.$this->label.$lienfin;
return $result; return $result;
} }

View File

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

View File

@ -858,7 +858,17 @@ class Facture extends CommonInvoice
if ($this->type == self::TYPE_CREDIT_NOTE) $picto.='a'; // Credit note if ($this->type == self::TYPE_CREDIT_NOTE) $picto.='a'; // Credit note
if ($this->type == self::TYPE_DEPOSIT) $picto.='d'; // Deposit invoice 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><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_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_CREDIT_NOTE) $label=$langs->transnoentitiesnoconv("ShowInvoiceAvoir").': '.$this->ref;
if ($this->type == self::TYPE_DEPOSIT) $label=$langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref; if ($this->type == self::TYPE_DEPOSIT) $label=$langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref;
@ -3329,7 +3339,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.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.= ' l.date_start, l.date_end,';
$sql.= ' p.ref as product_ref, p.fk_product_type, p.label as product_label,'; $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.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product=p.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product=p.rowid';
$sql.= ' WHERE l.fk_facture = '.$this->id; $sql.= ' WHERE l.fk_facture = '.$this->id;
@ -3352,6 +3363,7 @@ class Facture extends CommonInvoice
$this->lines[$i]->description = $obj->description; $this->lines[$i]->description = $obj->description;
$this->lines[$i]->fk_product = $obj->fk_product; $this->lines[$i]->fk_product = $obj->fk_product;
$this->lines[$i]->ref = $obj->product_ref; $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_label = $obj->product_label;
$this->lines[$i]->product_desc = $obj->product_desc; $this->lines[$i]->product_desc = $obj->product_desc;
$this->lines[$i]->fk_product_type = $obj->fk_product_type; $this->lines[$i]->fk_product_type = $obj->fk_product_type;

View File

@ -36,6 +36,7 @@ else print_titre($langs->trans("RelatedBill"));
<table class="noborder allwidth"> <table class="noborder allwidth">
<tr class="liste_titre"> <tr class="liste_titre">
<td><?php echo $langs->trans("Ref"); ?></td> <td><?php echo $langs->trans("Ref"); ?></td>
<td align="center"><?php echo $langs->trans("RefCustomer"); ?></td>
<td align="center"><?php echo $langs->trans("Date"); ?></td> <td align="center"><?php echo $langs->trans("Date"); ?></td>
<td align="right"><?php echo $langs->trans("AmountHTShort"); ?></td> <td align="right"><?php echo $langs->trans("AmountHTShort"); ?></td>
<td align="right"><?php echo $langs->trans("Status"); ?></td> <td align="right"><?php echo $langs->trans("Status"); ?></td>
@ -47,8 +48,9 @@ foreach($linkedObjectBlock as $object)
{ {
$var=!$var; $var=!$var;
?> ?>
<tr <?php echo $GLOBALS['bc'][$var]; ?> ><td> <tr <?php echo $GLOBALS['bc'][$var]; ?> >
<a href="<?php echo DOL_URL_ROOT.'/compta/facture.php?facid='.$object->id ?>"><?php echo img_object($langs->trans("ShowBill"),"bill").' '.$object->ref; ?></a></td> <td><?php echo $object->getNomUrl(1); ?></td>
<td align="center"><?php echo $object->ref_client; ?></td>
<td align="center"><?php echo dol_print_date($object->date,'day'); ?></td> <td align="center"><?php echo dol_print_date($object->date,'day'); ?></td>
<td align="right"><?php <td align="right"><?php
if ($user->rights->facture->lire) { if ($user->rights->facture->lire) {
@ -61,7 +63,7 @@ foreach($linkedObjectBlock as $object)
} }
?> ?>
<tr class="liste_total"> <tr class="liste_total">
<td align="left" colspan="2"><?php echo $langs->trans("TotalHT"); ?></td> <td align="left" colspan="3"><?php echo $langs->trans("TotalHT"); ?></td>
<td align="right"><?php <td align="right"><?php
if ($user->rights->facture->lire) { if ($user->rights->facture->lire) {
echo price($total); echo price($total);

View File

@ -144,8 +144,12 @@ if (! empty($conf->don->enabled) && $user->rights->don->lire)
*/ */
if (! empty($conf->facture->enabled) && $user->rights->facture->lire) if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{ {
$sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,"; $sql = "SELECT f.facnumber";
$sql.= " s.nom as name, s.rowid as socid"; $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 "; 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"; $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"; 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">'; print '<tr '.$bc[$var].'><td class="nowrap">';
$facturestatic->ref=$obj->facnumber; $facturestatic->ref=$obj->facnumber;
$facturestatic->id=$obj->rowid; $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; $facturestatic->type=$obj->type;
print $facturestatic->getNomUrl(1,''); print $facturestatic->getNomUrl(1,'');
print '</td>'; print '</td>';
print '<td class="nowrap">'; print '<td class="nowrap">';
$companystatic->id=$obj->socid; $companystatic->id=$obj->socid;
$companystatic->name=$obj->name; $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 $companystatic->getNomUrl(1,'',16);
print '</td>'; print '</td>';
print '<td align="right" class="nowrap">'.price($obj->total_ttc).'</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) if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
{ {
$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.type,"; $sql = "SELECT f.ref, f.rowid, f.total_ht, f.tva as total_tva, f.total_ttc, f.type";
$sql.= " s.nom as name, s.rowid as socid"; $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"; $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"; 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"; $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">'; print '<tr '.$bc[$var].'><td class="nowrap">';
$facturesupplierstatic->ref=$obj->ref; $facturesupplierstatic->ref=$obj->ref;
$facturesupplierstatic->id=$obj->rowid; $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; $facturesupplierstatic->type=$obj->type;
print $facturesupplierstatic->getNomUrl(1,'',16); print $facturesupplierstatic->getNomUrl(1,'',16);
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$companystatic->id=$obj->socid; $companystatic->id=$obj->socid;
$companystatic->name=$obj->name; $companystatic->name=$obj->name;
$companystatic->client=1; $companystatic->fournisseur = 1;
print $companystatic->getNomUrl(1,'',16); $companystatic->code_client = $obj->code_client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
print $companystatic->getNomUrl(1,'supplier',16);
print '</td>'; print '</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td align="right">'.price($obj->total_ttc).'</td>';
print '</tr>'; print '</tr>';
@ -292,10 +308,12 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
$langs->load("boxes"); $langs->load("boxes");
$facstatic=new Facture($db); $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 = "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.= ", f.date_lim_reglement as datelimite";
$sql.= " s.nom as name, s.rowid as socid,"; $sql.= ", s.nom as name";
$sql.= " sum(pf.amount) as am"; $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.= " 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.= " 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"; 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">'; print '<td width="110" class="nobordernopadding nowrap">';
$facturestatic->ref=$obj->facnumber; $facturestatic->ref=$obj->facnumber;
$facturestatic->id=$obj->rowid; $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; $facturestatic->type=$obj->type;
print $facturestatic->getNomUrl(1,''); print $facturestatic->getNomUrl(1,'');
print '</td>'; print '</td>';
@ -353,9 +374,11 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
$thirdpartystatic->id=$obj->socid; $thirdpartystatic->id=$obj->socid;
$thirdpartystatic->name=$obj->name; $thirdpartystatic->name=$obj->name;
$thirdpartystatic->client=1; $thirdpartystatic->client=1;
$thirdpartystatic->code_client = $obj->code_client;
$thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
print $thirdpartystatic->getNomUrl(1,'customer',44); print $thirdpartystatic->getNomUrl(1,'customer',44);
print '</td>'; 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->total_ttc).'</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->tms),'day').'</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>'; 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"); $langs->load("boxes");
$facstatic=new FactureFournisseur($db); $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 = "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, s.rowid as socid"; $sql.= ", s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_fournisseur";
$sql.= ", SUM(pf.amount) as am"; $sql.= ", SUM(pf.amount) as am";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff"; $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"; $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; $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 (!$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; 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.= " ORDER BY ff.tms DESC ";
$sql.= $db->plimit($max, 0); $sql.= $db->plimit($max, 0);
@ -427,13 +452,18 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print '<tr '.$bc[$var].'><td>'; print '<tr '.$bc[$var].'><td>';
$facstatic->ref=$obj->ref; $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 $facstatic->getNomUrl(1,'');
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$thirdpartystatic->id=$obj->socid; $thirdpartystatic->id=$obj->socid;
$thirdpartystatic->name=$obj->name; $thirdpartystatic->name=$obj->name;
$thirdpartystatic->fournisseur=1; $thirdpartystatic->fournisseur=1;
$thirdpartystatic->code_client = $obj->code_client;
$thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
print $thirdpartystatic->getNomUrl(1,'supplier',44); print $thirdpartystatic->getNomUrl(1,'supplier',44);
print '</td>'; print '</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</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); $commandestatic=new Commande($db);
$langs->load("orders"); $langs->load("orders");
$sql = "SELECT sum(f.total) as tot_fht, sum(f.total_ttc) as tot_fttc,"; $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.= ", s.nom as name";
$sql.= " c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.total_ttc"; $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"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ", ".MAIN_DB_PREFIX."commande as c"; $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->id=$obj->socid;
$societestatic->name=$obj->name; $societestatic->name=$obj->name;
$societestatic->client=1; $societestatic->client=1;
$societestatic->code_client = $obj->code_client;
$societestatic->code_fournisseur = $obj->code_fournisseur;
print $societestatic->getNomUrl(1,'customer',44); print $societestatic->getNomUrl(1,'customer',44);
print '</td>'; print '</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</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); $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 = "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.= ", f.date_lim_reglement as datelimite";
$sql.= " s.nom as name, s.rowid as socid,"; $sql.= ", s.nom as name";
$sql.= " sum(pf.amount) as am"; $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.= " 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.= " 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"; 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">'; print '<td width="110" class="nobordernopadding nowrap">';
$facturestatic->ref=$obj->facnumber; $facturestatic->ref=$obj->facnumber;
$facturestatic->id=$obj->rowid; $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; $facturestatic->type=$obj->type;
print $facturestatic->getNomUrl(1,''); print $facturestatic->getNomUrl(1,'');
print '</td>'; print '</td>';
@ -776,9 +815,11 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
$societestatic->id=$obj->socid; $societestatic->id=$obj->socid;
$societestatic->name=$obj->name; $societestatic->name=$obj->name;
$societestatic->client=1; $societestatic->client=1;
$societestatic->code_client = $obj->code_client;
$societestatic->code_fournisseur = $obj->code_fournisseur;
print $societestatic->getNomUrl(1,'customer',44); print $societestatic->getNomUrl(1,'customer',44);
print '</td>'; 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->total_ttc).'</td>';
print '<td align="right">'.price($obj->am).'</td>'; print '<td align="right">'.price($obj->am).'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$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); $facstatic=new FactureFournisseur($db);
$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.paye,"; $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, s.rowid as socid,"; $sql.= ", s.nom as name";
$sql.= " sum(pf.amount) as am"; $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.= " 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"; $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"; 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"; $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 (!$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; 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"; $sql.= " s.nom, s.rowid";
$resql=$db->query($sql); $resql=$db->query($sql);
@ -859,12 +903,17 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print '<tr '.$bc[$var].'><td>'; print '<tr '.$bc[$var].'><td>';
$facstatic->ref=$obj->ref; $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 $facstatic->getNomUrl(1,'');
print '</td>'; print '</td>';
$societestatic->id=$obj->socid; $societestatic->id=$obj->socid;
$societestatic->name=$obj->name; $societestatic->name=$obj->name;
$societestatic->client=0; $societestatic->client=0;
$societestatic->code_client = $obj->code_client;
$societestatic->code_fournisseur = $obj->code_fournisseur;
print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>'; 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>'; 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->total_ttc).'</td>';

View File

@ -887,7 +887,8 @@ class Contact extends CommonObject
global $langs; global $langs;
$result=''; $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">'; $lien = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';

View File

@ -42,8 +42,8 @@ foreach($linkedObjectBlock as $object)
$object->fetch_lines(); $object->fetch_lines();
$var=!$var; $var=!$var;
?> ?>
<tr <?php echo $bc[$var]; ?> ><td> <tr <?php echo $bc[$var]; ?> >
<a href="<?php echo DOL_URL_ROOT.'/contrat/card.php?id='.$object->id ?>"><?php echo img_object($langs->trans("ShowContract"),"contract").' '.$object->ref; ?></a></td> <td><?php echo $object->getNomUrl(1); ?></td>
<td align="center"><?php echo dol_print_date($object->date_contrat,'day'); ?></td> <td align="center"><?php echo dol_print_date($object->date_contrat,'day'); ?></td>
<td align="right">&nbsp;</td> <td align="right">&nbsp;</td>
<td align="right"><?php echo $object->getLibStatut(6); ?></td> <td align="right"><?php echo $object->getLibStatut(6); ?></td>

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Charles-Fr BENKE <charles.fr@benke.fr> * 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 * 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 * 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; $this->max=$max;
include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$actionstatic=new ActionComm($db); 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)); $this->info_box_head = array('text' => $langs->trans("BoxTitleLastActionsToDo",$max));
if ($user->rights->agenda->myactions->read) { if ($user->rights->agenda->myactions->read) {
$sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage,"; $sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage";
$sql.= " ta.code, ta.libelle as type_label,"; $sql.= ", ta.code";
$sql.= " s.nom as name, s.rowid as socid"; $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.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, ";
$sql.= MAIN_DB_PREFIX."actioncomm AS a)"; $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"; 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,60 +87,52 @@ class box_actions extends ModeleBoxes
$result = $db->query($sql); $result = $db->query($sql);
if ($result) { if ($result) {
$now=dol_now(); $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); $num = $db->num_rows($result);
$i = 0; $i = 0;
while ($i < $num) { while ($i < $num) {
$late = ''; $late = '';
$objp = $db->fetch_object($result); $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) //($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;
$this->info_box_contents[$i][0] = array( $tooltip = $langs->trans('Action'.$objp->code).': '.$label;
'td' => 'align="left" width="16"', $this->info_box_contents[$i][] = array(
'logo' => ("action"),
'tooltip' => $langs->trans('Action'.$objp->code).': '.$label,
'url' => DOL_URL_ROOT."/comm/action/card.php?id=".$objp->id,
);
$this->info_box_contents[$i][1] = array(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => dol_trunc($label,32), 'text' => $actionstatic->getNomUrl(1),
'text2'=> $late, 'text2'=> $late,
'tooltip' => $langs->trans('Action'.$objp->code).': '.$label, 'asis' => 1,
'url' => DOL_URL_ROOT."/comm/action/card.php?id=".$objp->id,
); );
$this->info_box_contents[$i][2] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="left" width="16"',
'logo' => ($objp->socid?'company':''),
'tooltip' => $langs->trans('Customer').': '.$objp->name,
'url' => ($objp->socid?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid:''),
);
$this->info_box_contents[$i][3] = array(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => dol_trunc($objp->name,24), 'text' => $societestatic->getNomUrl(1),
'tooltip' => $langs->trans('Customer').': '.$objp->name, 'asis' => 1,
'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid,
); );
$this->info_box_contents[$i][4] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="left" class="nowrap"', 'td' => 'align="left" class="nowrap"',
'text' => dol_print_date($datelimite, "dayhour"), 'text' => dol_print_date($datelimite, "dayhour"),
); );
$this->info_box_contents[$i][5] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="right"', 'td' => 'align="right"',
'text' => ($objp->percentage>= 0?$objp->percentage.'%':''), 'text' => ($objp->percentage>= 0?$objp->percentage.'%':''),
); );
$this->info_box_contents[$i][6] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="right" width="18"', 'td' => 'align="right" width="18"',
'text' => $actionstatic->LibStatut($objp->percentage,3), 'text' => $actionstatic->LibStatut($objp->percentage,3),
); );
@ -142,9 +140,13 @@ class box_actions extends ModeleBoxes
$i++; $i++;
} }
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoActionsToDo")); if ($num==0)
$this->info_box_contents[$i][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoActionsToDo"),
);
$db->free($result); $db->free($result);
} else { } else {
$this->info_box_contents[0][0] = array( $this->info_box_contents[0][0] = array(
'td' => 'align="left"', 'td' => 'align="left"',
@ -171,8 +173,7 @@ class box_actions extends ModeleBoxes
{ {
global $langs, $conf; global $langs, $conf;
parent::showBox($this->info_box_head, $this->info_box_contents); parent::showBox($this->info_box_head, $this->info_box_contents);
if ($conf->global->SHOW_DIALOG_HOMEPAGE) if ($conf->global->SHOW_DIALOG_HOMEPAGE) {
{
$actioncejour=false; $actioncejour=false;
$contents=$this->info_box_contents; $contents=$this->info_box_contents;
$nblines=count($contents); $nblines=count($contents);

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2012 Charles-François BENKE <charles.fr@benke.fr> /* Copyright (C) 2012 Charles-François BENKE <charles.fr@benke.fr>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net> * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -94,8 +94,10 @@ class box_activity extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic=new Facture($db); $facturestatic=new Facture($db);
$cachefile = DOL_DATA_ROOT.'/facture/temp/boxactivity-invoice'.$fileid; $cachedir = DOL_DATA_ROOT.'/facture/temp';
$refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile); $filename = '/boxactivity-invoice'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array(); $data = array();
if ($refresh) { if ($refresh) {
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
@ -118,13 +120,15 @@ class box_activity extends ModeleBoxes
$data[$j]=$db->fetch_object($result); $data[$j]=$db->fetch_object($result);
$j++; $j++;
} }
file_put_contents($cachefile,serialize($data),LOCK_EX); if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
dol_filecache($cachedir, $filename, $data);
}
$db->free($result); $db->free($result);
} else { } else {
dol_print_error($db); dol_print_error($db);
} }
} else { } else {
$data = unserialize(file_get_contents($cachefile)); $data = dol_readcachefile($cachedir, $filename);
} }
if (! empty($data)) { if (! empty($data)) {
$j=0; $j=0;
@ -173,8 +177,10 @@ class box_activity extends ModeleBoxes
); );
} }
$cachefile = DOL_DATA_ROOT.'/facture/temp/boxactivity-invoice2'.$fileid; $cachedir = DOL_DATA_ROOT.'/facture/temp';
$refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile); $filename = '/boxactivity-invoice2'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
if ($refresh) { if ($refresh) {
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
@ -193,13 +199,15 @@ class box_activity extends ModeleBoxes
$data[$j]=$db->fetch_object($result); $data[$j]=$db->fetch_object($result);
$j++; $j++;
} }
file_put_contents($cachefile,serialize($data),LOCK_EX); if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
dol_filecache($cachedir, $filename, $data);
}
$db->free($result); $db->free($result);
} else { } else {
dol_print_error($db); dol_print_error($db);
} }
} else { } else {
$data = unserialize(file_get_contents($cachefile)); $data = dol_readcachefile($cachedir, $filename);
} }
if (! empty($data)) { if (! empty($data)) {
$j=0; $j=0;
@ -255,9 +263,11 @@ class box_activity extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$commandestatic=new Commande($db); $commandestatic=new Commande($db);
$cachefile = DOL_DATA_ROOT.'/commande/temp/boxactivity-order'.$fileid; $cachedir = DOL_DATA_ROOT.'/commande/temp';
$refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile); $filename = '/boxactivity-order'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array(); $data = array();
if ($refresh) { if ($refresh) {
$sql = "SELECT c.fk_statut, sum(c.total_ttc) as Mnttot, count(*) as nb"; $sql = "SELECT c.fk_statut, sum(c.total_ttc) as Mnttot, count(*) as nb";
@ -282,13 +292,15 @@ class box_activity extends ModeleBoxes
$data[$j]=$db->fetch_object($result); $data[$j]=$db->fetch_object($result);
$j++; $j++;
} }
file_put_contents($cachefile,serialize($data),LOCK_EX); if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
dol_filecache($cachedir, $filename, $data);
}
$db->free($result); $db->free($result);
} else { } else {
dol_print_error($db); dol_print_error($db);
} }
} else { } else {
$data = unserialize(file_get_contents($cachefile)); $data = dol_readcachefile($cachedir, $filename);
} }
if (! empty($data)) { if (! empty($data)) {
$j=0; $j=0;
@ -334,8 +346,9 @@ class box_activity extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$propalstatic=new Propal($db); $propalstatic=new Propal($db);
$cachefile = DOL_DATA_ROOT.'/propale/temp/boxactivity-propal'.$fileid; $cachedir = DOL_DATA_ROOT.'/propale/temp';
$refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile); $filename = '/boxactivity-propal'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array(); $data = array();
if ($refresh) { if ($refresh) {
$sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb"; $sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb";
@ -360,18 +373,20 @@ class box_activity extends ModeleBoxes
$data[$j]=$db->fetch_object($result); $data[$j]=$db->fetch_object($result);
$j++; $j++;
} }
file_put_contents($cachefile,serialize($data),LOCK_EX); if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
dol_filecache($cachedir, $filename, $data);
}
$db->free($result); $db->free($result);
} else { } else {
dol_print_error($db); dol_print_error($db);
} }
} else { } else {
$data = unserialize(file_get_contents($cachefile)); $data = dol_readcachefile($cachedir, $filename);
} }
if (! empty($data)) { if (! empty($data)) {
$j=0; $j=0;
while ($i < count($data)) { while ($i < count($data)) {
$this->info_box_contents[$i][0] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="left" width="16"', 'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;viewstatut=".$data[$j]->fk_statut, '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), 'tooltip' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0),
@ -379,12 +394,12 @@ class box_activity extends ModeleBoxes
); );
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$this->info_box_contents[$i][1] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0), '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"', 'td' => 'align="right"',
'text' => $data[$j]->nb, 'text' => $data[$j]->nb,
'tooltip' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0), 'tooltip' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0),
@ -392,12 +407,12 @@ class box_activity extends ModeleBoxes
); );
$totalnb += $data[$j]->nb; $totalnb += $data[$j]->nb;
$this->info_box_contents[$i][3] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="right"', 'td' => 'align="right"',
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency), 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
); );
$totalMnt += $data[$j]->Mnttot; $totalMnt += $data[$j]->Mnttot;
$this->info_box_contents[$i][4] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="right" width="18"', 'td' => 'align="right" width="18"',
'text' => $propalstatic->LibStatut($data[$j]->fk_statut,3), 'text' => $propalstatic->LibStatut($data[$j]->fk_statut,3),
); );

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net> /* 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 * 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 * 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) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * 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 * 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 * 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) 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"; $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"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.client IN (1, 3)"; $sql.= " WHERE s.client IN (1, 3)";
@ -103,26 +110,26 @@ class box_clients extends ModeleBoxes
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$datec=$db->jdate($objp->datec); $datec=$db->jdate($objp->datec);
$datem=$db->jdate($objp->tms); $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( $this->info_box_contents[$i][] = 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(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => $objp->name, 'text' => $thirdpartystatic->getNomUrl(1),
'tooltip' => $langs->trans('Customer').': '.$objp->name, 'asis' => 1,
'url' => $url.$objp->socid
); );
$this->info_box_contents[$i][2] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="right"', 'td' => 'align="right"',
'text' => dol_print_date($datem, "day") 'text' => dol_print_date($datem, "day")
); );
$this->info_box_contents[$i][3] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="right" width="18"', 'td' => 'align="right" width="18"',
'text' => $thirdpartystatic->LibStatut($objp->status,3) 'text' => $thirdpartystatic->LibStatut($objp->status,3)
); );

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * 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 * 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 * 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; global $user, $langs, $db, $conf;
$this->max=$max; $this->max = $max;
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$commandestatic=new Commande($db); include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$commandestatic = new Commande($db);
$societestatic = new Societe($db);
$userstatic = new User($db); $userstatic = new User($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."CustomerOrders",$max)); $this->info_box_head = array('text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."CustomerOrders",$max));
if ($user->rights->commande->lire) if ($user->rights->commande->lire)
{ {
$sql = "SELECT s.nom as name, s.rowid as socid,"; $sql = "SELECT s.nom as name";
$sql.= " c.ref, c.tms, c.rowid, c.date_commande,"; $sql.= ", s.rowid as socid";
$sql.= " c.fk_statut, c.fk_user_valid, c.facture, c.total_ht"; $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.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."commande as c"; $sql.= ", ".MAIN_DB_PREFIX."commande as c";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; 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); $objp = $db->fetch_object($result);
$date=$db->jdate($objp->date_commande); $date=$db->jdate($objp->date_commande);
$datem=$db->jdate($objp->tms); $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( $this->info_box_contents[$i][] = array(
'td' => 'align="left" width="16"', 'td' => 'align="left"',
'logo' => $this->boximg, 'text' => $commandestatic->getNomUrl(1),
'tooltip' => $langs->trans('Order').': '.$objp->ref, 'asis' => 1,
'url' => DOL_URL_ROOT."/commande/card.php?id=".$objp->rowid,
); );
$this->info_box_contents[$i][] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => $objp->ref, 'text' => $societestatic->getNomUrl(1),
'tooltip' => $langs->trans('Order').': '.$objp->ref, 'asis' => 1,
'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,
); );
$this->info_box_contents[$i][] = array( $this->info_box_contents[$i][] = array(
@ -127,7 +136,7 @@ class box_commandes extends ModeleBoxes
$this->info_box_contents[$i][] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="right"', 'td' => 'align="right"',
'text' => (($objp->fk_user_valid > 0)?$userstatic->getNomUrl(1):''), '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-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es> * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -102,32 +103,26 @@ class box_comptes extends ModeleBoxes
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$account_static->id = $objp->rowid; $account_static->id = $objp->rowid;
$account_static->label = $objp->label;
$account_static->number = $objp->number;
$solde=$account_static->solde(0); $solde=$account_static->solde(0);
$solde_total[$objp->currency_code] += $solde; $solde_total[$objp->currency_code] += $solde;
$this->info_box_contents[$i][0] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $langs->trans('Account').': '.$objp->label,
'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid,
);
$this->info_box_contents[$i][1] = array(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => $objp->label, 'text' => $account_static->getNomUrl(1),
'tooltip' => $langs->trans('Account').': '.$objp->label, 'asis' => 1,
'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid,
); );
$this->info_box_contents[$i][2] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => $objp->number, 'text' => $objp->number,
); );
$this->info_box_contents[$i][3] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="right"', 'td' => 'align="right"',
'text' => price($solde, 0, $langs, 0, 0, -1, $objp->currency_code) 'text' => price($solde, 0, $langs, 0, -1, -1, $objp->currency_code)
); );
$i++; $i++;
@ -135,23 +130,19 @@ class box_comptes extends ModeleBoxes
// Total // Total
foreach ($solde_total as $key=>$solde) { foreach ($solde_total as $key=>$solde) {
$this->info_box_contents[$i][0] = array( $this->info_box_contents[$i][] = array(
'tr' => 'class="liste_total"', '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"', 'td' => 'align="left" class="liste_total"',
'text' => $langs->trans('Total').' '.$key, 'text' => $langs->trans('Total').' '.$key,
); );
$this->info_box_contents[$i][2] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="right" class="liste_total"', 'td' => 'align="right" class="liste_total"',
'text' => '&nbsp;' 'text' => '&nbsp;'
); );
$totalamount=price($solde,0,$langs,0,0,-1,$key);
$this->info_box_contents[$i][3] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="right" class="liste_total"', 'td' => 'align="right" class="liste_total"',
'text' => $totalamount 'text' => price($solde, 0, $langs, 0, -1, -1, $key)
); );
$i++; $i++;
} }

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * 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 * 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 * 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->id=$objp->fk_soc;
$societestatic->name=$objp->socname; $societestatic->name=$objp->socname;
$this->info_box_contents[$i][0] = array( $this->info_box_contents[$i][] = 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(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => $contactstatic->getFullName($langs,0), 'text' => $contactstatic->getNomUrl(1),
'tooltip' => $langs->trans('Contact').': '.$contactstatic->getFullName($langs,0), 'asis' => 1,
'url' => DOL_URL_ROOT."/contact/card.php?id=".$objp->rowid,
); );
$this->info_box_contents[$i][2] = array( $this->info_box_contents[$i][] = 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(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => $societestatic->name, 'text' => $societestatic->getNomUrl(1),
'tooltip' => $societestatic->name, 'asis' => 1,
'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->fk_soc,
); );
$this->info_box_contents[$i][4] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="right"', 'td' => 'align="right"',
'text' => dol_print_date($datem, "day"), 'text' => dol_print_date($datem, "day"),
); );

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com> /* 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 * 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 * 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) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com> * 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 * 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 * 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) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * 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 * 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 * 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; $this->max=$max;
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; 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);
$text = $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."CustomerBills",$max); $text = $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."CustomerBills",$max);
$this->info_box_head = array( $this->info_box_head = array(
@ -62,11 +66,16 @@ class box_factures extends ModeleBoxes
'limit'=> dol_strlen($text) 'limit'=> dol_strlen($text)
); );
if ($user->rights->facture->lire) if ($user->rights->facture->lire) {
{ $sql = "SELECT f.rowid as facid";
$sql = "SELECT f.rowid as facid, f.facnumber, f.type, f.total as total_ht, f.datef as df"; $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.= ", 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.= ", f.date_lim_reglement as datelimite";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; $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"; 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; $i = 0;
$l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)';
while ($i < $num) while ($i < $num) {
{ $objp = $db->fetch_object($result);
$objp = $db->fetch_object($result); $datelimite = $db->jdate($objp->datelimite);
$datelimite=$db->jdate($objp->datelimite); $date = $db->jdate($objp->df);
$date=$db->jdate($objp->df); $datem = $db->jdate($objp->tms);
$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 = ''; $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')));} 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( $this->info_box_contents[$i][] = 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(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => $objp->facnumber, 'text' => $facturestatic->getNomUrl(1),
'text2'=> $late, 'text2'=> $late,
'tooltip' => $langs->trans('CustomerInvoice').': '.$objp->facnumber, 'asis' => 1,
'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid,
); );
$this->info_box_contents[$i][2] = array( $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][3] = array(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => $objp->name, 'text' => $societestatic->getNomUrl(1, '', 40),
'maxlength'=>40, 'asis' => 1,
'tooltip' => $langs->trans('Customer').': '.$objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
); );
$this->info_box_contents[$i][4] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="right"', 'td' => 'align="right"',
'text' => price($objp->total_ht), 'text' => price($objp->total_ht),
); );
$this->info_box_contents[$i][5] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="right"', 'td' => 'align="right"',
'text' => dol_print_date($date,'day'), 'text' => dol_print_date($date,'day'),
); );
$this->info_box_contents[$i][6] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="right" width="18"', 'td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3), '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 $head Array with properties of box title
* @param array $contents Array with properties of box lines * @param array $contents Array with properties of box lines
* @return void * @return void
*/ */
function showBox($head = null, $contents = null) function showBox($head = null, $contents = null)
{ {

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * 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 * 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 * 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; $this->max=$max;
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; 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( $this->info_box_head = array(
'text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."SupplierBills",$max) '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) if ($user->rights->fournisseur->facture->lire)
{ {
$sql = "SELECT s.nom as name, s.rowid as socid,"; $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.paye, f.fk_statut,";
$sql.= ' f.datef as df,'; $sql.= ' f.datef as df,';
$sql.= ' f.datec as datec,'; $sql.= ' f.datec as datec,';
@ -94,47 +103,41 @@ class box_factures_fourn extends ModeleBoxes
$datelimite=$db->jdate($objp->datelimite); $datelimite=$db->jdate($objp->datelimite);
$date=$db->jdate($objp->df); $date=$db->jdate($objp->df);
$datem=$db->jdate($objp->tms); $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 = ''; $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'))); 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( $this->info_box_contents[$i][] = 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(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => ($objp->ref?$objp->ref:$objp->facid), 'text' => $facturestatic->getNomUrl(1),
'text2'=> $late, 'text2'=> $late,
'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'<br>'.$langs->trans('RefSupplier').': '.$objp->ref_supplier, 'asis' => 1,
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
); );
$this->info_box_contents[$i][2] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => $objp->ref_supplier, 'text' => $objp->ref_supplier,
'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'<br>'.$langs->trans('RefSupplier').': '.$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, 'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
); );
$this->info_box_contents[$i][3] = array( $this->info_box_contents[$i][] = 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(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => $objp->name, 'text' => $societestatic->getNomUrl(1, 'supplier'),
'tooltip' => $langs->trans('Supplier').': '.$objp->name, 'asis' => 1,
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
); );
$this->info_box_contents[$i][5] = array( $this->info_box_contents[$i][] = array(
'td' => 'align="right"', 'td' => 'align="right"',
'text' => dol_print_date($date,'day'), 'text' => dol_print_date($date,'day'),
); );

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -17,9 +18,9 @@
*/ */
/** /**
* \file htdocs/core/boxes/box_factures_fourn_imp.php * \file htdocs/core/boxes/box_factures_fourn_imp.php
* \ingroup fournisseur * \ingroup fournisseur
* \brief Fichier de gestion d'une box des factures fournisseurs impayees * \brief Fichier de gestion d'une box des factures fournisseurs impayees
*/ */
include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
@ -29,9 +30,9 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
*/ */
class box_factures_fourn_imp extends ModeleBoxes class box_factures_fourn_imp extends ModeleBoxes
{ {
var $boxcode="oldestunpaidsupplierbills"; var $boxcode = "oldestunpaidsupplierbills";
var $boximg="object_bill"; var $boximg = "object_bill";
var $boxlabel="BoxOldestUnpaidSupplierBills"; var $boxlabel = "BoxOldestUnpaidSupplierBills";
var $depends = array("facture","fournisseur"); var $depends = array("facture","fournisseur");
var $db; var $db;
@ -93,55 +94,82 @@ class box_factures_fourn_imp extends ModeleBoxes
$late=''; $late='';
if ($datelimite && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day'))); if ($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"', $tooltip = $langs->trans('SupplierInvoice') . ': ' . ($objp->ref?$objp->ref:$objp->facid) . '<br>' . $langs->trans('RefSupplier') . ': ' . $objp->ref_supplier;
'logo' => $this->boximg, $this->info_box_contents[$i][0] = array(
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid); 'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array(
'text' => ($objp->ref?$objp->ref:$objp->facid), 'td' => 'align="left"',
'text2'=> $late, 'text' => ($objp->ref?$objp->ref:$objp->facid),
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid); 'text2'=> $late,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
);
$this->info_box_contents[$i][2] = array('td' => 'align="left"', $this->info_box_contents[$i][2] = array(
'text' => $objp->ref_supplier, 'td' => 'align="left"',
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid); 'text' => $objp->ref_supplier,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
);
$this->info_box_contents[$i][3] = array('td' => 'align="left" width="16"', $tooltip = $langs->trans('Supplier') . ': '. $objp->name;
'logo' => 'company', $this->info_box_contents[$i][3] = array(
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid); 'td' => 'align="left" width="16"',
'logo' => 'company',
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
);
$this->info_box_contents[$i][4] = array('td' => 'align="left"', $this->info_box_contents[$i][4] = array(
'text' => $objp->name, 'td' => 'align="left"',
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid); 'text' => $objp->name,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
);
$this->info_box_contents[$i][5] = array('td' => 'align="right"', $this->info_box_contents[$i][5] = array(
'text' => dol_print_date($datelimite,'day')); 'td' => 'align="right"',
'text' => dol_print_date($datelimite,'day'),
);
$fac = new FactureFournisseur($db); $fac = new FactureFournisseur($db);
$fac->fetch($objp->facid); $fac->fetch($objp->facid);
$alreadypaid=$fac->getSommePaiement(); $alreadypaid=$fac->getSommePaiement();
$this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"', $this->info_box_contents[$i][6] = array(
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3,$alreadypaid,$objp->type)); 'td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3,$alreadypaid,$objp->type),
);
$i++; $i++;
} }
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpaidSupplierBills")); if ($num==0)
$this->info_box_contents[$i][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoUnpaidSupplierBills"),
);
$db->free($result); $db->free($result);
} } else {
else { $this->info_box_contents[0][0] = array(
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'td' => 'align="left"',
'maxlength'=>500, 'maxlength'=>500,
'text' => ($db->error().' sql='.$sql)); 'text' => ($db->error().' sql='.$sql),
} );
} }
else { } else {
$this->info_box_contents[0][0] = array('td' => 'align="left"', $this->info_box_contents[0][0] = array(
'text' => $langs->trans("ReadPermissionNotAllowed")); 'td' => 'align="left"',
} 'text' => $langs->trans("ReadPermissionNotAllowed"),
);
}
} }
/** /**
* Method to show box * Method to show box

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * 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 * 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 * 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; $this->max=$max;
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; 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)); $this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpaidCustomerBills",$max));
if ($user->rights->facture->lire) if ($user->rights->facture->lire)
{ {
$sql = "SELECT s.nom as name, s.rowid as socid,"; $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.facnumber, f.date_lim_reglement as datelimite,";
$sql.= " f.type,";
$sql.= " f.amount, f.datef as df,"; $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.= " f.paye, f.fk_statut, f.rowid as facid";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; $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"; 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); $objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->datelimite); $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=''; $late='';
if ($datelimite < ($now - $conf->facture->client->warning_delay)) $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day'))); 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"', $this->info_box_contents[$i][] = array(
'logo' => $this->boximg, 'td' => 'align="left"',
'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid); 'text' => $facturestatic->getNomUrl(1),
'text2'=> $late,
'asis' => 1,
);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][] = array(
'text' => $objp->facnumber, 'td' => 'align="left"',
'text2'=> $late, 'text' => $societestatic->getNomUrl(1, '', 44),
'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid); 'asis' => 1,
);
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"', $this->info_box_contents[$i][] = array(
'logo' => 'company', 'td' => 'align="right"',
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'text' => dol_print_date($datelimite,'day'),
);
$this->info_box_contents[$i][3] = array('td' => 'align="left"', $this->info_box_contents[$i][] = array(
'text' => $objp->name, 'td' => 'align="right" width="18"',
'maxlength'=>44, 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3),
'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));
$i++; $i++;
} }
@ -130,14 +149,18 @@ class box_factures_imp extends ModeleBoxes
} }
else else
{ {
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', $this->info_box_contents[0][0] = array(
'maxlength'=>500, 'td' => 'align="left"',
'text' => ($db->error().' sql='.$sql)); 'maxlength'=>500,
'text' => ($db->error().' sql='.$sql),
);
} }
} }
else { else {
$this->info_box_contents[0][0] = array('td' => 'align="left"', $this->info_box_contents[0][0] = array(
'text' => $langs->trans("ReadPermissionNotAllowed")); 'td' => 'align="left"',
'text' => $langs->trans("ReadPermissionNotAllowed"),
);
} }
} }

View File

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

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2004-2006 Destailleur Laurent <eldy@users.sourceforge.net> /* Copyright (C) 2004-2006 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -84,36 +85,52 @@ class box_fournisseurs extends ModeleBoxes
$datec=$db->jdate($objp->datec); $datec=$db->jdate($objp->datec);
$datem=$db->jdate($objp->tms); $datem=$db->jdate($objp->tms);
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $tooltip = $langs->trans('Supplier') . ': ' . $objp->name;
'logo' => $this->boximg, $this->info_box_contents[$i][0] = array(
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid); 'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array(
'text' => $objp->name, 'td' => 'align="left"',
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid); 'text' => $objp->name,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
);
$this->info_box_contents[$i][2] = array('td' => 'align="right"', $this->info_box_contents[$i][2] = array(
'text' => dol_print_date($datem, "day")); 'td' => 'align="right"',
'text' => dol_print_date($datem, "day"),
);
$this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"', $this->info_box_contents[$i][3] = array(
'text' => $thirdpartystatic->LibStatut($objp->status,3)); 'td' => 'align="right" width="18"',
'text' => $thirdpartystatic->LibStatut($objp->status,3),
);
$i++; $i++;
} }
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedSuppliers")); if ($num==0) $this->info_box_contents[$i][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoRecordedSuppliers"),
);
$db->free($result); $db->free($result);
} else {
$this->info_box_contents[0][0] = array(
'td' => 'align="left"',
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql),
);
} }
else { } else {
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', $this->info_box_contents[0][0] = array(
'maxlength'=>500, 'td' => 'align="left"',
'text' => ($db->error().' sql='.$sql)); 'text' => $langs->trans("ReadPermissionNotAllowed"),
} );
}
else {
$this->info_box_contents[0][0] = array('td' => 'align="left"',
'text' => $langs->trans("ReadPermissionNotAllowed"));
} }
} }

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -113,39 +114,55 @@ class box_members extends ModeleBoxes
$memberstatic->name=$objp->company; $memberstatic->name=$objp->company;
} }
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $this->info_box_contents[$i][0] = array(
'logo' => $this->boximg, 'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/adherents/card.php?rowid=".$objp->rowid); 'logo' => $this->boximg,
'tooltip' => $memberstatic->getFullName($langs),
'url' => DOL_URL_ROOT."/adherents/card.php?rowid=".$objp->rowid,
);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array(
'text' => $memberstatic->getFullName($langs), 'td' => 'align="left"',
'url' => DOL_URL_ROOT."/adherents/card.php?rowid=".$objp->rowid); 'text' => $memberstatic->getFullName($langs),
'tooltip' => $memberstatic->getFullName($langs),
'url' => DOL_URL_ROOT."/adherents/card.php?rowid=".$objp->rowid,
);
$this->info_box_contents[$i][2] = array('td' => 'align="right"', $this->info_box_contents[$i][2] = array(
'text' => dol_print_date($datem, "day")); 'td' => 'align="right"',
'text' => dol_print_date($datem, "day"),
);
$this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"', $this->info_box_contents[$i][3] = array(
'text' => $memberstatic->LibStatut($objp->status,$objp->cotisation,$db->jdate($objp->date_end_subscription),3)); 'td' => 'align="right" width="18"',
'text' => $memberstatic->LibStatut($objp->status,$objp->cotisation,$db->jdate($objp->date_end_subscription),3),
);
$i++; $i++;
} }
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedCustomers")); if ($num==0)
$this->info_box_contents[$i][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoRecordedCustomers"),
);
$db->free($result); $db->free($result);
} } else {
else { $this->info_box_contents[0][0] = array(
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'td' => 'align="left"',
'maxlength'=>500, 'maxlength'=>500,
'text' => ($db->error().' sql='.$sql)); 'text' => ($db->error().' sql='.$sql),
} );
} }
else { } else {
$this->info_box_contents[0][0] = array('align' => 'left', $this->info_box_contents[0][0] = array(
'text' => $langs->trans("ReadPermissionNotAllowed")); 'align' => 'left',
} 'text' => $langs->trans("ReadPermissionNotAllowed"),
);
}
} }
/** /**
* Method to show box * Method to show box

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -99,9 +100,12 @@ class box_produits extends ModeleBoxes
} }
} }
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $this->info_box_contents[$i][0] = array(
'logo' => ($objp->fk_product_type==1?'object_service':'object_product'), 'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid); 'logo' => ($objp->fk_product_type==1?'object_service':'object_product'),
'tooltip' => $objp->label,
'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid,
);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' => $objp->label, 'text' => $objp->label,
@ -153,23 +157,28 @@ class box_produits extends ModeleBoxes
'text' => $productstatic->LibStatut($objp->tobuy,3,1)); 'text' => $productstatic->LibStatut($objp->tobuy,3,1));
$i++; $i++;
} }
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProducts")); if ($num==0)
$this->info_box_contents[$i][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoRecordedProducts"),
);
$db->free($result); $db->free($result);
} } else {
else $this->info_box_contents[0][0] = array(
{ 'td' => 'align="left"',
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'maxlength'=>500,
'maxlength'=>500, 'text' => ($db->error().' sql='.$sql),
'text' => ($db->error().' sql='.$sql)); );
} }
} } else {
else { $this->info_box_contents[0][0] = array(
$this->info_box_contents[0][0] = array('td' => 'align="left"', 'td' => 'align="left"',
'text' => $langs->trans("ReadPermissionNotAllowed")); 'text' => $langs->trans("ReadPermissionNotAllowed"),
} );
} }
}
/** /**
* Method to show box * Method to show box

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2012 Maxime Kohlhaas <mko@atm-consulting.fr> * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -83,8 +84,7 @@ class box_produits_alerte_stock extends ModeleBoxes
$langs->load("stocks"); $langs->load("stocks");
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num) {
{
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$datem=$db->jdate($objp->tms); $datem=$db->jdate($objp->tms);
@ -106,15 +106,23 @@ class box_produits_alerte_stock extends ModeleBoxes
} }
} }
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $tooltip = $langs->trans('Product') . ': ' . $objp->label;
'logo' => ($objp->fk_product_type==1?'object_service':'object_product'), $this->info_box_contents[$i][0] = array(
'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid); 'td' => 'align="left" width="16"',
'logo' => ($objp->fk_product_type==1?'object_service':'object_product'),
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid,
);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array(
'text' => $objp->label, 'td' => 'align="left"',
'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid); 'text' => $objp->label,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid,
);
if (empty($objp->fk_price_expression)) { if (empty($objp->fk_price_expression))
{
if ($objp->price_base_type == 'HT') if ($objp->price_base_type == 'HT')
{ {
$price=price($objp->price); $price=price($objp->price);
@ -162,16 +170,22 @@ class box_produits_alerte_stock extends ModeleBoxes
'text' => $productstatic->LibStatut($objp->tobuy,3,1)); 'text' => $productstatic->LibStatut($objp->tobuy,3,1));
$i++; $i++;
} }
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoTooLowStockProducts")); if ($num==0)
$this->info_box_contents[$i][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoTooLowStockProducts"),
);
$db->free($result); $db->free($result);
} }
else else
{ {
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', $this->info_box_contents[0][0] = array(
'maxlength'=>500, 'td' => 'align="left"',
'text' => ($db->error().' sql='.$sql)); 'maxlength'=>500,
'text' => ($db->error().' sql='.$sql),
);
} }
} }
else { else {

View File

@ -1,6 +1,8 @@
<?php <?php
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr> /* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * 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 * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
@ -90,21 +92,24 @@ class box_project extends ModeleBoxes
while ($i < $num) { while ($i < $num) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$tooltip = $langs->trans('Project') . ': ' . $objp->ref;
$this->info_box_contents[$i][0] = array( $this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"', 'td' => 'align="left" width="16"',
'logo' => 'object_project', 'logo' => 'object_project',
'url' => DOL_URL_ROOT."/projet/card.php?id=".$objp->rowid 'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/projet/card.php?id=".$objp->rowid,
); );
$this->info_box_contents[$i][1] = array( $this->info_box_contents[$i][1] = array(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => $objp->ref, 'text' => $objp->ref,
'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid 'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid,
); );
$this->info_box_contents[$i][2] = array( $this->info_box_contents[$i][2] = array(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => $objp->title 'text' => $objp->title,
); );
$sql ="SELECT count(*) as nb, sum(progress) as totprogress"; $sql ="SELECT count(*) as nb, sum(progress) as totprogress";
@ -114,9 +119,15 @@ class box_project extends ModeleBoxes
$resultTask = $db->query($sql); $resultTask = $db->query($sql);
if ($resultTask) { if ($resultTask) {
$objTask = $db->fetch_object($resultTask); $objTask = $db->fetch_object($resultTask);
$this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format($objTask->nb, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks")); $this->info_box_contents[$i][3] = array(
'td' => 'align="right"',
'text' => number_format($objTask->nb, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks"),
);
if ($objTask->nb > 0 ) if ($objTask->nb > 0 )
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => number_format(($objTask->totprogress/$objTask->nb), 0, ',', ' ')."%"); $this->info_box_contents[$i][4] = array(
'td' => 'align="right"',
'text' => number_format(($objTask->totprogress/$objTask->nb), 0, ',', ' ')."%",
);
else else
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A&nbsp;"); $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A&nbsp;");
$totalnbTask += $objTask->nb; $totalnbTask += $objTask->nb;
@ -132,11 +143,28 @@ class box_project extends ModeleBoxes
// Add the sum à the bottom of the boxes // Add the sum à the bottom of the boxes
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead); $this->info_box_contents[$i][0] = array(
$this->info_box_contents[$i][1] = array('td' => '', 'text' => ""); 'tr' => 'class="liste_total"',
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($num, 0, ',', ' ')."&nbsp;".$langs->trans("Projects")); 'td' => 'align="left" ',
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => number_format($totalnbTask, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks")); 'text' => "&nbsp;",
$this->info_box_contents[$i][4] = array('td' => '', 'text' => ""); );
$this->info_box_contents[$i][1] = array(
'td' => '',
'text' => $langs->trans("Total")."&nbsp;".$textHead,
'text' => "&nbsp;",
);
$this->info_box_contents[$i][2] = array(
'td' => 'align="right" ',
'text' => number_format($num, 0, ',', ' ')."&nbsp;".$langs->trans("Projects"),
);
$this->info_box_contents[$i][3] = array(
'td' => 'align="right" ',
'text' => number_format($totalnbTask, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks"),
);
$this->info_box_contents[$i][4] = array(
'td' => '',
'text' => "&nbsp;",
);
} }

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -58,7 +59,7 @@ class box_propales extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$propalstatic=new Propal($db); $propalstatic=new Propal($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."Propals",$max)); $this->info_box_head = array('text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."Propals",$max));
if ($user->rights->propale->lire) if ($user->rights->propale->lire)
{ {
@ -83,8 +84,7 @@ class box_propales extends ModeleBoxes
$i = 0; $i = 0;
while ($i < $num) while ($i < $num) {
{
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$date=$db->jdate($objp->dp); $date=$db->jdate($objp->dp);
$datec=$db->jdate($objp->datec); $datec=$db->jdate($objp->datec);
@ -97,52 +97,75 @@ class box_propales extends ModeleBoxes
$late = img_warning($langs->trans("Late")); $late = img_warning($langs->trans("Late"));
} }
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $tooltip = $langs->trans('Proposal') . ': ' . $objp->ref;
'logo' => $this->boximg, $this->info_box_contents[$i][0] = array(
'url' => DOL_URL_ROOT."/comm/propal.php?id=".$objp->rowid); 'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/comm/propal.php?id=".$objp->rowid,
);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array(
'text' => $objp->ref, 'td' => 'align="left"',
'text2'=> $late, 'text' => $objp->ref,
'url' => DOL_URL_ROOT."/comm/propal.php?id=".$objp->rowid); 'text2'=> $late,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/comm/propal.php?id=".$objp->rowid,
);
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"', $tooltip = $langs->trans('Customer') . ': ' . $objp->name;
'logo' => 'company', $this->info_box_contents[$i][2] = array(
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'td' => 'align="left" width="16"',
'logo' => 'company',
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
);
$this->info_box_contents[$i][3] = array('td' => 'align="left"', $this->info_box_contents[$i][3] = array(
'text' => dol_trunc($objp->name,40), 'td' => 'align="left"',
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'text' => dol_trunc($objp->name,40),
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
);
$this->info_box_contents[$i][4] = array('td' => 'align="right"', $this->info_box_contents[$i][4] = array(
'text' => price($objp->total_ht), 'td' => 'align="right"',
); 'text' => price($objp->total_ht),
);
$this->info_box_contents[$i][5] = array('td' => 'align="right"', $this->info_box_contents[$i][5] = array(
'text' => dol_print_date($date,'day')); 'td' => 'align="right"',
'text' => dol_print_date($date,'day'),
);
$this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"', $this->info_box_contents[$i][6] = array(
'text' => $propalstatic->LibStatut($objp->fk_statut,3)); 'td' => 'align="right" width="18"',
'text' => $propalstatic->LibStatut($objp->fk_statut,3),
);
$i++; $i++;
} }
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProposals")); if ($num==0)
$this->info_box_contents[$i][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoRecordedProposals"),
);
$db->free($result); $db->free($result);
} } else {
else $this->info_box_contents[0][0] = array(
{ 'td' => 'align="left"',
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'maxlength'=>500,
'maxlength'=>500, 'text' => ($db->error().' sql='.$sql),
'text' => ($db->error().' sql='.$sql)); );
} }
} } else {
else $this->info_box_contents[0][0] = array(
{ 'td' => 'align="left"',
$this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed"),
'text' => $langs->trans("ReadPermissionNotAllowed")); );
} }
} }
/** /**

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -104,41 +105,58 @@ class box_prospect extends ModeleBoxes
$datec=$db->jdate($objp->datec); $datec=$db->jdate($objp->datec);
$datem=$db->jdate($objp->tms); $datem=$db->jdate($objp->tms);
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $this->info_box_contents[$i][0] = array(
'logo' => $this->boximg, 'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'logo' => $this->boximg,
'tooltip' => $objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array(
'text' => $objp->name, 'td' => 'align="left"',
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'text' => $objp->name,
'tooltip' => $objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
);
$this->info_box_contents[$i][2] = array('td' => 'align="right"', $this->info_box_contents[$i][2] = array(
'text' => dol_print_date($datem, "day")); 'td' => 'align="right"',
'text' => dol_print_date($datem, "day"),
);
$this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"', $this->info_box_contents[$i][3] = array(
'text' => str_replace('img ','img height="14" ',$prospectstatic->LibProspStatut($objp->fk_stcomm,3))); 'td' => 'align="right" width="18"',
'text' => str_replace('img ','img height="14" ',$prospectstatic->LibProspStatut($objp->fk_stcomm,3)),
);
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', $this->info_box_contents[$i][4] = array(
'text' => $thirdpartystatic->LibStatut($objp->status,3)); 'td' => 'align="right" width="18"',
'text' => $thirdpartystatic->LibStatut($objp->status,3),
);
$i++; $i++;
} }
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProspects")); if ($num==0)
$this->info_box_contents[$i][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoRecordedProspects"),
);
$db->free($resql); $db->free($resql);
} } else {
else $this->info_box_contents[0][0] = array(
{ 'td' => 'align="left"',
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'maxlength'=>500,
'maxlength'=>500, 'text' => ($db->error().' sql='.$sql),
'text' => ($db->error().' sql='.$sql)); );
} }
} } else {
else {
dol_syslog("box_prospect::loadBox not allowed de read this box content",LOG_ERR); dol_syslog("box_prospect::loadBox not allowed de read this box content",LOG_ERR);
$this->info_box_contents[0][0] = array('td' => 'align="left"', $this->info_box_contents[0][0] = array(
'text' => $langs->trans("ReadPermissionNotAllowed")); 'td' => 'align="left"',
'text' => $langs->trans("ReadPermissionNotAllowed"),
);
} }
} }

View File

@ -3,6 +3,7 @@
/* Copyright (C) 2004-2006 Destailleur Laurent <eldy@users.sourceforge.net> /* Copyright (C) 2004-2006 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -82,8 +83,7 @@ class box_supplier_orders extends ModeleBoxes
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num) {
{
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$date=$db->jdate($objp->date_commande); $date=$db->jdate($objp->date_commande);
$datem=$db->jdate($objp->tms); $datem=$db->jdate($objp->tms);
@ -91,48 +91,70 @@ class box_supplier_orders extends ModeleBoxes
$urlo = DOL_URL_ROOT."/fourn/commande/card.php?id=".$objp->rowid; $urlo = DOL_URL_ROOT."/fourn/commande/card.php?id=".$objp->rowid;
$urls = DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid; $urls = DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid;
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $tooltip = $langs->trans('SupplierOrder') . ': ' . $objp->ref;
'logo' => $this->boximg, $this->info_box_contents[$i][0] = array(
'url' => $urlo); 'td' => 'align="left" width="16"',
'logo' => $this->boximg,
$this->info_box_contents[$i][1] = array('td' => 'align="left"', 'tooltip' => $tooltip,
'text' => $objp->ref, 'url' => $urlo,
'url' => $urlo);
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
'logo' => 'company',
'url' => $urls);
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => $objp->name,
'url' => $urls);
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
'text' => dol_print_date($date,'day'),
); );
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', $this->info_box_contents[$i][1] = array(
'text' => $supplierorderstatic->LibStatut($objp->fk_statut,3)); 'td' => 'align="left"',
'text' => $objp->ref,
'tooltip' => $tooltip,
'url' => $urlo,
);
$tooltip = $langs->trans('Supplier') . ': ' . $objp->name;
$this->info_box_contents[$i][2] = array(
'td' => 'align="left" width="16"',
'logo' => 'company',
'tooltip' => $tooltip,
'url' => $urls,
);
$this->info_box_contents[$i][3] = array(
'td' => 'align="left"',
'text' => $objp->name,
'tooltip' => $tooltip,
'url' => $urls,
);
$this->info_box_contents[$i][4] = array(
'td' => 'align="right"',
'text' => dol_print_date($date,'day'),
);
$this->info_box_contents[$i][5] = array(
'td' => 'align="right" width="18"',
'text' => $supplierorderstatic->LibStatut($objp->fk_statut,3),
);
$i++; $i++;
} }
if ($num == 0) if ($num == 0)
$this->info_box_contents[$i][0] = array('td' => 'align="center"', 'text' => $langs->trans("NoSupplierOrder")); $this->info_box_contents[$i][0] = array(
'td' => 'align="center"',
'text' => $langs->trans("NoSupplierOrder"),
);
$db->free($result); $db->free($result);
} } else {
else $this->info_box_contents[0][0] = array(
{ 'td' => 'align="left"',
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'maxlength'=>500,
'maxlength'=>500, 'text' => ($db->error().' sql='.$sql),
'text' => ($db->error().' sql='.$sql)); );
} }
} }
else else
{ {
$this->info_box_contents[0][0] = array('td' => 'align="left"', $this->info_box_contents[0][0] = array(
'text' => $langs->trans("ReadPermissionNotAllowed")); 'td' => 'align="left"',
'text' => $langs->trans("ReadPermissionNotAllowed"),
);
} }
} }

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr> /* 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 * 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 * 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); $objp = $db->fetch_object($result);
$this->info_box_contents[$i][1] = array( $this->info_box_contents[$i][1] = array(
'td' => 'align="left"', '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( $this->info_box_contents[$i][2] = array(
'td' => 'align="right"', 'td' => 'align="right"',
'text' => $objp->nb."&nbsp;".$langs->trans("Tasks"), '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; $totalnb += $objp->nb;
$this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5)); $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) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -178,153 +179,173 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
*/ */
function showBox($head, $contents) function showBox($head, $contents)
{ {
global $langs,$conf; global $langs, $user, $conf;
require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
$MAXLENGTHBOX=60; // Mettre 0 pour pas de limite $MAXLENGTHBOX=60; // Mettre 0 pour pas de limite
$bcx=array(); $bcx = array();
$bcx[0] = 'class="box_pair"'; $bcx[0] = 'class="box_pair"';
$bcx[1] = 'class="box_impair"'; $bcx[1] = 'class="box_impair"';
$var = false; $var = false;
dol_syslog(get_class($this).'::showBox'); $cachetime = 900; // 900 : 15mn
$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);
$out = '';
// Define nbcol and nblines of the box to show if ($refresh) {
$nbcol=0; dol_syslog(get_class($this).'::showBox');
if (isset($contents[0])) $nbcol=count($contents[0]);
$nblines=count($contents);
print "\n\n<!-- Box start -->\n"; // Define nbcol and nblines of the box to show
print '<div class="box" id="boxto_'.$this->box_id.'">'."\n"; $nbcol=0;
if (isset($contents[0])) $nbcol=count($contents[0]);
$nblines=count($contents);
if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']) || $nblines) $out.= "\n<!-- Box ".get_class($this)." start -->\n";
{ $out.= '<div class="box" id="boxto_'.$this->box_id.'">'."\n";
print '<table summary="boxtable'.$this->box_id.'" width="100%" class="noborder boxtable">'."\n";
}
// Show box title if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']) || $nblines)
if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto'])) {
{ $out.= '<table summary="boxtable'.$this->box_id.'" width="100%" class="noborder boxtable">'."\n";
//print '<div id="boxto_'.$this->box_id.'_title">'."\n"; }
//print '<table summary="boxtabletitle'.$this->box_id.'" width="100%" class="noborder">'."\n";
print '<tr class="box_titre">';
print '<td';
if ($nbcol > 0) { print ' colspan="'.$nbcol.'"'; }
print '>';
if ($conf->use_javascript_ajax)
{
print '<table summary="" class="nobordernopadding" width="100%"><tr><td>';
}
if (! empty($head['text']))
{
$s=dol_trunc($head['text'],isset($head['limit'])?$head['limit']:$MAXLENGTHBOX);
print $s;
}
print ' ';
if (! empty($head['sublink'])) print '<a href="'.$head['sublink'].'"'.(empty($head['target'])?' target="_blank"':'').'>';
if (! empty($head['subpicto'])) print img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"');
if (! empty($head['sublink'])) '</a>';
if (! empty($conf->use_javascript_ajax))
{
print '</td><td class="nocellnopadd boxclose nowrap">';
// The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object
print img_picto($langs->trans("MoveBox",$this->box_id),'grip_title','class="boxhandle hideonsmartphone" style="cursor:move;"');
print img_picto($langs->trans("Close2",$this->box_id),'close_title','class="boxclose" rel="x:y" style="cursor:pointer;" id="imgclose'.$this->box_id.'"');
$label=$head['text'];
if (! empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')';
print '<input type="hidden" id="boxlabelentry'.$this->box_id.'" value="'.dol_escape_htmltag($label).'">';
print '</td></tr></table>';
}
print '</td>';
print "</tr>\n";
//print "</table>\n";
//print "</div>\n";
}
// Show box lines // Show box title
if ($nblines) if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']))
{ {
//print '<table summary="boxtablelines'.$this->box_id.'" width="100%" class="noborder">'."\n"; //$out.= '<div id="boxto_'.$this->box_id.'_title">'."\n";
// Loop on each record //$out.= '<table summary="boxtabletitle'.$this->box_id.'" width="100%" class="noborder">'."\n";
for ($i=0, $n=$nblines; $i < $n; $i++) $out.= '<tr class="box_titre">';
{ $out.= '<td';
if (isset($contents[$i])) if ($nbcol > 0) { $out.= ' colspan="'.$nbcol.'"'; }
{ $out.= '>';
$var=!$var; if ($conf->use_javascript_ajax)
{
$out.= '<table summary="" class="nobordernopadding" width="100%"><tr><td>';
}
if (! empty($head['text']))
{
$s=dol_trunc($head['text'],isset($head['limit'])?$head['limit']:$MAXLENGTHBOX);
$out.= $s;
}
$out.= ' ';
if (! empty($head['sublink'])) $out.= '<a href="'.$head['sublink'].'"'.(empty($head['target'])?' target="_blank"':'').'>';
if (! empty($head['subpicto'])) $out.= img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"');
if (! empty($head['sublink'])) '</a>';
if (! empty($conf->use_javascript_ajax))
{
$out.= '</td><td class="nocellnopadd boxclose nowrap">';
// The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object
$out.= img_picto($langs->trans("MoveBox",$this->box_id),'grip_title','class="boxhandle hideonsmartphone" style="cursor:move;"');
$out.= img_picto($langs->trans("Close2",$this->box_id),'close_title','class="boxclose" rel="x:y" style="cursor:pointer;" id="imgclose'.$this->box_id.'"');
$label=$head['text'];
if (! empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')';
$out.= '<input type="hidden" id="boxlabelentry'.$this->box_id.'" value="'.dol_escape_htmltag($label).'">';
$out.= '</td></tr></table>';
}
$out.= '</td>';
$out.= "</tr>\n";
//$out.= "</table>\n";
//$out.= "</div>\n";
}
// TR // Show box lines
if (isset($contents[$i][0]['tr'])) print '<tr valign="top" '.$contents[$i][0]['tr'].'>'; if ($nblines)
else print '<tr valign="top" '.$bcx[$var].'>'; {
//$out.= '<table summary="boxtablelines'.$this->box_id.'" width="100%" class="noborder">'."\n";
// Loop on each record
for ($i=0, $n=$nblines; $i < $n; $i++)
{
if (isset($contents[$i]))
{
$var=!$var;
// Loop on each TD // TR
$nbcolthisline=count($contents[$i]); if (isset($contents[$i][0]['tr'])) $out.= '<tr valign="top" '.$contents[$i][0]['tr'].'>';
for ($j=0; $j < $nbcolthisline; $j++) { else $out.= '<tr valign="top" '.$bcx[$var].'>';
// Define tdparam
$tdparam='';
if (isset($contents[$i][$j]['td'])) $tdparam.=' '.$contents[$i][$j]['td'];
if (empty($contents[$i][$j]['text'])) $contents[$i][$j]['text']=""; // Loop on each TD
$text=isset($contents[$i][$j]['text'])?$contents[$i][$j]['text']:''; $nbcolthisline=count($contents[$i]);
$textwithnotags=preg_replace('/<([^>]+)>/i','',$text); for ($j=0; $j < $nbcolthisline; $j++) {
$text2=isset($contents[$i][$j]['text2'])?$contents[$i][$j]['text2']:''; // Define tdparam
$text2withnotags=preg_replace('/<([^>]+)>/i','',$text2); $tdparam='';
$textnoformat=isset($contents[$i][$j]['textnoformat'])?$contents[$i][$j]['textnoformat']:''; if (isset($contents[$i][$j]['td'])) $tdparam.=' '.$contents[$i][$j]['td'];
//print "xxx $textwithnotags y";
if (empty($contents[$i][$j]['tooltip'])) $contents[$i][$j]['tooltip']="";
$tooltip=isset($contents[$i][$j]['tooltip'])?$contents[$i][$j]['tooltip']:'';
print '<td'.$tdparam.'>'."\n"; if (empty($contents[$i][$j]['text'])) $contents[$i][$j]['text']="";
$text=isset($contents[$i][$j]['text'])?$contents[$i][$j]['text']:'';
$textwithnotags=preg_replace('/<([^>]+)>/i','',$text);
$text2=isset($contents[$i][$j]['text2'])?$contents[$i][$j]['text2']:'';
$text2withnotags=preg_replace('/<([^>]+)>/i','',$text2);
$textnoformat=isset($contents[$i][$j]['textnoformat'])?$contents[$i][$j]['textnoformat']:'';
//$out.= "xxx $textwithnotags y";
if (empty($contents[$i][$j]['tooltip'])) $contents[$i][$j]['tooltip']="";
$tooltip=isset($contents[$i][$j]['tooltip'])?$contents[$i][$j]['tooltip']:'';
// Url $out.= '<td'.$tdparam.'>'."\n";
if (! empty($contents[$i][$j]['url']) && empty($contents[$i][$j]['logo']))
{
print '<a href="'.$contents[$i][$j]['url'].'" title="'.dol_escape_htmltag($langs->trans("Show").' '.$tooltip, 1).'" class="classfortooltip"';
//print ' alt="'.$textwithnotags.'"'; // Pas de alt sur un "<a href>"
print isset($contents[$i][$j]['target'])?' target="'.$contents[$i][$j]['target'].'"':'';
print '>';
}
// Logo // Url
if (! empty($contents[$i][$j]['logo'])) if (! empty($contents[$i][$j]['url']) && empty($contents[$i][$j]['logo']))
{ {
$logo=preg_replace("/^object_/i","",$contents[$i][$j]['logo']); $out.= '<a href="'.$contents[$i][$j]['url'].'" title="'.dol_escape_htmltag($langs->trans("Show").' '.$tooltip, 1).'" class="classfortooltip"';
print '<a href="'.$contents[$i][$j]['url'].'">'; //$out.= ' alt="'.$textwithnotags.'"'; // Pas de alt sur un "<a href>"
print img_object($langs->trans("Show").' '.$tooltip, $logo, 'class="classfortooltip"'); $out.= isset($contents[$i][$j]['target'])?' target="'.$contents[$i][$j]['target'].'"':'';
} $out.= '>';
}
$maxlength=$MAXLENGTHBOX; // Logo
if (! empty($contents[$i][$j]['maxlength'])) $maxlength=$contents[$i][$j]['maxlength']; if (! empty($contents[$i][$j]['logo']))
{
$logo=preg_replace("/^object_/i","",$contents[$i][$j]['logo']);
$out.= '<a href="'.$contents[$i][$j]['url'].'">';
$out.= img_object($langs->trans("Show").' '.$tooltip, $logo, 'class="classfortooltip"');
}
if ($maxlength) $textwithnotags=dol_trunc($textwithnotags,$maxlength); $maxlength=$MAXLENGTHBOX;
if (preg_match('/^<img/i',$text) || ! empty($contents[$i][$j]['asis'])) print $text; // show text with no html cleaning if (! empty($contents[$i][$j]['maxlength'])) $maxlength=$contents[$i][$j]['maxlength'];
else print $textwithnotags; // show text with html cleaning
// End Url if ($maxlength) $textwithnotags=dol_trunc($textwithnotags,$maxlength);
if (! empty($contents[$i][$j]['url'])) print '</a>'; if (preg_match('/^<img/i',$text) || ! empty($contents[$i][$j]['asis'])) $out.= $text; // show text with no html cleaning
else $out.= $textwithnotags; // show text with html cleaning
if (preg_match('/^<img/i',$text2) || ! empty($contents[$i][$j]['asis2'])) print $text2; // show text with no html cleaning // End Url
else print $text2withnotags; // show text with html cleaning if (! empty($contents[$i][$j]['url'])) $out.= '</a>';
if (! empty($textnoformat)) print "\n".$textnoformat."\n"; if (preg_match('/^<img/i',$text2) || ! empty($contents[$i][$j]['asis2'])) $out.= $text2; // show text with no html cleaning
else $out.= $text2withnotags; // show text with html cleaning
print "</td>\n"; if (! empty($textnoformat)) $out.= "\n".$textnoformat."\n";
}
print "</tr>\n"; $out.= "</td>\n";
} }
}
}
if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']) || $nblines) $out.= "</tr>\n";
{ }
print "</table>\n"; }
} }
// If invisible box with no contents if (! empty($head['text']) || ! empty($head['sublink']) || ! empty($head['subpicto']) || $nblines)
if (empty($head['text']) && empty($head['sublink']) && empty($head['subpicto']) && ! $nblines) print "<br>\n"; {
$out.= "</table>\n";
}
print "</div>\n"; // If invisible box with no contents
print "<!-- Box end -->\n\n"; if (empty($head['text']) && empty($head['sublink']) && empty($head['subpicto']) && ! $nblines) $out.= "<br>\n";
}
$out.= "</div>\n";
$out.= "<!-- Box ".get_class($this)." end -->\n\n";
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
dol_filecache($cachedir, $filename, $out);
}
} else {
dol_syslog(get_class($this).'::showBoxCached');
$out = dol_readcachefile($cachedir, $filename);
print "<!-- Box ".get_class($this)." from cache -->";
}
print $out;
}
} }

View File

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

View File

@ -2,11 +2,12 @@
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * 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 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <contact@altairis.fr> * 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 * 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 * 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">'; $out.='<td width="80" class="nowrap">';
$userstatic->id=$obj->fk_user_author; //$userstatic->id=$obj->fk_user_author;
$userstatic->login=$obj->login; //$userstatic->login=$obj->login;
$out.=$userstatic->getLoginUrl(1); //$out.=$userstatic->getLoginUrl(1);
$userstatic->fetch($obj->fk_user_author);
$out.=$userstatic->getNomUrl(1);
$out.='</td>'; $out.='</td>';
// Statut // 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)) if ($histo[$key]['elementtype'] == 'propal' && ! empty($conf->propal->enabled))
{ {
$propalstatic->ref=$langs->trans("ProposalShort"); //$propalstatic->ref=$langs->trans("ProposalShort");
$propalstatic->id=$histo[$key]['fk_element']; //$propalstatic->id=$histo[$key]['fk_element'];
$out.=$propalstatic->getNomUrl(1); 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)) elseif (($histo[$key]['elementtype'] == 'order' || $histo[$key]['elementtype'] == 'commande') && ! empty($conf->commande->enabled))
{ {
$orderstatic->ref=$langs->trans("Order"); //$orderstatic->ref=$langs->trans("Order");
$orderstatic->id=$histo[$key]['fk_element']; //$orderstatic->id=$histo[$key]['fk_element'];
$out.=$orderstatic->getNomUrl(1); 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)) elseif (($histo[$key]['elementtype'] == 'invoice' || $histo[$key]['elementtype'] == 'facture') && ! empty($conf->facture->enabled))
{ {
$facturestatic->ref=$langs->trans("Invoice"); //$facturestatic->ref=$langs->trans("Invoice");
$facturestatic->id=$histo[$key]['fk_element']; //$facturestatic->id=$histo[$key]['fk_element'];
$facturestatic->type=$histo[$key]['ftype']; if ($facturestatic->fetch($histo[$key]['fk_element'])>0) {
$out.=$facturestatic->getNomUrl(1,'compta'); $facturestatic->type=$histo[$key]['ftype'];
$out.=$facturestatic->getNomUrl(1,'compta');
} else {
$out.= $langs->trans("InvoiceDeleted");
}
} }
else $out.='&nbsp;'; else $out.='&nbsp;';
} }
@ -1272,9 +1289,11 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
// Auteur // Auteur
$out.='<td class="nowrap" width="80">'; $out.='<td class="nowrap" width="80">';
$userstatic->id=$histo[$key]['userid']; //$userstatic->id=$histo[$key]['userid'];
$userstatic->login=$histo[$key]['login']; //$userstatic->login=$histo[$key]['login'];
$out.=$userstatic->getLoginUrl(1); //$out.=$userstatic->getLoginUrl(1);
$userstatic->fetch($histo[$key]['userid']);
$out.=$userstatic->getNomUrl(1);
$out.='</td>'; $out.='</td>';
// Statut // Statut

View File

@ -1876,3 +1876,49 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
return $ret; return $ret;
} }
/**
* Store object in file
*
* @param string $directory Directory of cache
* @param string $filename Name of filecache
* @param mixed $object Object to store in cachefile
* @return void
*/
function dol_filecache($directory, $filename, $object)
{
if (! dol_is_dir($directory)) dol_mkdir($directory);
$cachefile = $directory . $filename;
file_put_contents($cachefile, serialize($object), LOCK_EX);
@chmod($cachefile, 0644);
}
/**
* Test if Refresh needed
*
* @param string $directory Directory of cache
* @param string $filename Name of filecache
* @param int $cachetime Cachetime delay
* @return boolean 0 no refresh 1 if refresh needed
*/
function dol_cache_refresh($directory, $filename, $cachetime)
{
$now = dol_now();
$cachefile = $directory . $filename;
$refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
return $refresh;
}
/**
* Read object from cachefile
*
* @param string $directory Directory of cache
* @param string $filename Name of filecache
* @return mixed Unserialise from file
*/
function dol_readcachefile($directory, $filename)
{
$cachefile = $directory . $filename;
$object = unserialize(file_get_contents($cachefile));
return $object;
}

View File

@ -1218,7 +1218,9 @@ class Expedition extends CommonObject
global $langs; global $langs;
$result=''; $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; $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'; $helpurl='EN:Module_Shipments|FR:Module_Exp&eacute;ditions|ES:M&oacute;dulo_Expediciones';
llxHeader('',$langs->trans('ListOfSendings'),$helpurl); 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.= ", s.nom as socname, s.rowid as socid";
$sql.= " FROM (".MAIN_DB_PREFIX."expedition as e"; $sql.= " FROM (".MAIN_DB_PREFIX."expedition as e";
if (!$user->rights->societe->client->voir && !$socid) // Internal user with no permission to see all 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("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("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); 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); 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("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); 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 '<input class="flat" type="text" size="10" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
print '</td>'; print '</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
if($conf->livraison_bon->enabled) { if($conf->expedition_bon->enabled) {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat" size="10" type="text" name="search_ref_liv" value="'.$search_ref_liv.'"'; print '<input class="flat" size="10" type="text" name="search_ref_liv" value="'.$search_ref_liv.'"';
print '</td>'; print '</td>';
}
if($conf->livraison_bon->enabled) {
print '<td class="liste_titre">&nbsp;</td>'; 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")).'">'; 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 // Date delivery planed
print "<td align=\"center\">"; 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(); /*$now = time();
if ( ($now - $db->jdate($objp->date_expedition)) > $conf->warnings->lim && $objp->statutid == 1 ) if ( ($now - $db->jdate($objp->date_expedition)) > $conf->warnings->lim && $objp->statutid == 1 )
{ {
}*/ }*/
print "</td>\n"; print "</td>\n";
if($conf->livraison_bon->enabled) { if($conf->expedition_bon->enabled) {
// Date real // Date real
print "<td align=\"center\">"; print '<td align="center">';
print dol_print_date($db->jdate($objp->date_livraison),"day"); print dol_print_date($db->jdate($objp->date_expedition),"day");
print "</td>\n"; 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>'; 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.qty,";
$sql.= ' cd.date_start,'; $sql.= ' cd.date_start,';
$sql.= ' cd.date_end,'; $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.= ' p.description as product_desc, p.fk_product_type as product_type';
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd"; $sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; $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(); $commande->fetch_thirdparty();
$prod = new Product($db); $prod = new Product($db);
$prod->id=$objp->fk_product; $prod->id = $objp->fk_product;
$prod->entity = $objp->entity;
$prod->getMultiLangs(); $prod->getMultiLangs();
$outputlangs = $langs; $outputlangs = $langs;
@ -461,9 +462,11 @@ if ($id > 0 || ! empty($ref))
$product_static->type=$objp->fk_product_type; $product_static->type=$objp->fk_product_type;
$product_static->id=$objp->fk_product; $product_static->id=$objp->fk_product;
$product_static->ref=$objp->ref; $product_static->ref=$objp->ref;
$product_static->entity = $objp->entity;
$text=$product_static->getNomUrl(1); $text=$product_static->getNomUrl(1);
$text.= ' - '.$label; $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); print $form->textwithtooltip($text,$description,3,'','',$i);
// Show range // Show range

View File

@ -46,8 +46,8 @@ foreach($linkedObjectBlock as $object)
{ {
$var=!$var; $var=!$var;
?> ?>
<tr <?php echo $GLOBALS['bc'][$var]; ?> ><td> <tr <?php echo $GLOBALS['bc'][$var]; ?> >
<a href="<?php echo DOL_URL_ROOT.'/expedition/card.php?id='.$object->id ?>"><?php echo img_object($langs->trans("ShowShipping"),"sending").' '.$object->ref; ?></a></td> <td><?php echo $object->getNomUrl(1); ?></td>
<td align="center"><?php echo dol_print_date($object->date_creation,'day'); ?></td> <td align="center"><?php echo dol_print_date($object->date_creation,'day'); ?></td>
<td align="center"><?php echo dol_print_date($object->date_delivery,'day'); ?></td> <td align="center"><?php echo dol_print_date($object->date_delivery,'day'); ?></td>
<td align="right"><?php <td align="right"><?php

View File

@ -547,7 +547,9 @@ class Fichinter extends CommonObject
global $langs; global $langs;
$result=''; $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">'; $lien = '<a href="'.DOL_URL_ROOT.'/fichinter/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';

View File

@ -41,8 +41,8 @@ foreach($linkedObjectBlock as $object)
{ {
$var=!$var; $var=!$var;
?> ?>
<tr <?php echo $GLOBALS['bc'][$var]; ?> ><td> <tr <?php echo $GLOBALS['bc'][$var]; ?> >
<a href="<?php echo DOL_URL_ROOT.'/fichinter/card.php?id='.$object->id ?>"><?php echo img_object($langs->trans("ShowIntervention"),"intervention").' '.$object->ref; ?></a></td> <td><?php echo $object->getNomUrl(1); ?></td>
<td align="center"><?php echo dol_print_date($object->datev,'day'); ?></td> <td align="center"><?php echo dol_print_date($object->datev,'day'); ?></td>
<td align="right"><?php echo $object->getLibStatut(3); ?></td> <td align="right"><?php echo $object->getLibStatut(3); ?></td>
</tr> </tr>

View File

@ -337,7 +337,7 @@ if ($object->id > 0)
} }
// TODO move to DAO class // 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.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
$sql.= " WHERE p.fk_soc =".$object->id; $sql.= " WHERE p.fk_soc =".$object->id;
$sql.= " AND p.entity =".$conf->entity; $sql.= " AND p.entity =".$conf->entity;
@ -369,8 +369,11 @@ if ($object->id > 0)
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td class="nowrap">'; print '<td class="nowrap">';
$orderstatic->id=$obj->rowid; $orderstatic->id = $obj->rowid;
$orderstatic->ref=$obj->ref; $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 $orderstatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td align="center" width="80">'; print '<td align="center" width="80">';
@ -408,7 +411,7 @@ if ($object->id > 0)
if ($user->rights->fournisseur->facture->lire) if ($user->rights->fournisseur->facture->lire)
{ {
// TODO move to DAO class // 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.= ' SUM(pf.amount) as am';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f'; $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'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn';
@ -441,6 +444,10 @@ if ($object->id > 0)
print '<a href="facture/card.php?facid='.$obj->rowid.'">'; print '<a href="facture/card.php?facid='.$obj->rowid.'">';
$facturestatic->id=$obj->rowid; $facturestatic->id=$obj->rowid;
$facturestatic->ref=($obj->ref?$obj->ref:$obj->rowid).($obj->ref_supplier?' - '.$obj->ref_supplier:''); $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; //$facturestatic->ref_supplier=$obj->ref_supplier;
print $facturestatic->getNomUrl(1); print $facturestatic->getNomUrl(1);
//print img_object($langs->trans('ShowBill'),'bill').' '.($obj->ref?$obj->ref:$obj->rowid).' - '.$obj->ref_supplier.'</a>'; //print img_object($langs->trans('ShowBill'),'bill').' '.($obj->ref?$obj->ref:$obj->rowid).' - '.$obj->ref_supplier.'</a>';

View File

@ -532,7 +532,17 @@ class CommandeFournisseur extends CommonOrder
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowOrder").': '.$this->ref; $label = '<u>' . $langs->trans("ShowOrder") . '</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);
$lien = '<a href="'.DOL_URL_ROOT.'/fourn/commande/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $lien = '<a href="'.DOL_URL_ROOT.'/fourn/commande/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';

View File

@ -1472,8 +1472,17 @@ class FactureFournisseur extends CommonInvoice
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowInvoice").': '.$this->ref; $label = '<u>' . $langs->trans("ShowSupplierInvoice") . '</u>';
if ($this->ref_supplier) $label.=' / '.$this->ref_supplier; 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') if ($option == 'document')
{ {

View File

@ -99,9 +99,16 @@ if ($sortfield == "") $sortfield="cf.date_creation";
$offset = $conf->liste_limit * $page ; $offset = $conf->liste_limit * $page ;
/*
* Mode Liste
*/
$sql = "SELECT s.rowid as socid, s.nom as name, cf.date_commande as dc,"; $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_ttc, cf.total_ht, cf.fk_user_author,cf.date_livraison,"; $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.= " p.rowid as project_id, p.ref as project_ref,";
$sql.= " u.firstname,";
$sql.= " u.lastname,";
$sql.= " u.photo,";
$sql.= " u.login"; $sql.= " u.login";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,";
$sql.= " ".MAIN_DB_PREFIX."commande_fournisseur as cf"; $sql.= " ".MAIN_DB_PREFIX."commande_fournisseur as cf";
@ -228,11 +235,18 @@ if ($resql)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$var=!$var; $var=!$var;
$objectstatic->id=$obj->rowid;
$objectstatic->ref=$obj->ref;
$objectstatic->ref_supplier = $obj->ref_supplier;
$objectstatic->total_ht = $obj->total_ht;
$objectstatic->total_tva = $obj->total_tva;
$objectstatic->total_ttc = $obj->total_ttc;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
// Ref // Ref
print '<td><a href="'.DOL_URL_ROOT.'/fourn/commande/card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'</a>'; print '<td class="nobordernopadding nowrap">';
print $objectstatic->getNomUrl(1);
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->fournisseur->dir_output.'/commande' . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->fournisseur->dir_output.'/commande' . '/' . dol_sanitizeFileName($obj->ref);
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
@ -258,11 +272,14 @@ if ($resql)
print '</td>'; print '</td>';
} }
// Author // Author
$userstatic->id=$obj->fk_user_author; $userstatic->id = $obj->fk_user_author;
$userstatic->login=$obj->login; $userstatic->lastname = $obj->lastname;
$userstatic->firstname = $obj->firstname;
$userstatic->login = $obj->login;
$userstatic->photo = $obj->photo;
print "<td>"; print "<td>";
if ($userstatic->id) print $userstatic->getLoginUrl(1); if ($userstatic->id) print $userstatic->getNomUrl(1);
else print "&nbsp;"; else print "&nbsp;";
print "</td>"; print "</td>";

View File

@ -4,6 +4,7 @@ Sending=Shipment
Sendings=Shipments Sendings=Shipments
Shipment=Shipment Shipment=Shipment
Shipments=Shipments Shipments=Shipments
ShowSending=Show Sending
Receivings=Receipts Receivings=Receipts
SendingsArea=Shipments area SendingsArea=Shipments area
ListOfSendings=List of shipments ListOfSendings=List of shipments

View File

@ -1401,6 +1401,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
$form=new Form($db); $form=new Form($db);
// Define link to login card // Define link to login card
/*
$loginhtmltext=''; $logintext=''; $loginhtmltext=''; $logintext='';
if ($user->societe_id) 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); $loginhtmltext.='<br><b>'.$langs->trans("Administrator").'</b>: '.yn($user->admin);
$type=($user->societe_id?$langs->trans("External").$company:$langs->trans("Internal")); $type=($user->societe_id?$langs->trans("External").$company:$langs->trans("Internal"));
$loginhtmltext.='<br><b>'.$langs->trans("Type").'</b>: '.$type; $loginhtmltext.='<br><b>'.$langs->trans("Type").'</b>: '.$type;
$loginhtmltext.='<br><b>'.$langs->trans("IPAddress").'</b>: '.$_SERVER["REMOTE_ADDR"];
$loginhtmltext.='<br>'; $loginhtmltext.='<br>';
$loginhtmltext.='<br><u>'.$langs->trans("Connection").'</u>'; $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.')'; 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("AuthenticationMode").'</b>: '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo)?'':' (demo)');
$loginhtmltext.='<br><b>'.$langs->trans("ConnectedSince").'</b>: '.dol_print_date($user->datelastlogin,"dayhour"); $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'].')'; $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($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"])); if (! empty($_SESSION["disablemodules"])) $loginhtmltext.='<br><b>'.$langs->trans("DisabledModules").'</b>: <br>'.join(', ',explode(',',$_SESSION["disablemodules"]));
*/
$appli='Dolibarr'; $appli='Dolibarr';
if (! empty($conf->global->MAIN_APPLICATION_TITLE)) 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">'; $toprightmenu.='<div class="login_block_user">';
// Add login user link // 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>';
$toprightmenu.='<div class="login_block_other">'; $toprightmenu.='<div class="login_block_other">';

View File

@ -2861,14 +2861,21 @@ class Product extends CommonObject
*/ */
function getNomUrl($withpicto=0,$option='',$maxlength=0) function getNomUrl($withpicto=0,$option='',$maxlength=0)
{ {
global $langs; global $conf, $langs;
$result=''; $result='';
$newref=$this->ref; $newref=$this->ref;
if ($maxlength) $newref=dol_trunc($newref,$maxlength,'middle'); if ($maxlength) $newref=dol_trunc($newref,$maxlength,'middle');
if ($this->type == 0) $label = $langs->trans("ShowProduct").': '.$this->ref.' '.$this->label; if ($this->type == 0) $label = '<u>' . $langs->trans("ShowProduct") . '</u>';
if ($this->type == 1) $label = $langs->trans("ShowService").': '.$this->ref.' '.$this->label; if ($this->type == 1) $label = '<u>' . $langs->trans("ShowService") . '</u>';
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; if (! empty($this->ref))
$label .= '<br><b>' . $langs->trans('ProductRef') . ':</b> ' . $this->ref;
if (! empty($this->label))
$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') { if ($option == 'supplier') {
$lien = '<a href="'.DOL_URL_ROOT.'/product/fournisseurs.php?id='.$this->id.$linkclose; $lien = '<a href="'.DOL_URL_ROOT.'/product/fournisseurs.php?id='.$this->id.$linkclose;

View File

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

View File

@ -420,6 +420,7 @@ else
print '<td class="nowrap">'; print '<td class="nowrap">';
$product_static->id = $objp->rowid; $product_static->id = $objp->rowid;
$product_static->ref = $objp->ref; $product_static->ref = $objp->ref;
$product_static->label = $objp->label;
$product_static->type = $objp->fk_product_type; $product_static->type = $objp->fk_product_type;
print $product_static->getNomUrl(1,'',24); print $product_static->getNomUrl(1,'',24);
print "</td>\n"; print "</td>\n";

View File

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

View File

@ -512,7 +512,10 @@ class Entrepot extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label = $langs->trans("ShowStock").': '.$this->libelle; $label = '<u>' . $langs->trans("ShowWarehouse").'</u>';
$label.= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->libelle;
if (! empty($this->lieu))
$label.= '<br><b>' . $langs->trans('LocationSummary').':</b> '.$this->lieu;
$lien='<a href="'.DOL_URL_ROOT.'/product/stock/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $lien='<a href="'.DOL_URL_ROOT.'/product/stock/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';

View File

@ -103,9 +103,12 @@ if ($result)
while ($i < min($num,$limit)) while ($i < min($num,$limit))
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$entrepot->id = $objp->rowid;
$entrepot->libelle = $objp->ref;
$entrepot->lieu = $objp->lieu;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td><a href="card.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowWarehouse"),'stock').' '.$objp->ref.'</a></td>'; print '<td>' . $entrepot->getNomUrl(1) . '</td>';
// Location // Location
print '<td>'.$objp->lieu.'</td>'; print '<td>'.$objp->lieu.'</td>';
// PMP value // PMP value
print '<td align="right">'; print '<td align="right">';

View File

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

View File

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

View File

@ -789,7 +789,11 @@ class Project extends CommonObject
$result = ''; $result = '';
$lien = ''; $lien = '';
$lienfin = ''; $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">'; $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option != 'nolink') { if ($option != 'nolink') {

View File

@ -7,7 +7,7 @@ require '../../main.inc.php';
if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1') if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1')
{ {
print "Page available only frome remote address 127.0.0.1"; print "Page available only from remote address 127.0.0.1";
exit; exit;
} }

View File

@ -8,7 +8,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1') if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1')
{ {
print "Page available only frome remote address 127.0.0.1"; print "Page available only from remote address 127.0.0.1";
exit; exit;
} }

View File

@ -1720,39 +1720,62 @@ class Societe extends CommonObject
$result=''; $result='';
$lien=$lienfin=''; $lien=$lienfin='';
$label = '<table width="100%">';
$label.= '<tr>';
$label.= '<td valign="top">';
if ($option == 'customer' || $option == 'compta') if ($option == 'customer' || $option == 'compta')
{ {
$label.= '<u>' . $langs->trans("ShowCustomer") . '</u>';
$lien = '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id; $lien = '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id;
} }
else if ($option == 'prospect' && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) 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; $lien = '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id;
} }
else if ($option == 'supplier') else if ($option == 'supplier')
{ {
$label.= '<u>' . $langs->trans("ShowSupplier") . '</u>';
$lien = '<a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$this->id; $lien = '<a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$this->id;
} }
else if ($option == 'category') else if ($option == 'category')
{ {
$label.= '<u>' . $langs->trans("ShowCategory") . '</u>';
$lien = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=2'; $lien = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=2';
} }
else if ($option == 'category_supplier') 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'; $lien = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=1';
} }
// By default // By default
if (empty($lien)) if (empty($lien))
{ {
$label.= '<u>' . $langs->trans("ShowCompany") . '</u>';
$lien = '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$this->id; $lien = '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$this->id;
} }
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 // Add type of canvas
$lien.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'" title="'.dol_escape_htmltag($name, 1).'" class="classfortooltip">'; $lien.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$name, 'company', 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, 'company', 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';
$result.=$lien.($maxlen?dol_trunc($name,$maxlen):$name).$lienfin; $result.=$lien.($maxlen?dol_trunc($name,$maxlen):$name).$lienfin;

View File

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

View File

@ -1181,8 +1181,8 @@ else
$object->idprof2 = GETPOST('idprof2', 'alpha'); $object->idprof2 = GETPOST('idprof2', 'alpha');
$object->idprof3 = GETPOST('idprof3', 'alpha'); $object->idprof3 = GETPOST('idprof3', 'alpha');
$object->idprof4 = GETPOST('idprof4', 'alpha'); $object->idprof4 = GETPOST('idprof4', 'alpha');
$object->idprof5 = GETPOST('idprof5', 'alpha'); $object->idprof5 = GETPOST('idprof5', 'alpha');
$object->idprof6 = GETPOST('idprof6', 'alpha'); $object->idprof6 = GETPOST('idprof6', 'alpha');
$object->typent_id = GETPOST('typent_id', 'int'); $object->typent_id = GETPOST('typent_id', 'int');
$object->effectif_id = GETPOST('effectif_id', 'int'); $object->effectif_id = GETPOST('effectif_id', 'int');
$object->barcode = GETPOST('barcode', 'alpha'); $object->barcode = GETPOST('barcode', 'alpha');

View File

@ -1777,14 +1777,61 @@ class User extends CommonObject
* *
* @param int $withpicto Include picto in link (0=No picto, 1=Inclut le picto dans le lien, 2=Picto seul) * @param int $withpicto Include picto in link (0=No picto, 1=Inclut le picto dans le lien, 2=Picto seul)
* @param string $option On what the link point to * @param string $option On what the link point to
* @param boolean $infologin Add connection info to the tooltip
* @return string String with URL * @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">'; $lien = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
@ -1793,7 +1840,7 @@ class User extends CommonObject
$result.=($lien.img_object($label, 'user', 'class="classfortooltip"').$lienfin); $result.=($lien.img_object($label, 'user', 'class="classfortooltip"').$lienfin);
if ($withpicto != 2) $result.=' '; if ($withpicto != 2) $result.=' ';
} }
$result.=$lien.$this->getFullName($langs,'','',24).$lienfin; $result.= $lien . $this->getFullName($langs,'','',24) . $companylink . $lienfin;
return $result; return $result;
} }

View File

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