From 228d3697bcd0218605be2e28131574cc85293a2e Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 17 Mar 2014 12:00:58 -0300 Subject: Squashed 'mod/tasks/' content from commit c9b1097 git-subtree-dir: mod/tasks git-subtree-split: c9b1097ce081d6893f9c939146208559c089dc15 --- views/default/tasks/tasklist_graph.php | 65 ++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 views/default/tasks/tasklist_graph.php (limited to 'views/default/tasks/tasklist_graph.php') diff --git a/views/default/tasks/tasklist_graph.php b/views/default/tasks/tasklist_graph.php new file mode 100644 index 000000000..f46066a8a --- /dev/null +++ b/views/default/tasks/tasklist_graph.php @@ -0,0 +1,65 @@ + $vars['entity']->guid, + 'count' => true, +)); +$closed = tasks_get_entities(array( + 'list_guid' => $vars['entity']->guid, + 'status' => 'closed', + 'count' => true, +)); +$total_link = $entity->getURL()."#all"; +// Closed tasks aren't contabilized in graph. +$total -= $closed; + +$done = tasks_get_entities(array( + 'list_guid' => $vars['entity']->guid, + 'status' => 'done', + 'count' => true, +)); + +$remaining = $total - $done; +$remaining_link = $entity->getURL()."#remaining"; + +$assigned = tasks_get_entities(array( + 'list_guid' => $vars['entity']->guid, + 'status' => array('assigned', 'active'), + 'count' => true, +)); +$assigned_link = $entity->getURL()."#assigned"; + +$active = tasks_get_entities(array( + 'list_guid' => $vars['entity']->guid, + 'status' => 'active', + 'count' => true, +)); +$active_link = $entity->getURL()."#active"; + +if ($total == 0) { + $percent = 0; +} else { + $percent = $done / $total * 100; +} + +?> + +
+
+
 
+
+ +' . elgg_echo('tasks:lists:graph:total', array($total)) . ', '; +echo '' . elgg_echo('tasks:lists:graph:remaining', array($remaining)) . ', '; +echo '' . elgg_echo('tasks:lists:graph:assigned', array($assigned)) . ', '; +echo '' . elgg_echo('tasks:lists:graph:active', array($active)) . ''; + +?> + +
-- cgit v1.2.3