|
@@ -28,9 +28,6 @@
|
|
|
// if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
|
|
// if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
|
|
|
|
|
|
-if (!defined('NOTOKENRENEWAL')) {
|
|
|
- define('NOTOKENRENEWAL', '1');
|
|
|
-}
|
|
|
if (!defined('NOREQUIREMENU')) {
|
|
|
define('NOREQUIREMENU', '1');
|
|
|
}
|
|
@@ -325,7 +322,7 @@ function LoadProducts(position, issubcat) {
|
|
|
});
|
|
|
|
|
|
idata=0; //product data counter
|
|
|
- $.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&category='+currentcat, function(data) {
|
|
|
+ $.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken();?>&category='+currentcat, function(data) {
|
|
|
console.log("Call ajax.php (in LoadProducts) to get Products of category "+currentcat+" then loop on result to fill image thumbs");
|
|
|
console.log(data);
|
|
|
while (ishow < maxproduct) {
|
|
@@ -415,7 +412,7 @@ function MoreProducts(moreorless) {
|
|
|
if (pageproducts==0) return; //Return if no less pages
|
|
|
pageproducts=pageproducts-1;
|
|
|
}
|
|
|
- $.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&category='+currentcat, function(data) {
|
|
|
+ $.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken();?>&category='+currentcat, function(data) {
|
|
|
console.log("Call ajax.php (in MoreProducts) to get Products of category "+currentcat);
|
|
|
|
|
|
if (typeof (data[(maxproduct * pageproducts)]) == "undefined" && moreorless=="more"){ // Return if no more pages
|
|
@@ -490,7 +487,7 @@ function ClickProduct(position, qty = 1) {
|
|
|
function ChangeThirdparty(idcustomer) {
|
|
|
console.log("ChangeThirdparty");
|
|
|
// Call page list.php to change customer
|
|
|
- $("#poslines").load("../societe/list.php?action=change&type=t&contextpage=poslist&idcustomer="+idcustomer+"&place="+place+"", function() {
|
|
|
+ $("#poslines").load("../societe/list.php?action=change&token=<?php echo newToken();?>&type=t&contextpage=poslist&idcustomer="+idcustomer+"&place="+place+"", function() {
|
|
|
});
|
|
|
|
|
|
ClearSearch();
|
|
@@ -540,7 +537,7 @@ function Floors() {
|
|
|
|
|
|
function FreeZone() {
|
|
|
console.log("Open box to enter a free product");
|
|
|
- $.colorbox({href:"freezone.php?action=freezone&place="+place, width:"80%", height:"200px", transition:"none", iframe:"true", title:"<?php echo $langs->trans("FreeZone"); ?>"});
|
|
|
+ $.colorbox({href:"freezone.php?action=freezone&token=<?php echo newToken(); ?>&place="+place, width:"80%", height:"200px", transition:"none", iframe:"true", title:"<?php echo $langs->trans("FreeZone"); ?>"});
|
|
|
}
|
|
|
|
|
|
function TakeposOrderNotes() {
|
|
@@ -562,7 +559,7 @@ function New() {
|
|
|
|
|
|
console.log("New with place = <?php echo $place; ?>, js place="+place+", invoiceid="+invoiceid);
|
|
|
|
|
|
- $.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getInvoice&id='+invoiceid, function(data) {
|
|
|
+ $.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getInvoice&token=<?php echo newToken();?>&id='+invoiceid, function(data) {
|
|
|
var r;
|
|
|
|
|
|
if (parseInt(data['paye']) === 1) {
|
|
@@ -628,7 +625,7 @@ function Search2(keyCodeForEnter, moreorless) {
|
|
|
pageproducts = 0;
|
|
|
jQuery(".wrapper2 .catwatermark").hide();
|
|
|
var nbsearchresults = 0;
|
|
|
- $.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&term=' + search_term + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) {
|
|
|
+ $.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&token=<?php echo newToken();?>&term=' + search_term + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) {
|
|
|
for (i = 0; i < <?php echo $MAXPRODUCT ?>; i++) {
|
|
|
if (typeof (data[i]) == "undefined") {
|
|
|
$("#prowatermark" + i).html("");
|
|
@@ -746,7 +743,7 @@ function Edit(number) {
|
|
|
return;
|
|
|
} else if (number=='qty') {
|
|
|
if (editaction=='qty' && editnumber != '') {
|
|
|
- $("#poslines").load("invoice.php?action=updateqty&place="+place+"&idline="+selectedline+"&number="+editnumber, function() {
|
|
|
+ $("#poslines").load("invoice.php?action=updateqty&token=<?php echo newToken(); ?>&place="+place+"&idline="+selectedline+"&number="+editnumber, function() {
|
|
|
editnumber="";
|
|
|
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
|
|
|
$("#qty").html("<?php echo $langs->trans("Qty"); ?>").removeClass('clicked');
|
|
@@ -760,7 +757,7 @@ function Edit(number) {
|
|
|
}
|
|
|
} else if (number=='p') {
|
|
|
if (editaction=='p' && editnumber!="") {
|
|
|
- $("#poslines").load("invoice.php?action=updateprice&place="+place+"&idline="+selectedline+"&number="+editnumber, function() {
|
|
|
+ $("#poslines").load("invoice.php?action=updateprice&token=<?php echo newToken(); ?>&place="+place+"&idline="+selectedline+"&number="+editnumber, function() {
|
|
|
editnumber="";
|
|
|
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
|
|
|
$("#price").html("<?php echo $langs->trans("Price"); ?>").removeClass('clicked');
|
|
@@ -774,7 +771,7 @@ function Edit(number) {
|
|
|
}
|
|
|
} else if (number=='r') {
|
|
|
if (editaction=='r' && editnumber!="") {
|
|
|
- $("#poslines").load("invoice.php?action=updatereduction&place="+place+"&idline="+selectedline+"&number="+editnumber, function() {
|
|
|
+ $("#poslines").load("invoice.php?action=updatereduction&token=<?php echo newToken(); ?>&place="+place+"&idline="+selectedline+"&number="+editnumber, function() {
|
|
|
editnumber="";
|
|
|
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
|
|
|
$("#reduction").html("<?php echo $langs->trans("ReductionShort"); ?>").removeClass('clicked');
|
|
@@ -814,14 +811,14 @@ function Edit(number) {
|
|
|
|
|
|
function TakeposPrintingOrder(){
|
|
|
console.log("TakeposPrintingOrder");
|
|
|
- $("#poslines").load("invoice.php?action=order&place="+place, function() {
|
|
|
+ $("#poslines").load("invoice.php?action=order&token=<?php echo newToken();?>&place="+place, function() {
|
|
|
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function TakeposPrintingTemp(){
|
|
|
console.log("TakeposPrintingTemp");
|
|
|
- $("#poslines").load("invoice.php?action=temp&place="+place, function() {
|
|
|
+ $("#poslines").load("invoice.php?action=temp&token=<?php echo newToken();?>&place="+place, function() {
|
|
|
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
|
|
|
});
|
|
|
}
|
|
@@ -843,11 +840,11 @@ function OpenDrawer(){
|
|
|
}
|
|
|
|
|
|
function DolibarrOpenDrawer() {
|
|
|
- console.log("DolibarrOpenDrawer call ajax url /takepos/ajax/ajax.php?action=opendrawer&term=<?php print urlencode($_SESSION["takeposterminal"]); ?>");
|
|
|
+ console.log("DolibarrOpenDrawer call ajax url /takepos/ajax/ajax.php?action=opendrawer&token=<?php echo newToken();?>&term=<?php print urlencode($_SESSION["takeposterminal"]); ?>");
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
data: { token: '<?php echo currentToken(); ?>' },
|
|
|
- url: "<?php print DOL_URL_ROOT.'/takepos/ajax/ajax.php?action=opendrawer&term='.urlencode($_SESSION["takeposterminal"]); ?>",
|
|
|
+ url: "<?php print DOL_URL_ROOT.'/takepos/ajax/ajax.php?action=opendrawer&token='.newToken().'&term='.urlencode($_SESSION["takeposterminal"]); ?>",
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -892,7 +889,7 @@ function ModalBox(ModalID)
|
|
|
|
|
|
function DirectPayment(){
|
|
|
console.log("DirectPayment");
|
|
|
- $("#poslines").load("invoice.php?place="+place+"&action=valid&pay=LIQ", function() {
|
|
|
+ $("#poslines").load("invoice.php?place="+place+"&action=valid&token=<?php echo newToken(); ?>&pay=LIQ", function() {
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -908,7 +905,7 @@ function WeighingScale(){
|
|
|
url: '<?php print getDolGlobalString('TAKEPOS_PRINT_SERVER'); ?>/scale/index.php',
|
|
|
})
|
|
|
.done(function( editnumber ) {
|
|
|
- $("#poslines").load("invoice.php?action=updateqty&place="+place+"&idline="+selectedline+"&number="+editnumber, function() {
|
|
|
+ $("#poslines").load("invoice.php?&token=<?php echo newToken(); ?>&place="+place+"&idline="+selectedline+"&number="+editnumber, function() {
|
|
|
editnumber="";
|
|
|
});
|
|
|
});
|