OrderSprinter 1.3.19

This commit is contained in:
Geno 2020-11-19 23:03:35 +01:00
parent c12cd500e3
commit 6e406d81c1
38 changed files with 947 additions and 114 deletions

View File

@ -85,7 +85,7 @@ class Installer {
}
Database::dropTables($pdo);
Database::createEmptyTables($pdo, $prefix);
Database::setVersion($pdo,$prefix,"1.3.18");
Database::setVersion($pdo,$prefix,"1.3.19");
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.3.18">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.19">
<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.3.18">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.19">
<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

@ -1 +1 @@
.paypanel{display:-webkit-flex;display:flex;-webkit-justify-content:left;justify-content:left;-webkit-flex-wrap:row wrap;flex-flow:row wrap;background-color:lightgrey}.payitem{width:100px;height:100px;margin:10px;border-radius:25px;border:2px solid #73ad21;padding-top:20px;padding-left:20px;padding-bottom:0;padding-right:20px;color:black;font-weight:bold;text-align:center;font-size:12px;word-wrap:break-word;white-space:pre-line;overflow:hidden;display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:row wrap;flex-flow:row wrap;box-shadow:10px 10px 5px #888}.paystillopen{background-color:#ff0}.payallaccounted{background-color:#ddd}#oben{color:black;font-weight:bold;font-size:20px;min-height:100px}#receiptpanel{position:relative;margin:10px auto;padding:0;width:100%;height:auto;border-collapse:collapse;background-color:#ddd;color:black;box-shadow:10px 10px 5px #888;border:2px solid #333}.payitem>*{flex:100%}.payitemmain{height:50px}.payitemaccounted{color:red;font-size:20px;font-weight:bold}.paymentitem{padding:8px 16px;border-bottom:1px solid #ddd;background-color:#ff9;height:40px;font-size:16px;font-weight:bold}.paymentitem:hover{padding:8px 16px;border-bottom:1px solid #ddd;background-color:#ff0;height:40px;font-size:16px;font-weight:bold}.paymentcancel{padding:8px 16px;border-bottom:1px solid #ddd;background-color:red;height:40px;font-size:16px;font-weight:bold}#paybuttonpanel{display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:row nowrap;flex-flow:row nowrap}#paybuttonpanel>*{flex:100%}.btnswitchon{border:1px solid black;border-left:0;padding:.1em .3em;position:relative}.btnswitchon:before{display:block;content:".";color:transparent;font-size:0;border-left:5px solid green;height:100%;position:absolute;left:0;padding:1px 0;top:-1px;bottom:-1px}.btnswitchoff{border:1px solid black;border-left:0;padding:.1em .3em;position:relative}.btnswitchoff:before{display:block;content:".";color:transparent;font-size:0;border-left:5px solid red;height:100%;position:absolute;left:0;padding:1px 0;top:-1px;bottom:-1px}.guestselectionbutton{padding:8px 16px;border-bottom:1px solid #ddd;background-color:#dd0;height:40px;font-size:16px;font-weight:bold;width:100%}.guestselectionlist{padding:8px 16px;border-bottom:1px solid #ddd;background-color:#4f4;height:40px;font-size:16px;font-weight:bold;width:100%}
.paypanel{display:-webkit-flex;display:flex;-webkit-justify-content:left;justify-content:left;-webkit-flex-wrap:row wrap;flex-flow:row wrap;background-color:lightgrey}.payitemnormborder{border-radius:25px;border:2px solid #73ad21}.payitemoffborder{border-radius:25px;border:5px solid gray}.payitem{width:100px;height:100px;margin:10px;padding-top:20px;padding-left:20px;padding-bottom:0;padding-right:20px;color:black;font-weight:bold;text-align:center;font-size:12px;word-wrap:break-word;white-space:pre-line;overflow:hidden;display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:row wrap;flex-flow:row wrap;box-shadow:10px 10px 5px #888}.paystillopen{background-color:#ff0}.payallaccounted{background-color:#ddd}#oben{color:black;font-weight:bold;font-size:20px;min-height:100px}#receiptpanel{position:relative;margin:10px auto;padding:0;width:100%;height:auto;border-collapse:collapse;background-color:#ddd;color:black;box-shadow:10px 10px 5px #888;border:2px solid #333}.payitem>*{flex:100%}.payitemmain{height:50px}.payitemaccounted{color:red;font-size:20px;font-weight:bold}.paymentitem{padding:8px 16px;border-bottom:1px solid #ddd;background-color:#ff9;height:40px;font-size:16px;font-weight:bold}.paymentitem:hover{padding:8px 16px;border-bottom:1px solid #ddd;background-color:#ff0;height:40px;font-size:16px;font-weight:bold}.paymentcancel{padding:8px 16px;border-bottom:1px solid #ddd;background-color:red;height:40px;font-size:16px;font-weight:bold}#paybuttonpanel{display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center;-webkit-flex-wrap:row nowrap;flex-flow:row nowrap}#paybuttonpanel>*{flex:100%}.btnswitchon{border:1px solid black;border-left:0;padding:.1em .3em;position:relative}.btnswitchon:before{display:block;content:".";color:transparent;font-size:0;border-left:5px solid green;height:100%;position:absolute;left:0;padding:1px 0;top:-1px;bottom:-1px}.btnswitchoff{border:1px solid black;border-left:0;padding:.1em .3em;position:relative}.btnswitchoff:before{display:block;content:".";color:transparent;font-size:0;border-left:5px solid red;height:100%;position:absolute;left:0;padding:1px 0;top:-1px;bottom:-1px}.guestselectionbutton{padding:8px 16px;border-bottom:1px solid #ddd;background-color:#dd0;height:40px;font-size:16px;font-weight:bold;width:100%}.guestselectionlist{padding:8px 16px;border-bottom:1px solid #ddd;background-color:#4f4;height:40px;font-size:16px;font-weight:bold;width:100%}

View File

@ -1 +1 @@
.productspanel{display:-webkit-flex;display:flex;-webkit-justify-content:left;justify-content:left;-webkit-flex-wrap:row wrap;flex-flow:row wrap;background-color:lightgrey}.productitem{background-color:#ff0;margin:10px;border-radius:25px;border:2px solid #73ad21;padding:20px;color:black;font-weight:bold;text-align:center;box-shadow:10px 10px 5px #888;word-wrap:break-word}.osprod-desk-0{width:100px;height:40px}.osprod-desk-1{width:100px;height:100px}.osprod-desk-2{width:120px;height:130px}.prodToMoveEl{padding:8px 16px;border-bottom:1px solid #ddd;height:40px;font-size:16px;font-weight:bold}.proditemselected{background-color:#0f0}.proditemunselected{background-color:#eee}
.productspanel{display:-webkit-flex;display:flex;-webkit-justify-content:left;justify-content:left;-webkit-flex-wrap:row wrap;flex-flow:row wrap;background-color:lightgrey}.productitem{background-color:#ff0;margin:10px;border-radius:25px;border:2px solid #73ad21;padding:20px;color:black;font-weight:bold;text-align:center;box-shadow:10px 10px 5px #888;word-wrap:break-word}.osprod-desk-0{width:100px;height:40px}.osprod-desk-1{width:100px;height:100px}.osprod-desk-2{width:120px;height:130px}.prodToMoveEl{padding:8px 16px;border-bottom:1px solid #ddd;height:40px;font-size:16px;font-weight:bold}.proditemselected{background-color:#0f0}.proditemunselected{background-color:#eee}.whitebackground{background-color:white}

View File

@ -0,0 +1,14 @@
<h2>Verwendung von Produktbildern</h2>
<p>Jeder Benutzer kann für sich festlegen (Menü <i>Einstellungen</i>), ob er die reine textuelle Darstellung der Produktlisten wünscht, oder die Einblendung von Produktbildern bevorzugt.
<p>Die Einstellung kann individuell für die Desktopansicht (Einstellung: <i>Produktbilder in Desktopansicht</i>) und die Mobilansicht (Einstellung: <i>Produktbilder in Mobilansicht</i>) vorgenommen werden.
<p>Damit Bilder angezeigt werden können, müssen diese natürlich im System hinterlegt werden. Ein Benutzer mit dem Recht <i>Angebot</i> kann Bilder in der Angebotsansicht den Produkten zuweisen.
In der Angebotsansicht befindet sich eine aufklappbare Fläche, die mit <i>Bilduweisung</i> beschriftet ist. Dort sind alle Produkte in alphabetischer Reihenfolge aufgeführt.
Wird ein Produkteintrag angeklickt, so öffnet sich eine Fläche, die ein möglicherweise bereits zugewiesenes Bild zeigt sowie ein Uploadwidget enthält, mit dem ein neues Bild hochgeladen oder das existierende Bild ersetzt werden kann.
<p>Das Hochladen eines Bildes ist über das Anklicken des Upload-Buttons oder per <b>Drag-and-Drop</b> einer Bilddatei auf den Upload-Button möglich.
<p>Ist das WLAN-Netz oft gestört bzw. nicht so performant, kann das Laden der Bilder für die Darstellung in der Bestell- und Kassenansicht die Bedienung verlangsamen. In diesem Fall sollte wieder auf die Textdarstellung zurückgeschaltet werden.

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.3.18">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.19">
<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

@ -62,6 +62,10 @@ $(document).on("pageinit", "#help-page", function () {
<div data-role="collapsible" data-content-theme="c" data-collapsed="true" data-theme="e" >
<?php include 'elements/help-receipts.txt'; ?>
</div>
<div data-role="collapsible" data-content-theme="c" data-collapsed="true" data-theme="e" >
<?php include 'elements/help-prodimages.txt'; ?>
</div>
</div>

BIN
webapp/img/trans.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

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.3.18">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.3.18">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.19">
<link rel="stylesheet" type="text/css" href="css/numfield.css?v=1.3.19">
<link rel="stylesheet" href="php/3rdparty/orderstyle/orderstyle.min.css" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -133,6 +133,15 @@ function showLoginMask(jsonContent) {
}
function binding() {
$('#loginmask h2').off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
});
$('#logoutarea h2').off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
});
$("#loginbutton").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
@ -206,7 +215,7 @@ function handleResultOfInstallCheck(is_installed) {
if (is_installed == "Yes") {
useInstallation();
} else {
setTimeout(function(){document.location.href = "install.html?v=1.3.18"},500);
setTimeout(function(){document.location.href = "install.html?v=1.3.19"},500);
}
}

View File

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

View File

@ -2339,6 +2339,58 @@ return false;
}
}
function updateUserTable1318_1319($prefix, $version, $dbname) {
$pdo = $this->pdo;
try {
if ($version != "1.3.18") {
$ret = $this->updateUserTable1317_1318($prefix, $version, $dbname);
if (!$ret) {
echo "Version update v1.3.17 to 1.3.18 not successful.";
return false;
}
}
DbUtils::overrulePrefix($prefix);
$sql = "INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL,?,?)";
$stmt = $pdo->prepare($this->basedb->resolveTablenamesInSqlString($sql));
$stmt->execute(array('priceinlist','0'));
$this->basedb->createProdimagesTable($pdo);
$sql = "SHOW COLUMNS FROM %products% LIKE 'prodimageid'";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute();
$result = $stmt->fetchAll();
if (count($result) == 0) {
$this->execSql($pdo, "ALTER TABLE %products% ADD prodimageid INT(10) NULL AFTER audio");
$this->execSql($pdo, "OPTIMIZE TABLE %products%");
$this->execSql($pdo, "ALTER TABLE %histprod% ADD prodimageid INT(10) NULL AFTER audio");
$this->execSql($pdo, "OPTIMIZE TABLE %histprod%");
}
$sql = "SHOW COLUMNS FROM %user% LIKE 'preferimgdesk'";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute();
$result = $stmt->fetchAll();
if (count($result) == 0) {
$sql = "ALTER TABLE %user% ADD preferimgdesk INT(1) NULL AFTER prefertablemap";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute();
$sql = "ALTER TABLE %user% ADD preferimgmobile INT(1) NULL AFTER preferimgdesk";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute();
}
$this->updateVersion($pdo, '1.3.19');
return true;
} catch (PDOException $e) {
echo "Error in v1.3.18 to 1.3.19: $e";
return false;
}
}
function setVersion($prefix,$theVersion) {
$pdo = $this->pdo;
@ -2408,6 +2460,7 @@ $this->basedb->createTableMapsTable($pdo);
$this->basedb->createTablePosTable($pdo);
$this->basedb->createConfigTable($pdo);
$this->basedb->createProdTypeTable($pdo);
$this->basedb->createProdimagesTable($pdo);
$this->basedb->createProductTable($pdo);
$this->basedb->createPriceLevelTable($pdo);
$this->basedb->createClosingTable($pdo);
@ -2465,7 +2518,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.3.18')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'version', '1.3.19')");
$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')");
@ -2514,6 +2567,7 @@ $this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VAL
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'updateurl', 'http://www.ordersprinter.de/update')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'restaurantmode', '1')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'dblog', '1')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'priceinlist', '0')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'startprodsearch', '3')");
$this->basedb->doSQL($pdo,"INSERT INTO `%config%` (`id` , `name`, `setting`) VALUES (NULL , 'returntoorder', '1')");
@ -2897,7 +2951,7 @@ $zones[] = $timezone_identifiers[$i];
}
echo json_encode($zones);
} else if ($command == 'update') {
$installerVersion = "1.3.18";
$installerVersion = "1.3.19";
$admin = new InstallAdmin();
$pdo = $admin->openDbAndReturnPdo($_POST['host'],$_POST['db'],$_POST['user'],$_POST['password']);
@ -2928,7 +2982,7 @@ $supportedVersions = array("1.0.22","1.0.23","1.0.24","1.0.25","1.0.26","1.0.27"
"1.1.18","1.1.19","1.1.20","1.1.21","1.1.22","1.1.23","1.1.24","1.1.25","1.1.26","1.1.27","1.1.28","1.1.29","1.1.30",
"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.13","1.3.14","1.3.15","1.3.16","1.3.17","1.3.18"
);
if (!in_array($version, $supportedVersions)) {
@ -2936,7 +2990,7 @@ echo json_encode("Quellversion nicht unterstützt");
return;
}
$ret = $admin->updateUserTable1317_1318($_POST['prefix'], $version, $_POST['db']);
$ret = $admin->updateUserTable1318_1319($_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.3.18">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.19">
<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.3.18">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.19">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -16,6 +16,9 @@
<script src="utilities.js"></script>
<script src="elements/tablemap.js"></script>
<script src="elements/roommap.js"></script>
<link href="php/3rdparty/hayageek_uploadfile.css" rel="stylesheet">
<script src="php/3rdparty/hayageek_jquery_uploadfile.js"></script>
<style>
@media all
@ -73,6 +76,8 @@ var MAN_USER_PASS = ["Passwort","Password","Contraseña"];
var MAN_YES = ["Ja","Yes","Si"];
var MAN_NO = ["Nein","No","No"];
var MAN_CREATE = ["Erstellen","Create","Crear"];
var MAN_CREATE_WITH_REC = ["Erstellen mit Bon","Create with receipt","Crear con tiquet"];
var MAN_CREATE_WITHOUT_REC = ["Erstellen ohne Bon","Create without receipt","Crear sin tiquet"];
var MAN_SPEISEKARTE = ["Speisekarte","Menu","Menú"];
var MAN_ROOMPLAN = ["Raumplan","Plan of rooms","Mapa de espacio"];
@ -194,7 +199,6 @@ var MAN_BAK_REST_INFO_ALL = ['Die Datensicherung kann auch die gesamte Datenbank
'Exportar puede guarda la base de datos completamente. Con "Importar" este data se puede re-importado. '
+ 'Las acciones estan escritos en un log.'];
var MAN_REST_INFO = ["Der Import dauert eine Weile...","The import takes a while...","Importar necesita un rato..."];
var MAN_UPLOAD_FILE = ["Diese Datei hochladen (<i>importieren</i>): ", "Upload this file: ","Importar este file: "];
var MAN_BAK_REST_HEAD = ["Sicherung und Import","Backup and Restore","Exportar y Importar"];
var MAN_BAK_BTN = ["Sicherung (Konfiguration)","Backup (Configuration)","Exportar (configuración)"];
var MAN_BAK_GUEST_BTN = ["Sicherung (Konfiguration + Gäste)","Backup (Configuration + guests)","Exportar (configuración y clientes)"];
@ -208,7 +212,6 @@ var MAN_UPDATE_HINT = ["Das Updaten über diesen Weg funktioniert nur, wenn die
var MAN_UPDATE_URL = ["Updateserver","Update Server","Servidor"];
var MAN_AVAIL_UPD_VERSION = ["Neueste verfügbare Version","Newest released version","ùltima version"];
var MAN_UPD_PROGRESS = ["Fortschritt","Progress","Progreso"];
var MAN_RESTORE_BTN = ["Importieren","Restore","Importar"];
var MAN_GO_LIVE = ["Starte Produktivbetrieb","Start productive mode","Empezar trabajar realmente"];
var MAN_SHUTDOWN = ["Server herunterfahren","Shutdown server","Apagar servidor"];
var MAN_SHUTDOWN_HINT = ["(Herunterfahren nur möglich, wenn Webserver die erforderlichen Rechte besitzt).",
@ -349,6 +352,7 @@ var MAN_SHOWPAYMENT6 = ["Lastschrift","debitsCard","Débito"];
var MAN_SHOWPAYMENT7 = ["Hotelzimmer","Hotel room","Habitación"];
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_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:"];
@ -379,7 +383,7 @@ var MAN_DASHSLOT2 = ["Dashboard Slot 2","Dashboard Slot 2","Dashboard Slot 2"];
var MAN_DASHSLOT3 = ["Dashboard Slot 3","Dashboard Slot 3","Dashboard Slot 3"];
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];
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];
var numberOfClosings = 0;
@ -477,7 +481,8 @@ var generalValuesSettings = [
["dashslot3",MAN_DASHSLOT3[lang],"s",37],
["groupworkitemsd",MAN_GROUP_WORK_ITEMS_D[lang],"s",38],
["oneprodworkrecd",MAN_ONE_PROD_WORKREC_D[lang],"s",39],
["dblog",MAN_DBLOG[lang],"s",40]
["dblog",MAN_DBLOG[lang],"s",40],
["priceinlist",MAN_PRICE_IN_LIST[lang],"s",41]
];
var predef = "";
@ -508,8 +513,9 @@ function setLanguage(l) {
$("#datexportendmonthpart").html(monthHtml);
$("#datexportendmonthpart").trigger("create");
$("#createclosing").html(MAN_CREATE[l]);
$("#createclosing").html(MAN_CREATE_WITH_REC[l]);
$("#createclosingnoprint").html(MAN_CREATE_WITHOUT_REC[l]);
$("#changeConfig").html(MAN_CHANGE[l]);
$("#dataexportdettxt").html(MAN_DATEXPDETTXT[l]);
@ -555,7 +561,6 @@ function setLanguage(l) {
$("#bakresinfotxt").html(MAN_BAK_REST_INFO[l]);
$("#bakresinfotxtall").html(MAN_BAK_REST_INFO_ALL[l]);
$("#uplfiletxt").html(MAN_UPLOAD_FILE[l]);
$("#bakrestxt").html(MAN_BAK_REST_HEAD[l]);
$("#updatetxt").html(MAN_UPDATE_HEAD[l]);
$('#dbproptxt').html(MAN_DB_PROPERTIES[l]);
@ -567,7 +572,6 @@ function setLanguage(l) {
$("#backupguestsbtntxt").html(MAN_BAK_GUEST_BTN[l]);
$("#backupbtntxtall").html(MAN_BAK_BTN_ALL[l]);
$("#backupbtntxtalllogs").html(MAN_BAK_BTN_ALL_LOGS[l])
$("#restorebtntxt").html(MAN_RESTORE_BTN[l]);
$("#golivetxt").html(MAN_GO_LIVE[l]);
$("#shutdownbtntxt").html(MAN_SHUTDOWN[l]);
@ -750,6 +754,7 @@ function insertGeneralConfigItems(configResult) {
$("#partOfBeepCooked").html(createYesNo("beepcooked",MAN_BEEP_COOKED, values.beepcooked));
$("#partOfRestaurantmode").html(createYesNo("restaurantmode",MAN_RESTAURANT_MODE, values.restaurantmode));
$("#partOfDblog").html(createYesNo("dblog",MAN_DBLOG, values.dblog));
$("#partOfPriceinlist").html(createYesNo("priceinlist",MAN_PRICE_IN_LIST, values.priceinlist));
$("#partOfclosshowci").html(createYesNo("closshowci",MAN_CLOSSHOWCI,values.closshowci));
$("#partOfclosshowpaytaxes").html(createYesNo("closshowpaytaxes",MAN_CLOSSHOWPAYTAXES,values.closshowpaytaxes));
@ -831,6 +836,7 @@ function insertGeneralConfigItems(configResult) {
generalVals[38] = values.groupworkitemsd;
generalVals[39] = values.oneprodworkrecd;
generalVals[40] = values.dblog;
generalVals[41] = values.priceinlist;
$("#smtphost").val(values.smtphost);
$("#partOfSmtpauth").html(createSMTPAuth(values.smtpauth));
@ -1165,12 +1171,45 @@ function reactOnConfigChange(result) {
}
}
function initRestoreFileUpload() {
var settings = {
url: "php/contenthandler.php?module=admin&command=restore",
method: "POST",
allowedTypes:"json",
fileName: "userfile",
multiple: false,
uploadQueueOrder: 'replace',
showFileCounter: false,
dragDropStr: "<span>Datei zum Wiederherstellen</span>",
extErrorStr: " ist nicht erlaubt. Erlaubte Dateiendung: ",
onSuccess:function(files,data,xhr)
{
var answer = jQuery.parseJSON(data);
if (answer.status != "OK") {
alert("Upload war nicht erfolgreich: " + answer.msg);
} else {
alert("Import war erfolgreich.");
setTimeout(function(){
document.location.href = "index.html?v=1.3.19";
},250);
}
},
onError: function(files,status,errMsg)
{
$("#restorestatus").html("<font color='red'>Upload fehlgeschlagen</font>");
}
}
$("#restorefilearea").uploadFile(settings);
}
$(document).ready(function() {
$.ajaxSetup({ cache: false });
requestUnpaidTables();
var refreshId = setInterval(function() {
requestUnpaidTables();
}, 5000);
initRestoreFileUpload();
});
function requestUnpaidTables() {
@ -1197,16 +1236,16 @@ function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}
function startCreateClosing(remark) {
function startCreateClosing(remark,doPrint) {
if (unpaidTables.length == "") {
hideClosingBtn();
doAjax("POST","php/contenthandler.php?module=closing&command=createClosing",{ remark: remark },createClosing,"Tagesabschluss");
doAjax("POST","php/contenthandler.php?module=closing&command=createClosing",{ remark: remark, print: (doPrint ? 1 : 0) },createClosing,"Tagesabschluss");
} else {
areYouSure("Tageserfassung", MAN_UNPAID1[lang] + unpaidTables + ". " + MAN_UNPAID2[lang], MAN_YES[lang], function() {
hideClosingBtn();
doAjax("POST","php/contenthandler.php?module=closing&command=createClosing",{ remark: remark },createClosing,"Tagesabschluss");
doAjax("POST","php/contenthandler.php?module=closing&command=createClosing",{ remark: remark, print: (doPrint ? 1 : 0) },createClosing,"Tagesabschluss");
});
}
}
@ -1214,11 +1253,13 @@ function startCreateClosing(remark) {
function hideClosingBtn() {
$("#closingwaiticon").show();
$("#createclosing").hide();
$("#createclosingnoprint").hide();
}
function showClosingBtn() {
$("#closingwaiticon").hide();
$("#createclosing").show();
$("#createclosingnoprint").show();
}
function bindingClosing() {
@ -1227,7 +1268,15 @@ function bindingClosing() {
$('#remarkfield').val("");
var filteredRemark = remarkText.replace(/\f/g,"").replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\v/g,"");
startCreateClosing(filteredRemark);
startCreateClosing(filteredRemark,true);
});
$("#createclosingnoprint").off("click").on("click", function (e) {
var remarkText =$('#remarkfield').val();
$('#remarkfield').val("");
var filteredRemark = remarkText.replace(/\f/g,"").replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\v/g,"");
startCreateClosing(filteredRemark,false);
});
$(".csvExportButton").off("click").on("click", function (e) {
@ -1525,10 +1574,6 @@ function binding() {
window.location.href = "php/contenthandler.php?module=admin&command=backup&type=confandguests";
});
$("#restorebtntxt").off("click").on("click", function (e) {
$("#restinfoafterclick").html(MAN_REST_INFO[lang]);
});
$("#golive").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
@ -1666,9 +1711,9 @@ function handleUpdateCheckResult(answer) {
var millis=getMillis();
setTimeout(function(){
document.location.href = "install.html?v=1.3.18&mode=onlyupdate&n=" + millis;
document.location.href = "install.html?v=1.3.19&mode=onlyupdate&n=" + millis;
},250);
document.location.href = "install.html?v=1.3.18&mode=onlyupdate&n=" + millis;
document.location.href = "install.html?v=1.3.19&mode=onlyupdate&n=" + millis;
}
function handleUpdateReplace(answer) {
@ -1962,12 +2007,15 @@ function createClosing(closingresult) {
var decpoint = $("#admin-page").data("decpoint");
var msg = closingresult.msg;
var closingid = msg.closingid;
var doPrint = closingresult.print;
alert("Summe des Tagesabschlusses (" + $("#admin-page").data("currency") + "): " + (msg.result.toString()).replace(".", decpoint));
if (generalVals[1] == 2) {
doAjax("GET","php/contenthandler.php?module=printqueue&command=queueClosingSummary",{closingid: closingid},null,"Druckproblem");
} else {
doAjax("GET","php/contenthandler.php?module=closing&command=getClosingSummary",{closingid: closingid},doPrintClosingSummary,"Druckproblem");
if (doPrint == 1) {
if (generalVals[1] == 2) {
doAjax("GET","php/contenthandler.php?module=printqueue&command=queueClosingSummary",{closingid: closingid},null,"Druckproblem");
} else {
doAjax("GET","php/contenthandler.php?module=closing&command=getClosingSummary",{closingid: closingid},doPrintClosingSummary,"Druckproblem");
}
}
} else {
if (closingresult.code == 33) {
@ -2926,7 +2974,13 @@ $(document).on("pageinit", "#admin-page", function () {
</div> <!-- yearselection -->
<input type="text" id="remarkfield" value="" data-mini="true" placeholder="Bemerkung" />
<button type="submit" data-theme="f" class="cancelButton" data-icon="plus" id="createclosing">Erstellen</button>
<div class="ui-grid-a" class="noprint">
<div class="ui-block-a"><button type="submit" data-theme="f" class="cancelButton" data-icon="plus" id="createclosing">Erstellen/Bon</button></div>
<div class="ui-block-b"><button type="submit" data-theme="f" class="cancelButton" data-icon="plus" id="createclosingnoprint">Erstellen/kein Bon</button></div>
</div><!-- /grid-a -->
<img id="closingwaiticon" src="php/3rdparty/images/ajax-loader.gif" style="display:none;"/>
<div id=partofclosings>
@ -3241,6 +3295,8 @@ $(document).on("pageinit", "#admin-page", function () {
<input type="text" value="" data-mini="true" placeholder="3" id="startprodsearch" data-theme="c" class="genConfigEl"/>
</div>
<div id="partOfPriceinlist"></div>
<br><b><u><span id="desktopviewsectiontxt">DESKTOPANSICHT</span></u></b><br><br>
<div>
@ -3402,6 +3458,7 @@ $(document).on("pageinit", "#admin-page", function () {
<li>Eingabe: Preis des Produktes wird bei der Bestellaufnahme abgefragt.
</ul>
<li><b>Tage</b>: Man kann die Tage einschränken, an denen ein Produkt bestellt werden kann. 0=Sonntag, 1=Montag, usw. bis 6=Samstag. Wird ein Produkt an allen Tagen verkauft, ist keine Angabe erforderlich. Ein Produkt, welches nur an Wochenenden verkauft wird, muss mit '06' oder '60' ausgezeichnet werden.
<li><b>Bildnr</b>: Produkte können mit Bildern versehen werden. Jedes Bild in der Bilddatenbank besitzt eine eindeutige ID. Über die Angabe der Bildnummer können Bilder mehreren Produkten zugeordnet werden. Bilder, die keine Referenz mehr besitzen, werden regelmäßig aus der Datenbank entfernt.
</ul>
<p>Ein Produkteintrag mit weiteren Eigenschaften kann beispielsweise so aussehen:
@ -3563,13 +3620,9 @@ $(document).on("pageinit", "#admin-page", function () {
</div>
<div id=restorearea>
<form id="restoreform" enctype="multipart/form-data" action="php/contenthandler.php?module=admin&command=restore" method="POST" data-ajax="false">
<input type="hidden" name="MAX_FILE_SIZE" value="600000000" />
<span id=uplfiletxt>Diese Datei hochladen (<i>importieren</i>):</span>
<input name="userfile" id="userfile" type="file" />
<div id=restinfoafterclick></div>
<input type="submit" data-theme="d" value="Importieren" id="restorebtntxt" formaction="php/contenthandler.php?module=admin&command=restore"/>
</form>
<span id=uplfiletxt>Diese Datei hochladen (<i>importieren</i>):</span>
<div id="restorefilearea">Upload</div>
<div id="restorestatus"></div>
</div>
<p><button type="submit" data-theme="d" id="golive"><span id="golivetxt">Starte Produktivbetrieb</span></button>
@ -3614,7 +3667,7 @@ $(document).on("pageinit", "#admin-page", function () {
<div id="tableforprint" class="printpart">Wenn dieser Text dargestellt wird, liegt ein Fehler vor!</div>
<div id="printserverdownloadpart" style="display:none;">
<a class="noprint" href="OrderSprinterPrintserver.exe" data-role="button" data-icon="arrow-d" data-ajax="false">Download Printserver</a>
<a class="noprint" href="OrderSprinterPrintserver.exe" data-role="button" data-icon="arrow-d" data-ajax="false">Download Windows-Printserver</a>
</div> <!-- printerdownloadpart -->
<div data-role="footer" data-theme="b" id="thefooterr" class="noprint">
<div class="ui-grid-a">

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,146 @@
.ajax-file-upload-statusbar {
border: 1px solid #0ba1b5;
margin-top: 10px;
width: 420px;
margin-right: 10px;
margin: 5px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
padding: 5px 5px 5px 15px
}
.ajax-file-upload-filename {
width: 300px;
height: auto;
margin: 0 5px 5px 0px;
}
.ajax-file-upload-filesize {
width: 50px;
height: auto;
margin: 0 5px 5px 0px;
display: inline-block;
vertical-align:middle;
}
.ajax-file-upload-progress {
margin: 5px 10px 5px 0px;
position: relative;
width: 250px;
border: 1px solid #ddd;
padding: 1px;
border-radius: 3px;
display: inline-block;
color:#FFFFFF;
}
.ajax-file-upload-bar {
background-color: #0ba1b5;
width: 0;
height: 20px;
border-radius: 3px;
color:#FFFFFF;
}
.ajax-file-upload-percent {
position: absolute;
display: inline-block;
top: 3px;
left: 48%
}
.ajax-file-upload-red {
-moz-box-shadow: inset 0 39px 0 -24px #e67a73;
-webkit-box-shadow: inset 0 39px 0 -24px #e67a73;
box-shadow: inset 0 39px 0 -24px #e67a73;
background-color: #e4685d;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
display: inline-block;
color: #fff;
font-family: arial;
font-size: 13px;
font-weight: normal;
padding: 4px 15px;
text-decoration: none;
text-shadow: 0 1px 0 #b23e35;
cursor: pointer;
vertical-align: top;
margin: 5px 10px 5px 0px;
}
.ajax-file-upload-green {
background-color: #77b55a;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
margin: 0;
padding: 0;
display: inline-block;
color: #fff;
font-family: arial;
font-size: 13px;
font-weight: normal;
padding: 4px 15px;
text-decoration: none;
cursor: pointer;
text-shadow: 0 1px 0 #5b8a3c;
vertical-align: top;
margin: 5px 10px 5px 0px;
}
.ajax-file-upload {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
font-weight: bold;
padding: 15px 20px;
cursor:pointer;
line-height:20px;
height:25px;
margin:0 10px 10px 0;
display: inline-block;
background: #fff;
border: 1px solid #e8e8e8;
color: black;
text-decoration: none;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-moz-box-shadow: 0 2px 0 0 #e8e8e8;
-webkit-box-shadow: 0 2px 0 0 #e8e8e8;
box-shadow: 0 2px 0 0 #e8e8e8;
padding: 6px 10px 4px 10px;
color: #black;
background: #2f8ab9;
border: none;
-moz-box-shadow: 0 2px 0 0 #13648d;
-webkit-box-shadow: 0 2px 0 0 #13648d;
box-shadow: 0 2px 0 0 #13648d;
vertical-align: middle;
}
.ajax-file-upload:hover {
background: #3396c9;
-moz-box-shadow: 0 2px 0 0 #15719f;
-webkit-box-shadow: 0 2px 0 0 #15719f;
box-shadow: 0 2px 0 0 #15719f;
}
.ajax-upload-dragdrop
{
border:2px dotted #A5A5C7;
width:420px;
color: black;
text-align:left;
vertical-align:middle;
padding:10px 10px 0px 10px;
}
.state-hover
{
border:2px solid #A5A5C7;
}
.ajax-file-upload-container
{
margin:20px 0px 20px 0px;
}

View File

@ -0,0 +1,18 @@
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -70,12 +70,16 @@ class Admin {
"setKeepTypeLevel" => array("loggedin" => 1, "isadmin" => 0, "rights" => null),
"setMobileTheme" => array("loggedin" => 1, "isadmin" => 0, "rights" => null),
"setApplyExtrasBtnPos" => array("loggedin" => 1, "isadmin" => 0, "rights" => null),
"setPreferimgdesk" => array("loggedin" => 1, "isadmin" => 0, "rights" => null),
"setPreferimgmobile" => array("loggedin" => 1, "isadmin" => 0, "rights" => null),
"getOrderVolume" => array("loggedin" => 1, "isadmin" => 0, "rights" => null),
"getButtonSizes" => array("loggedin" => 1, "isadmin" => 0, "rights" => null),
"getPreferTableMap" => array("loggedin" => 1, "isadmin" => 0, "rights" => null),
"getKeepTypeLevel" => array("loggedin" => 1, "isadmin" => 0, "rights" => null),
"getMobileTheme" => array("loggedin" => 1, "isadmin" => 0, "rights" => null),
"getApplyExtrasBtnPos" => array("loggedin" => 1, "isadmin" => 0, "rights" => null),
"getPreferimgdesk" => array("loggedin" => 1, "isadmin" => 0, "rights" => null),
"getPreferimgmobile" => array("loggedin" => 1, "isadmin" => 0, "rights" => null),
"isInstalled" => array("loggedin" => 0, "isadmin" => 0, "rights" => null),
"isPrinterServerActive" => array("loggedin" => 1, "isadmin" => 0, "rights" => null),
@ -249,6 +253,14 @@ class Admin {
if ($this->isUserAlreadyLoggedInForPhp()) {
$this->setPreferTableMap($_POST['prefertablemap']);
}
} else if ($command == 'setPreferimgdesk') {
if ($this->isUserAlreadyLoggedInForPhp()) {
$this->setPreferimgdesk($_POST['preferredvalue']);
}
} else if ($command == 'setPreferimgmobile') {
if ($this->isUserAlreadyLoggedInForPhp()) {
$this->setPreferimgmobile($_POST['preferredvalue']);
}
} else if ($command == 'setKeepTypeLevel') {
if ($this->isUserAlreadyLoggedInForPhp()) {
$this->setKeepTypeLevel($_POST['keeptypelevel']);
@ -273,6 +285,14 @@ class Admin {
if ($this->isUserAlreadyLoggedInForPhp()) {
$this->getPreferTableMap();
}
} else if ($command == 'getPreferimgdesk') {
if ($this->isUserAlreadyLoggedInForPhp()) {
$this->getPreferimgdesk();
}
} else if ($command == 'getPreferimgmobile') {
if ($this->isUserAlreadyLoggedInForPhp()) {
$this->getPreferimgmobile();
}
} else if ($command == 'getKeepTypeLevel') {
if ($this->isUserAlreadyLoggedInForPhp()) {
$this->getKeepTypeLevel();
@ -697,6 +717,13 @@ class Admin {
self::getUserValue('prefertablemap',1);
}
function getPreferimgdesk() {
self::getUserValue('preferimgdesk', 0);
}
function getPreferimgmobile() {
self::getUserValue('preferimgmobile', 0);
}
function getKeepTypeLevel() {
self::getUserValue('keeptypelevel',1);
}
@ -751,6 +778,18 @@ class Admin {
function setPreferTableMap($preferValue) {
self::setUserValue('prefertablemap',$preferValue);
}
function setPreferimgdesk($preferValue) {
if ($preferValue == 0) {
$preferValue = null;
}
self::setUserValue('preferimgdesk',$preferValue);
}
function setPreferimgmobile($preferValue) {
if ($preferValue == 0) {
$preferValue = null;
}
self::setUserValue('preferimgmobile',$preferValue);
}
function setKeepTypeLevel($preferValue) {
self::setUserValue('keeptypelevel',$preferValue);
}
@ -838,7 +877,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'"));
$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'"));
$sql = "select name,setting FROM %config% WHERE name in ($configItems)";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute();
@ -853,7 +892,7 @@ class Admin {
$right_changeprice = 0;
$supplyRight = 0;
if ($userLoggedIn) {
$sql = "SELECT language,right_supply,right_changeprice,keeptypelevel,extrasapplybtnpos,right_paydesk FROM %user% WHERE id=?";
$sql = "SELECT language,right_supply,right_changeprice,keeptypelevel,extrasapplybtnpos,right_paydesk,IFNULL(preferimgdesk,0) as preferimgdesk,IFNULL(preferimgmobile,0) as preferimgmobile FROM %user% WHERE id=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($_SESSION['userid']));
$row = $stmt->fetchObject();
@ -872,7 +911,9 @@ class Admin {
"keeptypelevel" => $row->keeptypelevel,
"extrasapplybtnpos" => $row->extrasapplybtnpos,
"isUserLoggedIn" => 1,
"jsonMenuItemsAndVersion" => $jsonMenuItems
"jsonMenuItemsAndVersion" => $jsonMenuItems,
"preferimgdesk" => $row->preferimgdesk,
"preferimgmobile" => $row->preferimgmobile
);
echo json_encode($retVal);
}
@ -955,6 +996,7 @@ class Admin {
$restaurantmode = CommonUtils::getConfigValueStmt($pdo,$stmt,"restaurantmode",1);
$dblog = CommonUtils::getConfigValueStmt($pdo,$stmt,"dblog",1);
$priceinlist = CommonUtils::getConfigValueStmt($pdo,$stmt,"priceinlist",0);
$startprodsearch = CommonUtils::getConfigValueStmt($pdo,$stmt,"startprodsearch",3);
$smtphost = "";
@ -1025,7 +1067,8 @@ class Admin {
"showpayment6" => $showpayment6,
"showpayment7" => $showpayment7,
"showpayment8" => $showpayment8,
"dashslot1" => $dashslot1,"dashslot2" => $dashslot2,"dashslot3" => $dashslot3
"dashslot1" => $dashslot1,"dashslot2" => $dashslot2,"dashslot3" => $dashslot3,
"priceinlist" => $priceinlist
);
@ -1118,7 +1161,7 @@ class Admin {
$view = "preferences.html";
}
echo json_encode($view . "?v=1.3.18");
echo json_encode($view . "?v=1.3.19");
}
}
@ -1249,6 +1292,8 @@ class Admin {
$ret = $speisekartenHandler->manageSpeisekarte($pdo,$speisekarte);
Products::cleanProdImagesTable($pdo);
return $ret;
}
@ -1321,27 +1366,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.3.18"); };
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waitertxt[$lang], "link" => "waiter.html?v=1.3.19"); };
} else {
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.3.18"); };
if ($_SESSION['right_waiter']) { $mainMenu[] = array("name" => $waiterdesktxt[$lang], "link" => "waiterdesktop.php?v=1.3.19"); };
}
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.3.18"); };
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.3.18"); };
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.3.18"); };
if ($_SESSION['right_kitchen']) { $mainMenu[] = array("name" => $kitchentxt[$lang], "link" => "kitchen.html?v=1.3.19"); };
if ($_SESSION['right_bar']) { $mainMenu[] = array("name" => "Bar", "link" => "bar.html?v=1.3.19"); };
if ($_SESSION['right_supply']) { $mainMenu[] = array("name" => $supplytxt[$lang], "link" => "supplydesk.html?v=1.3.19"); };
if ($_SESSION['modus'] == 0) {
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.3.18"); };
if ($_SESSION['right_paydesk']) { $mainMenu[] = array("name" => $paydesktxt[$lang], "link" => "paydesk.html?v=1.3.19"); };
}
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.3.18"); };
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.3.18"); };
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.3.18"); };
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.3.18"); };
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.3.18"); };
if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.3.18"); };
if ($_SESSION['right_dash']) { $mainMenu[] = array("name" => $dashtxt[$lang], "link" => "dash.php?v=1.3.18"); };
if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.3.18"); };
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.3.18");
$mainMenu[] = array("name" => "Hilfe", "link" => "help.php?v=1.3.18");
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.3.18");
if ($_SESSION['right_statistics']) { $mainMenu[] = array("name" => $stattxt[$lang], "link" => "reports.html?v=1.3.19"); };
if ($_SESSION['right_bill']) { $mainMenu[] = array("name" => $bontxt[$lang], "link" => "bill.html?v=1.3.19"); };
if ($_SESSION['right_products']) { $mainMenu[] = array("name" => $prodtxt[$lang], "link" => "products.html?v=1.3.19"); };
if ($_SESSION['right_reservation']) { $mainMenu[] = array("name" => $restxt[$lang], "link" => "reservation.html?v=1.3.19"); };
if ($_SESSION['right_rating']) { $mainMenu[] = array("name" => $ratingtxt[$lang], "link" => "rating.html?v=1.3.19"); };
if ($_SESSION['right_customers']) { $mainMenu[] = array("name" => $customerstxt[$lang], "link" => "customers.html?v=1.3.19"); };
if ($_SESSION['right_dash']) { $mainMenu[] = array("name" => $dashtxt[$lang], "link" => "dash.php?v=1.3.19"); };
if ($_SESSION['right_manager'] || $_SESSION['is_admin'] || $_SESSION['right_closing']) { $mainMenu[] = array("name" => $admintxt[$lang], "link" => "manager.html?v=1.3.19"); };
$mainMenu[] = array("name" => $settingtxt[$lang], "link" => "preferences.html?v=1.3.19");
$mainMenu[] = array("name" => "Hilfe", "link" => "help.php?v=1.3.19");
$mainMenu[] = array("name" => "Feedback", "link" => "feedback.html?v=1.3.19");
}
$mainMenu[] = array("name" => $logout[$lang], "link" => "logout.php");
@ -1349,7 +1394,7 @@ class Admin {
$waiterMessage = $this->getMessage(null, "waitermessage");
}
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.3.18",
$mainMenuAndVersion = array ("version" => "OrderSprinter 1.3.19",
"user" => $currentUser,
"menu" => $mainMenu,
"waitermessage" => $waiterMessage,
@ -1740,6 +1785,7 @@ class Admin {
"restaurantmode" => array("dbcol" => "restaurantmode","checknum" => 0),
"dblog" => array("dbcol" => "dblog","checknum" => 0),
"priceinlist" => array("dbcol" => "priceinlist","checknum" => 0),
"smtphost" => array("dbcol" => "smtphost","checknum" => 0),
"smtpauth" => array("dbcol" => "smtpauth","checknum" => 1),
"smtpuser" => array("dbcol" => "smtpuser","checknum" => 0),
@ -2205,21 +2251,21 @@ class Admin {
}
private function getConfigTablesToBackupRestore() {
return array("logo","work","payment","room","resttables","tablepos","tablemaps","pricelevel","prodtype","products","config","user","comments","histprod","histconfig","histuser","histactions","hist","extras","extrasprods");
return array("logo","work","payment","room","resttables","tablepos","tablemaps","pricelevel","prodtype","prodimages","products","config","user","comments","histprod","histconfig","histuser","histactions","hist","extras","extrasprods");
}
private function getConfigGuestsTablesToBackupRestore() {
return array("logo","work","payment","room","resttables","tablepos","tablemaps","pricelevel","prodtype","products","config","user","comments","histprod","histconfig","histuser","histactions","hist","extras","extrasprods","customers","groups","groupcustomer","vacations");
return array("logo","work","payment","room","resttables","tablepos","tablemaps","pricelevel","prodtype","prodimages","products","config","user","comments","histprod","histconfig","histuser","histactions","hist","extras","extrasprods","customers","groups","groupcustomer","vacations");
}
private function getAllTablesToBackupRestore() {
return array("closing","logo","printjobs","ratings","work","payment","room","resttables","tablepos","tablemaps","pricelevel","prodtype","products","config",
return array("closing","logo","printjobs","ratings","work","payment","room","resttables","tablepos","tablemaps","pricelevel","prodtype","prodimages","products","config",
"user","reservations","customers","groups","groupcustomer","vacations","bill","customerlog","queue","billproducts","hsin","hsout","comments","histprod","histconfig","histuser","histactions","hist",
"extras","extrasprods","queueextras");
}
private function getAllWithLogsTablesToBackupRestore() {
return array("log","closing","logo","printjobs","ratings","work","payment","room","resttables","tablepos","tablemaps","pricelevel","prodtype","products","config",
return array("log","closing","logo","printjobs","ratings","work","payment","room","resttables","tablepos","tablemaps","pricelevel","prodtype","prodimages","products","config",
"user","reservations","customers","groups","groupcustomer","vacations","bill","customerlog","queue","billproducts","hsin","hsout","comments","histprod","histconfig","histuser","histactions","hist",
"extras","extrasprods","queueextras");
}
@ -2331,17 +2377,17 @@ class Admin {
if ($_FILES['userfile']['error'] != UPLOAD_ERR_OK //checks for errors
&& is_uploaded_file($_FILES['userfile']['tmp_name'])) { //checks that file is uploaded
header("Location: ../infopage.html?e=manager.html=Kann_Datei_nicht_laden.");
echo json_encode(array("status" => "ERROR","msg" => "Kann Datei nicht laden."));
exit();
}
if(!file_exists($_FILES['userfile']['tmp_name'])) {
header("Location: ../infopage.html?e=manager.html=Datei_existiert_nicht._Bitte_PHP-Variablen_upload_max_filesize_und_post_max_size_checken.");
echo json_encode(array("status" => "ERROR","msg" => "Datei existiert nicht. Bitte PHP-Variablen upload_max_filesize und post_max_size_checken."));
exit();
}
if(!is_uploaded_file($_FILES['userfile']['tmp_name'])) {
header("Location: ../infopage.html?e=manager.html=Datei_konnte_nicht_hochgeladen_werden.");
echo json_encode(array("status" => "ERROR","msg" => "Datei konnte nicht hochgeladen werden."));
exit();
}
@ -2362,7 +2408,7 @@ class Admin {
$timezone = DbUtils::getTimeZone();
$dbContent = json_decode($content,true);
foreach($dbContent as $table) {
if ($table['table'] == 'config') {
@ -2380,7 +2426,7 @@ class Admin {
if ($aConfigDbPart['fieldname'] == 'setting') {
$bakVersion = base64_decode($aConfigDbPart['value']);
if ($bakVersion != $version) {
header("Location: ../infopage.html?e=manager.html=Backup_hat_die_falsche_Version:_$bakVersion.");
echo json_encode(array("status" => "ERROR","msg" => "Backup hat die falsche Version $bakVersion."));
exit();
}
}
@ -2396,6 +2442,8 @@ class Admin {
$typeIsOnlyConfig = true;
self::doSql($pdo, "SET foreign_key_checks = 0;", null);
foreach($dbContent as $table) {
$tablename = "%" . $table['table'] . "%";
$tablecontent = $table['content'];
@ -2434,6 +2482,7 @@ class Admin {
try {
$stmt->execute($vals);
} catch (Exception $e) {
$errorMsg = $e->getMessage();
}
}
@ -2448,6 +2497,8 @@ class Admin {
HistFiller::insertRestoreHistEntry($pdo);
}
self::doSql($pdo, "SET foreign_key_checks = 1;", null);
$basedb->signLastBillid($pdo);
$setVersion = "update %config% set setting=? where name='version'";
@ -2484,8 +2535,7 @@ class Admin {
session_destroy();
header("Location: ../infopage.html?i=index.html=Import_war_erfolgreich."); /* Browser umleiten */
exit;
echo json_encode(array("status" => "OK"));
}
private function shutdown() {
@ -2507,11 +2557,13 @@ class Admin {
}
private function optimize() {
set_time_limit(60 * 10);
set_time_limit(60 * 20);
try {
$pdo = DButils::openDbAndReturnPdoStatic();
self::doSql($pdo, "OPTIMIZE TABLE %queue%", null);
self::doSql($pdo, "OPTIMIZE TABLE %billproducts%", null);
self::doSql($pdo, "OPTIMIZE TABLE %products%", null);
self::doSql($pdo, "OPTIMIZE TABLE %prodimages%", null);
self::doSql($pdo, "OPTIMIZE TABLE %extrasprods%", null);
self::doSql($pdo, "OPTIMIZE TABLE %queueextras%", null);
self::doSql($pdo, "OPTIMIZE TABLE %log%", null);

View File

@ -30,7 +30,7 @@ return;
// user has manager rights
if($command == 'createClosing') {
$this->createClosing($_POST['remark']);
$this->createClosing($_POST['remark'],$_POST['print']);
} else if ($command == 'remotecreateclosing') {
if (isset($_POST['remoteaccesscode'])) {
if (isset($_POST['remark'])) {
@ -125,14 +125,14 @@ if (is_null($code) || ($code == '')) {
echo json_encode("Remote access code was not configured!");
} else {
if (md5($remoteaccesscode) == $code) {
$this->createClosing($remark);
$this->createClosing($remark,0);
} else {
echo json_encode("Remote access code not correct!");
}
}
}
private function createClosing ($remark) {
private function createClosing ($remark,$doPrint = 1) {
if (is_null($remark)) {
$remark = "";
}
@ -288,7 +288,7 @@ CommonUtils::keepOnlyLastLog($pdo);
// call plugin after completion of closing
CommonUtils::callPlugin($pdo, "createClosing", "after");
echo json_encode(array("status" => "OK", "msg" => $content));
echo json_encode(array("status" => "OK", "msg" => $content, "print" => $doPrint));
}
private function getSumOfBillsWithClosingId($pdo,$closingid,$onlyBar) {
@ -414,8 +414,10 @@ $curClosingDateRow = CommonUtils::getRowSqlObject($pdo, $sql, array($closingid))
$curClosingDate = $curClosingDateRow->closingdate;
Customers::exportLog($pdo, $prevClosingDate, $curClosingDate);
}
private function emailCsvCore($pdo,$closingid,$toEmail,$topic,$startdate,$enddate,$billsum,$billcount) {
$msg = $this->retrieveClosingFromDb($pdo,$closingid, false, true);
$msg = $this->getClosingByTaxAndUser($pdo,$closingid);
$msg .= $this->retrieveClosingFromDb($pdo,$closingid, false, true);
$msg = "Zeitraum: $startdate - $enddate\nBrutto-Summe: $billsum\nEnthaltene Bons: $billcount\n\n" . $msg;
$msg = str_replace("\n", "\r\n", $msg);
@ -511,6 +513,32 @@ echo json_encode(array("status" => "ERROR", "code" => ERROR_INCONSISTENT_DB, "ms
}
}
private function getClosingByTaxAndUser($pdo,$closingid) {
$sql = "SELECT sum(price) as sumprice,%queue%.tax as thetax,username ";
$sql .= "FROM %bill%,%billproducts%,%queue%,%user% ";
$sql .= "WHERE %billproducts%.billid=%bill%.id AND %bill%.closingid=? AND %bill%.userid=%user%.id AND %billproducts%.queueid=%queue%.id ";
$sql .= "AND (%bill%.status is null OR %bill%.status != ?) ";
$sql .= "GROUP BY username,thetax ";
$decpoint = CommonUtils::getConfigValue($pdo, "decpoint", ",");
$result = CommonUtils::fetchSqlAll($pdo, $sql, array($closingid,'c'));
$count = count($result);
if ($count == 0) {
return "";
} else {
$msg = "Umsätze aufgeschlüsselt nach Benutzer und Steuersatz:\n\n";
$msg .= "Benutzer;Steuersatz;Umsatz (Brutto)\n";
foreach($result as $res) {
// sumprice | thetax | username
$tax = str_replace('.', $decpoint, $res['thetax']);
$sumprice = str_replace('.', $decpoint, $res['sumprice']);
$msg .= $res['username'] . ";$tax;$sumprice\n";
}
return $msg . "\n";
}
}
private function retrieveClosingFromDb($pdo,$closingid,$doCsvExport,$onlyresultreturn) {
if(session_id() == '') {
session_start();

View File

@ -113,6 +113,8 @@ class DbUtils {
$out = str_replace("%extrasprods%",$prefix . 'extrasprods', $out);
$out = str_replace("%queueextras%",$prefix . 'queueextras', $out);
$out = str_replace("%ratings%",$prefix . 'ratings', $out);
$out = str_replace("%prodimages%",$prefix . 'prodimages', $out);
return (str_replace("%prodtype%",$prefix . 'prodtype',$out));
}
@ -164,6 +166,8 @@ class DbUtils {
array("col" => 'tablebtnsize', "hist" => 0, "new" => null ,"default" => null, "update" => null),
array("col" => 'prodbtnsize', "hist" => 0, "new" => null ,"default" => null, "update" => null),
array("col" => 'prefertablemap', "hist" => 0, "new" => null ,"default" => 1, "update" => null),
array("col" => 'preferimgdesk', "hist" => 0, "new" => null ,"default" => null, "update" => null),
array("col" => 'preferimgmobile', "hist" => 0, "new" => null ,"default" => null, "update" => null),
array("col" => 'keeptypelevel', "hist" => 0, "new" => null ,"default" => 0, "update" => null),
array("col" => 'extrasapplybtnpos', "hist" => 0, "new" => null ,"default" => 1, "update" => null)
);
@ -186,6 +190,7 @@ class DbUtils {
array("col" => 'sorting', "hist" => 1),
array("col" => 'available', "hist" => 1, "property" => "available"),
array("col" => 'audio', "hist" => 1, "property" => "audio"),
array("col" => 'prodimageid', "hist" => 1, "property" => "prodimageid"),
array("col" => 'removed', "hist" => 0)
);
}

View File

@ -36,7 +36,10 @@ class Products {
function handleCommand($command) {
$cmdArray = array('showDbProducts', 'getMenuLevelUp', 'applySingleProdData', 'createExtra', 'applyExtra', 'upExtra', 'delExtra','sortup','sortdown', 'delproduct', 'reassign', 'applyType', 'delType', 'getSingleProdData', 'getSingleTypeData', 'getPriceLevelInfo','setPriceLevelInfo', 'createProduct','createProdType','addGeneralComment','changeGeneralComment','delGeneralComment','upGeneralComment','downGeneralComment','sortProdAlpha');
$cmdArray = array('showDbProducts', 'getMenuLevelUp', 'applySingleProdData', 'createExtra', 'applyExtra', 'upExtra', 'delExtra','sortup','sortdown', 'delproduct',
'reassign', 'applyType', 'delType', 'getSingleProdData', 'getSingleTypeData', 'getPriceLevelInfo','setPriceLevelInfo', 'createProduct','createProdType',
'addGeneralComment','changeGeneralComment','delGeneralComment','upGeneralComment','downGeneralComment','sortProdAlpha','getOnlyAllProds','loadprodimage',
'deleteImageProdAssignment');
if (in_array($command, $cmdArray)) {
if (!($this->userrights->hasCurrentUserRight('right_products'))) {
if ($command == 'createProdType') {
@ -141,6 +144,22 @@ class Products {
}
} else if ($command == 'sortProdAlpha') {
$this->sortProdAlpha($_POST['refid']);
} else if ($command == 'getOnlyAllProds') {
$this->getOnlyAllProds();
} else if ($command == 'deleteImageProdAssignment') {
$this->deleteImageProdAssignment($_POST['prodid']);
} else if ($command == 'loadprodimage') {
$this->loadprodimage();
} else if ($command == 'getprodimage') {
if ($_GET['prodid']) {
$size = 'h';
if (isset($_GET['size'])) {
$size = $_GET['size'];
}
$this->getprodimage($_GET['prodid'],$size);
} else {
$this->getprodimage(null);
}
} else {
echo "Command not supported.";
}
@ -162,6 +181,7 @@ class Products {
array("id" => "audio", "get" => "IF(audio is not null, audio, '') as audio","histid" => "","histget" => "","histexportname" => "","isnumber" => "0"),
array("id" => "favorite", "get" => "IF(favorite is not null, favorite, '') as favorite","histid" => "prodid","histget" => "favorite","histexportname" => "Favorit","isnumber" => "0", "exportvals" => array("default" => "Nein","1" => "Ja")),
array("id" => "type", "get" => "'p' as type","histid" => "","histget" => "","histexportname" => "","isnumber" => "0"),
array("id" => "prodimageid", "get" => "IF(prodimageid is not null, prodimageid, 0) as prodimageid","histid" => "prodimageid","histget" => "prodimageid","histexportname" => "Bildnr","isnumber" => "1")
);
function getDateValueAsBoolInterpretatedIcon($aValue) {
@ -993,6 +1013,7 @@ class Products {
$pdo = $this->dbutils->openDbAndReturnPdo();
$pdo->beginTransaction();
$this->sorter->delproduct($pdo, $prodid);
self::cleanProdImagesTable($pdo);
$pdo->commit();
echo json_encode("OK");
@ -1064,6 +1085,205 @@ class Products {
}
}
function getOnlyAllProds() {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$sql = "SELECT id,longname,IFNULL(prodimageid,0) as prodimageid FROM %products% WHERE removed is null ORDER BY longname";
$result = CommonUtils::fetchSqlAll($pdo, $sql, null);
$ret = array();
foreach($result as $aProd) {
$chainStr = $this->getTypeHierarchy($pdo, $aProd["id"]);
$ret[] = array("id" => $aProd["id"],"longname" => $aProd["longname"],"prodimageid" => $aProd["prodimageid"],"chain" => $chainStr);
}
echo json_encode(array("status" => "OK","msg" => $ret));
}
private function getTypeHierarchy($pdo,$prodid) {
$chain = array();
$sql = "SELECT category FROM %products% WHERE id=?";
$row = CommonUtils::getRowSqlObject($pdo, $sql, array($prodid));
$cat = $row->category;
if (is_null($cat)) {
return "";
}
do {
$chain[] = $this->getNameOfProdType($pdo,$cat);
$cat = $this->getIdOfReferencedTypeProd($pdo,$cat);
} while (!is_null($cat));
return $this->chainArrayToStr($chain);
}
private function getIdOfReferencedTypeProd($pdo,$currentProdTypeId) {
$sql = "SELECT reference FROM %prodtype% WHERE id=?";
$row = CommonUtils::getRowSqlObject($pdo, $sql, array($currentProdTypeId));
return $row->reference;
}
private function getNameOfProdType($pdo,$prodtypeid) {
$sql = "SELECT name FROM %prodtype% WHERE id=?";
$row = CommonUtils::getRowSqlObject($pdo, $sql, array($prodtypeid));
return $row->name;
}
private function chainArrayToStr($chainArr) {
$ret = array();
for ($i=(count($chainArr)-1);$i>=0;$i--) {
$ret[] = $chainArr[$i];
}
$retStr = implode(" -> ", $ret);
return $retStr;
}
public static function cleanProdImagesTable($pdo) {
$sql = "UPDATE %products% SET prodimageid=? WHERE removed is not null";
CommonUtils::execSql($pdo, $sql, array(null));
$sql = "SELECT id FROM %prodimages%";
$result = CommonUtils::fetchSqlAll($pdo, $sql, null);
foreach($result as $res) {
$prodimageid = $res["id"];
$sql = "SELECT id FROM %products% WHERE prodimageid=?";
$referencingProds = CommonUtils::fetchSqlAll($pdo, $sql, array($prodimageid));
if (count($referencingProds) == 0) {
$sql = "DELETE FROM %prodimages% WHERE id=?";
CommonUtils::execSql($pdo, $sql, array($prodimageid));
}
}
}
private static function outTransImage() {
$name = '../img/trans.png';
$fp = fopen($name, 'rb');
header("Content-Type: image/png");
header("Content-Length: " . filesize($name));
fpassthru($fp);
}
// show image
function getprodimage($prodid,$size='h') {
$imgcol = 'imgh';
if ($size == 'm') {
$imgcol = 'imgm';
} else if ($size == 'l') {
$imgcol = 'imgl';
}
if (is_null($prodid)) {
self::outTransImage();
exit;
} else {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$sql = "SELECT $imgcol as img FROM %prodimages%,%products% WHERE %products%.prodimageid=%prodimages%.id AND %products%.id=?";
$result = CommonUtils::fetchSqlAll($pdo, $sql, array($prodid));
if (count($result) != 1) {
self::outTransImage();
exit;
} else {
$imagedata = base64_decode($result[0]["img"]);
}
}
header("Content-type: image/png");
echo $imagedata;
exit;
}
private static function scaleImg($fn,$maxDim) {
list($width, $height, $type, $attr) = getimagesize($_FILES['imagefile']['tmp_name']);
if ($width > $maxDim || $height > $maxDim) {
$size = getimagesize($fn);
$ratio = $size[0] / $size[1]; // width/height
if ($ratio > 1) {
$width = $maxDim;
$height = $maxDim / $ratio;
} else {
$width = $maxDim * $ratio;
$height = $maxDim;
}
$src = imagecreatefromstring(file_get_contents($fn));
$dst = imagecreatetruecolor($width, $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);
imagedestroy($src);
ob_start();
imagepng($dst); // adjust format as needed
$imagedata = ob_get_contents();
ob_end_clean();
imagedestroy($dst);
return $imagedata;
}
}
private function deleteImageProdAssignment($prodid) {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$pdo->beginTransaction();
try{
$sql = "UPDATE %products% SET prodimageid=? WHERE id=?";
CommonUtils::execSql($pdo, $sql, array(null,$prodid));
self::cleanProdImagesTable($pdo);
HistFiller::updateProdInHist($pdo, $prodid);
$pdo->commit();
} catch (Exception $ex) {
$pdo->rollBack();
}
echo json_encode($prodid);
}
function loadprodimage() {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$prodid = $_GET['prodid'];
if ($_FILES['imagefile']['error'] != UPLOAD_ERR_OK
&& is_uploaded_file($_FILES['imagefile']['tmp_name'])) {
echo json_encode(array("status" => "ERROR","msg" => "Kann Datei nicht laden."));
exit();
}
if(!file_exists($_FILES['imagefile']['tmp_name'])) {
echo json_encode(array("status" => "ERROR","msg" => "Datei existiert nicht. Bitte PHP-Variablen upload_max_filesize und post_max_size_checken."));
exit();
}
if(!is_uploaded_file($_FILES['imagefile']['tmp_name'])) {
echo json_encode(array("status" => "ERROR","msg" => "Datei konnte nicht hochgeladen werden."));
exit();
}
$fn = $_FILES['imagefile']['tmp_name'];
$imageh = self::scaleImg($fn, 300);
$imageBaseh_64 = base64_encode($imageh);
$imagem = self::scaleImg($fn, 150);
$imageBasem_64 = base64_encode($imagem);
$imagel = self::scaleImg($fn, 80);
$imageBasel_64 = base64_encode($imagel);
$pdo->beginTransaction();
try {
$sql = "INSERT INTO %prodimages% (imgh,imgm,imgl) VALUES(?,?,?)";
CommonUtils::execSql($pdo, $sql, array($imageBaseh_64,$imageBasem_64,$imageBasel_64));
$prodimageid = $pdo->lastInsertId();
$sql = "UPDATE %products% SET prodimageid=? WHERE id=?";
CommonUtils::execSql($pdo, $sql, array($prodimageid,$prodid));
HistFiller::updateProdInHist($pdo,$prodid);
self::cleanProdImagesTable($pdo);
} catch (Exception $ex) {
echo json_encode(array("status" => "ERROR","msg" => $ex->getMessage()));
$pdo->rollBack();
exit();
}
$pdo->commit();
echo json_encode(array("status" => "OK"));
}
function sortProdAlpha($typeid) {
$pdo = DbUtils::openDbAndReturnPdoStatic();
$pdo->beginTransaction();

View File

@ -117,7 +117,7 @@ class Updater {
$infoFileLines = $infoFile["msg"];
if (count($infoFileLines) > 1) {
$checkIfNewerVersion = self::isV2Newer('1.3.18',trim($infoFileLines[0]));
$checkIfNewerVersion = self::isV2Newer('1.3.19',trim($infoFileLines[0]));
return array("status" => "OK","msg" => $infoFileLines[0],"url" => $url,"neweravailable" => ($checkIfNewerVersion ? 1 : 0));
} else {
return array("status" => "ERROR","msg" => "Info file not valid","url" => $url);

View File

@ -195,6 +195,4 @@ class HistFiller {
$stmt_insert_hist = $pdo->prepare(DbUtils::substTableAlias($sql_insert_hist));
$stmt_insert_hist->execute(array($currentTime, $action, $refIdForHist));
}
}
?>
}

View File

@ -17,6 +17,7 @@ class ProductEntry {
private $category = null;
private $unit = null;
private $days = null;
private $prodimageid = 0;
private static $PRICE_B = "PreisB";
private static $PRICE_C = "PreisC";
@ -28,6 +29,7 @@ class ProductEntry {
private static $UNIT = "Einheit";
private static $DAYS = "Tage";
private static $ID = "ID";
private static $IMAGEID = "Bildnr";
public function createFromPostData($postData) {
@ -113,6 +115,7 @@ class ProductEntry {
$priceC = str_replace('.', $decpoint, $aProd['priceC']);
$unit = $aProd['unit'];
$days = $aProd['days'];
$prodimageid = $aProd['prodimageid'];
$tax = str_replace('.', $decpoint, $aProd['tax']);
$taxaustria = $aProd['taxaustria'];
$amount = $aProd['amount'];
@ -159,6 +162,9 @@ class ProductEntry {
$extArr[] = self::$ID . ":" . $prodId;
}
if (!is_null($prodimageid) && ($prodimageid != 0)) {
$extArr[] = self::$IMAGEID . ":" . $prodimageid;
}
if (count($extArr) > 0) {
$prodText .= " # " . join("; ", $extArr);
}
@ -180,6 +186,7 @@ class ProductEntry {
$this->priceC = null;
$this->unit = null;
$this->days = null;
$this->prodimageid = null;
$this->shortName = null;
$this->taxaustria = 0;
@ -222,6 +229,11 @@ class ProductEntry {
$this->taxaustria = $value;
} else if ($identifier == self::$AMOUNT) {
$this->amount = $value;
} else if ($identifier == self::$IMAGEID) {
if ($value == 0) {
$value = null;
}
$this->prodimageid = $value;
}
}
}
@ -296,6 +308,9 @@ class ProductEntry {
function getFavorite() {
return $this->favorite;
}
function getProdImageId() {
return (($this->prodimageid == 0) ? null : $this->prodimageid);
}
function toString() {
return "S:" . $this->shortName . " PA:" . $this->priceA . " PB:" . $this->priceB . " PC:" . $this->priceC . " Tax:" . $this->tax . " R:" . $this->longName;
}

View File

@ -369,6 +369,14 @@ class TypeAndProductFileManager {
$prodid = $product->getProdId();
$available = $product->getAvailable();
$favorite = 0;
$prodimageid = $product->getProdImageId();
$sql = "SELECT id FROM %prodimages% WHERE id=?";
$prodimages = CommonUtils::fetchSqlAll($pdo, $sql, array($prodimageid));
if (count($prodimages) == 0) {
$prodimageid = null;
}
$category = $theLeafEntry->getReference();
$sorting = 0;
@ -391,15 +399,15 @@ class TypeAndProductFileManager {
}
}
if ($isNewProd) {
$sql = "INSERT INTO `%products%` (`id`, `shortname`, `longname`, `priceA`, `priceB`, `priceC`, `unit`,`days`, `tax`, `taxaustria`, `amount`, `category`,`available`,`favorite`,`sorting`) VALUES (NULL,";
$sql = $sql . "?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
$sql = "INSERT INTO `%products%` (`id`, `shortname`, `longname`, `priceA`, `priceB`, `priceC`, `unit`,`days`, `tax`, `taxaustria`, `amount`, `category`,`available`,`favorite`,`sorting`,`prodimageid`) VALUES (NULL,";
$sql = $sql . "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($shortName,$longName,$priceA,$priceB,$priceC,$unit,$days,$tax, $taxaustria, $amount, $category,$available,$favorite,$sorting));
$stmt->execute(array($shortName,$longName,$priceA,$priceB,$priceC,$unit,$days,$tax, $taxaustria, $amount, $category,$available,$favorite,$sorting,$prodimageid));
$prodid = $pdo->lastInsertId();
HistFiller::createProdInHist($pdo, $prodid);
} else {
$sql = "SELECT shortname,longname,priceA,priceB,priceC,unit,days,tax,taxaustria,amount,available,category FROM %products% WHERE id=?";
$sql = "SELECT shortname,longname,priceA,priceB,priceC,unit,days,tax,taxaustria,amount,available,category,prodimageid FROM %products% WHERE id=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($prodid));
$row = $stmt->fetchObject();
@ -414,12 +422,13 @@ class TypeAndProductFileManager {
|| ($row->available != $available)
|| ($row->tax != $tax)
|| ($row->taxaustria != $taxaustria)
|| ($row->prodimageid != $prodimageid)
|| ($row->amount != $amount));
if ($changed) {
$sql = "UPDATE %products% SET shortname=?,longname=?,priceA=?,priceB=?,priceC=?,unit=?,days=?,tax=?,taxaustria=?,amount=?,available=?,sorting=? WHERE id=?";
$sql = "UPDATE %products% SET shortname=?,longname=?,priceA=?,priceB=?,priceC=?,unit=?,days=?,tax=?,taxaustria=?,amount=?,available=?,sorting=?,prodimageid=? WHERE id=?";
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
$stmt->execute(array($shortName,$longName,$priceA,$priceB,$priceC,$unit,$days,$tax,$taxaustria,$amount,$available,$sorting,$prodid));
$stmt->execute(array($shortName,$longName,$priceA,$priceB,$priceC,$unit,$days,$tax,$taxaustria,$amount,$available,$sorting,$prodimageid,$prodid));
$changedProdIds[] = $prodid;
} else {
$sql = "UPDATE %products% SET sorting=? WHERE id=?";

View File

@ -120,6 +120,7 @@ class Basedb {
$this->doSQLcatch($pdo, "drop TABLE `%closing%`");
$this->doSQLcatch($pdo, "drop TABLE `%config%`");
$this->doSQLcatch($pdo, "drop TABLE `%products%`");
$this->doSQLcatch($pdo, "drop TABLE `%prodimages%`");
$this->doSQLcatch($pdo, "drop TABLE `%prodtype%`");
$this->doSQLcatch($pdo, "drop TABLE `%pricelevel%`");
$this->doSQLcatch($pdo, "drop TABLE `%tablepos%`");
@ -215,6 +216,8 @@ class Basedb {
`tablebtnsize` INT(1) NULL,
`prodbtnsize` INT(1) NULL,
`prefertablemap` INT(1) NULL,
`preferimgdesk` INT(1) NULL,
`preferimgmobile` INT(1),
`keeptypelevel` INT(1) NOT NULL,
`extrasapplybtnpos` INT(1) NOT NULL,
`failedlogins` VARCHAR(20) NULL,
@ -390,8 +393,10 @@ class Basedb {
`sorting` INT(2) NULL,
`available` INT(2) NOT NULL,
`audio` VARCHAR ( 150 ) NULL,
`prodimageid` INT(10) NULL,
`removed` INT(1) NULL,
FOREIGN KEY (category) REFERENCES %prodtype%(id)
FOREIGN KEY (category) REFERENCES %prodtype%(id),
FOREIGN KEY (prodimageid) REFERENCES %prodimages%(id)
) CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDb ;
";
$this->doSQL($pdo,$sql);
@ -596,6 +601,22 @@ class Basedb {
$this->doSQL($pdo,$sql);
}
function createProdimagesTable($pdo) {
$sql = "
CREATE TABLE `%prodimages%` (
`id` INT (10) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`imgh` MEDIUMBLOB,
`imgm` MEDIUMBLOB,
`imgl` MEDIUMBLOB
) CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDb ;
";
try {
$this->doSQL($pdo,$sql);
} catch (Exception $ex) {
// do nothing - the table may already exist (previous installation etc.
}
}
function createHistTables($pdo) {
$sql = "
CREATE TABLE `%hist%` (
@ -624,6 +645,7 @@ class Basedb {
`available` INT(2) NOT NULL,
`favorite` INT(1) NULL,
`audio` VARCHAR ( 150 ) NULL,
`prodimageid` INT(10) NULL,
`extras` VARCHAR ( 300 ) NULL,
FOREIGN KEY (prodid) REFERENCES %products%(id)
) CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDb
@ -821,6 +843,7 @@ class Basedb {
$this->createTablePosTable($pdo);
$this->createConfigTable($pdo);
$this->createProdTypeTable($pdo);
$this->createProdimagesTable($pdo);
$this->createProductTable($pdo);
$this->createPriceLevelTable($pdo);
$this->createClosingTable($pdo);

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.3.18">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.19">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -49,6 +49,11 @@ var PREF_TM = ["Tischauswahl bevorzugt","Prefer table selection","Prerefir selec
var PREF_TM_GR = ["Grafische Tischkarte","Tablemap as image","Mapa de cartas"];
var PREF_TM_TEXT = ["Text-Buttons","Text buttons","botones con textos"];
var PREF_IMG_DESK = ["Produktbilder in Desktopansicht","Images in Desktop view","Imagenes en vista de desktop"];
var PREF_IMG_MOBILE = ["Produktbilder in Mobilansicht","Images in mobile view","Imagenes en vista de móviles"];
var PREF_NO = ["Nein","No","No"];
var PREF_YES = ["Ja","Yes","Si"];
var PREF_KTL_TITEL = ["Navigation in der Bestellansicht","Order Navigation","Navigacion de ordenar"];
var PREF_KTL = ["Bestellnavigation","Order Navigation","Navigacion de ordenar"];
var PREF_KTL_KEEP = ["Produktkategorie beibehalten","Keep on product type level","No cambiar categoría"];
@ -223,7 +228,12 @@ function setButtonSizes() {
function setPreferTablemap() {
doAjax("GET","php/contenthandler.php?module=admin&command=getPreferTableMap",null,fillPreferTableMap,"Keine Information über Bevorzugung grafischer Tischpläne");
}
function setPreferimgdesk() {
doAjax("GET","php/contenthandler.php?module=admin&command=getPreferimgdesk",null,fillPreferimgdesk,"Keine Information über Bevorzugung Produktbilder in Desktopansicht");
}
function setPreferimgmobile() {
doAjax("GET","php/contenthandler.php?module=admin&command=getPreferimgmobile",null,fillPreferimgmobile,"Keine Information über Bevorzugung Produktbilder in Mobilansicht");
}
function setKeepTypeLevel() {
doAjax("GET","php/contenthandler.php?module=admin&command=getKeepTypeLevel",null,fillKeepTypeLevel,"Keine Information über Bevorzugung Bestellnavigation");
}
@ -265,6 +275,20 @@ function createPreferTMPart(prefervalue,label,labeltxt) {
return html;
}
function createPreferImgPart(prefervalue,label,labeltxt) {
if (prefervalue == null) {
prefervalue = 0;
}
var html = '<div class="ui-field-contain">';
html += '<label for="' + label + '"><span id="' + label + 'txt">' + labeltxt + '</span> :</label>';
html += '<select name="' + label + '" id="' + label + '" data-theme="e">';
html += '<option value="0"' + isSelected(0,prefervalue) + '>' + PREF_NO[l] + '</option>';
html += '<option value="1"' + isSelected(1,prefervalue) + '>' + PREF_YES[l] + '</option>';
html += '</select></div>';
return html;
}
function createPreferKTLPart(prefervalue,label,labeltxt) {
var html = '<div class="ui-field-contain">';
@ -315,6 +339,15 @@ function fillPreferTableMap(preferTablemap) {
$("#prefertmpartbox").trigger("create");
}
function fillPreferimgdesk(preferredVaue) {
$("#preferimgdeskbtnpart").html(createPreferImgPart(preferredVaue, "preferimgdesklabel", PREF_IMG_DESK[l]));
$("#preferimgdeskpartbox").trigger("create");
}
function fillPreferimgmobile(preferredVaue) {
$("#preferimgmobilebtnpart").html(createPreferImgPart(preferredVaue, "preferimgmobilelabel", PREF_IMG_MOBILE[l]));
$("#preferimgmobilepartbox").trigger("create");
}
function fillKeepTypeLevel(preferKeepTypeLevel) {
$("#preferktlbtnpart").html(createPreferKTLPart(preferKeepTypeLevel, "preferktllabel", PREF_KTL[l]));
$("#preferktlpartbox").trigger("create");
@ -402,6 +435,21 @@ function binding() {
binding();
});
$("#preferimgdesklabel").off('change').on('change', function(e) {
var newVal = $("#preferimgdesklabel").find(":selected").val();
$("#preferimgdeskbtnpart").html(createPreferImgPart(newVal, "preferimgdesklabel", PREF_IMG_DESK[l]));
$("#preferimgdeskpartbox").trigger("create");
doAjax("POST","php/contenthandler.php?module=admin&command=setPreferimgdesk",{preferredvalue:newVal},handleGeneralAnswer,"Produktbilder Desktop");
binding();
});
$("#preferimgmobilelabel").off('change').on('change', function(e) {
var newVal = $("#preferimgmobilelabel").find(":selected").val();
$("#preferimgmobilebtnpart").html(createPreferImgPart(newVal, "preferimgmobilelabel", PREF_IMG_MOBILE[l]));
$("#preferimgmobilepartbox").trigger("create");
doAjax("POST","php/contenthandler.php?module=admin&command=setPreferimgmobile",{preferredvalue:newVal},handleGeneralAnswer,"Produktbilder Mobil");
binding();
});
$("#preferktllabel").off('change').on('change', function(e) {
var newVal = $("#preferktllabel").find(":selected").val();
$("#preferktlbtnpart").html(createPreferKTLPart(newVal, "preferktllabel", PREF_KTL[l]));
@ -438,6 +486,8 @@ $(document).on("pageinit", "#pref-page", function () {
setKeepTypeLevel();
setMobileTheme();
setApplyBtnPos();
setPreferimgdesk();
setPreferimgmobile();
binding();
});
@ -496,6 +546,15 @@ $(document).on("pageinit", "#pref-page", function () {
<h3><span id="prefertmtxt">Tischplan</span></h3>
<div id="prefertmbtnpart"></div>
</div>
<div id="preferimgdeskpartbox" data-role="collapsible" data-collapsed="false" data-theme="e" data-content-theme="c" class="noprint">
<h3><span id="preferimgdesktxt">Bilder Desktopansicht</span></h3>
<div id="preferimgdeskbtnpart"></div>
</div>
<div id="preferimgmobilepartbox" data-role="collapsible" data-collapsed="false" data-theme="e" data-content-theme="c" class="noprint">
<h3><span id="preferimgmobiletxt">Bilder Mobilansicht</span></h3>
<div id="preferimgmobilebtnpart"></div>
</div>
<div id="preferktlpartbox" data-role="collapsible" data-collapsed="false" data-theme="e" data-content-theme="c" class="noprint">
<h3><span id="preferktltxt">Bestellnavigation</span></h3>

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.3.18">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.19">
<link rel="stylesheet" href="php/contenthandler.php?module=admin&command=getmobilecss" />
<link rel="stylesheet" href="php/3rdparty/orderstyle/jquery.mobile.icons.min.css" />
@ -17,6 +17,8 @@
<script src="utilities.js"></script>
<script src="elements/product.js"></script>
<script src="elements/extra.js"></script>
<link href="php/3rdparty/hayageek_uploadfile.css" rel="stylesheet">
<script src="php/3rdparty/hayageek_jquery_uploadfile.js"></script>
</head>
<body>
@ -60,6 +62,7 @@ var PROD_MAX_PRICE_EXCEEDED = ["Der Maximalwert für einen Preis wurde überschr
var PROD_COMMENTS = ["Diese Bemerkungen können bei einer Bestellung zu jedem Produkt hinzugefügt werden.","These remarks can be added to each product during ordering.","Durante ordenar estos commentarios se puede añadido a cada producto."];
var PROD_COMMENT = ["Bemerkungen","Remarks","Comentarios"];
var PROD_DEL = ["Löschen","Delete","Removar"];
var PROD_PRODIMAGES = ["Bildzuweisung","Image assignment","Asignar imagenes"];
var PROD_EXTRAS = ["Extras/Optionen","Add-ons/Options","Opciones"];
var PROD_ASS_EXTRAS = ["Zuweisung Extras/Optionen","Assign Add-ons/Options","Asignar opciones"];
var PROD_ENTER_VALUES = ["Leere Datenfelder sind nicht erlaubt","Empty fields not allowed","Necesitamos valores"];
@ -101,6 +104,7 @@ function setLanguage(language) {
$("#prodtitletxt").html(PROD_TITLE[lang]);
$("#assignheader").html(PROD_ASSIGN[lang]);
$("#extrasheader").html(PROD_EXTRAS[lang]);
$("#prodimagesheader").html(PROD_PRODIMAGES[lang]);
$("#menuheader").html(PROD_MENU[lang]);
}
@ -127,9 +131,114 @@ function setLanguage(language) {
$("#menulist").html(tablestructure);
fillListTableWithContent();
$("#menulist").trigger("create");
cmdBinding();
cmdBinding();
getProdsForProdsImageArea();
}
function getProdsForProdsImageArea() {
doAjax("GET","php/contenthandler.php?module=products&command=getOnlyAllProds",null,fillProdImagesArea,null);
}
function fillProdImagesArea(answer) {
if (answer.status != "OK") {
return;
}
var prodlist = answer.msg;
var txt = "";
for (var i=0;i<prodlist.length;i++) {
var aProd = prodlist[i];
txt += createProdImageEntry(aProd.longname,aProd.id,aProd.chain);
}
$("#prodimageslist").html(txt);
$("#prodimageslist").trigger("create");
bindProdImageEntryClick();
}
function createProdImageEntry(longname,prodid,chain) {
var txt = '<div data-role="collapsible" data-content-theme="f" data-theme="c" id="prodimageentry_' + prodid+ '" class="prodimageentry" >';
txt += '<h3>' + toHtml(longname) + '</h3>';
txt += '<p>' + toHtml(chain) + '<p>';
txt += '<span class="imagepart"><img src="php/contenthandler.php?module=products&command=getprodimage&prodid=' + prodid + '" /></span>';
txt += '<div class="uploadarea"></div>';
txt += '<a href="#" data-role="button" data-icon="delete" data-theme="d" data-ajax="false" id="prodimagedelete_' + prodid + '" class="deleteprodimage" >Bildzuordnung entfernen</a> '
txt += "</div>";
return txt;
}
function bindProdImageEntryClick() {
$(".prodimageentry").off("collapsibleexpand").on("collapsibleexpand", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
var id = this.id;
var prodid = id.split('_')[1];
createProdEntryArea(prodid);
});
$(".deleteprodimage").off("click").on("click", function (e) {
e.stopImmediatePropagation();
e.preventDefault();
var prodid = this.id.split('_')[1];
doAjax("POST","php/contenthandler.php?module=products&command=deleteImageProdAssignment",{prodid:prodid},createProdEntryArea,"Aufhebnung der Zuordnung ist fehlgeschlagen");
});
}
function createProdEntryArea(prodid) {
updateProdImagePart(prodid)
var txt = "";
txt = '&nbsp;&nbsp;<div id="restorefilearea_' + prodid + '" >Upload</div>';
txt += '<div id="restorestatus_' + prodid + '" ></div>';
$("#prodimageentry_" + prodid + " .uploadarea").html(txt);
$("#restorefilearea_" + prodid).trigger("create");
initRestoreFileUpload(prodid);
}
function updateProdImagePart(prodid) {
var millis = getMillis();
var src = 'php/contenthandler.php?module=products&command=getprodimage&prodid=' + prodid + "&millis=" + millis;
$("#prodimageentry_" + prodid + " .imagepart img").attr("src", src);
}
function initRestoreFileUpload(prodid) {
var settings = {
url: "php/contenthandler.php?module=products&command=loadprodimage&prodid=" + prodid,
method: "POST",
allowedTypes:"jpg,png,gif",
fileName: "imagefile",
multiple: false,
uploadQueueOrder: 'replace',
showFileCounter: false,
dragDropStr: "<span>Bilddatei</span>",
extErrorStr: " ist nicht erlaubt. Erlaubte Dateiendung: ",
onSuccess:function(files,data,xhr)
{
var answer = jQuery.parseJSON(data);
if (answer.status != "OK") {
alert("Upload war nicht erfolgreich: " + answer.msg);
} else {
//alert("Import war erfolgreich.");
updateProdImagePart(prodid)
}
},
onError: function(files,status,errMsg)
{
$("#restorestatus_" + prodid).html("<font color='red'>Upload fehlgeschlagen</font>");
}
}
$("#restorefilearea_" + prodid).uploadFile(settings);
$("#restorefilearea_" + prodid).trigger("create");
}
function createMenuTableStructure(menu) {
if (menu.status != "OK") {
return;
@ -1044,6 +1153,15 @@ function setLanguage(language) {
</p>
</div>
</div>
<div id="prodimagesarea">
<div data-role="collapsible" data-content-theme="f" data-theme="c">
<h3><span id="prodimagesheader">Bildzuweisung</span></h3>
<p>
<div id=prodimageslist></div>
</p>
</div>
</div>
</div>
<div data-role="footer" data-theme="b" id="thefooterr">

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.3.18">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.19">
<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.3.18">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.19">
<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.3.18">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.19">
<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.3.18">
<link rel="stylesheet" type="text/css" href="css/bestformat.css?v=1.3.19">
<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