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
bfbc9fb2
Commit
bfbc9fb2
authored
Oct 24, 2019
by
Romain Therville
🐭
Browse files
Merge branch 'issue#119' into 'master'
merge branche issue#119 with master See merge request
!61
parents
2ca6265d
4406f5bc
Changes
5
Show whitespace changes
Inline
Side-by-side
ui/nG6/lib/class.tx_nG6_db.php
View file @
bfbc9fb2
...
...
@@ -2169,6 +2169,36 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
return
$res
;
}
/**
* Returns a run's retention status and date
*
* @param string $r_id the analyze ids
* @return['run_data_state'] purged=> the date is purged, stored=> the data is stored
* @return['run_retention_date'] the unix epoch timestamp
*/
static
function
select_run_retention_status
(
$r_id
)
{
// First select the run from the database
$queryParts
=
Array
(
'SELECT'
=>
'tx_nG6_run.data_state AS run_data_state, '
.
'tx_nG6_run.retention_date AS run_retention_date '
,
'FROM'
=>
'tx_nG6_run '
,
'WHERE'
=>
'tx_nG6_run.uid='
.
$r_id
,
'GROUPBY'
=>
''
,
'ORDERBY'
=>
''
,
'LIMIT'
=>
''
);
// Then create the result hash table
$result
=
array
();
$res
=
$GLOBALS
[
'TYPO3_DB'
]
->
exec_SELECT_queryArray
(
$queryParts
);
while
(
$row
=
$GLOBALS
[
'TYPO3_DB'
]
->
sql_fetch_assoc
(
$res
))
{
$result
[
'run_data_state'
]
=
$row
[
'run_data_state'
];
//$result['run_retention_date'] = $row['run_data_state'];
$result
[
'run_retention_date'
]
=
tx_nG6_utils
::
convert_epoch_timestamp_to_nice_date
(
$row
[
'run_retention_date'
]);
}
return
$result
;
}
/*
...
...
@@ -2529,7 +2559,35 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
return
$res
;
}
/**
* Returns an analysis's retention status and date
*
* @param string $a_id the analysis id
* @return['analysis_data_state'] purged=> the date is purged, stored=> the data is stored
* @return['analysis_retention_date'] the unix epoch timestamp
*/
static
function
select_analysis_retention_status
(
$a_id
)
{
// First select the analysis from the database
$queryParts
=
Array
(
'SELECT'
=>
'tx_nG6_analyze.data_state AS analysis_data_state, '
.
'tx_nG6_analyze.retention_date AS analysis_retention_date '
,
'FROM'
=>
'tx_nG6_analyze '
,
'WHERE'
=>
'tx_nG6_analyze.uid='
.
$a_id
,
'GROUPBY'
=>
''
,
'ORDERBY'
=>
''
,
'LIMIT'
=>
''
);
// Then create the result hash table
$result
=
array
();
$res
=
$GLOBALS
[
'TYPO3_DB'
]
->
exec_SELECT_queryArray
(
$queryParts
);
while
(
$row
=
$GLOBALS
[
'TYPO3_DB'
]
->
sql_fetch_assoc
(
$res
))
{
$result
[
'analysis_data_state'
]
=
$row
[
'analysis_data_state'
];
//$result['analysis_retention_date'] = $row['analysis_retention_date'];
$result
[
'analysis_retention_date'
]
=
tx_nG6_utils
::
convert_epoch_timestamp_to_nice_date
(
$row
[
'analysis_retention_date'
]);
}
return
$result
;
}
/*
...
...
ui/nG6/lib/class.tx_nG6_utils.php
View file @
bfbc9fb2
...
...
@@ -354,6 +354,13 @@ please have a look at our storage fees (<a href="###URL_PRICE###">###URL_PRICE##
return
(
$return_text
);
}
static
function
convert_epoch_timestamp_to_nice_date
(
$epoch_date
){
//return(gmdate('D, d M Y', $epoch_date));
return
(
gmdate
(
'l jS \of F Y'
,
$epoch_date
));
}
}
...
...
ui/nG6/pi1/analyzes/AnalysisTemplate.tpl
View file @
bfbc9fb2
...
...
@@ -32,6 +32,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<br
/>
All data related to this analysis use
<strong>
{
$analyse_size
}
</strong>
on the hard drive.
{
block
name
=
description_update
}{/
block
}
{
if
$analysis_data_state
==
'stored'
}
The analysis data is
<strong>
stored
</strong>
. It will be kept until
{
$analysis_retention_date
}
.
<br/>
{
else
}
The analysis data has been
<strong>
purged
</strong>
.
<br/>
{/
if
}
</div>
<div
style=
"clear:both"
></div>
{/
block
}
...
...
ui/nG6/pi1/class.tx_nG6_pi1.php
View file @
bfbc9fb2
...
...
@@ -321,6 +321,10 @@ class tx_nG6_pi1 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
$comments
=
tx_nG6_db
::
get_all_run_comments
(
$runs
[
key
(
$runs
)][
'id'
]);
$smarty
->
assign
(
'comments'
,
$comments
);
$retention_policy
=
tx_nG6_db
::
select_run_retention_status
(
$runs
[
key
(
$runs
)][
'id'
]);
$smarty
->
assign
(
'run_data_state'
,
$retention_policy
[
'run_data_state'
]);
$smarty
->
assign
(
'run_retention_date'
,
$retention_policy
[
'run_retention_date'
]);
$run_analysis
=
tx_nG6_db
::
get_run_analysis
(
$runs
[
key
(
$runs
)][
'id'
]);
// Add some information to the table
foreach
(
$run_analysis
as
$analysis_id
=>
$analysis_values
)
{
...
...
@@ -396,6 +400,10 @@ class tx_nG6_pi1 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
$smarty
->
assign
(
'user_login'
,
$GLOBALS
[
'TSFE'
]
->
fe_user
->
user
[
'username'
]);
$smarty
->
assign
(
'user_id'
,
$GLOBALS
[
'TSFE'
]
->
fe_user
->
user
[
'uid'
]);
$retention_policy
=
tx_nG6_db
::
select_analysis_retention_status
(
$this
->
piVars
[
'analyze_id'
]);
$smarty
->
assign
(
'analysis_data_state'
,
$retention_policy
[
'analysis_data_state'
]);
$smarty
->
assign
(
'analysis_retention_date'
,
$retention_policy
[
'analysis_retention_date'
]);
// Then select analyse results
$results
=
tx_nG6_db
::
select_analyse_results
(
$this
->
piVars
[
'analyze_id'
]);
$smarty
->
assign
(
'analyse_results'
,
$results
);
...
...
ui/nG6/pi1/run_view.tpl
View file @
bfbc9fb2
...
...
@@ -80,10 +80,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<br
/>
Raw data and analysis results use
<strong>
{
$run_size
}
</strong>
on the hard drive.
<br/>
{
if
$run_analysis
|@
count
>
0
}
<strong>
{
$run_analysis
|@
count
}
</strong>
analysis have been done on this run.
<strong>
{
$run_analysis
|@
count
}
</strong>
analysis have been done on this run.
<br/>
{
else
}
<strong>
{
$run_analysis
|@
count
}
</strong>
analysis has been done on this run.
<strong>
{
$run_analysis
|@
count
}
</strong>
analysis has been done on this run.
<br/>
{/
if
}
{
if
$run_data_state
==
'stored'
}
The run data is
<strong>
stored
</strong>
. It will be kept until
{
$run_retention_date
}
.
<br/>
{
else
}
The run data has been
<strong>
purged
</strong>
.
<br/>
{/
if
}
<br/>
<div
style=
"float:right;"
>
...
...
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