saimod todo filter & search functionality
This commit is contained in:
parent
6f040c6b26
commit
c2050aa67e
@ -49,8 +49,9 @@ INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`,
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (116, 42, 'editor', 'text', 115, 0, 1, '#tab_editor', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_text&action=editor&id=${id}&lang=${lang}', 'init_saimod_sys_text_editor', '\\SYSTEM\\SAI\\saimod_sys_text');
|
||||
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (120, 42, 'todo', 'todo', -1, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo', 'init_saimod_sys_todo', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (121, 42, 'todolist', 'todo', 120, 0, 0, '#tab_todo', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=todolist', 'init_saimod_sys_todo_todo', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (122, 42, 'doto', 'todo', 120, 0, 1, '#tab_todo', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=dotolist', 'init_saimod_sys_todo_doto', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (121, 42, 'todolist', 'todo', 120, 0, 0, '#tab_todo', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=todolist&filter=${filter}&search=${search}', 'init_saimod_sys_todo_todo', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (122, 42, 'doto', 'todo', 120, 0, 1, '#tab_todo', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=dotolist&filter=${filter}&search=${search}', 'init_saimod_sys_todo_doto', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (123, 42, 'stats', 'todo', 120, 0, 1, '#tab_todo', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=stats', 'init_saimod_sys_todo_stats', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (124, 42, 'todoopen', 'todo', 120, 0, 1, '#tab_todo', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=todo&todo=${todo}', 'init_saimod_sys_todo_todoopen', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (125, 42, 'todoclose', 'todo', 120, 0, 1, '#tab_todo', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=todo&todo=${todo}', 'init_saimod_sys_todo_todoclose', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||
|
||||
@ -144,6 +144,10 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam
|
||||
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 (1020, 42, 3, 1000, 'todolist', 'filter', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1021, 42, 3, 1000, 'todolist', 'search', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1025, 42, 3, 1000, 'dotolist', 'filter', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1026, 42, 3, 1000, 'dotolist', 'search', 'STRING');
|
||||
|
||||
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_docu', 'action', NULL);
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_all', 'frFR', 'Tous', 3, 3, '2015-04-20 16:31:55', '2015-04-20 16:31:55');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_all', 'basic');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_all', 'sai_log');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_all', 'sai_todo');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_all', 'sai_text');
|
||||
|
||||
DELETE FROM `system_text` WHERE id = 'basic_analytics';
|
||||
@ -259,6 +260,13 @@
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_placeholder_username', 'jaJA', 'peter / peter@world.org', 0, 0, '2015-04-15 18:41:22', '0000-00-00 00:00:00');
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_placeholder_username', 'trTR', 'peter@world.org', 0, 0, '2015-04-15 18:29:17', '0000-00-00 00:00:00');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_placeholder_username', 'basic');
|
||||
|
||||
DELETE FROM `system_text` WHERE id = 'basic_placeholder_search';
|
||||
DELETE FROM `system_text_tag` WHERE id = 'basic_placeholder_search';
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_placeholder_search', 'deDE', 'Ich suche nach...', 0, 0, '2015-04-15 18:29:16', '0000-00-00 00:00:00');
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_placeholder_search', 'enUS', 'I\'m searching for...', 0, 0, '2015-04-15 18:29:16', '0000-00-00 00:00:00');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_placeholder_search', 'basic');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_placeholder_search', 'sai_todo');
|
||||
|
||||
DELETE FROM `system_text` WHERE id = 'basic_progress';
|
||||
DELETE FROM `system_text_tag` WHERE id = 'basic_progress';
|
||||
@ -454,6 +462,7 @@
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_search', 'enUS', 'Search', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_search', 'basic');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_search', 'sai_security');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_search', 'sai_todo');
|
||||
|
||||
DELETE FROM `system_text` WHERE id = 'basic_send_email';
|
||||
DELETE FROM `system_text_tag` WHERE id = 'basic_send_email';
|
||||
@ -533,6 +542,48 @@
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_deassign', 'enUS', 'I don\'t Do that', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_deassign', 'basic');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_deassign', 'sai_todo');
|
||||
|
||||
DELETE FROM `system_text` WHERE id = 'basic_mine';
|
||||
DELETE FROM `system_text_tag` WHERE id = 'basic_mine';
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_mine', 'deDE', 'Meine', 1, 1, '2015-04-16 23:11:18', '2015-04-16 16:48:36');
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_mein', 'enUS', 'Mine', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_mine', 'basic');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_mine', 'sai_todo');
|
||||
|
||||
DELETE FROM `system_text` WHERE id = 'basic_free';
|
||||
DELETE FROM `system_text_tag` WHERE id = 'basic_free';
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_free', 'deDE', 'Frei', 1, 1, '2015-04-16 23:11:18', '2015-04-16 16:48:36');
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_free', 'enUS', 'Free', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_free', 'basic');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_free', 'sai_todo');
|
||||
|
||||
DELETE FROM `system_text` WHERE id = 'basic_others';
|
||||
DELETE FROM `system_text_tag` WHERE id = 'basic_others';
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_others', 'deDE', 'Andere', 1, 1, '2015-04-16 23:11:18', '2015-04-16 16:48:36');
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_others', 'enUS', 'Others', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_others', 'basic');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_others', 'sai_todo');
|
||||
|
||||
DELETE FROM `system_text` WHERE id = 'basic_generated';
|
||||
DELETE FROM `system_text_tag` WHERE id = 'basic_generated';
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_generated', 'deDE', 'Generiert', 1, 1, '2015-04-16 23:11:18', '2015-04-16 16:48:36');
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_generated', 'enUS', 'Generated', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_generated', 'basic');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_generated', 'sai_todo');
|
||||
|
||||
DELETE FROM `system_text` WHERE id = 'basic_user';
|
||||
DELETE FROM `system_text_tag` WHERE id = 'basic_user';
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_user', 'deDE', 'Nutzer', 1, 1, '2015-04-16 23:11:18', '2015-04-16 16:48:36');
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_user', 'enUS', 'User', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_user', 'basic');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_user', 'sai_todo');
|
||||
|
||||
DELETE FROM `system_text` WHERE id = 'basic_report';
|
||||
DELETE FROM `system_text_tag` WHERE id = 'basic_report';
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_report', 'deDE', 'Report', 1, 1, '2015-04-16 23:11:18', '2015-04-16 16:48:36');
|
||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_report', 'enUS', 'Report', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_report', 'basic');
|
||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_report', 'sai_todo');
|
||||
|
||||
-- SAI
|
||||
DELETE FROM `system_text` WHERE id = 'sai_api_title';
|
||||
|
||||
@ -29,6 +29,7 @@ class system_todo {
|
||||
const FIELD_TYPE = 'type';
|
||||
const FIELD_TYPE_EXCEPTION = 0;
|
||||
const FIELD_TYPE_USER = 1;
|
||||
const FIELD_TYPE_REPORT = 2;
|
||||
const FIELD_STATE = 'state';
|
||||
const FIELD_STATE_OPEN = 0;
|
||||
const FIELD_STATE_CLOSED = 1;
|
||||
|
||||
@ -20,17 +20,24 @@ function init_saimod_sys_todo() {
|
||||
})
|
||||
};
|
||||
|
||||
function register_search(){
|
||||
$('#btn_search').click(function(){
|
||||
system.load($(this).attr('state')+$('#input_search').val(),true);
|
||||
});
|
||||
}
|
||||
|
||||
function init_saimod_sys_todo_todo() {
|
||||
$('#tabs_todo li').each(function(){
|
||||
$(this).removeClass('active');});
|
||||
$('#menu_todolist').parent().addClass('active');
|
||||
init_tinymce();
|
||||
register_search();
|
||||
}
|
||||
|
||||
function init_saimod_sys_todo_doto() {
|
||||
$('#tabs_todo li').each(function(){
|
||||
$(this).removeClass('active');});
|
||||
$('#menu_doto').parent().addClass('active');
|
||||
register_search();
|
||||
}
|
||||
|
||||
function init_saimod_sys_todo_stats() {
|
||||
|
||||
@ -19,6 +19,7 @@ class SYS_SAIMOD_TODO_LIST extends \SYSTEM\DB\QP {
|
||||
' LEFT JOIN '.\SYSTEM\DBD\system_user::NAME_MYS.' as creator ON todo.'.\SYSTEM\DBD\system_todo::FIELD_USER.'=creator.'.\SYSTEM\DBD\system_user::FIELD_ID.
|
||||
' LEFT JOIN '.\SYSTEM\DBD\system_user::NAME_MYS.' as assignee ON assign.'.\SYSTEM\DBD\system_todo_assign::FIELD_USER.'=assignee.'.\SYSTEM\DBD\system_user::FIELD_ID.
|
||||
' WHERE todo.'.\SYSTEM\DBD\system_todo::FIELD_STATE.' = ?'.
|
||||
' AND (todo.'.\SYSTEM\DBD\system_todo::FIELD_MESSAGE.' LIKE ? OR creator.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.' LIKE ? OR assignee.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.' LIKE ?)'.
|
||||
' ORDER BY case when assign.'.\SYSTEM\DBD\system_todo_assign::FIELD_USER.' = ? then 1 else 2 end'.
|
||||
' LIMIT 100'.
|
||||
') as a'.
|
||||
|
||||
28
sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_LIST_FREE.php
Normal file
28
sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_LIST_FREE.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace SYSTEM\DBD;
|
||||
|
||||
class SYS_SAIMOD_TODO_LIST_FREE extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'TODO',
|
||||
//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_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,'.
|
||||
' assignee.'.\SYSTEM\DBD\system_user::FIELD_ID.' as assignee_id'.
|
||||
' FROM '.\SYSTEM\DBD\system_todo::NAME_MYS.' as todo'.
|
||||
' LEFT JOIN '.\SYSTEM\DBD\system_todo_assign::NAME_MYS.' as assign ON todo.'.\SYSTEM\DBD\system_todo::FIELD_ID.'=assign.'.\SYSTEM\DBD\system_todo_assign::FIELD_TODO.
|
||||
' LEFT JOIN '.\SYSTEM\DBD\system_user::NAME_MYS.' as creator ON todo.'.\SYSTEM\DBD\system_todo::FIELD_USER.'=creator.'.\SYSTEM\DBD\system_user::FIELD_ID.
|
||||
' LEFT JOIN '.\SYSTEM\DBD\system_user::NAME_MYS.' as assignee ON assign.'.\SYSTEM\DBD\system_todo_assign::FIELD_USER.'=assignee.'.\SYSTEM\DBD\system_user::FIELD_ID.
|
||||
' WHERE todo.'.\SYSTEM\DBD\system_todo::FIELD_STATE.' = ?'.
|
||||
' AND assign.'.\SYSTEM\DBD\system_todo_assign::FIELD_USER.' IS NULL'.
|
||||
' AND (todo.'.\SYSTEM\DBD\system_todo::FIELD_MESSAGE.' LIKE ? OR creator.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.' LIKE ? OR assignee.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.' LIKE ?)'.
|
||||
' LIMIT 100'.
|
||||
') as a'.
|
||||
' GROUP BY a.todo_id'.
|
||||
' 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'
|
||||
);}}
|
||||
28
sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_LIST_MINE.php
Normal file
28
sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_LIST_MINE.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace SYSTEM\DBD;
|
||||
|
||||
class SYS_SAIMOD_TODO_LIST_MINE extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'TODO',
|
||||
//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_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,'.
|
||||
' assignee.'.\SYSTEM\DBD\system_user::FIELD_ID.' as assignee_id'.
|
||||
' FROM '.\SYSTEM\DBD\system_todo::NAME_MYS.' as todo'.
|
||||
' LEFT JOIN '.\SYSTEM\DBD\system_todo_assign::NAME_MYS.' as assign ON todo.'.\SYSTEM\DBD\system_todo::FIELD_ID.'=assign.'.\SYSTEM\DBD\system_todo_assign::FIELD_TODO.
|
||||
' LEFT JOIN '.\SYSTEM\DBD\system_user::NAME_MYS.' as creator ON todo.'.\SYSTEM\DBD\system_todo::FIELD_USER.'=creator.'.\SYSTEM\DBD\system_user::FIELD_ID.
|
||||
' LEFT JOIN '.\SYSTEM\DBD\system_user::NAME_MYS.' as assignee ON assign.'.\SYSTEM\DBD\system_todo_assign::FIELD_USER.'=assignee.'.\SYSTEM\DBD\system_user::FIELD_ID.
|
||||
' WHERE todo.'.\SYSTEM\DBD\system_todo::FIELD_STATE.' = ?'.
|
||||
' AND assign.'.\SYSTEM\DBD\system_todo_assign::FIELD_USER.' = ?'.
|
||||
' AND (todo.'.\SYSTEM\DBD\system_todo::FIELD_MESSAGE.' LIKE ? OR creator.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.' LIKE ? OR assignee.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.' LIKE ?)'.
|
||||
' LIMIT 100'.
|
||||
') as a'.
|
||||
' GROUP BY a.todo_id'.
|
||||
' 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'
|
||||
);}}
|
||||
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace SYSTEM\DBD;
|
||||
|
||||
class SYS_SAIMOD_TODO_LIST_OTHERS extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'TODO',
|
||||
//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_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,'.
|
||||
' assignee.'.\SYSTEM\DBD\system_user::FIELD_ID.' as assignee_id'.
|
||||
' FROM '.\SYSTEM\DBD\system_todo::NAME_MYS.' as todo'.
|
||||
' LEFT JOIN '.\SYSTEM\DBD\system_todo_assign::NAME_MYS.' as assign ON todo.'.\SYSTEM\DBD\system_todo::FIELD_ID.'=assign.'.\SYSTEM\DBD\system_todo_assign::FIELD_TODO.
|
||||
' LEFT JOIN '.\SYSTEM\DBD\system_user::NAME_MYS.' as creator ON todo.'.\SYSTEM\DBD\system_todo::FIELD_USER.'=creator.'.\SYSTEM\DBD\system_user::FIELD_ID.
|
||||
' LEFT JOIN '.\SYSTEM\DBD\system_user::NAME_MYS.' as assignee ON assign.'.\SYSTEM\DBD\system_todo_assign::FIELD_USER.'=assignee.'.\SYSTEM\DBD\system_user::FIELD_ID.
|
||||
' WHERE todo.'.\SYSTEM\DBD\system_todo::FIELD_STATE.' = ?'.
|
||||
' AND NOT assign.'.\SYSTEM\DBD\system_todo_assign::FIELD_USER.' = ?'.
|
||||
' AND (todo.'.\SYSTEM\DBD\system_todo::FIELD_MESSAGE.' LIKE ? OR creator.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.' LIKE ? OR assignee.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.' LIKE ?)'.
|
||||
' LIMIT 100'.
|
||||
') as a'.
|
||||
' GROUP BY a.todo_id'.
|
||||
' 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'
|
||||
);}}
|
||||
29
sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_LIST_TYPE.php
Normal file
29
sai/modules/saimod_sys_todo/qq/SYS_SAIMOD_TODO_LIST_TYPE.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace SYSTEM\DBD;
|
||||
|
||||
class SYS_SAIMOD_TODO_LIST_TYPE extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'TODO',
|
||||
//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_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,'.
|
||||
' assignee.'.\SYSTEM\DBD\system_user::FIELD_ID.' as assignee_id'.
|
||||
' FROM '.\SYSTEM\DBD\system_todo::NAME_MYS.' as todo'.
|
||||
' LEFT JOIN '.\SYSTEM\DBD\system_todo_assign::NAME_MYS.' as assign ON todo.'.\SYSTEM\DBD\system_todo::FIELD_ID.'=assign.'.\SYSTEM\DBD\system_todo_assign::FIELD_TODO.
|
||||
' LEFT JOIN '.\SYSTEM\DBD\system_user::NAME_MYS.' as creator ON todo.'.\SYSTEM\DBD\system_todo::FIELD_USER.'=creator.'.\SYSTEM\DBD\system_user::FIELD_ID.
|
||||
' LEFT JOIN '.\SYSTEM\DBD\system_user::NAME_MYS.' as assignee ON assign.'.\SYSTEM\DBD\system_todo_assign::FIELD_USER.'=assignee.'.\SYSTEM\DBD\system_user::FIELD_ID.
|
||||
' WHERE todo.'.\SYSTEM\DBD\system_todo::FIELD_STATE.' = ?'.
|
||||
' AND todo.'.\SYSTEM\DBD\system_todo::FIELD_TYPE.' = ?'.
|
||||
' AND (todo.'.\SYSTEM\DBD\system_todo::FIELD_MESSAGE.' LIKE ? OR creator.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.' LIKE ? OR assignee.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.' LIKE ?)'.
|
||||
' ORDER BY case when assign.'.\SYSTEM\DBD\system_todo_assign::FIELD_USER.' = ? then 1 else 2 end'.
|
||||
' LIMIT 100'.
|
||||
') as a'.
|
||||
' GROUP BY a.todo_id'.
|
||||
' 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'
|
||||
);}}
|
||||
@ -49,16 +49,51 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule {
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/saimod_sys_todo_new.tpl'), $vars);
|
||||
}
|
||||
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_todolist(){
|
||||
return self::generate_list(\SYSTEM\DBD\system_todo::FIELD_STATE_OPEN);}
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_todolist($filter='all',$search=''){
|
||||
return self::generate_list(\SYSTEM\DBD\system_todo::FIELD_STATE_OPEN,$filter,$search);}
|
||||
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_dotolist(){
|
||||
return self::generate_list(\SYSTEM\DBD\system_todo::FIELD_STATE_CLOSED);}
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_dotolist($filter='all',$search=''){
|
||||
return self::generate_list(\SYSTEM\DBD\system_todo::FIELD_STATE_CLOSED,$filter,$search);}
|
||||
|
||||
private static function generate_list($state){
|
||||
$result = $result_user = '';
|
||||
private static function generate_list($state,$filter,$search){
|
||||
$vars = array();
|
||||
$vars['filter'] = $filter;
|
||||
$vars['search'] = $search;
|
||||
$search = '%'.$search.'%';
|
||||
$vars['todo_list_elements'] = $vars['filter_mine'] =
|
||||
$vars['filter_free'] = $vars['filter_others'] = $vars['filter_gen'] =
|
||||
$vars['filter_user'] = $vars['filter_report'] = '';
|
||||
$userid = \SYSTEM\SECURITY\Security::getUser()->id;
|
||||
$res = \SYSTEM\DBD\SYS_SAIMOD_TODO_LIST::QQ(array($state,$userid));
|
||||
switch($filter){
|
||||
case 'mine':
|
||||
$res = \SYSTEM\DBD\SYS_SAIMOD_TODO_LIST_MINE::QQ(array($state,$userid,$search,$search,$search));
|
||||
$vars['filter_mine'] = 'active';
|
||||
break;
|
||||
case 'free':
|
||||
$res = \SYSTEM\DBD\SYS_SAIMOD_TODO_LIST_FREE::QQ(array($state,$search,$search,$search));
|
||||
$vars['filter_free'] = 'active';
|
||||
break;
|
||||
case 'others':
|
||||
$res = \SYSTEM\DBD\SYS_SAIMOD_TODO_LIST_OTHERS::QQ(array($state,$userid,$search,$search,$search));
|
||||
$vars['filter_others'] = 'active';
|
||||
break;
|
||||
case 'gen':
|
||||
$res = \SYSTEM\DBD\SYS_SAIMOD_TODO_LIST_TYPE::QQ(array($state,\SYSTEM\DBD\system_todo::FIELD_TYPE_EXCEPTION,$search,$search,$search,$userid));
|
||||
$vars['filter_gen'] = 'active';
|
||||
break;
|
||||
case 'user':
|
||||
$res = \SYSTEM\DBD\SYS_SAIMOD_TODO_LIST_TYPE::QQ(array($state,\SYSTEM\DBD\system_todo::FIELD_TYPE_USER,$search,$search,$search,$userid));
|
||||
$vars['filter_user'] = 'active';
|
||||
break;
|
||||
case 'report':
|
||||
$res = \SYSTEM\DBD\SYS_SAIMOD_TODO_LIST_TYPE::QQ(array($state,\SYSTEM\DBD\system_todo::FIELD_TYPE_REPORT,$search,$search,$search,$userid));
|
||||
$vars['filter_report'] = 'active';
|
||||
break;
|
||||
default:
|
||||
$res = \SYSTEM\DBD\SYS_SAIMOD_TODO_LIST::QQ(array($state,$search,$search,$search,$userid));
|
||||
$vars['filter_all'] = 'active';
|
||||
break;
|
||||
}
|
||||
while($row = $res->next()){
|
||||
$row['class_row'] = self::trclass($row['type'],$row['class'],$row['assignee_id'],$userid);
|
||||
$row['time_elapsed'] = \SYSTEM\time::time_ago_string(strtotime($row['time']));
|
||||
@ -67,18 +102,11 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule {
|
||||
$row['message'] = $row['message'];
|
||||
$row['request_uri'] = htmlspecialchars($row['request_uri']);
|
||||
$row['openclose'] = $state == \SYSTEM\DBD\system_todo::FIELD_STATE_OPEN ? 'close' : 'open';
|
||||
if($row['type'] == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER){
|
||||
$row['message'] = str_replace("\n", '<br/>', $row['message']);
|
||||
$result_user .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_user_list_element.tpl'), $row);
|
||||
} else {
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_list_element.tpl'), $row);
|
||||
}
|
||||
$row['message'] = str_replace("\n", '<br/>', $row['message']);
|
||||
$vars['todo_list_elements'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_user_list_element.tpl'), $row);
|
||||
}
|
||||
$count = \SYSTEM\DBD\SYS_SAIMOD_TODO_COUNT::Q1(array($state))['count'];
|
||||
$vars = array();
|
||||
$vars['todo_user_list_elements'] = $result_user;
|
||||
$vars['todo_list_elements'] = $result;
|
||||
$vars['count'] = $count;
|
||||
$vars['count'] = \SYSTEM\DBD\SYS_SAIMOD_TODO_COUNT::Q1(array($state))['count'];
|
||||
$vars['state'] = $state == \SYSTEM\DBD\system_todo::FIELD_STATE_OPEN ? 'todo' : 'todo(doto)';
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag(\SYSTEM\DBD\system_text::TAG_SAI_TODO));
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_list.tpl'), $vars);
|
||||
}
|
||||
|
||||
@ -1,4 +1,15 @@
|
||||
<div id="table-wrapper">
|
||||
<ul class="nav nav-pills" id="error_filter">
|
||||
<li class="${filter_all}"><a href="#!${state};filter.all;search.${search}">${basic_all}</a></li>
|
||||
<li class="${filter_mine}"><a href="#!${state};filter.mine;search.${search}">${basic_mine}</a></li>
|
||||
<li class="${filter_free}"><a href="#!${state};filter.free;search.${search}">${basic_free}</a></li>
|
||||
<li class="${filter_others}"><a href="#!${state};filter.others;search.${search}">${basic_others}</a></li>
|
||||
<li class="${filter_gen}"><a href="#!${state};filter.gen;search.${search}">${basic_generated}</a></li>
|
||||
<li class="${filter_user}"><a href="#!${state};filter.user;search.${search}">${basic_user}</a></li>
|
||||
<li class="${filter_report}"><a href="#!${state};filter.report;search.${search}">${basic_report}</a></li>
|
||||
<button class="btn-sm btn btn-success" state="${state};filter.${filter};search." id="btn_search" type="submit" style="float: right; margin-left: 10px;"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> ${basic_search}</button>
|
||||
<input class="input-medium search-query action-control" id="input_search" type="text" placeholder="${basic_placeholder_search}" size="20" style="float: right;" value="${search}"/>
|
||||
</ul>
|
||||
Rows: ${count}
|
||||
<h5>User ToDo's</h5>
|
||||
<table class="table table-hover table-condensed">
|
||||
@ -8,23 +19,6 @@
|
||||
<th>${table_author}</th>
|
||||
<th>${table_assignee}</th>
|
||||
</tr>
|
||||
${todo_user_list_elements}
|
||||
</table>
|
||||
<hr>
|
||||
<h5>Generated ToDo's</h5>
|
||||
<table class="table table-hover table-condensed">
|
||||
<tr>
|
||||
<th>${time_ago}</th>
|
||||
<th>${table_class}</th>
|
||||
<th>${table_message}</th>
|
||||
<th>${table_file}</th>
|
||||
<th>${table_line}</th>
|
||||
<th>${table_ip}</th>
|
||||
<th>${table_url}</th>
|
||||
<th>${table_user}</th>
|
||||
<th>${table_querytime}</th>
|
||||
<th>${table_count}</th>
|
||||
</tr>
|
||||
${todo_list_elements}
|
||||
</table>
|
||||
</div>
|
||||
Loading…
x
Reference in New Issue
Block a user