Commit db746f17caf5f383165728ad5b00a1d961b080f5

Authored by Hacene SI HADJ MOHAND
2 parents 80404514 c198a068

Merge branch 'master' of https://gitlab.irap.omp.eu/CDPP/AMDA_IHM

desktop.php
... ... @@ -9,10 +9,19 @@
9 9 require_once('php/config.php');
10 10  
11 11 // error_reporting(E_ALL);
  12 + if (!isset($_POST['username'])) {
  13 + header('Location: index.html');
  14 + exit(1);
  15 + }
  16 +
12 17 if (!isset($_POST['username'])) die('<a href="index.html">LOGIN SVP</a>');
13 18  
14 19 $usrMgr = new UserMgr();
15 20 $sessionID = $usrMgr->init();
  21 + if ($sessionID === FALSE) {
  22 + header('Location: index.html?error=1');
  23 + exit(1);
  24 + }
16 25 ?>
17 26  
18 27 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
... ... @@ -37,7 +46,7 @@
37 46 <!-- <script type="text/javascript" src="js/lib/ext/ext-all-debug-w-comments.js"></script> -->
38 47 <script type="text/javascript" src="js/lib/ext/ext-all.js"></script>
39 48 <!-- <script type="text/javascript" src="js/lib/ext/ext-all-dev.js"></script> -->
40   -<!-- <script type="text/javascript" src="js/lib/ext-override.js"></script> -->
  49 + <script type="text/javascript" src="js/lib/ext-override.js"></script>
41 50  
42 51 <!-- Direct API -->
43 52 <script type="text/javascript" src="php/api.php"></script>
... ...
help/catAsciiFormat 0 → 100644
... ... @@ -0,0 +1,16 @@
  1 +<h3>ASCII Catalog Format</h3>
  2 +<ul>
  3 +<li>Time formats in ascii catalog are the same as in ascii time tables.
  4 + <br/> <br/>
  5 +<li>Each ascii catalog should have a header with parameters description ( will be changed ) : see <i>Catalog Header example</i> below.
  6 +Note that parameter <i>id</i> should be unique for a given catalog.
  7 +<pre>
  8 +# Test catalog;
  9 +# Name: ascii_cat;
  10 +# Creation Date: 2019-09-01T08:11:53;
  11 +# Parameter 1: id:column1; name:Col 1; size:1; type:float;
  12 +# Parameter 2: id:column2; name:Col 2; size:1; type:int;
  13 +# Parameter 3: id:column3; name:Col 3; size:1; type:int;
  14 +# Parameter 4: id:column4; name:Col 4; size:1; type:int;
  15 +</pre>
  16 +</ul>
... ...
help/parameters/RO-IRFU-LAP-EAICD.PDF 0 → 100644
No preview for this file type
help/parameters/RO-IRFU-LAP-UG.PDF 0 → 100644
No preview for this file type
index.html
... ... @@ -13,6 +13,7 @@
13 13 <body>
14 14 <div id="centrage">
15 15  
  16 +
16 17 <div id="trou">
17 18  
18 19 <div id="couvercle"></div>
... ... @@ -20,11 +21,56 @@
20 21 <div id="TousLesBoutons">
21 22 <div id="Btn_FirstVisit" onclick="location.href='help.html';"></div>
22 23 <div id="Btn_Rules" onclick="location.href='help/policy.html';"></div>
23   -<form method="POST" action="desktop.php">
  24 +<form id="Form_Login" method="POST" action="desktop.php" onsubmit="return checkForm(this);">
  25 + <div id="loader" class="loader"></div>
