. */ /** * \file takepos/class/actions_takepos.class.php * \ingroup takepos * \brief Hooks of takepos module */ /** * Class ActionsTakePos */ class ActionsTakePos { /** * @var DoliDB Database handler. */ public $db; /** * @var string Error */ public $error = ''; /** * @var array Errors */ public $errors = array(); /** * @var array Hook results. Propagated to $hookmanager->resArray for later reuse */ public $results = array(); /** * @var string String displayed by executeHook() immediately after return */ public $resprints; /** * Constructor * * @param DoliDB $db Database handler */ public function __construct($db) { $this->db = $db; } /** * Overloading the doActions function : replacing the parent's function with the one below * * @param array() $parameters Hook metadatas (context, etc...) * @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...) * @param string $action Current action (if set). Generally create or edit or null * @param HookManager $hookmanager Hook manager propagated to allow calling another hook * @return int < 0 on error, 0 on success, 1 to replace standard code */ public function addMoreActionsButtons($parameters, &$object, &$action, $hookmanager) { global $conf, $user, $langs; /* print_r($parameters); print_r($object); echo "action: " . $action; */ if (in_array($parameters['currentcontext'], array('invoicecard'))) // do something only for the context 'somecontext1' or 'somecontext2' { $receipt_url=DOL_URL_ROOT."/takepos/receipt.php"; $this->resprints = '
'; } return 0; // or return 1 to replace standard code } }