FIX MVC and missing http header in TakePOS
This commit is contained in:
parent
8e15f95890
commit
0258da808c
@ -58,11 +58,14 @@ if (empty($user->rights->takepos->run)) {
|
|||||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
|
||||||
$hookmanager->initHooks(array('takeposproductsearch')); // new context for product search hooks
|
$hookmanager->initHooks(array('takeposproductsearch')); // new context for product search hooks
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'getProducts') {
|
if ($action == 'getProducts') {
|
||||||
|
top_httphead('application/json');
|
||||||
|
|
||||||
$object = new Categorie($db);
|
$object = new Categorie($db);
|
||||||
if ($category == "supplements") {
|
if ($category == "supplements") {
|
||||||
$category = getDolGlobalInt('TAKEPOS_SUPPLEMENTS_CATEGORY');
|
$category = getDolGlobalInt('TAKEPOS_SUPPLEMENTS_CATEGORY');
|
||||||
@ -88,9 +91,11 @@ if ($action == 'getProducts') {
|
|||||||
}
|
}
|
||||||
echo json_encode($res);
|
echo json_encode($res);
|
||||||
} else {
|
} else {
|
||||||
echo 'Failed to load category with id='.$category;
|
echo 'Failed to load category with id='.dol_escape_htmltag($category);
|
||||||
}
|
}
|
||||||
} elseif ($action == 'search' && $term != '') {
|
} elseif ($action == 'search' && $term != '') {
|
||||||
|
top_httphead('application/json');
|
||||||
|
|
||||||
// Change thirdparty with barcode
|
// Change thirdparty with barcode
|
||||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
|
|
||||||
@ -329,8 +334,8 @@ if ($action == 'getProducts') {
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php';
|
||||||
$printer = new dolReceiptPrinter($db);
|
$printer = new dolReceiptPrinter($db);
|
||||||
// check printer for terminal
|
// check printer for terminal
|
||||||
if ($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$term} > 0) {
|
if (getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) {
|
||||||
$printer->initPrinter($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$term});
|
$printer->initPrinter(getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term));
|
||||||
// open cashdrawer
|
// open cashdrawer
|
||||||
$printer->pulse();
|
$printer->pulse();
|
||||||
$printer->close();
|
$printer->close();
|
||||||
@ -340,12 +345,14 @@ if ($action == 'getProducts') {
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
$printer = new dolReceiptPrinter($db);
|
$printer = new dolReceiptPrinter($db);
|
||||||
// check printer for terminal
|
// check printer for terminal
|
||||||
if (($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$term} > 0 || $conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") && $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$term} > 0) {
|
if ((getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0 || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") && getDolGlobalInt('TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$term) > 0) {
|
||||||
$object = new Facture($db);
|
$object = new Facture($db);
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$ret = $printer->sendToPrinter($object, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$term}, $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$term});
|
$ret = $printer->sendToPrinter($object, getDolGlobalString('TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$term), getDolGlobalString('TAKEPOS_PRINTER_TO_USE'.$term));
|
||||||
}
|
}
|
||||||
} elseif ($action == 'getInvoice') {
|
} elseif ($action == 'getInvoice') {
|
||||||
|
top_httphead('application/json');
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
|
||||||
$object = new Facture($db);
|
$object = new Facture($db);
|
||||||
@ -359,5 +366,5 @@ if ($action == 'getProducts') {
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php';
|
||||||
$printer = new dolReceiptPrinter($db);
|
$printer = new dolReceiptPrinter($db);
|
||||||
$printer->sendToPrinter($object, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$term}, $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$term});
|
$printer->sendToPrinter($object, getDolGlobalString('TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$term), getDolGlobalString('TAKEPOS_PRINTER_TO_USE'.$term));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,6 +81,8 @@ if ($action == "getTables") {
|
|||||||
}
|
}
|
||||||
$rows[] = $row;
|
$rows[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
top_httphead('application/json');
|
||||||
echo json_encode($rows);
|
echo json_encode($rows);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -119,13 +121,18 @@ if ($action == "add") {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Title
|
// Title
|
||||||
|
$head = '';
|
||||||
$title = 'TakePOS - Dolibarr '.DOL_VERSION;
|
$title = 'TakePOS - Dolibarr '.DOL_VERSION;
|
||||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
||||||
$title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
|
$title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
|
||||||
}
|
}
|
||||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
$arrayofcss = array('/takepos/css/pos.css.php?a=xxx');
|
||||||
|
|
||||||
|
top_htmlhead($head, $title, 0, 0, '', $arrayofcss);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<link rel="stylesheet" href="css/pos.css.php?a=xxx">
|
<body style="overflow: hidden">
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
div.tablediv{
|
div.tablediv{
|
||||||
background-image:url(img/table.gif);
|
background-image:url(img/table.gif);
|
||||||
@ -205,8 +212,7 @@ $( document ).ready(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
|
||||||
<body style="overflow: hidden">
|
|
||||||
<?php if ($user->admin) {?>
|
<?php if ($user->admin) {?>
|
||||||
<div style="position: absolute; left: 0.1%; top: 0.8%; width:8%; height:11%;">
|
<div style="position: absolute; left: 0.1%; top: 0.8%; width:8%; height:11%;">
|
||||||
<?php if ($mode == "edit") {?>
|
<?php if ($mode == "edit") {?>
|
||||||
@ -233,5 +239,6 @@ $( document ).ready(function() {
|
|||||||
</h1>
|
</h1>
|
||||||
</center>
|
</center>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -78,6 +78,7 @@ if ($invoice->socid > 0) {
|
|||||||
}
|
}
|
||||||
$vatRateDefault = get_default_tva($mysoc, $soc);
|
$vatRateDefault = get_default_tva($mysoc, $soc);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -87,6 +88,8 @@ $arrayofjs = array();
|
|||||||
|
|
||||||
top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss);
|
top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss);
|
||||||
?>
|
?>
|
||||||
|
<body>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var vatRate = '<?php echo dol_escape_js($vatRateDefault); ?>';
|
var vatRate = '<?php echo dol_escape_js($vatRateDefault); ?>';
|
||||||
|
|
||||||
@ -116,8 +119,7 @@ top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss);
|
|||||||
$('#desc').focus()
|
$('#desc').focus()
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<br>
|
<br>
|
||||||
<center>
|
<center>
|
||||||
<input type="text" id="desc" name="desc" class="takepospay" style="width:40%;" placeholder="<?php echo $langs->trans('Description'); ?>">
|
<input type="text" id="desc" name="desc" class="takepospay" style="width:40%;" placeholder="<?php echo $langs->trans('Description'); ?>">
|
||||||
|
|||||||
@ -15,6 +15,8 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// This page return an image of a photo
|
||||||
|
|
||||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
||||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
|
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
|
||||||
if (!defined('NOREQUIRESOC')) {
|
if (!defined('NOREQUIRESOC')) {
|
||||||
@ -74,6 +76,7 @@ if ($query == "cat") {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
header('Location: ../../public/theme/common/nophoto.png');
|
header('Location: ../../public/theme/common/nophoto.png');
|
||||||
|
exit;
|
||||||
} elseif ($query == "pro") {
|
} elseif ($query == "pro") {
|
||||||
require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
|
require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
|
||||||
|
|
||||||
@ -86,15 +89,18 @@ if ($query == "cat") {
|
|||||||
$file = array_pop($match);
|
$file = array_pop($match);
|
||||||
if ($file == "") {
|
if ($file == "") {
|
||||||
header('Location: ../../public/theme/common/nophoto.png');
|
header('Location: ../../public/theme/common/nophoto.png');
|
||||||
|
exit;
|
||||||
} else {
|
} else {
|
||||||
if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||||
header('Location: '.$file.'&cache=1');
|
header('Location: '.$file.'&cache=1');
|
||||||
|
exit;
|
||||||
} else {
|
} else {
|
||||||
header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product');
|
header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product');
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO We don't need this. Size of image must be defined on HTML page, image must NOT be resize when downloaded.
|
// TODO We don't need this. Size of image must be defined on HTML page, image must NOT be resized when downloaded.
|
||||||
|
|
||||||
// The file
|
// The file
|
||||||
$filename = $query.".jpg";
|
$filename = $query.".jpg";
|
||||||
|
|||||||
@ -15,6 +15,8 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// This page return an image of a QR code
|
||||||
|
|
||||||
if (!defined("NOLOGIN")) {
|
if (!defined("NOLOGIN")) {
|
||||||
define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
|
define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
|
||||||
}
|
}
|
||||||
@ -46,6 +48,13 @@ require '../../core/modules/barcode/doc/tcpdfbarcode.modules.php';
|
|||||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
// The buildBarCode does not include the http headers but this is a page that just return an image.
|
||||||
|
|
||||||
if (GETPOSTISSET("key")) {
|
if (GETPOSTISSET("key")) {
|
||||||
$key = GETPOST('key');
|
$key = GETPOST('key');
|
||||||
$module = new modTcpdfbarcode();
|
$module = new modTcpdfbarcode();
|
||||||
|
|||||||
@ -97,11 +97,11 @@ $MAXCATEG = (empty($conf->global->TAKEPOS_NB_MAXCATEG) ? $maxcategbydefaultforth
|
|||||||
$MAXPRODUCT = (empty($conf->global->TAKEPOS_NB_MAXPRODUCT) ? $maxproductbydefaultforthisdevice : $conf->global->TAKEPOS_NB_MAXPRODUCT);
|
$MAXPRODUCT = (empty($conf->global->TAKEPOS_NB_MAXPRODUCT) ? $maxproductbydefaultforthisdevice : $conf->global->TAKEPOS_NB_MAXPRODUCT);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$constforcompanyid = 'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"];
|
$constforcompanyid = 'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"];
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
if ($invoice->socid > 0) $soc->fetch($invoice->socid);
|
if ($invoice->socid > 0) $soc->fetch($invoice->socid);
|
||||||
else $soc->fetch($conf->global->$constforcompanyid);
|
else $soc->fetch($conf->global->$constforcompanyid);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$result = restrictedArea($user, 'takepos', 0, '');
|
$result = restrictedArea($user, 'takepos', 0, '');
|
||||||
@ -116,8 +116,13 @@ $form = new Form($db);
|
|||||||
|
|
||||||
$disablejs = 0;
|
$disablejs = 0;
|
||||||
$disablehead = 0;
|
$disablehead = 0;
|
||||||
$arrayofjs = array();
|
$arrayofjs = array('/takepos/js/jquery.colorbox-min.js'); // TODO It seems we don't need this
|
||||||
$arrayofcss = array();
|
$arrayofcss = array('/takepos/css/pos.css.php', '/takepos/css/colorbox.css');
|
||||||
|
|
||||||
|
if (getDolGlobalInt('TAKEPOS_COLOR_THEME') == 1) {
|
||||||
|
$arrayofcss[] = '/takepos/css/colorful.css';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Title
|
// Title
|
||||||
$title = 'TakePOS - Dolibarr '.DOL_VERSION;
|
$title = 'TakePOS - Dolibarr '.DOL_VERSION;
|
||||||
@ -130,17 +135,7 @@ $head = '<meta name="apple-mobile-web-app-title" content="TakePOS"/>
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
|
<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);
|
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
?>
|
|
||||||
<link rel="stylesheet" href="css/pos.css.php">
|
|
||||||
<link rel="stylesheet" href="css/colorbox.css" type="text/css" media="screen" />
|
|
||||||
<?php
|
|
||||||
if (getDolGlobalInt('TAKEPOS_COLOR_THEME') == 1) {
|
|
||||||
print '<link rel="stylesheet" href="css/colorful.css">';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<script type="text/javascript" src="js/jquery.colorbox-min.js"></script> <!-- TODO It seems we don't need this -->
|
|
||||||
<script type="text/javascript">
|
|
||||||
<?php
|
|
||||||
$categories = $categorie->get_full_arbo('product', ((getDolGlobalInt('TAKEPOS_ROOT_CATEGORY_ID') > 0) ? getDolGlobalInt('TAKEPOS_ROOT_CATEGORY_ID') : 0), 1);
|
$categories = $categorie->get_full_arbo('product', ((getDolGlobalInt('TAKEPOS_ROOT_CATEGORY_ID') > 0) ? getDolGlobalInt('TAKEPOS_ROOT_CATEGORY_ID') : 0), 1);
|
||||||
|
|
||||||
|
|
||||||
@ -172,6 +167,9 @@ $maincategories = dol_sort_array($maincategories, 'label');
|
|||||||
$subcategories = dol_sort_array($subcategories, 'label');
|
$subcategories = dol_sort_array($subcategories, 'label');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<body class="bodytakepos" style="overflow: hidden;">
|
||||||
|
|
||||||
|
<script>
|
||||||
var categories = <?php echo json_encode($maincategories); ?>;
|
var categories = <?php echo json_encode($maincategories); ?>;
|
||||||
var subcategories = <?php echo json_encode($subcategories); ?>;
|
var subcategories = <?php echo json_encode($subcategories); ?>;
|
||||||
|
|
||||||
@ -374,7 +372,11 @@ function LoadProducts(position, issubcat) {
|
|||||||
$("#proprice"+ishow).attr("class", "productprice");
|
$("#proprice"+ishow).attr("class", "productprice");
|
||||||
$("#proprice"+ishow).html(data[parseInt(idata)]['price_formated']);
|
$("#proprice"+ishow).html(data[parseInt(idata)]['price_formated']);
|
||||||
}
|
}
|
||||||
|
console.log("#prodiv"+ishow+".data(rowid)="+data[idata]['id']);
|
||||||
|
console.log($("#prodiv"+ishow));
|
||||||
|
|
||||||
$("#prodiv"+ishow).data("rowid", data[idata]['id']);
|
$("#prodiv"+ishow).data("rowid", data[idata]['id']);
|
||||||
|
console.log($('#prodiv4').data('rowid'));
|
||||||
$("#prodiv"+ishow).data("iscat", 0);
|
$("#prodiv"+ishow).data("iscat", 0);
|
||||||
$("#prodiv"+ishow).attr("class","wrapper2");
|
$("#prodiv"+ishow).attr("class","wrapper2");
|
||||||
$("#prowatermark"+ishow).hide();
|
$("#prowatermark"+ishow).hide();
|
||||||
@ -464,7 +466,7 @@ function MoreProducts(moreorless) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ClickProduct(position, qty = 1) {
|
function ClickProduct(position, qty = 1) {
|
||||||
console.log("ClickProduct");
|
console.log("ClickProduct at position"+position);
|
||||||
$('#proimg'+position).animate({opacity: '0.5'}, 1);
|
$('#proimg'+position).animate({opacity: '0.5'}, 1);
|
||||||
$('#proimg'+position).animate({opacity: '1'}, 100);
|
$('#proimg'+position).animate({opacity: '1'}, 100);
|
||||||
if ($('#prodiv'+position).data('iscat')==1){
|
if ($('#prodiv'+position).data('iscat')==1){
|
||||||
@ -472,6 +474,7 @@ function ClickProduct(position, qty = 1) {
|
|||||||
LoadProducts(position, true);
|
LoadProducts(position, true);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
console.log($('#prodiv4').data('rowid'));
|
||||||
idproduct=$('#prodiv'+position).data('rowid');
|
idproduct=$('#prodiv'+position).data('rowid');
|
||||||
console.log("Click on product at position "+position+" for idproduct "+idproduct+", qty="+qty);
|
console.log("Click on product at position "+position+" for idproduct "+idproduct+", qty="+qty);
|
||||||
if (idproduct=="") return;
|
if (idproduct=="") return;
|
||||||
@ -939,7 +942,6 @@ $( document ).ready(function() {
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<body class="bodytakepos" style="overflow: hidden;">
|
|
||||||
<?php
|
<?php
|
||||||
$keyCodeForEnter = getDolGlobalInt('CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']) > 0 ? getDolGlobalInt('CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']) : '';
|
$keyCodeForEnter = getDolGlobalInt('CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']) > 0 ? getDolGlobalInt('CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']) : '';
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -929,14 +929,14 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
if (!defined('INCLUDE_INVOICE_PAGE_FROM_OTHER_PAGE')) {
|
// llxHeader
|
||||||
|
if ((getDolGlobalString('TAKEPOS_PHONE_BASIC_LAYOUT') == 1 && $conf->browser->layout == 'phone') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||||
$title = 'TakePOS - Dolibarr '.DOL_VERSION;
|
$title = 'TakePOS - Dolibarr '.DOL_VERSION;
|
||||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
||||||
$title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
|
$title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
|
||||||
@ -947,15 +947,19 @@ if (!defined('INCLUDE_INVOICE_PAGE_FROM_OTHER_PAGE')) {
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>';
|
||||||
$arrayofcss = array(
|
$arrayofcss = array(
|
||||||
'/takepos/css/pos.css.php',
|
'/takepos/css/pos.css.php',
|
||||||
'/takepos/js/jquery.colorbox-min.js'
|
|
||||||
);
|
);
|
||||||
$arrayofjs = array('/takepos/js/jquery.colorbox-min.js');
|
$arrayofjs = array('/takepos/js/jquery.colorbox-min.js');
|
||||||
$disablejs = 0;
|
$disablejs = 0;
|
||||||
$disablehead = 0;
|
$disablehead = 0;
|
||||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
|
print '<body>'."\n";
|
||||||
|
} else {
|
||||||
|
top_httphead('text/html', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
<!-- invoice.php -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var selectedline=0;
|
var selectedline=0;
|
||||||
var selectedtext="";
|
var selectedtext="";
|
||||||
@ -1689,7 +1693,8 @@ if ($action == "search") {
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
// llxFooter
|
||||||
if (!defined('INCLUDE_INVOICE_PAGE_FROM_OTHER_PAGE')) {
|
if ((getDolGlobalString('TAKEPOS_PHONE_BASIC_LAYOUT') == 1 && $conf->browser->layout == 'phone') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||||
llxFooter();
|
print '</body></html>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,6 +53,30 @@ if (empty($user->rights->takepos->run)) {
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$arrayofcss = array('/takepos/css/pos.css.php');
|
||||||
|
$arrayofjs = array();
|
||||||
|
|
||||||
|
$head = '';
|
||||||
|
$title = '';
|
||||||
|
$disablejs = 0;
|
||||||
|
$disablehead = 0;
|
||||||
|
|
||||||
|
$head='<link rel="stylesheet" href="css/pos.css.php">';
|
||||||
|
if (getDolGlobalInt('TAKEPOS_COLOR_THEME') == 1) {
|
||||||
|
$head .= '<link rel="stylesheet" href="css/colorful.css">';
|
||||||
|
}
|
||||||
|
|
||||||
|
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
|
?>
|
||||||
|
<body>
|
||||||
|
<?php
|
||||||
|
|
||||||
if (!empty($conf->stripe->enabled)) {
|
if (!empty($conf->stripe->enabled)) {
|
||||||
$service = 'StripeTest';
|
$service = 'StripeTest';
|
||||||
$servicestatus = 0;
|
$servicestatus = 0;
|
||||||
@ -99,10 +123,6 @@ function fetchConnectionToken() {
|
|||||||
</script>
|
</script>
|
||||||
<?php }
|
<?php }
|
||||||
|
|
||||||
/*
|
|
||||||
* View
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (!empty($conf->stripe->enabled) && isset($keyforstripeterminalbank) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) {
|
if (!empty($conf->stripe->enabled) && isset($keyforstripeterminalbank) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha'))) {
|
||||||
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning', 1);
|
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning', 1);
|
||||||
}
|
}
|
||||||
@ -175,16 +195,6 @@ if ($invoiceid > 0) {
|
|||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$arrayofcss = array('/takepos/css/pos.css.php');
|
|
||||||
$arrayofjs = array();
|
|
||||||
|
|
||||||
$head = '';
|
|
||||||
$title = '';
|
|
||||||
$disablejs = 0;
|
|
||||||
$disablehead = 0;
|
|
||||||
|
|
||||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
|
||||||
|
|
||||||
// Define list of possible payments
|
// Define list of possible payments
|
||||||
$arrayOfValidPaymentModes = array();
|
$arrayOfValidPaymentModes = array();
|
||||||
$arrayOfValidBankAccount = array();
|
$arrayOfValidBankAccount = array();
|
||||||
@ -219,14 +229,6 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<link rel="stylesheet" href="css/pos.css.php">
|
|
||||||
<?php
|
|
||||||
if ($conf->global->TAKEPOS_COLOR_THEME == 1) {
|
|
||||||
print '<link rel="stylesheet" href="css/colorful.css">';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@ -69,10 +69,27 @@ if (empty($user->rights->takepos->run) && !defined('INCLUDE_PHONEPAGE_FROM_PUBLI
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (empty($action)) {
|
||||||
|
// Code for llxHeader()
|
||||||
|
$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, 0, 0, '', '');
|
||||||
|
} else {
|
||||||
|
top_httphead('text/html', 1);
|
||||||
|
}
|
||||||
|
|
||||||
if ($action == "productinfo") {
|
if ($action == "productinfo") {
|
||||||
$prod = new Product($db);
|
$prod = new Product($db);
|
||||||
$prod->fetch($idproduct);
|
$prod->fetch($idproduct);
|
||||||
@ -139,17 +156,6 @@ if ($action == "productinfo") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} 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 type="text/javascript">
|
<script type="text/javascript">
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@ -67,7 +67,9 @@ $arrayofjs = array('/takepos/js/jquery.colorbox-min.js');
|
|||||||
|
|
||||||
$head = '';
|
$head = '';
|
||||||
top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss);
|
top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
<body>
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* Save (validate)
|
* Save (validate)
|
||||||
@ -82,8 +84,7 @@ top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss);
|
|||||||
$('#label').focus()
|
$('#label').focus()
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<br>
|
<br>
|
||||||
<center>
|
<center>
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@ -66,7 +66,7 @@ if (empty($user->rights->takepos->run)) {
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
top_httphead('text/html');
|
top_httphead('text/html', 1);
|
||||||
|
|
||||||
if ($place > 0) {
|
if ($place > 0) {
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$db->escape($_SESSION["takeposterminal"]."-".$place).")'";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$db->escape($_SESSION["takeposterminal"]."-".$place).")'";
|
||||||
@ -90,7 +90,6 @@ if (!empty($hookmanager->resPrint)) {
|
|||||||
|
|
||||||
// IMPORTANT: This file is sended to 'Takepos Printing' application. Keep basic file. No external files as css, js... If you need images use absolute path.
|
// IMPORTANT: This file is sended to 'Takepos Printing' application. Keep basic file. No external files as css, js... If you need images use absolute path.
|
||||||
?>
|
?>
|
||||||
<html>
|
|
||||||
<body>
|
<body>
|
||||||
<style>
|
<style>
|
||||||
.right {
|
.right {
|
||||||
|
|||||||
@ -74,6 +74,7 @@ if ($invoiceid > 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$head = '';
|
||||||
$arrayofcss = array('/takepos/css/pos.css.php');
|
$arrayofcss = array('/takepos/css/pos.css.php');
|
||||||
$arrayofjs = array();
|
$arrayofjs = array();
|
||||||
|
|
||||||
|
|||||||
@ -61,6 +61,11 @@ $invoice->fetch($facid);
|
|||||||
$customer = new Societe($db);
|
$customer = new Societe($db);
|
||||||
$customer->fetch($invoice->socid);
|
$customer->fetch($invoice->socid);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
if ($action == "send") {
|
if ($action == "send") {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
@ -86,11 +91,17 @@ if ($action == "send") {
|
|||||||
}
|
}
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
$arrayofcss = array('/takepos/css/pos.css.php');
|
$arrayofcss = array('/takepos/css/pos.css.php');
|
||||||
$arrayofjs = array();
|
$arrayofjs = array();
|
||||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</head>
|
|
||||||
<body class="center">
|
<body class="center">
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@ -47,6 +47,13 @@ if (GETPOSTISSET('status')) {
|
|||||||
die(strtoupper($_SESSION['SMP_CURRENT_PAYMENT']));
|
die(strtoupper($_SESSION['SMP_CURRENT_PAYMENT']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
top_httphead('text/html', 1);
|
||||||
|
|
||||||
if (GETPOST('smp-status')) {
|
if (GETPOST('smp-status')) {
|
||||||
print '<html lang="en">';
|
print '<html lang="en">';
|
||||||
print '<head>';
|
print '<head>';
|
||||||
|
|||||||
@ -53,6 +53,11 @@ if (empty($user->rights->takepos->run)) {
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
if ($action=="split") {
|
if ($action=="split") {
|
||||||
$line = GETPOST('line', 'int');
|
$line = GETPOST('line', 'int');
|
||||||
$split = GETPOST('split', 'int');
|
$split = GETPOST('split', 'int');
|
||||||
@ -139,6 +144,9 @@ if ($invoiceid > 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$arrayofcss = array('/takepos/css/pos.css.php');
|
$arrayofcss = array('/takepos/css/pos.css.php');
|
||||||
|
if (getDolGlobalInt('TAKEPOS_COLOR_THEME') == 1) {
|
||||||
|
$arrayofcss[] = '/takepos/css/colorful.css';
|
||||||
|
}
|
||||||
$arrayofjs = array();
|
$arrayofjs = array();
|
||||||
|
|
||||||
$head = '';
|
$head = '';
|
||||||
@ -152,15 +160,7 @@ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
|||||||
$arrayOfValidPaymentModes = array();
|
$arrayOfValidPaymentModes = array();
|
||||||
$arrayOfValidBankAccount = array();
|
$arrayOfValidBankAccount = array();
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<link rel="stylesheet" href="css/pos.css.php">
|
|
||||||
<?php
|
|
||||||
if ($conf->global->TAKEPOS_COLOR_THEME == 1) {
|
|
||||||
print '<link rel="stylesheet" href="css/colorful.css">';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</head>
|
|
||||||
<body class="takepossplitphp">
|
<body class="takepossplitphp">
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user