From 1380344fdb71811463079acf67ffd45679fc9805 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Jul 2021 12:17:32 +0200 Subject: [PATCH] Fix PHP 8 --- htdocs/admin/company_socialnetworks.php | 2 + htdocs/admin/defaultvalues.php | 6 +- htdocs/admin/mails_senderprofile_list.php | 2 +- htdocs/admin/pdf_other.php | 3 +- htdocs/main.inc.php | 2 +- htdocs/takepos/ajax/ajax.php | 4 +- htdocs/takepos/index.php | 46 ++++++------ htdocs/takepos/invoice.php | 85 +++++++++++++---------- htdocs/theme/md/theme_vars.inc.php | 17 ++++- htdocs/user/group/list.php | 2 +- htdocs/user/hierarchy.php | 10 ++- 11 files changed, 106 insertions(+), 73 deletions(-) diff --git a/htdocs/admin/company_socialnetworks.php b/htdocs/admin/company_socialnetworks.php index 4809a418861..2d4b2e6d128 100644 --- a/htdocs/admin/company_socialnetworks.php +++ b/htdocs/admin/company_socialnetworks.php @@ -74,6 +74,8 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))) { } } } + + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index dc801059e41..038d8d0915c 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -241,7 +241,7 @@ if ($defaultvalue) { } -print '
entity) && !empty($debug)) ? '?debug=1' : '').'" method="POST">'; +print ''; if ($optioncss != '') { print ''; } @@ -393,8 +393,8 @@ if (!is_array($result) && $result<0) { // Actions print ''; if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) { - print ''.img_edit().''; - print ''.img_delete().''; + print ''.img_edit().''; + print ''.img_delete().''; } else { print ''; print ''; diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index e27c48b0416..8ba5a990c33 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -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 ''; } diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index f836b8f0f0c..ed14f2ac119 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -78,7 +78,8 @@ $head = pdf_admin_prepare_head(); print dol_get_fiche_head($head, 'other', $langs->trans("other"), -1, 'pdf'); -print ''.$form->textwithpicto($langs->trans("PDFOtherDesc"), $s)."
\n"; +$tooltiptext = ''; +print ''.$form->textwithpicto($langs->trans("PDFOtherDesc"), $tooltiptext)."
\n"; print "
\n"; print load_fiche_titre($langs->trans("Proposal"), '', ''); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index cbc3a2246cf..82ff19e3771 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2063,7 +2063,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '') $dropdownBody .= '
'.$langs->trans("ConnectedSince").': '.dol_print_date($user->datelastlogin, "dayhour", 'tzuser'); $dropdownBody .= '
'.$langs->trans("PreviousConnexion").': '.dol_print_date($user->datepreviouslogin, "dayhour", 'tzuser'); $dropdownBody .= '
'.$langs->trans("CurrentTheme").': '.$conf->theme; - $dropdownBody .= '
'.$langs->trans("CurrentMenuManager").': '.$menumanager->name; + $dropdownBody .= '
'.$langs->trans("CurrentMenuManager").': '.(isset($menumanager) ? $menumanager->name : 'unknown'); $langFlag = picto_from_langcode($langs->getDefaultLang()); $dropdownBody .= '
'.$langs->trans("CurrentUserLanguage").': '.($langFlag ? $langFlag.' ' : '').$langs->getDefaultLang(); diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index 0ccdeb86b9b..30635c58b8c 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -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) { diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 7e2a2d5c1e1..1ddab39dcbe 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -703,12 +703,12 @@ function TakeposPrintingTemp(){ } function OpenDrawer(){ - console.log("OpenDrawer call ajax url http://global->TAKEPOS_PRINT_SERVER; ?>:8111/print"); + console.log("OpenDrawer call ajax url http://:8111/print"); $.ajax({ type: "POST", data: { token: 'notrequired' }, 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: 'global->TAKEPOS_PRINT_SERVER; ?>/scale/index.php', + url: '/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() { 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']) : ''; ?>
@@ -1036,41 +1036,41 @@ $menus[$r++] = array('title'=>' $menus[$r++] = array('title'=>'
'.$langs->trans("Reduction").'
', 'action'=>'Reduction();'); $menus[$r++] = array('title'=>'
'.$langs->trans("Payment").'
', 'action'=>'CloseBill();'); -if ($conf->global->TAKEPOS_DIRECT_PAYMENT) { +if (getDolGlobalString('TAKEPOS_DIRECT_PAYMENT')) { $menus[$r++] = array('title'=>'
'.$langs->trans("DirectPayment").' ('.$langs->trans("Cash").')
', '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'=>'
'.$langs->trans("Order").'', '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'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposConnector(placeid);'); } else { $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposPrinting(placeid);'); } - } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { + } elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'DolibarrTakeposPrinting(placeid);'); } else { $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', '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'=>'
'.$langs->trans("OrderNotes").'
', 'action'=>'TakeposOrderNotes();'); } - if ($conf->global->TAKEPOS_SUPPLEMENTS) { + if (getDolGlobalString('TAKEPOS_SUPPLEMENTS')) { $menus[$r++] = array('title'=>'
'.$langs->trans("ProductSupplements").'
', 'action'=>'LoadProducts(\'supplements\');'); } } -if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { +if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { $menus[$r++] = array('title'=>'
'.$langs->trans("DOL_OPEN_DRAWER").'
', 'action'=>'OpenDrawer();'); } -if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { +if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { $menus[$r++] = array( 'title' => '
'.$langs->trans("DOL_OPEN_DRAWER").'
', 'action' => 'DolibarrOpenDrawer();', @@ -1112,7 +1112,7 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { $menus[$r++] = array('title'=>'
'.$langs->trans("Logout").'
', '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'=>'
'.$langs->trans("WeighingScale").'
', '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 ''; - echo ''; + echo ''; + echo ''; } elseif ($i > 12) { - echo ''; + echo ''; } else { - echo ''; + echo ''; } } @@ -1169,7 +1169,7 @@ if ($conf->global->TAKEPOS_WEIGHING_SCALE) { //echo ''; echo ''; } else { - if (!$conf->global->TAKEPOS_HIDE_CATEGORY_IMAGES) { + if (!getDolGlobalString('TAKEPOS_HIDE_CATEGORY_IMAGES')) { echo ''; } } @@ -1208,7 +1208,7 @@ if ($conf->global->TAKEPOS_WEIGHING_SCALE) { //echo ''; print ''; } else { - if ($conf->global->TAKEPOS_HIDE_PRODUCT_IMAGES) { + if (getDolGlobalString('TAKEPOS_HIDE_PRODUCT_IMAGES')) { echo ''; } else { print '
'; @@ -1216,7 +1216,7 @@ if ($conf->global->TAKEPOS_WEIGHING_SCALE) { } } ?> - global->TAKEPOS_HIDE_PRODUCT_IMAGES) { ?> +
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index f55f84130b6..8cef291c2d7 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -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 .= '
'; - 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 .= ' '; } else { $sectionwithinvoicelink .= ' '; } - } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { + } elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { $sectionwithinvoicelink .= ' '; } else { $sectionwithinvoicelink .= ' '; - if ($conf->global->TAKEPOS_GIFT_RECEIPT) { + if (getDolGlobalString('TAKEPOS_GIFT_RECEIPT')) { $sectionwithinvoicelink .= ' '; } } - if ($conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE > 0) { + if (getDolGlobalString('TAKEPOS_EMAIL_TEMPLATE_INVOICE') && $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE > 0) { $sectionwithinvoicelink .= ' '; } - if ($remaintopay <= 0 && $conf->global->TAKEPOS_AUTO_PRINT_TICKETS) { + if ($remaintopay <= 0 && getDolGlobalString('TAKEPOS_AUTO_PRINT_TICKETS')) { $sectionwithinvoicelink .= ''; } } @@ -891,7 +900,7 @@ var selectedline=0; var selectedtext=""; var placeid= 0 ? $placeid : 0); ?>; $(document).ready(function() { - var idoflineadded = ; + var 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://global->TAKEPOS_PRINT_SERVER; ?>:8111/print', + url: 'http://:8111/print', data: receipt }); }); @@ -1028,7 +1037,7 @@ function TakeposConnector(id){ $.get("/takepos/ajax/ajax.php?action=printinvoiceticket&term=&id="+id+"&token=", function(data, status) { $.ajax({ type: "POST", - url: 'global->TAKEPOS_PRINT_SERVER; ?>/printer/index.php', + url: '/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 '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".''."\n"; - print ''."\n"; + print ''."\n"; } -print ''."\n"; +print ''."\n"; print '
'; print ''; if ($sectionwithinvoicelink && ($mobilepage == "invoice" || $mobilepage == "")) { @@ -1189,10 +1199,10 @@ if ($sectionwithinvoicelink && ($mobilepage == "invoice" || $mobilepage == "")) print ''; print ''; -if ($_SESSION["basiclayout"] != 1) { +if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) { print ''; print ''; - if ($conf->global->TAKEPOS_SHOW_HT) { + if (getDolGlobalString('TAKEPOS_SHOW_HT')) { print '\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 ''."\n"; $tmplines = array_reverse($invoice->lines); + $htmlsupplements = array(); foreach ($tmplines as $line) { if ($line->fk_parent_line != false) { $htmlsupplements[$line->fk_parent_line] .= 'fk_parent_line] .= ''; $htmlsupplements[$line->fk_parent_line] .= ''; $htmlsupplements[$line->fk_parent_line] .= ''; @@ -1383,7 +1394,7 @@ if ($placeid > 0) { } $htmlforlines .= '" id="'.$line->id.'">'; $htmlforlines .= ''; - if ($conf->global->TAKEPOS_SHOW_HT) { + if (getDolGlobalString('TAKEPOS_SHOW_HT')) { $htmlforlines .= ''; } $htmlforlines .= ''."\n"; - $htmlforlines .= $htmlsupplements[$line->id]; + $htmlforlines .= empty($htmlsupplements[$line->id]) ? '' : empty($htmlsupplements[$line->id]); print $htmlforlines; } diff --git a/htdocs/theme/md/theme_vars.inc.php b/htdocs/theme/md/theme_vars.inc.php index 9e98a863737..fd37b6376dd 100644 --- a/htdocs/theme/md/theme_vars.inc.php +++ b/htdocs/theme/md/theme_vars.inc.php @@ -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'; diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 493383076b0..04fa0035418 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -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 ''; print ''; print ''; - print ''; print ''; print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'object_group', 0, $newcardbutton, '', $limit, 0, 0, 1); diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index 6073ca4c88f..0413fda69b0 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -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);
'; // In phone version only show when it is invoice page -if ($mobilepage == "invoice" || $mobilepage == "") { +if (empty($mobilepage) || $mobilepage == "invoice") { print ''; } -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 ''.$langs->trans('ReductionShort').''.$langs->trans('Qty').''; print '' . $langs->trans('TotalHTShort') . '
'; // In phone version only show when it is invoice page - if ($mobilepage == "invoice" || $mobilepage == "") { + if (empty($mobilepage) || $mobilepage == "invoice") { print '' . price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency) . ''; 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 '
'; print ''.$langs->trans('TotalTTCShort').'
'; // In phone version only show when it is invoice page - if ($mobilepage == "invoice" || $mobilepage == "") { + if (empty($mobilepage) || $mobilepage == "invoice") { print ''.price($invoice->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); @@ -1256,7 +1266,7 @@ if ($_SESSION["basiclayout"] != 1) { print "
'.vatrate($line->remise_percent, true).''.$line->qty.''.price($line->total_ttc).''; - if ($_SESSION["basiclayout"] == 1) { + if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) { $htmlforlines .= ''.$line->qty." x "; } if (isset($line->product_type)) { @@ -1425,10 +1436,10 @@ if ($placeid > 0) { if (!empty($line->array_options['options_order_notes'])) { $htmlforlines .= "
(".$line->array_options['options_order_notes'].")"; } - if ($_SESSION["basiclayout"] == 1) { + if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) { $htmlforlines .= '
  '; } - 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 .= ''; $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 .= ''; $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 .= '