diff --git a/js/app/AmdaApp.js b/js/app/AmdaApp.js index d0d70b8..b7ce230 100755 --- a/js/app/AmdaApp.js +++ b/js/app/AmdaApp.js @@ -591,7 +591,41 @@ Ext.define('amdaApp.AmdaApp', { if (isMigration) { // isSpecialInfo myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.info.id, true, function(module) { module.createWindow(isSpecialInfo, 'Welcome on AMDA', true); - }); + var win = myDesktopApp.getDesktop().getWindow(myDesktopApp.dynamicModules.info.id); + + if ( isOldWS ) { + win.on({ + show : function() { + Ext.Msg.show({ + title:'Welcome on new AMDA', + msg: 'It is your first visit of the new version of AMDA.
'+ + 'Do you want to copy here your workspace from the old AMDA ?', + buttons: Ext.Msg.YESNO, + icon: Ext.Msg.QUESTION, + fn : function (btn) { + if (btn == 'yes') { + loadMask.show(); + AmdaAction.convertWS(function(res,e){ + var explorerModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id); + explorerModule.filtersStore.reload(); + loadMask.hide(); + + if (res.success == true) { + myDesktopApp.infoMsg('Your Wokspace has been copied

' + + 'Note :

Plot Requests have not been copied - too many modifs!
' + + 'Derived params made from Remote params have not been copied

' + res.msg); + } + else { + myDesktopApp.errorMsg(res.error); + } + }); + } + } + }); + }, + scope : this }); + } + }) } else { myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.help.id, true, function(module) { diff --git a/js/app/controllers/AboutModule.js b/js/app/controllers/AboutModule.js index a8fc414..b605104 100644 --- a/js/app/controllers/AboutModule.js +++ b/js/app/controllers/AboutModule.js @@ -78,39 +78,7 @@ Ext.define('amdaDesktop.AboutModule', } ]}); } - - if (isMigration && isOldWS) { - win.on({ - show : function(){ - Ext.Msg.show({ - title:'Welcome on new AMDA', - msg: 'It is your first visit of the new version of AMDA.
'+ - 'Do you want to copy here your workspace from the old AMDA ?', - buttons: Ext.Msg.YESNO, - icon: Ext.Msg.QUESTION, - fn : function (btn) { - if (btn == 'yes') { - loadMask.show(); - AmdaAction.convertWS(function(res,e){ - var explorerModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id); - explorerModule.filtersStore.reload(); - loadMask.hide(); - - if (res.success == true) { - myDesktopApp.infoMsg('Your Wokspace has been copied

' + - 'Note :

Plot Requests have not been copied - too many modifs!
' + - 'Derived params made from Remote params have not been copied

' + res.msg); - } - else { - myDesktopApp.errorMsg(res.error); - } - }); - } - } - }); - } - }); - } + win.show(); } else if (win.file === theFile) { diff --git a/js/resources/css/amda.css b/js/resources/css/amda.css index f7b1fbe..26124b9 100644 --- a/js/resources/css/amda.css +++ b/js/resources/css/amda.css @@ -239,6 +239,10 @@ background-image: url(../images/16x16/error.png) !important; background-color: yellow !important; } +.infoMsg .x-window-body > .x-box-inner { + overflow: scroll; + } + /* datasets information windows */ .infoWindow table.contact { diff --git a/php/classes/UserWsTransfer.php b/php/classes/UserWsTransfer.php index 27cb24d..2088d39 100644 --- a/php/classes/UserWsTransfer.php +++ b/php/classes/UserWsTransfer.php @@ -43,7 +43,20 @@ class UserWsTransfer { return $deleted; } + + private function getNotreadyFunctions() { + + $deletedXML = new DomDocument("1.0"); + $deletedXML->load(CONVERSIONDIR."Functions.xml"); + $deletedNodes = $deletedXML->getElementsByTagName('deleted'); + + $notready = array(); + foreach ($deletedNodes as $node) + $notready[] = $node->getAttribute('xml:id'); + return $notready; + } + private function getNotready() { $deletedXML = new DomDocument("1.0"); @@ -188,6 +201,7 @@ class UserWsTransfer { $deleted = $this->getObsolete(); $notready = $this->getNotready(); + $notreadyFunctions = $this->getNotreadyFunctions(); $wsParamNode = $this->newWs->getElementsByTagName('paramList')->item(0); @@ -220,6 +234,13 @@ class UserWsTransfer { continue; } + if ($this->deleteParam($expression,$notreadyFunctions)) { + $msg .= ''.$name.' : function not ready yet
'.$expression.'
'; + // error_log( 'For INFO : DELETED '.$expression,1,email); + $this->ws_deleted[] = $name; + continue; + } + if (!empty($this->wsd_deleted)) if ($this->deleteParam($expression,$this->wsd_deleted)) { $msg .= ''.$name.' : uses obsolete myData param
'.$expression.'
'; @@ -441,7 +462,7 @@ class UserWsTransfer { $fileFormat[$mask] = $format === 'txt' ? 'ASCII' : strtoupper($format); } } - + $this->newWs->save($this->newWsDir.'WsParams.xml'); // First delete CEF files @@ -452,10 +473,6 @@ class UserWsTransfer { error_log('No '.$vi.' in '.TRANSFERUSER.'/DATA/base.xml',1,email); else { $viNode = $maskNode->item(0)->parentNode; - $files = $viNode->getElementsByTagName('file'); - foreach ($files as $file) { - $deletedFiles[] = $file->getAttribute('name'); - } $viNode->parentNode->removeChild($viNode); } } @@ -467,15 +484,18 @@ class UserWsTransfer { $viNode->setAttribute('id',$id); $mask = $viNode->getElementsByTagName('mask')->item(0)->nodeValue; $viNode->setAttribute('format', $fileFormat[$mask]); - } $BaseXml->save(NEWUSERPATH.TRANSFERUSER.'/DATA/base.xml'); - + $filesNodes = $FilesXml->getElementsByTagName('file'); foreach ($filesNodes as $file) { $fileName = $file->getAttribute('name'); - if (!in_array($fileName,$deletedFiles)) { + $format = $file->getAttribute('format'); + if ($format == 'cef') { + $deletedFiles[] = $file->getAttribute('xml:id'); + } + else { copy(OLDUSERPATH.TRANSFERUSER.'/DATA/'.$fileName,NEWUSERPATH.TRANSFERUSER.'/DATA/'.$fileName); } } @@ -485,9 +505,16 @@ class UserWsTransfer { if ($node) $node->parentNode->removeChild($node); } - + + foreach ($deletedFiles as $vi) { + $node = $FilesXml->getElementById($vi); + if ($node) { + $msg .= ''.$vi.' : CEF format is not implemented
'; + $node->parentNode->removeChild($node); + } + } + $FilesXml->save($this->newWsDir.'Files.xml'); - $msg .= ' ok
'; return array('success' => true, 'msg' => $msg); } -- libgit2 0.21.2