Affiche les numeros de commande au lieu de l'id de bdd
This commit is contained in:
parent
3a87f3ffef
commit
f605fcf3e1
@ -41,6 +41,9 @@ if (!$user->rights->propale->lire)
|
|||||||
if ($conf->projet->enabled) {
|
if ($conf->projet->enabled) {
|
||||||
require_once "../project.class.php";
|
require_once "../project.class.php";
|
||||||
}
|
}
|
||||||
|
if($conf->commande->enabled) {
|
||||||
|
require_once "../commande/commande.class.php";
|
||||||
|
}
|
||||||
require("./propal_model_pdf.class.php");
|
require("./propal_model_pdf.class.php");
|
||||||
require("../propal.class.php");
|
require("../propal.class.php");
|
||||||
require("../actioncomm.class.php");
|
require("../actioncomm.class.php");
|
||||||
@ -57,8 +60,8 @@ if ($user->societe_id > 0)
|
|||||||
|
|
||||||
// Nombre de ligne pour choix de produit/service prédéfinis
|
// Nombre de ligne pour choix de produit/service prédéfinis
|
||||||
$NBLINES=4;
|
$NBLINES=4;
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* Actions */
|
/* Actions */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
@ -740,14 +743,14 @@ if ($_GET["propalid"])
|
|||||||
$nb_commande = sizeof($propal->commande_liste_array());
|
$nb_commande = sizeof($propal->commande_liste_array());
|
||||||
if ($nb_commande > 0)
|
if ($nb_commande > 0)
|
||||||
{
|
{
|
||||||
$coms = $propal->commande_liste_array();
|
$coms = $propal->associated_orders();
|
||||||
print '<br><table class="border" width="100%">';
|
print '<br><table class="border" width="100%">';
|
||||||
|
|
||||||
print "<tr><td>Commande(s) rattachée(s)</td></tr>\n";
|
print "<tr><td>Commande(s) rattachée(s)</td></tr>\n";
|
||||||
|
|
||||||
for ($i = 0 ; $i < $nb_commande ; $i++)
|
for ($i = 0 ; $i < $nb_commande ; $i++)
|
||||||
{
|
{
|
||||||
print '<tr><td><a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$coms[$i].'">'.$coms[$i]."</a></td>\n";
|
print '<tr><td><a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$coms[$i]->id.'">'.$coms[$i]->ref."</a></td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -740,6 +740,41 @@ class Propal
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Renvoie un tableau contenant les commandes associées
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
function associated_orders ()
|
||||||
|
{
|
||||||
|
$ga = array();
|
||||||
|
|
||||||
|
$sql = "SELECT fk_commande FROM ".MAIN_DB_PREFIX."co_pr";
|
||||||
|
$sql .= " WHERE fk_propale = " . $this->id;
|
||||||
|
if ($this->db->query($sql) )
|
||||||
|
{
|
||||||
|
$nump = $this->db->num_rows();
|
||||||
|
|
||||||
|
if ($nump)
|
||||||
|
{
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $nump)
|
||||||
|
{
|
||||||
|
$obj = $this->db->fetch_object();
|
||||||
|
$order=new Commande($this->db);
|
||||||
|
$order->fetch($obj->fk_commande);
|
||||||
|
$ga[$i] = $order;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $ga;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $this->db->error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user