Commit 1be6ea035143fdc46d5c8f44bb3bf0379e65b5d4

Authored by Erdogan Furkan
1 parent c2cc7749

#10098 - Final corrections

desktop.php
1 1 <?php
2   - /**
  2 +
  3 +/**
3 4 * @file index.php
4 5 * @version $Id: desktop.php 2934 2015-06-03 13:23:22Z elena $
5 6 *
6 7 */
7   -
8   - require_once('php/config.php');
9   -
10   - // error_reporting(E_ALL);
11   - if (!isset($_POST['username'])) {
  8 +
  9 +require_once('php/config.php');
  10 +
  11 +// error_reporting(E_ALL);
  12 +if (!isset($_POST['username'])) {
12 13 header('Location: index.html');
13 14 exit(1);
14   - }
  15 +}
15 16  
16   - if (!isset($_POST['username'])) die('<a href="index.html">LOGIN SVP</a>');
17   - $usrMgr = new UserMgr();
18   -
19   - $sessionID = $usrMgr->init();
20   - if ($sessionID === FALSE) {
  17 +if (!isset($_POST['username'])) die('<a href="index.html">LOGIN SVP</a>');
  18 +$usrMgr = new UserMgr();
  19 +
  20 +$sessionID = $usrMgr->init();
  21 +if ($sessionID === FALSE) {
21 22 header('Location: index.html?error=1');
22 23 exit(1);
23   - }
  24 +}
24 25 ?>
25 26  
26 27 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
27 28 <html>
  29 +
28 30 <head>
29 31 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
30 32 <meta http-equiv="PRAGMA" content="NO-CACHE">
31 33 <meta http-equiv="CACHE-CONTROL" content="NO-CACHE">
32 34 <meta http-equiv="EXPIRES" content="-1">
33 35  
34   - <title><?php if (defined('TITLE')) { echo TITLE; } else { echo 'AMDANEW'; } ?></title>
  36 + <title><?php if (defined('TITLE')) {
  37 + echo TITLE;
  38 + } else {
  39 + echo 'AMDANEW';
  40 + } ?></title>
35 41 <!-- Important ! the order of css loading : ext-all.css - should be the first -->
36 42 <link rel="stylesheet" type="text/css" href="js/lib/ext/resources/css/ext-all.css" />
37 43 <link rel="stylesheet" type="text/css" href="js/resources/css/desktop.css" />
38 44 <link rel="stylesheet" type="text/css" href="js/resources/css/amda.css" />
39   -
  45 +
40 46 <link rel="icon" href="favicon.ico" type="image/x-icon">
41   - <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
  47 + <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
42 48  
43   -<!-- <script type="text/javascript" src="js/lib/ext/builds/ext-core.js"></script> -->
44   -<!-- <script type="text/javascript" src="js/lib/ext/bootstrap.js"></script> -->
45   -<!-- <script type="text/javascript" src="js/lib/ext/ext-all-debug-w-comments.js"></script> -->
  49 + <!-- <script type="text/javascript" src="js/lib/ext/builds/ext-core.js"></script> -->
  50 + <!-- <script type="text/javascript" src="js/lib/ext/bootstrap.js"></script> -->
  51 + <!-- <script type="text/javascript" src="js/lib/ext/ext-all-debug-w-comments.js"></script> -->
46 52 <script type="text/javascript" src="js/lib/ext/ext-all.js"></script>
47   -<!-- <script type="text/javascript" src="js/lib/ext/ext-all-dev.js"></script> -->
  53 + <!-- <script type="text/javascript" src="js/lib/ext/ext-all-dev.js"></script> -->
48 54 <script type="text/javascript" src="js/lib/ext-override.js"></script>
49   -
50   -<!-- Direct API -->
51   - <script type="text/javascript" src="php/api.php"></script>
52 55  
53   -
54   -<!-- <script src="help/movies/Resources/scripts/prototype.js" language="JavaScript" type="text/javascript"></script>
  56 + <!-- Direct API -->
  57 + <script type="text/javascript" src="php/api.php"></script>
  58 +
  59 + <!-- <script src="help/movies/Resources/scripts/prototype.js" language="JavaScript" type="text/javascript"></script>
