Commit 3d8f5753dcb7f4c5c9ad3f1e6464ec4f9aed4582

Authored by Elena.Budnik
2 parents 77354e6d 52cc0f17

Merge remote-tracking branch 'origin/master' into webservices

help/ttTimeFormat 0 → 100644
@@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
  1 +<h3>ASCII Time Table Time Format</h3>
  2 +<i>Year Month Day Hour Minute Second</i> => with different separators ("-", ":", "/", " ") used in a standard way.
  3 +<br/><i>Milliseconds</i> are not taken in to account.
  4 +<br/><br/>
  5 +Examples:
  6 + <ul>
  7 + <li> 2001-01-01T00:00:00
  8 + <li> 2001-01-01 00:00:00
  9 + <li> 2001 01 01 00 00 00
  10 + <li> 2001/01/01 00:00:00
  11 + </ul>
  12 +<br/>
  13 +If you plan to use uploaded time table to work with data note that :<br/>
  14 +<b>Valid time range: 1970-01-01 - 2038-01-19</b>
  15 +
js/app/controllers/ExplorerModule.js
@@ -105,29 +105,19 @@ Ext.define(&#39;amdaDesktop.ExplorerModule&#39;, @@ -105,29 +105,19 @@ Ext.define(&#39;amdaDesktop.ExplorerModule&#39;,
105 region: 'center' 105 region: 'center'
106 }, 106 },
107 { 107 {
108 - xtype: 'label',  
109 - text: 'Log:',  
110 - margin: '10 0 -5 0',  
111 - region: 'south',  
112 - height: 20  
113 - },  
114 - {  
115 xtype: 'panel', 108 xtype: 'panel',
  109 + title: 'Log',
116 id: 'LogPanel', 110 id: 'LogPanel',
  111 + collapsible: true,
  112 + iconCls: 'icon-align-left',
117 region: 'south', 113 region: 'south',
118 - height: 150,  
119 split: true, 114 split: true,
120 - layout: {  
121 - type: 'vbox',  
122 - align: 'stretch',  
123 - autoSize: true  
124 - },  
125 - autoScroll: true, 115 + height: 150,
126 stateful: true, 116 stateful: true,
127 stateId: 'LogPanel', 117 stateId: 'LogPanel',
128 - buttons: [{  
129 - scope: this,  
130 - text: 'Clear', 118 + tools: [{
  119 + type: 'trash',
  120 + tooltip: 'Clear logs',
131 handler: function () { 121 handler: function () {
132 var logPanel = win.items.get('LogPanel') 122 var logPanel = win.items.get('LogPanel')
133 logPanel.removeAll() 123 logPanel.removeAll()
js/app/controllers/JobsMgr.js
@@ -187,6 +187,7 @@ Ext.define(&#39;amdaDesktop.JobsMgr&#39;, { @@ -187,6 +187,7 @@ Ext.define(&#39;amdaDesktop.JobsMgr&#39;, {
187 // AKKA - use processid to find job 187 // AKKA - use processid to find job
188 nodeToMove = jobRootNode.findChild('id', job.id, false) 188 nodeToMove = jobRootNode.findChild('id', job.id, false)
189 nodeToMove.set('status', job.status) 189 nodeToMove.set('status', job.status)
  190 + nodeToMove.set('info', job.info)
190 191
191 // TODO check if really job.status 192 // TODO check if really job.status
192 193
js/app/controllers/StatisticsModule.js
@@ -43,14 +43,12 @@ Ext.define(&#39;amdaDesktop.StatisticsModule&#39;, { @@ -43,14 +43,12 @@ Ext.define(&#39;amdaDesktop.StatisticsModule&#39;, {
43 43
44 saveState: function() { 44 saveState: function() {
45 var uiContent = this.getUiContent(); 45 var uiContent = this.getUiContent();
46 - var form = uiContent.down('form').getForm();  
47 - var values = form.getValues();  
48 - // Ext.state.Manager.set(this.id + '_form', values); 46 + var form = uiContent.formPanel.items.items[1].getForm();
  47 + var values = form.getValues();
49 Ext.state.Manager.set('timeinterval', {'startDate' : values.startDate,'stopDate' : values.stopDate }); 48 Ext.state.Manager.set('timeinterval', {'startDate' : values.startDate,'stopDate' : values.stopDate });
50 }, 49 },
51 50
52 - getState : function() {  
53 - // return Ext.state.Manager.get(this.id + '_form'); 51 + getState : function() {
54 return Ext.state.Manager.get('timeinterval'); 52 return Ext.state.Manager.get('timeinterval');
55 } 53 }
56 54
js/app/models/Stats.js
@@ -22,8 +22,8 @@ Ext.define(&#39;amdaModel.Stats&#39;, { @@ -22,8 +22,8 @@ Ext.define(&#39;amdaModel.Stats&#39;, {
22 values.id = this.get('id'); 22 values.id = this.get('id');
23 } 23 }
24 24
25 - values.timesrc = this.get('timesrc');  
26 - values.name = 'test'; //this.get('name'); 25 + values.timesrc = this.get('timesrc');
  26 + values.name = this.get('name');
27 27
28 // if (this.get('description').match(/[a-z,0-9]/gi) != null) { 28 // if (this.get('description').match(/[a-z,0-9]/gi) != null) {
29 // values.description = this.get('description'); 29 // values.description = this.get('description');
js/app/views/ExplorerUI.js
@@ -506,6 +506,9 @@ Ext.define(&#39;amdaUI.ExplorerUI&#39;, { @@ -506,6 +506,9 @@ Ext.define(&#39;amdaUI.ExplorerUI&#39;, {
506 }, 506 },
507 507
508 itemcontextmenu: function(view, rec, item, index, e){ 508 itemcontextmenu: function(view, rec, item, index, e){
  509 + // Add record to selection model
  510 + view.ownerCt.getSelectionModel().select(rec);
  511 +
509 // block other events 512 // block other events
510 e.stopEvent(); 513 e.stopEvent();
511 514
js/app/views/PlotComponents/PlotBaseSerieForm.js
@@ -90,7 +90,7 @@ Ext.define(&#39;amdaPlotComp.PlotBaseSerieForm&#39;, { @@ -90,7 +90,7 @@ Ext.define(&#39;amdaPlotComp.PlotBaseSerieForm&#39;, {
90 me.object.set('serie-yaxis', value); 90 me.object.set('serie-yaxis', value);
91 me.crtTree.refresh(); 91 me.crtTree.refresh();
92 }), 92 }),
93 - this.addStandardFieldSet('Y Values range', '', this.getValuesRangeItems()), 93 + this.addStandardFieldSet('Min/Max thresholds', '', this.getValuesRangeItems()),
94 this.addStandardParamDropTarget('serie-colored-param', 'Colored Parameter'), 94 this.addStandardParamDropTarget('serie-colored-param', 'Colored Parameter'),
95 this.addStandardFieldSet('Lines', 'serie-lines-activated', this.addStandardLineItems('serie-lines')), 95 this.addStandardFieldSet('Lines', 'serie-lines-activated', this.addStandardLineItems('serie-lines')),
96 this.addStandardFieldSet('Symbols', 'serie-symbols-activated', this.addStandardSymbolsItems('serie-symbols')), 96 this.addStandardFieldSet('Symbols', 'serie-symbols-activated', this.addStandardSymbolsItems('serie-symbols')),
js/app/views/PlotComponents/PlotSpectroForm.js
@@ -30,7 +30,7 @@ Ext.define(&#39;amdaPlotComp.PlotSpectroForm&#39;, { @@ -30,7 +30,7 @@ Ext.define(&#39;amdaPlotComp.PlotSpectroForm&#39;, {
30 me.object.set('spectro-yaxis', value); 30 me.object.set('spectro-yaxis', value);
31 me.crtTree.refresh(); 31 me.crtTree.refresh();
32 }), 32 }),
33 - this.addStandardFieldSet('Values range', '', this.getValuesRangeItems()) 33 + this.addStandardFieldSet('Min/Max thresholds', '', this.getValuesRangeItems())
34 ]; 34 ];
35 } 35 }
36 }); 36 });
37 \ No newline at end of file 37 \ No newline at end of file
js/app/views/StatisticsUI.js
@@ -38,8 +38,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;, @@ -38,8 +38,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
38 loadObject : function() 38 loadObject : function()
39 { 39 {
40 // load object into form 40 // load object into form
41 - var basicForm = this.formPanel.items.items[0].getForm();  
42 - 41 + var basicForm = this.formPanel.items.items[1].getForm();
43 basicForm.loadRecord(this.object); 42 basicForm.loadRecord(this.object);
44 43
45 }, 44 },
@@ -101,7 +100,21 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;, @@ -101,7 +100,21 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
101 { 100 {
102 this.timeSelector.addTT(TTname, TTid); ; 101 this.timeSelector.addTT(TTname, TTid); ;
103 }, 102 },
104 - 103 +
  104 + /**
  105 + * Set Start-Stop from parameter info (Local & MyData)
  106 + */
  107 + setTimeFromData : function(obj) {
  108 + if (!obj.start || !obj.stop)
  109 + return;
  110 +
  111 + var dateStart = new Date(obj.start.replace(/[T|Z]/g,' ').replace(/\-/g,'\/'));
  112 + var dateStop = new Date(obj.stop.replace(/[T|Z]/g,' ').replace(/\-/g,'\/'));
  113 +
  114 + this.formPanel.items.items[1].getForm().setValues({ startDate : dateStart, stopDate : dateStop });
  115 + this.timeSelector.intervalSel.updateDuration();
  116 + },
  117 +
