Works on product canvas and templates

!! WARNING : not stable !!
This commit is contained in:
Regis Houssin
2010-05-02 20:06:09 +00:00
parent 2ff8f376f3
commit 5ad77d4f31
2 changed files with 6 additions and 3 deletions

View File

@@ -80,6 +80,9 @@ class ProductService extends Product
parent::assign_values($action);
// Duration
$this->tpl['duration_value'] = $this->duration_value;
if ($action == 'create')
{
// Title

View File

@@ -220,10 +220,10 @@ if ($_POST["action"] == 'update' && ($user->rights->produit->creer || $user->rig
}
else
{
if (!empty($_POST["canvas"]) && file_exists('canvas/'.$product->canvas.'/product.'.$product->canvas.'.class.php'))
if (!empty($_POST["canvas"]) && file_exists('canvas/'.$_POST["canvas"].'/product.'.$_POST["canvas"].'.class.php'))
{
$classname = 'Product'.ucfirst($product->canvas);
include_once('canvas/'.$product->canvas.'/product.'.$product->canvas.'.class.php');
$classname = 'Product'.ucfirst($_POST["canvas"]);
include_once('canvas/'.$_POST["canvas"].'/product.'.$_POST["canvas"].'.class.php');
$product = new $classname($db);
}