Commit 2a4a90d8 authored by Celine Noirot's avatar Celine Noirot

Merge branch 'issue#119.2' into 'master'

Merge branch issue#119.2 with master

See merge request !67
parents 0677a917 171f25f0
......@@ -1148,6 +1148,7 @@ INNER JOIN fe_groups ON fe_groups.uid = fe_users.usergroup',
'hidden' => $vals['hidden'],
'date' => $vals['crdate'],
'public' => $vals['public'],
'space_id' => $vals['space_id'],
'description' => $vals['description']);
}
......@@ -2173,7 +2174,7 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
* 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_data_state'] purged=> the date is purged, stored=> the data is stored, extended=>retention extended and data still stored
* @return['run_retention_date'] the unix epoch timestamp
*/
static function select_run_retention_status($r_id) {
......@@ -2181,7 +2182,8 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
// 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 ',
'tx_nG6_run.retention_date AS run_retention_date, '.
'tx_nG6_run.purged_date AS run_purged_date ',
'FROM' => 'tx_nG6_run ',
'WHERE' => 'tx_nG6_run.uid='.$r_id,
'GROUPBY' => '',
......@@ -2193,8 +2195,9 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
$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']);
$result['run_purge_date'] = tx_nG6_utils::convert_epoch_timestamp_to_nice_date($row['run_purged_date']);
//$result['run_purge_date'] = $row['run_purged_date'];
}
return $result;
}
......@@ -2564,14 +2567,16 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
*
* @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
* @return['analysis_retention_date'] the retention unix epoch timestamp converted to a nice date
* @return['analysis_purged_date'] the purge unix epoch timestamp converted to a nice date
*/
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 ',
'tx_nG6_analyze.retention_date AS analysis_retention_date, '.
'tx_nG6_analyze.purged_date AS analysis_purged_date ',
'FROM' => 'tx_nG6_analyze ',
'WHERE' => 'tx_nG6_analyze.uid='.$a_id,
'GROUPBY' => '',
......@@ -2583,8 +2588,8 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
$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']);
$result['analysis_purge_date'] = tx_nG6_utils::convert_epoch_timestamp_to_nice_date($row['analysis_purged_date']);
}
return $result;
}
......
......@@ -30,12 +30,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<div class="ng6-content-header-right">
{$analyse.description}
<br />
All data related to this analysis use <strong> {$analyse_size} </strong> on the hard drive.
All data related to this analysis use <strong> {$analyse_size} </strong> on the hard drive.<br />
{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/>
{elseif $analysis_data_state == 'purged'}
The analysis data has been <strong>purged</strong> on {$analysis_purge_date}.<br/>
{elseif $analysis_data_state == 'extended'}
The analysis data retention has been <strong>extended</strong> to {$analysis_retention_date}.<br/>
{/if}
</div>
<div style="clear:both"></div>
......
......@@ -325,6 +325,7 @@ class tx_nG6_pi1 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
$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']);
$smarty->assign('run_purge_date', $retention_policy['run_purge_date']);
$run_analysis = tx_nG6_db::get_run_analysis($runs[key($runs)]['id']);
// Add some information to the table
......@@ -404,6 +405,7 @@ class tx_nG6_pi1 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
$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']);
$smarty->assign('analysis_purge_date', $retention_policy['analysis_purge_date']);
// Then select analyse results
$results = tx_nG6_db::select_analyse_results($this->piVars['analyze_id']);
......
......@@ -86,8 +86,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{/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/>
{elseif $run_data_state == 'purged'}
The run data has been <strong>purged</strong> on {$run_purge_date}.<br/>
{elseif $run_data_state == 'extended'}
The run data retention has been <strong>extended</strong> to {$run_retention_date}.<br/>
{/if}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment