* * 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 für ältere Rechte-Prüfung 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 und JS einbinden $arrayofjs = array('/handybarcodescanner/js/scanner.js'); $arrayofcss = array('/handybarcodescanner/css/scanner.css'); llxHeader('', $langs->trans("HandyBarcodeScanner"), '', '', 0, 0, $arrayofjs, $arrayofcss, '', 'mod-handybarcodescanner page-scanner classforhorizontalscrolloftabs'); // Titel print load_fiche_titre($langs->trans("HandyBarcodeScanner"), '', 'handybarcodescanner@handybarcodescanner'); print '
'; // Mode Tabs - Dolibarr Style $head = array(); $h = 0; if ($enableOrder) { $head[$h][0] = dol_buildpath('/handybarcodescanner/handybarcodescannerindex.php', 1).'?mode=order'; $head[$h][1] = img_picto('', 'order', 'class="pictofixedwidth"').$langs->trans("Order"); $head[$h][2] = 'order'; $h++; } if ($enableShop) { $head[$h][0] = dol_buildpath('/handybarcodescanner/handybarcodescannerindex.php', 1).'?mode=shop'; $head[$h][1] = img_picto('', 'globe', 'class="pictofixedwidth"').$langs->trans("Shop"); $head[$h][2] = 'shop'; $h++; } if ($enableInventory) { $head[$h][0] = dol_buildpath('/handybarcodescanner/handybarcodescannerindex.php', 1).'?mode=inventory'; $head[$h][1] = img_picto('', 'stock', 'class="pictofixedwidth"').$langs->trans("Inventory"); $head[$h][2] = 'inventory'; $h++; } print dol_get_fiche_head($head, $mode, '', -1, ''); // Scanner Container print '
'; print '
'; // Video Container print '
'; print ''; print '
'; print '
'; // Scanner Controls print '
'; print ''; print ''; print '
'; print '
'; // scanner-box print '
'; // div-table-responsive // Manual Barcode Input (for testing without camera/HTTPS) print '
'; print '
'; print ''; print ''; print '
'; print '
'; // Last Scan Info print '
'; print ''.$langs->trans("LastScan").': '; print '-'; print '
'; // Result Area print ''; print dol_get_fiche_end(); print '
'; // scanner-wrapper // Hidden config for JavaScript ?> close();