Commit 19eca0a627164ccc8a4e1b8f2bb9647d52707aca

Authored by Hacene SI HADJ MOHAND
1 parent 9b3e810f

ok

js/app/views/CatalogUI.js
... ... @@ -530,10 +530,12 @@ Ext.define('amdaUI.CatalogUI', {
530 530 var typeTT = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.catalog.id).linkedNode.data.nodeType;
531 531  
532 532 if (this.object.get('id') == '' && this.object.get('relatedTimeTableId') == '') {
  533 + // creating new catalog
533 534 AmdaAction.initObjectCache(this.isCatalog, this.object.get('nbParameters'), this.onAfterInit,this);
534 535 }
535 536 else if(this.object.get('relatedTimeTableId') != ''){
536   - AmdaAction.initObjectCacheFromTimeTable(this.object.get('relatedTimeTableId'), this.object.get('nbParameters'));
  537 + // Generate Catalog from Time Table
  538 + AmdaAction.initObjectCacheFromTimeTable(this.object.get('relatedTimeTableId'), typeTT, this.object.get('nbParameters'),this.onAfterInit, this);
537 539 }
538 540 else {
539 541 //From existing TT file
... ...
js/app/views/TimeTableUI.js
... ... @@ -291,7 +291,7 @@ Ext.define('amdaUI.TimeTableUI', {
291 291 if (btn == 'ok'){
292 292 var catObj=Ext.create('amdaModel.Catalog');
293 293 var catNode=Ext.create('amdaModel.CatalogNode',{leaf : true});
294   - catObj.set('relatedTimeTable', id);
  294 + catObj.set('relatedTimeTableId', id);
295 295 creatDate=new Date(this.object.get('created'));
296 296 date=Ext.Date.format(creatDate,'Y-m-d\\TH:i:s');
297 297 descr='Generated by CDPP/Amda Time Table Module \n'+ 'From Time Table: '+this.object.get('name')+'\nOn: '+date+'\n';
... ...
php/classes/AmdaAction.php
... ... @@ -1125,6 +1125,13 @@ class AmdaAction
1125 1125 return $cacheMgr->initFromCatalog($id, $type);
1126 1126 }
1127 1127  
  1128 + public function initObjectCacheFromTimeTable($id, $type, $nparams)
  1129 + {
  1130 + $cacheMgr = new CatalogCacheMgr();
  1131 +
  1132 + return $cacheMgr->initFromTimeTable($id, $nparams);
  1133 + }
  1134 +
1128 1135  
1129 1136 public function initForChart($id, $folderId, $name, $isTmpObject, $type)
1130 1137 {
... ...
php/classes/CatalogCacheMgr.php
1   -<?php/
  1 +<?php
2 2  
3 3 /**
4 4 * @class CatalogCacheMgr
... ... @@ -65,12 +65,14 @@ class CatalogCacheMgr extends TimeTableCacheMgr
65 65  
66 66 return $result+ array('parameters' => $info['parameters']);
67 67 }
68   -
  68 +
69 69 public function initFromTimeTable($id, $nbParams)
70 70 {
71   - $info = this ->resetCache(array('nparams' => $nbParams));
  71 +
  72 + $params = $this->resetCache(array('nparams' => $nbParams));
72 73 $ttMgr= new TimeTableMgr();
73 74 $intervals_res = $ttMgr->loadIntervalsFromObject($id);
  75 +
74 76 if (!$intervals_res['success'])
75 77 return $intervals_res;
76 78  
... ... @@ -86,10 +88,12 @@ class CatalogCacheMgr extends TimeTableCacheMgr
86 88 $this->cache->updateIndexes();
87 89  
88 90 //Save cache file
89   - return array('success' => $this->saveToFile(), 'token' => $this->cache->getToken(), 'status' => $this->cache->getStatus());
  91 + return array('success' => $this->saveToFile(), 'token' => $this->cache->getToken(), 'status' => $this->cache->getStatus(), 'parameters' => $this->cache->getParametersInfo());
  92 +
90 93  
91 94  
92 95 }
93 96  
  97 +
94 98 }
95 99 ?>
... ...
php/config.php
... ... @@ -161,6 +161,7 @@ $API = array(
161 161 'initObjectCacheFromTmpObject'=>array('len'=>3),
162 162 'initObjectCacheFromUploadedFile'=>array('len'=>3),
163 163 'initObjectCacheFromCatalog'=>array('len'=>2),
  164 + 'initObjectCacheFromTimeTable'=>array('len'=>3),
164 165 'readCacheIntervals'=>array('len'=>1),
165 166 'readIntervalsForChart'=>array('len'=>1),
166 167 'addCacheInterval'=>array('len'=>1),
... ...