From 46234024c8e2c3d5f3c0656e58a0d56f50c99a12 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 18 Apr 2012 12:42:41 +0200 Subject: [PATCH] Fix: Bug #369 --- htdocs/comm/propal/index.php | 38 +++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 65867a55128..c3f07553948 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2012 Regis Houssin * * 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 @@ -48,6 +48,7 @@ if ($user->societe_id > 0) */ $propalstatic=new Propal($db); +$companystatic=new Societe($db); $form = new Form($db); $formfile = new FormFile($db); $help_url="EN:Module_Commercial_Proposals|FR:Module_Propositions_commerciales|ES:Módulo Presupuestos"; @@ -155,7 +156,7 @@ else */ if ($conf->propal->enabled) { - $sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid"; + $sql = "SELECT c.rowid, c.ref, s.nom as socname, s.rowid as socid, s.canvas, s.client"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as c"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -182,9 +183,18 @@ if ($conf->propal->enabled) $var=!$var; $obj = $db->fetch_object($resql); print ""; - print ''; - print "".img_object($langs->trans("ShowPropal"),"propal").' '.$obj->ref.""; - print ''.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).''; + + $propalstatic->id=$obj->rowid; + $propalstatic->ref=$obj->ref; + print ''.$propalstatic->getNomUrl(1).''; + + $companystatic->id=$obj->socid; + $companystatic->name=$obj->socname; + $companystatic->client=$obj->client; + $companystatic->canvas=$obj->canvas; + print ''.$companystatic->getNomUrl(1,'customer',24).''; + + print ''; $i++; } } @@ -201,7 +211,7 @@ $max=5; * Last modified proposals */ -$sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom, s.rowid as socid,"; +$sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as socname, s.rowid as socid, s.canvas, s.client,"; $sql.= " date_cloture as datec"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as c"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; @@ -255,7 +265,12 @@ if ($resql) print ''; - print ''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.''; + $companystatic->id=$obj->socid; + $companystatic->name=$obj->socname; + $companystatic->client=$obj->client; + $companystatic->canvas=$obj->canvas; + print ''.$companystatic->getNomUrl(1,'customer').''; + print ''.dol_print_date($db->jdate($obj->datec),'day').''; print ''.$propalstatic->LibStatut($obj->fk_statut,5).''; print ''; @@ -274,7 +289,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) { $langs->load("propal"); - $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp"; + $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."propal as p"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -324,8 +339,13 @@ if ($conf->propal->enabled && $user->rights->propale->lire) print ''; print ""; + + $companystatic->id=$obj->socid; + $companystatic->name=$obj->socname; + $companystatic->client=$obj->client; + $companystatic->canvas=$obj->canvas; + print ''.$companystatic->getNomUrl(1,'customer',44).''."\n"; - print ''.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,44).''."\n"; print ''; print dol_print_date($db->jdate($obj->dp),'day').''."\n"; print ''.price($obj->total_ttc).'';