datamodel viewer : display children in search tree, search configured to "contains", viewed class is now added to the search input by default and more information about attribute null values/default values

SVN:trunk[5366]
This commit is contained in:
Stephen Abello
2018-02-23 15:37:00 +00:00
parent b739c00414
commit 06bc58f383
15 changed files with 65 additions and 21 deletions

View File

@@ -721,6 +721,7 @@ Dict::Add('CS CZ', 'Czech', 'Čeština', array(
'UI:Schema:DisplaySelector/Label' => 'Label~~',
'UI:Schema:DisplaySelector/Code' => 'Code~~',
'UI:Schema:Attribute/Filter' => 'Filter~~',
'UI:Schema:DefaultNullValue' => 'Default null : "%1$s"~~',
'UI:LinksWidget:Autocomplete+' => 'Zadejte první tři znaky...',
'UI:Edit:TestQuery' => 'Otestovat dotaz',
'UI:Combo:SelectValue' => '--- vyberte hodnotu ---',

View File

@@ -563,6 +563,7 @@ Dict::Add('DA DA', 'Danish', 'Dansk', array(
'UI:Schema:DisplaySelector/Label' => 'Label~~',
'UI:Schema:DisplaySelector/Code' => 'Code~~',
'UI:Schema:Attribute/Filter' => 'Filter~~',
'UI:Schema:DefaultNullValue' => 'Default null : "%1$s"~~',
'UI:LinksWidget:Autocomplete+' => '',
'UI:Edit:TestQuery' => 'Test forespørgsel',
'UI:Combo:SelectValue' => '--- vælg en værdi ---',

View File

@@ -564,6 +564,7 @@ Dict::Add('DE DE', 'German', 'Deutsch', array(
'UI:Schema:DisplaySelector/Label' => 'Label~~',
'UI:Schema:DisplaySelector/Code' => 'Code~~',
'UI:Schema:Attribute/Filter' => 'Filter~~',
'UI:Schema:DefaultNullValue' => 'Default null : "%1$s"~~',
'UI:LinksWidget:Autocomplete+' => 'Geben Sie die ersten 3 Buchstaben ein...',
'UI:Edit:TestQuery' => 'Query testen',
'UI:Combo:SelectValue' => '--- wählen Sie einen Wert ---',

View File

@@ -725,6 +725,7 @@ Dict::Add('EN US', 'English', 'English', array(
'UI:Schema:DisplaySelector/Label' => 'Label~~',
'UI:Schema:DisplaySelector/Code' => 'Code~~',
'UI:Schema:Attribute/Filter' => 'Filter~~',
'UI:Schema:DefaultNullValue' => 'Default null : "%1$s"~~',
'UI:LinksWidget:Autocomplete+' => 'Type the first 3 characters...',
'UI:Edit:TestQuery' => 'Test query',
'UI:Combo:SelectValue' => '--- select a value ---',

View File

@@ -722,6 +722,7 @@ Dict::Add('ES CR', 'Spanish', 'Español, Castellano', array(
'UI:Schema:DisplaySelector/Label' => 'Label~~',
'UI:Schema:DisplaySelector/Code' => 'Code~~',
'UI:Schema:Attribute/Filter' => 'Filter~~',
'UI:Schema:DefaultNullValue' => 'Default null : "%1$s"~~',
'UI:LinksWidget:Autocomplete+' => 'Escriba los primeros 3 caracteres...',
'UI:Edit:TestQuery' => 'Consulta de Prueba',
'UI:Combo:SelectValue' => '--- seleccione un valor ---',

View File

@@ -616,6 +616,7 @@ Dict::Add('FR FR', 'French', 'Français', array(
'UI:Schema:DisplaySelector/Label' => 'Label',
'UI:Schema:DisplaySelector/Code' => 'Code',
'UI:Schema:Attribute/Filter' => 'Filtre',
'UI:Schema:DefaultNullValue' => 'Valeur null par défaut : "%1$s"',
'UI:LinksWidget:Autocomplete+' => 'Tapez les 3 premiers caractères...',
'UI:Edit:TestQuery' => 'Tester la requête',
'UI:Combo:SelectValue' => '--- choisissez une valeur ---',

View File

@@ -495,6 +495,7 @@ Dict::Add('HU HU', 'Hungarian', 'Magyar', array(
'UI:Schema:DisplaySelector/Label' => 'Label~~',
'UI:Schema:DisplaySelector/Code' => 'Code~~',
'UI:Schema:Attribute/Filter' => 'Filter~~',
'UI:Schema:DefaultNullValue' => 'Default null : "%1$s"~~',
'UI:LinksWidget:Autocomplete+' => '',
'UI:Combo:SelectValue' => '--- válasszon értéket ---',
'UI:Label:SelectedObjects' => 'Kiválasztott objektumok: ',

View File

@@ -627,6 +627,7 @@ Dict::Add('IT IT', 'Italian', 'Italiano', array(
'UI:Schema:DisplaySelector/Label' => 'Label~~',
'UI:Schema:DisplaySelector/Code' => 'Code~~',
'UI:Schema:Attribute/Filter' => 'Filter~~',
'UI:Schema:DefaultNullValue' => 'Default null : "%1$s"~~',
'UI:LinksWidget:Autocomplete+' => '',
'UI:Combo:SelectValue' => '--- seleziona un valore ---',
'UI:Label:SelectedObjects' => 'oggetti selezionati: ',

View File

@@ -563,6 +563,7 @@ Dict::Add('JA JP', 'Japanese', '日本語', array(
'UI:Schema:DisplaySelector/Label' => 'Label~~',
'UI:Schema:DisplaySelector/Code' => 'Code~~',
'UI:Schema:Attribute/Filter' => 'Filter~~',
'UI:Schema:DefaultNullValue' => 'Default null : "%1$s"~~',
'UI:LinksWidget:Autocomplete+' => '最初の3文字をタイプしてください...',
'UI:Edit:TestQuery' => 'Test query',
'UI:Combo:SelectValue' => '--- 値を選んでください ---',

View File

@@ -722,6 +722,7 @@ Dict::Add('NL NL', 'Dutch', 'Nederlands', array(
'UI:Schema:DisplaySelector/Label' => 'Label~~',
'UI:Schema:DisplaySelector/Code' => 'Code~~',
'UI:Schema:Attribute/Filter' => 'Filter~~',
'UI:Schema:DefaultNullValue' => 'Default null : "%1$s"~~',
'UI:LinksWidget:Autocomplete+' => 'Typ de eerste 3 karakters...',
'UI:Edit:TestQuery' => 'Test query',
'UI:Combo:SelectValue' => '--- selecteer een waarde ---',

View File

@@ -714,6 +714,7 @@ Dict::Add('PT BR', 'Brazilian', 'Brazilian', array(
'UI:Schema:DisplaySelector/Label' => 'Label~~',
'UI:Schema:DisplaySelector/Code' => 'Code~~',
'UI:Schema:Attribute/Filter' => 'Filter~~',
'UI:Schema:DefaultNullValue' => 'Default null : "%1$s"~~',
'UI:LinksWidget:Autocomplete+' => 'Tipo os 3 primeiro caracteres...',
'UI:Edit:TestQuery' => 'Testar consulta',
'UI:Combo:SelectValue' => '--- selecione um valor ---',

View File

@@ -696,6 +696,7 @@ Dict::Add('RU RU', 'Russian', 'Русский', array(
'UI:Schema:DisplaySelector/Label' => 'Label~~',
'UI:Schema:DisplaySelector/Code' => 'Code~~',
'UI:Schema:Attribute/Filter' => 'Filter~~',
'UI:Schema:DefaultNullValue' => 'Default null : "%1$s"~~',
'UI:LinksWidget:Autocomplete+' => 'Введите первые 3 символа...',
'UI:Edit:TestQuery' => 'Проверить запрос',
'UI:Combo:SelectValue' => '--- выбор значения ---',

View File

@@ -601,6 +601,7 @@ Dict::Add('TR TR', 'Turkish', 'Türkçe', array(
'UI:Schema:DisplaySelector/Label' => 'Label~~',
'UI:Schema:DisplaySelector/Code' => 'Code~~',
'UI:Schema:Attribute/Filter' => 'Filter~~',
'UI:Schema:DefaultNullValue' => 'Default null : "%1$s"~~',
'UI:LinksWidget:Autocomplete+' => 'İlk 3 karakteri giriniz...',
'UI:Combo:SelectValue' => '--- değer seçiniz ---',
'UI:Label:SelectedObjects' => 'Seçilen nesneler: ',

View File

@@ -600,6 +600,7 @@ Dict::Add('ZH CN', 'Chinese', '简体中文', array(
'UI:Schema:DisplaySelector/Label' => 'Label~~',
'UI:Schema:DisplaySelector/Code' => 'Code~~',
'UI:Schema:Attribute/Filter' => 'Filter~~',
'UI:Schema:DefaultNullValue' => 'Default null : "%1$s"~~',
'UI:LinksWidget:Autocomplete+' => '输入前3个字符...',
'UI:Combo:SelectValue' => '--- 选择一个值 ---',
'UI:Label:SelectedObjects' => '被选对象: ',

View File

@@ -221,6 +221,30 @@ function DisplayClassesList($oPage, $sContext)
$oPage->add("<label for='search-model'>" . Dict::S('UI:Schema:ClassFilter') ."</label><input id='search-model'/> ");
$oPage->add("<ul id=\"ClassesList\" class=\"treeview fileview\">\n");
$oPage->add_ready_script(
<<<EOF
$("#search-model").result(function(){
$(this).trigger(jQuery.Event('input'));
});
$("#search-model").on('input', function() {
var search_result = [];
$("#ClassesList").find("li").each(function(){
if( ! ~$(this).children("a").text().toLowerCase().indexOf($("#search-model").val().toLowerCase())){
$(this).hide();
}
else{
search_result.push($(this));
}
});
search_result.forEach(function(e){
e.show();
e.find('ul > li').show();
e.parents().show();
});
});
EOF
);
// Get all the "root" classes for display
$aRootClasses = array();
foreach(MetaModel::GetClasses() as $sClassName)
@@ -716,7 +740,7 @@ function DisplayClassDetails($oPage, $sClass, $sContext)
$aOrigins[$sOrigin] = true;
$sAllowedValues = "";
$sMoreInfo = "";
$sDefaultNullValue = "";
$aCols = array();
foreach($oAttDef->GetSQLColumns() as $sCol => $sFieldDesc)
{
@@ -726,7 +750,19 @@ function DisplayClassDetails($oPage, $sClass, $sContext)
{
$aMoreInfo = array();
$aMoreInfo[] = $oAttDef->IsNullAllowed() ? Dict::S('UI:Schema:NullAllowed') : Dict::S('UI:Schema:NullNotAllowed');
if($oAttDef->IsNullAllowed())
{
$aMoreInfo[] = Dict::S('UI:Schema:NullAllowed');
$sDefaultNullValue = ($oAttDef->GetNullValue() !== null ? Dict::Format('UI:Schema:DefaultNullValue', $oAttDef->GetNullValue()) : "" );
}
else
{
$aMoreInfo[] = Dict::S('UI:Schema:NullNotAllowed');
}
if($oAttDef->GetDefaultValue())
{
$aMoreInfo[] = Dict::Format("UI:Schema:Default_Description", $oAttDef->GetDefaultValue());
}
$sMoreInfo .= implode(', ', $aMoreInfo);
}
$sAttrCode = $oAttDef->GetCode();
@@ -765,7 +801,7 @@ function DisplayClassDetails($oPage, $sClass, $sContext)
'origincolor' => "<span class=\"originColor" . $sOrigin ."\"></span>",
'origin' => "<span id=\"origin" . $sAttrCode ."\">$sOrigin</span>",
'values' => $sAllowedValues,
'moreinfo' => $sMoreInfo);
'moreinfo' => "<span id=\"moreinfo" . $sAttrCode . "\"> $sMoreInfo</span>");
//tooltip construction
$oPage->add_ready_script(
<<<EOF
@@ -781,6 +817,9 @@ function DisplayClassDetails($oPage, $sClass, $sContext)
if( !$sIsEnumValues && '$sAllowedValuesEscpd' != ''){
$('#values$sAttrCode').qtip( { content: '$sAllowedValuesEscpd', show: 'mouseover', hide: {fixed : true, delay : 500}, style: { name: 'dark', tip: 'leftTop' }, position: { corner: { target: 'rightMiddle', tooltip: 'leftTop' }} } );
}
if('$sDefaultNullValue' != ''){
$('#moreinfo$sAttrCode').parent().qtip( { content: '$sDefaultNullValue', show: 'mouseover', hide: {fixed : true, delay : 500}, style: { name: 'dark', tip: 'leftTop' }, position: { corner: { target: 'rightMiddle', tooltip: 'leftTop' }} } );
}
EOF
);
@@ -866,19 +905,19 @@ function DisplayGranularityDisplayer($oPage){
$('.attrCode').show();
$('.attrLabel').show();
$('.parenthesis').show();
$("#search-model").autocomplete(autocompleteClassLabelAndCode);
$("#search-model").autocomplete(autocompleteClassLabelAndCode, {scroll:true, matchContains:true});
break;
case 'label':
$('.attrCode').hide();
$('.attrLabel').show();
$('.parenthesis').hide();
$("#search-model").autocomplete(autocompleteClassLabel);
$("#search-model").autocomplete(autocompleteClassLabel, {scroll:true, matchContains:true});
break;
case 'code':
$('.attrCode').show();
$('.attrLabel').hide();
$('.parenthesis').hide();
$("#search-model").autocomplete(autocompleteClassCode);
$("#search-model").autocomplete(autocompleteClassCode, {scroll:true, matchContains:true});
break;
}
SetUserPreference("datamodel_viewer_display_granularity", $('#displaySelector').val(), true);
@@ -947,6 +986,12 @@ switch($operation)
//if we want to see class details & class is given then display it, otherwise act default (just show the class list)
if($sClass != '')
{
$oPage->add_ready_script(
<<<EOF
$('#search-model').val('$sClass');
$('#search-model').trigger("input");
EOF
);
DisplayClassDetails($oPage, $sClass, $sContext);
break;
}
@@ -963,21 +1008,6 @@ $oPage->add_ready_script(
west : {size: "20%", minSize : 200,paneSize : 600}
});
// Layout
$("#search-model").result(function(){
$(this).trigger(jQuery.Event('input'));
});
$("#search-model").on('input', function() {
$("#ClassesList").find("li").each(function(){
if( ! ~$(this).children("a").text().toLowerCase().indexOf($("#search-model").val().toLowerCase())){
$(this).hide();
}
else{
$(this).show();
$(this).parents().show();
}
});
});
EOF
);