From 3399a6dad5706f0db1cdb36cc2cbb7cbb276b53e Mon Sep 17 00:00:00 2001 From: Anthony Damhet <73399671+EchoLoGeek@users.noreply.github.com> Date: Fri, 25 Jul 2025 21:34:54 +0200 Subject: [PATCH] add links to home info-box (#34803) --- htdocs/index.php | 30 +++++++++++++++++++++++++++++- htdocs/theme/eldy/info-box.inc.php | 28 +++++++++++++++++++++++++++- htdocs/theme/md/info-box.inc.php | 28 ++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 2 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index c67cb92a81f..9db7239bc95 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -579,8 +579,32 @@ if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD') && getDolGlobalInt('MAI $groupElement['globalStats'] = array(); } + // Links + $arrayLinks = array( + 'action' => dol_buildpath('/comm/action/card.php?action=create', 1), + 'project' => dol_buildpath('/projet/card.php?action=create', 1), + 'propal' => dol_buildpath('/comm/propal/card.php?action=create', 1), + 'commande' => dol_buildpath('/commande/card.php?action=create', 1), + 'facture' => dol_buildpath('/compta/facture/card.php?action=create', 1), + 'supplier_proposal' => dol_buildpath('/supplier_proposal/card.php?action=create', 1), + 'order_supplier' => dol_buildpath('/fourn/commande/card.php?action=create', 1), + 'invoice_supplier' => dol_buildpath('/fourn/facture/card.php?action=create', 1), + 'contrat' => dol_buildpath('/contrat/card.php?action=create', 1), + 'ticket' => dol_buildpath('/ticket/card.php?action=create', 1), + 'bank_account' => dol_buildpath('/compta/bank/card.php?action=create', 1), + 'member' => dol_buildpath('/adherents/card.php?action=create', 1), + 'expensereport' => dol_buildpath('/expensereport/card.php?action=create', 1), + 'holiday' => dol_buildpath('/holiday/card.php?action=create', 1), + 'cubes' => dol_buildpath('/mrp/mo_card.php?action=create', 1), + + ); + $infoboxMoreCss = ''; + if (array_key_exists($groupKey, $arrayLinks)) { + $infoboxMoreCss = 'infobox-haslink'; + } + $openedDashBoard .= '
'."\n"; - $openedDashBoard .= '
'."\n"; + $openedDashBoard .= '
'."\n"; $openedDashBoard .= ' '."\n"; $openedDashBoard .= ' '."\n"; @@ -590,6 +614,10 @@ if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD') && getDolGlobalInt('MAI $openedDashBoard .= ''.$groupElement['globalStats']['nbTotal'].''; } + if (array_key_exists($groupKey, $arrayLinks)) { + $openedDashBoard .= ' '."\n"; + } + $openedDashBoard .= ''."\n"; $openedDashBoard .= '
'."\n"; diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 17dcc123665..77577bc3868 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -318,7 +318,33 @@ a.info-box-text{ text-decoration: none;} } - +/* customize section for home box link */ +.infobox-haslink .info-box-icon i { + transition: opacity 0.2s ease-in-out; +} +.infobox-haslink .info-box-icon:hover i { + opacity: 0.2; +} +.infobox-haslink .info-box-icon .info-box-createlink { + height:100%; + width:100%; + display:block; + position:absolute; + top:0; + left:0; + font-size:0.6em; + display: flex; + opacity: 0; + transition: opacity 0.2s ease-in-out; + color:inherit; + text-decoration: none; +} +.infobox-haslink .info-box-icon:hover .info-box-createlink { + opacity: 1; +} +.infobox-haslink .info-box-icon .info-box-createlink span.fas { + margin:auto; +} /* ICONS INFO BOX */ diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index 608145db35a..2d76ac33f1c 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -719,3 +719,31 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) { width: 250px; } } + +/* customize section for home box link */ +.infobox-haslink .info-box-icon i { + transition: opacity 0.2s ease-in-out; +} +.infobox-haslink .info-box-icon:hover i { + opacity: 0.2; +} +.infobox-haslink .info-box-icon .info-box-createlink { + height:100%; + width:100%; + display:block; + position:absolute; + top:0; + left:0; + font-size:0.6em; + display: flex; + opacity: 0; + transition: opacity 0.2s ease-in-out; + color:inherit; + text-decoration: none; +} +.infobox-haslink .info-box-icon:hover .info-box-createlink { + opacity: 1; +} +.infobox-haslink .info-box-icon .info-box-createlink span.fas { + margin:auto; +} \ No newline at end of file