Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
ng6
Commits
f7582c32
Commit
f7582c32
authored
Jul 22, 2016
by
Celine Noirot
Browse files
Add 2 years purge data (version alpha) with graphique evolution
parent
8369a8e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
ui/nG6/lib/class.tx_nG6_db.php
View file @
f7582c32
...
...
@@ -525,17 +525,17 @@ class tx_nG6_db {
return
$final_results
;
}
function
select_storage_evolution
(
$values
,
$by
,
$role
,
$get_analyzes
,
$octet
,
$cumulate
)
{
error_log
(
date
(
DATE_RFC2822
)
.
" entrée dans select_storage_evolution
\n
"
,
3
,
"/save/ng6-test/src/nG6/ui/nG6/testMM.log"
);
function
select_storage_evolution
(
$values
,
$by
,
$role
,
$get_analyzes
,
$octet
,
$cumulate
)
{
if
(
$by
==
"organism"
||
$by
==
"location"
)
{
$by
=
"tx_nG6_"
.
$by
;
}
$storage_unit
=
"full_seq_size"
;
if
(
$octet
)
{
$storage_unit
=
"storage_size"
;
$storage_unit
=
"storage_size"
;
}
$from
=
""
;
$where
=
"fe_groups."
.
$by
.
" IN ('"
.
implode
(
"', '"
,
$values
)
.
"')"
;
if
(
$role
==
"create_user"
)
{
$from
=
'tx_nG6_project '
.
' INNER JOIN tx_nG6_project_run ON tx_nG6_project_run.project_id= tx_nG6_project.uid'
...
...
@@ -563,8 +563,6 @@ function select_storage_evolution($values, $by, $role, $get_analyzes, $octet, $c
$results
=
array
();
$res
=
$GLOBALS
[
'TYPO3_DB'
]
->
exec_SELECT_queryArray
(
$queryParts
);
while
(
$res_row
=
$GLOBALS
[
'TYPO3_DB'
]
->
sql_fetch_assoc
(
$res
))
{
error_log
(
"select_storage_evolution recup runs "
.
$res_row
[
"crdate"
]
.
" - "
.
$res_row
[
$storage_unit
]
.
"
\n
"
,
3
,
"/save/ng6-test/src/nG6/ui/nG6/testMM.log"
);
$analyses_size
=
0
;
$analyses_size_purged
=
0
;
if
(
$get_analyzes
&&
$octet
)
{
...
...
@@ -576,19 +574,15 @@ function select_storage_evolution($values, $by, $role, $get_analyzes, $octet, $c
}
if
(
array_key_exists
(
$res_row
[
"crdate"
],
$results
)
)
{
$results
[
$res_row
[
"crdate"
]]
+=
array
(
$res_row
[
$storage_unit
]
+
$analyses_size
,
$res_row
[
"purged_size"
]
+
$analyses_size_purged
);
$results
[
$res_row
[
"crdate"
]][
0
]
+=
$res_row
[
$storage_unit
]
+
$analyses_size
;
$results
[
$res_row
[
"crdate"
]][
1
]
+=
$res_row
[
"purged_size"
]
+
$analyses_size_purged
;
}
else
{
$results
[
$res_row
[
"crdate"
]]
=
array
(
$res_row
[
$storage_unit
]
+
$analyses_size
,
$res_row
[
"purged_size"
]
+
$analyses_size_purged
);
}
}
$final_results
=
array
();
foreach
(
$results
as
$group_key
=>
$group_values
)
{
//error_log("select_storage_evolution ".$group_key." - ".$group_values[0]." - ".$group_values[1] ."\n",3,"/save/ng6-test/src/nG6/ui/nG6/testMM.log");
if
(
$group_values
[
1
]
>
0
){
error_log
(
"select_storage_evolution purged "
.
$group_key
.
" - "
.
$group_values
[
0
]
.
" - "
.
$group_values
[
1
]
.
"
\n
"
,
3
,
"/save/ng6-test/src/nG6/ui/nG6/testMM.log"
);
}
if
(
$cumulate
&&
count
(
$final_results
)
>
0
)
{
$final_results
[]
=
array
(
$group_key
,
$group_values
[
0
]
+
$final_results
[
count
(
$final_results
)
-
1
][
1
],
$group_values
[
0
]
+
$group_values
[
1
]
+
$final_results
[
count
(
$final_results
)
-
1
][
2
]);
}
else
{
...
...
@@ -598,7 +592,7 @@ function select_storage_evolution($values, $by, $role, $get_analyzes, $octet, $c
}
return
$final_results
;
}
/**
* Add a comment to the comment table
* @param unknown $table_name
...
...
ui/nG6/res/js/tx_nG6_pi6.js
View file @
f7582c32
...
...
@@ -695,15 +695,13 @@ function drawDataEvolution(stat_tables){
real_group
=
$group_by
.
attr
(
'
id
'
).
split
(
'
_
'
)[
1
],
role
=
$
(
"
input[type=radio][name=users_to_consider]:checked
"
).
val
(),
values
=
getDatatableCheckedValue
(
stat_tables
),
bases
=
$
(
"
#chk_display_bases
"
)
.
attr
(
"
checked
"
)
==
"
checked
"
?
"
1
"
:
"
0
"
,
analysis
=
$
(
"
#chk_includes_analyses
"
)
.
attr
(
"
checked
"
)
==
"
checked
"
?
"
1
"
:
"
0
"
,
bases
=
$
(
"
#chk_display_bases
"
)
[
0
].
checked
?
"
1
"
:
"
0
"
,
analysis
=
$
(
"
#chk_includes_analyses
"
)
[
0
].
checked
?
"
1
"
:
"
0
"
,
cumulate
=
$
(
"
#chk_cumulate
"
)[
0
].
checked
?
"
1
"
:
"
0
"
;
$
.
ajax
({
url
:
"
index.php?eID=tx_nG6&type=data_evolution&by=
"
+
group_by
+
"
&role=
"
+
role
+
"
&cumulate=
"
+
cumulate
+
"
&get_analyzes=
"
+
analysis
+
"
&bases=
"
+
bases
+
"
&values=
"
+
values
.
join
(
"
,
"
),
dataType
:
'
json
'
,
success
:
function
(
val
,
status
,
xhr
)
{
// reformat the data with values to integer
var
val_stored
=
[];
var
val_purged
=
[];
...
...
@@ -716,105 +714,58 @@ function drawDataEvolution(stat_tables){
seriesData
=
[
{
type
:
"
line
"
,
name
:
"
data storage size
"
,
name
:
"
Size of data still stored
"
,
data
:
val_stored
,
tooltip
:
{
valueSuffix
:
'
octets
'
},
color
:
"
green
"
},{
type
:
"
line
"
,
name
:
"
data purged size
"
,
data
:
val_purged
,
yAxis
:
1
,
tooltip
:
{
valueSuffix
:
'
octets
'
},
color
:
"
blue
"
name
:
"
Size of data (stored + purged)
"
,
data
:
val_purged
,
color
:
"
blue
"
,
dashStyle
:
'
dash
'
}
]
]
chart
=
new
Highcharts
.
StockChart
({
chart
:
{
renderTo
:
'
highcharts_graph
'
,
zoomType
:
'
xy
'
},
rangeSelector
:
{
selected
:
4
},
yAxis
:
[
{
gridLineWidth
:
1
,
title
:
{
text
:
'
Data
stored
'
,
text
:
'
Size of data still
stored
'
,
style
:
{
color
:
"
green
"
}
},
min
:
0
,
labels
:
{
formatter
:
function
()
{
if
(
$
(
"
#chk_display_bases
"
).
attr
(
"
checked
"
)
==
"
checked
"
)
{
return
get_base_string_representation
(
this
.
value
,
0
);
}
else
{
return
get_octet_string_representation
(
this
.
value
,
0
);
}
},
style
:
{
color
:
"
green
"
}
}
// ,
// plotLines: [{
// value: 0,
// width: 2,
// color: 'silver'
// }]
min
:
0
},
{
gridLineWidth
:
0
,
gridLineWidth
:
1
,
title
:
{
text
:
'
Data
purged
'
,
text
:
'
Size of data (stored +
purged
)
'
,
style
:
{
color
:
"
blue
"
}
},
min
:
0
,
labels
:
{
formatter
:
function
()
{
if
(
$
(
"
#chk_display_bases
"
).
attr
(
"
checked
"
)
==
"
checked
"
)
{
return
get_base_string_representation
(
this
.
value
,
0
);
}
else
{
return
get_octet_string_representation
(
this
.
value
,
0
);
}
},
style
:
{
color
:
"
blue
"
}
}
// ,
// plotLines: [{
// value: 0,
// width: 2,
// color: 'black'
// }]
min
:
0
,
opposite
:
true
},
],
tooltip
:
{
shared
:
true
,
// formatter: function() {
// var s = Highcharts.dateFormat('%B %Y', this.x) + ":";
// $.each(this.points, function(i, point) {
// if ($("#chk_display_bases").attr("checked") == "checked") {
// s += '<strong>'+ get_base_string_representation(point.y, 2) +'</strong>';
// } else {
// s += '<strong>'+ get_octet_string_representation(point.y, 2) +'</strong>';
// }
//
// });
// return s;
// }
formatter
:
function
()
{
var
toolTipTxt
=
'
<b>
'
+
Highcharts
.
dateFormat
(
'
%B %Y
'
,
this
.
x
)
+
"
:
"
+
'
</b>
'
;
$
.
each
(
this
.
points
,
function
(
i
,
point
)
{
toolTipTxt
+=
'
<br/><span style="color:
'
+
point
.
series
.
color
+
'
">
'
+
point
.
series
.
name
+
'
:
'
+
get_octet_string_representation
(
point
.
y
,
2
)
+
'
</span>
'
;
});
return
toolTipTxt
;
}
,
shared
:
true
,
},
credits
:
{
enabled
:
false
},
series
:
seriesData
,
...
...
@@ -828,7 +779,7 @@ function drawDataEvolution(stat_tables){
function
initStatMenuDataTables
()
{
var
stat_tables
=
{};
stat_tables
[
"
laboratories
"
]
=
$
(
"
#data_table_laboratories
"
).
DataTable
({
"
language
"
:
{
"
info
"
:
'
Showing _START_ to _END_ of _MAX_ entries <strong><small id="nb_selected_span"></small></strong>
'
...
...
@@ -861,14 +812,6 @@ function initStatMenuDataTables () {
null
,
null
]
});
stat_tables
[
"
obsolete
"
]
=
$
(
"
#data_table_obsolete
"
).
DataTable
({
"
language
"
:
{
"
info
"
:
'
Showing _START_ to _END_ of _MAX_ entries <strong><small id="nb_selected_span"></small></strong>
'
},
"
order
"
:
[[
1
,
"
asc
"
]],
"
columns
"
:
[
{
"
orderable
"
:
false
},
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
]
});
$
(
"
#data_table_laboratories, #data_table_organizations, #data_table_locations
"
).
on
(
'
draw.dt
'
,
function
()
{
var
$table
=
$
(
'
div[id^=wrapper_datatable]:visible
'
),
...
...
@@ -885,6 +828,7 @@ function initStatMenuDataTables () {
});
$
.
each
(
stat_tables
,
function
(
idx
,
table
){
//console.log(table);
table
.
draw
();
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment