diff --git a/dbd/sql/mysql/schema/system_todo_asign.sql b/dbd/sql/mysql/schema/system_todo_asign.sql new file mode 100644 index 0000000..2e8d047 --- /dev/null +++ b/dbd/sql/mysql/schema/system_todo_asign.sql @@ -0,0 +1,8 @@ +CREATE TABLE `system_todo_asign` ( + `todo` INT(10) NOT NULL, + `user` INT(10) UNSIGNED NOT NULL, + PRIMARY KEY (`todo`, `user`) +) +COLLATE='utf8_unicode_ci' +ENGINE=InnoDB +; \ No newline at end of file diff --git a/dbd/tbl/system_todo_asign.php b/dbd/tbl/system_todo_asign.php new file mode 100644 index 0000000..0b1c747 --- /dev/null +++ b/dbd/tbl/system_todo_asign.php @@ -0,0 +1,10 @@ +id; + $res = \SYSTEM\DBD\SYS_SAIMOD_TODO_LIST::QQ(array(\SYSTEM\DBD\system_todo::FIELD_STATE_OPEN,$userid)); $count = \SYSTEM\DBD\SYS_SAIMOD_TODO_TODO_COUNT::Q1()['count']; while($row = $res->next()){ - $row['class_row'] = self::trclass($row['type'],$row['class']); + $row['class_row'] = self::trclass($row['type'],$row['class'],$row['asignee_id'],$userid); $row['time_elapsed'] = \SYSTEM\time::time_ago_string(strtotime($row['time'])); //$row['report_type'] = self::reporttype($row['type']); $row['state_string'] = self::state($row['count']); @@ -129,9 +130,12 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule { return '';} return '';} - private static function trclass($type,$class){ + private static function trclass($type,$class,$asignee,$userid){ if($type == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER){ - return 'success';} + if($asignee == $userid){ return 'danger';} + if($asignee){ return 'warning';} + return 'success'; + } switch($class){ case 'SYSTEM\LOG\INFO': case 'INFO': case 'SYSTEM\LOG\COUNTER': return 'success'; diff --git a/sai/modules/saimod_sys_todo/tpl/todo_list.tpl b/sai/modules/saimod_sys_todo/tpl/todo_list.tpl index ab068c4..f9c2e2d 100644 --- a/sai/modules/saimod_sys_todo/tpl/todo_list.tpl +++ b/sai/modules/saimod_sys_todo/tpl/todo_list.tpl @@ -5,7 +5,8 @@