Ajout un parametre pour l'utilisation des canvas

This commit is contained in:
Rodolphe Quiedeville 2007-01-05 15:34:43 +00:00
parent c724b60321
commit f3cbca4b51

View File

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Auguria SARL <info@auguria.org>
*
* 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
@ -138,6 +139,14 @@ else if ($_POST["action"] == 'viewProdDescInForm')
Header("Location: produit.php");
exit;
}
else if ($_POST["action"] == 'ProductCanvasAbility')
{
dolibarr_set_const($db, "PRODUCT_CANVAS_ABILITY", $_POST["ProductCanvasAbility"]);
Header("Location: produit.php");
exit;
}
else if ($_POST["action"] == 'usesearchtoselectproduct')
{
dolibarr_set_const($db, "PRODUIT_USE_SEARCH_TO_SELECT", $_POST["activate_usesearchtoselectproduct"]);
@ -287,9 +296,22 @@ print " <td>".$langs->trans("ProductSpecial")."</td>\n";
print " <td align=\"right\" width=\"60\">".$langs->trans("Value")."</td>\n";
print " <td width=\"80\">&nbsp;</td></tr>\n";
print '<form method="post" action="produit.php">';
print '<input type="hidden" name="action" value="ProductCanvasAbility">';
print "<tr ".$bc[$var].">";
print '<td width="80%">'.$langs->trans("ProductCanvasAbility").'</td>';
print '<td width="60" align="right">';
print $html->selectyesno("ProductCanvasAbility",$conf->global->PRODUCT_CANVAS_ABILITY,1);
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td>";
print '</tr></form>';
require_once(DOL_DOCUMENT_ROOT . "/product.class.php");
$dir = DOL_DOCUMENT_ROOT . "/product/canvas/";
if ($conf->global->PRODUCT_CANVAS_ABILITY==="1")
{
if(is_dir($dir) )
{
$handle=opendir($dir);
@ -332,7 +354,7 @@ else
{
print "<tr><td><b>ERROR</b>: $dir is not a directory !</td></tr>\n";
}
}
print '</table>';
$db->close();