From 0da945ee291f7a4292ea90cf546d00f98284ec69 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 16 Mar 2021 18:28:18 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B03536=20-=20Dashboard:=20Finish=20integra?= =?UTF-8?q?tion=20of=20in=20the=20TopBar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/dashboard.class.inc.php | 36 ++++++---- css/backoffice/components/_toolbar.scss | 3 + css/backoffice/layout/_top-bar.scss | 90 +++++++++++++------------ dictionaries/en.dictionary.itop.ui.php | 4 +- dictionaries/fr.dictionary.itop.ui.php | 4 +- 5 files changed, 76 insertions(+), 61 deletions(-) diff --git a/application/dashboard.class.inc.php b/application/dashboard.class.inc.php index 753144b0f..5bd83fe1a 100644 --- a/application/dashboard.class.inc.php +++ b/application/dashboard.class.inc.php @@ -1021,20 +1021,21 @@ EOF */ protected function RenderSelector(WebPage $oPage, $aAjaxParams = array()) { + if (!$this->HasCustomDashboard()) { + return; + } $sId = $this->GetId(); $sDivId = utils::Sanitize($sId, '', 'element_identifier'); $sExtraParams = json_encode($aAjaxParams); - $sSelectorHtml = '
'; - if ($this->HasCustomDashboard()) { - $bStandardSelected = appUserPreferences::GetPref('display_original_dashboard_'.$sId, false); - $sStandard = Dict::S('UI:Toggle:StandardDashboard'); - $sSelectorHtml .= '
'.$sStandard.'
'; - $sSelectorHtml .= ''; - $sCustom = Dict::S('UI:Toggle:CustomDashboard'); - $sSelectorHtml .= '
'.$sCustom.'
'; - } + $sSwitchToStandard = Dict::S('UI:Toggle:SwitchToStandardDashboard'); + $sSwitchToCustom = Dict::S('UI:Toggle:SwitchToCustomDashboard'); + $bStandardSelected = appUserPreferences::GetPref('display_original_dashboard_'.$sId, false); + + $sSelectorHtml = '
'; + $sSelectorHtml .= ''; $sSelectorHtml .= '
'; + $sFile = addslashes($this->GetDefinitionFile()); $sReloadURL = $this->GetReloadURL(); @@ -1043,19 +1044,26 @@ EOF $oToolbar->AddHtml($sSelectorHtml); $oPage->add_script( - << 'A4 Landscape', 'UI:PrintResolution:LetterPortrait' => 'Letter Portrait', 'UI:PrintResolution:LetterLandscape' => 'Letter Landscape', - 'UI:Toggle:StandardDashboard' => 'Standard', - 'UI:Toggle:CustomDashboard' => 'Custom', + 'UI:Toggle:SwitchToStandardDashboard' => 'Switch to standard dashboard', + 'UI:Toggle:SwitchToCustomDashboard' => 'Switch to custom dashboard', 'UI:ConfigureThisList' => 'Configure This List...', 'UI:ListConfigurationTitle' => 'List Configuration', diff --git a/dictionaries/fr.dictionary.itop.ui.php b/dictionaries/fr.dictionary.itop.ui.php index 7758ddd30..7da18c0f1 100644 --- a/dictionaries/fr.dictionary.itop.ui.php +++ b/dictionaries/fr.dictionary.itop.ui.php @@ -1154,8 +1154,8 @@ Lors de l\'association à un déclencheur, on attribue à chaque action un numé 'UI:PrintResolution:A4Landscape' => 'A4 Paysage', 'UI:PrintResolution:LetterPortrait' => 'US Letter Portrait', 'UI:PrintResolution:LetterLandscape' => 'US Letter Paysage', - 'UI:Toggle:StandardDashboard' => 'Standard', - 'UI:Toggle:CustomDashboard' => 'Modifié', + 'UI:Toggle:SwitchToStandardDashboard' => 'Basculer sur le tableau de bord standard', + 'UI:Toggle:SwitchToCustomDashboard' => 'Basculer sur le tableau de bord modifié', 'UI:ConfigureThisList' => 'Configurer Cette Liste...', 'UI:ListConfigurationTitle' => 'Configuration de la liste',