Fix PHP 8

This commit is contained in:
Laurent Destailleur 2021-07-08 12:17:32 +02:00
parent 16ee47b12c
commit 1380344fdb
11 changed files with 106 additions and 73 deletions

View File

@ -74,6 +74,8 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))) {
}
}
}
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}

View File

@ -241,7 +241,7 @@ if ($defaultvalue) {
}
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && !empty($debug)) ? '?debug=1' : '').'" method="POST">';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
if ($optioncss != '') {
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
}
@ -393,8 +393,8 @@ if (!is_array($result) && $result<0) {
// Actions
print '<td class="center">';
if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) {
print '<a class="editfielda marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$defaultvalue->id.'&entity='.$defaultvalue->entity.'&mode='.$mode.'&action=edit&token='.newToken().((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_edit().'</a>';
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$defaultvalue->id.'&entity='.$defaultvalue->entity.'&mode='.$mode.'&action=delete&token='.newToken().((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_delete().'</a>';
print '<a class="editfielda marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$defaultvalue->id.'&entity='.$defaultvalue->entity.'&mode='.$mode.'&action=edit&token='.newToken().'">'.img_edit().'</a>';
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$defaultvalue->id.'&entity='.$defaultvalue->entity.'&mode='.$mode.'&action=delete&token='.newToken().'">'.img_delete().'</a>';
} else {
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="rowid" value="'.$id.'">';

View File

@ -499,7 +499,7 @@ foreach ($object->fields as $key => $val) {
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], empty($search[$key]) ? '' : $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
} elseif (strpos($val['type'], 'integer:') === 0) {
print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1);
print $object->showInputField($val, $key, empty($search[$key]) ? '' : $search[$key], '', '', 'search_', 'maxwidth150', 1);
} elseif (!preg_match('/^(date|timestamp)/', $val['type'])) {
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]).'">';
}

View File

@ -78,7 +78,8 @@ $head = pdf_admin_prepare_head();
print dol_get_fiche_head($head, 'other', $langs->trans("other"), -1, 'pdf');
print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("PDFOtherDesc"), $s)."</span><br>\n";
$tooltiptext = '';
print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("PDFOtherDesc"), $tooltiptext)."</span><br>\n";
print "<br>\n";
print load_fiche_titre($langs->trans("Proposal"), '', '');

View File

@ -2063,7 +2063,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
$dropdownBody .= '<br><b>'.$langs->trans("ConnectedSince").':</b> '.dol_print_date($user->datelastlogin, "dayhour", 'tzuser');
$dropdownBody .= '<br><b>'.$langs->trans("PreviousConnexion").':</b> '.dol_print_date($user->datepreviouslogin, "dayhour", 'tzuser');
$dropdownBody .= '<br><b>'.$langs->trans("CurrentTheme").':</b> '.$conf->theme;
$dropdownBody .= '<br><b>'.$langs->trans("CurrentMenuManager").':</b> '.$menumanager->name;
$dropdownBody .= '<br><b>'.$langs->trans("CurrentMenuManager").':</b> '.(isset($menumanager) ? $menumanager->name : 'unknown');
$langFlag = picto_from_langcode($langs->getDefaultLang());
$dropdownBody .= '<br><b>'.$langs->trans("CurrentUserLanguage").':</b> '.($langFlag ? $langFlag.' ' : '').$langs->getDefaultLang();

View File

