Commit 9d0827cd6000f7ed74795874b0e6752d1ac2afdf

Authored by Hacene SI HADJ MOHAND
2 parents 90412dba 7bc1d734
Exists in 8928 and in 1 other branch 6728

Merge branch 'master' into 8928

help/policy.html
... ... @@ -18,15 +18,18 @@
18 18 <h3>Rules of the road</h3>
19 19 <div class="title">
20 20 <ul>
21   - <li><a href="licenceAction.do.html" target="_blank">CDPP</a>
22   - <li><a href="http://spdf.gsfc.nasa.gov/new_users.html" target="_blank">CDAWEB</a>
23   - <li><a href="http://ppi.pds.nasa.gov/citations_policy.jsp" target="_blank">PDS</a>
24   - <li><a href="http://themis.ssl.berkeley.edu/roadrules.shtml" target="_blank">THEMIS</a>
25   - <li><a href="http://lasp.colorado.edu/home/maven/files/2014/09/MAVEN_public-rules-of-the-road-v3.pdf" target="_blank">MAVEN</a>
26 21 <li><a href="SKR.html" target="_blank">CASSINI/RPWS/SKR</a>
  22 + <li><a href="http://spdf.gsfc.nasa.gov/new_users.html" target="_blank">CDAWEB</a>
  23 + <li><a href="licenceAction.do.html" target="_blank">CDPP</a>
27 24 <li><a href="http://www.cosmos.esa.int/web/csa/rules-of-the-road" target="_blank">CSA</a>
28   - <li><a href="STEREO.html" target="_blank">STEREO</a>
  25 + <li><a href="http://lasp.colorado.edu/home/maven/files/2014/09/MAVEN_public-rules-of-the-road-v3.pdf" target="_blank">MAVEN</a>
  26 + <li><a href="https://lasp.colorado.edu/mms/sdc/public/about" target="_blank">MMS</a>
  27 + <li><a href="http://ppi.pds.nasa.gov/citations_policy.jsp" target="_blank">PDS</a>
29 28 <li><a href="https://www.cosmos.esa.int/web/psa/psa-acknowledgement" target="_blank">PSA</a>
  29 + <li><a href="https://fields.ssl.berkeley.edu/rules/" target="_blank">PSP / FIELDS</a>
  30 + <li><a href="http://sweap.cfa.harvard.edu/Data.html" target="_blank">PSP / SWEAP</a>
  31 + <li><a href="STEREO.html" target="_blank">STEREO</a>
  32 + <li><a href="http://themis.ssl.berkeley.edu/roadrules.shtml" target="_blank">THEMIS</a>
30 33 </ul>
31 34 </div>
32 35 </div>
... ...
js/app/views/ParamArgumentsPlug.js
... ... @@ -82,7 +82,7 @@ Ext.define(&#39;amdaUI.ParamArgumentsPlug&#39;, {
82 82 listeners: {
83 83 scope: this,
84 84 beforeclose: function() {
85   - this.hostCmp.setDisabled(false);
  85 + //this.hostCmp.setDisabled(false);
86 86 Ext.PluginManager.unregister(this);
87 87 } ,
88 88 show: function() {
... ... @@ -112,7 +112,7 @@ Ext.define(&#39;amdaUI.ParamArgumentsPlug&#39;, {
112 112 me.win.setHeight(me.computeHeight());
113 113 });
114 114  
115   - this.hostCmp.setDisabled(true);
  115 + //this.hostCmp.setDisabled(true);
116 116 this.win.show();
117 117 },
118 118  
... ... @@ -178,4 +178,4 @@ Ext.define(&#39;amdaUI.ParamArgumentsPlug&#39;, {
178 178 });
179 179 return this.form;
180 180 }
181   -});
182 181 \ No newline at end of file
  182 +});
... ...
js/app/views/ParamArgumentsUI.js
... ... @@ -41,7 +41,7 @@ Ext.define(&#39;amdaUI.ParamArgumentsUI&#39;, {
41 41 this.paramRequestObject = paramRequestObject;
42 42  
43 43 var me = this;
44   - me.mask();
  44 + me.getEl().mask();
45 45 me.resetArguments();
46 46  
47 47 var explorerModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id);
... ... @@ -76,11 +76,11 @@ Ext.define(&#39;amdaUI.ParamArgumentsUI&#39;, {
76 76 }
77 77 if (onReady)
78 78 onReady(uiScope);
79   - me.unmask();
  79 + me.getEl().unmask();