55 60 <script src="help/movies/Resources/scripts/qtp_poster.js" language="JavaScript" type="text/javascript"></script>
56 61 <link href="help/movies/Resources/stylesheets/qtp_poster.css" rel="StyleSheet" type="text/css" /> --->
57 62  
58 63  
59 64 <script type="text/javascript">
60   - //Enable dynamic loading for improved debugging support
61   - Ext.Loader.setConfig({enabled: true});
62   -
  65 + //Enable dynamic loading for improved debugging support
  66 + Ext.Loader.setConfig({
  67 + enabled: true
  68 + });
  69 +
63 70 Ext.Loader.setPath({
64   - 'Ext' : 'js/lib/ext/src',
65   - 'Ext.ux.desktop' : 'js/lib/ux/desktop',
66   - 'Ext.ux' : 'js/lib/ext/examples/ux',
67   - 'MyDesktop' : 'js/lib/ux/desktop/exampleModules',
68   - 'extensions' : 'js/lib/ux',
69   - 'Ext.ux.amdaGrid' : 'js/lib/ux/grid',
70   - 'samp' : 'js/lib/SAMP',
71   - 'amdaDesktop' : 'js/app/controllers',
72   - 'amdaUI' : 'js/app/views',
73   - 'amdaPlotComp' : 'js/app/views/PlotComponents',
74   - 'amdaModel' : 'js/app/models',
75   - 'amdaPlotObj' : 'js/app/models/PlotObjects',
76   - 'amdaReader' : 'js/app/stores',
77   - 'amdaApp' : 'js/app'
  71 + 'Ext': 'js/lib/ext/src',
  72 + 'Ext.ux.desktop': 'js/lib/ux/desktop',
  73 + 'Ext.ux': 'js/lib/ext/examples/ux',
  74 + 'MyDesktop': 'js/lib/ux/desktop/exampleModules',
  75 + 'extensions': 'js/lib/ux',
  76 + 'Ext.ux.amdaGrid': 'js/lib/ux/grid',
  77 + 'samp': 'js/lib/SAMP',
  78 + 'amdaDesktop': 'js/app/controllers',
  79 + 'amdaUI': 'js/app/views',
  80 + 'amdaPlotComp': 'js/app/views/PlotComponents',
  81 + 'amdaModel': 'js/app/models',
  82 + 'amdaPlotObj': 'js/app/models/PlotObjects',
  83 + 'amdaReader': 'js/app/stores',
  84 + 'amdaApp': 'js/app'
78 85 });
79 86  
80 87 Ext.require('amdaDesktop.AmdaStateProvider');
... ... @@ -84,18 +91,18 @@
84 91 Ext.require('amdaApp.AmdaApp');
85 92  
86 93 var myDesktopApp;
87   -
  94 +
88 95 var isMigration = false;
89 96 var sessionID = '<?php echo $sessionID; ?>';
90   - var isFirstVisit = '<?php echo $usrMgr->isFirst; ?>';
  97 + var isFirstVisit = '<?php echo $usrMgr->isFirst; ?>';
91 98 var isOldWS = false; // '<#?php echo $usrMgr->isOldWS; ?>';
92   - var isSpecialInfo = '<?php echo $usrMgr->isSpecialInfo; ?>';
93   - var isNewInfo = '<?php echo $usrMgr->isNewInfo; ?>';
  99 + var isSpecialInfo = '<?php echo $usrMgr->isSpecialInfo; ?>';
  100 + var isNewInfo = '<?php echo $usrMgr->isNewInfo; ?>';
