diff --git a/css/backoffice/components/toolbar/_toolbar-spacer.scss b/css/backoffice/components/toolbar/_toolbar-spacer.scss index 8c383d7a4..cb9f490af 100644 --- a/css/backoffice/components/toolbar/_toolbar-spacer.scss +++ b/css/backoffice/components/toolbar/_toolbar-spacer.scss @@ -4,8 +4,6 @@ */ -.ibo-toolbar--button { - .ibo-toolbar-spacer { - flex-grow: 1; - } +.ibo-toolbar-spacer { + flex-grow: 1; } \ No newline at end of file diff --git a/datamodels/2.x/combodo-db-tools/dbtools.php b/datamodels/2.x/combodo-db-tools/dbtools.php index 5a730dcb6..f53ebf3fb 100644 --- a/datamodels/2.x/combodo-db-tools/dbtools.php +++ b/datamodels/2.x/combodo-db-tools/dbtools.php @@ -17,6 +17,19 @@ * You should have received a copy of the GNU Affero General Public License */ +use Combodo\iTop\Application\UI\Base\Component\Alert\AlertUIBlockFactory; +use Combodo\iTop\Application\UI\Base\Component\Button\ButtonUIBlockFactory; +use Combodo\iTop\Application\UI\Base\Component\CollapsibleSection\CollapsibleSectionUIBlockFactory; +use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableUIBlockFactory; +use Combodo\iTop\Application\UI\Base\Component\FieldSet\FieldSetUIBlockFactory; +use Combodo\iTop\Application\UI\Base\Component\Form\FormUIBlockFactory; +use Combodo\iTop\Application\UI\Base\Component\Html\Html; +use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory; +use Combodo\iTop\Application\UI\Base\Component\Panel\PanelUIBlockFactory; +use Combodo\iTop\Application\UI\Base\Component\Title\TitleUIBlockFactory; +use Combodo\iTop\Application\UI\Base\Component\Toolbar\Separator\ToolbarSeparatorUIBlockFactory; +use Combodo\iTop\Application\UI\Base\Component\Toolbar\ToolbarUIBlockFactory; +use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory; use Combodo\iTop\DBTools\Service\DBAnalyzerUtils; @include_once('../../approot.inc.php'); @@ -38,157 +51,110 @@ const MAX_RESULTS = 10; function DisplayDBInconsistencies(iTopWebPage &$oP, ApplicationContext &$oAppContext) { $iShowId = intval(utils::ReadParam('show_id', '0')); - $sErrorLabelSelection = utils::ReadParam('error_selection', ''); $sClassSelection = utils::ReadParam('class_selection', ''); - if (!empty($sClassSelection)) - { + if (!empty($sClassSelection)) { $aClassSelection = explode(",", $sClassSelection); - } - else - { + } else { $aClassSelection = array(); } - $sClassSelection = utils::ReadParam('class_selection', ''); $oP->SetCurrentTab('DBTools:Inconsistencies'); $bRunAnalysis = intval(utils::ReadParam('run_analysis', '0')); - if ($bRunAnalysis) - { + if ($bRunAnalysis) { $oDBAnalyzer = new DatabaseAnalyzer(0); $aResults = $oDBAnalyzer->CheckIntegrity($aClassSelection); - if (empty($aResults)) - { - $oP->p('
'.Dict::S('DBTools:NoError').'
'); + if (empty($aResults)) { + $oAlert = AlertUIBlockFactory::MakeForSuccess(Dict::S('DBTools:NoError')); + $oP->AddUiBlock($oAlert); } } - $oP->add('
'); - $oP->add("
"); - $oP->add(''); + $oPanel = FieldSetUIBlockFactory::MakeStandard(Dict::S('DBTools:SelectAnalysisType')); + $oP->AddUiBlock($oPanel); + $oForm = FormUIBlockFactory::MakeStandard(); + $oPanel->AddSubBlock($oForm); - $oP->add("\n"); + $oToolbar = ToolbarUIBlockFactory::MakeStandard(); + $oForm->AddSubBlock($oToolbar); - $oP->add("
"); - $sChecked = ($iShowId == 0) ? 'checked' : ''; - $oP->add("'); - $oP->add(""); - $sChecked = ($iShowId == 1) ? 'checked' : ''; - $oP->add("'); - $oP->add(""); - $sChecked = ($iShowId == 3) ? 'checked' : ''; - $oP->add("'); - $oP->add("

\n"); + $oInput = InputUIBlockFactory::MakeForInputWithLabel(Dict::S('DBTools:HideIds'), 'show_id'); + $oToolbar->AddSubBlock($oInput); + $oInput->GetInput()->SetType('radio'); + $oInput->GetInput()->SetValue('0'); + $oInput->GetInput()->SetIsChecked($iShowId == 0); + $oInput->GetInput()->AddCSSClasses(['ibo-input-checkbox', 'ibo-input--label-left']); - $oP->add("\n"); - $oP->add(''); - $oP->add(''); - $oP->add(''); - $oP->add(''); - $oP->add(''); - $oP->add($oAppContext->GetForForm()); - $oP->add("
\n"); - $oP->add('
'); + $oToolbar->AddSubBlock(ToolbarSeparatorUIBlockFactory::MakeVertical()); + + $oInput = InputUIBlockFactory::MakeForInputWithLabel(Dict::S('DBTools:ShowIds'), 'show_id'); + $oToolbar->AddSubBlock($oInput); + $oInput->GetInput()->SetType('radio'); + $oInput->GetInput()->SetValue('1'); + $oInput->GetInput()->SetIsChecked($iShowId == 1); + $oInput->GetInput()->AddCSSClasses(['ibo-input-checkbox', 'ibo-input--label-left']); + + $oToolbar->AddSubBlock(ToolbarSeparatorUIBlockFactory::MakeVertical()); + + $oInput = InputUIBlockFactory::MakeForInputWithLabel(Dict::S('DBTools:ShowReport'), 'show_id'); + $oToolbar->AddSubBlock($oInput); + $oInput->GetInput()->SetType('radio'); + $oInput->GetInput()->SetValue('3'); + $oInput->GetInput()->SetIsChecked($iShowId == 3); + $oInput->GetInput()->AddCSSClasses(['ibo-input-checkbox', 'ibo-input--label-left']); + + $oButton = ButtonUIBlockFactory::MakeForPrimaryAction(Dict::S('DBTools:Analyze'), null, null, true); + // TODO 3.0 Spacing ? + $oButton->AddCSSClasses(['mt-5', 'mb-5']); + $oForm->AddSubBlock($oButton); + + $oInput = InputUIBlockFactory::MakeForHidden('class_selection', $sClassSelection); + $oForm->AddSubBlock($oInput); + $oInput = InputUIBlockFactory::MakeForHidden('run_analysis', 1); + $oForm->AddSubBlock($oInput); + $oInput = InputUIBlockFactory::MakeForHidden('exec_module', 'combodo-db-tools'); + $oForm->AddSubBlock($oInput); + $oInput = InputUIBlockFactory::MakeForHidden('exec_page', 'dbtools.php'); + $oForm->AddSubBlock($oInput); + $oForm->AddSubBlock($oAppContext->GetForFormBlock()); - if (!empty($sErrorLabelSelection) || !empty($sClassSelection)) - { - $oP->add("
"); - $oP->add("
"); - $oP->add(''); - $oP->add(''); - $oP->add(''); - $oP->add(''); - $oP->add(''); - $oP->add("\n"); - $oP->add("
\n"); + if (!empty($sErrorLabelSelection) || !empty($sClassSelection)) { + $oForm = FormUIBlockFactory::MakeStandard(); + $oP->AddUiBlock($oForm); + $oInput = InputUIBlockFactory::MakeForHidden('show_id', '0'); + $oForm->AddSubBlock($oInput); + $oInput = InputUIBlockFactory::MakeForHidden('class_selection', ''); + $oForm->AddSubBlock($oInput); + $oInput = InputUIBlockFactory::MakeForHidden('error_selection', ''); + $oForm->AddSubBlock($oInput); + $oInput = InputUIBlockFactory::MakeForHidden('exec_module', 'combodo-db-tools'); + $oForm->AddSubBlock($oInput); + $oInput = InputUIBlockFactory::MakeForHidden('exec_page', 'dbtools.php'); + $oForm->AddSubBlock($oInput); + $oButton = ButtonUIBlockFactory::MakeForPrimaryAction(Dict::S('DBTools:ShowAll'), null, null, true); + $oForm->AddSubBlock($oButton); } - if (!empty($aResults)) - { - - if ($iShowId == 3) - { + if (!empty($aResults)) { + if ($iShowId == 3) { + // Report DisplayInconsistenciesReport($aResults); } - $oP->p(Dict::S('DBTools:ErrorsFound')); + $oPanel = PanelUIBlockFactory::MakeForWarning(Dict::S('DBTools:ErrorsFound')); + $oPanel->AddCSSClass('ibo-datatable-panel'); + $oP->AddUiBlock($oPanel); - $oP->add(''); - $bTable = true; - foreach($aResults as $sClass => $aErrorList) - { - foreach($aErrorList as $sErrorLabel => $aError) - { - if (!empty($sErrorLabelSelection) && ($sErrorLabel != $sErrorLabelSelection)) - { - continue; - } - - if (!$bTable) - { - $oP->add('
'); - $oP->add('
'.Dict::S('DBTools:Class').''.Dict::S('DBTools:Count').''.Dict::S('DBTools:Error').'
'); - $bTable = true; - } - - $oP->add(''); - - - $oP->add(''); - $iCount = $aError['count']; - $oP->add(''); - $oP->add(''); - $oP->add(''); - - if ($iShowId > 0) - { - $oP->add('
ClassCountError
'.MetaModel::GetName($sClass).' ('.$sClass.')'.$iCount.''.$sErrorLabel.'
'); - $bTable = false; - $oP->p(Dict::S('DBTools:SQLquery')); - $sQuery = $aError['query']; - $oP->add('
'); - $oP->add(''.$sQuery.''); - $oP->add('
'); - - if (isset($aError['fixit'])) - { - $oP->p(Dict::S('DBTools:FixitSQLquery')); - $aQueries = $aError['fixit']; - $oP->add('
'); - foreach($aQueries as $sFixQuery) - { - $oP->add('
'.$sFixQuery.'
'); - } - $oP->add('
'); - } - - $oP->p(Dict::S('DBTools:SQLresult')); - $sQueryResult = ''; - $iCount = count($aError['res']); - $iMaxCount = MAX_RESULTS; - foreach($aError['res'] as $aRes) - { - $iMaxCount--; - if ($iMaxCount < 0) - { - $sQueryResult .= 'Displayed '.MAX_RESULTS."/$iCount results.
"; - break; - } - foreach($aRes as $sKey => $sValue) - { - $sQueryResult .= "'$sKey'='$sValue' "; - } - $sQueryResult .= '
'; - } - $oP->add('
'); - $oP->add(''.$sQueryResult.''); - $oP->add('
'); - } - } + if ($iShowId == 0) { + // Error List + $oPanel->AddSubBlock(DisplayErrorList($aResults)); + } else { + // Detail List + $oPanel->AddSubBlock(DisplayErrorDetails($aResults)); } - $oP->add(''); } + return $oP; } @@ -221,6 +187,84 @@ function DisplayInconsistenciesReport($aResults) exit(0); } +/** + * @param $aResults + * + * @return \Combodo\iTop\Application\UI\Base\UIBlock + * @throws \CoreException + * @throws \DictExceptionMissingString + */ +function DisplayErrorList($aResults) +{ + $aColumns = [ + 'class' => ['label' => Dict::S('DBTools:Class')], + 'count' => ['label' => Dict::S('DBTools:Count')], + 'error' => ['label' => Dict::S('DBTools:Error')], + ]; + $aRows = []; + + foreach ($aResults as $sClass => $aErrorList) { + foreach ($aErrorList as $sErrorLabel => $aError) { + $aRows[] = [ + 'class' => MetaModel::GetName($sClass).' ('.$sClass.')', + 'count' => $aError['count'], + 'error' => $sErrorLabel, + ]; + } + } + + return DataTableUIBlockFactory::MakeForForm('', $aColumns, $aRows); +} + +function DisplayErrorDetails($aResults) +{ + $oBlock = UIContentBlockUIBlockFactory::MakeStandard(); + + foreach ($aResults as $sClass => $aErrorList) { + foreach ($aErrorList as $sErrorLabel => $aError) { + + $sErrorTitle = Dict::Format('DBTools:DetailedErrorTitle', MetaModel::GetName($sClass).' ('.$sClass.')', $aError['count'], $sErrorLabel); + $oCollapsible = CollapsibleSectionUIBlockFactory::MakeStandard($sErrorTitle); + $oBlock->AddSubBlock($oCollapsible); + + $oFieldSet = FieldSetUIBlockFactory::MakeStandard(Dict::S('DBTools:SQLquery')); + $oCollapsible->AddSubBlock($oFieldSet); + $oFieldSet->AddSubBlock(new Html("
{$aError['query']}
")); + + if (isset($aError['fixit'])) { + $oFieldSet = FieldSetUIBlockFactory::MakeStandard(Dict::S('DBTools:FixitSQLquery')); + $oCollapsible->AddSubBlock($oFieldSet); + + $aQueries = $aError['fixit']; + foreach ($aQueries as $sFixQuery) { + $oFieldSet->AddSubBlock(new Html("
{$sFixQuery}
")); + } + } + + $oFieldSet = FieldSetUIBlockFactory::MakeStandard(Dict::S('DBTools:SQLresult')); + $oCollapsible->AddSubBlock($oFieldSet); + + $sQueryResult = ''; + $iCount = count($aError['res']); + $iMaxCount = MAX_RESULTS; + foreach ($aError['res'] as $aRes) { + $iMaxCount--; + if ($iMaxCount < 0) { + $sQueryResult .= 'Displayed '.MAX_RESULTS."/$iCount results.
"; + break; + } + foreach ($aRes as $sKey => $sValue) { + $sQueryResult .= "'$sKey'='$sValue' "; + } + $sQueryResult .= '
'; + } + $oFieldSet->AddSubBlock(new Html("
{$sQueryResult}
")); + } + } + + return $oBlock; +} + /** * @param iTopWebPage $oP * @param ApplicationContext $oAppContext @@ -246,29 +290,37 @@ function DisplayLostAttachments(iTopWebPage &$oP, ApplicationContext &$oAppConte // Build HTML $oP->SetCurrentTab('DBTools:LostAttachments'); - $oP->add('
'); - $oP->add('
'); + $oLostAttachmentsBlock = UIContentBlockUIBlockFactory::MakeStandard(null, ['ibo-dbt-lostattachments']); + $oP->AddUiBlock($oLostAttachmentsBlock); - $oP->add('
'.Dict::S('DBTools:LostAttachments:Disclaimer').'
'); - $oP->add('
'); - $oP->add('
'); - $oP->add(''); - $oP->add(''); + $oForm = FormUIBlockFactory::MakeStandard(); + $oLostAttachmentsBlock->AddSubBlock($oForm); + + $oInput = InputUIBlockFactory::MakeForHidden('exec_module', 'combodo-db-tools'); + $oForm->AddSubBlock($oInput); + $oInput = InputUIBlockFactory::MakeForHidden('exec_page', 'dbtools.php'); + $oForm->AddSubBlock($oInput); // Step 1: Analyze DB - $oP->add('

1.'.Dict::S('DBTools:LostAttachments:Step:Analyze').'

'); + if (!$bDoAnalyze) { + $oAlert = AlertUIBlockFactory::MakeForInformation(Dict::S('DBTools:LostAttachments:Disclaimer')); + $oForm->AddSubBlock($oAlert); + + $oPanel = FieldSetUIBlockFactory::MakeStandard(Dict::S('DBTools:LostAttachments:Step:Analyze')); + $oForm->AddSubBlock($oPanel); + $oButton = ButtonUIBlockFactory::MakeForPrimaryAction(Dict::S('DBTools:LostAttachments:Button:Analyze'), 'step_name', 'analyze', true); + // TODO 3.0 Spacing ? + $oButton->AddCSSClasses(['mt-5', 'mb-5']); + $oPanel->AddSubBlock($oButton); + } // Step 2: Display results - if($bDoAnalyze) - { + if ($bDoAnalyze) { // Check if we have to restore some items first - if($bDoRestore) - { - foreach($aRecordsToClean as $sRecordToClean) - { + if ($bDoRestore) { + foreach ($aRecordsToClean as $sRecordToClean) { utils::PushArchiveMode(false); // For iTop < 2.5, the application can be wrongly set to archive mode true when it fails from retrieving an object. See r5340. - try - { + try { // Retrieve attachment $aLocationParts = explode('::', $sRecordToClean); /** @var \DBObject $oOriginObject */ @@ -308,8 +360,7 @@ function DisplayLostAttachments(iTopWebPage &$oP, ApplicationContext &$oAppConte $iRestoredItemsCount++; } - catch(Exception $e) - { + catch (Exception $e) { $aErrorsReport[] = 'Could not restore attachment from '.$sRecordToClean.', cause: '.$e->getMessage(); } utils::PopArchiveMode(); @@ -321,23 +372,30 @@ function DisplayLostAttachments(iTopWebPage &$oP, ApplicationContext &$oAppConte $sSelWrongRecs = 'SELECT id, secret, "InlineImage" AS current_class, id AS current_id, item_class AS target_class, item_id AS target_id, contents_filename AS filename FROM '.$sInlineImageDBTable.' WHERE contents_mimetype NOT LIKE "image/%"'; $aWrongRecords = CMDBSource::QueryToArray($sSelWrongRecs); - $oP->add('
'); - $oP->add('

2.'.Dict::S('DBTools:LostAttachments:Step:AnalyzeResults').'

'); - if(empty($aWrongRecords)) - { - $oP->add('
'.Dict::S('DBTools:LostAttachments:Step:AnalyzeResults:None').'
'); - } - else - { - $oP->add('
'.Dict::Format('DBTools:LostAttachments:Step:AnalyzeResults:Some', count($aWrongRecords)).'
'); + if (empty($aWrongRecords)) { + $oAlert = AlertUIBlockFactory::MakeForSuccess(Dict::S('DBTools:LostAttachments:Step:AnalyzeResults:None')); + $oForm->AddSubBlock($oAlert); + } else { + // Errors found + $oAlert = AlertUIBlockFactory::MakeForFailure(Dict::Format('DBTools:LostAttachments:Step:AnalyzeResults:Some', count($aWrongRecords))); + // TODO 3.0 Spacing ? + $oAlert->AddCSSClass('mb-5'); + $oForm->AddSubBlock($oAlert); + + $oPanel = PanelUIBlockFactory::MakeForWarning(Dict::S('DBTools:LostAttachments:Step:AnalyzeResults')); + $oPanel->AddCSSClass('ibo-datatable-panel'); + $oForm->AddSubBlock($oPanel); // Display errors as table - $oP->add(''); - $oP->add(''); - - foreach($aWrongRecords as $iIndex => $aWrongRecord) - { + $aColumns = [ + 'select' => ['label' => ''], + 'filename' => ['label' => Dict::S('DBTools:LostAttachments:Step:AnalyzeResults:Item:Filename')], + 'location' => ['label' => Dict::S('DBTools:LostAttachments:Step:AnalyzeResults:Item:CurrentLocation')], + 'target' => ['label' => Dict::S('DBTools:LostAttachments:Step:AnalyzeResults:Item:TargetLocation')], + ]; + $aRows = []; + foreach ($aWrongRecords as $iIndex => $aWrongRecord) { $sCurrentClass = $aWrongRecord['current_class']; $sCurrentId = $aWrongRecord['current_id']; @@ -349,76 +407,79 @@ function DisplayLostAttachments(iTopWebPage &$oP, ApplicationContext &$oAppConte $sFilename = ''.$aWrongRecord['filename'].''; - $sRowClass = ($iIndex % 2 === 0) ? 'odd' : 'even'; // (Starts at 0, not 1) - $oP->add(''); + $aRows[] = [ + 'select' => '', + 'filename' => $sFilename, + 'location' => $sRecordToClean, + 'target' => $sTargetLocation, + ]; + // $oP->add(''); } - $oP->add('
'.Dict::S('DBTools:LostAttachments:Step:AnalyzeResults:Item:Filename').''.Dict::S('DBTools:LostAttachments:Step:AnalyzeResults:Item:CurrentLocation').''.Dict::S('DBTools:LostAttachments:Step:AnalyzeResults:Item:TargetLocation').'
'.$sFilename.''.$sRecordToClean.''.$sTargetLocation.'
'.$sFilename.''.$sRecordToClean.''.$sTargetLocation.'
'); - $oP->add('
'); + $oTable = DataTableUIBlockFactory::MakeForForm('results', $aColumns, $aRows); + $oPanel->AddSubBlock($oTable); + /** @var \Combodo\iTop\Application\UI\Base\Component\Button\ButtonJS $oButton */ + $oButton = ButtonUIBlockFactory::MakeForPrimaryAction(Dict::S('DBTools:LostAttachments:Button:Restore'), 'step_name', 'restore', true); + // TODO 3.0 Spacing ? + $oButton->AddCSSClasses(['mt-5', 'ml-5']); + $oButton->SetIsDisabled(true); + $oPanel->AddSubBlock($oButton); + // JS to handle checkboxes and button $oP->add_ready_script( -<< 0 ) + if( $('.ibo-dbt-lostattachments .dbt-cbx:not(:checked)').length > 0 ) { - $('.dbt-lostattachments .dbt-toggler-cbx').prop('checked', false); + $('.ibo-dbt-lostattachments .dbt-toggler-cbx').prop('checked', false); } }); EOF ); } - $oP->add('
'); } // Step 3: Restore results - if($bDoRestore) - { - $oP->add('
'); - $oP->add('

3.'.Dict::S('DBTools:LostAttachments:Step:RestoreResults').'

'); + if ($bDoRestore) { + $oPanel = FieldSetUIBlockFactory::MakeStandard(Dict::S('DBTools:LostAttachments:Step:RestoreResults')); + $oForm->AddSubBlock($oPanel); - $oP->add('
'.Dict::Format('DBTools:LostAttachments:Step:RestoreResults:Results', $iRestoredItemsCount, $iRecordsToCleanCount).'
'); + $oAlert = AlertUIBlockFactory::MakeForSuccess(Dict::Format('DBTools:LostAttachments:Step:RestoreResults:Results', $iRestoredItemsCount, $iRecordsToCleanCount)); + $oPanel->AddSubBlock($oAlert); - if(!empty($aErrorsReport)) - { - foreach($aErrorsReport as $sErrorReport) - { - $oP->add('
'.$sErrorReport.'
'); + if (!empty($aErrorsReport)) { + foreach ($aErrorsReport as $sErrorReport) { + + $oAlert = AlertUIBlockFactory::MakeForFailure($sErrorReport); + $oPanel->AddSubBlock($oAlert); } } - - $oP->add('
'); } - - $oP->add($oAppContext->GetForForm()); - $oP->add('
'); - $oP->add('
'); - - $oP->add('
'); - $oP->add('
'); + $oForm->AddSubBlock($oAppContext->GetForFormBlock()); // Buttons disabling on click $sConfirmText = Dict::S('DBTools:LostAttachments:Button:Restore:Confirm'); $sButtonBusyText = Dict::S('DBTools:LostAttachments:Button:Busy'); $oP->add_ready_script( -<<add_saas('env-'.utils::GetCurrentEnvironment().'/combodo-db-tools/default.scss'); - $oP->add( - << -

$sPageTitle

- -EOF - ); + $oTitle = TitleUIBlockFactory::MakeForPage($sPageTitle); + $oP->AddUiBlock($oTitle); + $oP->AddTabContainer('db-tools'); $oP->SetCurrentTabContainer('db-tools'); @@ -476,12 +528,10 @@ EOF // Lost attachments $oP = DisplayLostAttachments($oP, $oAppContext); } -catch (Exception $e) -{ +catch (Exception $e) { $oP->p(''.$e->getMessage().''); } -if (isset($oP)) -{ +if (isset($oP)) { $oP->output(); } diff --git a/datamodels/2.x/combodo-db-tools/dictionaries/en.dict.combodo-db-tools.php b/datamodels/2.x/combodo-db-tools/dictionaries/en.dict.combodo-db-tools.php index 84add3c25..fd1a72c62 100644 --- a/datamodels/2.x/combodo-db-tools/dictionaries/en.dict.combodo-db-tools.php +++ b/datamodels/2.x/combodo-db-tools/dictionaries/en.dict.combodo-db-tools.php @@ -39,12 +39,14 @@ Dict::Add('EN US', 'English', 'English', array( 'DBTools:ShowReport' => 'Report', 'DBTools:IntegrityCheck' => 'Integrity check', 'DBTools:FetchCheck' => 'Fetch Check (long)', + 'DBTools:SelectAnalysisType' => 'Select analysis type', 'DBTools:Analyze' => 'Analyze', 'DBTools:Details' => 'Show Details', 'DBTools:ShowAll' => 'Show All Errors', 'DBTools:Inconsistencies' => 'Database inconsistencies', + 'DBTools:DetailedErrorTitle' => '%2$s error(s) in class %1$s: %3$s', 'DBAnalyzer-Integrity-OrphanRecord' => 'Orphan record in `%1$s`, it should have its counterpart in table `%2$s`', 'DBAnalyzer-Integrity-InvalidExtKey' => 'Invalid external key %1$s (column: `%2$s.%3$s`)', diff --git a/datamodels/2.x/combodo-db-tools/dictionaries/fr.dict.combodo-db-tools.php b/datamodels/2.x/combodo-db-tools/dictionaries/fr.dict.combodo-db-tools.php index a63fffe0d..dbce09b84 100644 --- a/datamodels/2.x/combodo-db-tools/dictionaries/fr.dict.combodo-db-tools.php +++ b/datamodels/2.x/combodo-db-tools/dictionaries/fr.dict.combodo-db-tools.php @@ -34,12 +34,14 @@ Dict::Add('FR FR', 'French', 'Français', array( 'DBTools:ShowReport' => 'Rapport', 'DBTools:IntegrityCheck' => 'Contrôle d\'intégrité', 'DBTools:FetchCheck' => 'Contrôle de récupération (long)', + 'DBTools:SelectAnalysisType' => 'Type d\'analyse', 'DBTools:Analyze' => 'Analyser', 'DBTools:Details' => 'Afficher détails', 'DBTools:ShowAll' => 'Afficher toutes les erreurs', 'DBTools:Inconsistencies' => 'Incohérences de base de données', + 'DBTools:DetailedErrorTitle' => '%2$s erreur(s) dans la classe %1$s : %3$s', 'DBAnalyzer-Integrity-OrphanRecord' => 'Enregistrement orphelin dans `%1$s`, il devrait avoir son équivalent dans la tableit `%2$s`', 'DBAnalyzer-Integrity-InvalidExtKey' => 'Clef externe invalide %1$s (colonne: `%2$s.%3$s`)', diff --git a/sources/application/UI/Base/Component/DataTable/StaticTable/StaticTable.php b/sources/application/UI/Base/Component/DataTable/StaticTable/StaticTable.php index 637771cec..4ba494d57 100644 --- a/sources/application/UI/Base/Component/DataTable/StaticTable/StaticTable.php +++ b/sources/application/UI/Base/Component/DataTable/StaticTable/StaticTable.php @@ -105,7 +105,7 @@ class StaticTable extends UIContentBlock } /** - * @param string $sUrlForRefresh + * @param string $sFilter */ public function SetFilter($sFilter): void { diff --git a/templates/base/components/datatable/static/formtable/layout.ready.js.twig b/templates/base/components/datatable/static/formtable/layout.ready.js.twig index 133f179ca..d8272199d 100644 --- a/templates/base/components/datatable/static/formtable/layout.ready.js.twig +++ b/templates/base/components/datatable/static/formtable/layout.ready.js.twig @@ -6,9 +6,15 @@ var table{{ oUIBlock.GetId()|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_ scrollCollapse: true, paging: false, filter: false, + autoWidth: false, search: false, dom: "t", "order": [], + {% if oUIBlock.GetOption("select_mode") is not empty %} + select: { + style: "{{ oUIBlock.GetOption("select_mode") }}" + }, + {% endif %} }); if ($('#{{ oUIBlock.GetId() }}').find('thead').is(':visible')) {