Commit cdf22cddab0659c02c40ae4b05cecf3a5a8ddf3a

Authored by Elena.Budnik
1 parent 8e40a14d

message window corrected, files transfer corrected

js/app/AmdaApp.js
... ... @@ -591,7 +591,41 @@ Ext.define('amdaApp.AmdaApp', {
591 591 if (isMigration) { // isSpecialInfo
592 592 myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.info.id, true, function(module) {
593 593 module.createWindow(isSpecialInfo, 'Welcome on AMDA', true);
594   - });
  594 + var win = myDesktopApp.getDesktop().getWindow(myDesktopApp.dynamicModules.info.id);
  595 +
  596 + if ( isOldWS ) {
  597 + win.on({
  598 + show : function() {
  599 + Ext.Msg.show({
  600 + title:'Welcome on new AMDA',
  601 + msg: 'It is your first visit of the new version of AMDA.<br/>'+
  602 + 'Do you want to copy here your workspace from the old AMDA ?',
  603 + buttons: Ext.Msg.YESNO,
  604 + icon: Ext.Msg.QUESTION,
  605 + fn : function (btn) {
  606 + if (btn == 'yes') {
  607 + loadMask.show();
  608 + AmdaAction.convertWS(function(res,e){
  609 + var explorerModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id);
  610 + explorerModule.filtersStore.reload();
  611 + loadMask.hide();
  612 +
  613 + if (res.success == true) {
  614 + myDesktopApp.infoMsg('<b>Your Wokspace has been copied</b><br/><br/> ' +
  615 + '<b>Note : </b><br/><br> Plot Requests have not been copied - too many modifs!<br/>' +
  616 + 'Derived params made from Remote params have not been copied<br/><br/>' + res.msg);
  617 + }
  618 + else {
  619 + myDesktopApp.errorMsg(res.error);
  620 + }
  621 + });
  622 + }
  623 + }
  624 + });
  625 + },
  626 + scope : this });
  627 + }
  628 + })
595 629 }
596 630 else {
597 631 myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.help.id, true, function(module) {
... ...
js/app/controllers/AboutModule.js
... ... @@ -78,39 +78,7 @@ Ext.define(&#39;amdaDesktop.AboutModule&#39;,
78 78 }
79 79 ]});
80 80 }
81   -
82   - if (isMigration && isOldWS) {
83   - win.on({
84   - show : function(){
85   - Ext.Msg.show({
86   - title:'Welcome on new AMDA',
87   - msg: 'It is your first visit of the new version of AMDA.<br/>'+
88   - 'Do you want to copy here your workspace from the old AMDA ?',
89   - buttons: Ext.Msg.YESNO,
90   - icon: Ext.Msg.QUESTION,
91   - fn : function (btn) {
92   - if (btn == 'yes') {
93   - loadMask.show();
94   - AmdaAction.convertWS(function(res,e){
95   - var explorerModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id);
96   - explorerModule.filtersStore.reload();
97   - loadMask.hide();
98   -
99   - if (res.success == true) {
100   - myDesktopApp.infoMsg('<b>Your Wokspace has been copied</b><br/><br/> ' +
101   - '<b>Note : </b><br/><br> Plot Requests have not been copied - too many modifs!<br/>' +
102   - 'Derived params made from Remote params have not been copied<br/><br/>' + res.msg);
103   - }
104   - else {
105   - myDesktopApp.errorMsg(res.error);
106   - }
107   - });
108   - }
109   - }
110   - });
111   - }
112   - });
113   - }
  81 +
114 82 win.show();
115 83 }
116 84 else if (win.file === theFile) {
... ...
js/resources/css/amda.css
... ... @@ -239,6 +239,10 @@ background-image: url(../images/16x16/error.png) !important;
239 239 background-color: yellow !important;
240 240 }
241 241  
  242 +.infoMsg .x-window-body > .x-box-inner {
  243 + overflow: scroll;
  244 + }
  245 +