94 101 var news = '../data/' + sessionID + '/INFO';
95 102  
96   - var AMDAVERSION = '<?php if (defined('AMDA_VERSION')) echo AMDA_VERSION;?>';
97   -
98   - var wsSize = '<?php echo $usrMgr->getWsSize(); ?>';
  103 + var AMDAVERSION = '<?php if (defined('AMDA_VERSION')) echo AMDA_VERSION; ?>';
  104 +
  105 + var wsSize = '<?php echo $usrMgr->getWsSize(); ?>';
99 106 var diskQuota = '<?php echo DISK_QUOTA; ?>';
100 107  
101 108 var freeSpace = diskQuota - wsSize;
... ... @@ -104,92 +111,86 @@
104 111 var isGuest = sessionID.match('guest');
105 112  
106 113 var max_uploaded_file_size = '<?php echo MAX_UPLOADED_FILESIZE; ?>';
107   - var guestSessionDuration = '<?php echo GuestSessionDuration*60; ?>'; // in secs
108   - var maxGuestTimeInterval = '<?php echo MaxGuestTimeInterval; ?>'; // in days
109   -
110   - var gatewayTimeout = '<?php if (defined('GATEWAY_TIMEOUT')) echo GATEWAY_TIMEOUT; else echo 300000; ?>'; // in msec
  114 + var guestSessionDuration = '<?php echo GuestSessionDuration * 60; ?>'; // in secs
  115 + var maxGuestTimeInterval = '<?php echo MaxGuestTimeInterval; ?>'; // in days
  116 +
  117 + var gatewayTimeout = '<?php if (defined('GATEWAY_TIMEOUT')) echo GATEWAY_TIMEOUT;
  118 + else echo 300000; ?>'; // in msec