24 26 <input type="text" name="username" placeholder="LOGIN" id="Btn_EnterLogin" class="PlaceHolder" />
25 27 <input type="password" name="password" placeholder="PASSWORD" id="Btn_EnterPassword" class="PlaceHolder"/>
26   - <div><input id="Btn_Login" type="submit" value=""/></div>
27   -</form>
  28 + <div><input id="Btn_Login" name="login" type="submit" value=""/></div>
  29 +</form>
  30 +<script type="text/javascript">
  31 + function setLoginLoader(value) {
  32 + var form = document.getElementById('Form_Login');
  33 + form.elements['username'].readOnly = value;
  34 + form.elements['password'].readOnly = value;
  35 + form.elements['login'].disabled = value;
  36 + document.getElementById("loader").style.display = value ? 'block' : 'none';
  37 + }
  38 +
  39 +
  40 + function checkForm(form)
  41 + {
  42 + if (form.elements['username'].value == "" || form.elements['password'].value == "") {
  43 + alert('Please type your username and password');
  44 + return false;
  45 + }
  46 + setLoginLoader(true);
  47 + return true;
  48 + }
  49 +
  50 + window.onpageshow = function(event) {
  51 + var qs = (function(a) {
  52 + if (a == "") return {};
  53 + var b = {};
  54 + for (var i = 0; i < a.length; ++i)
  55 + {
  56 + var p=a[i].split('=', 2);
  57 + if (p.length == 1)
  58 + b[p[0]] = "";
  59 + else
  60 + b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
  61 + }
  62 + return b;
  63 + })(window.location.search.substr(1).split('&'));
  64 +
  65 + if (qs["error"] && qs["error"] == "1") {
  66 + alert('Cannot connect to AMDA');
  67 + return false;
  68 + }
  69 +
  70 + setLoginLoader(false);
  71 +
  72 + };
  73 +</script>