@ -60,11 +60,11 @@ if (empty($user->rights->takepos->run)) {
if ($action == 'getProducts') {
$object = new Categorie($db);
if ($category == "supplements") {
$category = $conf->global->TAKEPOS_SUPPLEMENTS_CATEGORY;
$category = getDolGlobalInt('TAKEPOS_SUPPLEMENTS_CATEGORY');
}
$result = $object->fetch($category);
if ($result > 0) {
$prods = $object->getObjectsInCateg("product", 0, 0, 0, $conf->global->TAKEPOS_SORTPRODUCTFIELD, 'ASC');
$prods = $object->getObjectsInCateg("product", 0, 0, 0, getDolGlobalString('TAKEPOS_SORTPRODUCTFIELD'), 'ASC');
// Removed properties we don't need
if (is_array($prods) && count($prods) > 0) {
foreach ($prods as $prod) {

View File

@ -703,12 +703,12 @@ function TakeposPrintingTemp(){
}
function OpenDrawer(){
console.log("OpenDrawer call ajax url http://<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>:8111/print");
console.log("OpenDrawer call ajax url http://<?php print getDolGlobalString('TAKEPOS_PRINT_SERVER'); ?>:8111/print");
$.ajax({
type: "POST",
data: { token: 'notrequired' },
<?php
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
echo "url: '".$conf->global->TAKEPOS_PRINT_SERVER."/printer/drawer.php',";
} else {
echo "url: 'http://".$conf->global->TAKEPOS_PRINT_SERVER.":8111/print',";
@ -781,7 +781,7 @@ function WeighingScale(){
$.ajax({
type: "POST",
data: { token: 'notrequired' },
url: '<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>/scale/index.php',
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() {
@ -799,7 +799,7 @@ $( document ).ready(function() {
if ($_SESSION["takeposterminal"] == "") {
print "ModalBox('ModalTerminal');";
}
if ($conf->global->TAKEPOS_CONTROL_CASH_OPENING) {
if (getDolGlobalString('TAKEPOS_CONTROL_CASH_OPENING')) {
$sql = "SELECT rowid, status FROM ".MAIN_DB_PREFIX."pos_cash_fence WHERE";
$sql .= " entity = ".$conf->entity." AND ";
$sql .= " date_creation > '".$db->idate(dol_get_first_hour(dol_now()))."'";
@ -818,7 +818,7 @@ $( document ).ready(function() {
<body class="bodytakepos" style="overflow: hidden;">
<?php
$keyCodeForEnter = $conf->global->{'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']} > 0 ? $conf->global->{'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']) : '';
?>
<div class="container">
@ -1036,41 +1036,41 @@ $menus[$r++] = array('title'=>'<span class="fa fa-cube paddingrightonly"></span>
$menus[$r++] = array('title'=>'<span class="fa fa-percent paddingrightonly"></span><div class="trunc">'.$langs->trans("Reduction").'</div>', 'action'=>'Reduction();');
$menus[$r++] = array('title'=>'<span class="far fa-money-bill-alt paddingrightonly"></span><div class="trunc">'.$langs->trans("Payment").'</div>', 'action'=>'CloseBill();');
if ($conf->global->TAKEPOS_DIRECT_PAYMENT) {
if (getDolGlobalString('TAKEPOS_DIRECT_PAYMENT')) {
$menus[$r++] = array('title'=>'<span class="far fa-money-bill-alt paddingrightonly"></span><div class="trunc">'.$langs->trans("DirectPayment").' <span class="opacitymedium">('.$langs->trans("Cash").')</span></div>', 'action'=>'DirectPayment();');
}
// BAR RESTAURANT specific menu
if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) {
if ($conf->global->TAKEPOS_ORDER_PRINTERS) {
$menus[$r++] = array('title'=>'<span class="fa fa-blender-phone paddingrightonly"></span><div class="trunc">'.$langs->trans("Order").'</span>', 'action'=>'TakeposPrintingOrder();');
}
//Button to print receipt before payment
if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") {
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) {
if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") {
if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
$menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly"></span><div class="trunc">'.$langs->trans("Receipt").'</div>', 'action'=>'TakeposConnector(placeid);');
} else {
$menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly"></span><div class="trunc">'.$langs->trans("Receipt").'</div>', 'action'=>'TakeposPrinting(placeid);');
}
} elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") {
} elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
$menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly"></span><div class="trunc">'.$langs->trans("Receipt").'</div>', 'action'=>'DolibarrTakeposPrinting(placeid);');
} else {
$menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly"></span><div class="trunc">'.$langs->trans("Receipt").'</div>', 'action'=>'Print(placeid);');
}
}
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && $conf->global->TAKEPOS_ORDER_NOTES == 1) {
if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector" && getDolGlobalString('TAKEPOS_ORDER_NOTES') == 1) {
$menus[$r++] = array('title'=>'<span class="fa fa-sticky-note paddingrightonly"></span><div class="trunc">'.$langs->trans("OrderNotes").'</div>', 'action'=>'TakeposOrderNotes();');
}
if ($conf->global->TAKEPOS_SUPPLEMENTS) {
if (getDolGlobalString('TAKEPOS_SUPPLEMENTS')) {
$menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly"></span><div class="trunc">'.$langs->trans("ProductSupplements").'</div>', 'action'=>'LoadProducts(\'supplements\');');
}
}
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") {
if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") {
$menus[$r++] = array('title'=>'<span class="fa fa-receipt paddingrightonly"></span><div class="trunc">'.$langs->trans("DOL_OPEN_DRAWER").'</div>', 'action'=>'OpenDrawer();');
}
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") {
if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
$menus[$r++] = array(
'title' => '<span class="fa fa-receipt paddingrightonly"></span><div class="trunc">'.$langs->trans("DOL_OPEN_DRAWER").'</div>',
'action' => 'DolibarrOpenDrawer();',
@ -1112,7 +1112,7 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
$menus[$r++] = array('title'=>'<span class="fa fa-sign-out-alt paddingrightonly"></span><div class="trunc">'.$langs->trans("Logout").'</div>', 'action'=>'window.location.href=\''.DOL_URL_ROOT.'/user/logout.php\';');
}
if ($conf->global->TAKEPOS_WEIGHING_SCALE) {
if (!empty($conf->global->TAKEPOS_WEIGHING_SCALE)) {
$menus[$r++] = array('title'=>'<span class="fa fa-balance-scale paddingrightonly"></span><div class="trunc">'.$langs->trans("WeighingScale").'</div>', 'action'=>'WeighingScale();');
}
@ -1124,12 +1124,12 @@ if ($conf->global->TAKEPOS_WEIGHING_SCALE) {
foreach ($menus as $menu) {
$i++;
if (count($menus) > 12 and $i == 12) {
echo '<button style="'.$menu['style'].'" type="button" id="actionnext" class="actionbutton" onclick="MoreActions('.count($menus).');">'.$langs->trans("Next").'</button>';
echo '<button style="display: none;" type="button" id="action'.$i.'" class="actionbutton" onclick="'.$menu['action'].'">'.$menu['title'].'</button>';
echo '<button style="'.(empty($menu['style']) ? '' : $menu['style']).'" type="button" id="actionnext" class="actionbutton" onclick="MoreActions('.count($menus).');">'.$langs->trans("Next").'</button>';
echo '<button style="display: none;" type="button" id="action'.$i.'" class="actionbutton" onclick="'.(empty($menu['action']) ? '' : $menu['action']).'">'.$menu['title'].'</button>';
} elseif ($i > 12) {
echo '<button style="display: none;" type="button" id="action'.$i.'" class="actionbutton" onclick="'.$menu['action'].'">'.$menu['title'].'</button>';
echo '<button style="display: none;" type="button" id="action'.$i.'" class="actionbutton" onclick="'.(empty($menu['action']) ? '' : $menu['action']).'">'.$menu['title'].'</button>';
} else {
echo '<button style="'.$menu['style'].'" type="button" id="action'.$i.'" class="actionbutton" onclick="'.$menu['action'].'">'.$menu['title'].'</button>';
echo '<button style="'.(empty($menu['style']) ? '' : $menu['style']).'" type="button" id="action'.$i.'" class="actionbutton" onclick="'.(empty($menu['action']) ? '' : $menu['action']).'">'.$menu['title'].'</button>';
}
}
@ -1169,7 +1169,7 @@ if ($conf->global->TAKEPOS_WEIGHING_SCALE) {
//echo '<img class="imgwrapper" src="img/arrow-next-top.png" height="100%" id="catimg'.$count.'" />';
echo '<span class="fa fa-chevron-right centerinmiddle" style="font-size: 5em;"></span>';
} else {
if (!$conf->global->TAKEPOS_HIDE_CATEGORY_IMAGES) {
if (!getDolGlobalString('TAKEPOS_HIDE_CATEGORY_IMAGES')) {
echo '<img class="imgwrapper" height="100%" id="catimg'.$count.'" />';
}
}
@ -1208,7 +1208,7 @@ if ($conf->global->TAKEPOS_WEIGHING_SCALE) {
//echo '<img class="imgwrapper" src="img/arrow-next-top.png" height="100%" id="proimg'.$count.'" />';
print '<span class="fa fa-chevron-right centerinmiddle" style="font-size: 5em;"></span>';
} else {
if ($conf->global->TAKEPOS_HIDE_PRODUCT_IMAGES) {
if (getDolGlobalString('TAKEPOS_HIDE_PRODUCT_IMAGES')) {
echo '<button type="button" id="probutton'.$count.'" class="productbutton" style="display: none;"></button>';
} else {
print '<div class="" id="proprice'.$count.'"></div>';
@ -1216,7 +1216,7 @@ if ($conf->global->TAKEPOS_WEIGHING_SCALE) {
}
}
?>
<?php if ($count != ($MAXPRODUCT - 2) && $count != ($MAXPRODUCT - 1) && !$conf->global->TAKEPOS_HIDE_PRODUCT_IMAGES) { ?>
<?php if ($count != ($MAXPRODUCT - 2) && $count != ($MAXPRODUCT - 1) && !getDolGlobalString('TAKEPOS_HIDE_PRODUCT_IMAGES')) { ?>
<div class="description" id="prodivdesc<?php echo $count; ?>">
<div class="description_content" id="prodesc<?php echo $count; ?>"></div>
</div>

View File

@ -70,10 +70,10 @@ if (empty($user->rights->takepos->run) && !defined('INCLUDE_PHONEPAGE_FROM_PUBLI
* View
*/
if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout == 'phone') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
if ((getDolGlobalString('TAKEPOS_PHONE_BASIC_LAYOUT') == 1 && $conf->browser->layout == 'phone') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
// DIRECT LINK TO THIS PAGE FROM MOBILE AND NO TERMINAL SELECTED
if ($_SESSION["takeposterminal"] == "") {
if ($conf->global->TAKEPOS_NUM_TERMINALS == "1") {
if (getDolGlobalString('TAKEPOS_NUM_TERMINALS') == "1") {
$_SESSION["takeposterminal"] = 1;
} else {
header("Location: ".DOL_URL_ROOT."/takepos/index.php");
@ -94,6 +94,8 @@ if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout ==
'/takepos/js/jquery.colorbox-min.js'
);
$arrayofjs = array('/takepos/js/jquery.colorbox-min.js');
$disablejs = 0;
$disablehead = 0;
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
}
@ -132,12 +134,19 @@ if ($pay == 'cheque') {
}
// Retrieve paiementid
$sql = "SELECT id FROM ".MAIN_DB_PREFIX."c_paiement";
$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
$sql .= " AND code = '".$db->escape($paycode)."'";
$resql = $db->query($sql);
$obj = $db->fetch_object($resql);
$paiementid = $obj->id;
$paiementid = 0;
if ($paycode) {
$sql = "SELECT id FROM ".MAIN_DB_PREFIX."c_paiement";
$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
$sql .= " AND code = '".$db->escape($paycode)."'";
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
if ($obj) {
$paiementid = $obj->id;
}
}
}
$invoice = new Facture($db);
if ($invoiceid > 0) {
@ -164,7 +173,7 @@ if ($invoice->socid > 0) {
*/
// Change the currency of invoice if it was modified
if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "") {
if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"])) {
if ($invoice->multicurrency_code != $_SESSION["takeposcustomercurrency"]) {
$invoice->setMulticurrencyCode($_SESSION["takeposcustomercurrency"]);
}
@ -855,25 +864,25 @@ if ($action == "valid" || $action == "history" || $action == 'creditnote') {
}
}
$sectionwithinvoicelink .= '</span><br>';
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") {
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") {
if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
$sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="TakeposConnector('.$placeid.');">'.$langs->trans('PrintTicket').'</button>';
} else {
$sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="TakeposPrinting('.$placeid.');">'.$langs->trans('PrintTicket').'</button>';
}
} elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") {
} elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
$sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="DolibarrTakeposPrinting('.$placeid.');">'.$langs->trans('PrintTicket').'</button>';
} else {
$sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="Print('.$placeid.');">'.$langs->trans('PrintTicket').'</button>';
if ($conf->global->TAKEPOS_GIFT_RECEIPT) {
if (getDolGlobalString('TAKEPOS_GIFT_RECEIPT')) {
$sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="Print('.$placeid.', 1);">'.$langs->trans('GiftReceipt').'</button>';
}
}
if ($conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE > 0) {
if (getDolGlobalString('TAKEPOS_EMAIL_TEMPLATE_INVOICE') && $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE > 0) {
$sectionwithinvoicelink .= ' <button id="buttonsend" type="button" onclick="SendTicket('.$placeid.');">'.$langs->trans('SendTicket').'</button>';
}
if ($remaintopay <= 0 && $conf->global->TAKEPOS_AUTO_PRINT_TICKETS) {
if ($remaintopay <= 0 && getDolGlobalString('TAKEPOS_AUTO_PRINT_TICKETS')) {
$sectionwithinvoicelink .= '<script language="javascript">$("#buttonprint").click();</script>';
}
}
@ -891,7 +900,7 @@ var selectedline=0;
var selectedtext="";
var placeid=<?php echo ($placeid > 0 ? $placeid : 0); ?>;
$(document).ready(function() {
var idoflineadded = <?php echo ($idoflineadded ? $idoflineadded : 0); ?>;
var idoflineadded = <?php echo (empty($idoflineadded) ? 0 : $idoflineadded); ?>;
$('.posinvoiceline').click(function(){
console.log("Click done on "+this.id);
@ -1017,7 +1026,7 @@ function TakeposPrinting(id){
receipt=data.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '');
$.ajax({
type: "POST",
url: 'http://<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>:8111/print',
url: 'http://<?php print getDolGlobalString('TAKEPOS_PRINT_SERVER'); ?>:8111/print',
data: receipt
});
});
@ -1028,7 +1037,7 @@ function TakeposConnector(id){
$.get("<?php echo DOL_URL_ROOT; ?>/takepos/ajax/ajax.php?action=printinvoiceticket&term=<?php echo urlencode($_SESSION["takeposterminal"]); ?>&id="+id+"&token=<?php echo currentToken(); ?>", function(data, status) {
$.ajax({
type: "POST",
url: '<?php print $conf->global->TAKEPOS_PRINT_SERVER; ?>/printer/index.php',
url: '<?php print getDolGlobalString('TAKEPOS_PRINT_SERVER'); ?>/printer/index.php',
data: 'invoice='+data
});
});
@ -1083,6 +1092,7 @@ $( document ).ready(function() {
$sql .= $db->order('datec', 'ASC');
$resql = $db->query($sql);
if ($resql) {
$max_sale = 0;
while ($obj = $db->fetch_object($resql)) {
echo '$("#customerandsales").append(\'';
echo '<a class="valignmiddle" title="'.dol_escape_js($langs->trans("SaleStartedAt", dol_print_date($db->jdate($obj->datec), '%H:%M', 'tzuser'))).'" onclick="place=\\\'';
@ -1173,10 +1183,10 @@ $( document ).ready(function() {
// for tooltip and other js beautifiers must be reexecuted too.
if (!empty($conf->use_javascript_ajax)) {
print "\n".'<!-- Includes JS Footer of Dolibarr -->'."\n";
print '<script src="'.DOL_URL_ROOT.'/core/js/lib_foot.js.php?lang='.$langs->defaultlang.($ext ? '&'.$ext : '').'"></script>'."\n";
print '<script src="'.DOL_URL_ROOT.'/core/js/lib_foot.js.php?lang='.$langs->defaultlang.'"></script>'."\n";
}
print '<!-- invoice.php place='.(int) $place.' invoice='.$invoice->ref.' mobilepage='.$mobilepage.' $_SESSION["basiclayout"]='.$_SESSION["basiclayout"].' conf->global->TAKEPOS_BAR_RESTAURANT='.$conf->global->TAKEPOS_BAR_RESTAURANT.' -->'."\n";
print '<!-- invoice.php place='.(int) $place.' invoice='.$invoice->ref.' mobilepage='.(empty($mobilepage) ? '' : $mobilepage).' $_SESSION["basiclayout"]='.(empty($_SESSION["basiclayout"])?'':$_SESSION["basiclayout"]).' conf->global->TAKEPOS_BAR_RESTAURANT='.getDolGlobalString('TAKEPOS_BAR_RESTAURANT').' -->'."\n";
print '<div class="div-table-responsive-no-min invoice">';
print '<table id="tablelines" class="noborder noshadow postablelines" width="100%">';
if ($sectionwithinvoicelink && ($mobilepage == "invoice" || $mobilepage == "")) {
@ -1189,10 +1199,10 @@ if ($sectionwithinvoicelink && ($mobilepage == "invoice" || $mobilepage == ""))
print '<tr class="liste_titre nodrag nodrop">';
print '<td class="linecoldescription">';
// In phone version only show when it is invoice page
if ($mobilepage == "invoice" || $mobilepage == "") {
if (empty($mobilepage) || $mobilepage == "invoice") {
print '<input type="hidden" name="invoiceid" id="invoiceid" value="'.$invoice->id.'">';
}
if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) {
$sql = "SELECT floor, label FROM ".MAIN_DB_PREFIX."takepos_floor_tables where rowid=".((int) $place);
$resql = $db->query($sql);
$obj = $db->fetch_object($resql);
@ -1215,14 +1225,14 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
print $langs->trans("Products");
}
print '</td>';
if ($_SESSION["basiclayout"] != 1) {
if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) {
print '<td class="linecolqty right">'.$langs->trans('ReductionShort').'</td>';
print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
if ($conf->global->TAKEPOS_SHOW_HT) {
if (getDolGlobalString('TAKEPOS_SHOW_HT')) {
print '<td class="linecolht right nowraponall">';
print '<span class="opacitymedium small">' . $langs->trans('TotalHTShort') . '</span><br>';
// In phone version only show when it is invoice page
if ($mobilepage == "invoice" || $mobilepage == "") {
if (empty($mobilepage) || $mobilepage == "invoice") {
print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">' . price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency) . '</span>';
if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
@ -1238,9 +1248,9 @@ if ($_SESSION["basiclayout"] != 1) {
print '<td class="linecolht right nowraponall">';
print '<span class="opacitymedium small">'.$langs->trans('TotalTTCShort').'</span><br>';
// In phone version only show when it is invoice page
if ($mobilepage == "invoice" || $mobilepage == "") {
if (empty($mobilepage) || $mobilepage == "invoice") {
print '<span id="linecolht-span-total" style="font-size:1.3em; font-weight: bold;">'.price($invoice->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</span>';
if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
$multicurrency = new MultiCurrency($db);
@ -1256,7 +1266,7 @@ if ($_SESSION["basiclayout"] != 1) {
print "</tr>\n";
if ($_SESSION["basiclayout"] == 1) {
if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) {
if ($mobilepage == "cats") {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$categorie = new Categorie($db);
@ -1336,13 +1346,14 @@ if ($_SESSION["basiclayout"] == 1) {
if ($placeid > 0) {
//In Phone basic layout hide some content depends situation
if ($_SESSION["basiclayout"] == 1 && $mobilepage != "invoice" && $action != "order") {
if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1 && $mobilepage != "invoice" && $action != "order") {
return;
}
if (is_array($invoice->lines) && count($invoice->lines)) {
print '<!-- invoice.php show lines of invoices -->'."\n";
$tmplines = array_reverse($invoice->lines);
$htmlsupplements = array();
foreach ($tmplines as $line) {
if ($line->fk_parent_line != false) {
$htmlsupplements[$line->fk_parent_line] .= '<tr class="drag drop oddeven posinvoiceline';
@ -1367,7 +1378,7 @@ if ($placeid > 0) {
}
}
$htmlsupplements[$line->fk_parent_line] .= '</td>';
if ($_SESSION["basiclayout"] != 1) {
if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) {
$htmlsupplements[$line->fk_parent_line] .= '<td class="right">'.vatrate($line->remise_percent, true).'</td>';
$htmlsupplements[$line->fk_parent_line] .= '<td class="right">'.$line->qty.'</td>';
$htmlsupplements[$line->fk_parent_line] .= '<td class="right">'.price($line->total_ttc).'</td>';
@ -1383,7 +1394,7 @@ if ($placeid > 0) {
}
$htmlforlines .= '" id="'.$line->id.'">';
$htmlforlines .= '<td class="left">';
if ($_SESSION["basiclayout"] == 1) {
if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) {
$htmlforlines .= '<span class="phoneqty">'.$line->qty."</span> x ";
}
if (isset($line->product_type)) {
@ -1425,10 +1436,10 @@ if ($placeid > 0) {
if (!empty($line->array_options['options_order_notes'])) {
$htmlforlines .= "<br>(".$line->array_options['options_order_notes'].")";
}
if ($_SESSION["basiclayout"] == 1) {
if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) {
$htmlforlines .= '</td><td class="right phonetable"><button type="button" onclick="SetQty(place, '.$line->rowid.', '.($line->qty - 1).');" class="publicphonebutton2 phonered">-</button>&nbsp;&nbsp;<button type="button" onclick="SetQty(place, '.$line->rowid.', '.($line->qty + 1).');" class="publicphonebutton2 phonegreen">+</button>';
}
if ($_SESSION["basiclayout"] != 1) {
if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) {
$moreinfo = '';
$moreinfo .= $langs->transcountry("TotalHT", $mysoc->country_code).': '.price($line->total_ht);
if ($line->vat_src_code) {
@ -1479,10 +1490,10 @@ if ($placeid > 0) {
}
$htmlforlines .= '</td>';
if ($conf->global->TAKEPOS_SHOW_HT) {
if (getDolGlobalString('TAKEPOS_SHOW_HT')) {
$htmlforlines .= '<td class="right classfortooltip" title="'.$moreinfo.'">';
$htmlforlines .= price($line->total_ht, 1, '', 1, -1, -1, $conf->currency);
if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
$multicurrency = new MultiCurrency($db);
@ -1493,7 +1504,7 @@ if ($placeid > 0) {
}
$htmlforlines .= '<td class="right classfortooltip" title="'.$moreinfo.'">';
$htmlforlines .= price($line->total_ttc, 1, '', 1, -1, -1, $conf->currency);
if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
//Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
$multicurrency = new MultiCurrency($db);
@ -1503,7 +1514,7 @@ if ($placeid > 0) {
$htmlforlines .= '</td>';
}
$htmlforlines .= '</tr>'."\n";
$htmlforlines .= $htmlsupplements[$line->id];
$htmlforlines .= empty($htmlsupplements[$line->id]) ? '' : empty($htmlsupplements[$line->id]);
print $htmlforlines;
}

View File

@ -65,6 +65,9 @@ $colortext = '0,0,0';
$colortextlink = '0,0,120';
$fontsize = '14';
$fontsizesmaller = '11';
$topMenuFontSize = '1.1em';
$toolTipBgColor = 'rgba(255, 255, 255, 0.96)';
$toolTipFontColor = '#333';
// text color
$textSuccess = '#28a745';
@ -83,9 +86,15 @@ $badgeInfo = '#17a2b8';
$badgeDark = '#343a40';
$badgeLight = '#f8f9fa';
// badge color ajustement for color blind
$colorblind_deuteranopes_badgeSuccess = '#37de5d'; //! text color black
$colorblind_deuteranopes_badgeSuccess_textColor7 = '#000';
$colorblind_deuteranopes_badgeWarning = '#e4e411';
$colorblind_deuteranopes_badgeDanger = $badgeDanger; // currently not tested with a color blind people so use default color
/* default color for status : After a quick check, somme status can have oposite function according to objects
* So this badges status uses default value according to theme eldy status img
* TODO: use color definition vars above for define badges color status X -> expemple $badgeStatusValidate, $badgeStatusClosed, $badgeStatusActive ....
* TODO: use color definition vars above for define badges color status X -> exemple $badgeStatusValidate, $badgeStatusClosed, $badgeStatusActive ....
*/
$badgeStatus0 = '#cbd3d3';
$badgeStatus1 = '#bc9526';
@ -99,3 +108,9 @@ $badgeStatus8 = '#993013';
$badgeStatus9 = '#e7f0f0';
$badgeStatus10 = '#993013';
$badgeStatus11 = '#15a540';
// status color ajustement for color blind
$colorblind_deuteranopes_badgeStatus4 = $colorblind_deuteranopes_badgeStatus7 = $colorblind_deuteranopes_badgeSuccess; //! text color black
$colorblind_deuteranopes_badgeStatus_textColor4 = $colorblind_deuteranopes_badgeStatus_textColor7 = '#000';
$colorblind_deuteranopes_badgeStatus1 = $colorblind_deuteranopes_badgeWarning;
$colorblind_deuteranopes_badgeStatus_textColor1 = '#000';

View File

@ -35,6 +35,7 @@ $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all',
$search_group = GETPOST('search_group');
$optioncss = GETPOST('optioncss', 'alpha');
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$contextpage = GETPOST('optioncss', 'aZ09');
// Defini si peux lire/modifier utilisateurs et permisssions
$caneditperms = ($user->admin || $user->rights->user->user->creer);
@ -168,7 +169,6 @@ if ($resql) {
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'object_group', 0, $newcardbutton, '', $limit, 0, 0, 1);

View File

@ -42,9 +42,11 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_user = GETPOST('search_user', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
$contextpage = GETPOST('optioncss', 'aZ09');
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
// Load mode employee
$mode = GETPOST("mode", 'alpha');
@ -94,7 +96,7 @@ if (!is_array($user_arbo) && $user_arbo < 0) {
$data[] = array('rowid'=>0, 'fk_menu'=>-1, 'title'=>"racine", 'mainmenu'=>'', 'leftmenu'=>'', 'fk_mainmenu'=>'', 'fk_leftmenu'=>'');
foreach ($fulltree as $key => $val) {
$userstatic->id = $val['id'];
$userstatic->ref = $val['label'];
$userstatic->ref = $val['id'];
$userstatic->login = $val['login'];
$userstatic->firstname = $val['firstname'];
$userstatic->lastname = $val['lastname'];
@ -146,6 +148,8 @@ if (!is_array($user_arbo) && $user_arbo < 0) {
$newcardbutton = '';
$newcardbutton .= dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1' : '').'&leftmenu=', '', $canadduser);
$morehtmlright = '';
$morehtmlright .= dolGetButtonTitle($langs->trans("List"), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''));
$param = array('morecss'=>'marginleftonly btnTitleSelected');
$morehtmlright .= dolGetButtonTitle($langs->trans("HierarchicView"), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $param);