Skip to content
Snippets Groups Projects
Commit 2ea124d3 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Canvas usage is an option

parent 3956d590
No related branches found
No related tags found
No related merge requests found
...@@ -51,8 +51,17 @@ if ($user->societe_id) $socid=$user->societe_id; ...@@ -51,8 +51,17 @@ if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'societe', $socid); $result = restrictedArea($user, 'societe', $socid);
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
$socstatic = new Societe($db);
if (!empty($socid)) $socstatic->getCanvas($socid);
$canvas = (!empty($socstatic->canvas)?$socstatic->canvas:GETPOST("canvas"));
if (! GETPOST("canvas"))
// If canvas is defined, because on url, or because company was created with canvas feature on,
// we use the canvas feature.
// If canvas is not defined, we use standard feature.
if (empty($canvas))
{ {
// ----------------------------------------- // -----------------------------------------
// When used in standard mode // When used in standard mode
...@@ -61,7 +70,6 @@ if (! GETPOST("canvas")) ...@@ -61,7 +70,6 @@ if (! GETPOST("canvas"))
// Initialization Company Object // Initialization Company Object
$soc = new Societe($db); $soc = new Societe($db);
/* /*
* Actions * Actions
*/ */
...@@ -1579,16 +1587,9 @@ else ...@@ -1579,16 +1587,9 @@ else
// When used with CANVAS // When used with CANVAS
// ----------------------------------------- // -----------------------------------------
$_GET["canvas"] = 'default'; //$_GET["canvas"] = 'default';
//if ($_REQUEST["private"]==1) $_GET["canvas"] = 'individual'; To switch to other canvas, we must use another value for canvas //if ($_REQUEST["private"]==1) $_GET["canvas"] = 'individual'; To switch to other canvas, we must use another value for canvas
// Get object canvas
$socstatic = new Societe($db);
if (!empty($socid)) $socstatic->getCanvas($socid);
// Initialization Company Canvas
$canvas = (!empty($socstatic->canvas)?$socstatic->canvas:GETPOST("canvas"));
$soccanvas = new Canvas($db); $soccanvas = new Canvas($db);
$soccanvas->load_canvas('thirdparty@societe',$canvas); $soccanvas->load_canvas('thirdparty@societe',$canvas);
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment