OrderSprinter 1.4.6

This commit is contained in:
Geno 2020-11-19 23:10:21 +01:00
parent 00e310abcf
commit 6ac093bae8
34 changed files with 384 additions and 139 deletions

View File

@ -9,8 +9,8 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" href="css/gueststyle.css?v=1.4.5" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css?v=1.4.5" />
<link rel="stylesheet" href="css/gueststyle.css?v=1.4.6" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css?v=1.4.6" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
<link rel="stylesheet" href="php/3rdparty/jquery.mobile-1.4.0.min.css" type="text/css" />
<script src="php/3rdparty/jquery-1.11.3.min.js"></script>
@ -46,11 +46,18 @@
</div>
<div data-role="collapsible" data-content-theme="c" data-collapsed="false" data-theme="e" id="tablecodediv" style="display:none;" class="notcollapsible">
<H2>Tisch-Code</H2>
<H2>Code-Eingabe</H2>
<div id="tablecodearea" style="display:none;">
<p>Bitte geben Sie hier den Tisch-Code ein:
<p><input class="whiteinput" type="text" id="tablecodefield" /><br>
</div> <!-- tablecodearea -->
<div id="daycodearea" style="display:none;">
<p>Bitte geben Sie hier die Tageslosung ein:
<p><input class="whiteinput" type="text" id="dailycodefield" /><br>
</div> <!-- daycodearea -->
<div class="ui-grid-a">
<div class="ui-block-a"><button type="submit" data-theme="d" data-icon="back" id="codebackbtn">Zurück</button></div>
<div class="ui-block-b"><button type="submit" data-theme="f" data-icon="check" id="submitcodesbtn">Weiter</button></div>
@ -98,7 +105,7 @@
<div data-role="footer" data-theme="b" id="thefooter1">
<div class="ui-grid-a">
<div class="ui-block-a">&nbsp;&nbsp;OrderSprinter</div>
<div class="ui-block-b grid_right" id="versioninfo">1.4.5&nbsp;&nbsp;</div>
<div class="ui-block-b grid_right" id="versioninfo">1.4.6&nbsp;&nbsp;</div>
</div><!-- /grid-a -->
</div>
</div>

View File

@ -90,10 +90,10 @@ if (isset($_POST['code'])) {
} else {
echo "<html>";
echo "<head><title>Installation Gastsystem</title>";
echo '<link rel="stylesheet" type="text/css" href="css/gueststyle.css?v=1.4.5">';
echo '<link rel="stylesheet" type="text/css" href="css/gueststyle.css?v=1.4.6">';
echo "</head>";
echo "<body><div class=surround>";
echo "<span class=headerline>Installation OrderSprinter-Gastsystem 1.4.5</span><br><br>";
echo "<span class=headerline>Installation OrderSprinter-Gastsystem 1.4.6</span><br><br>";
echo "<form action='install.php' method='post'><input class=installfield name=code id=code type=text placeholder='Installationscode' />";
echo "<br><input type=submit value='Installation starten' class=installbtn />";
echo "</form></div></html>";

File diff suppressed because one or more lines are too long

View File

@ -12,6 +12,3 @@ defined('TAB_PREFIX') || define ('TAB_PREFIX', 'os_');
// Code für die Installation, und als Gastsystemscode in der Kernapplikation einzutragen
defined('CODE') || define ('CODE', '123456xxx');
// Timeout in Sekunden: danach müssen Gaeste wieder den Tischcode und die Tageslosung eingeben
defined('TIMEOUT') || define ('TIMEOUT', '300');

View File

@ -55,4 +55,14 @@ class DbUtils {
}
}
public static function getConfigItem($pdo,$item,$default) {
$sql = "SELECT value FROM %ossystem% WHERE item=?";
$result = self::fetchSqlAll($pdo, $sql, array($item));
if (count($result) == 0) {
return $default;
} else {
return $result[0]["value"];
}
}
}

View File

@ -25,24 +25,28 @@ class Tables {
$tablesArr[] = array("id" => $t["id"],"name" => $t["name"]);
}
$currency = "";
$decpoint = ".";
$currency = DbUtils::getConfigItem($pdo, 'currency', "");
$decpoint = DbUtils::getConfigItem($pdo, 'decpoint', ".");
$askdaycode = DbUtils::getConfigItem($pdo, 'askdaycode', 1);
$asktablecode = DbUtils::getConfigItem($pdo, 'asktablecode', 1);
$guesttimeout = DbUtils::getConfigItem($pdo, 'guesttimeout', 5) * 60;
$result = DbUtils::fetchSqlAll($pdo, $sql, array('currency'));
if (count($result) > 0) {
$currency = $result[0]["value"];
}
$result = DbUtils::fetchSqlAll($pdo, $sql, array('decpoint'));
if (count($result) > 0) {
$decpoint = $result[0]["value"];
}
return array("status" => "OK","msg" => $tablesArr,"currency" => $currency,"decpoint" => $decpoint, "timeout" => TIMEOUT);
return array("status" => "OK",
"msg" => $tablesArr,
"currency" => $currency,
"decpoint" => $decpoint,
"askdaycode" => $askdaycode,
"asktablecode" => $asktablecode,
"timeout" => $guesttimeout);
}
public static function checkcodes($pdo,$tableid,$tablecode,$dailycode) {
$tablecode = trim($tablecode);
$dailycode = trim($dailycode);
$askdaycode = DbUtils::getConfigItem($pdo, 'askdaycode', 1);
$asktablecode = DbUtils::getConfigItem($pdo, 'asktablecode', 1);
$sql = "SELECT value FROM %ossystem% WHERE item=?";
$result = DbUtils::fetchSqlAll($pdo, $sql, array('resttables'));
@ -50,6 +54,7 @@ class Tables {
return array("status" => "ERROR","msg" => "Keine Tischdefinition hinterlegt.");
}
if ($asktablecode == 1) {
$resttables = $result[0];
$tables = json_decode($resttables["value"], true);
@ -62,7 +67,9 @@ class Tables {
}
}
}
}
if ($askdaycode == 1) {
$sql = "SELECT value FROM %ossystem% WHERE item=?";
$result = DbUtils::fetchSqlAll($pdo, $sql, array('dailycode'));
@ -77,6 +84,8 @@ class Tables {
return array("status" => "ERROR","msg" => "Falsche Tageslosung angegeben!");
}
}
return array("status" => "OK");
}
}
if (isset($_GET["command"])) {

View File

@ -3,12 +3,10 @@
require_once 'php/dbutils.php';
require_once 'php/config.php';
// REM* wget "http://localhost/bestellung/php/contenthandler.php?module=guestsync&command=sync"
class Sync {
public static function insertSystemData($pdo,$systemdata) {
try {
// REM* check for guestcode
if (!isset($systemdata["guestcode"])) {
return array("status" => "ERROR","msg" => "No Access code transmitted!");
}
@ -26,6 +24,10 @@ class Sync {
self::insertIntoSystemTable($pdo, $systemdata, 'currency');
self::insertIntoSystemTable($pdo, $systemdata, 'decpoint');
self::insertIntoSystemTableWithCheck($pdo, $systemdata, 'askdaycode');
self::insertIntoSystemTableWithCheck($pdo, $systemdata, 'asktablecode');
self::insertIntoSystemTableWithCheck($pdo, $systemdata, 'guesttimeout');
if (isset($systemdata["timezone"])) {
self::updateOsAccessStatus($pdo, $systemdata["timezone"]);
}
@ -44,11 +46,22 @@ class Sync {
}
}
// REM* update that an access from OrderSprinter core webapp has taken place
private static function insertIntoSystemTableWithCheck($pdo,$data,$item) {
if (isset($data[$item])) {
$sql = "SELECT id FROM %ossystem% WHERE item=?";
$result = DbUtils::fetchSqlAll($pdo, $sql, array($item));
if (count($result) == 0) {
$sql = "INSERT INTO %ossystem% (item,value) VALUES(?,?)";
DbUtils::execSql($pdo, $sql, array($item,$data[$item]));
} else {
self::insertIntoSystemTable($pdo, $data, $item);
}
}
}
private static function updateOsAccessStatus($pdo,$timezone) {
date_default_timezone_set($timezone);
$date = new DateTime();
// REM* seconds since Jan 01 1970. (UTC)
$currentTimeStamp = $date->getTimestamp();
$sql = "SELECT id FROM %gueststatus% WHERE item=?";

View File

@ -85,7 +85,7 @@ class Installer {
}
Database::dropTables($pdo);
Database::createEmptyTables($pdo, $prefix);
Database::setVersion($pdo,$prefix,"1.4.5");
Database::setVersion($pdo,$prefix,"1.4.6");
Database::setAccessPassword($pdo,$prefix,$adminpass);
Database::setRefreshRate($pdo,$prefix,"5"); // default: 5 times per hour
return array("status" => "OK","msg" => "Installation successful");

Binary file not shown.

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.5">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.6">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.5">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.6">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.5">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.6">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -58,7 +58,7 @@ var FEED_SENT_TXT = ["Wenn eine Kopie der Nachricht an die angegebene Emailadres
var FEED_ERROR_TXT = ["Fehler beim Nachrichtenversand: ","Error during mail transmisión: ","Error durante envío del mail: "];
var FEED_INFO_TXT = ["Diese Seite dient zur Übermittlung von Feedback an den Entwickler. Die Email wird das Mailkonto des Betreibers versendet.",
var FEED_INFO_TXT = ["Diese Seite dient zur Übermittlung von Feedback an den Entwickler. Die Email wird über das Mailkonto des Betreibers versendet.",
"This page serves for sending a feedmail email to the developer of this software. The email will be send by use of the mail account of the administrator.",
"Esta página sirve para enviar un email al programador de este software. El email va a ser enviado por la cuenta del administrador."];

View File

@ -9,8 +9,8 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.5">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.4.5">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.6">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.4.6">
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -215,7 +215,7 @@ function handleResultOfInstallCheck(is_installed) {
if (is_installed == "Yes") {
useInstallation();
} else {
setTimeout(function(){document.location.href = "install.html?v=1.4.5"},500);
setTimeout(function(){document.location.href = "install.html?v=1.4.6"},500);
}
}

View File

@ -727,7 +727,7 @@ $(document).ready(function() {
<tr id=updateline>
<td>&nbsp;</td>
<td align=center>
<button id="updatebtn">Update -> 1.4.5</button>
<button id="updatebtn">Update -> 1.4.6</button>
<span id="updateinprogresstxt" style="display:none;">Update... bitte warten.</span>
</td>
<td>&nbsp;</td>

View File

@ -2893,6 +2893,44 @@ return false;
}
}
function updateUserTable1405_1406($prefix, $version, $dbname) {
$pdo = $this->pdo;
try {
if ($version != "1.4.5") {
$ret = $this->updateUserTable1404_1405($prefix, $version, $dbname);
if (!$ret) {
echo "Version update v1.4.4 to 1.4.5 not successful.";
return false;
}
}
DbUtils::overrulePrefix($prefix);
$this->execSqlWithParam($pdo, "INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL,?,?)", array('askdaycode','1'));
$this->execSqlWithParam($pdo, "INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL,?,?)", array('asktablecode','1'));
$this->execSqlWithParam($pdo, "INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL,?,?)", array('guesttimeout','5'));
$this->execSqlWithParam($pdo, "INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL,?,?)", array('showdaycode','0'));
$sql = "ALTER TABLE %products% ADD INDEX pcatindex (category)";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute();
$sql = "OPTIMIZE TABLE %products%";
$stmt = $pdo->prepare($this->basedb->resolveTablenamesInSqlString($sql));
$stmt->execute();
$sql = "OPTIMIZE TABLE %queue%";
$stmt = $pdo->prepare($this->basedb->resolveTablenamesInSqlString($sql));
$stmt->execute();
$this->updateVersion($pdo, '1.4.6');
return true;
} catch (PDOException $e) {
echo "Error in v1.4.5 to 1.4.6: $e";
return false;
}
}
function insertIntRow($pdo,$table,$rowToInsert,$afterRow) {
$this->insertTypeRow($pdo, $table, $rowToInsert, $afterRow, 'INT(1) NULL');
}
@ -3068,7 +3106,7 @@ $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VAL
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'billlanguage', $billlanguage)");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'currency', '$currency')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'receiptfontsize', '12')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.4.5')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.4.6')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'paymentconfig', '0')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'remoteaccesscode', null)");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'decpoint', '$decpoint')");
@ -3078,6 +3116,10 @@ $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VAL
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'bigfontworkreceipt', '0')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'prominentsearch', '0')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'guestjobprint', '1')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'askdaycode', '1')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'showdaycode', '0')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'asktablecode', '1')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'guesttimeout', '5')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'groupworkitemsf', '1')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'groupworkitemsd', '1')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'addreceipttoprinter', null)");
@ -3516,7 +3558,7 @@ $zones[] = $timezone_identifiers[$i];
echo json_encode($zones);
} else if ($command == 'update') {
set_time_limit(60*30);
$installerVersion = "1.4.5";
$installerVersion = "1.4.6";
$admin = new InstallAdmin();
$pdo = $admin->openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password']);
@ -3548,7 +3590,7 @@ $supportedVersions = array("1.0.22","1.0.23","1.0.24","1.0.25","1.0.26","1.0.27"
"1.2.0","1.2.1","1.2.2", "1.2.3", "1.2.4","1.2.5","1.2.6","1.2.7","1.2.8","1.2.9","1.2.10","1.2.11","1.2.12","1.2.13","1.2.14","1.2.15","1.2.16","1.2.17",
"1.2.18","1.2.19","1.2.20","1.2.21","1.2.22","1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7","1.3.8","1.3.9","1.3.10","1.3.11","1.3.12",
"1.3.13","1.3.14","1.3.15","1.3.16","1.3.17","1.3.18","1.3.19","1.3.20","1.3.21","1.3.22","1.3.23","1.3.24","1.3.25","1.3.26","1.4.0","1.4.1","1.4.2","1.4.3",
"1.4.4"
"1.4.4","1.4.5"
);
if (!in_array($version, $supportedVersions)) {
@ -3556,7 +3598,7 @@ echo json_encode("Quellversion nicht unterstützt");
return;
}
$ret = $admin->updateUserTable1404_1405($_POST['prefix'], $version, $_POST['db']);
$ret = $admin->updateUserTable1405_1406($_POST['prefix'], $version, $_POST['db']);
if(session_id() == '') {
session_start();

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.5">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.6">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.5">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.6">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -357,6 +357,11 @@ var MAN_SHOWPAYMENT8 = ["Gast","Guest","Huésped"];
var MAN_DBLOG = ["Debug-Logging","Debug logging","Debug logging"];
var MAN_PRICE_IN_LIST = ["Preisangabe neben Produkt","List price next to product","Mostrar precio en lista de productos"];
var MAN_GUEST_JOB_PRINT = ["Gastbestelljob drucken","Print guest order","Imprimir orden de remote"];
var MAN_ASK_DAYCODE = ["Abfrage Tageslosung","Require input of day code in guest system","Pregunta código del dia en sistema de huéspedes"];
var MAN_SHOW_DAYCODE = ["Tageslosung in Bestellansicht anzeigen","Show day code in order view","Mostrat códiga del dia en vista de ordenes"];
var MAN_ASK_TABLECODE = ["Abfrage Tischcode","Require input of table code","Pregunta código de la mesa en sistem de huéspedes"];
var MAN_GUEST_TIMEOUT = ["Timeout (Min)","Timeout (min)","Timeout (min)"];
var MAN_GUESTTIMEOUT_HINT = ["Ein Timeout von 0 bedeutet, dass gar ein Timeout abläuft.","A timeout value of 0 means that there is no timeout at all.","Un valor de timeout de 0 significa que no hay ningún timeout."];
var MAN_RESTAURANT_MODE = ["Restaurantmodus","Restaurant mode","Usar para restaurantes"];
var MAN_REST_MODE_HINT = ["Hinweis: Wird der Restaurantmodus auf <i>Nein</i> gesetzt, wird in der <b>Desktopansicht</b> die Tischauswahl deaktiviert. Alle Produkte werden als Außer-Haus-Verkauf gebucht.","Hint: If the restautant mode is set to <i>no</i> in the <b>desktop view</b> the table selection is deactivated and all products are ordered as <i>to-go</i>","Nota: Si el modus del restaurante es configurado a <i>no</i> en la vista de <b>Desktop</b> la selección de las mesas es deactivada y todos los productos son ordenados como <i>to-go</i>"];
var MAN_SPECIAL_SETTINGS_TXT = ["Einstellungen für spezielle Abläufe:","Settings for special workflows:","Configuración para workflows muy escpeciales:"];
@ -392,7 +397,7 @@ var MAN_TMPDIRHINT = ["Wird das PHP-Tmp-Verzeichnis angegeben, so können z.B. k
"Si el tmp esta espcificado es posible crear backups comprimidos por ejemplo. Normalmente el valor default es corecto pero de vez en cuando los providers cambian el valor sin adaptar el PHP framework!"];
var lang = 0;
var generalVals = [12,2,0,3,0,1,1,0,0,1, 0,50,20,10,1,0,0,0,1,0,1,0,0,1,1, 1,1,1,1,1,1,1,1,1,1, 1,2,3, 1,0, 1,0,1];
var generalVals = [12,2,0,3,0,1,1,0,0,1, 0,50,20,10,1,0,0,0,1,0,1,0,0,1,1, 1,1,1,1,1,1,1,1,1,1, 1,2,3, 1,0, 1,0,1, 1,1,0];
var numberOfClosings = 0;
@ -503,6 +508,10 @@ var generalValuesSettings = [
["dblog",MAN_DBLOG[lang],"s",40],
["priceinlist",MAN_PRICE_IN_LIST[lang],"s",41],
["guestjobprint",MAN_GUEST_JOB_PRINT[lang],"s",42],
["askdaycode",MAN_ASK_DAYCODE[lang],"s",43],
["asktablecode",MAN_ASK_TABLECODE[lang],"s",44],
["guesttimeout",MAN_GUEST_TIMEOUT[lang],"i",0,""],
["showdaycode",MAN_SHOW_DAYCODE[lang],"s",45]
];
var predef = "";
@ -551,6 +560,7 @@ function setLanguage(l) {
$("#smtpusertxt").html(MAN_SMTPUSER[l]);
$("#smtppasstxt").html(MAN_SMTPPASS[l]);
$("#smtpporttxt").html(MAN_SMTPPORT[l]);
$("#guesttimeouttxt").html(MAN_GUEST_TIMEOUT[l]);
$("#startprodsearchtxt").html(MAN_STARTPRODSEARCH[l]);
@ -660,6 +670,8 @@ function setLanguage(l) {
$("#applyPrinterInstances").html(MAN_APPLY[l]);
$("#printerInstanceHint").html(MAN_PRINSTANCE_HINT[l]);
$("#guesttimeouthint").html(MAN_GUESTTIMEOUT_HINT[l]);
}
function createMonthSelection(label) {
@ -782,6 +794,9 @@ function insertGeneralConfigItems(configResult) {
$("#partOfDblog").html(createYesNo("dblog",MAN_DBLOG, values.dblog));
$("#partOfPriceinlist").html(createYesNo("priceinlist",MAN_PRICE_IN_LIST, values.priceinlist));
$("#partOfGuestjobprint").html(createYesNo("guestjobprint",MAN_GUEST_JOB_PRINT, values.guestjobprint));
$("#partOfAskdaycode").html(createYesNo("askdaycode",MAN_ASK_DAYCODE, values.askdaycode));
$("#partOfAsktablecode").html(createYesNo("asktablecode",MAN_ASK_TABLECODE, values.asktablecode));
$("#partOfShowdaycode").html(createYesNo("showdaycode",MAN_SHOW_DAYCODE, values.showdaycode));
$("#partOfclosshowci").html(createYesNo("closshowci",MAN_CLOSSHOWCI,values.closshowci));
$("#partOfclosshowpaytaxes").html(createYesNo("closshowpaytaxes",MAN_CLOSSHOWPAYTAXES,values.closshowpaytaxes));
@ -868,6 +883,9 @@ function insertGeneralConfigItems(configResult) {
generalVals[40] = values.dblog;
generalVals[41] = values.priceinlist;
generalVals[42] = values.guestjobprint;
generalVals[43] = values.askdaycode;
generalVals[44] = values.asktablecode;
generalVals[45] = values.showdaycode;
defaulttmp = values.defaulttmp;
@ -877,6 +895,7 @@ function insertGeneralConfigItems(configResult) {
$("#smtppass").val(values.smtppass);
$("#partOfSmtpsecure").html(createSMTPSecure(values.smtpsecure));
$("#smtpport").val(values.smtpport);
$("#guesttimeout").val(values.guesttimeout);
$("#startprodsearch").val(values.startprodsearch);
$("#discountname1").val(values.discountname1);
@ -1227,7 +1246,7 @@ function initRestoreFileUpload() {
} else {
alert("Import war erfolgreich.");
setTimeout(function(){
document.location.href = "index.html?v=1.4.5";
document.location.href = "index.html?v=1.4.6";
},250);
}
},
@ -1764,9 +1783,9 @@ function handleUpdateCheckResult(answer) {
var millis=getMillis();
setTimeout(function(){
document.location.href = "install.html?v=1.4.5&mode=onlyupdate&n=" + millis;
document.location.href = "install.html?v=1.4.6&mode=onlyupdate&n=" + millis;
},250);
document.location.href = "install.html?v=1.4.5&mode=onlyupdate&n=" + millis;
document.location.href = "install.html?v=1.4.6&mode=onlyupdate&n=" + millis;
}
function handleUpdateReplace(answer) {
@ -3539,6 +3558,14 @@ $(document).on("pageinit", "#admin-page", function () {
</div>
<div id="partOfGuestjobprint"></div>
<div id="partOfAskdaycode"></div>
<div id="partOfAsktablecode"></div>
<div id="partOfShowdaycode"></div>
<div data-role="fieldcontain">
<label for="guesttimeout"><span id="guesttimeoutxt">Timeout</span>:</label>
<input type="text" value="" data-mini="true" placeholder="5" id="guesttimeout" data-theme="c" class="genConfigEl"/><br>
<i id=guesttimeouthint style="padding-left: 50px;padding-right: 50px;">Hinweis: 0 = kein Timeout</i>
</div>
<br><b><u><span id="specialsettingssectiontxt">Spezialeinstellungen</span></u></b><br><br>

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.5">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.6">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -99,7 +99,8 @@ class Admin {
"getprinterinstances" => array("loggedin" => 1, "isadmin" => 0, "rights" => array("manager_or_admin")),
"setprinterinstances" => array("loggedin" => 1, "isadmin" => 0, "rights" => array("manager_or_admin")),
"getdashreports" => array("loggedin" => 1, "isadmin" => 0, "rights" => array("dash"))
"getdashreports" => array("loggedin" => 1, "isadmin" => 0, "rights" => array("dash")),
"getDailycode" => array("loggedin" => 1, "isadmin" => 0, "rights" => null)
);
@ -360,6 +361,8 @@ class Admin {
$this->setprinterinstances($_POST["k1"],$_POST["k2"],$_POST["k3"],$_POST["k4"],$_POST["k5"],$_POST["k6"],$_POST["f1"],$_POST["f2"],$_POST["d1"],$_POST["d2"]);
} else if ($command == 'getdashreports') {
$this->getdashreports();
} else if ($command == 'getDailycode') {
$this->getDailycode();
}
else {
echo "Command not supported.";
@ -944,7 +947,7 @@ class Admin {
return;
}
$configItems = join(",",array("'decpoint'","'version'","'cancelunpaidcode'","'tax'","'togotax'","'taxaustrianormal'","'taxaustriaerm1'","'taxaustriaerm2'","'taxaustriaspecial'","'currency'","'workflowconfig'","'prominentsearch'","'discount1'","'discount2'","'discount3'","'discountname1'","'discountname2'","'discountname3'","'waitergopayprint'","'cashenabled'","'returntoorder'","'restaurantmode'","'startprodsearch'","'priceinlist'"));
$configItems = join(",",array("'decpoint'","'version'","'cancelunpaidcode'","'tax'","'togotax'","'taxaustrianormal'","'taxaustriaerm1'","'taxaustriaerm2'","'taxaustriaspecial'","'currency'","'workflowconfig'","'prominentsearch'","'discount1'","'discount2'","'discount3'","'discountname1'","'discountname2'","'discountname3'","'waitergopayprint'","'cashenabled'","'returntoorder'","'restaurantmode'","'startprodsearch'","'priceinlist'","'showdaycode'","'dailycode'"));
$sql = "select name,setting FROM %config% WHERE name in ($configItems)";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute();
@ -1024,6 +1027,10 @@ class Admin {
$bigfontworkreceipt = CommonUtils::getConfigValueStmt($pdo,$stmt,"bigfontworkreceipt",null);
$prominentsearch = CommonUtils::getConfigValueStmt($pdo,$stmt,"prominentsearch",null);
$guestjobprint = CommonUtils::getConfigValueStmt($pdo,$stmt,"guestjobprint",null);
$askdaycode = CommonUtils::getConfigValueStmt($pdo,$stmt,"askdaycode",null);
$showdaycode = CommonUtils::getConfigValueStmt($pdo,$stmt,"showdaycode",null);
$asktablecode = CommonUtils::getConfigValueStmt($pdo,$stmt,"asktablecode",null);
$guesttimeout = CommonUtils::getConfigValueStmt($pdo,$stmt,"guesttimeout",5);
$discount1 = CommonUtils::getConfigValueStmt($pdo,$stmt,"discount1",null);
$discount2 = CommonUtils::getConfigValueStmt($pdo,$stmt,"discount2",null);
$discount3 = CommonUtils::getConfigValueStmt($pdo,$stmt,"discount3",null);
@ -1132,6 +1139,7 @@ class Admin {
"userlanguage" => $userlang, "receiptprinter" => $receiptprinter,
"receiptfontsize" => $receiptfontsize, "reservationnote" => $reservationnote, "paymentconfig" => $paymentconfig,
"workflowconfig" => $workflowconfig, "emailratingcontact" => $emailratingcontact,"emailbadrating" => $emailbadrating, "guestjobprint" => $guestjobprint,
"askdaycode" => $askdaycode, "asktablecode" => $asktablecode, "guesttimeout" => $guesttimeout, "showdaycode" => $showdaycode,
"rightchangeprice" => $right_changeprice, "bigfontworkreceipt" => $bigfontworkreceipt, "prominentsearch" => $prominentsearch,"groupworkitemsf" => $groupworkitemsf,"groupworkitemsd" => $groupworkitemsd,
"sday" => $now["mday"],"smonth" => $now["mon"], "syear" => $now["year"], "shour" => $now["hours"], "smin" => $now["minutes"],
"smtphost" => $smtphost,"smtpauth" => $smtpauth,"smtpuser" => $smtpuser,"smtppass" => $smtppass,"smtpsecure" => $smtpsecure,"smtpport" => $smtpport,
@ -1245,7 +1253,7 @@ class Admin {
$view = "preferences.html";
}
echo json_encode($view . "?v=1.4.5");
echo json_encode($view . "?v=1.4.6");
}
}
@ -1452,27 +1460,27 @@ class Admin {
if (!self::isOnlyRatingUser($rights, $right_rating, true)) {
if ($_SESSION['modus'] == 0) {
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.4.5"); };
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.4.6"); };
} else {
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.4.5"); };
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.4.6"); };
}
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.4.5"); };
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.4.5"); };
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.4.5"); };
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.4.6"); };
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.4.6"); };
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.4.6"); };
if ($_SESSION['modus'] == 0) {
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.4.5"); };
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.4.6"); };
}
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.4.5"); };
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.4.5"); };
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.4.5"); };
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.4.5"); };
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.4.5"); };
if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.4.5"); };
if ($_SESSION['right_dash']) { $mainMenu[] = array("name" => $dashtxt[$lang], "link" => "dash.php?v=1.4.5"); };
if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.4.5"); };
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.4.5");
$mainMenu[] = array("name" => "Hilfe", "link" => "help.php?v=1.4.5");
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.4.5");
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.4.6"); };
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.4.6"); };
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.4.6"); };
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.4.6"); };
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.4.6"); };
if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.4.6"); };
if ($_SESSION['right_dash']) { $mainMenu[] = array("name" => $dashtxt[$lang], "link" => "dash.php?v=1.4.6"); };
if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.4.6"); };
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.4.6");
$mainMenu[] = array("name" => "Hilfe", "link" => "help.php?v=1.4.6");
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.4.6");
}
$mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php");
@ -1480,7 +1488,7 @@ class Admin {
$waiterMessage = $this->getMessage(null, "waitermessage");
}
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.4.5",
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.4.6",
"user" => $currentUser,
"menu" => $mainMenu,
"waitermessage" => $waiterMessage,
@ -1552,6 +1560,17 @@ class Admin {
}
}
private function getDailycode() {
try {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$dailycode = CommonUtils::getConfigValue($pdo, 'dailycode', "");
echo json_encode(array("status" => "OK","msg" => $dailycode));
} catch (Exception $ex) {
echo json_encode(array("status" => "ERROR","msg" => "Error: " . $ex->getMessage()));
return;
}
}
private function getDbStat() {
try {
$pdo = DbUtils::openDbAndReturnPdoStatic();
@ -1910,6 +1929,10 @@ class Admin {
"bigfontworkreceipt" => array("dbcol" => "bigfontworkreceipt","checknum" => 0),
"prominentsearch" => array("dbcol" => "prominentsearch","checknum" => 0),
"guestjobprint" => array("dbcol" => "guestjobprint","checknum" => 0),
"askdaycode" => array("dbcol" => "askdaycode","checknum" => 0),
"asktablecode" => array("dbcol" => "asktablecode","checknum" => 0),
"showdaycode" => array("dbcol" => "showdaycode","checknum" => 0),
"guesttimeout"=> array("dbcol" => "guesttimeout","checknum" => 0),
"discount1" => array("dbcol" => "discount1","checknum" => 0),
"discount2" => array("dbcol" => "discount2","checknum" => 0),
"discount3" => array("dbcol" => "discount3","checknum" => 0),
@ -2031,6 +2054,17 @@ class Admin {
}
}
if ($name == "guesttimeout") {
if (is_numeric($aVal)) {
$aVal = round($aVal);
if ($aVal < 0) {
$aVal = 0;
}
} else {
$aVal = 5;
}
}
if (($name == "updateurl") || ($name == "tmpdir") || ($name == "ftphost") || ($name == "ftpuser")) {
$aVal = trim($aVal);
}

View File

@ -27,7 +27,7 @@ if (isset($_POST["cmd"])) {
if (strlen($status) > 150) {
$status = substr($status, 0,149);
}
$version = "1.4.5";
$version = "1.4.6";
$arr = array("cmd" => $cmd,"fct" => $fct, "xhr" => $xhr,"errormsg" => $errormsg,"status" => $status,"version" => $version,"phpversion" => $phpversion);
} else {

View File

@ -47,6 +47,10 @@ class Guestsync {
$currency = CommonUtils::getConfigValue($pdo, 'currency', 'Euro');
$decpoint = CommonUtils::getConfigValue($pdo, 'decpoint', '.');
$askdaycode = CommonUtils::getConfigValue($pdo, 'askdaycode', "1");
$asktablecode = CommonUtils::getConfigValue($pdo, 'asktablecode', "1");
$guesttimeout = CommonUtils::getConfigValue($pdo, 'guesttimeout', "5");
$transferdata = array(
"timezone" => $timezone,
"dailycode" => $dailycode,
@ -55,7 +59,10 @@ class Guestsync {
"types" => $types,
"products" => $products,
"currency" => $currency,
"decpoint" => $decpoint
"decpoint" => $decpoint,
"askdaycode" => $askdaycode,
"asktablecode" => $asktablecode,
"guesttimeout" => $guesttimeout
);
$data = json_encode($transferdata);
@ -118,11 +125,16 @@ class Guestsync {
}
private static function checkPermission($pdo,$tableid,$tablecode,$prodid,$dailycode) {
$askdaycode = CommonUtils::getConfigValue($pdo, 'askdaycode', 1);
if ($askdaycode == 1) {
$dailycodeInDb = trim(CommonUtils::getConfigValue($pdo, 'dailycode', ''));
if ($dailycode != trim($dailycodeInDb)) {
return false;
}
}
$asktablecode = CommonUtils::getConfigValue($pdo, 'asktablecode', 1);
if ($asktablecode == 1) {
$sql = "SELECT IFNULL(code,'') as code from %resttables% WHERE id=? AND allowoutorder=?";
$result = CommonUtils::fetchSqlAll($pdo, $sql, array($tableid,1));
if (count($result) == 0) {
@ -132,6 +144,7 @@ class Guestsync {
if ($tablecodeInDb != $tablecode) {
return false;
}
}
$sql = "SELECT id FROM %products% WHERE id=? AND removed is null AND (display is null OR display='KG' OR display='G')";
$result = CommonUtils::fetchSqlAll($pdo, $sql, array($prodid));
@ -140,7 +153,6 @@ class Guestsync {
}
return true;
}
private static function shallWeSync($pdo) {

View File

@ -209,11 +209,8 @@ class Products {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$pdo->beginTransaction();
$sql = "select setting FROM %config% WHERE name=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array("pricelevel"));
$row = $stmt->fetchObject();
$pricelevel = $row->setting;
$pricelevel = CommonUtils::getConfigValue($pdo, 'pricelevel', 1);
$priceTxt = "priceA";
if ($pricelevel == 2) {
$priceTxt = "priceB";
@ -222,9 +219,7 @@ class Products {
}
$sql = "select id,name,reference from %prodtype% where removed is null";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));
$stmt->execute();
$result = $stmt->fetchAll();
$result = CommonUtils::fetchSqlAll($pdo, $sql, null);
$typeArray = array();
foreach($result as $row) {
@ -265,10 +260,63 @@ class Products {
}
$pdo->commit();
$retArray = array("types" => $typeArray, "prods" => $prodArray);
$filteredTypes = self::filterUsedTypes($typeArray, $prodArray);
$retArray = array("types" => $filteredTypes, "prods" => $prodArray);
echo json_encode($retArray);
}
private static function filterUsedTypes($types,$products) {
$typesWithContent = array();
foreach ($products as $p) {
$ref = $p["ref"];
$typeOfProd = self::getTypeOfId($types, $ref);
if (!is_null($typeOfProd)) {
$typesWithContent = self::declareProdTypeAndParentsInUse($types, $typeOfProd,$typesWithContent);
}
}
$out = array();
$keys = array_keys($typesWithContent);
foreach($keys as $aKey) {
$t = $typesWithContent[$aKey];
$out[] = array("id" => $t["id"],"name" => $t["name"],"ref" => $t["ref"]);
}
return $out;
}
private static function getTypeOfId($alltypes,$typeid) {
foreach($alltypes as $t) {
if ($t["id"] == $typeid) {
return $t;
}
}
return null;
}
private static function declareProdTypeAndParentsInUse($alltypes,$aType,$typesWithContent) {
$typeid = $aType["id"];
$reference = $aType["ref"];
if (!array_key_exists($typeid, $typesWithContent)) {
$typesWithContent[$typeid] = array("id" => $typeid,"name" => $aType["name"],"ref" => $reference);
$parent = null;
foreach($alltypes as $a) {
$typeid = $a["id"];
if ($typeid == $reference) {
$parent = $a;
break;
}
}
if (!is_null($parent)) {
$typesWithContent = self::declareProdTypeAndParentsInUse($alltypes,$parent,$typesWithContent);
}
}
return $typesWithContent;
}
/*
* Return all available product with id and name, category
* (used for re-assignment to type)
@ -1311,13 +1359,26 @@ class Products {
}
function createProdType($id,$prodTypeName) {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$pdo->beginTransaction();
if ($id == "top") {
$kind = 0;
if (isset($_POST["kind"])) {
$kind = $_POST["kind"];
}
$sql = "INSERT INTO `%prodtype%` (`name`,`usekitchen`,`usesupplydesk`,`kind`,`printer`,`sorting`,`reference`) VALUES(?,1,1,?,1,NULL,?)";
CommonUtils::execSql($pdo, $sql, array($prodTypeName,$kind,null));
$pdo->commit();
echo json_encode(array("status" => "OK"));
return;
}
if (!is_numeric($id)) {
echo json_encode(array("status" => "ERROR", "code" => ERROR_GENERAL_ID_TYPE, "msg" => ERROR_GENERAL_ID_TYPE_MSG));
return;
}
$pdo = $this->dbutils->openDbAndReturnPdo();
$pdo->beginTransaction();
$sql = "SELECT kind FROM %prodtype% WHERE id=?";
$stmt = $pdo->prepare($this->dbutils->resolveTablenamesInSqlString($sql));

View File

@ -420,6 +420,7 @@ class Basedb {
`prodimageid` INT(10) NULL,
`display` VARCHAR(3) NULL,
`removed` INT(1) NULL,
INDEX pcatindex (category),
FOREIGN KEY (category) REFERENCES %prodtype%(id),
FOREIGN KEY (prodimageid) REFERENCES %prodimages%(id)
) CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDb ;

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.5">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.6">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -7,7 +7,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.5">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.6">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -280,6 +280,17 @@ function setLanguage(language) {
txt += PROD_CATS_LIST[lang] + ":<br>" + cats;
}
if (ct == null) {
// on highest levels show fields to create types on highest level
txt += '<br><input id="topleveltypefield" placeholder="' + PROD_PLACEHOLDER_NEW_PRODTYPE[lang] + '" style="background:white;" />';
txt += '<div class="ui-grid-a">';
txt += '<div class="ui-block-a"><button id="createtoptypebtn_food" class="oscmd" type="submit" data-theme="c">' + PROD_NEW_CAT[lang] + " (" + PROD_FOOD[lang] + ") </button></div>";
txt += '<div class="ui-block-b"><button id="createtoptypebtn_drink" class="oscmd" type="submit" data-theme="c">' + PROD_NEW_CAT[lang] + " (" + PROD_DRINKS[lang] + ") </button></div>";
txt += '</div>';
}
var prodsListPrinted = false;
var pt = content.containedProds;
@ -378,6 +389,8 @@ function setLanguage(language) {
proddel(objid);
} else if (cmd == "newtype") {
typenew(objid);
} else if (cmd == "createtoptypebtn") {
newtoptype(objid);
} else if (cmd == "typeapply") {
typeapply(objid);
} else if (cmd == "typecancel") {
@ -396,6 +409,8 @@ function setLanguage(language) {
doAjax("GET","php/contenthandler.php?module=products&command=getAssignedExtrasOfProd&prodid=" + objid,null,handleAssignedExtras,"Zugewiesene Optionen");
} else if (cmd == 'toggleprodtype') {
toggleProdType(objid);
} else if (cmd == 'createtoptypebtn') {
}
});
}
@ -768,19 +783,29 @@ function setLanguage(language) {
doAjax("POST","php/contenthandler.php?module=products&command=delproduct",{prodid:prodid},reloadCurrentType,"Produktsort./entf.");
}
function typenew(typeid) {
var newTypeName = $("#newtypename_" + typeid).val();
if (newTypeName.trim() == "") {
function createNewTypeOnServer(refid,name,kind) {
if (name == "") {
alert(PROD_ENTER_CAT_NAME[lang]);
} else {
var data = {
refid: typeid,
name: newTypeName
refid: refid,
name: name,
kind: kind
};
doAjax("POST","php/contenthandler.php?module=products&command=createProdType",data,reloadPageWithTimeout,"Neue Kategorie nicht anlegbar");
}
}
function newtoptype(kind) {
var name = $("#topleveltypefield").val().trim();
createNewTypeOnServer("top",name,(kind == "food" ? 0 : 1));
}
function typenew(typeid) {
var name = $("#newtypename_" + typeid).val().trim();
createNewTypeOnServer(typeid,name,0);
}
function typeapply(typeid) {
var name = $("#typename_input_" + typeid).val();
if (name.trim() == "") {

View File

@ -7,7 +7,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.5">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.6">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -7,7 +7,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.5">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.6">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.5">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.6">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

View File

@ -5,7 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="Stefan Pichel">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.5">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.4.6">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -11,6 +11,8 @@
<div id=tableoverlay></div>
</div>
<div class="daycodeareamobile" style="display:none;"><span class="daycodetxt">Tageslosung</span>: <span class="daycodefield"></span></div>
<div id="receiptpanel" style="display:none;"></div>
<td id="main" class="tablemain">