diff --git a/js/app/views/CatalogUI.js b/js/app/views/CatalogUI.js index 2962264..32bbef2 100644 --- a/js/app/views/CatalogUI.js +++ b/js/app/views/CatalogUI.js @@ -18,6 +18,7 @@ Ext.define('amdaUI.CatalogUI', { 'Ext.ux.grid.filter.NumericFilter', 'Ext.ux.grid.filter.StringFilter', 'amdaUI.OperationsTT', + 'amdaUI.DescriptionField', 'Ext.grid.plugin.BufferedRenderer', 'amdaPlotObj.PlotObjectConfig', 'amdaUI.StatusGrid', @@ -1402,14 +1403,9 @@ Ext.define('amdaUI.CatalogUI', { border:false, layout:'fit', items:[{ - xtype: 'htmleditor', + xtype: 'descriptionfield', align:'stretch', - enableFont:false, - enableFontSize:false, - enableAlignments: false, - enableColors:false, name: 'description', - fieldLabel: 'Description', }], }, { diff --git a/js/app/views/DescriptionField.js b/js/app/views/DescriptionField.js new file mode 100644 index 0000000..4ee2223 --- /dev/null +++ b/js/app/views/DescriptionField.js @@ -0,0 +1,9 @@ +Ext.define('amdaUI.DescriptionField', { + extend: 'Ext.form.field.TextArea', + //extend: 'Ext.form.field.HtmlEditor', + alias: 'widget.descriptionfield', + + fieldLabel: 'Description', + +}); + diff --git a/js/app/views/DownloadUI.js b/js/app/views/DownloadUI.js index f92476d..bf6048c 100644 --- a/js/app/views/DownloadUI.js +++ b/js/app/views/DownloadUI.js @@ -16,6 +16,7 @@ Ext.define('amdaUI.DownloadUI', { 'amdaUI.TimeSelectorUI', 'amdaUI.ParamArgumentsPlug', 'amdaUI.SendToSampButtonUI', + 'amdaUI.DescriptionField', 'amdaModel.Download', 'amdaModel.DownloadParam', 'amdaModel.RequestParamObject' @@ -652,9 +653,10 @@ Ext.define('amdaUI.DownloadUI', { border:false, layout:'fit', items:[{ - xtype: 'textarea', + xtype: 'descriptionfield', name: 'description', - emptyText:'Description' + emptyText:'Description', + fieldLabel: '' }] }; diff --git a/js/app/views/ParameterUI.js b/js/app/views/ParameterUI.js index 86420fd..92e8de3 100755 --- a/js/app/views/ParameterUI.js +++ b/js/app/views/ParameterUI.js @@ -17,6 +17,7 @@ Ext.define('amdaUI.ParameterUI', requires: [ 'amdaUI.AliasUI', 'amdaUI.CalculatorUI', + 'amdaUI.DescriptionField', 'extensions.SelectableTextArea', 'amdaUI.ParamArgumentsPlug', 'amdaModel.RequestParamObject', @@ -603,7 +604,7 @@ Ext.define('amdaUI.ParameterUI', { itemId: 'formParamDescription', name: 'description', - xtype: 'textarea', fieldLabel: 'Description', + xtype: 'descriptionfield', width: 320, height: 75, colspan: 3 }] diff --git a/js/app/views/PlotComponents/PlotTabContent.js b/js/app/views/PlotComponents/PlotTabContent.js index 62a4b87..edce35d 100644 --- a/js/app/views/PlotComponents/PlotTabContent.js +++ b/js/app/views/PlotComponents/PlotTabContent.js @@ -13,6 +13,7 @@ Ext.define('amdaPlotComp.PlotTabContent', { requires: [ 'amdaUI.TimeSelectorUI', + 'amdaUI.DescriptionField', 'amdaPlotComp.PlotTree', 'amdaPlotComp.PlotOutputForm', 'amdaPlotComp.PlotElementPanel' @@ -224,8 +225,8 @@ Ext.define('amdaPlotComp.PlotTabContent', { bodyStyle: {background: '#dfe8f6',padding: '1', }, border:false, layout:'fit', - items:[{ xtype: 'textarea', name: 'description', - id:'plot_description',emptyText:'Description'}] + items:[{ xtype: 'descriptionfield', name: 'description', + id:'plot_description',emptyText:'Description', fieldLabel: ''}] }; var treePanel = new Ext.form.Panel({ diff --git a/js/app/views/SearchUI.js b/js/app/views/SearchUI.js index f24dae8..523427e 100755 --- a/js/app/views/SearchUI.js +++ b/js/app/views/SearchUI.js @@ -16,6 +16,7 @@ Ext.define('amdaUI.SearchUI', requires: [ 'amdaUI.CalculatorUI', 'amdaUI.TimeSelectorUI', + 'amdaUI.DescriptionField', 'extensions.SelectableTextArea', 'amdaUI.ParamArgumentsPlug', 'amdaModel.RequestParamObject' @@ -599,9 +600,8 @@ Ext.define('amdaUI.SearchUI', labelAlign: 'top', hideTrigger: true, width: 165 }, { - xtype: 'textarea', + xtype: 'descriptionfield', name: 'description', - fieldLabel: 'Description', width: 375, height: 70, colspan: 3 } diff --git a/js/app/views/StatisticsUI.js b/js/app/views/StatisticsUI.js index c7a1220..fd25128 100644 --- a/js/app/views/StatisticsUI.js +++ b/js/app/views/StatisticsUI.js @@ -15,6 +15,7 @@ Ext.define('amdaUI.StatisticsUI', requires: [ 'amdaUI.TimeSelectorUI', 'amdaUI.ParamArgumentsPlug', + 'amdaUI.DescriptionField', 'amdaModel.StatisticParam' ], @@ -531,9 +532,8 @@ Ext.define('amdaUI.StatisticsUI', items: [ this.fieldName, { - xtype: 'textarea', + xtype: 'descriptionfield', name: 'description', - fieldLabel: 'Description', height: 125 }, this.timeSelector diff --git a/js/app/views/TimeTableUI.js b/js/app/views/TimeTableUI.js index f1ded07..0521c89 100755 --- a/js/app/views/TimeTableUI.js +++ b/js/app/views/TimeTableUI.js @@ -18,6 +18,7 @@ Ext.define('amdaUI.TimeTableUI', { 'Ext.ux.grid.filter.NumericFilter', 'amdaUI.OperationsTT', 'amdaUI.StatisticalPlug', + 'amdaUI.DescriptionField', 'Ext.grid.plugin.BufferedRenderer', 'amdaDesktop.AmdaStateProvider' ], @@ -442,9 +443,8 @@ Ext.define('amdaUI.TimeTableUI', { ] }, { - xtype: 'textarea', + xtype: 'descriptionfield', name: 'description', - fieldLabel: 'Description', anchor: '100% 50%' }, { diff --git a/php/classes/AmdaAction.php b/php/classes/AmdaAction.php index 73a6e1f..d93b1d1 100644 --- a/php/classes/AmdaAction.php +++ b/php/classes/AmdaAction.php @@ -189,7 +189,15 @@ class AmdaAction case 'catalog': if ($isLeaf) { $info = '<b>Nb intervals:</b> '.$child->getAttribute('intervals').'<br/>'; + + $objectMgr = new TimeTableMgr(); + $obj_info = $objectMgr->getObject($id, $nodeType); + if (!empty($obj_info) && !empty($obj_info['description'])) { + $info .= '<b>Description:</b> '. $obj_info['description'] . '<br/>'; + } + $info .= '<b>ID:</b> '. $child->getAttribute('xml:id'); + } break; @@ -204,15 +212,15 @@ class AmdaAction } break; case 'derivedParam': - $info = $child->getAttribute('buildchain').'<br/>'; + $info = '<b>Expression:</b> '. $child->getAttribute('buildchain').'<br/>'; if($child->hasAttribute('units') && $child->getAttribute('units') != 'undefined' && $child->getAttribute('units') != '') $info .= 'Units: '.$child->getAttribute('units').'<br/>'; $samplingMode = $child->getAttribute('sampling_mode'); if($samplingMode == 'timestep'){ - $info .= 'Sampling: '.$child->getAttribute('timestep').' sec'; + $info .= '<b>Sampling:</b> '.$child->getAttribute('timestep').' sec'.'<br/>'; }else if($samplingMode == 'refparam'){ - $info .= 'Reference Parameter: '.$child->getAttribute('reference_param'); + $info .= '<b>Reference Parameter:</b> '.$child->getAttribute('reference_param').'<br/>'; } if ($child->hasAttribute('dim_1')) { @@ -220,8 +228,17 @@ class AmdaAction } if ($child->hasAttribute('dim_2')) { $dim_2 = $child->getAttribute('dim_2'); + } + $objectMgr = new DerivedParamMgr($nodeType); + $obj_info = $objectMgr->getObject($child->getAttribute('xml:id')) ; + if (!empty($obj_info) && array_key_exists('description', $obj_info) && ($obj_info['description'] != "undefined")) { + $info .= '<b>Description:</b> '. $obj_info['description'].'<br/>'; + } + + $info .= '<b>ID:</b> '. $child->getAttribute('xml:id'); + if ($isLeaf) $isParameter = true; break; diff --git a/php/classes/RequestMgr.php b/php/classes/RequestMgr.php index 1e53384..4e8637c 100644 --- a/php/classes/RequestMgr.php +++ b/php/classes/RequestMgr.php @@ -363,7 +363,7 @@ class RequestMgr extends AmdaObjectMgr } public function getObjectInfo($id) { - $info = "Request ID: ".$id."<br/>"; + $info = "<b>Request ID:</b> ".$id."<br/>"; if (!file_exists(USERREQDIR.$id)) { $info .= "<b>ERROR:</b> Cannot retrieve request definition file"; @@ -378,8 +378,7 @@ class RequestMgr extends AmdaObjectMgr switch ($this->type) { case 'request': - $info .= "Plot: "; - $description = $obj->description; + $info .= "<b>Plot:</b> "; $panels_list = array(); if (!empty($obj->panels)) { foreach ($obj->panels as $p) { @@ -411,17 +410,13 @@ class RequestMgr extends AmdaObjectMgr else { $info .= "Empty"; } - if(!empty($description)){ - $info .= '<br/>Description: '.$description; - } break; case 'condition': - $info .= "Data Mining: ".htmlspecialchars($obj->expression); + $info .= "<b>Data Mining:</b> ".htmlspecialchars($obj->expression); break; case 'download': - $info .= "Download: "; + $info .= "<b>Download:</b> "; $params_list = array(); - $description = $obj->description; if (!empty($obj->list)) { foreach ($obj->list as $p) { if (!in_array($p->paramid, $params_list)) @@ -434,12 +429,9 @@ class RequestMgr extends AmdaObjectMgr else { $info .= "Empty"; } - if(!empty($description)){ - $info .= '<br/>Description: '.$description; - } break; case 'statistic': - $info .= "Statistic: "; + $info .= "<b>Statistic:</b> "; $functions_list = array(); if (!empty($obj->parameter)) { foreach ($obj->parameter as $param) { @@ -453,7 +445,7 @@ class RequestMgr extends AmdaObjectMgr if (!empty($functions_list)) { foreach ($functions_list as $func => $params) { $info .= "<br/>"; - $info .= "<b>" . $func . ":</b> " . implode(', ', $params); + $info .= "<i>" . $func . ":</i> " . implode(', ', $params); } } else { @@ -468,6 +460,11 @@ class RequestMgr extends AmdaObjectMgr $info .= "<b>ERROR:</b> Unknown request type"; } + $description = isset($obj->description) ? $obj->description : ''; + if(!empty($description)){ + $info .= '<br/><b>Description:</b> '.$description; + } + return $info; } -- libgit2 0.21.2