Skip to content

Commit

Permalink
Fix: Little fix after canvas changes to be able to have "pure canvas"…
Browse files Browse the repository at this point in the history
… (canvas with no controller, only templates).
  • Loading branch information
eldy committed Sep 24, 2011
1 parent b306a41 commit af2e300
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
8 changes: 7 additions & 1 deletion htdocs/contact/fiche.php
Expand Up @@ -277,7 +277,11 @@
// -----------------------------------------
// 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
}
Expand Down Expand Up @@ -324,6 +328,8 @@
/*
* 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
Expand Down
11 changes: 8 additions & 3 deletions htdocs/societe/soc.php
Expand Up @@ -104,6 +104,7 @@
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");

if ($action == 'update') $object->fetch($socid);
else $object->canvas=$canvas;

if (GETPOST("private") == 1)
{
Expand Down Expand Up @@ -474,9 +475,13 @@
// -----------------------------------------
// 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
{
Expand Down

0 comments on commit af2e300

Please sign in to comment.