Commit 1102a658 authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

dashbaord changes

parent 597045c2
......@@ -137,14 +137,18 @@ class DashboardAction extends CAction
$pieBudgetPerFinancerLbl = [];
$pieBudgetPerFinancerData = [];
$barTasksPerProject = [];
$barTasksPerProjectLbl = [];
$barTasksPerProjectData = [];
foreach ($answers as $key => $ans) {
if( isset($ans["step"]) && $ans["step"] == "deal5" )
$countAnswersFinanced++;
if( isset($ans["links.operators"]) ){
if( isset($ans["links"]["operators"]) ){
$hasOperator = false;
foreach ( $ans["links.operators"] as $oid => $op) {
foreach ( $ans["links"]["operators"] as $oid => $op) {
if($op != "0")
$hasOperator = true;
}
......@@ -153,7 +157,8 @@ class DashboardAction extends CAction
$countAnswersWithOperators++;
else
$countAnswersWithOperatorsUnset++;
}
} else
$countAnswersWithOperatorsUnset++;
if( isset($ans["validation"]) ){
$refused = false;
......@@ -161,7 +166,7 @@ class DashboardAction extends CAction
if($v["valid"] == "notValid")
$refused = true;
}
if( isset($ans["validation"]['deal5']["finsished"]) && $ans["validation"]['deal5']["finsished"] == true )
if( isset($ans["validation"]['deal5']["finished"]) && $ans["validation"]['deal5']["finished"] == true )
$countAnswersFinished++;
if($refused)
......@@ -178,18 +183,34 @@ class DashboardAction extends CAction
foreach ($bud["financer"] as $bfix => $fin) {
$totalFinanced += (int)$fin["amount"];
if(!isset($pieBudgetPerFinancer[$fin["name"]]))
$pieBudgetPerFinancer[$fin["name"]] = 0;
$pieBudgetPerFinancer[$fin["name"]] += (int)$fin["amount"];
$pieBudgetPerFinancer[ $fin["name"] ] = 0;
$pieBudgetPerFinancer[ $fin["name"] ] += (int)$fin["amount"];
}
if( isset($ans["step"]) && $ans["step"] == "deal4" )
$totalProjetEnValidation += (int)$bud["price"];
} else
$totalProjetNonFinanced += (int)$bud["price"];
//if( isset($ans["validation"]['deal5']["finsished"]) && $ans["validation"]['deal5']["finsished"] == true )
if( isset($ans["step"]) && $ans["step"] == "deal5" && isset($bud["todo"]) ){
foreach ($bud["todo"] as $bfix => $todo) {
$totalFinanced += (int)$fin["amount"];
if(isset($ans["deal1"]["deal13"])){
if( !isset($barTasksPerProject[ $ans["deal1"]["deal13"] ]))
$barTasksPerProject[ $ans["deal1"]["deal13"] ] = 0;
if(isset($todo["done"]) && $todo["done"] == "0")
$barTasksPerProject[ $fin["name"] ]++;
else
$barTasksPerProject[ $fin["name"] ]++;
}
}
if( isset($ans["step"]) && $ans["step"] == "deal4" )
$totalProjetEnValidation += (int)$bud["price"];
}
//if( isset($ans["validation"]['deal5']["finished"]) && $ans["validation"]['deal5']["finished"] == true )
if( isset($ans["step"]) && $ans["step"] == "deal5" )
$totalProjetEnCours += (int)$bud["price"];
else
else if( isset($ans["validation"]['deal5']["finished"]) && $ans["validation"]['deal5']["finished"] == true )
$totalProjetFinished += (int)$bud["price"];
}
}
......@@ -198,10 +219,13 @@ class DashboardAction extends CAction
$pieBudgetPerFinancerLbl = array_keys($pieBudgetPerFinancer);
$pieBudgetPerFinancerData = array_values($pieBudgetPerFinancer);
$barTasksPerProjectLbl = array_keys($barTasksPerProject);
$barTasksPerProjectData = array_values($barTasksPerProject);
// var_dump($pieBudgetPerFinancer);
// var_dump($pieBudgetPerFinancerLbl);
// var_dump($pieBudgetPerFinancerData);
var_dump($barTasksPerProject);
var_dump($barTasksPerProjectLbl);
var_dump($barTasksPerProjectData);
$lists = [
"chiffresDoss" =>[
......@@ -214,24 +238,20 @@ class DashboardAction extends CAction
["data"=>$countAnswersWithOperators,"name"=>"Dossier géré avec opérateur","icon"=>"handshake-o"],
["data"=>$countAnswersWithOperatorsUnset,"name"=>"Dossier sans opérateur","icon"=>"gavel","type"=>"danger"],
["data"=>$countAnswersFinanced,"name"=>"Dossier financé","icon"=>"money","type"=>"success"],
["data"=>$countAnswersFinished,"name"=>"Dossier clôturé","icon"=>"handshake-o","type"=>"success"],
["data"=>$countAnswersFinished,"name"=>"Dossier clôturé","icon"=>"check-circle-o","type"=>"success"],
["data"=>$countAnswersRefused,"name"=>"Dossier refusé","icon"=>"thumbs-down","type"=>"danger"],
],
"tpl" => "costum.views.tpls.list"
],
"chiffresDecis" =>[
"title"=>"<i class='fa fa-2x fa-gavel'></i><br/>Decisions",
"title"=>"<i class='fa fa-2x fa-cogs'></i><br/>Travaux",
"blocksize"=>"4 col-xs-6",
"bgColor" => Ctenat::$COLORS[0],
"color" => "#fff",
"data" => [
["data"=>"??","name"=>"active Projects","icon"=>"thumbs-up","type"=>"success"],
["data"=>"??","name"=>"finished Projects","type"=>"danger","icon"=>"map-marker"],
["data"=>"??","name"=>"for open projects Tasks distribution","type"=>"danger","icon"=>"money"],
["data"=>"??","name"=>"for each worker Tasks distribution per project","icon"=>"hourglass-half"],
["data"=>"??","name"=>"Dossier en attente de decision","type"=>"danger","icon"=>"hourglass-half"],
["data"=>"??","name"=>"Dossier abandonné","icon"=>"ban","type"=>"danger"],
],
"tpl" => "costum.views.tpls.list"
],
......@@ -268,15 +288,9 @@ class DashboardAction extends CAction
"url"=>"/graph/co/dash/g/costum.views.custom.ctenat.graph.pieMany"
],
"tasks" =>[
"title"=>"Travaux",
"data" => [32,65,3,21,10],
"lbls" => ["Travaux 0","Travaux 1","Travaux 2","Travaux 3","Travaux 4"],
"url" => "/graph/co/dash/g/graph.views.co.line"
],
"tasks" =>[
"title"=>"Travaux en cours par projet",
"data" => [32,65,3,21,10],
"lbls" => ["Travaux 0","Travaux 1","Travaux 2","Travaux 3","Travaux 4"],
"title"=>"Travaux en cours par projet" ,
"data" => $barTasksPerProjectData ,
"lbls" => $barTasksPerProjectLbl ,
"url" => "/graph/co/dash/g/graph.views.co.barMany"
],
"finance" =>[
......
Supports Markdown
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