Canvas::display_canvas() (htdocs/core/class/canvas.class.php) includes these templates from inside a method and only imports $db,$conf,$langs,$user, $canvas,$form,$formfile via 'global'. $objcanvas and $socid are never brought into that scope, so they were undefined at runtime (the templates already reconstruct the thirdparty object from $GLOBALS['objcanvas']). - Derive $socid from the in-scope thirdparty object ($soc->id / $object->id), fixing the empty socid used for $filedir/$urlsource/showdocuments(). - Replace the bare $objcanvas->control->object with the already-derived $soc (company) / $object (individual). For the company template $socid was previously masked from PHPStan by a '@var int $socid' docblock; it is now actually defined. |
||
|---|---|---|
| .. | ||
| company | ||
| individual | ||
| actions_card_common.class.php | ||
| README | ||
This directory contains an example on how we can use the canvas feature to overwrite the thirdparty screen and sql code by new one. This directory is used only if thirdpartie's pages are called with option canvas=newcanvas@societe parameter. If yes, screens are replaced by template in htdocs/societe/canvas/newcanvas directory and actions are also replaced by actions in htdocs/societe/canvas/newcanvas directory. In standard usage of Dolibarr, this directory can be removed.