Gestion de la liste de formats de livre

This commit is contained in:
Rodolphe Quiedeville 2007-04-16 15:45:48 +00:00
parent 74b9edbd09
commit 9e3dd487c0
3 changed files with 33 additions and 4 deletions

View File

@ -52,8 +52,11 @@
</td>
<td>Format</td>
<td>
<input name="format" size="8" maxlength="7" value="{$prod_format}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">
<select class="flat" name="format">
{html_options values=$livre_available_formats output=$livre_available_formats selected="$prod_format"}
</select>
</td>
</tr>
<tr>

View File

@ -58,8 +58,9 @@
</td>
<td>Format</td>
<td>
<input name="format" size="8" maxlength="7" value="{$prod_format}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">
<select class="flat" name="format">
{html_options values=$livre_available_formats output=$livre_available_formats selected="$prod_format"}
</select>
</td>
</tr>
<tr>

View File

@ -431,6 +431,10 @@ class ProductLivre extends Product
$smarty->assign('prod_statuts_id', array(1,0) );
$smarty->assign('prod_statuts_value', array('En vente', 'Hors vente') );
$this->GetAvailableFormat();
$smarty->assign('livre_available_formats', $this->available_formats);
if ($this->status==1)
{
$smarty->assign('prod_statut', 'En vente');
@ -527,5 +531,26 @@ class ProductLivre extends Product
print $sql;
}
}
function GetAvailableFormat()
{
$this->available_formats = array();
$sql = "SELECT rowid,value FROM ".MAIN_DB_PREFIX."const ";
$sql.=" WHERE name LIKE 'EDITEUR_LIVRE_FORMAT_%';";
$resql = $this->db->query($sql);
while ($obj = $this->db->fetch_object($resql) )
{
$this->available_formats[$obj->rowid] = stripslashes($obj->value);
}
$this->db->free($resql);
return 0;
}
}
?>