111 119  
112 120 var logExecTime = <?php echo (defined('LOG_EXEC_TIME') && (LOG_EXEC_TIME === TRUE) ? 'true' : 'false'); ?>;
113 121 //create mask class (LoadMask for elements has been deprecated, use Ext.dom.Element.mask & Ext.dom.Element.unmask)
114 122 var AMDAMask = new Ext.Class({
115   - show : function(interactivePlot)
116   - {
117   - var msg = 'Processing...Please wait';
118   - if (interactivePlot)
  123 + show: function(interactivePlot) {
  124 + var msg = 'Processing...Please wait';
  125 + if (interactivePlot)
119 126 msg += ' <br/> <p align="center"><input id="killopBtn" type="button" value="Kill process" /></p>';
120 127  
121 128 var mask = Ext.getBody().mask(msg, 'amda-mask');
122 129  
123   - if (interactivePlot)
124   - {
  130 + if (interactivePlot) {
125 131 var killBtn = Ext.get('killopBtn');
126   - killBtn.on('click',function(e,t) {
127   - AmdaAction.killPlotRequest(function (result, e)
128   - {
129   - var t = e.getTransaction();
130   - if (e.status)
131   - {
132   - if (!result)
133   - myDesktopApp.errorMsg('Cannot kill process');
134   - }
135   - else
136   - myDesktopApp.errorMsg(e.message);
137   -
138   - },this);
139   -
140   - },
141   - this);
  132 + killBtn.on('click', function(e, t) {
  133 + AmdaAction.killPlotRequest(function(result, e) {
  134 + var t = e.getTransaction();
  135 + if (e.status) {
  136 + if (!result)
  137 + myDesktopApp.errorMsg('Cannot kill process');
  138 + } else
  139 + myDesktopApp.errorMsg(e.message);
  140 +
  141 + }, this);
  142 +
  143 + },
  144 + this);
142 145  
143 146 }
144 147 },
145   - hide : function()
146   - {
  148 + hide: function() {
147 149 Ext.getBody().unmask();
148 150 this.tid = null;
149 151 },
150   - isMasked : function()
151   - {
  152 + isMasked: function() {
152 153 return Ext.getBody().isMasked();
153 154 }
154 155 });
155   -
  156 +
156 157 var loadMask;
157 158  
158   - Ext.onReady(function () {
  159 + Ext.onReady(function() {
159 160 //TODO update jobsStatus onLogin
160   - Ext.Ajax.extraParams = {sessionID : sessionID};
  161 + Ext.Ajax.extraParams = {
  162 + sessionID: sessionID
  163 + };
161 164 Ext.Ajax.timeout = gatewayTimeout; // msec ; should be the same value (or less) as gateway timeout
162 165  
163   - Ext.Ajax.on('requestexception', function(conn, response, options, e) {
  166 + Ext.Ajax.on('requestexception', function(conn, response, options, e) {
164 167  
165 168 if (loadMask && loadMask.isMasked())
166 169 loadMask.hide();
167   -
  170 +
168 171 if (response && response.statusText) {
169   - if (response.timedout)
170   - alert('Request processing time exceeds gateway timeout\n In case of parameter from Remote Bases : please re-launch the same request in 10 min,\n otherwise select "non-screen" FileOutput or contact AMDA team');
171   - else
  172 + if (response.timedout)
  173 + alert('Request processing time exceeds gateway timeout\n In case of parameter from Remote Bases : please re-launch the same request in 10 min,\n otherwise select "non-screen" FileOutput or contact AMDA team');
  174 + else
172 175 alert(response.statusText);
173   - }
174   - else
  176 + } else
175 177 alert('Communication failure');
176   - });
177   -
  178 + });
  179 +
178 180 // backspace key disable
179 181 Ext.EventManager.on(window, 'keydown', function(e, t) {
180 182 if (e.getKey() == e.BACKSPACE && ((!/^input$/i.test(t.tagName) && !/^textarea$/i.test(t.tagName)) || t.disabled || t.readOnly)) {
181   - e.stopEvent();
  183 + e.stopEvent();
182 184 }
183 185 });
184 186  
185 187 var stateProvider = Ext.create('amdaDesktop.AmdaStateProvider');
186 188 stateProvider.on({
187 189 scope: this,
188   - afterrestore: function(provider)
189   - {
190   - amdaDesktop.JobsMgr.getStatus();
  190 + afterrestore: function(provider) {
  191 + amdaDesktop.JobsMgr.getStatus();
191 192 Ext.state.Manager.setProvider(provider);
192   - myDesktopApp = new amdaApp.AmdaApp();
  193 + myDesktopApp = new amdaApp.AmdaApp();
193 194 // global message bus
194 195 myDesktopApp.EventManager = new Ext.util.Observable();
195 196 // not needed - for documentation only
... ... @@ -202,6 +203,7 @@
202 203 });
203 204 </script>
204 205 </head>
205   -<body/>
206   -</html>
207 206  
  207 +<body />
  208 +
  209 +</html>
208 210 \ No newline at end of file
... ...
js/app/views/PlotComponents/PlotContextManager.js
... ... @@ -107,6 +107,32 @@ Ext.define(&#39;amdaPlotComp.PlotContextManager&#39;, {
107 107 return links;
108 108 },
109 109  
  110 + setIntervalsRef(links, menu) {
  111 + var realLinks = new Array();
  112 + for (i = 0; i < links.length; i++) {
  113 + var isAlreadyHere = false
  114 + for (j = 0; j < i; j++) {
  115 + if (links[i] == links[j]) {
  116 + isAlreadyHere = true;
  117 + continue;
  118 + }
  119 + }
  120 + if (isAlreadyHere == false) {
  121 + realLinks.push(links[i]);
  122 + }
  123 + }
  124 +
  125 + Ext.each(realLinks, function (realLink) {
  126 + menu.add({
  127 + text: realLink,
  128 + handler: function () {
  129 + window.open(realLink, "_blank");
  130 + }
  131 + });
  132 + });
  133 + return realLinks;
  134 + },
  135 +
110 136 isInterval: function (context, panel, crtTimestamp) {
111 137 isInterval = false;
112 138 Ext.each(panel.intervals, function (interval) {
... ...
js/app/views/PlotComponents/PlotIntervalRefPlug.js deleted
... ... @@ -1,141 +0,0 @@
1   -/**
2   - * Projectย  : AMDA-NG
3   - * Name : PlotIntervalRefPlug.js
4   - * @plugin amdaPlotComp.PlotIntervalRefPlug
5   - * @extends Ext.util.Observable
6   - * @ptype plotIntervalRefPlugin
7   - * @brief Shows references for Interval
8   - * @author Furkan
9   - * @version $Id: PlotIntervalRefPlug.js
10   - ********************************************************************************
11   - * FT Id : Date : Name - Description
12   - *******************************************************************************
13   - * :
14   - */
15   -
16   -
17   -Ext.define('amdaPlotComp.PlotIntervalRefPlug', {
18   - extend: 'Ext.util.Observable',
19   - alias: 'plugin.plotIntervalRefPlugin',
20   -
21   - id: 'plot-intervalref-plug',
22   - win: null,
23   - form: null,
24   - interactiveId: '',
25   - actionDone: '',
26   - durationDone: 0,
27   -
28   - constructor: function (config) {
29   - Ext.apply(this, config);
30   - this.callParent(arguments);
31   - },
32   -
33   - onDestroy: function () {
34   - this.win = null;
35   - },
36   -
37   - init: function (cmp) {
38   - this.hostCmp = cmp;
39   - },
40   -
41   - /**
42   - * creation of the window
43   - */
44   - show: function (interactiveId, links, xPos, yPos) {
45   - if (!this.win) {
46   - this.win = new Ext.Window({
47   - id: 'plot-intervalref-win-' + this.hostCmp.ownerCt.getId(), // Plot window ID
48   - width: 265,
49   - x: 0, y: 0,
50   - baseCls: 'x-panel',
51   - title: 'Catalogue references',
52   - layout: 'fit',
53   - constrain: true,
54   - collapsible: true,
55   - resizable: false,
56   - ghost: false,
57   - renderTo: this.hostCmp.ownerCt.body,
58   - items: this.getFormConfig(links),
59   - listeners: {
60   - scope: this,
61   - beforeclose: function () {
62   - this.hostCmp.panelImage.stopZoom();
63   - Ext.PluginManager.unregister(this);
64   - }
65   - },
66   - getConstrainVector: function (constrainTo) {
67   - var me = this;
68   - if (me.constrain || me.constrainHeader) {
69   - constrainTo = constrainTo || (me.floatParent && me.floatParent.getTargetEl()) || me.container || me.el.getScopeParent();
70   - return (me.constrainHeader ? me.header.el : me.el).getConstrainVector(constrainTo);
71   - }
72   - }
73   - });
74   -
75   - this.win.on('destroy', this.onDestroy, this);
76   -
77   - Ext.PluginManager.register(this);
78   - }
79   -
80   - this.interactiveId = interactiveId;
81   - this.win.show();
82   - this.win.setPosition(xPos, yPos - 250);
83   - },
84   -
85   - close: function () {
86   - if (this.win == null)
87   - return;
88   - this.win.close();
89   - },
90   - /**
91   - * Main form
92   - */
93   - getFormConfig: function (links) {
94   - this.form = new Ext.form.FormPanel({
95   - frame: true,
96   - width: 265,
97   - height: 80,
98   - layout: {
99   - type: 'vbox',
100   - pack: 'start',
101   - align: 'stretch'
102   - },
103   - fieldDefaults: {
104   - labelWidth: 60
105   - },
106   - items: [
107   - {
108   - xtype: 'fieldcontainer',
109   - layout: 'hbox',
110   - fieldLabel: 'Select the reference from the list',
111   - labelAlign: 'top',
112   - bodyStyle: { background: '#dfe8f6' },
113   - border: false,
114   - items: [
115   - {
116   - xtype: 'combo',
117   - name: 'referencelink',
118   - store: links,
119   - editable: false,
120   - width: 250,
121   - value: 'References',
122   - triggerAction: 'all'
123   - }
124   - ],
125   - }],
126   - buttons: [
127   -
128   - {
129   - text: 'Open in new tab',
130   - scope: this,
131   - handler: function () {
132   - var referencelink = this.form.getForm().findField('referencelink');
133   - window.open(referencelink.getValue(), "_blank");
134   - }
135   - }
136   - ]
137   -
138   - });
139   - return this.form;
140   - }
141   -});
js/app/views/PlotTabResultUI.js
... ... @@ -16,7 +16,6 @@ Ext.define(&#39;amdaUI.PlotTabResultUI&#39;, {
16 16 requires: [
17 17 'amdaPlotComp.PlotZoomPlug',
18 18 'amdaPlotComp.PlotExtendShiftPlug',
19   - 'amdaPlotComp.PlotIntervalRefPlug',
20 19 'amdaPlotComp.PlotContextManager',
21 20 'amdaPlotComp.PlotResultImage'
22 21 ],
... ... @@ -377,20 +376,13 @@ Ext.define(&#39;amdaUI.PlotTabResultUI&#39;, {
377 376  
378 377 var links = amdaPlotComp.PlotContextManager.getIntervalLinks(allintervalParams);
379 378 if (links.length > 0) {
  379 + var menu = Ext.create('Ext.menu.Menu', { plain: true });
  380 + var realLinks = amdaPlotComp.PlotContextManager.setIntervalsRef(links, menu);
380 381 me.contextualMenu.add('-');
381 382 me.contextualMenu.add([
382 383 {
383   -
384   - text: 'Open references',
385   - handler: function () {
386   - if (links.length == 1) {
387   - window.open(links, "_blank");
388   - }
389   - else {
390   - var intervalRefPlugin = this.getPlugin('plot-intervalref-plugin-id');
391   - intervalRefPlugin.show(me.interactiveId, links, sourceXPos, sourceYPos);
392   - }
393   - },
  384 + text: 'Open references (' + realLinks.length + ')',
  385 + menu: menu,
394 386 scope: me
395 387 }]);
396 388 }
... ... @@ -743,10 +735,6 @@ Ext.define(&#39;amdaUI.PlotTabResultUI&#39;, {
743 735 {
744 736 ptype: 'plotExtendShiftPlugin',
745 737 pluginId: 'plot-extendshift-plugin-id'
746   - },
747   - {
748   - ptype: 'plotIntervalRefPlugin',
749   - pluginId: 'plot-intervalref-plugin-id'
750 738 }],
751 739 listeners: {
752 740 scope: this,
... ... @@ -757,9 +745,6 @@ Ext.define(&#39;amdaUI.PlotTabResultUI&#39;, {
757 745 var exttendShiftPlugin = this.getPlugin('plot-extendshift-plugin-id');
758 746 if (exttendShiftPlugin)
759 747 exttendShiftPlugin.close();
760   - var intervalRefPlugin = this.getPlugin('plot-intervalref-plugin-id');
761   - if (intervalRefPlugin)
762   - intervalRefPlugin.close();
763 748 }
764 749 }
765 750 };
... ...
js/app/views/VisuUI.js
... ... @@ -54,12 +54,10 @@ Ext.define(&#39;amdaUI.VisuUI&#39;, {
54 54 /**
55 55 * load object catalog into this view
56 56 */
57   - loadObject: function ()
58   - {
  57 + loadObject: function () {
59 58 var me = this;
60 59  
61   - var onAfterInit = function (result, e)
62   - {
  60 + var onAfterInit = function (result, e) {
63 61 if (!result) {
64 62 myDesktopApp.errorMsg(e.message);
65 63 Ext.defer(function () {
... ... @@ -67,8 +65,7 @@ Ext.define(&#39;amdaUI.VisuUI&#39;, {
67 65 }, 10);
68 66  
69 67 return;
70   - } else if (!result.success)
71   - {
  68 + } else if (!result.success) {
72 69 if (result.message)
73 70 myDesktopApp.errorMsg(result.message);
74 71 else
... ... @@ -97,8 +94,8 @@ Ext.define(&#39;amdaUI.VisuUI&#39;, {
97 94 };
98 95  
99 96 var fieldsConfig = [];
100   - fieldsConfig.push({type: 'date', id: 'start', name: 'start', dateFormat: 'Y-m-d\\TH:i:s', convert: dateConvert});
101   - fieldsConfig.push({type: 'date', id: 'stop', name: 'stop', dateFormat: 'Y-m-d\\TH:i:s', convert: dateConvert});
  97 + fieldsConfig.push({ type: 'date', id: 'start', name: 'start', dateFormat: 'Y-m-d\\TH:i:s', convert: dateConvert });
  98 + fieldsConfig.push({ type: 'date', id: 'stop', name: 'stop', dateFormat: 'Y-m-d\\TH:i:s', convert: dateConvert });
102 99 me.parametersStore.each(function (param) {
103 100 switch (param.get('type')) {
104 101 case 0: //double
... ... @@ -147,8 +144,7 @@ Ext.define(&#39;amdaUI.VisuUI&#39;, {
147 144 * Check if changes were made before closing window
148 145 * @return true if changes
149 146 */
150   - fclose: function ()
151   - {
  147 + fclose: function () {
152 148 return false;
153 149 },
154 150  
... ... @@ -198,7 +194,7 @@ Ext.define(&#39;amdaUI.VisuUI&#39;, {
198 194  
199 195 var isFirst = true;
200 196 Ext.Array.each(chartTypes, function (chartType) {
201   - var tabContent = Ext.create(chartType.widget, {parametersStore: me.parametersStore});
  197 + var tabContent = Ext.create(chartType.widget, { parametersStore: me.parametersStore });
202 198 var tab = tabPanel.add({
203 199 title: chartType.title,
204 200 items: [
... ... @@ -214,17 +210,16 @@ Ext.define(&#39;amdaUI.VisuUI&#39;, {
214 210 });
215 211 },
216 212  
217   - init: function (config)
218   - {
  213 + init: function (config) {
219 214 this.catalogStore = Ext.create('Ext.data.Store', {
220 215 fields: []
221 216 });
222 217  
223 218 this.parametersStore = Ext.create('Ext.data.Store', {
224 219 fields: [
225   - {name: 'id', type: 'string'},
226   - {name: 'name', type: 'string'},
227   - {name: 'type', type: 'int'}
  220 + { name: 'id', type: 'string' },
  221 + { name: 'name', type: 'string' },
  222 + { name: 'type', type: 'int' }
228 223 ],
229 224 data: []
230 225 });
... ... @@ -238,14 +233,14 @@ Ext.define(&#39;amdaUI.VisuUI&#39;, {
238 233 mask: false,
239 234 shadow: false,
240 235 theme: 'Blue',
241   - background: {fill: "#fff"}
  236 + background: { fill: "#fff" }
242 237 };
243 238  
244 239 this.formPanel = Ext.create('Ext.form.Panel', {
245 240 region: 'center',
246 241 layout: 'border',
247   - bodyStyle: {background: '#dfe8f6'},
248   - defaults: {border: false, align: 'stretch', padding: '3'},
  242 + bodyStyle: { background: '#dfe8f6' },
  243 + defaults: { border: false, align: 'stretch', padding: '3' },
249 244 items: [
250 245 {
251 246 xtype: 'fieldset',
... ... @@ -254,11 +249,11 @@ Ext.define(&#39;amdaUI.VisuUI&#39;, {
254 249 {
255 250 xtype: 'fieldcontainer',
256 251 layout: 'hbox',
257   - fieldDefaults: {labelWidth: 80, labelAlign: 'right'},
  252 + fieldDefaults: { labelWidth: 80, labelAlign: 'right' },
258 253 items: [
259   - {xtype: 'textfield', fieldLabel: 'Catalog Name', name: 'name', readOnly: true},
260   - {xtype: 'splitter'},
261   - {xtype: 'textfield', fieldLabel: 'Intervals', name: 'nbIntervals', readOnly: true}
  254 + { xtype: 'textfield', fieldLabel: 'Catalog Name', name: 'name', readOnly: true },
  255 + { xtype: 'splitter' },
  256 + { xtype: 'textfield', fieldLabel: 'Intervals', name: 'nbIntervals', readOnly: true }
262 257 ]
263 258 }
264 259 ],
... ... @@ -300,60 +295,56 @@ Ext.define(&#39;amdaUI.VisuUI&#39;, {
300 295 }
301 296 ],
302 297 listeners:
303   - {
304   - render: function (o, op)
305   - {
306   - var me = this;
307   - var el = me.body.dom;
308   - var dropTarget = Ext.create('Ext.dd.DropTarget', el, {
309   - ddGroup: 'explorerTree',
310   - notifyEnter: function (ddSource, e, data)
311   - {
  298 + {
  299 + render: function (o, op) {
  300 + var me = this;
  301 + var el = me.body.dom;
  302 + var dropTarget = Ext.create('Ext.dd.DropTarget', el, {
  303 + ddGroup: 'explorerTree',
  304 + notifyEnter: function (ddSource, e, data) {
312 305  
313 306 },
314   - notifyOver: function (ddSource, e, data)
315   - {
  307 + notifyOver: function (ddSource, e, data) {
316 308 var nodeType = data.records[0].get('nodeType');
317 309 if ((nodeType == 'catalog' || nodeType == 'sharedcatalog') &&
318   - (data.records[0].get('leaf')))
319   - {
  310 + (data.records[0].get('leaf'))) {
320 311 this.valid = true;
321 312 return this.dropAllowed;
322 313 }
323 314 this.valid = false;
324 315 return this.dropNotAllowed;
325 316 },
326   - notifyDrop: function (ddSource, e, data)
327   - {
  317 + notifyDrop: function (ddSource, e, data) {
328 318 if (!this.valid)
329 319 return false;
330 320 var visuModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.visu.id);
331 321 if (visuModule) {
332   -
  322 +
333 323 var catNode = data.records[0];
334   - AmdaAction.getObject( catNode.get('id'), catNode.get('nodeType'), function(result, remoteEvent) {
  324 + AmdaAction.getObject(catNode.get('id'), catNode.get('nodeType'), function (result, remoteEvent) {
335 325 var catObj = Ext.create(catNode.get('objectDataModel'), result);
336   - if(catObj !== null){
337   - visuModule.addCatalog(catObj);
338   - }else{
339   - Ext.MessageBox.show({title: 'Warning',
340   - msg: '<br/>Undifined Catalog '+catNode.get('text'),
341   - width: 300,
342   - buttons: Ext.MessageBox,
343   - fn: me.overwriteProcess,
344   - icon: Ext.MessageBox.WARNING,
345   - scope: me
346   - });
347   - return false;
348   - }
349   -
  326 + if (catObj !== null) {
  327 + visuModule.addCatalog(catObj);
  328 + } else {
  329 + Ext.MessageBox.show({
  330 + title: 'Warning',
  331 + msg: '<br/>Undifined Catalog ' + catNode.get('text'),
  332 + width: 300,
  333 + buttons: Ext.MessageBox,
  334 + fn: me.overwriteProcess,
  335 + icon: Ext.MessageBox.WARNING,
  336 + scope: me
  337 + });
  338 + return false;
  339 + }
  340 +
350 341 }, this);
351 342 }
352 343 return true;
353 344 }
354 345 });
355   - }
356   - }
  346 + }
  347 + }
357 348 });
358 349  
359 350 var myConf = {
... ...