Works on canvas integration in third party module
This commit is contained in:
parent
f604e7eaac
commit
f6057890bd
@ -1587,20 +1587,13 @@ else
|
|||||||
// When used with CANVAS
|
// When used with CANVAS
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
|
|
||||||
//$_GET["canvas"] = 'default@thirdparty';
|
|
||||||
//$canvas = 'default@thirdparty';
|
|
||||||
//if ($_REQUEST["private"]==1) $_GET["canvas"] = 'individual'; To switch to other canvas, we must use another value for canvas
|
|
||||||
|
|
||||||
$soccanvas = new Canvas($db);
|
$soccanvas = new Canvas($db);
|
||||||
$soccanvas->getCanvas('card',$canvas);
|
$soccanvas->getCanvas('card',$canvas);
|
||||||
|
|
||||||
|
// Load data control
|
||||||
/*
|
|
||||||
* Actions
|
|
||||||
*/
|
|
||||||
|
|
||||||
$soccanvas->loadControl($socid);
|
$soccanvas->loadControl($socid);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -1612,23 +1605,24 @@ else
|
|||||||
$formadmin = new FormAdmin($db);
|
$formadmin = new FormAdmin($db);
|
||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
|
|
||||||
if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] ||
|
if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] || GETPOST("action") == 'create')
|
||||||
$_GET["action"] == 'create' || $_POST["action"] == 'create')
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Sheet mode creation
|
* Sheet mode creation
|
||||||
*/
|
*/
|
||||||
if ($user->rights->societe->creer)
|
if ($user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
// Set action type
|
// Set action type
|
||||||
$soccanvas->setAction(GETPOST("action"));
|
$soccanvas->setAction(GETPOST("action"));
|
||||||
|
|
||||||
|
// Card header
|
||||||
$title = $soccanvas->getTitle();
|
$title = $soccanvas->getTitle();
|
||||||
print_fiche_titre($title);
|
print_fiche_titre($title);
|
||||||
|
|
||||||
$soccanvas->assign_post();
|
// Assign _POST data
|
||||||
|
$soccanvas->assign_post();
|
||||||
|
|
||||||
// Assign values
|
// Assign template values
|
||||||
$soccanvas->assign_values();
|
$soccanvas->assign_values();
|
||||||
|
|
||||||
dol_htmloutput_errors($soccanvas->error,$soccanvas->errors);
|
dol_htmloutput_errors($soccanvas->error,$soccanvas->errors);
|
||||||
@ -1638,15 +1632,16 @@ else
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
|
elseif (GETPOST("action") == 'edit')
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Company Fact Mode edition
|
* Company Fact Mode edition
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Set action type
|
// Set action type
|
||||||
$soccanvas->setAction(GETPOST("action"));
|
$soccanvas->setAction(GETPOST("action"));
|
||||||
|
|
||||||
|
// Card header
|
||||||
$title = $soccanvas->getTitle();
|
$title = $soccanvas->getTitle();
|
||||||
print_fiche_titre($title);
|
print_fiche_titre($title);
|
||||||
|
|
||||||
@ -1654,11 +1649,12 @@ else
|
|||||||
{
|
{
|
||||||
if ($reload || ! $_POST["nom"])
|
if ($reload || ! $_POST["nom"])
|
||||||
{
|
{
|
||||||
$soc->id = $socid;
|
//Reload object
|
||||||
$soccanvas->fetch($socid);
|
$soccanvas->fetch($socid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Assign _POST data
|
||||||
$soccanvas->assign_post();
|
$soccanvas->assign_post();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1676,20 +1672,21 @@ else
|
|||||||
/*
|
/*
|
||||||
* Company Fact Sheet mode visu
|
* Company Fact Sheet mode visu
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Set action type
|
// Set action type
|
||||||
$soccanvas->setAction('view');
|
$soccanvas->setAction('view');
|
||||||
|
|
||||||
$result=$soccanvas->fetch($socid);
|
// Fetch object
|
||||||
|
$result=$soccanvas->fetch($socid);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db,$soccanvas->control->object->error);
|
dol_print_error($db,$soccanvas->control->object->error);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Card header
|
||||||
$head = societe_prepare_head($soccanvas->control->object);
|
$head = societe_prepare_head($soccanvas->control->object);
|
||||||
$title = $soccanvas->getTitle();
|
$title = $soccanvas->getTitle();
|
||||||
|
|
||||||
dol_fiche_head($head, 'company', $title, 0, 'company');
|
dol_fiche_head($head, 'company', $title, 0, 'company');
|
||||||
|
|
||||||
// Assign values
|
// Assign values
|
||||||
@ -1762,4 +1759,4 @@ $db->close();
|
|||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date$ - $Revision$');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Loading…
Reference in New Issue
Block a user