Canvas usage is an option
This commit is contained in:
parent
3956d5904f
commit
2ea124d32e
@ -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"))
|
|||||||
// Initialization Company Object
|
// Initialization Company Object
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -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);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user