Merge branch '16.0' into 16p1

This commit is contained in:
Laurent Destailleur 2022-08-29 01:05:47 +02:00 committed by GitHub
commit 1b1ebdd636
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 90 additions and 84 deletions

View File

@ -1320,7 +1320,7 @@ if ($action == 'create') {
// Description
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('note', (GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : $object->note_private), '', 120, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%');
$doleditor = new DolEditor('note', (GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : $object->note_private), '', 120, 'dolibarr_notes', 'In', true, true, isModEnabled('fckeditor'), ROWS_4, '90%');
$doleditor->Create();
print '</td></tr>';

View File

@ -194,7 +194,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
$companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$propalstatic->getNomUrl(1).'</td>';
print '<td class="nowraponall tdoverflowmax100">'.$propalstatic->getNomUrl(1).'</td>';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
print '<td class="nowrap right tdamount amount">'.price((!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc)).'</td>';
print '</tr>';
@ -291,7 +291,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
$companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$supplierproposalstatic->getNomUrl(1).'</td>';
print '<td class="nowraponall tdoverflowmax100">'.$supplierproposalstatic->getNomUrl(1).'</td>';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '</tr>';
@ -389,7 +389,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$orderstatic->getNomUrl(1).'</td>';
print '<td class="nowraponall tdoverflowmax100">'.$orderstatic->getNomUrl(1).'</td>';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '</tr>';
@ -487,7 +487,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
$companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$supplierorderstatic->getNomUrl(1).'</td>';
print '<td class="nowraponall tdoverflowmax100">'.$supplierorderstatic->getNomUrl(1).'</td>';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '</tr>';
@ -573,8 +573,9 @@ if (!empty($conf->ficheinter->enabled)) {
$companystatic->email = $obj->email;
$companystatic->entity = $obj->entity;
$companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">';
print '<td class="nowraponall tdoverflowmax100">';
print $fichinterstatic->getNomUrl(1);
print "</td>";
print '<td class="nowrap tdoverflowmax100">';
@ -654,7 +655,7 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
$companystatic->canvas = $objp->canvas;
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
print '<td class="nowraponall tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
print '<td class="nowrap">';
//print $companystatic->getLibCustProspStatut();
@ -751,7 +752,7 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S
$companystatic->canvas = $objp->canvas;
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
print '<td class="nowraponall tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
print '<td>';
$obj = $companystatic;
@ -865,8 +866,8 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T
$staticcontrat->ref = $obj->ref;
print '<tr class="oddeven">';
print '<td>'.$staticcontrat->getNomUrl(1).'</td>';
print '<td>'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
print '<td class="nowraponall">'.$staticcontrat->getNomUrl(1).'</td>';
print '<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
print '<td class="right">'.$staticcontrat->LibStatut($obj->statut, 3).'</td>';
print '</tr>';
@ -962,7 +963,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
print '<td class="nowrap" width="140">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowrap">'.$propalstatic->getNomUrl(1).'</td>';
print '<td class="nobordernopadding nowraponall">'.$propalstatic->getNomUrl(1).'</td>';
print '<td width="18" class="nobordernopadding nowrap">'.$warning.'</td>';
print '<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).'</td>';
print '</tr>';
@ -1082,7 +1083,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
print '<td class="nowrap" width="140">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowrap">'.$orderstatic->getNomUrl(1).'</td>';
print '<td class="nobordernopadding nowraponall">'.$orderstatic->getNomUrl(1).'</td>';
print '<td width="18" class="nobordernopadding nowrap"></td>';
print '<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($orderstatic->element, $filename, $filedir).'</td>';
print '</tr>';

View File

@ -47,7 +47,6 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
if (!empty($conf->project->enabled)) {
@ -2875,7 +2874,7 @@ if ($action == 'create') {
if ($object->statut != Propal::STATUS_DRAFT && $useonlinesignature) {
print '<br><!-- Link to sign -->';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
print showOnlineSignatureUrl('proposal', $object->ref).'<br>';
}

View File

@ -1918,10 +1918,11 @@ class Form
* @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on).
* @param int $outputmode 0=HTML select string, 1=Array
* @param bool $multiple add [] in the name of element and add 'multiple' attribut
* @param int $forcecombo Force the component to be a simple combo box without ajax
* @return string HTML select string
* @see select_dolgroups()
*/
public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $noactive = 0, $outputmode = 0, $multiple = false)
public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $noactive = 0, $outputmode = 0, $multiple = false, $forcecombo = 0)
{
// phpcs:enable
global $conf, $user, $langs, $hookmanager;
@ -2124,7 +2125,7 @@ class Form
}
$out .= '</select>';
if ($num) {
if ($num && !$forcecombo) {
// Enhance with select2
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
$out .= ajax_combobox($htmlname);
@ -6451,8 +6452,8 @@ class Form
} elseif ($usecalendar == 'jquery') {
if (!$disabled) {
// Output javascript for datepicker
$minYear = $conf->global->MIN_YEAR_SELECT_DATE ? $conf->global->MIN_YEAR_SELECT_DATE : (date('Y') - 100);
$maxYear = $conf->global->MAX_YEAR_SELECT_DATE ? $conf->global->MAX_YEAR_SELECT_DATE : (date('Y') + 100);
$minYear = getDolGlobalString('MIN_YEAR_SELECT_DATE', date('Y') - 100);
$maxYear = getDolGlobalString('MAX_YEAR_SELECT_DATE', date('Y') + 100);
$retstring .= "<script type='text/javascript'>";
$retstring .= "$(function(){ $('#".$prefix."').datepicker({

View File

@ -7029,7 +7029,7 @@ function dol_html_entity_decode($a, $b, $c = 'UTF-8', $keepsomeentities = 0)
if ($keepsomeentities) {
$newstring = strtr($newstring, array('&amp;'=>'__andamp__', '&lt;'=>'__andlt__', '&gt;'=>'__andgt__', '"'=>'__dquot__'));
}
$newstring = html_entity_decode($newstring, $b, $c);
$newstring = html_entity_decode((string) $newstring, (int) $b, (string) $c);
if ($keepsomeentities) {
$newstring = strtr($newstring, array('__andamp__'=>'&amp;', '__andlt__'=>'&lt;', '__andgt__'=>'&gt;', '__dquot__'=>'"'));
}

View File

@ -57,11 +57,11 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos
*/
public function info()
{
global $conf, $langs;
global $db, $langs;
$langs->load('cashdesk@cashdesk');
$form = new Form($this->db);
$form = new Form($db);
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
@ -79,9 +79,9 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos
// Parametrage du prefix
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
$texte .= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskvalue" value="'.$conf->global->TAKEPOS_REF_UNIVERSAL_MASK.'">', $tooltip, 1, 1).'</td>';
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskvalue" value="'.getDolGlobalString('TAKEPOS_REF_UNIVERSAL_MASK').'">', $tooltip, 1, 1).'</td>';
$texte .= '<td align="left" rowspan="2">&nbsp; <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"></td>';
$texte .= '<td class="left" rowspan="2">&nbsp; <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"></td>';
$texte .= '</tr>';
@ -121,12 +121,12 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos
*/
public function getNextValue($objsoc = null, $invoice = null, $mode = 'next')
{
global $db, $conf;
global $db;
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// On defini critere recherche compteur
$mask = $conf->global->TAKEPOS_REF_UNIVERSAL_MASK;
$mask = getDolGlobalString('TAKEPOS_REF_UNIVERSAL_MASK');
if (!$mask) {
$this->error = 'NotConfigured';
@ -136,9 +136,10 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos
// Get entities
$entity = getEntity('invoicenumber', 1, $invoice);
$date = (empty($invoice->date) ? dol_now() : $invoice->date);
$pos_source = is_object($invoice) && $invoice->pos_source > 0 ? $invoice->pos_source : 0;
$mask = str_replace('{TN}', $pos_source, $mask);
$numFinal = get_next_value($db, $mask, 'facture', 'ref', '', $objsoc, $invoice->date, $mode, false, null, $entity);
$numFinal = get_next_value($db, $mask, 'facture', 'ref', '', $objsoc, $date, $mode, false, null, $entity);
return $numFinal;
}

View File

@ -962,6 +962,8 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->trackid = 'tas'.$object->id;
} elseif (preg_match('/^TICKET_/', $action)) {
$object->trackid = 'tic'.$object->id;
} elseif (preg_match('/^USER_/', $action)) {
$object->trackid = 'use'.$object->id;
} else {
$object->trackid = '';
}

View File

@ -150,7 +150,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) +
if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) {
$dataseries[] = array($langs->trans("Customers"), round($third['customer']));
}
if ((($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled('supplier_order') && $user->rights->supplier_order->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) {
if (((isModEnabled('fournisseur') && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled('supplier_order') && $user->rights->supplier_order->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) {
$dataseries[] = array($langs->trans("Suppliers"), round($third['supplier']));
}
if (isModEnabled('societe')) {

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -67,7 +68,7 @@ if (GETPOST('action', 'alpha') == 'set') {
}
}
if ($conf->global->TAKEPOS_ORDER_NOTES == 1) {
if (getDolGlobalInt('TAKEPOS_ORDER_NOTES') == 1) {
$extrafields = new ExtraFields($db);
$extrafields->addExtraField('order_notes', 'Order notes', 'varchar', 0, 255, 'facturedet', 0, 0, '', '', 0, '', 0, 1);
}
@ -79,6 +80,7 @@ if ($conf->global->TAKEPOS_ORDER_NOTES == 1) {
$form = new Form($db);
$formproduct = new FormProduct($db);
$arrayofjs = array();
$arrayofcss = array("/takepos/css/colorbox.css");
llxHeader('', $langs->trans("CashDeskSetup"), '', '', 0, 0, $arrayofjs, $arrayofcss);
@ -112,7 +114,7 @@ print '</center>';
print '<br>';
if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT')) {
print '<br>';
print '<a href="" onclick="Floors(); return false;"><span class="fa fa-glass-cheers"></span> '.$langs->trans("DefineTablePlan").'</a><br>';
print '<br><br>';
@ -171,12 +173,12 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
print ajax_constantonoff("TAKEPOS_SUPPLEMENTS", array(), $conf->entity, 0, 0, 1, 0);
print '</td></tr>';
if ($conf->global->TAKEPOS_SUPPLEMENTS) {
if (getDolGlobalInt('TAKEPOS_SUPPLEMENTS')) {
print '<tr class="oddeven"><td>';
print $langs->trans("SupplementCategory");
print '</td>';
print '<td class="center">';
print $form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_SUPPLEMENTS_CATEGORY, 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0);
print $form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalString('TAKEPOS_SUPPLEMENTS_CATEGORY'), 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0);
print ajax_combobox('TAKEPOS_SUPPLEMENTS_CATEGORY');
print "</td></tr>\n";
}
@ -203,8 +205,8 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
print $form->buttonsSaveCancel("Save", '');
}
if (!empty($conf->global->TAKEPOS_BAR_RESTAURANT)) {
if ($conf->global->TAKEPOS_QR_MENU) {
if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT')) {
if (getDolGlobalInt('TAKEPOS_QR_MENU')) {
$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
print '<br>';
@ -221,7 +223,7 @@ if (!empty($conf->global->TAKEPOS_BAR_RESTAURANT)) {
print '</table>';
}
if ($conf->global->TAKEPOS_AUTO_ORDER) {
if (getDolGlobalInt('TAKEPOS_AUTO_ORDER')) {
print '<br>';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';

View File

@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019 Andreu Bisquerra Gaya <jove@bisquerra.com>
* Copyright (C) 2021 Nicolas ZABOURI <info@inovea-conseil.com>
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019 Andreu Bisquerra Gaya <jove@bisquerra.com>
* Copyright (C) 2021 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -47,10 +48,7 @@ if (GETPOST('action', 'alpha') == 'set') {
$res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'restricthtml'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'restricthtml'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_RECEIPT_NAME", GETPOST('TAKEPOS_RECEIPT_NAME', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_SHOW_CUSTOMER", GETPOST('TAKEPOS_SHOW_CUSTOMER', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_AUTO_PRINT_TICKETS", GETPOST('TAKEPOS_AUTO_PRINT_TICKETS', 'int'), 'int', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_PRINT_PAYMENT_METHOD", GETPOST('TAKEPOS_PRINT_PAYMENT_METHOD', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, 'TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT', GETPOST('TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT', 'alphanohtml'), 'chaine', 0, '', $conf->entity);
dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha'));
@ -120,14 +118,14 @@ print $langs->trans('DolibarrReceiptPrinter');
print '<td>';
print $langs->trans('ReceiptPrinterMethodDescription');
if (isModEnabled('receiptprinter')) {
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") {
if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
print '<br>';
print img_picto('', 'printer', 'class="paddingright"').'<a href="'.DOL_URL_ROOT.'/admin/receiptprinter.php">'.$langs->trans("Setup").'</a>';
}
}
print '</td><td class="right">';
if (isModEnabled('receiptprinter')) {
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") {
if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmethod&token='.newToken().'&value=receiptprinter">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
@ -148,7 +146,7 @@ print $langs->trans('TakeposConnectorMethodDescription');
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") {
print '<br>';
print $langs->trans("URL")." / ".$langs->trans("IPAddress").' (<a href="http://en.takepos.com/connector" target="_blank" rel="noopener noreferrer external">'.$langs->trans("TakeposConnectorNecesary").'</a>)';
print ' <input type="text" class="minwidth200" id="TAKEPOS_PRINT_SERVER" name="TAKEPOS_PRINT_SERVER" value="'.$conf->global->TAKEPOS_PRINT_SERVER.'">';
print ' <input type="text" class="minwidth200" id="TAKEPOS_PRINT_SERVER" name="TAKEPOS_PRINT_SERVER" value="'.getDolGlobalString('TAKEPOS_PRINT_SERVER').'">';
}
print '</td><td class="right">';
@ -221,14 +219,14 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P
print '<tr class="oddeven"><td>';
print $langs->trans('PrintCustomerOnReceipts');
print '<td colspan="2">';
print $form->selectyesno("TAKEPOS_SHOW_CUSTOMER", $conf->global->TAKEPOS_SHOW_CUSTOMER, 1);
print ajax_constantonoff("TAKEPOS_SHOW_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0);
print "</td></tr>\n";
// Print payment method
print '<tr class="oddeven"><td>';
print $langs->trans('PrintPaymentMethodOnReceipts');
print '<td colspan="2">';
print $form->selectyesno("TAKEPOS_PRINT_PAYMENT_METHOD", $conf->global->TAKEPOS_PRINT_PAYMENT_METHOD, 1);
print ajax_constantonoff("TAKEPOS_PRINT_PAYMENT_METHOD", array(), $conf->entity, 0, 0, 1, 0);
print "</td></tr>\n";
}
@ -236,7 +234,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P
print '<tr class="oddeven"><td>';
print $langs->trans("AutoPrintTickets");
print '<td colspan="2">';
print $form->selectyesno("TAKEPOS_AUTO_PRINT_TICKETS", $conf->global->TAKEPOS_AUTO_PRINT_TICKETS, 1);
print ajax_constantonoff("TAKEPOS_AUTO_PRINT_TICKETS", array(), $conf->entity, 0, 0, 1, 0);
print "</td></tr>\n";
@ -247,7 +245,7 @@ print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_SHOW_HT_RECEIPT", array(), $conf->entity, 0, 0, 1, 0);
print "</td></tr>\n";
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector" && filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) {
print '<tr class="oddeven"><td>';
print $langs->trans('WeighingScale');
print '<td colspan="2">';
@ -255,7 +253,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($con
print "</td></tr>\n";
}
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) {
print '<tr class="oddeven"><td>';
print $langs->trans('CustomerDisplay');
print '<td colspan="2">';

View File

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2021 Nicolas ZABOURI <info@inovea-conseil.com>
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2021 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -78,7 +79,7 @@ if ($action == 'set') {
$res = dolibarr_set_const($db, "TAKEPOS_NUM_TERMINALS", GETPOST('TAKEPOS_NUM_TERMINALS', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_ADDON", GETPOST('TAKEPOS_ADDON', 'alpha'), 'int', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_EMAIL_TEMPLATE_INVOICE", GETPOST('TAKEPOS_EMAIL_TEMPLATE_INVOICE', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!empty($conf->global->TAKEPOS_ENABLE_SUMUP)) {
if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
$res = dolibarr_set_const($db, "TAKEPOS_SUMUP_AFFILIATE", GETPOST('TAKEPOS_SUMUP_AFFILIATE', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_SUMUP_APPID", GETPOST('TAKEPOS_SUMUP_APPID', 'alpha'), 'chaine', 0, '', $conf->entity);
}
@ -142,13 +143,13 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
print load_fiche_titre($langs->trans('CashDeskRefNumberingModules'), '', '');
print '<table class="noborder" width="100%">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name")."</td>\n";
print '<td>'.$langs->trans("Description")."</td>\n";
print '<td class="nowrap">'.$langs->trans("Example")."</td>\n";
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
print '</tr>'."\n";
clearstatcache();
@ -195,8 +196,8 @@ foreach ($dirmodels as $reldir) {
}
print '</td>'."\n";
print '<td align="center">';
if ($conf->global->TAKEPOS_REF_ADDON == "$file") {
print '<td class="center">';
if (getDolGlobalString('TAKEPOS_REF_ADDON') == "$file") {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setrefmod&token='.newToken().'&value='.urlencode($file).'">';
@ -276,7 +277,7 @@ if (isModEnabled('service')) {
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc"));
print '<td colspan="2">';
print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_ROOT_CATEGORY_ID, 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0);
print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalInt('TAKEPOS_ROOT_CATEGORY_ID'), 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0);
print ajax_combobox('TAKEPOS_ROOT_CATEGORY_ID');
print "</td></tr>\n";
@ -458,7 +459,7 @@ print '</div>';
// Sumup options
if ($conf->global->TAKEPOS_ENABLE_SUMUP) {
if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
print '<br>';
print '<div class="div-table-responsive-no-min">';

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -73,7 +74,7 @@ if (GETPOST('action', 'alpha') == 'set') {
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CHEQUE".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CB".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
if (!empty($conf->global->TAKEPOS_ENABLE_SUMUP)) {
if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_SUMUP".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
}
foreach ($paiements as $modep) {
@ -145,7 +146,7 @@ print "</tr>\n";
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
print '<td>';
print $form->select_company($conf->global->{'CASHDESK_ID_THIRDPARTY'.$terminaltouse}, 'socid', '(s.client IN (1, 3) AND s.status = 1)', 1, 0, 0, array(), 0);
print $form->select_company(getDolGlobalInt('CASHDESK_ID_THIRDPARTY'.$terminaltouse), 'socid', '(s.client IN (1, 3) AND s.status = 1)', 1, 0, 0, array(), 0);
print '</td></tr>';
$atleastonefound = 0;
@ -153,33 +154,33 @@ if (isModEnabled('banque')) {
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForSell").'</td>';
print '<td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 0, "courant=2", 1);
if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse})) {
$form->select_comptes(getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse), 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 0, "courant=2", 1);
if (getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse)) {
$atleastonefound++;
}
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCheque").'</td>';
print '<td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 0, "courant=1", 1);
if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse})) {
$form->select_comptes(getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse), 'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 0, "courant=1", 1);
if (getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse)) {
$atleastonefound++;
}
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCB").'</td>';
print '<td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 0, "courant=1", 1);
if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse})) {
$form->select_comptes(getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse), 'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 0, "courant=1", 1);
if (getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse)) {
$atleastonefound++;
}
print '</td></tr>';
if ($conf->global->TAKEPOS_ENABLE_SUMUP) {
if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForSumup").'</td>';
print '<td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 0, "courant=1", 1);
if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse})) {
$form->select_comptes(getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse), 'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 0, "courant=1", 1);
if (getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse)) {
$atleastonefound++;
}
print '</td></tr>';
@ -197,7 +198,7 @@ if (isModEnabled('banque')) {
}
$cour = preg_match('/^LIQ.*/', $modep->code) ? 2 : 1;
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
$form->select_comptes($conf->global->$name, $name, 0, "courant=".$cour, 1);
$form->select_comptes(getDolGlobalInt($name), $name, 0, "courant=".$cour, 1);
print '</td></tr>';
}
}
@ -205,10 +206,10 @@ if (isModEnabled('banque')) {
if (isModEnabled('stock')) {
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>'; // Force warehouse (this is not a default value)
print '<td>';
if (!isModEnabled('productbatch') || !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) {
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}, 1);
if (!isModEnabled('productbatch') || getDolGlobalInt('CASHDESK_FORCE_DECREASE_STOCK')) {
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, getDolGlobalInt('CASHDESK_NO_DECREASE_STOCK'.$terminal), 1);
} else {
if (!$conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}) {
if (getDolGlobalInt('CASHDESK_NO_DECREASE_STOCK'.$terminal)) {
$res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK".$terminal, 1, 'chaine', 0, '', $conf->entity);
}
print $langs->trans("Yes").'<br>';
@ -286,11 +287,11 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" || $conf->global->TA
print '<tr class="oddeven"><td>'.$langs->trans('CashDeskReaderKeyCodeForEnter').'</td>';
print '<td>';
print '<input type="text" name="CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse.'" value="'.$conf->global->{'CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse}.'" />';
print '<input type="text" name="CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse.'" value="'.getDolGlobalString('CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse).'" />';
print '</td></tr>';
// Numbering module
if ($conf->global->TAKEPOS_ADDON == "terminal") {
if (getDolGlobalString('TAKEPOS_ADDON') == "terminal") {
print '<tr class="oddeven"><td>';
print $langs->trans("BillsNumberingModule");
print '<td colspan="2">';
@ -379,7 +380,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->{$variablename}.'</textarea>';
} else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->{$variablename}, '', 80, 'dolibarr_notes');
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
print $doleditor->Create();
}
print '</td></tr>';
@ -395,7 +396,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->{$variablename}.'</textarea>';
} else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->{$variablename}, '', 80, 'dolibarr_notes');
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
print $doleditor->Create();
}
print '</td></tr>';

View File

@ -425,7 +425,7 @@ while ($i < count($arrayOfValidPaymentModes)) {
}
$keyforsumupbank = "CASHDESK_ID_BANKACCOUNT_SUMUP".$_SESSION["takeposterminal"];
if ($conf->global->TAKEPOS_ENABLE_SUMUP) {
if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
if (!empty($conf->global->$keyforsumupbank)) {
print '<button type="button" class="calcbutton2" onclick="ValidateSumup();">Sumup</button>';
} else {