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 <?php
/* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * 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 * 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 * 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"); Header("Location: produit.php");
exit; 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') else if ($_POST["action"] == 'usesearchtoselectproduct')
{ {
dolibarr_set_const($db, "PRODUIT_USE_SEARCH_TO_SELECT", $_POST["activate_usesearchtoselectproduct"]); dolibarr_set_const($db, "PRODUIT_USE_SEARCH_TO_SELECT", $_POST["activate_usesearchtoselectproduct"]);
@ -287,11 +296,24 @@ print " <td>".$langs->trans("ProductSpecial")."</td>\n";
print " <td align=\"right\" width=\"60\">".$langs->trans("Value")."</td>\n"; print " <td align=\"right\" width=\"60\">".$langs->trans("Value")."</td>\n";
print " <td width=\"80\">&nbsp;</td></tr>\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"); require_once(DOL_DOCUMENT_ROOT . "/product.class.php");
$dir = DOL_DOCUMENT_ROOT . "/product/canvas/"; $dir = DOL_DOCUMENT_ROOT . "/product/canvas/";
if(is_dir($dir)) if ($conf->global->PRODUCT_CANVAS_ABILITY==="1")
{ {
if(is_dir($dir) )
{
$handle=opendir($dir); $handle=opendir($dir);
$var=true; $var=true;
@ -327,12 +349,12 @@ if(is_dir($dir))
} }
} }
closedir($handle); closedir($handle);
} }
else else
{ {
print "<tr><td><b>ERROR</b>: $dir is not a directory !</td></tr>\n"; print "<tr><td><b>ERROR</b>: $dir is not a directory !</td></tr>\n";
}
} }
print '</table>'; print '</table>';
$db->close(); $db->close();