--- /dev/null
+<?php
+//$script = $_SERVER['SCRIPT_NAME'].'/assistant/go';
+
+$id=$_GET['q'];
+$barcode_prefix_regexp = '/^'.preg_replace('/\//', '\/', BARCODE_PREFIX).'/';
+if(preg_match($barcode_prefix_regexp, $id)) $id=preg_replace($barcode_prefix_regexp, '', $id);
+if(preg_match('/\//', $id)) $this->post_redirect_get($id);
+ else $this->post_redirect_get('?q='.urlencode($id));
</menu>
<div style="float: right;">
- <form action="?" method="GET">
+ <form action="$script/assistant/go" method="GET" style="float: left;"><!-- TODO: Display only when go plugin available -->
+ <input type="text" name="q" placeholder="smart id..." />
+ <input type="submit" value="go" />
+ </form>
+ <form action="?" method="GET" style="float: left;">
<input type="text" name="q" placeholder="regexp..." value="$search" />
<input type="submit" value="filter" />
</form>
}
function post_redirect_get($location, $message='', $error=false) {
- $location = $this->html->internal_url($location).'?message='.urlencode($message);
+ $url_args = $message != '' ? '?message='.urlencode($message) : '';
+ $location = $this->html->internal_url($location).$url_args;
header('Location: '.$location);
if($error) trigger_error($message);
$location=htmlspecialchars($location);
define('DIR_HOME', './');
define('DIR_IMAGES', DIR_HOME.'/images');
-define('DIR_TEMPLATES', DIR_HOME.'/templates');
+define('DIR_BARCODES', DIR_HOME.'/barcodes');
+define('DIR_TEMPLATES', DIR_HOME.'/templates');
define('DIR_ASSISTANTS', DIR_HOME.'/assistants');
define('URL_HOME', dirname($_SERVER['SCRIPT_NAME']));
define('URL_IMAGES', URL_HOME.'/images');
+define('URL_BARCODES', URL_HOME.'/barcodes');
+
+define('BARCODE_TYPE', 'code128b');
+define('BARCODE_PREFIX', 'STORE/');
$fake_lms_users = array( //You can specify multiple users in this array
DB_USER => DB_PASS