diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 4fb0a44b06b..fa825bcb84d 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -56,6 +56,52 @@ class FormOther $this->db = $db; } + /** + * Return HTML code for scanner tool + * + * @param string $jstoexecuteonadd Name of javascript function to call + * @return string HTML component + */ + public function getHTMLScannerForm($jstoexecuteonadd = 'barcodscannerjs') + { + global $langs; + + $out = ''; + + $out .= '
'; + $out .= ''."\n"; + $out .= '
'; + $out .= '
Barcode scanner tool...

'; + + $out .= ' Autodetect if we scan a product barcode or a lot/serial barcode
'; + $out .= ' Scan a product barcode
'; + $out .= ' Scan a product lot or serial number
'; + + $out .= $langs->trans("QtyToAddAfterBarcodeScan").'
'; + $out .= ''; + + /*print '
'.$langs->trans("or").'
'; + + print '
'; + + print '     Qty
'; + */ + $out .= '
'; + $out .= '
'; + $out .= ''; + $out .= ''; + $out .= '
'; + + $out .= ''.$langs->trans("FeatureNotYetAvailable").''; + + // TODO Add call of javascript $jstoexecuteonadd so each scan will add qty into the inventory page + an ajax save. + + $out .= '
'; + $out .= '
'; + $out .= '
'; + + return $out; + } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index b2cf491d901..6af61126fe6 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -524,35 +524,9 @@ if ($object->id > 0) { // Popup for mass barcode scanning if ($action == 'updatebyscaning') { - print '
'; - print ''."\n"; - print '
'; - print '
Barcode scanner tool...

'; - - print ' Autodetect if we scan a product barcode or a lot/serial barcode
'; - print ' Scan a product barcode
'; - print ' Scan a product lot or serial number
'; - - print $langs->trans("QtyToAddAfterBarcodeScan").'
'; - print ''; - - /*print '
'.$langs->trans("or").'
'; - - print '
'; - - print '     Qty
'; - */ - print '
'; - print '
'; - print '
'; - - print ''.$langs->trans("FeatureNotYetAvailable").''; - - // TODO Add javascript so each scan will add qty into the inventory page + an ajax save. - - print '
'; - print '
'; - print '
'; + include DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; + $formother = new FormOther($db); + print $formother->getHTMLScannerForm(); }