Fix: Little fix after canvas changes to be able to have "pure canvas" (canvas with no controller, only templates).

This commit is contained in:
Laurent Destailleur 2011-09-24 20:50:57 +00:00
parent b306a41811
commit af2e300100
2 changed files with 15 additions and 4 deletions

View File

@ -277,7 +277,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists())
// -----------------------------------------
// When used with CANVAS
// -----------------------------------------
if (! $objcanvas->hasActions() && $id)
{
$object = new Societe($db);
$object->fetch($id); // For use with "pure canvas" (canvas that contains templates only)
}
$objcanvas->assign_values($action, $id); // Set value for templates
$objcanvas->display_canvas(); // Show template
}
@ -324,6 +328,8 @@ else
/*
* Fiche en mode creation
*/
$object->canvas=$canvas;
$object->fk_departement = $_POST["departement_id"];
// We set pays_id, pays_code and label for the selected country

View File

@ -104,6 +104,7 @@ if (empty($reshook))
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
if ($action == 'update') $object->fetch($socid);
else $object->canvas=$canvas;
if (GETPOST("private") == 1)
{
@ -474,9 +475,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists())
// -----------------------------------------
// When used with CANVAS
// -----------------------------------------
$objcanvas->assign_values($action, $socid); // Set value for templates
$objcanvas->display_canvas(); // Show template
if (! $objcanvas->hasActions() && $socid)
{
$object = new Societe($db);
$object->fetch($socid); // For use with "pure canvas" (canvas that contains templates only)
}
$objcanvas->assign_values($action, $socid); // Set value for templates
$objcanvas->display_canvas(); // Show template
}
else
{