Merge pull request #13974 from andreubisquerra/12.0
Update to Auto Order last version in Dolibarr 12
This commit is contained in:
commit
f7e57da9f9
@ -4,6 +4,7 @@ html,body {
|
||||
margin:0;
|
||||
height:100%;
|
||||
width:100%;
|
||||
background-color: #FFF !important;
|
||||
}
|
||||
|
||||
.container{
|
||||
@ -17,14 +18,14 @@ html,body {
|
||||
.phonerow1{
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
height: 40%;
|
||||
height: auto;
|
||||
min-height: 40%;
|
||||
}
|
||||
|
||||
.phonerow2{
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
height: 40%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.phonebuttonsrow{
|
||||
@ -90,7 +91,71 @@ button.publicphonebutton {
|
||||
text-align: center;
|
||||
overflow: visible; /* removes extra width in IE */
|
||||
width:33%;
|
||||
height:90%;
|
||||
height:50px;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.phoneblue{
|
||||
color: #fff;
|
||||
background-color: #428bca;
|
||||
border-color: #357ebd;
|
||||
}
|
||||
|
||||
.phonegreen{
|
||||
color: #fff;
|
||||
background-color: #5cb85c;
|
||||
border-color: #4cae4c;
|
||||
font-size:20px;
|
||||
text-align:center;
|
||||
width:20px;
|
||||
}
|
||||
|
||||
.phonetable{
|
||||
width:130px;
|
||||
}
|
||||
|
||||
.phoneqty{
|
||||
font-size:24px;
|
||||
font-weight: bold;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.phonered{
|
||||
color: #fff;
|
||||
background-color: #dc3545;
|
||||
border-color: #dc3545;
|
||||
font-size:20px;
|
||||
text-align:center;
|
||||
width:20px;
|
||||
}
|
||||
|
||||
.phoneorange{
|
||||
color: #fff;
|
||||
background-color: #f0ad4e;
|
||||
border-color: #eea236;
|
||||
}
|
||||
|
||||
.total{
|
||||
width:100% !important;
|
||||
font-size:24px;
|
||||
}
|
||||
|
||||
.width24{
|
||||
font-size:24px;
|
||||
}
|
||||
|
||||
.leftcat{
|
||||
margin-top:15px;
|
||||
float:left;
|
||||
width: 50%;
|
||||
text-align:center;
|
||||
height:150px;;
|
||||
overflow:hidden;
|
||||
margin-bottom:5px;
|
||||
font-size:18px;
|
||||
color:#5B5858;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@ -107,3 +172,28 @@ button.publicphonebutton2 {
|
||||
font-weight: bold;
|
||||
padding: 8px 16px;
|
||||
}
|
||||
|
||||
.div-table-responsive-no-min{
|
||||
margin-top:20px;
|
||||
}
|
||||
|
||||
.comment {
|
||||
float: left;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.comment-text-area {
|
||||
float: left;
|
||||
width: 80%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.textinput {
|
||||
float: left;
|
||||
width: 100%;
|
||||
min-height: 75px;
|
||||
outline: none;
|
||||
resize: none;
|
||||
border: 1px solid grey;
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
|
||||
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
|
||||
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
|
||||
|
||||
require '../../main.inc.php'; // Load $user and permissions
|
||||
if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) require '../../main.inc.php'; // Load $user and permissions
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$w = GETPOST('w', 'int');
|
||||
@ -60,7 +60,7 @@ if ($query == "cat")
|
||||
{
|
||||
$filename = $obj['photo'];
|
||||
}
|
||||
$file = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename);
|
||||
$file = DOL_URL_ROOT.'/viewimage.php?cache=1&publictakepos=1&modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename);
|
||||
header('Location: '.$file);
|
||||
exit;
|
||||
}
|
||||
@ -72,15 +72,20 @@ elseif ($query == "pro")
|
||||
|
||||
$objProd = new Product($db);
|
||||
$objProd->fetch($id);
|
||||
$image = $objProd->show_photos('product', $conf->product->multidir_output[$entity], 'small', 1);
|
||||
$image = $objProd->show_photos('product', $conf->product->multidir_output[$objProd->entity], 'small', 1);
|
||||
|
||||
preg_match('@src="([^"]+)"@', $image, $match);
|
||||
$file = array_pop($match);
|
||||
if ($file == "") header('Location: ../../public/theme/common/nophoto.png');
|
||||
else header('Location: '.$file.'&cache=1');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($file == "") {
|
||||
header('Location: ../../public/theme/common/nophoto.png');
|
||||
} else {
|
||||
if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||
header('Location: '.$file.'&cache=1');
|
||||
} else {
|
||||
header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// TODO We don't need this. Size of image must be defined on HTML page, image must NOT be resize when downloaded.
|
||||
|
||||
// The file
|
||||
|
||||
@ -70,10 +70,12 @@ if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout ==
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
|
||||
$arrayofcss = array(
|
||||
'/takepos/css/pos.css.php',
|
||||
'/takepos/js/jquery.colorbox-min.js'
|
||||
);
|
||||
$arrayofjs = array('/takepos/js/jquery.colorbox-min.js');
|
||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
||||
print '<link rel="stylesheet" href="css/pos.css.php">
|
||||
<link rel="stylesheet" href="css/colorbox.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript" src="js/jquery.colorbox-min.js"></script>';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -863,6 +865,9 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT)
|
||||
print $langs->trans('Place')." <b>".$label."</b> - ";
|
||||
print $langs->trans('Floor')." <b>".$floor."</b> - ";
|
||||
}
|
||||
elseif (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) print $mysoc->name;
|
||||
elseif ($mobilepage == "cats") print $langs->trans('Category');
|
||||
elseif ($mobilepage == "products") print $langs->trans('Label');
|
||||
}
|
||||
// In phone version only show when is invoice page
|
||||
if ($mobilepage == "invoice" || $mobilepage == "") {
|
||||
@ -877,6 +882,7 @@ if ($_SESSION["basiclayout"] != 1)
|
||||
print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
|
||||
print '<td class="linecolht right nowraponall">'.$langs->trans('TotalTTCShort').'</td>';
|
||||
}
|
||||
elseif ($mobilepage == "invoice") print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -889,12 +895,14 @@ if ($_SESSION["basiclayout"] == 1)
|
||||
$categories = $categorie->get_full_arbo('product');
|
||||
$htmlforlines = '';
|
||||
foreach ($categories as $row) {
|
||||
$htmlforlines .= '<tr class="drag drop oddeven posinvoiceline';
|
||||
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '<div class="leftcat';
|
||||
else $htmlforlines .= '<tr class="drag drop oddeven posinvoiceline';
|
||||
$htmlforlines .= '" onclick="LoadProducts('.$row['id'].');">';
|
||||
$htmlforlines .= '<td class="left">';
|
||||
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '<img class="imgwrapper" width="33%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=cat&query=cat&id='.$row['id'].'"><br>';
|
||||
else $htmlforlines .= '<td class="left">';
|
||||
$htmlforlines .= $row['label'];
|
||||
$htmlforlines .= '</td>';
|
||||
$htmlforlines .= '</tr>'."\n";
|
||||
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '</div>'."\n";
|
||||
else $htmlforlines .= '</td></tr>'."\n";
|
||||
}
|
||||
$htmlforlines .= '</table>';
|
||||
$htmlforlines .= '</table>';
|
||||
@ -910,12 +918,20 @@ if ($_SESSION["basiclayout"] == 1)
|
||||
$prods = $object->getObjectsInCateg("product");
|
||||
$htmlforlines = '';
|
||||
foreach ($prods as $row) {
|
||||
$htmlforlines .= '<tr class="drag drop oddeven posinvoiceline';
|
||||
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '<div class="leftcat';
|
||||
else $htmlforlines .= '<tr class="drag drop oddeven posinvoiceline';
|
||||
$htmlforlines .= '" onclick="AddProduct(\''.$place.'\', '.$row->id.')">';
|
||||
$htmlforlines .= '<td class="left">';
|
||||
$htmlforlines .= $row->label;
|
||||
$htmlforlines .= '<div class="right">'.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).'</div>';
|
||||
$htmlforlines .= '</tr>'."\n";
|
||||
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||
$htmlforlines .= '<img class="imgwrapper" width="33%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=pro&query=pro&id='.$row->id.'"><br>';
|
||||
$htmlforlines .= $row->label.''.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency);
|
||||
$htmlforlines .= '</div>'."\n";
|
||||
}
|
||||
else {
|
||||
$htmlforlines .= '<td class="left">';
|
||||
$htmlforlines .= $row->label;
|
||||
$htmlforlines .= '<div class="right">'.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).'</div>';
|
||||
$htmlforlines .= '</tr>'."\n";
|
||||
}
|
||||
}
|
||||
$htmlforlines .= '</table>';
|
||||
print $htmlforlines;
|
||||
@ -991,7 +1007,7 @@ if ($placeid > 0)
|
||||
}
|
||||
$htmlforlines .= '" id="'.$line->id.'">';
|
||||
$htmlforlines .= '<td class="left">';
|
||||
if ($_SESSION["basiclayout"] == 1) $htmlforlines .= $line->qty." x ";
|
||||
if ($_SESSION["basiclayout"] == 1) $htmlforlines .= '<span class="phoneqty">'.$line->qty."</span> x ";
|
||||
//if ($line->product_label) $htmlforlines.= '<b>'.$line->product_label.'</b>';
|
||||
if (isset($line->product_type))
|
||||
{
|
||||
@ -1026,7 +1042,8 @@ if ($placeid > 0)
|
||||
}
|
||||
}
|
||||
if (!empty($line->array_options['options_order_notes'])) $htmlforlines .= "<br>(".$line->array_options['options_order_notes'].")";
|
||||
if ($_SESSION["basiclayout"] != 1)
|
||||
if ($_SESSION["basiclayout"] == 1) $htmlforlines .= '</td><td class="right phonetable"><button type="button" onclick="SetQty(place, '.$line->rowid.', '.($line->qty-1).');" class="publicphonebutton2 phonered">-</button> <button type="button" onclick="SetQty(place, '.$line->rowid.', '.($line->qty+1).');" class="publicphonebutton2 phonegreen">+</button>';
|
||||
if ($_SESSION["basiclayout"] != 1)
|
||||
{
|
||||
$moreinfo = '';
|
||||
$moreinfo .= $langs->transcountry("TotalHT", $mysoc->country_code).': '.price($line->total_ht);
|
||||
|
||||
@ -39,10 +39,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
|
||||
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||
// Decode place if it is an order from customer phone
|
||||
$key = GETPOST('key');
|
||||
$place=dol_decode($key);
|
||||
$place = GETPOSTISSET("key") ? dol_decode(GETPOST('key')) : GETPOST('place', 'aZ09');
|
||||
} else {
|
||||
$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant
|
||||
}
|
||||
else $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$setterminal = GETPOST('setterminal', 'int');
|
||||
$idproduct = GETPOST('idproduct', 'int');
|
||||
@ -62,28 +62,54 @@ if (empty($user->rights->takepos->run) && !defined('INCLUDE_PHONEPAGE_FROM_PUBLI
|
||||
* View
|
||||
*/
|
||||
|
||||
// Title
|
||||
$title = 'TakePOS - Dolibarr '.DOL_VERSION;
|
||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
|
||||
$head = '<meta name="apple-mobile-web-app-title" content="TakePOS"/>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
|
||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
||||
|
||||
print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/takepos/css/phone.css">';
|
||||
|
||||
if ($action=="productinfo"){
|
||||
if ($action == "productinfo") {
|
||||
$prod = new Product($db);
|
||||
$prod->fetch($idproduct);
|
||||
print "<b>".$prod->label."</b><br>";
|
||||
print '<img class="imgwrapper" width="60%" src="'.DOL_URL_ROOT.'/takepos/genimg/index.php?query=pro&id='.$idproduct.'">';
|
||||
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="AddProductConfirm(place, '.$idproduct.');">'.$langs->trans('Add').'</button>';
|
||||
print "<br><b>".$prod->label."</b><br>";
|
||||
print '<img class="imgwrapper" width="60%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=pro&query=pro&id='.$idproduct.'">';
|
||||
print "<br>".$prod->description;
|
||||
print "<br><b>".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency)."</b>";
|
||||
print '<br>';
|
||||
print '<button type="button" class="publicphonebutton2" onclick="AddProductConfirm(place, '.$idproduct.');">'.$langs->trans('Add').'</button>';
|
||||
} elseif ($action == "publicpreorder") {
|
||||
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="TakeposPrintingOrder();">'.$langs->trans('Confirm').'</button>';
|
||||
print "<br><br>";
|
||||
print '<div class="comment">
|
||||
<textarea class="textinput" placeholder="'.$langs->trans('Note').'"></textarea>
|
||||
</div>';
|
||||
print '<br>';
|
||||
} elseif ($action == "publicpayment") {
|
||||
$langs->loadLangs(array("orders"));
|
||||
print '<h1>'.$langs->trans('StatusOrderDelivered').'</h1>';
|
||||
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="CheckPlease();">'.$langs->trans('Payment').'</button>';
|
||||
print '<br>';
|
||||
}
|
||||
elseif ($action=="editline"){
|
||||
elseif ($action == "checkplease") {
|
||||
if (GETPOSTISSET("payment")) {
|
||||
print '<h1>'.$langs->trans('StatusOrderDelivered').'</h1>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
$printer = new dolReceiptPrinter($db);
|
||||
$printer->initPrinter($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$_SESSION["takeposterminal"]});
|
||||
$printer->printer->feed();
|
||||
$printer->printer->feed();
|
||||
$printer->printer->text($langs->trans('IM'));
|
||||
$printer->printer->feed();
|
||||
$printer->printer->text($langs->trans('Place').": ".$place);
|
||||
$printer->printer->feed();
|
||||
$printer->printer->text($langs->trans('Payment').": ".$langs->trans(GETPOST('payment', 'alpha')));
|
||||
$printer->printer->feed();
|
||||
$printer->printer->feed();
|
||||
$printer->printer->feed();
|
||||
$printer->printer->feed();
|
||||
$printer->printer->feed();
|
||||
$printer->close();
|
||||
} else {
|
||||
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="CheckPlease(\'Cash\');">'.$langs->trans('Cash').'</button>';
|
||||
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="CheckPlease(\'CreditCard\');">'.$langs->trans('CreditCard').'</button>';
|
||||
print '<br>';
|
||||
}
|
||||
} elseif ($action == "editline") {
|
||||
$placeid = GETPOST('placeid', 'int');
|
||||
$selectedline = GETPOST('selectedline', 'int');
|
||||
$invoice = new Facture($db);
|
||||
@ -95,17 +121,25 @@ elseif ($action=="editline"){
|
||||
$prod = new Product($db);
|
||||
$prod->fetch($line->fk_product);
|
||||
print "<b>".$prod->label."</b><br>";
|
||||
print '<img class="imgwrapper" width="60%" src="genimg/index.php?query=pro&id='.$line->fk_product.'">';
|
||||
print '<img class="imgwrapper" width="60%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=pro&query=pro&id='.$line->fk_product.'">';
|
||||
print "<br>".$prod->description;
|
||||
print "<br><b>".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency)."</b>";
|
||||
print '<br>';
|
||||
print '<button type="button" class="publicphonebutton2" onclick="SetQty(place, '.$selectedline.', '.($line->qty-1).');">-</button>';
|
||||
print '<button type="button" class="publicphonebutton2" onclick="SetQty(place, '.$selectedline.', '.($line->qty+1).');">+</button>';
|
||||
print '<button type="button" class="publicphonebutton2" onclick="SetNote(place, '.$selectedline.');">'.$langs->trans('Note').'</button>';
|
||||
print '<button type="button" class="publicphonebutton2 phonered width24" onclick="SetQty(place, '.$selectedline.', '.($line->qty - 1).');">-</button>';
|
||||
print '<button type="button" class="publicphonebutton2 phonegreen width24" onclick="SetQty(place, '.$selectedline.', '.($line->qty + 1).');">+</button>';
|
||||
print '<button type="button" class="publicphonebutton2 phoneblue width24" onclick="SetNote(place, '.$selectedline.');">'.$langs->trans('Note').'</button>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// Title
|
||||
$title = 'TakePOS - Dolibarr '.DOL_VERSION;
|
||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
|
||||
$head = '<meta name="apple-mobile-web-app-title" content="TakePOS"/>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
|
||||
$arrayofcss = array('/takepos/css/phone.css');
|
||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
||||
?>
|
||||
<script language="javascript">
|
||||
<?php
|
||||
@ -194,6 +228,11 @@ function AddProduct(placeid, productid){
|
||||
?>
|
||||
}
|
||||
|
||||
function PublicPreOrder(){
|
||||
$("#phonediv1").load("auto_order.php?action=publicpreorder&place="+place, function() {
|
||||
});
|
||||
}
|
||||
|
||||
function AddProductConfirm(placeid, productid){
|
||||
place=placeid;
|
||||
<?php
|
||||
@ -209,6 +248,9 @@ function AddProductConfirm(placeid, productid){
|
||||
}
|
||||
|
||||
function SetQty(place, selectedline, qty){
|
||||
<?php
|
||||
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||
?>
|
||||
if (qty==0){
|
||||
$("#phonediv2").load("auto_order.php?mobilepage=invoice&action=deleteline&place="+place+"&idline="+selectedline, function() {
|
||||
});
|
||||
@ -217,11 +259,26 @@ function SetQty(place, selectedline, qty){
|
||||
$("#phonediv2").load("auto_order.php?mobilepage=invoice&action=updateqty&place="+place+"&idline="+selectedline+"&number="+qty, function() {
|
||||
});
|
||||
}
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
?>
|
||||
if (qty==0){
|
||||
$("#phonediv2").load("invoice.php?mobilepage=invoice&action=deleteline&place="+place+"&idline="+selectedline, function() {
|
||||
});
|
||||
}
|
||||
else{
|
||||
$("#phonediv2").load("invoice.php?mobilepage=invoice&action=updateqty&place="+place+"&idline="+selectedline+"&number="+qty, function() {
|
||||
});
|
||||
}
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
LoadCats();
|
||||
}
|
||||
|
||||
function SetNote(place, selectedline){
|
||||
var note = prompt("<?php $langs->trans('Note'); ?>", "Harry Potter");
|
||||
var note = prompt("<?php $langs->trans('Note'); ?>", "");
|
||||
$("#phonediv2").load("auto_order.php?mobilepage=invoice&action=updateqty&place="+place+"&idline="+selectedline+"&number="+qty, function() {
|
||||
});
|
||||
LoadCats();
|
||||
@ -262,11 +319,13 @@ function LoadPlacesList(){
|
||||
function TakeposPrintingOrder(){
|
||||
console.log("TakeposPrintingOrder");
|
||||
<?php
|
||||
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')){
|
||||
echo '$("#phonediv2").load("auto_order.php?action=order&place="+place, function() {
|
||||
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||
echo '$("#phonediv2").load("auto_order.php?action=order&mobilepage=order&place="+place, function() {
|
||||
});';
|
||||
echo '$("#phonediv1").load("auto_order.php?action=publicpayment&place="+place, function() {
|
||||
});';
|
||||
}
|
||||
else{
|
||||
else {
|
||||
echo '$("#phonediv2").load("invoice.php?action=order&place="+place, function() {
|
||||
});';
|
||||
}
|
||||
@ -277,17 +336,21 @@ function Exit(){
|
||||
window.location.href='../user/logout.php';
|
||||
}
|
||||
|
||||
function CheckPlease(){
|
||||
console.log("Request the check to the waiter");
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "<?php print dol_buildpath('/takepos/ajax/ajax.php', 1).'?action=thecheck&=place='.$place; ?>",
|
||||
});
|
||||
function CheckPlease(payment){
|
||||
if (payment==undefined){
|
||||
$("#phonediv1").load("auto_order.php?action=checkplease&place="+place, function() {
|
||||
});
|
||||
}
|
||||
else{
|
||||
console.log("Request the check to the waiter");
|
||||
$("#phonediv1").load("auto_order.php?action=checkplease&place=<?php echo $place;?>&payment="+payment, function() {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<body style="overflow: hidden; background-color:#D1D1D1;">
|
||||
<body style="background-color:#D1D1D1;">
|
||||
<?php
|
||||
if ($conf->global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print '<div class="dialog-info-takepos-terminal" id="dialog-info" title="TakePOS">'.$langs->trans('TerminalSelect').'</div>';
|
||||
?>
|
||||
@ -300,19 +363,19 @@ function CheckPlease(){
|
||||
print '<button type="button" class="phonebutton" onclick="TakeposPrintingOrder();">'.strtoupper(substr($langs->trans('Order'), 0, 3)).'</button>';
|
||||
print '<button type="button" class="phonebutton" onclick="Exit();">'.strtoupper(substr($langs->trans('Logout'), 0, 3)).'</button>';
|
||||
}
|
||||
else{
|
||||
print '<button type="button" class="publicphonebutton" onclick="LoadCats();">'.strtoupper(substr($langs->trans('Categories'), 0, 5)).'</button>';
|
||||
print '<button type="button" class="publicphonebutton" onclick="TakeposPrintingOrder();">'.strtoupper(substr($langs->trans('Order'), 0, 5)).'</button>';
|
||||
print '<button type="button" class="publicphonebutton" onclick="CheckPlease();">'.strtoupper(substr($langs->trans('Payment'), 0, 5)).'</button>';
|
||||
else {
|
||||
print '<button type="button" class="publicphonebutton phoneblue" onclick="LoadCats();">'.strtoupper(substr($langs->trans('Categories'), 0, 5)).'</button>';
|
||||
print '<button type="button" class="publicphonebutton phoneorange" onclick="PublicPreOrder();">'.strtoupper(substr($langs->trans('Order'), 0, 5)).'</button>';
|
||||
print '<button type="button" class="publicphonebutton phonegreen" onclick="CheckPlease();">'.strtoupper(substr($langs->trans('Payment'), 0, 5)).'</button>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="row1">
|
||||
<div id="phonediv1" class="phonediv1"></div>
|
||||
</div>
|
||||
<div class="row2">
|
||||
<div class="phonerow2">
|
||||
<div id="phonediv2" class="phonediv2"></div>
|
||||
</div>
|
||||
<div class="phonerow1">
|
||||
<div id="phonediv1" class="phonediv1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<?php
|
||||
|
||||
@ -33,4 +33,5 @@ $_SESSION["takeposterminal"] = 1;
|
||||
|
||||
define('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE', 1);
|
||||
if (GETPOSTISSET("mobilepage")) require '../invoice.php';
|
||||
elseif (GETPOSTISSET("genimg")) require DOL_DOCUMENT_ROOT.'/takepos/genimg/index.php';
|
||||
else require '../phone.php';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user