* * 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. */ /** * \file handybarcodescanner/handybarcodescannerindex.php * \ingroup handybarcodescanner * \brief Mobile Barcode Scanner - Hauptseite (Dolibarr integriert) */ // Load Dolibarr environment $res = 0; if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; } $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; } if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; } if (!$res && file_exists("../main.inc.php")) { $res = @include "../main.inc.php"; } if (!$res && file_exists("../../main.inc.php")) { $res = @include "../../main.inc.php"; } if (!$res && file_exists("../../../main.inc.php")) { $res = @include "../../../main.inc.php"; } if (!$res) { die("Include of main fails"); } require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; // Load translation files $langs->loadLangs(array("handybarcodescanner@handybarcodescanner", "products", "orders", "stocks")); // Get parameters $action = GETPOST('action', 'aZ09'); $mode = GETPOST('mode', 'alpha') ?: 'order'; // Security check if (!$user->hasRight('handybarcodescanner', 'use')) { // Fallback fuer aeltere Rechte-Pruefung if (!$user->hasRight('fournisseur', 'commande', 'creer') && !$user->hasRight('supplier_order', 'creer')) { accessforbidden('You need permission to use the barcode scanner'); } } // Check mode-specific permissions $enableOrder = getDolGlobalInt('HANDYBARCODESCANNER_ENABLE_ORDER', 1); $enableShop = getDolGlobalInt('HANDYBARCODESCANNER_ENABLE_SHOP', 1); $enableInventory = getDolGlobalInt('HANDYBARCODESCANNER_ENABLE_INVENTORY', 1); /* * View */ $form = new Form($db); // CSS einbinden (JS wird manuell am Ende geladen) $arrayofcss = array('/handybarcodescanner/css/scanner.css'); llxHeader('', $langs->trans("HandyBarcodeScanner"), '', '', 0, 0, array(), $arrayofcss, '', 'mod-handybarcodescanner page-scanner classforhorizontalscrolloftabs'); print '
'; // Mode Tabs - eigene Buttons (kein Seitenreload, Kamera bleibt aktiv) print '
'; if ($enableOrder) { $activeClass = ($mode == 'order') ? ' active' : ''; print ''; } if ($enableShop) { $activeClass = ($mode == 'shop') ? ' active' : ''; print ''; } if ($enableInventory) { $activeClass = ($mode == 'inventory') ? ' active' : ''; print ''; } print '
'; // Inline Tab-Switch Logik (unabhaengig von scanner.js Ladereihenfolge) print ''; // Scanner Container print '
'; print '
'; // Video Container print '
'; print ''; print '
'; print '
'; // Scanner Controls print '
'; print ''; print ''; print '
'; print '
'; // scanner-box print '
'; // div-table-responsive // Last Scan Info print '
'; print ''.$langs->trans("LastScan").': '; print '-'; print '
'; // Result Area print ''; // PWA-Link fuer mobilen Zugriff (aktuelle Domain verwenden, nicht DOL_MAIN_URL_ROOT) $pwaUrl = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].dol_buildpath('/handybarcodescanner/pwa.php', 1); print ''; print '
'; // scanner-wrapper // Hidden config for JavaScript ?> close();