80 80 });
81 81 }
82 82 else
83   - me.unmask();
  83 + me.getEl().unmask();
84 84 },
85 85  
86 86 initDimension: function(relatedDim, data) {
... ...
php/classes/AmdaStats.php
... ... @@ -8,8 +8,9 @@ class AmdaStats {
8 8  
9 9 public $statXml;
10 10 public $tasks = array('plot', 'mining', 'print', 'statistics');
  11 + public $tasksWs = array('ws_print', 'ws_plot');
11 12 public $tasksAdd = array('ttoper', 'samp', 'upload', 'create', 'images');
12   - public $usersToExclude = array('bouchemit', 'impex');
  13 + public $usersToExclude = array('bouchemit');
13 14 public $success = true;
14 15 private $user = null;
15 16 private $task = array('request'=>'plot','condition'=>'mining', 'download'=>'print','statistics'=>'statistics',
... ... @@ -61,8 +62,24 @@ class AmdaStats {
61 62 if (!$status)
62 63 $this->success = false;
63 64 }
  65 + else {
  66 + $allTasks = array_merge($this->tasks, $this->tasksAdd, $this->tasksWs);
  67 + $newTask = FALSE;
  68 + foreach ($allTasks as $task) {
  69 + $items = $this->statXml->getElementsByTagName($task);
  70 + if ($items->length == 0) {
  71 + //add missing task
  72 + $element = $this->statXml->createElement("$task");
  73 + $this->statXml->documentElement->appendChild($element);
  74 + $newTask = TRUE;
  75 + }
  76 + }
  77 + if ($newTask) {
  78 + $this->statXml->save(StatsXml);
  79 + }
  80 + }
64 81 }
65   - }
  82 + }
