2
0
forked from Wavyzz/dolibarr

L'onglet 'Documents' des propales est fonctionnel + diverses modifications esthtiques

This commit is contained in:
marc_ocebo
2005-06-27 21:47:44 +00:00
parent cea58d9122
commit a16e2ef285
13 changed files with 1420 additions and 1126 deletions

View File

@@ -388,6 +388,51 @@ class Form
}
/**
* \brief Affiche la liste d<>roulante des projets d'une soci<63>t<EFBFBD> donn<6E>e
*
*/
function select_projects($socid='', $selected='', $htmlname='projectid')
{
$socid=intVal($socid);
if (empty($socid))
return;
// On recherche les societes
$sql = 'SELECT p.rowid, p.title FROM ';
$sql .= MAIN_DB_PREFIX .'projet as p';
$sql .= ' WHERE fk_soc='.$socid;
$sql .= ' ORDER BY p.title ASC';
$result=$this->db->query($sql);
if ($result)
{
print '<select class="flat" name="'.$htmlname.'">';
$num = $this->db->num_rows($result);
$i = 0;
if ($num)
{
while ($i < $num)
{
$obj = $this->db->fetch_object();
if (!empty($selected) && $selected == $obj->rowid)
{
print '<option value="'.$obj->rowid.'" selected>'.$obj->title.'</option>';
}
else
{
print '<option value="'.$obj->rowid.'">'.$obj->title.'</option>';
}
$i++;
}
}
print '</select>';
}
else
{
dolibarr_print_error($this->db);
}
}
/**
* \brief Retourne la liste des produits
* \param selected Produit pr<70>s<EFBFBD>lectionn<6E>