diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 35d4015e270..ef396c143a1 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -188,7 +188,8 @@ $result = restrictedArea($user, 'adherent'); */ if (GETPOST('cancel', 'alpha')) { - $action = 'list'; $massaction = ''; + $action = 'list'; + $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; @@ -324,14 +325,17 @@ $formother = new FormOther($db); $membertypestatic = new AdherentType($db); $memberstatic = new Adherent($db); +$now = dol_now(); + // Page Header $title = $langs->trans("Members")." - ".$langs->trans("List"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $title, $help_url); +$morejs = array(); +$morecss = array(); -$now = dol_now(); - +// Build and execute select +// -------------------------------------------------------------------- if ((!empty($search_categ) && $search_categ > 0) || !empty($catid)) { $sql = "SELECT DISTINCT"; } else { @@ -356,7 +360,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) { // Add fields from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql = preg_replace('/,\s*$/', '', $sql); @@ -487,16 +491,14 @@ if ($search_country) { if ($search_import_key) { $sql .= natural_search("d.import_key", $search_import_key); } - // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; - // Add where from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -// Count total nb of records with no order and no limits +// Count total nb of records $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ @@ -510,7 +512,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { dol_print_error($db); } - if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } @@ -533,8 +535,7 @@ if (!$resql) { $num = $db->num_rows($resql); -$arrayofselected = is_array($toselect) ? $toselect : array(); - +// Direct jump if only one record found if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) { $obj = $db->fetch_object($resql); $id = $obj->rowid; @@ -542,6 +543,13 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ exit; } +// Output page +// -------------------------------------------------------------------- + +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll + +$arrayofselected = is_array($toselect) ? $toselect : array(); + if ($search_type > 0) { $membertype = new AdherentType($db); @@ -1351,7 +1359,7 @@ if ($num == 0) { $colspan++; } } - print ''.$langs->trans("NoRecordFound").''; + print ''.$langs->trans("NoRecordFound").''; } $db->free($resql); diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 15db7d2ba0d..bc3f4609d1f 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -601,6 +601,9 @@ print '
'; print 'MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = '.getDolGlobalString('MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES', ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': 1)')."
"; print '
'; +print 'MAIN_DISALLOW_EXT_URL_INTO_DESCRIPTIONS = '.getDolGlobalString('MAIN_DISALLOW_EXT_URL_INTO_DESCRIPTIONS', ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)')."
"; +print '
'; + print 'MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL = '.getDolGlobalString('MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL', ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)')."
"; print '
'; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 5d69bb2b6dd..9eadd0fa421 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3393,7 +3393,6 @@ class Facture extends CommonInvoice // Set new ref and define current status if (!$error) { - $this->ref = $num; $this->ref = $num; $this->statut = self::STATUS_VALIDATED; $this->status = self::STATUS_VALIDATED; diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 127584e3f9f..64e4d690308 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1236,8 +1236,8 @@ abstract class CommonDocGenerator // save curent cell padding $curentCellPaddinds = $pdf->getCellPaddings(); // set cell padding with column content definition - $pdf->setCellPaddings($colDef['content']['padding'][3], $colDef['content']['padding'][0], $colDef['content']['padding'][1], $colDef['content']['padding'][2]); - $pdf->writeHTMLCell($colDef['width'], 2, $colDef['xStartPos'], $curY, $columnText, 0, 1, 0, true, $colDef['content']['align']); + $pdf->setCellPaddings(isset($colDef['content']['padding'][3]) ? $colDef['content']['padding'][3] : 0, isset($colDef['content']['padding'][0]) ? $colDef['content']['padding'][0] : 0, isset($colDef['content']['padding'][1]) ? $colDef['content']['padding'][1] : 0, isset($colDef['content']['padding'][2]) ? $colDef['content']['padding'][2] : 0); + $pdf->writeHTMLCell($colDef['width'], 2, isset($colDef['xStartPos']) ? $colDef['xStartPos'] : 0, $curY, $columnText, 0, 1, 0, true, $colDef['content']['align']); // restore cell padding $pdf->setCellPaddings($curentCellPaddinds['L'], $curentCellPaddinds['T'], $curentCellPaddinds['R'], $curentCellPaddinds['B']); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cf512d5f173..f5024b5cb71 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8377,18 +8377,18 @@ class Form * Return a HTML select string, built from an array of key+value, but content returned into select is defined into $array parameter. * Note: Do not apply langs->trans function on returned content of Ajax service, content may be entity encoded twice. * - * @param string $htmlname Name of html select area - * @param array $array Array (key=>array('text'=>'A text', 'url'=>'An url'), ...) - * @param string $id Preselected key - * @param string $moreparam Add more parameters onto the select tag - * @param int $disableFiltering If set to 1, results are not filtered with searched string - * @param int $disabled Html select box is disabled - * @param int $minimumInputLength Minimum Input Length - * @param string $morecss Add more class to css styles - * @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected. - * @param string $placeholder String to use as placeholder - * @param integer $acceptdelayedhtml 1 = caller is requesting to have html js content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect) - * @return string HTML select string + * @param string $htmlname Name of html select area + * @param array $array Array (key=>array('text'=>'A text', 'url'=>'An url'), ...) + * @param string $id Preselected key + * @param string $moreparam Add more parameters onto the select tag + * @param int $disableFiltering If set to 1, results are not filtered with searched string + * @param int $disabled Html select box is disabled + * @param int $minimumInputLength Minimum Input Length + * @param string $morecss Add more class to css styles + * @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected. + * @param string $placeholder String to use as placeholder + * @param integer $acceptdelayedhtml 1 = caller is requesting to have html js content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect) + * @return string HTML select string * @see selectArrayAjax(), ajax_combobox() in ajax.lib.php */ public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 4424a65eb07..96ae839a9cd 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -1305,7 +1305,7 @@ $(document).on('select2:open', (e) => { const target = $(e.target); if (target && target.length) { const id = target[0].id || target[0].name; - document.querySelector(`input[aria-controls*='${id}']`).focus(); + document.querySelector('input[aria-controls*='+id+']').focus(); } }); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 50b22f1b439..41eda7174da 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1197,10 +1197,10 @@ class pdf_crabe extends ModelePDFFactures if ($object->type != 2) { // Check a payment mode is defined if (empty($object->mode_reglement_code) - && empty($conf->global->FACTURE_CHQ_NUMBER) + && !getDolGlobalInt('FACTURE_CHQ_NUMBER') && !getDolGlobalInt('FACTURE_RIB_NUMBER')) { $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); - } elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank)) + } elseif (($object->mode_reglement_code == 'CHQ' && !getDolGlobalInt('FACTURE_CHQ_NUMBER') && empty($object->fk_account) && empty($object->fk_bank)) || ($object->mode_reglement_code == 'VIR' && !getDolGlobalInt('FACTURE_RIB_NUMBER') && empty($object->fk_account) && empty($object->fk_bank))) { // Avoid having any valid PDF with setup that is not complete $outputlangs->load("errors"); @@ -1286,12 +1286,12 @@ class pdf_crabe extends ModelePDFFactures // Show payment mode CHQ if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // If payment mode unregulated or payment mode forced to CHQ - if (!empty($conf->global->FACTURE_CHQ_NUMBER)) { + if (getDolGlobalInt('FACTURE_CHQ_NUMBER')) { $diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE); if ($conf->global->FACTURE_CHQ_NUMBER > 0) { $account = new Account($this->db); - $account->fetch($conf->global->FACTURE_CHQ_NUMBER); + $account->fetch(getDolGlobalInt('FACTURE_CHQ_NUMBER')); $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index cbdb1608beb..ee826a0b0ef 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1289,10 +1289,10 @@ class pdf_sponge extends ModelePDFFactures if ($object->type != 2) { // Check a payment mode is defined if (empty($object->mode_reglement_code) - && empty($conf->global->FACTURE_CHQ_NUMBER) + && !getDolGlobalInt('FACTURE_CHQ_NUMBER') && !getDolGlobalInt('FACTURE_RIB_NUMBER')) { $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); - } elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank)) + } elseif (($object->mode_reglement_code == 'CHQ' && !getDolGlobalInt('FACTURE_CHQ_NUMBER') && empty($object->fk_account) && empty($object->fk_bank)) || ($object->mode_reglement_code == 'VIR' && !getDolGlobalInt('FACTURE_RIB_NUMBER') && empty($object->fk_account) && empty($object->fk_bank))) { // Avoid having any valid PDF with setup that is not complete $outputlangs->load("errors"); @@ -1381,12 +1381,12 @@ class pdf_sponge extends ModelePDFFactures // Show payment mode CHQ if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // If payment mode unregulated or payment mode forced to CHQ - if (!empty($conf->global->FACTURE_CHQ_NUMBER)) { + if (getDolGlobalInt('FACTURE_CHQ_NUMBER')) { $diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE); if ($conf->global->FACTURE_CHQ_NUMBER > 0) { $account = new Account($this->db); - $account->fetch($conf->global->FACTURE_CHQ_NUMBER); + $account->fetch(getDolGlobalInt('FACTURE_CHQ_NUMBER')); $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index a46bd5f108c..e9da62a42bb 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1032,12 +1032,12 @@ class pdf_azur extends ModelePDFPropales // Show payment mode CHQ if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // Si mode reglement non force ou si force a CHQ - if (!empty($conf->global->FACTURE_CHQ_NUMBER)) { + if (getDolGlobalInt('FACTURE_CHQ_NUMBER')) { $diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE); if ($conf->global->FACTURE_CHQ_NUMBER > 0) { $account = new Account($this->db); - $account->fetch($conf->global->FACTURE_CHQ_NUMBER); + $account->fetch(getDolGlobalInt('FACTURE_CHQ_NUMBER')); $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index b8ef09f04ba..56184668f20 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1143,12 +1143,12 @@ class pdf_cyan extends ModelePDFPropales // Show payment mode CHQ if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // Si mode reglement non force ou si force a CHQ - if (!empty($conf->global->FACTURE_CHQ_NUMBER)) { + if (getDolGlobalInt('FACTURE_CHQ_NUMBER')) { $diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE); if ($conf->global->FACTURE_CHQ_NUMBER > 0) { $account = new Account($this->db); - $account->fetch($conf->global->FACTURE_CHQ_NUMBER); + $account->fetch(getDolGlobalInt('FACTURE_CHQ_NUMBER')); $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); @@ -1162,7 +1162,7 @@ class pdf_cyan extends ModelePDFPropales $posy = $pdf->GetY() + 2; } } - if ($conf->global->FACTURE_CHQ_NUMBER == -1) { + if (getDolGlobalInt('FACTURE_CHQ_NUMBER') == -1) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0); diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 8b0a032c4c9..41bbf8c32f9 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -943,10 +943,10 @@ class pdf_eagle_proforma extends ModelePDFCommandes // Show payment mode CHQ if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // Si mode reglement non force ou si force a CHQ - if (!empty($conf->global->FACTURE_CHQ_NUMBER)) { + if (getDolGlobalInt('FACTURE_CHQ_NUMBER')) { if ($conf->global->FACTURE_CHQ_NUMBER > 0) { $account = new Account($this->db); - $account->fetch($conf->global->FACTURE_CHQ_NUMBER); + $account->fetch(getDolGlobalInt('FACTURE_CHQ_NUMBER')); $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - 3); @@ -960,7 +960,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes $posy = $pdf->GetY() + 2; } } - if ($conf->global->FACTURE_CHQ_NUMBER == -1) { + if (getDolGlobalInt('FACTURE_CHQ_NUMBER') == -1) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - 3); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 0fec1c99997..5a2eaeddf47 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -841,12 +841,12 @@ class pdf_aurore extends ModelePDFSupplierProposal // Show payment mode CHQ if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // Si mode reglement non force ou si force a CHQ - if (!empty($conf->global->FACTURE_CHQ_NUMBER)) { + if (getDolGlobalInt('FACTURE_CHQ_NUMBER')) { $diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE); if ($conf->global->FACTURE_CHQ_NUMBER > 0) { $account = new Account($this->db); - $account->fetch($conf->global->FACTURE_CHQ_NUMBER); + $account->fetch(getDolGlobalInt('FACTURE_CHQ_NUMBER')); $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); @@ -860,7 +860,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $posy = $pdf->GetY() + 2; } } - if ($conf->global->FACTURE_CHQ_NUMBER == -1) { + if (getDolGlobalInt('FACTURE_CHQ_NUMBER') == -1) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0); diff --git a/htdocs/document.php b/htdocs/document.php index 21ab1b8b054..089bdf4b66b 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -31,6 +31,8 @@ * DOL_URL_ROOT.'/document.php?hashp=sharekey' */ +define('MAIN_SECURITY_FORCECSP', "default-src: 'none'"); + //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language if (!defined('NOTOKENRENEWAL')) { diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 0e10bb06f2a..e4263d1a217 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -199,9 +199,7 @@ Hide=Hide ShowCardHere=Show card Search=Search SearchOf=Search -SearchMenuShortCut=Ctrl + shift + f QuickAdd=Quick add -QuickAddMenuShortCut=Ctrl + shift + l Valid=Valid Approve=Approve Disapprove=Disapprove diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 619dde3f5a1..f4ffbb16ff7 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -199,9 +199,7 @@ Hide=Cacher ShowCardHere=Voir la fiche ici Search=Rechercher SearchOf=Recherche de -SearchMenuShortCut=Ctrl + Maj + f QuickAdd=Création rapide -QuickAddMenuShortCut=Ctrl + Maj + l Valid=Valider Approve=Approuver Disapprove=Désapprouver diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 817c7cae698..f71955af2aa 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2081,12 +2081,21 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') { $logouthtmltext .= $langs->trans("Logout").'
'; + $stringforfirstkey = $langs->trans("KeyboardShortcut"); + if ($conf->browser->name == 'chrome') { + $stringforfirstkey .= ' ALT +'; + } elseif ($conf->browser->name == 'firefox') { + $stringforfirstkey .= ' ALT + SHIFT +'; + } else { + $stringforfirstkey .= ' CTL +'; + } + $logouttext .= ''; - $logouttext .= img_picto($langs->trans('Logout'), 'sign-out', '', false, 0, 0, '', 'atoplogin valignmiddle'); + $logouttext .= img_picto($langs->trans('Logout').' ('.$stringforfirstkey.' l)', 'sign-out', '', false, 0, 0, '', 'atoplogin valignmiddle'); $logouttext .= ''; } else { $logouthtmltext .= $langs->trans("NoLogoutProcessWithAuthMode", $_SESSION["dol_authmode"]); - $logouttext .= img_picto($langs->trans('Logout'), 'sign-out', '', false, 0, 0, '', 'atoplogin valignmiddle opacitymedium'); + $logouttext .= img_picto($langs->trans('Logout').' ('.$stringforfirstkey.' l)', 'sign-out', '', false, 0, 0, '', 'atoplogin valignmiddle opacitymedium'); } } @@ -2368,11 +2377,22 @@ function top_menu_user($hideloginname = 0, $urllogout = '') $urllogout = DOL_URL_ROOT.'/user/logout.php?token='.newToken(); } + // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox + // accesskey is for Mac: CTRL + key for all browsers + $stringforfirstkey = $langs->trans("KeyboardShortcut"); + if ($conf->browser->name == 'chrome') { + $stringforfirstkey .= ' ALT +'; + } elseif ($conf->browser->name == 'firefox') { + $stringforfirstkey .= ' ALT + SHIFT +'; + } else { + $stringforfirstkey .= ' CTL +'; + } + // Defined the links for bottom of card - $profilLink = ' '.$langs->trans("Card").''; + $profilLink = ' '.$langs->trans("Card").''; $urltovirtualcard = '/user/virtualcard.php?id='.((int) $user->id); - $virtuelcardLink = dolButtonToOpenUrlInDialogPopup('publicvirtualcardmenu', $langs->trans("PublicVirtualCardUrl").(is_object($user) ? ' - '.$user->getFullName($langs) : ''), img_picto($langs->trans("PublicVirtualCardUrl"), 'card', ''), $urltovirtualcard, '', 'button-top-menu-dropdown marginleftonly nohover', "closeTopMenuLoginDropdown()", '', 'v'); - $logoutLink = ''.$langs->trans("Logout").''; + $virtuelcardLink = dolButtonToOpenUrlInDialogPopup('publicvirtualcardmenu', $langs->trans("PublicVirtualCardUrl").(is_object($user) ? ' - '.$user->getFullName($langs) : '').' ('.$stringforfirstkey.' v)', img_picto($langs->trans("PublicVirtualCardUrl").' ('.$stringforfirstkey.' v)', 'card', ''), $urltovirtualcard, '', 'button-top-menu-dropdown marginleftonly nohover', "closeTopMenuLoginDropdown()", '', 'v'); + $logoutLink = ''.$langs->trans("Logout").''; $profilName = $user->getFullName($langs).' ('.$user->login.')'; if (!empty($user->admin)) { @@ -2525,9 +2545,20 @@ function top_menu_quickadd() $html = ''; + // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox + // accesskey is for Mac: CTRL + key for all browsers + $stringforfirstkey = $langs->trans("KeyboardShortcut"); + if ($conf->browser->name == 'chrome') { + $stringforfirstkey .= ' ALT +'; + } elseif ($conf->browser->name == 'firefox') { + $stringforfirstkey .= ' ALT + SHIFT +'; + } else { + $stringforfirstkey .= ' CTL +'; + } + $html .= ' '; $html .= ' @@ -2544,6 +2575,7 @@ function top_menu_quickadd() console.log("Click on #topmenu-quickadd-dropdown .dropdown-toggle"); openQuickAddDropDown(); }); + // Key map shortcut $(document).keydown(function(e){ if( e.which === 76 && e.ctrlKey && e.shiftKey ){ @@ -2552,7 +2584,6 @@ function top_menu_quickadd() } }); - var openQuickAddDropDown = function() { event.preventDefault(); $("#topmenu-quickadd-dropdown").toggleClass("open"); @@ -2759,6 +2790,17 @@ function top_menu_bookmark() return $html; } + // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox + // accesskey is for Mac: CTRL + key for all browsers + $stringforfirstkey = $langs->trans("KeyboardShortcut"); + if ($conf->browser->name == 'chrome') { + $stringforfirstkey .= ' ALT +'; + } elseif ($conf->browser->name == 'firefox') { + $stringforfirstkey .= ' ALT + SHIFT +'; + } else { + $stringforfirstkey .= ' CTL +'; + } + if (!defined('JS_JQUERY_DISABLE_DROPDOWN') && !empty($conf->use_javascript_ajax)) { // This may be set by some pages that use different jquery version to avoid errors include_once DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php'; $langs->load("bookmarks"); @@ -2770,7 +2812,7 @@ function top_menu_bookmark() } else { $html .= '