66 83  
67 84 /*
68 85 * Merge individual User Stats.xml into one generique Stats.xml
... ... @@ -71,27 +88,33 @@ class AmdaStats {
71 88 // long procedure
72 89 ini_set('max_execution_time', 600);
73 90  
74   - $tags = array_merge($this->tasks, $this->tasksAdd);
  91 + $allTasks = array_merge($this->tasks, $this->tasksAdd, $this->tasksWs);
75 92  
76   - $doc2 = new DomDocument("1.0");
  93 + $userDoc = new DomDocument("1.0");
77 94 if ($year == null) $year = date("Y");
78 95  
79 96 $users=glob(USERPATH."*");
80 97 foreach ($users as $user) {
81   - $name2 = $user."/Stats$year.xml";
82   -
83   - if (!file_exists($name2)) continue;
84   -
85   - $doc2->load($name2);
86   -
87   - foreach ($tags as $tag) {
88   - $tag1 = $this->statXml->getElementsByTagName($tag)->item(0);
89   - $tag2 = $doc2->getElementsByTagName($tag)->item(0);
90   - $items2 = $tag2->getElementsByTagName("item");
91   - if ($items2->length > 0) {
92   - foreach ($items2 as $item2) {
93   - $item1 = $this->statXml->importNode($item2, true);
94   - $tag1->appendChild($item1);
  98 + $userXmlPath = $user."/Stats$year.xml";
  99 +
  100 + if (!file_exists($userXmlPath)) continue;
  101 +
  102 + $userDoc->load($userXmlPath);
  103 +
  104 + foreach ($allTasks as $task) {
  105 + $globalTaskItems = $this->statXml->getElementsByTagName($task);
  106 + if ($globalTaskItems->length == 0)
  107 + continue;
  108 + $globalTaskItem = $globalTaskItems->item(0);
  109 + $userTaskItems = $userDoc->getElementsByTagName($task);
  110 + if ($userTaskItems->length == 0)
  111 + continue;
  112 + $userTaskItem = $userTaskItems->item(0);
  113 + $userItems = $userTaskItem->getElementsByTagName("item");
  114 + if ($userItems->length > 0) {
  115 + foreach ($userItems as $userItem) {
  116 + $globalItem = $this->statXml->importNode($userItem, true);
  117 + $globalTaskItem->appendChild($globalItem);
95 118 }
96 119 }
97 120 }
... ... @@ -109,7 +132,7 @@ class AmdaStats {
109 132  
110 133 $rootElement = $this->statXml->createElement('stats');
111 134  
112   - $allTasks = array_merge($this->tasks, $this->tasksAdd);
  135 + $allTasks = array_merge($this->tasks, $this->tasksAdd, $this->tasksWs);
113 136  
114 137 foreach ($allTasks as $task) {
115 138 $element = $this->statXml->createElement("$task");
... ... @@ -122,7 +145,7 @@ class AmdaStats {
122 145 }
123 146  
124 147 public function addTask($user, $task, $vars) {
125   -
  148 +
126 149 // if (!$this->user) {
127 150 // error_log('User is null', 1, email);
128 151 // return;
... ... @@ -181,14 +204,18 @@ class AmdaStats {
181 204  
182 205 $taskArray = array();
183 206  
184   - foreach (array_merge($this->tasks,$this->tasksAdd) as $task) {
185   - $theTask = $this->statXml->getElementsByTagName($task)->item(0);
  207 + foreach (array_merge($this->tasks,$this->tasksAdd, $this->tasksWs) as $task) {
  208 + $taskItems = $this->statXml->getElementsByTagName($task);
  209 + if ($taskItems->length < 1)
  210 + return;
  211 + $theTask = $taskItems->item(0);
186 212 $items = $theTask->getElementsByTagName('item');
187 213 $hints = $items->length;
188 214  
189 215 $startStop = $this->getStartStop($items, $start, $stop);
190   - $taskArray[] = array('task' => $task, 'number' => $hints,
191   - 'start' => $startStop[0], 'stop' => $startStop[1]);
  216 +
  217 + $taskArray[] = array('task' => $task, 'number' => $hints,
  218 + 'start' => $startStop[0], 'stop' => $startStop[1]);
192 219 }
193 220  
194 221 $objToReturn = json_encode(array('stats' => $taskArray));
... ... @@ -213,8 +240,13 @@ class AmdaStats {
213 240 $STOParray = array();
214 241 $usersArray = array();
215 242  
216   - foreach ($this->tasks as $task) {
217   - $theTask = $this->statXml->getElementsByTagName($task)->item(0);
  243 + $dataTasks = array_merge($this->tasks, $this->tasksWs);
  244 +
  245 + foreach ($dataTasks as $task) {
  246 + $taskItems = $this->statXml->getElementsByTagName($task);
  247 + if ($taskItems->length < 1)
  248 + continue;
  249 + $theTask = $taskItems->item(0);
218 250 $items = $theTask->getElementsByTagName('item');
219 251 $TASKarray = array();
220 252  
... ... @@ -307,12 +339,17 @@ class AmdaStats {
307 339 if (!$stop) $stop = 100000000000;
308 340  
309 341 $date = array();
310   -
311   - foreach ($items as $item) {
312   - $newDate = strtotime($item->getAttribute('date'));
313 342  
314   - if (($newDate > $start) && ($newDate < $stop))
315   - $date[] = $newDate;
  343 + if ($items->length < 1) {
  344 + return array(0, 0);
  345 + }
  346 + else {
  347 + foreach ($items as $item) {
  348 + $newDate = strtotime($item->getAttribute('date'));
  349 +
  350 + if (($newDate > $start) && ($newDate < $stop))
  351 + $date[] = $newDate;
  352 + }
316 353 }
317 354  
318 355 return array(min($date), max($date));
... ... @@ -323,7 +360,7 @@ class AmdaStats {
323 360 if (!file_exists(StatsXml)) return 0;
324 361 if (!file_exists($inXml)) return 0;
325 362  
326   - $tags = array_merge($this->tasks,$this->tasksAdd);
  363 + $tags = array_merge($this->tasks,$this->tasksAdd, $this->tasksWs);
327 364  
328 365 $doc1 = new DomDocument("1.0");
329 366 $doc2 = new DomDocument("1.0");
... ...
php/classes/RequestMgr.php
... ... @@ -47,7 +47,6 @@ class RequestMgr extends AmdaObjectMgr
47 47  
48 48 putenv("USER_DATA_PATH=".USERDATADIR);
49 49 putenv("USER_WS_PATH=".USERWSDIR);
50   - putenv("PHP_CLASSES_PATH=".CLASSPATH);
51 50 }
52 51  
53 52 protected function setObject($obj)
... ...
php/epntap.php
1 1 <?php
2 2  
3 3 include(realpath(dirname(__FILE__) . "/config.php"));
4   -include(CLASSPATH . "VOTableMgr.php");
5 4  
6 5 $action = preg_replace("/[^a-zA-Z]+/", "", filter_var($_GET['action'], FILTER_SANITIZE_STRING));
7 6  
... ...