Commit 8369a8e8 authored by Celine Noirot's avatar Celine Noirot
Browse files

Add 2 years purge data (version alpha alpha)

parent f124fa8f
......@@ -835,7 +835,24 @@ class tx_nG6_eid {
$cumulate = true;
}
print json_encode(tx_nG6_db::select_storage_evolution($values, $by, $role, $get_analyzes, $octet, $cumulate));
}
} elseif ($type == 'purge_managment_mail') {
$all_analyses = trim(t3lib_div::_GP('all_analyses'));
$all_runs = trim(t3lib_div::_GP('all_runs'));
$value = trim(t3lib_div::_GP('date_value'));
//Change date format
$date = explode('-', $value);
$timestamp = mktime (0, 0, 1, $date[1], $date[2], $date[0]);
print json_encode(tx_nG6_db::update_purge_date( $all_runs, $all_analyses, "mail_sent_date",$timestamp));
} elseif ($type == 'refresh_purge_list') {
$max_retention_date = trim(t3lib_div::_GP('max_retention_date'));
$filter_size = trim(t3lib_div::_GP('filter_size'));
$with_laboratories = trim(t3lib_div::_GP('with_laboratories'));
$create_users = trim(t3lib_div::_GP('create_users'));
//Change date format
print json_encode(tx_nG6_db::filter_list_retention_data_info($filter_size,$max_retention_date,$create_users, $with_laboratories));
}
}
}
......@@ -848,4 +865,4 @@ if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/nG6/cla
$SOBE = t3lib_div::makeInstance('tx_nG6_eid');
$SOBE->main();
?>
\ No newline at end of file
?>
This diff is collapsed.
......@@ -213,6 +213,11 @@ class tx_nG6_pi1 extends tslib_pibase {
}
$smarty->assign('h_analysis', tx_nG6_utils::trace_hierarchy($project_analysis));
$smarty->assign('project_analysis', $project_analysis);
$smarty->assign('managment_purged_data', tx_nG6_db::select_a_project_retention_data_info($projects[key($projects)]['id']));
$txNG6Utils = new tx_nG6_utils;
//$smarty->register_object('tx_nG6_utils',$txNG6Utils);
$smarty->assign_by_ref('tx_nG6_utils', $txNG6Utils);
}
return $smarty->fetch('project_view.tpl');
} else {
......
......@@ -47,17 +47,43 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<div class="ng6-content-header-right">
{$projects[key($projects)].description} <br /> <br />
<strong>{$project_runs|@count}</strong> run(s) and
<strong>{$project_analysis|@count}</strong> analyse(s) have been done on the run {$projects[key($projects)].name}.
<strong>{$project_analysis|@count}</strong> analyse(s) have been done on the project {$projects[key($projects)].name}.
<br />
{assign var="project_size" value="<span id='size' class='tx-nG6-mini-wait'></span>"}
Raw data and analysis results use <strong>{$project_size}</strong> on the hard drive for the whole project.<br />
{assign var="nb_run_stored" value=0}
{foreach from=$project_runs key=run_id item=run_values}
{if $run_values.data_state == "stored"}
{$nb_run_stored = $nb_run_stored +1}
{/if}
{/foreach}
{$nb_run_stored}
<br><label>Managment purged data</label><br>
{assign var="manag_values" value="{$managment_purged_data[$projects[key($projects)].id]}"}
<table class="table table-striped table-bordered dataTable" id="manag_purged_data_table">
<thead>
<tr>
<th rowspan="1">Data</th>
<th rowspan="1">Purged</th>
<th rowspan="1">Stored</th>
<th rowspan="1">Extended</th>
<th rowspan="1">All</th>
</tr>
</thead>
<tbody>
<tr>
<th rowspan="1">Runs</th>
<th rowspan="1">{if $manag_values.state.purged.nb_run}{$manag_values.state.purged.nb_run} ({$tx_nG6_utils->get_octet_string_representation($manag_values.state.purged.size_run)}){else}-{/if}</th>
<th rowspan="1">{if $manag_values.state.stored.nb_run}{$manag_values.state.stored.nb_run} ({$tx_nG6_utils->get_octet_string_representation($manag_values.state.stored.size_run)}){else}-{/if}</th>
<th rowspan="1">{if $manag_values.state.extended.nb_run}{$manag_values.state.extended.nb_run} ({$tx_nG6_utils->get_octet_string_representation($manag_values.state.extended.size_run)}){else}-{/if}</th>
<th rowspan="1">{$manag_values.nb_runs}</th>
</tr>
<tr>
<th rowspan="1">Analysis</th>
<th rowspan="1">{if $manag_values.state.purged.nb_analyze}{$manag_values.state.purged.nb_analyze} ({$tx_nG6_utils->get_octet_string_representation($manag_values.state.purged.size_analyze)}){else}-{/if}</th>
<th rowspan="1">{if $manag_values.state.stored.nb_analyze}{$manag_values.state.stored.nb_analyze} ({$tx_nG6_utils->get_octet_string_representation($manag_values.state.stored.size_analyze)}){else}-{/if}</th>
<th rowspan="1">{if $manag_values.state.extended.nb_analyze}{$manag_values.state.extended.nb_analyze} ({$tx_nG6_utils->get_octet_string_representation($manag_values.state.extended.size_analyze)}){else}-{/if}</th>
<th rowspan="1">{$manag_values.nb_analyses}</th>
</tr>
</tbody>
</table>
</div>
<div style="clear:both"></div>
</div>
......@@ -269,6 +295,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{include file='project_table.tpl'}
</div>
{/if}
{debug}
{include file='../template/modals.tpl'}
......@@ -67,13 +67,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<td>{$new_element.data.date|date_format:"%d/%m/%Y"}</td>
<td>{$new_element.data.software}</td>
<td>{$new_element.data.version}</td>
<td>{if $new_element.data.data_state eq "stored"}<i class="glyphicon glyphicon-saved"></i>{elseif $new_element.data.data_state eq "purged"}<i class="glyphicon glyphicon-trash"></i>{else}<i class="glyphicon glyphicon-floppy-repeat"></i>{/if}</td>
<td>{if $new_element.data.data_state eq "stored"}<i title="Data stored until {$new_element.data.retention_date|date_format:"%d/%m/%y"}" class="glyphicon glyphicon-saved"></i>
{elseif $new_element.data.data_state eq "purged"}<i title="Data purged since {$new_element.data.purged_date|date_format:"%d/%m/%y"}" class="glyphicon glyphicon-trash"></i>
{elseif $new_element.data.data_state eq "extended"}<i title="Data stored until {$new_element.data.retention_date|date_format:"%d/%m/%y"}" class="glyphicon glyphicon-repeat"></i>{/if}
{if $new_element.data.mail_sent_date != 0}<i title="Mail sended since {$new_element.data.mail_sent_date|date_format:"%d/%m/%y"}" class="glyphicon glyphicon-envelope"></i>{/if}
</td>
{/if}
{else}
<td>{$new_element.data.date|date_format:"%d/%m/%Y"}</td>
<td>{$new_element.data.software}</td>
<td>{$new_element.data.version}</td>
<td>{if $new_element.data.data_state eq "stored"}<i class="glyphicon glyphicon-saved"></i>{elseif $new_element.data.data_state eq "purged"}<i class="glyphicon glyphicon-trash"></i>{else}<i class="glyphicon glyphicon-floppy-repeat"></i>{/if}</td>
<td>{if $new_element.data.data_state eq "stored"}<i title="Data stored until {$new_element.data.retention_date|date_format:"%d/%m/%y"}" class="glyphicon glyphicon-saved"></i>
{elseif $new_element.data.data_state eq "purged"}<i title="Data purged since {$new_element.data.purged_date|date_format:"%d/%m/%y"}" class="glyphicon glyphicon-trash"></i>
{elseif $new_element.data.data_state eq "extended"}<i title="Data stored until {$new_element.data.retention_date|date_format:"%d/%m/%y"}" class="glyphicon glyphicon-repeat"></i>{/if}
{if $new_element.data.mail_sent_date != 0}<i title="Mail sended since {$new_element.data.mail_sent_date|date_format:"%d/%m/%y"}" class="glyphicon glyphicon-envelope"></i>{/if}
</td>
{/if}
</tr>
{/if}
......
......@@ -89,7 +89,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</td>
<td id="wf_run_{$run_values.id}"></td>
{* icone change if data stored/purged *}
<td>{if $run_values.data_state eq "stored"}<i class="glyphicon glyphicon-saved"></i>{elseif $run_values.data_state eq "purged"}<i class="glyphicon glyphicon-trash"></i>{else}<i class="glyphicon glyphicon-floppy-repeat"></i>{/if}</td>
<td>{if $run_values.data_state eq "stored"}<i title="Data stored until {$run_values.retention_date|date_format:"%d/%m/%y"}" class="glyphicon glyphicon-saved"></i>
{elseif $run_values.data_state eq "purged"}<i title="Data purged since {$run_values.purged_date|date_format:"%d/%m/%y"}" class="glyphicon glyphicon-trash"></i>
{elseif $run_values.data_state eq "extended"}<i title="Data stored until {$run_values.retention_date|date_format:"%d/%m/%y"}" class="glyphicon glyphicon-repeat"></i>{/if}
{if $run_values.mail_sent_date != 0}<i title="Mail sended since {$run_values.mail_sent_date|date_format:"%d/%m/%y"}" class="glyphicon glyphicon-envelope"></i>{/if}
</td>
{else}
{if $is_at_least_admin_of_1_run && $login_user}
<td></td>
......@@ -108,7 +112,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<td></td>
{/if}
{* icone change if data stored/purged *}
<td>{if $run_values.data_state eq "stored"}<i class="glyphicon glyphicon-saved"></i>{elseif $run_values.data_state eq "purged"}<i class="glyphicon glyphicon-trash"></i>{else}<i class="glyphicon glyphicon-floppy-repeat"></i>{/if}</td>
<td>{if $run_values.data_state eq "stored"}<i title="Data stored until {$run_values.retention_date|date_format:"%d/%m/%y"}" class="glyphicon glyphicon-saved"></i>
{elseif $run_values.data_state eq "purged"}<i title="Data purged since {$run_values.purged_date|date_format:"%d/%m/%y"}" class="glyphicon glyphicon-trash"></i>
{elseif $run_values.data_state eq "extended"}<i title="Data stored until {$run_values.retention_date|date_format:"%d/%m/%y"}" class="glyphicon glyphicon-repeat"></i>{/if}
{if $run_values.mail_sent_date != 0}<i title="Mail sended since {$run_values.mail_sent_date|date_format:"%d/%m/%y"}" class="glyphicon glyphicon-envelope"></i>{/if}
</td>
{/if}
</tr>
{/if}
......
......@@ -274,32 +274,42 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</p>
</div>
<div class="clearfix">
<div class="col-sm-6">
<fieldset class="col-sm-12">
<h4>1. Filter on size greater than</h4>
<div class="text">
<label class="text">
<input type="text" name="size" id="filter_size" >
<input type="text" name="size" id="filter_size" > Go
</label>
</div>
</fieldset>
</div>
<div class="col-sm-6">
<fieldset class="col-sm-12">
<h4>2. Retention date lower than : </h4>
<div class="text">
<label class="text">
<input id="max_retention_date" class="form-control" type="text" value="" data-date-format="dd/mm/yyyy" data-provide="datepicker" name="max_retention_date"/>
</label>
</div>
</fieldset>
</div>
<div class="col-sm-6">
<fieldset class="col-sm-12">
<h4>2. With laboratories implie ?</h4>
<div id="wrapper_datatable_laboratories">
<h4>3. Which create user ?</h4>
<div id="wrapper_datatable_create">
<table class="table table-striped table-bordered dataTable" id="data_table_laboratories">
<thead>
<th><center><input type="checkbox" id="chk_all_with_laboratories"></center></th>
<th>Laboratories</th>
<th></th>
<th>Create user</th>
</thead>
<tbody>
{foreach $distribution key=group_name item=group_values}
{foreach $ng6_admin_users key=user_key item=user_values}
<tr>
<td><center><input type="checkbox" class="chk_with_lab_element" value="{$group_name}"></center></td>
<td>{$group_name}</td>
<td><center><input type="checkbox" class="chk_create_user" value="{$user_values.id}"></center></td>
<td>{$user_values.username}</td>
</tr>
{/foreach}
</tbody>
......@@ -309,11 +319,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<div class="col-sm-6">
<fieldset class="col-sm-12">
<h4>3. Without laboratories implie ?</h4>
<h4>4. Without laboratories implie ?</h4>
<div id="wrapper_datatable_laboratories">
<table class="table table-striped table-bordered dataTable" id="data_table_laboratories">
<thead>
<th><center><input type="checkbox" id="chk_all_without_laboratories"></center></th>
<th></th>
<th>Laboratories</th>
</thead>
<tbody>
......@@ -321,7 +331,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<tr>
<td><center><input type="checkbox" class="chk_without_lab_element" value="{$group_name}"></center></td>
<td>{$group_name}</td>
</tr>
{/foreach}
</tbody>
......@@ -336,24 +345,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div>
</div>
</div>
</div>
<br />
<div id="purge_list">
{debug}
<table class="table table-striped table-bordered dataTable" id="users_data_table">
<table class="table table-striped table-bordered dataTable" id="data_table_obsolete">
<thead>
<tr>
<th rowspan="2"><center><input type="checkbox" id="chk_all_runs"></center></th>
<th rowspan="2">Project</th>
<th rowspan="2">All Run</th>
<th colspan="3"><center>Obsolete Run </center></th>
<th colspan="3"><center>Obsolete Analyze</center></th>
<th colspan="3"><center>Obsoletes Runs </center></th>
<th rowspan="2">All Analyze</th>
<th colspan="3"><center>Obsoletes Analyzes</center></th>
<th rowspan="2">Total Size Purgeable</th>
<th rowspan="2">Users</th>
</tr>
<tr>
<tr>
<th>Nb Run purged</th>
<th>Nb Run stored</th>
<th>Nb Run extended</th>
......@@ -367,29 +377,44 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{foreach from=$ng6_purge_projects key=c_project_id item=project_values}
<tr id="tr_project_{$c_project_id}" >
<td><center><input type="checkbox" id="chk_project_{$c_project_id}" value="project_{$c_project_id}" /></center></td>
<td><a href="index.php?id=3&tx_nG6_pi1[project_id]={$c_project_id}">{$project_values.project_name} </td>
<td><a href="index.php?id=3&tx_nG6_pi1[project_id]={$c_project_id}">{$project_values.project_name}</a> </td>
<td>{$project_values.nb_runs}</td>
<td>{if $project_values.state.purged.nb_run} {$project_values.state.purged.nb_run} ({$project_values.state.purged.size_run} Go){else} - {/if}</td>
<td>{if $project_values.state.stored.nb_run}{$project_values.state.stored.nb_run} ({$project_values.state.stored.size_run} Go){else} - {/if}</td>
<td>{if $project_values.state.extended.nb_run}{$project_values.state.extended.nb_run} ({$project_values.state.extended.size_run} Go) {else} - {/if}</td>
<td>{if $project_values.state.purged.nb_run}{$project_values.state.purged.nb_run} ({$project_values.state.purged.size_run} Go){else} - {/if}</td>
<td><input type="hidden" values="{$project_values.state.stored.run_ids}" id="rstored_project_{$c_project_id}" />{if $project_values.state.stored.nb_run}{$project_values.state.stored.nb_run} ({$project_values.state.stored.size_run} Go){else} - {/if}</td>
<td><input type="hidden" values="{$project_values.state.extended.run_ids}" id="rextended_project_{$c_project_id}" />{if $project_values.state.extended.nb_run}{$project_values.state.extended.nb_run} ({$project_values.state.extended.size_run} Go) {else} - {/if}</td>
<td>{$project_values.nb_analyses}</td>
<td>{if $project_values.state.purged.nb_analyze}{$project_values.state.purged.nb_analyze} ({$project_values.state.purged.size_analyze} Go){else} - {/if}</td>
<td>{if $project_values.state.stored.nb_analyze}{$project_values.state.stored.nb_analyze} ({$project_values.state.stored.size_analyze} Go){else} - {/if}</td>
<td>{if $project_values.state.extended.nb_analyze}{$project_values.state.extended.nb_analyze} ({$project_values.state.extended.size_analyze} Go){else} - {/if}</td>
<td>{$project_values.state.stored.size_run+$project_values.state.extended.size_run+$project_values.state.stored.size_analyze+$project_values.state.extended.size_analyze}</td>
<td><input type="hidden" values="{$project_values.state.stored.analysis_ids}" id="astored_project_{$c_project_id}" />{if $project_values.state.stored.nb_analyze}{$project_values.state.stored.nb_analyze} ({$project_values.state.stored.size_analyze} Go){else} - {/if}</td>
<td><input type="hidden" values="{$project_values.state.extended.analysis_ids}" id="aextended_project_{$c_project_id}" />{if $project_values.state.extended.nb_analyze}{$project_values.state.extended.nb_analyze} ({$project_values.state.extended.size_analyze} Go){else} - {/if}</td>
<td>{$project_values.total_purgeable_size}</td>
<td>
{foreach from=$project_values.users key=c_user_i item=user_values}
{$user_values.user_name} {if $user_values.right=="1"} {$user_values.email} {/if},
{/foreach}
{$user_values.user_name} {if $user_values.right_level_label=="manager"} {$user_values.email} {/if},
{/foreach}
</td>
</tr>
{/foreach}
</tbody>
<tfoot>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td><input type="checkbox" id="chk_col_rstored" value="rstored" /></td>
<td><input type="checkbox" id="chk_col_rextended" value="rextended" /></td>
<td></td>
<td></td>
<td><input type="checkbox" id="chk_col_astored" value="astored" /></td>
<td><input type="checkbox" id="chk_col_aextended" value="aextended" /></td>
<td></td>
<td></td>
</tr>
<tr>
<th align="left" colspan="11">
<th align="left" colspan="12">
With selection :
<div class="btn-group">
<button id="mail_sent" type="button" class="btn btn-sm btn-default" ><i class="glyphicon glyphicon-mail"></i> Mark as mail sent </button>
<button id="mail_sent" type="button" class="btn btn-sm btn-default" ><i class="glyphicon glyphicon-envelope"></i> Mark as mail sent </button>
<button id="purge" type="button" class="btn btn-sm btn-default"><i class="glyphicon glyphicon-minus"></i> purge data</button>
</div>
</th>
......@@ -398,6 +423,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</table>
</div>
</div>
</div>
</div>
</div>
......
......@@ -94,7 +94,7 @@ class tx_nG6_pi6 extends tslib_pibase {
$distribution = tx_nG6_db::select_projects_repartition('create_user', 'title');
$smarty->assign('distribution', $distribution);
$smarty->assign('ng6_admin_users', tx_nG6_db::get_ng6_admin_users() );
$smarty->assign('ng6_purge_projects', tx_nG6_db::select_retention_data_for_projects() );
$smarty->assign('ng6_purge_projects', tx_nG6_db::select_obsolete_list_retention_data_info( ));
return $smarty->fetch('administration_view.tpl');
}
}
......@@ -103,4 +103,4 @@ if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/nG6/pi6
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/nG6/pi6/class.tx_nG6_pi6.php']);
}
?>
\ No newline at end of file
?>
......@@ -73,21 +73,21 @@ $(function () {
});
// button for drawing
$("#refresh_graph_btn").click(function(){
$('#highcharts_graph').html('<div class="tx-nG6-wait">Chart generation, please wait ...</div>');
var selected_display = $("input[type=radio][name=display_by]:checked").val() ;
if (selected_display == "project_distribution") {
drawProjectDistribution(stat_tables);
} else if (selected_display == "project_evolution") {
drawProjectEvolution(stat_tables);
} else if (selected_display == "data_distribution") {
drawDataDistribution(stat_tables);
} else if (selected_display == "data_evolution") {
drawDataEvolution(stat_tables);
}
});
// $("#refresh_graph_btn").click(function(){
//
// $('#highcharts_graph').html('<div class="tx-nG6-wait">Chart generation, please wait ...</div>');
//
// var selected_display = $("input[type=radio][name=display_by]:checked").val() ;
// if (selected_display == "project_distribution") {
// drawProjectDistribution(stat_tables);
// } else if (selected_display == "project_evolution") {
// drawProjectEvolution(stat_tables);
// } else if (selected_display == "data_distribution") {
// drawDataDistribution(stat_tables);
// } else if (selected_display == "data_evolution") {
// drawDataEvolution(stat_tables);
// }
// });
// refresh datatables
$("input[type=radio][name=group_by]").change(function(){
......@@ -360,24 +360,138 @@ $(function () {
* PURGE MANAGEMENT
*
***************************************/
$("#get_purge_list_btn").click(function(){
$('#purge_list').html('<div class="tx-nG6-wait">List generation, please wait ...</div>');
var $kind_of = $("input[type=radio][name=kind_of]:checked"),
kind_of = $kind_of.val(),
state = $("input[type=radio][name=state]:checked").val();
//filtre table
$("#refresh_purge_list_btn").click(function(){
//$('#purge_list').html('<div class="tx-nG6-wait">List generation, please wait ...</div>');
var filter_size = $("#filter_size").val(),
max_retention_date = $("#max_retention_date").val(),
with_lab=[],
create_users=[],
with_laboratories="",
create_users_string="";
$(':checked[class^=chk_create_user').each(function(){
create_users.push($(this).val());
});
$(':checked[class^=chk_without_').each(function(){
with_lab.push($(this).val());
});
with_laboratories = with_lab.join(',');
create_users_string = create_users.join(',');
$.ajax({
url: "index.php?eID=tx_nG6&type=purge_management&state="+state+"&kind_of="+kind_of+"&action=get_list",
url: "index.php?eID=tx_nG6&type=refresh_purge_list&max_retention_date="+max_retention_date+"&filter_size="+filter_size+"&create_users="+create_users_string+"&with_lab="+with_lab,
dataType: 'json',
success: function(val, status, xhr) {
console.log(val);
oTable = stat_tables["obsolete"];
oTable.clear()
$.each(val, function(key,values){
var checkbox = '<center><input id="chk_project_"'+key+'" type="checkbox" value="project_' + key + '"></center>' ;
var row=[checkbox, "<a href='index.php?id=3&tx_nG6_pi1[project_id]="+key+"'>"+values["project_name"]+"</a>", values["nb_runs"]];
if (values["state"].hasOwnProperty('purged') && values["state"]["purged"] != null && values["state"]["purged"]['nb_run'] != null) {
row.push(values["state"]["purged"]['nb_run'] + " (" + values["state"]["purged"]['size_run'] + ")")
}else{
row.push("-")
}
if (values["state"].hasOwnProperty('stored') && values["state"]["stored"] != null && values["state"]["stored"]['nb_run'] != null) {
row.push(values["state"]["stored"]['nb_run']+ " (" + values["state"]["stored"]['size_run'] + ")")
}else{
row.push("-")
}
if (values["state"].hasOwnProperty('extended') && values["state"]["extended"] != null && values["state"]["extended"]['nb_run'] != null) {
row.push(values["state"]["extended"]['nb_run']+ " (" + values["state"]["extended"]['size_run'] + ")")
}else{
row.push("-")
}
row.push(values["nb_analyses"])
if (values["state"].hasOwnProperty('purged') && values["state"]["purged"] != null && values["state"]["purged"]['nb_analyze'] != null) {
row.push(values["state"]["purged"]['nb_analyze']+ " (" + values["state"]["purged"]['size_analyze'] + ")")
}else{
row.push("-")
}
if (values["state"].hasOwnProperty('stored') && values["state"]["stored"] != null && values["state"]["stored"]['nb_analyze'] != null) {
row.push(values["state"]["stored"]['nb_analyze']+ " (" + values["state"]["stored"]['size_analyze'] + ")")
}else{
row.push("-")
}
if (values["state"].hasOwnProperty('extended') && values["state"]["extended"] != null && values["state"]["extended"]['nb_analyze'] != null) {
row.push(values["state"]["extended"]['nb_analyze']+ " (" + values["state"]["extended"]['size_analyze'] + ")")
}else{
row.push("-")
}
row.push(values["total_purgeable_size"])
var string_user= "";
$.each(values["users"], function(key_user,values_user){
if (values_user["right_level_label"]=="manager") {
string_user+=values_user["user_name"]+" (" + values_user["email"] +"),";
}else{
string_user+=values_user["user_name"]+",";
}
});
string_user = string_user.slice(0, -1);
row.push(string_user);
oTable.row.add(row );
});
oTable.draw();
}
});
});
//mark mail sent
$("#mail_sent").click(function(){
var all_runs="",
all_analyses="";
$(':checked[id^=chk_col').each(function(){
col_name=$(this).val();
$(':checked[id^=chk_project').each(function(){
project_id=$(this).val();
if (col_name.startsWith("r") ){
cur_run=$('input[id='+col_name+"_"+project_id+']').attr("values");
if (cur_run != ""){
all_runs+=cur_run+"," ;
}
}else{
cur_analyse = $('input[id='+col_name+"_"+project_id+']').attr("values");
if (cur_analyse != ""){
all_analyses+=cur_analyse+"," ;
}
}
});
});
$("#modal-label-tmpl").html("Mail");
$("#modal-body-tmpl").html("Date of mail send");
$("#modal-foot-tmpl").html('<div id="date_mail" class="input-group date" data-date="">'
+'<input id="mail_date" class="form-control" type="text" value="" data-date-format="dd/mm/yyyy" data-provide="datepicker" name="mail_date"/>'
+'</div>'
+'<button id="modal-btn-send" class="btn btn-primary">Send</button>');
$("#ng6modal").modal();
$("#modal-btn-send").click(function(){
date_send = $("#mail_date").val();
$.ajax({
url: "index.php?eID=tx_nG6&type=purge_managment_mail&all_analyses="+all_analyses+"&all_runs="+all_runs+"&date_value="+date_send,
dataType: 'json',
success: function(val, status, xhr) {
console.log(val);
}
});
});
});
});
function set_active_tab(active_tab){
if (!endsWith(window.location.href, "active_tab=" + active_tab)) {
window.location.assign(window.location.href+"&active_tab="+active_tab);
......@@ -589,20 +703,55 @@ function drawDataEvolution(stat_tables){
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 = [];
for (var i=0; i <val.length; i++ ) {
val[i][0] = parseInt(val[i][0])*1000;
val[i][1] = parseInt(val[i][1]);
val_stored[i] = [parseInt(val[i][0])*1000,parseInt(val[i][1])];
val_purged[i] = [parseInt(val[i][0])*1000,parseInt(val[i][2])];
}
var seriesData = [];
seriesData = [
{
type:"line",
name: "data storage size",
data: val_stored,
tooltip: {
valueSuffix: ' octets'
},
color: "green"
},{
type:"line",
name: "data purged size",
data: val_purged, yAxis: 1,
tooltip: {
valueSuffix: ' octets'
},
color: "blue"
}
]
chart = new Highcharts.StockChart({
chart: {
renderTo: 'highcharts_graph'
renderTo: 'highcharts_graph',
zoomType: 'xy'
},
rangeSelector: {
selected: 4
},
yAxis: {
min: 0,
yAxis: [