diff --git a/sai/modules/saimod_sys_todo/autoload.inc b/sai/modules/saimod_sys_todo/autoload.inc index a3861ae..033c876 100644 --- a/sai/modules/saimod_sys_todo/autoload.inc +++ b/sai/modules/saimod_sys_todo/autoload.inc @@ -1,5 +1,8 @@ perc;} + $result['project'] = round($result['project'] / (count($result['data'])),2); + return $result; } public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_stats(){ - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_stats.tpl'), self::statistics());} + $vars = array(); + $stats = self::statistics(); + $vars['project'] = $stats['project']; + $vars['entries'] = ''; + foreach($stats['data'] as $stat){ + $vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_stats_entry.tpl'), $stat); + } + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_stats.tpl'), $vars);} private static function time_elapsed_string($ptime) { diff --git a/sai/modules/saimod_sys_todo/stats/todo_stats_gen.php b/sai/modules/saimod_sys_todo/stats/todo_stats_gen.php new file mode 100644 index 0000000..51e5111 --- /dev/null +++ b/sai/modules/saimod_sys_todo/stats/todo_stats_gen.php @@ -0,0 +1,10 @@ +name = $name; + $this->part = $part; + $this->whole = $whole; + $this->perc = round($this->part / $this->whole * 100,2); + } +} diff --git a/sai/modules/saimod_sys_todo/tpl/todo_stats.tpl b/sai/modules/saimod_sys_todo/tpl/todo_stats.tpl index f54c98d..082d1f1 100644 --- a/sai/modules/saimod_sys_todo/tpl/todo_stats.tpl +++ b/sai/modules/saimod_sys_todo/tpl/todo_stats.tpl @@ -1,42 +1,15 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + ${entries} - + +
ValueName Count%
ToDo_All${todo_count}${todo_perc}%
ToDo_Gen${todo_gen_count}${todo_gen_perc}%
ToDo_User${todo_user_count}${todo_user_perc}%
DoTo_All${doto_count}${doto_perc}%
DoTo_Gen${doto_gen_count}${doto_gen_perc}%
DoTo_User${doto_user_count}${doto_user_perc}%AllDone
Project ${project_perc}%${project}%
\ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/tpl/todo_stats_entry.tpl b/sai/modules/saimod_sys_todo/tpl/todo_stats_entry.tpl new file mode 100644 index 0000000..aa258bc --- /dev/null +++ b/sai/modules/saimod_sys_todo/tpl/todo_stats_entry.tpl @@ -0,0 +1,6 @@ + + ${name} + ${part} + ${whole} + ${perc}% + \ No newline at end of file