105 generateCatalog : function() 118 generateCatalog : function()
106 { 119 {
107 var module = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.statistics.id); 120 var module = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.statistics.id);
@@ -119,7 +132,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;, @@ -119,7 +132,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
119 var updateStatus = true; 132 var updateStatus = true;
120 133
121 var formValues = basicForm.getValues(); 134 var formValues = basicForm.getValues();
122 - //this.object.set('name',formValues.name); 135 + this.object.set('name',this.fieldName.getValue());
123 this.object.set('description',formValues.description); 136 this.object.set('description',formValues.description);
124 137
125 var recs = this.paramGrid.getStore().getNewRecords(); 138 var recs = this.paramGrid.getStore().getNewRecords();
@@ -207,7 +220,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;, @@ -207,7 +220,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
207 fields: [ 'name', 'hidden_id'] 220 fields: [ 'name', 'hidden_id']
208 }); 221 });
209 222
210 - this.timeSelector = new amdaUI.TimeSelectorUI({id: 'statisticsTimeSelector', height : 160}); 223 + this.timeSelector = new amdaUI.TimeSelectorUI({id: 'statisticsTimeSelector', flex:1});
211 224
212 var store = Ext.create('Ext.data.Store', 225 var store = Ext.create('Ext.data.Store',
213 { 226 {
@@ -218,8 +231,8 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;, @@ -218,8 +231,8 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
218 { 231 {
219 title: 'Select Parameter & Apply Function', 232 title: 'Select Parameter & Apply Function',
220 selType : 'rowmodel', 233 selType : 'rowmodel',
221 - // flex: 2,  
222 - height :250, 234 + flex: 2,
  235 + // height :250,
223 store : store, 236 store : store,
224 columns: [ 237 columns: [
225 { xtype: 'rownumberer' }, 238 { xtype: 'rownumberer' },
@@ -362,36 +375,20 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;, @@ -362,36 +375,20 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
362 this.formPanel = Ext.create('Ext.form.Panel', 375 this.formPanel = Ext.create('Ext.form.Panel',
363 { 376 {
364 region: 'center', 377 region: 'center',
365 - layout: 'hbox', 378 + layout: {
  379 + type: 'hbox',
  380 + pack: 'start',
  381 + align: 'stretch'
  382 + },
366 //bodyStyle: {background : '#dfe8f6'}, 383 //bodyStyle: {background : '#dfe8f6'},
367 defaults: { bodyStyle: {background : '#dfe8f6'}, padding : '3'}, 384 defaults: { bodyStyle: {background : '#dfe8f6'}, padding : '3'},
368 fieldDefaults: { labelWidth: 80, labelAlign : 'top' }, 385 fieldDefaults: { labelWidth: 80, labelAlign : 'top' },
369 - items: [  
370 - { 386 + items: [ {
371 xtype: 'form', 387 xtype: 'form',
372 flex : 1, 388 flex : 1,
373 layout: {type: 'vbox', pack: 'start', align: 'stretch'}, 389 layout: {type: 'vbox', pack: 'start', align: 'stretch'},
374 - items : [  
375 - this.paramGrid,  
376 - this.timeSelector  
377 - ]  
378 - },  
379 - {  
380 - xtype: 'form',  
381 - title: 'Additional Information',  
382 - flex : 1,  
383 - layout: {type: 'vbox', pack: 'start', align: 'stretch', padding : '3'},  
384 - items : [  
385 - this.fieldName,  
386 - {  
387 - xtype: 'textarea',  
388 - name: 'description',  
389 - fieldLabel: 'Description',  
390 - height: 200  
391 - }  
392 - ],  
393 - fbar:[  
394 - { 390 + items : [ this.paramGrid ],
  391 + fbar:[ {
395 type: 'button', 392 type: 'button',
396 text: 'Generate Catalog', 393 text: 'Generate Catalog',
397 scope : this, 394 scope : this,
@@ -399,8 +396,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;, @@ -399,8 +396,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
399 { 396 {
400 // update object with user's values 397 // update object with user's values
401 // if the return is true (object had been updated) 398 // if the return is true (object had been updated)
402 - if(this.updateObject()){  
403 - this.updateObject(); 399 + if (this.updateObject()){
404 this.generateCatalog(); 400 this.generateCatalog();
405 } 401 }
406 } 402 }
@@ -409,9 +405,31 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;, @@ -409,9 +405,31 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
409 type: 'button', 405 type: 'button',
410 text: 'Reset', 406 text: 'Reset',
411 scope : this, 407 scope : this,
412 - handler: function() {} 408 + handler: function() {
  409 + this.formPanel.getForm().reset();
  410 + this.paramGrid.store.removeAll();
  411 + this.timeSelector.TTGrid.store.removeAll();
  412 + }
413 }] 413 }]
414 - }] 414 + },
  415 + {
  416 + xtype: 'form',
  417 + title: 'Additional Information',
  418 + flex : 1,
  419 + trackResetOnLoad: true,
  420 + layout: {type: 'vbox', pack: 'start', align: 'stretch', padding : '3'},
  421 + items : [
  422 + this.fieldName,
  423 + {
  424 + xtype: 'textarea',
  425 + name: 'description',
  426 + fieldLabel: 'Description',
  427 + height: 125
  428 + },
  429 + this.timeSelector
  430 + ]
  431 + }
  432 + ]
415 }); 433 });
416 434
417 var myConf = { 435 var myConf = {
js/app/views/UploadPanelUI.js
@@ -19,7 +19,7 @@ Ext.define(&#39;amdaUI.UploadPanelUI&#39;, { @@ -19,7 +19,7 @@ Ext.define(&#39;amdaUI.UploadPanelUI&#39;, {
19 isFile : true, 19 isFile : true,
20 isTimeTable : false, 20 isTimeTable : false,
21 tmpNode : null, 21 tmpNode : null,
22 - 22 +
23 constructor: function(config) 23 constructor: function(config)
24 { 24 {
25 this.init(config); 25 this.init(config);
@@ -310,16 +310,9 @@ Ext.define(&#39;amdaUI.UploadPanelUI&#39;, { @@ -310,16 +310,9 @@ Ext.define(&#39;amdaUI.UploadPanelUI&#39;, {
310 { 310 {
311 var title = 'Time Table'; 311 var title = 'Time Table';
312 var items = [ 312 var items = [
313 - { boxLabel: 'ASCII', name: 'ttfrmt', inputValue: 'ASCII', checked: true,  
314 - listeners: {  
315 - change: function (cb, nv, ov) {  
316 - if (nv) Ext.getCmp('tf_tt').show();  
317 - else Ext.getCmp('tf_tt').hide();  
318 - }  
319 - }  
320 - },  
321 - { boxLabel: 'VOTable', name: 'ttfrmt', inputValue: 'VOT'}];  
322 - 313 + { boxLabel: 'ASCII&nbsp;<img amda_clicktip="ttTimeFormat" style="vertical-align:bottom" src="js/resources/images/16x16/info_mini.png"', name: 'ttfrmt', inputValue: 'ASCII', checked: true},
  314 + { boxLabel: 'VOTable', name: 'ttfrmt', inputValue: 'VOT'}
  315 + ];
323 var timeFormatId = 'tf_tt'; 316 var timeFormatId = 'tf_tt';
324 this.formatId = 'nsf_tt'; 317 this.formatId = 'nsf_tt';
325 this.localUploadId = 'form-uploadtt'; 318 this.localUploadId = 'form-uploadtt';
@@ -467,12 +460,11 @@ Ext.define(&#39;amdaUI.UploadPanelUI&#39;, { @@ -467,12 +460,11 @@ Ext.define(&#39;amdaUI.UploadPanelUI&#39;, {
467 } 460 }
468 } 461 }
469 }; 462 };
470 - var isCatalog = !(this.isFile || this.isTimeTable);  
471 463
472 var timeFormat = Ext.create('Ext.form.FieldSet', { 464 var timeFormat = Ext.create('Ext.form.FieldSet', {
473 id: timeFormatId, 465 id: timeFormatId,
474 title: 'Time Settings', 466 title: 'Time Settings',
475 - hidden : isCatalog, 467 + hidden : !this.isFile,
476 items : [ 468 items : [
477 { 469 {
478 xtype: 'radiogroup', 470 xtype: 'radiogroup',
js/resources/css/amda.css
@@ -104,6 +104,10 @@ @@ -104,6 +104,10 @@
104 background-image:url( ../images/16x16/workspaces.png ) !important; 104 background-image:url( ../images/16x16/workspaces.png ) !important;
105 } 105 }
106 106
  107 +.icon-align-left {
  108 + background-image: url(../images/16x16/align_left.png);
  109 +}
  110 +
107 .icon-delete { 111 .icon-delete {
108 background-image:url( ../images/icons/fam/delete.gif ) !important; 112 background-image:url( ../images/icons/fam/delete.gif ) !important;
109 } 113 }
@@ -121,6 +125,14 @@ background-image: url(../images/small_cancel_centered.png); @@ -121,6 +125,14 @@ background-image: url(../images/small_cancel_centered.png);
121 } 125 }
122 126
123 /** 127 /**
  128 +Custom tool typ icons
  129 + */
  130 +
  131 +.x-tool-trash {
  132 + background-image: url(../images/trash.png) !important;
  133 +}
  134 +
  135 +/**
124 * RangeMenu Styles 136 * RangeMenu Styles
125 **/ 137 **/
126 138
@@ -489,6 +501,10 @@ p + p { @@ -489,6 +501,10 @@ p + p {
489 opacity: 1.0 !important; 501 opacity: 1.0 !important;
490 } 502 }
491 503
  504 +#LogPanel-splitter-collapseEl {
  505 + display: none;
  506 +}
  507 +
492 .epntap_grid .disabled_row { 508 .epntap_grid .disabled_row {
493 color: gray; 509 color: gray;
494 } 510 }
@@ -504,4 +520,4 @@ p + p { @@ -504,4 +520,4 @@ p + p {
504 .epntap_cell { 520 .epntap_cell {
505 padding: 4px; 521 padding: 4px;
506 white-space: normal; 522 white-space: normal;
507 -}  
508 \ No newline at end of file 523 \ No newline at end of file
  524 +}
js/resources/images/16x16/align_left.png 0 → 100644

201 Bytes

js/resources/images/trash.png 0 → 100644

356 Bytes

php/classes/AmdaAction.php
@@ -58,7 +58,6 @@ class AmdaAction @@ -58,7 +58,6 @@ class AmdaAction
58 * $obj = { id: node.id, nodeType: node.nodeType } 58 * $obj = { id: node.id, nodeType: node.nodeType }
59 */ 59 */
60 public function getTree($obj) { 60 public function getTree($obj) {
61 -  
62 $node = $obj->node; 61 $node = $obj->node;
63 62
64 $nodeType = $obj->nodeType; 63 $nodeType = $obj->nodeType;
@@ -102,6 +101,7 @@ class AmdaAction @@ -102,6 +101,7 @@ class AmdaAction
102 $xmlName = SHAREDPATH.'/SharedObjectTree.xml'; 101 $xmlName = SHAREDPATH.'/SharedObjectTree.xml';
103 break; 102 break;
104 case 'bkgWorks': 103 case 'bkgWorks':
  104 + // data/<user>/JOBS/jobs.xml
105 $xmlName = USERJOBDIR.$this->xmlFiles[$nodeType]; 105 $xmlName = USERJOBDIR.$this->xmlFiles[$nodeType];
106 break; 106 break;
107 case 'source': 107 case 'source':
@@ -144,8 +144,6 @@ class AmdaAction @@ -144,8 +144,6 @@ class AmdaAction
144 $id = $child->getAttribute('xml:id'); 144 $id = $child->getAttribute('xml:id');
145 $name = $child->getAttribute('name'); 145 $name = $child->getAttribute('name');
146 $help = $child->getAttribute('att'); 146 $help = $child->getAttribute('att');
147 - if ($child->hasAttribute('dataStart')) $dataStart = $child->getAttribute('dataStart');  
148 - if ($child->hasAttribute('dataStop')) $dataStop = $child->getAttribute('dataStop');  
149 147
150 $specialNode = false; 148 $specialNode = false;
151 $isParameter = false; 149 $isParameter = false;
@@ -158,12 +156,17 @@ class AmdaAction @@ -158,12 +156,17 @@ class AmdaAction
158 { 156 {
159 case 'bkgWorks': 157 case 'bkgWorks':
160 $specialNode = true; 158 $specialNode = true;
161 - $status = $child->getAttribute('status');  
162 - // if ($status == 'done') continue;  
163 - $childrenToReturn[] = array('text' => $name, 'id' => $id,'nodeType' => $nodeType, 'leaf' => $isLeaf,  
164 - 'pid' => $child->getAttribute('pid'), 'status' => $status,  
165 - 'jobType' => $child->getAttribute('jobType'), 'info' => $child->getAttribute('info'));  
166 - break; 159 + $childrenToReturn[] = [
  160 + 'text' => $name,
  161 + 'id' => $id,
  162 + 'nodeType' => $nodeType,
  163 + 'leaf' => $isLeaf,
  164 + 'pid' => $child->getAttribute('pid'),
  165 + 'status' => $child->getAttribute('status'),
  166 + 'jobType' => $child->getAttribute('jobType'),
  167 + 'info' => $child->getAttribute('info')
  168 + ];
  169 + break;
167 170
168 case 'condition': 171 case 'condition':
169 $objectMgr = new RequestMgr(); 172 $objectMgr = new RequestMgr();
@@ -175,9 +178,8 @@ class AmdaAction @@ -175,9 +178,8 @@ class AmdaAction
175 $objplot = $objectMgr->getObject($id); 178 $objplot = $objectMgr->getObject($id);
176 for ($i=0; $i < count($objplot->children); $i++) 179 for ($i=0; $i < count($objplot->children); $i++)
177 { 180 {
178 - for ($j=0; $j < count($objplot->children[$i]->children); $j++)  
179 - {  
180 - $info = $info.' '.$objplot->children[$i]->children[$j]->name; 181 + for ($j=0; $j < count($objplot->children[$i]->children); $j++) {
  182 + $info = $info.' . '.$objplot->children[$i]->children[$j]->name;
181 } 183 }
182 } 184 }
183 break; 185 break;
@@ -846,7 +848,7 @@ class AmdaAction @@ -846,7 +848,7 @@ class AmdaAction
846 */ 848 */
847 public function getJobs($obj = null) 849 public function getJobs($obj = null)
848 { 850 {
849 - $obj = (object) array(); 851 + $obj = (object) array();
850 return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSRUNNINGINFO); 852 return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSRUNNINGINFO);
851 } 853 }
852 854
@@ -913,7 +915,6 @@ class AmdaAction @@ -913,7 +915,6 @@ class AmdaAction
913 } catch (Exception $e) { 915 } catch (Exception $e) {
914 return array('success' => false, 'message' => 'Exception detected : '.$e->getMessage()); 916 return array('success' => false, 'message' => 'Exception detected : '.$e->getMessage());
915 } 917 }
916 -  
917 return $res; 918 return $res;
918 } 919 }
919 920
php/classes/TimeTableMgr.php
@@ -114,16 +114,6 @@ class TimeTableMgr extends AmdaObjectMgr @@ -114,16 +114,6 @@ class TimeTableMgr extends AmdaObjectMgr
114 if ($key == 'created') { 114 if ($key == 'created') {
115 $rootElement->appendChild($this->objectDom->createElement($key, $this->created)); 115 $rootElement->appendChild($this->objectDom->createElement($key, $this->created));
116 } 116 }
117 - /*else if ($key == 'intervals') {  
118 - $n_int = 0;  
119 - foreach ($value as $item) {  
120 - $newInterval = $this->objectDom->createElement('intervals');  
121 - $newInterval->appendChild($this->objectDom->createElement('start', $item->start));  
122 - $newInterval->appendChild($this->objectDom->createElement('stop', $item->stop));  
123 - $rootElement->appendChild($newInterval);  
124 - $n_int++;  
125 - }  
126 - }*/  
127 // it is catalog 117 // it is catalog
128 else if ($key == 'parameters') { 118 else if ($key == 'parameters') {
129 $paramsElement = $this->setParamDescription($value); 119 $paramsElement = $this->setParamDescription($value);
@@ -161,28 +151,43 @@ class TimeTableMgr extends AmdaObjectMgr @@ -161,28 +151,43 @@ class TimeTableMgr extends AmdaObjectMgr
161 $lines = file($tmp_file,FILE_SKIP_EMPTY_LINES); 151 $lines = file($tmp_file,FILE_SKIP_EMPTY_LINES);
162 $description="Uploaded Time Table".PHP_EOL; 152 $description="Uploaded Time Table".PHP_EOL;
163 153
164 - foreach ($lines as $line){  
165 - if ($line[0] == '#') $description=$description.PHP_EOL.substr($line,1,-1); 154 + $recordsNumber = count($lines);
  155 + $descNumber = 0;
  156 +
  157 + foreach ($lines as $line)
  158 + {
  159 + if ($line[0] == '#') {
  160 + $description=$description.PHP_EOL.substr($line,1,-1);
  161 + }
166 else { 162 else {
167 - $date = explode(' ', preg_replace('!\s+!', ' ', $line)); 163 + $date = explode(' ', trim(preg_replace('!\s+!', ' ',$line)));
  164 +
168 if (!strtotime(trim($date[0]))) { 165 if (!strtotime(trim($date[0]))) {
169 $description=$description.PHP_EOL.$line; 166 $description=$description.PHP_EOL.$line;
  167 + $descNumber++;
170 continue; 168 continue;
171 } 169 }
172 // check if it is ISO format 170 // check if it is ISO format
173 - if (!isset($isIso)) $isIso = preg_match('/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})$/', trim($date[0])); 171 + if (!isset($isIso))
  172 + $isIso = preg_match('/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})$/', trim($date[0]));
  173 +
174 if (!$isIso) { 174 if (!$isIso) {
175 - if (count($date) == 2) {  
176 - $tempStartT = strtotime(trim($date[0]));  
177 - $tempStopT = strtotime(trim($date[1]));  
178 - }  
179 - else { // y-m-d h:m:s for example  
180 - $tempStartT = strtotime($date[0]." ".$date[1]);  
181 - $tempStopT = strtotime($date[2]." ".$date[3]);  
182 - } 175 + // y-m-d h:m:s for example
  176 + $dateLength = count($date) / 2;
  177 +
  178 + $tempStart = $date[0];
  179 + $tempStop = $date[$dateLength];
183 180
184 - $startDate = date('Y-m-d\TH:i:s',$tempStartT);  
185 - $stopDate = date('Y-m-d\TH:i:s',$tempStopT); 181 + if ($dateLength > 1) {
  182 + for ($i = 1; $i < $dateLength; $i++)
  183 + $tempStart.= $date[$i];
  184 +
  185 + for ($i = $dateLength + 1; $i < $dateLength * 2; $i++)
  186 + $tempStop .= $date[$i];
  187 + }
  188 +
  189 + $startDate = date('Y-m-d\TH:i:s',strtotime($tempStart));
  190 + $stopDate = date('Y-m-d\TH:i:s',strtotime($tempStop));
186 191
187 if (!$onlyDescription) 192 if (!$onlyDescription)
188 $attributesToReturn['intervals'][] = array('start' => $startDate, 'stop' => $stopDate); 193 $attributesToReturn['intervals'][] = array('start' => $startDate, 'stop' => $stopDate);
@@ -193,15 +198,16 @@ class TimeTableMgr extends AmdaObjectMgr @@ -193,15 +198,16 @@ class TimeTableMgr extends AmdaObjectMgr
193 } 198 }
194 } 199 }
195 } 200 }
196 - 201 + if ( $recordsNumber == $descNumber )
  202 + $description = "Looks like we can not read your time format...".PHP_EOL.$description;
  203 +
197 $attributesToReturn['description'] = $description; 204 $attributesToReturn['description'] = $description;
198 $attributesToReturn['name'] = basename($tmp_file, '.'.$suffix[1]); 205 $attributesToReturn['name'] = basename($tmp_file, '.'.$suffix[1]);
199 $attributesToReturn['created'] = date('Y-m-d\TH:i:s'); 206 $attributesToReturn['created'] = date('Y-m-d\TH:i:s');
200 207
201 return $attributesToReturn; 208 return $attributesToReturn;
202 } 209 }
203 -  
204 - 210 +
205 /* 211 /*
206 * Uploaded vot TT => convert to array 212 * Uploaded vot TT => convert to array
207 */ 213 */
update_amda/cp2amda
@@ -61,6 +61,7 @@ if [ -d $NEWMETA/ParamInfo ]; then @@ -61,6 +61,7 @@ if [ -d $NEWMETA/ParamInfo ]; then
61 mkdir $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo 61 mkdir $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo
62 fi 62 fi
63 cp $NEWMETA/ParamInfo/info*.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo 63 cp $NEWMETA/ParamInfo/info*.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo
  64 + cp $AMDAINTERNALDIR/PARAM_INFO_PREDEFINED/info*.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo
64 fi 65 fi
65 66
66 # copy LocalParams.xml created by makeTree.php to AMDA installation 67 # copy LocalParams.xml created by makeTree.php to AMDA installation