28 74 <a href="mailto:amda@irap.omp.eu?subject=AMDA registration" id="Btn_Register"></a>
29 75 <a href="mailto:amda@irap.omp.eu?subject=AMDA contact" id="Btn_Contact"></a>
30 76 <div id="Btn_About" onclick="location.href='help/info.html';"></div><div id="textAbout">AMDA Info</div>
... ...
js/app/views/CatalogUI.js
... ... @@ -270,6 +270,7 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
270 270 {
271 271 xtype: 'rownumberer',
272 272 width: 50,
  273 + minWidth: 50,
273 274 renderer: function (value, metaData, record) {
274 275 var msg = record.index + 1;
275 276 if (record.get('isNew') || record.get('isModified')) {
... ... @@ -286,6 +287,7 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
286 287 sortable: true,
287 288 dataIndex: 'start',
288 289 width: 120,
  290 + minWidth: 50,
289 291 menuDisabled: false,
290 292 editor: {
291 293 xtype: 'datefield',
... ... @@ -302,6 +304,7 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
302 304 sortable: true,
303 305 dataIndex: 'stop',
304 306 width: 120,
  307 + minWidth: 50,
305 308 menuDisabled: false,
306 309 editor: {
307 310 xtype: 'datefield',
... ... @@ -317,6 +320,7 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
317 320 sortable: true,
318 321 dataIndex: 'durationHour',
319 322 width: 120,
  323 + minWidth: 50,
320 324 menuDisabled: false,
321 325 hidden: true,
322 326 id: amdaUI.CatalogUI.COL_TO_HIDE_DURATION + '1',
... ... @@ -336,6 +340,7 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
336 340 sortable: true,
337 341 dataIndex: 'durationMin',
338 342 width: 120,
  343 + minWidth: 50,
339 344 menuDisabled: false,
340 345 hidden: false,
341 346 id: amdaUI.CatalogUI.COL_TO_HIDE_DURATION + '2',
... ... @@ -355,6 +360,7 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
355 360 sortable: true,
356 361 dataIndex: 'durationSec',
357 362 width: 120,
  363 + minWidth: 50,
358 364 menuDisabled: false,
359 365 hidden: true,
360 366 id: amdaUI.CatalogUI.COL_TO_HIDE_DURATION + '3',
... ... @@ -378,7 +384,8 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
378 384 text: obj.name,
379 385 sortable: true,
380 386 dataIndex: obj.id,
381   - menuDisabled: false
  387 + menuDisabled: false,
  388 + minWidth: 50
382 389 };
383 390 switch (obj.type) {
384 391 case 0: //double
... ... @@ -389,7 +396,7 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
389 396 xtype: 'gridcolumn',
390 397 width: pramColumnWidth * parseInt(obj.size),
391 398 editor: 'textfield',
392   - filter: {type: 'numeric'}
  399 + filter: {type: 'numeric', menuItemCfgs: {decimalPrecision: 10}}
393 400 });
394 401 break;
395 402 case 1: //dateTime
... ... @@ -783,6 +790,12 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
783 790 selModel: {pruneRemoved: false},
784 791 // selType: 'cellmodel',
785 792 plugins: [cellEditing, {ptype: 'bufferedrenderer'}],
  793 + listeners: {
  794 + afterrender: function () {
  795 + this.TTGrid.headerCt.resizer.tracker.gridBugFix = true;
  796 + },
  797 + scope: this
  798 + },
786 799 dockedItems: [{
787 800 xtype: 'toolbar',
788 801 items: [{
... ... @@ -888,7 +901,7 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
888 901 dock: 'bottom',
889 902 ui: 'footer',
890 903 height: 140,
891   -
  904 +
892 905 items: [
893 906 {
894 907 type: 'button',
... ...
js/app/views/StatisticsUI.js
... ... @@ -117,9 +117,8 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
117 117 updateObject : function()
118 118 {
119 119 // get the basic form of the left
120   - var basicForm = this.formPanel.items.items[0].getForm();
121   - var updateStatus = true;
122   -
  120 + var basicForm = this.formPanel.items.items[1].getForm();
  121 + var updateStatus = true;
123 122 var formValues = basicForm.getValues();
124 123 this.object.set('name',this.fieldName.getValue());
125 124 this.object.set('description',formValues.description);
... ... @@ -151,9 +150,8 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
151 150 +'<br>You must add one or choose Time Selection `by Interval`');
152 151 return false;
153 152 }
154   -
  153 +
155 154 basicForm.updateRecord(this.object);
156   -
157 155 this.object.set('timesrc', timeSource);
158 156 // set valid intervals into TimeTable object
159 157 if (timeSource === amdaModel.AmdaTimeObject.inputTimeSrc[0])
... ... @@ -180,15 +178,6 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
180 178 */
181 179 init : function (config)
182 180 {
183   -// var functions = Ext.create('Ext.data.Store', {
184   -// fields: ['id', 'name'],
185   -// data : [
186   -// {"id":"min", "name":"MIN"},
187   -// {"id":"max", "name":"MAX"},
188   -// {"id":"mean","name":"MEAN"}
189   -// ]
190   -// });
191   -
192 181 this.fieldName = new Ext.form.field.Text({
193 182 fieldLabel: 'Catalog Name',
194 183 allowBlank : false,
... ... @@ -385,7 +374,6 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
385 374 pack: 'start',
386 375 align: 'stretch'
387 376 },
388   - //bodyStyle: {background : '#dfe8f6'},
389 377 defaults: { bodyStyle: {background : '#dfe8f6'}, padding : '3'},
390 378 fieldDefaults: { labelWidth: 80, labelAlign : 'top' },
391 379 items: [ {
... ...
js/app/views/UploadPanelUI.js
... ... @@ -455,7 +455,7 @@ Ext.define(&#39;amdaUI.UploadPanelUI&#39;, {
455 455 }
456 456 else {
457 457 this.formats = [
458   - { boxLabel: 'ASCII&nbsp;<img amda_clicktip="ttTimeFormat" style="vertical-align:bottom" src="js/resources/images/16x16/info_mini.png"', name: 'catfrmt', inputValue: 'ASCII', checked: true},
  458 + { boxLabel: 'ASCII&nbsp;<img amda_clicktip="catAsciiFormat" style="vertical-align:middle" src="js/resources/images/icons/attention.png"', name: 'catfrmt', inputValue: 'ASCII', checked: true},
459 459 { boxLabel: 'VOTable', name: 'catfrmt', inputValue: 'VOT'}
460 460 ];
461 461  
... ...
js/lib/ext-override.js
1   -/**
  1 +/**
2 2 * Project : AMDA-NG4
3 3 * Name : ext-override.js
4 4 * @file ext-override.js
5   -
  5 +
6 6 * @brief patches for extjs
7 7 * @author elena (sencha support)
8 8 * @version $Id: ext-override.js 2345 2014-05-13 09:06:43Z elena $
... ... @@ -10,12 +10,68 @@
10 10 * FT Id : Date : Name - Description
11 11 *******************************************************************************
12 12 * : :16/06/2011 : elena - creation
13   - *
  13 + *
14 14 */
15 15  
16   -Ext.onReady(function () {
17   -
18   -// for version 4.1.3 - corrected in 4.2.2
  16 +Ext.onReady(function () {
  17 +
  18 + // Fix for #7096
  19 + Ext.override(Ext.dd.DragTracker, {
  20 + constrainModes: {
  21 + point: function (me, xy) {
  22 + var dr = me.dragRegion,
  23 + constrainTo = me.getConstrainRegion();
  24 +
  25 + if (!constrainTo) {
  26 + return xy;
  27 + }
  28 + dr.x = dr.left = dr[0] = dr.right = xy[0];
  29 + dr.y = dr.top = dr[1] = dr.bottom = xy[1];
  30 + if (!me.gridBugFix)
  31 + dr.constrainTo(constrainTo);
  32 +
  33 + return [dr.left, dr.top];
  34 + },
  35 + // Constrain the dragTarget to within the constrain region. Return the passed xy adjusted by the same delta.
  36 + dragTarget: function(me, xy) {
  37 + var s = me.startXY,
  38 + dr = me.startRegion.copy(),
  39 + constrainTo = me.getConstrainRegion(),
  40 + adjust;
  41 + // No constraint
  42 + if (!constrainTo) {
  43 + return xy;
  44 + }
  45 + // See where the passed XY would put the dragTarget if translated by the unconstrained offset.
  46 + // If it overflows, we constrain the passed XY to bring the potential
  47 + // region back within the boundary.
  48 + dr.translateBy(xy[0] - s[0], xy[1] - s[1]);
  49 + // Constrain the X coordinate by however much the dragTarget overflows
  50 + if (dr.right > constrainTo.right) {
  51 + xy[0] += adjust = (constrainTo.right - dr.right);
  52 + // overflowed the right
  53 + dr.left += adjust;
  54 + }
  55 + if (dr.left < constrainTo.left) {
  56 + xy[0] += (constrainTo.left - dr.left);
  57 + }
  58 + // overflowed the left
  59 + // Constrain the Y coordinate by however much the dragTarget overflows
  60 + if (dr.bottom > constrainTo.bottom) {
  61 + xy[1] += adjust = (constrainTo.bottom - dr.bottom);
  62 + // overflowed the bottom
  63 + dr.top += adjust;
  64 + }
  65 + if (dr.top < constrainTo.top) {
  66 + xy[1] += (constrainTo.top - dr.top);
  67 + }
  68 + // overflowed the top
  69 + return xy;
  70 + }
  71 + }
  72 + });
  73 +
  74 +// for version 4.1.3 - corrected in 4.2.2
19 75 /*Ext.override(Ext.grid.RowNumberer, {
20 76 renderer: function(value, metaData, record, rowIdx, colIdx, store) {
21 77 var rowspan = this.rowspan;
... ... @@ -23,13 +79,13 @@ Ext.onReady(function () {
23 79 metaData.tdAttr = 'rowspan="' + rowspan + '"';
24 80 }
25 81  
26   - metaData.tdCls = Ext.baseCSSPrefix + 'grid-cell-special';
27   -
  82 + metaData.tdCls = Ext.baseCSSPrefix + 'grid-cell-special';
  83 +
28 84 return store.indexOf(record) + 1;
29 85 }
30 86 });*/
31   -
32   -//TODO check if needed for version 4.1.3, 4.2.2
  87 +
  88 +//TODO check if needed for version 4.1.3, 4.2.2
33 89 /*Ext.override(Ext.view.Table, {
34 90 onUpdate : function(store, record, operation, changedFieldNames) {
35 91 var me = this,
... ... @@ -38,15 +94,15 @@ Ext.onReady(function () {
38 94 oldCells, newCells, len, i,
39 95 columns, overItemCls,
40 96 isHovered, row;
41   -
42   - if (me.rendered) {
  97 +
  98 + if (me.rendered) {
43 99 index = me.store.indexOf(record);
44 100 columns = me.headerCt.getGridColumns();
45 101 overItemCls = me.overItemCls;
46 102  
47 103 // If we have columns which may *need* updating (think lockable grid child with all columns either locked or unlocked)
48 104 // and the changed record is within our view, then update the view
49   -
  105 +
50 106 if (columns.length && index > -1) {
51 107 newRow = me.bufferRender([record], index)[0];
52 108 oldRow = me.all.item(index);
... ... @@ -80,37 +136,37 @@ Ext.onReady(function () {
80 136 }
81 137 }
82 138 });*/
83   -
84   -//TODO check if needed for version 4.1.3, 4.2.2
  139 +
  140 +//TODO check if needed for version 4.1.3, 4.2.2
85 141 /*Ext.override(Ext.ZIndexManager, {
86 142 tempHidden: [],
87 143 show: function() {
88 144 var comp, x, y;
89   -
  145 +
90 146 while (comp = this.tempHidden.shift()) {
91 147 x = comp.x;
92 148 y = comp.y;
93   -
  149 +
94 150 comp.show();
95 151 comp.setPosition(x,y);
96 152 }
97   - }
98   - });
  153 + }
  154 + });
99 155  
100 156 Ext.override(Ext.selection.TreeModel, {
101   -
  157 +
102 158 onRowClick: function (view, record, item, index, e) {
103   - // Record index will be -1 if the clicked record is a metadata record and not selectable
  159 + // Record index will be -1 if the clicked record is a metadata record and not selectable
104 160 if (index !== -1) {
105   - if (!this.allowRightMouseSelection(e)) {
106   - return ;
  161 + if (!this.allowRightMouseSelection(e)) {
  162 + return ;
107 163 }
108   -
  164 +
109 165 //Don't process if it's a right-click over a previously selected record.
110 166 // if (!(e.type === 'contextmenu' && this.isSelected(record))) {
111 167 this.processSelection(view, record, item, index, e);
112 168 // }
113   - }
  169 + }
114 170 }
115 171 });
116 172 Ext.override(Ext.selection.Model, {
... ... @@ -142,5 +198,4 @@ Ext.onReady(function () {
142 198 return false;
143 199 }
144 200 });*/
145   -});
146   -
147 201 \ No newline at end of file
  202 +});
... ...
js/resources/css/login.css
... ... @@ -22,3 +22,23 @@ input, textarea { font-family:verdana,tahoma,arial,verdana,sans-serif; font-size
22 22 #field2 { left:540px; top:333px; width:200px; }
23 23 .qo-submit { background:transparent url(../images/login/login.gif) no-repeat 0 0; height:22px; left:705px; top:373px; width:43px; }
24 24 .qo-submit-over { background:transparent url(../images/login/login.gif) no-repeat 0 -38px; height:22px; left:705px; top:373px; width:43px; }
  25 +
  26 +.loader {
  27 + position: absolute;
  28 + left: 50%;
  29 + top: 50%;
  30 + z-index: 999;
  31 + margin: -75px 0 0 -75px;
  32 + border: 16px solid #f3f3f3;
  33 + border-radius: 50%;
  34 + border-top: 16px solid #3498db;
  35 + width: 50px;
  36 + height: 50px;
  37 + animation: spin 2s linear infinite;
  38 + display: none;
  39 +}
  40 +
  41 +@keyframes spin {
  42 + 0% { transform: rotate(0deg); }
  43 + 100% { transform: rotate(360deg); }
  44 +}
... ...
js/resources/images/icons/attention.png 0 → 100644

567 Bytes

php/RemoteDataCenter/IPIM.php
... ... @@ -19,7 +19,7 @@ class IPIM extends SimulationDataCenterClass
19 19 protected $energyTableWidth = 200;
20 20  
21 21  
22   - protected function addSimulatedRegionToTargetsFile($reg=null,$reg=null){}
  22 + protected function addSimulatedRegionToTargetsFile($reg=null,$coordName=null){}
23 23  
24 24 protected function getDatasetName($no)
25 25 {
... ...
php/classes/TimeTableCacheSortObject.php
... ... @@ -235,7 +235,7 @@ class TimeTableCacheSortObject
235 235 {
236 236 $res = $part->compare($global_intervals[$index_a], $global_intervals[$index_b]);
237 237 if ($res != 0)
238   - return $res;
  238 + return ($res > 0) ? 1 : -1;
239 239 }
240 240 return $index_a-$index_b;
241 241 });
... ...
php/classes/UserMgr.php
... ... @@ -328,8 +328,9 @@ class UserMgr
328 328 // New Bases to add
329 329 if (count($basesToAdd) > 0) {
330 330 foreach ($basesToAdd as $baseToAdd) {
331   - $centerNode = $this->makeNewBase($baseToAdd);
332   - $this->paramMgr->xmlDom->documentElement->appendChild($centerNode);
  331 + $centerNode = $this->makeNewBase($baseToAdd);
  332 + if (isset($centerNode))
  333 + $this->paramMgr->xmlDom->documentElement->appendChild($centerNode);
333 334 }
334 335 }
335 336  
... ... @@ -535,8 +536,9 @@ class UserMgr
535 536  
536 537 public function init()
537 538 {
538   - if ($this->ddLogin() != 0)
539   - die('<h2>You are trying to log in as '.$this->user.'<br/> Please check that you entered a valid password</h2>');
  539 + if ($this->ddLogin() != 0) {
  540 + return FALSE;
  541 + }
540 542  
541 543 $this->userdir = USERPATH."/".$this->user."/";
542 544  
... ...