* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * \file class/actions_handybarcodescanner.class.php * \ingroup handybarcodescanner * \brief Hook class for HandyBarcodeScanner module */ /** * Class ActionsHandyBarcodeScanner */ class ActionsHandyBarcodeScanner { /** * @var DoliDB Database handler. */ public $db; /** * @var string Error code (or message) */ 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; } /** * Execute action - Hook on product card view * * @param array $parameters Array of parameters * @param CommonObject $object The object to process * @param string $action Action code * @param HookManager $hookmanager Hook manager propagated to allow calling another hook * @return int 0=OK, <0 on error, >0 to replace standard code */ public function tabContentViewProduct($parameters, &$object, &$action, $hookmanager) { global $conf, $langs; // Only if module is enabled if (!isModEnabled('handybarcodescanner')) { return 0; } // Inject JavaScript and CSS for barcode zoom feature $this->resprints = $this->getBarcodeZoomAssets(); return 0; } /** * Get JavaScript and CSS for barcode zoom modal * * @return string HTML with script and style tags */ private function getBarcodeZoomAssets() { $html = ''; // CSS for the modal $html .= ' '; // JavaScript for barcode zoom functionality $html .= ' '; return $html; } }