mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°931: "Empty" message added to the tag usage tab
This commit is contained in:
@@ -234,21 +234,29 @@ abstract class TagSetFieldData extends cmdbAbstractObject
|
||||
$oSet = new DBObjectSet($oFilter);
|
||||
$iCount = $oSet->Count();
|
||||
$oPage->SetCurrentTab(Dict::Format('Core:TagSetFieldData:WhereIsThisTagTab', $iCount));
|
||||
$aClassLabels = array();
|
||||
foreach(MetaModel::EnumChildClasses($sClass) as $sCurrentClass)
|
||||
if ($iCount === 0)
|
||||
{
|
||||
$aClassLabels[$sCurrentClass] = MetaModel::GetName($sCurrentClass);
|
||||
$sNoEntries = Dict::S('Core:TagSetFieldData:NoEntryFound');
|
||||
$oPage->add("<p>$sNoEntries</p>");
|
||||
}
|
||||
|
||||
foreach($aClassLabels as $sClass => $sClassLabel)
|
||||
else
|
||||
{
|
||||
$oFilter = DBSearch::FromOQL("SELECT $sClass WHERE $sAttCode MATCHES '$sTagCode'");
|
||||
$oSet = new DBObjectSet($oFilter);
|
||||
if ($oSet->CountExceeds(0))
|
||||
$aClassLabels = array();
|
||||
foreach(MetaModel::EnumChildClasses($sClass) as $sCurrentClass)
|
||||
{
|
||||
$oPage->add("<h2>$sClassLabel</h2>");
|
||||
$oResultBlock = new DisplayBlock($oFilter, 'list', false);
|
||||
$oResultBlock->Display($oPage, 1);
|
||||
$aClassLabels[$sCurrentClass] = MetaModel::GetName($sCurrentClass);
|
||||
}
|
||||
|
||||
foreach($aClassLabels as $sClass => $sClassLabel)
|
||||
{
|
||||
$oFilter = DBSearch::FromOQL("SELECT $sClass WHERE $sAttCode MATCHES '$sTagCode'");
|
||||
$oSet = new DBObjectSet($oFilter);
|
||||
if ($oSet->CountExceeds(0))
|
||||
{
|
||||
$oPage->add("<h2>$sClassLabel</h2>");
|
||||
$oResultBlock = new DisplayBlock($oFilter, 'list', false);
|
||||
$oResultBlock->Display($oPage, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -923,4 +923,5 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
'Core:TagSetFieldData:ErrorTagLabelSyntax' => 'Tags label should not contain | nor be empty',
|
||||
'Core:TagSetFieldData:ErrorCodeUpdateNotAllowed' => 'Tags code cannot be changed',
|
||||
'Core:TagSetFieldData:WhereIsThisTagTab' => 'Tag usage (%1$d)',
|
||||
'Core:TagSetFieldData:NoEntryFound' => 'No entry found for this tag',
|
||||
));
|
||||
|
||||
@@ -774,4 +774,6 @@ Opérateurs :<br/>
|
||||
'Core:TagSetFieldData:ErrorTagLabelSyntax' => 'Le nom de l\'étiquette ne doit pas être vide ni contenir le caractère \'|\'',
|
||||
'Core:TagSetFieldData:ErrorCodeUpdateNotAllowed' => 'Le code de l\'étiquette ne peut pas être changé',
|
||||
'Core:TagSetFieldData:WhereIsThisTagTab' => 'Utilisation (%1$d)',
|
||||
'Core:TagSetFieldData:NoEntryFound' => 'Pas d\'utilisation de cette étiquette',
|
||||
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user