Commit 6682a58c authored by Celine Noirot's avatar Celine Noirot

Fix #13 add column in obsolete list with category of project

parent 63a9b899
......@@ -374,6 +374,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<th rowspan="2">All Analyze</th>
<th colspan="2"><center>Obsoletes Analyzes</center></th>
<th rowspan="2">Total Size Purgeable</th>
<th rowspan="2">Project category</th>
<th rowspan="2">Users</th>
</tr>
<tr>
......
......@@ -343,7 +343,7 @@ $(function () {
"order": [[ 1, "asc" ]],
"columns": [
{ "orderable": false },
null,null,null,null,null,null,null,null,null]
null,null,null,null,null,null,null,null,null,null]
});
purge_table["demand"] = $("#data_table_demand").DataTable({
"language": {
......@@ -601,35 +601,48 @@ function refresh_project_obsolete(obsolete_project_datatable){
nb_purgeable_project+=1;
var checkbox = '<center><input id="chk_obsolete_'+key+'" type="checkbox" value="' + key + '"></center>' ;
var row=[checkbox, "<a href='index.php?id=3&tx_nG6_pi1[project_id]="+key+"'>"+values["project_name"]+"</a>", values["nb_runs"]];
var nb_purgeable_element=0,
nb_all_element=parseInt(values["nb_runs"], 10);
console.log("nb_purgeable_element: ", nb_purgeable_element,"; nb_all_element ", nb_all_element);
if (values["state"].hasOwnProperty('stored') && values["state"]["stored"] != null && values["state"]["stored"]['nb_run'] != null) {
row.push(values["state"]["stored"]['nb_run']+ " (" + get_octet_string_representation(values["state"]["stored"]['size_run'],2) + ")")
nb_purgeable_element+=parseInt(values["state"]["stored"]['nb_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']+ " (" + get_octet_string_representation(values["state"]["extended"]['size_run'],2) + ")")
nb_purgeable_element+=parseInt(values["state"]["extended"]['nb_run']);
}else{
row.push("-")
}
row.push(values["nb_analyses"])
nb_all_element+=parseInt(values["nb_analyses"]);
if (values["state"].hasOwnProperty('stored') && values["state"]["stored"] != null && values["state"]["stored"]['nb_analyze'] != null) {
row.push(values["state"]["stored"]['nb_analyze']+ " (" + get_octet_string_representation(values["state"]["stored"]['size_analyze'],2) + ")")
nb_purgeable_element+=parseInt(values["state"]["stored"]['nb_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']+ " (" + get_octet_string_representation(values["state"]["extended"]['size_analyze'],2) + ")")
nb_purgeable_element+=parseInt(values["state"]["extended"]['nb_analyze']);
}else{
row.push("-")
}
row.push(get_octet_string_representation(values["total_purgeable_size"],2))
console.log("nb_purgeable_element: ", nb_purgeable_element,"; nb_all_element ", nb_all_element);
if (nb_purgeable_element != nb_all_element) {
row.push("open")
}else{
row.push("finished")
}
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"] +", "+ values_user["user_group_title"]+"], ";
string_user+=values_user["user_name"]+" [" + values_user["email"] +", "+ values_user["user_group_title"]+"], ";
}else{
string_user+=values_user["user_name"]+", ";
string_user+=values_user["user_name"]+", ";
}
});
string_user = string_user.slice(0, -2);
......@@ -1066,3 +1079,4 @@ function updateUsersButtonStatus() {
$(".nou-selection-btn").each(function(){ $(this).removeAttr('disabled'); });
}
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