242 246 /* datasets information windows */
243 247  
244 248 .infoWindow table.contact {
... ...
php/classes/UserWsTransfer.php
... ... @@ -43,7 +43,20 @@ class UserWsTransfer {
43 43  
44 44 return $deleted;
45 45 }
  46 +
  47 + private function getNotreadyFunctions() {
  48 +
  49 + $deletedXML = new DomDocument("1.0");
  50 + $deletedXML->load(CONVERSIONDIR."Functions.xml");
  51 + $deletedNodes = $deletedXML->getElementsByTagName('deleted');
  52 +
  53 + $notready = array();
  54 + foreach ($deletedNodes as $node)
  55 + $notready[] = $node->getAttribute('xml:id');
46 56  
  57 + return $notready;
  58 + }
  59 +
47 60 private function getNotready() {
48 61  
49 62 $deletedXML = new DomDocument("1.0");
... ... @@ -188,6 +201,7 @@ class UserWsTransfer {
188 201  
189 202 $deleted = $this->getObsolete();
190 203 $notready = $this->getNotready();
  204 + $notreadyFunctions = $this->getNotreadyFunctions();
191 205  
192 206 $wsParamNode = $this->newWs->getElementsByTagName('paramList')->item(0);
193 207  
... ... @@ -220,6 +234,13 @@ class UserWsTransfer {
220 234 continue;
221 235 }
222 236  
  237 + if ($this->deleteParam($expression,$notreadyFunctions)) {
  238 + $msg .= '<b>'.$name.'</b> : function not ready yet <br/> '.$expression.'<br/>';
  239 + // error_log( 'For INFO : DELETED '.$expression,1,email);
  240 + $this->ws_deleted[] = $name;
  241 + continue;
  242 + }
  243 +
223 244 if (!empty($this->wsd_deleted))
224 245 if ($this->deleteParam($expression,$this->wsd_deleted)) {
225 246 $msg .= '<b>'.$name.'</b> : uses obsolete myData param<br/> '.$expression.'<br/>';
... ... @@ -441,7 +462,7 @@ class UserWsTransfer {
441 462 $fileFormat[$mask] = $format === 'txt' ? 'ASCII' : strtoupper($format);
442 463 }
443 464 }
444   -
  465 +
445 466 $this->newWs->save($this->newWsDir.'WsParams.xml');
446 467  
447 468 // First delete CEF files
... ... @@ -452,10 +473,6 @@ class UserWsTransfer {
452 473 error_log('No '.$vi.' in '.TRANSFERUSER.'/DATA/base.xml',1,email);
453 474 else {
454 475 $viNode = $maskNode->item(0)->parentNode;
455   - $files = $viNode->getElementsByTagName('file');
456   - foreach ($files as $file) {
457   - $deletedFiles[] = $file->getAttribute('name');
458   - }
459 476 $viNode->parentNode->removeChild($viNode);
460 477 }
461 478 }
... ... @@ -467,15 +484,18 @@ class UserWsTransfer {
467 484 $viNode->setAttribute('id',$id);
468 485 $mask = $viNode->getElementsByTagName('mask')->item(0)->nodeValue;
469 486 $viNode->setAttribute('format', $fileFormat[$mask]);
470   -
471 487 }
472 488  
473 489 $BaseXml->save(NEWUSERPATH.TRANSFERUSER.'/DATA/base.xml');
474   -
  490 +
475 491 $filesNodes = $FilesXml->getElementsByTagName('file');
476 492 foreach ($filesNodes as $file) {
477 493 $fileName = $file->getAttribute('name');
478   - if (!in_array($fileName,$deletedFiles)) {
  494 + $format = $file->getAttribute('format');
  495 + if ($format == 'cef') {
  496 + $deletedFiles[] = $file->getAttribute('xml:id');
  497 + }
  498 + else {
479 499 copy(OLDUSERPATH.TRANSFERUSER.'/DATA/'.$fileName,NEWUSERPATH.TRANSFERUSER.'/DATA/'.$fileName);
480 500 }
481 501 }
... ... @@ -485,9 +505,16 @@ class UserWsTransfer {
485 505 if ($node)
486 506 $node->parentNode->removeChild($node);
487 507 }
488   -
  508 +
  509 + foreach ($deletedFiles as $vi) {
  510 + $node = $FilesXml->getElementById($vi);
  511 + if ($node) {
  512 + $msg .= '<b>'.$vi.'</b> : CEF format is not implemented <br/>';
  513 + $node->parentNode->removeChild($node);
  514 + }
  515 + }
  516 +
489 517 $FilesXml->save($this->newWsDir.'Files.xml');
490   - $msg .= ' ok<br/>';
491 518  
492 519 return array('success' => true, 'msg' => $msg);
493 520 }
... ...