diff --git a/dbd/sql/mysql/data/system_sai_api.sql b/dbd/sql/mysql/data/system_sai_api.sql index b9ae8df..f64bcaf 100644 --- a/dbd/sql/mysql/data/system_sai_api.sql +++ b/dbd/sql/mysql/data/system_sai_api.sql @@ -142,6 +142,8 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1007, 42, 3, 1000, 'deassign', 'user', 'INT'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1010, 42, 2, 1000, 'edit', 'todo', 'INT'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1011, 42, 2, 1000, 'edit', 'message', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1015, 42, 2, 1000, 'priority_up', 'todo', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1016, 42, 2, 1000, 'priority_down', 'todo', 'INT'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_docu', 'action', NULL); diff --git a/dbd/sql/mysql/schema/system_todo.sql b/dbd/sql/mysql/schema/system_todo.sql index a833791..b6f066b 100644 --- a/dbd/sql/mysql/schema/system_todo.sql +++ b/dbd/sql/mysql/schema/system_todo.sql @@ -21,9 +21,12 @@ CREATE TABLE `system_todo` ( `type` INT(11) NOT NULL DEFAULT '0', `count` INT(11) NOT NULL DEFAULT '1', `state` INT(11) NOT NULL DEFAULT '0', + `priority` INT(11) NOT NULL DEFAULT '0', + `time_closed` DATETIME NULL DEFAULT NULL, PRIMARY KEY (`ID`), UNIQUE INDEX `file_line_message` (`file`, `line`, `message_hash`) ) COLLATE='utf8_general_ci' ENGINE=MyISAM -AUTO_INCREMENT=92; \ No newline at end of file +AUTO_INCREMENT=0 +; \ No newline at end of file diff --git a/dbd/sql/mysql/schema/system_todo_assign.sql b/dbd/sql/mysql/schema/system_todo_assign.sql index da87016..0b503ad 100644 --- a/dbd/sql/mysql/schema/system_todo_assign.sql +++ b/dbd/sql/mysql/schema/system_todo_assign.sql @@ -1,6 +1,7 @@ CREATE TABLE `system_todo_assign` ( `todo` INT(10) NOT NULL, `user` INT(10) UNSIGNED NOT NULL, + `time` DATETIME NOT NULL, PRIMARY KEY (`todo`, `user`) ) COLLATE='utf8_unicode_ci' diff --git a/dbd/tbl/system_todo.php b/dbd/tbl/system_todo.php index 9bc28bb..5b24c8a 100644 --- a/dbd/tbl/system_todo.php +++ b/dbd/tbl/system_todo.php @@ -32,4 +32,6 @@ class system_todo { const FIELD_STATE = 'state'; const FIELD_STATE_OPEN = 0; const FIELD_STATE_CLOSED = 1; + const FIELD_PRIORITY = 'priority'; + const FIELD_TIME_CLOSED = 'time_closed'; } \ No newline at end of file diff --git a/dbd/tbl/system_todo_assign.php b/dbd/tbl/system_todo_assign.php index 4e0db6e..3f48e66 100644 --- a/dbd/tbl/system_todo_assign.php +++ b/dbd/tbl/system_todo_assign.php @@ -7,4 +7,5 @@ class system_todo_assign { const FIELD_TODO = 'todo'; const FIELD_USER = 'user'; + const FIELD_TIME = 'time'; } \ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js b/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js index 17e2600..218861f 100644 --- a/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js +++ b/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js @@ -54,6 +54,7 @@ function init_saimod_sys_todo_todoopen(){ register_assign(); register_deassign(); register_deassign_user(); + register_priority(); init_tinymce(); } function init_saimod_sys_todo_todoclose(){ @@ -71,6 +72,7 @@ function init_saimod_sys_todo_todoclose(){ register_assign(); register_deassign(); register_deassign_user(); + register_priority(); init_tinymce(); } @@ -89,6 +91,30 @@ function init_saimod_sys_todo_new(){ init_tinymce(); } +function register_priority(){ + $('#btn_prio_up').click(function(){ + $.ajax({ type : 'GET', + url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=priority_up&todo='+$(this).attr('todo'), + success : function(data) { + if(data.status){ + alert('success'); + } + } + }); + }); + + $('#btn_prio_down').click(function(){ + $.ajax({ type : 'GET', + url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=priority_down&todo='+$(this).attr('todo'), + success : function(data) { + if(data.status){ + alert('success'); + } + } + }); + }); +} + function register_open(){ $('#btn_open').show(); $('#btn_open').click(function(){ diff --git a/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_ASSIGN.php b/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_ASSIGN.php index e6f19de..d86e049 100644 --- a/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_ASSIGN.php +++ b/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_ASSIGN.php @@ -7,6 +7,8 @@ class SYS_SAIMOD_TODO_ASSIGN extends \SYSTEM\DB\QP { //pg 'TODO', //mys -'INSERT INTO '.\SYSTEM\DBD\system_todo_assign::NAME_MYS.' ('.\SYSTEM\DBD\system_todo_assign::FIELD_TODO.','.\SYSTEM\DBD\system_todo_assign::FIELD_USER.') VALUES(?,?);' +'INSERT INTO '.\SYSTEM\DBD\system_todo_assign::NAME_MYS. +' ('.\SYSTEM\DBD\system_todo_assign::FIELD_TODO.','.\SYSTEM\DBD\system_todo_assign::FIELD_USER.','.\SYSTEM\DBD\system_todo_assign::FIELD_TIME.')'. +' VALUES(?,?, NOW());' );}} diff --git a/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_CLOSE.php b/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_CLOSE.php index bfb243c..7f2a4ea 100644 --- a/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_CLOSE.php +++ b/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_CLOSE.php @@ -8,7 +8,7 @@ class SYS_SAIMOD_TODO_CLOSE extends \SYSTEM\DB\QP { 'UPDATE '.\SYSTEM\DBD\system_todo::NAME_PG.' SET '.\SYSTEM\DBD\system_todo::FIELD_STATE.'='.\SYSTEM\DBD\system_todo::FIELD_STATE_CLOSED. ' WHERE "'.\SYSTEM\DBD\system_todo::FIELD_ID.'"= $1;', //mys -'UPDATE '.\SYSTEM\DBD\system_todo::NAME_MYS.' SET '.\SYSTEM\DBD\system_todo::FIELD_STATE.'='.\SYSTEM\DBD\system_todo::FIELD_STATE_CLOSED. +'UPDATE '.\SYSTEM\DBD\system_todo::NAME_MYS.' SET '.\SYSTEM\DBD\system_todo::FIELD_STATE.'='.\SYSTEM\DBD\system_todo::FIELD_STATE_CLOSED.', '.\SYSTEM\DBD\system_todo::FIELD_TIME_CLOSED.'=NOW()'. ' WHERE '.\SYSTEM\DBD\system_todo::FIELD_ID.'= ?;' );}} diff --git a/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_CLOSE_ALL.php b/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_CLOSE_ALL.php index d827b67..9ce76a0 100644 --- a/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_CLOSE_ALL.php +++ b/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_CLOSE_ALL.php @@ -8,7 +8,7 @@ class SYS_SAIMOD_TODO_CLOSE_ALL extends \SYSTEM\DB\QQ { 'UPDATE '.\SYSTEM\DBD\system_todo::NAME_PG.' SET '.\SYSTEM\DBD\system_todo::FIELD_STATE.'='.\SYSTEM\DBD\system_todo::FIELD_STATE_CLOSED. ' WHERE "'.\SYSTEM\DBD\system_todo::FIELD_TYPE.'"='.\SYSTEM\DBD\system_todo::FIELD_TYPE_EXCEPTION.';', //mys -'UPDATE '.\SYSTEM\DBD\system_todo::NAME_MYS.' SET '.\SYSTEM\DBD\system_todo::FIELD_STATE.'='.\SYSTEM\DBD\system_todo::FIELD_STATE_CLOSED. +'UPDATE '.\SYSTEM\DBD\system_todo::NAME_MYS.' SET '.\SYSTEM\DBD\system_todo::FIELD_STATE.'='.\SYSTEM\DBD\system_todo::FIELD_STATE_CLOSED.', '.\SYSTEM\DBD\system_todo::FIELD_TIME_CLOSED.'=NOW()'. ' WHERE `'.\SYSTEM\DBD\system_todo::FIELD_TYPE.'`='.\SYSTEM\DBD\system_todo::FIELD_TYPE_EXCEPTION.';' );}} diff --git a/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_LIST.php b/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_LIST.php index 42e417f..a449a28 100644 --- a/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_LIST.php +++ b/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_LIST.php @@ -9,7 +9,7 @@ class SYS_SAIMOD_TODO_LIST extends \SYSTEM\DB\QP { //mys 'SELECT * FROM('. ' SELECT todo.'.\SYSTEM\DBD\system_todo::FIELD_ID.' as todo_id,'. - ' todo.'.\SYSTEM\DBD\system_todo::FIELD_TYPE.', todo.'.\SYSTEM\DBD\system_todo::FIELD_CLASS.', todo.'.\SYSTEM\DBD\system_todo::FIELD_TIME.', todo.'.\SYSTEM\DBD\system_todo::FIELD_COUNT.', todo.'.\SYSTEM\DBD\system_todo::FIELD_MESSAGE.', todo.'.\SYSTEM\DBD\system_todo::FIELD_REQUEST_URI.', todo.'.\SYSTEM\DBD\system_todo::FIELD_FILE.', todo.'.\SYSTEM\DBD\system_todo::FIELD_LINE.', todo.'.\SYSTEM\DBD\system_todo::FIELD_SERVER_NAME.', todo.'.\SYSTEM\DBD\system_todo::FIELD_SERVER_PORT.', todo.'.\SYSTEM\DBD\system_todo::FIELD_QUERYTIME.', todo.'.\SYSTEM\DBD\system_todo::FIELD_IP.','. + ' todo.'.\SYSTEM\DBD\system_todo::FIELD_TYPE.', todo.'.\SYSTEM\DBD\system_todo::FIELD_CLASS.', todo.'.\SYSTEM\DBD\system_todo::FIELD_TIME.', todo.'.\SYSTEM\DBD\system_todo::FIELD_COUNT.', todo.'.\SYSTEM\DBD\system_todo::FIELD_MESSAGE.', todo.'.\SYSTEM\DBD\system_todo::FIELD_REQUEST_URI.', todo.'.\SYSTEM\DBD\system_todo::FIELD_FILE.', todo.'.\SYSTEM\DBD\system_todo::FIELD_LINE.', todo.'.\SYSTEM\DBD\system_todo::FIELD_SERVER_NAME.', todo.'.\SYSTEM\DBD\system_todo::FIELD_SERVER_PORT.', todo.'.\SYSTEM\DBD\system_todo::FIELD_QUERYTIME.', todo.'.\SYSTEM\DBD\system_todo::FIELD_IP.', todo.'.\SYSTEM\DBD\system_todo::FIELD_PRIORITY.','. ' creator.'.\SYSTEM\DBD\system_user::FIELD_ID.' as creator_id,'. ' creator.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.','. ' assignee.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.' as assignee,'. @@ -23,5 +23,5 @@ class SYS_SAIMOD_TODO_LIST extends \SYSTEM\DB\QP { ' LIMIT 100'. ') as a'. ' GROUP BY a.todo_id'. -' ORDER BY a.'.\SYSTEM\DBD\system_todo::FIELD_TYPE.' DESC, a.'.\SYSTEM\DBD\system_todo::FIELD_COUNT.' DESC, a.'.\SYSTEM\DBD\system_todo::FIELD_TIME.' DESC' +' ORDER BY a.'.\SYSTEM\DBD\system_todo::FIELD_PRIORITY.' DESC, a.'.\SYSTEM\DBD\system_todo::FIELD_TYPE.' DESC, a.'.\SYSTEM\DBD\system_todo::FIELD_COUNT.' DESC, a.'.\SYSTEM\DBD\system_todo::FIELD_TIME.' DESC' );}} \ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_PRIORITY.php b/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_PRIORITY.php new file mode 100644 index 0000000..ca43eac --- /dev/null +++ b/sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_PRIORITY.php @@ -0,0 +1,13 @@ +message${message} + + - \ No newline at end of file + diff --git a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl index 009a18e..80b057f 100644 --- a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl +++ b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl @@ -2,6 +2,7 @@ + @@ -21,6 +22,8 @@
${table_property}${table_value}
${table_id}${ID}
${table_priority}${priority}
${table_ip}${ip}
${table_querytime}${querytime}
${table_time}${time}
+ +