diff --git a/js/app/views/CatalogUI.js b/js/app/views/CatalogUI.js index 80c8c2a..a5b4222 100644 --- a/js/app/views/CatalogUI.js +++ b/js/app/views/CatalogUI.js @@ -870,7 +870,7 @@ Ext.define('amdaUI.CatalogUI', { var window = Ext.create('Ext.window.Window', { title: (isNew) ? 'New Column' : 'Edit Column', width: 275, - height: 155, + height: 210, closable:false, modal:true, resizable: false, @@ -917,7 +917,17 @@ Ext.define('amdaUI.CatalogUI', { minValue: 1, allowBlank: false, tooltip: 'For exemple: 1 for scalar type or 3 for a vector' - }], + }, + { + // Name + xtype:'textarea', + fieldLabel: 'Description', + name: 'descriptionColumn', + height:50, + value: (isNew) ? null : columnInfo.description, + allowBlank: true, + } + ], buttons: [{ text: 'Save', @@ -937,6 +947,7 @@ Ext.define('amdaUI.CatalogUI', { this.up('form').getForm().findField('nameColumn').getValue(), this.up('form').getForm().findField('typeColumn').getValue(), this.up('form').getForm().findField('sizeColumn').getValue(), + this.up('form').getForm().findField('descriptionColumn').getValue(), function(result, e){ if(result){ me.toReconfigure = true; @@ -949,6 +960,7 @@ Ext.define('amdaUI.CatalogUI', { var newName = null; var newType = null; var newSize = null; + var newDescription = null; // Check if there is modifications if(this.up('form').getForm().findField('nameColumn').getValue() != columnInfo.name){ @@ -960,10 +972,13 @@ Ext.define('amdaUI.CatalogUI', { if(this.up('form').getForm().findField('sizeColumn').getValue() != columnInfo.size){ newSize = this.up('form').getForm().findField('sizeColumn').getValue(); } + if(this.up('form').getForm().findField('descriptionColumn').getValue() != columnInfo.description){ + newDescription = this.up('form').getForm().findField('descriptionColumn').getValue(); + } - if(newName != null || newType != null || newSize != null) + if(newName != null || newType != null || newSize != null || newDescription != null) { - AmdaAction.editColumn(columnInfo.id, newName, newType, newSize, function(result, e){ + AmdaAction.editColumn(columnInfo.id, newName, newType, newSize, newDescription, function(result, e){ if(result){ me.toReconfigure = true; me.onAfterInit(result); diff --git a/php/classes/AmdaAction.php b/php/classes/AmdaAction.php index b416743..e236cab 100644 --- a/php/classes/AmdaAction.php +++ b/php/classes/AmdaAction.php @@ -1659,9 +1659,9 @@ class AmdaAction return $cacheMgr->deleteColumn($id); } - public function addColumn($id, $name, $type, $size){ + public function addColumn($id, $name, $type, $size, $description){ $cacheMgr = new CatalogCacheMgr(); - return $cacheMgr->addColumn($id,$name, $type,$size); + return $cacheMgr->addColumn($id,$name, $type,$size,$description); } public function getCatColumnInfo($id){ @@ -1669,9 +1669,9 @@ class AmdaAction return $cacheMgr->getCatColumnInfo($id); } - public function editColumn($id, $name, $type, $size){ + public function editColumn($id, $name, $type, $size,$description){ $cacheMgr = new CatalogCacheMgr(); - return $cacheMgr->editColumn($id,$name, $type,$size); + return $cacheMgr->editColumn($id,$name, $type,$size,$description); } } ?> diff --git a/php/classes/CatalogCacheMgr.php b/php/classes/CatalogCacheMgr.php index 3028469..55751dd 100644 --- a/php/classes/CatalogCacheMgr.php +++ b/php/classes/CatalogCacheMgr.php @@ -160,11 +160,11 @@ class CatalogCacheMgr extends TimeTableCacheMgr return array('success' => $result , 'token' => $this->cache->getToken(), 'status' => $this->cache->getStatus(),'parameters' => $this->cache->getParametersInfo()); } - public function addColumn($id,$name, $type,$size){ + public function addColumn($id,$name, $type,$size, $description){ if (!$this->loadFromFile()) return array('success' => false, 'message' => 'Cannot load cache file'); $isNew=true; - $this->cache->addParameter($id,$name, $size, $type, "", $isNew); + $this->cache->addParameter($id,$name, $size, $type, $description , $isNew); $this->saveToFile(); return array('success' => true , 'token' => $this->cache->getToken(), 'status' => $this->cache->getStatus(),'parameters' => $this->cache->getParametersInfo()); } @@ -176,11 +176,11 @@ class CatalogCacheMgr extends TimeTableCacheMgr return $this->cache->getParameterInfo($id); } - public function editColumn($id,$name, $type,$size){ + public function editColumn($id,$name, $type,$size, $description){ if (!$this->loadFromFile()) return array('success' => false, 'message' => 'Cannot load cache file'); - $this->cache->editParameter($id,$name, $type, $size); + $this->cache->editParameter($id,$name, $type, $size, $description); $this->saveToFile(); return array('success' => true , 'token' => $this->cache->getToken(), 'status' => $this->cache->getStatus(),'parameters' => $this->cache->getParametersInfo()); diff --git a/php/classes/CatalogCacheObject.php b/php/classes/CatalogCacheObject.php index e78b338..c9d2927 100644 --- a/php/classes/CatalogCacheObject.php +++ b/php/classes/CatalogCacheObject.php @@ -52,7 +52,7 @@ class CatalogCacheObject extends TimeTableCacheObject return false; } - public function editParameter($id, $name, $type, $size) + public function editParameter($id, $name, $type, $size, $description) { foreach ($this->parameters as $index=>$param){ if($id == $param['id']){ @@ -62,6 +62,8 @@ class CatalogCacheObject extends TimeTableCacheObject $this->parameters[$index]['type'] = $type; if(isset($size)) $this->parameters[$index]['size'] = $size; + if(isset($description)) + $this->parameters[$index]['description'] = $description; $this->isModified = TRUE; return true; } diff --git a/php/config.php b/php/config.php index 15b184c..cb89c11 100644 --- a/php/config.php +++ b/php/config.php @@ -200,9 +200,9 @@ $API = array( 'parseTemplatedParam' => array('len'=>1), // Furkan - New Catalog Options 'deleteColumn' => array('len'=> 1), - 'addColumn' => array('len' => 4), + 'addColumn' => array('len' => 5), 'getCatColumnInfo' => array('len' => 1), - 'editColumn' => array('len' => 4) + 'editColumn' => array('len' => 5) ) ) ); -- libgit2 0.21.2