saimod todo update, texts update, sai default project and url included

This commit is contained in:
Ulf Gebhardt 2015-06-02 23:07:51 +02:00
parent 450a39855b
commit 1891cc6d68
18 changed files with 148 additions and 105 deletions

View File

@ -137,6 +137,8 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1002, 42, 2, 1000, 'open', 'todo', 'INT'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1002, 42, 2, 1000, 'open', 'todo', 'INT');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1003, 42, 2, 1000, 'close', 'todo', 'INT'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1003, 42, 2, 1000, 'close', 'todo', 'INT');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1004, 42, 2, 1000, 'add', 'todo', 'STRING'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1004, 42, 2, 1000, 'add', 'todo', 'STRING');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1005, 42, 2, 1000, 'assign', 'todo', 'INT');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1006, 42, 2, 1000, 'deassign', 'todo', '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 (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 (1011, 42, 2, 1000, 'edit', 'message', 'STRING');

View File

@ -520,6 +520,20 @@
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_open', 'enUS', 'Open', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18'); INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_open', 'enUS', 'Open', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_open', 'basic'); INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_open', 'basic');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_open', 'sai_todo'); INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_open', 'sai_todo');
DELETE FROM `system_text` WHERE id = 'basic_assign';
DELETE FROM `system_text_tag` WHERE id = 'basic_assign';
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_assign', 'deDE', 'Mach ich', 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_assign', 'enUS', 'I Do it', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_assign', 'basic');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_assign', 'sai_todo');
DELETE FROM `system_text` WHERE id = 'basic_deassign';
DELETE FROM `system_text_tag` WHERE id = 'basic_deassign';
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_deassign', 'deDE', 'Mach ich nicht', 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_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');
-- SAI -- SAI
DELETE FROM `system_text` WHERE id = 'sai_api_title'; DELETE FROM `system_text` WHERE id = 'sai_api_title';
@ -545,8 +559,8 @@
DELETE FROM `system_text` WHERE id = 'sai_copyright'; DELETE FROM `system_text` WHERE id = 'sai_copyright';
DELETE FROM `system_text_tag` WHERE id = 'sai_copyright'; DELETE FROM `system_text_tag` WHERE id = 'sai_copyright';
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('sai_copyright', 'deDE', '<a href="MYURL" target="_blank" data-mce-href="MYURL">MYPROJECTNAME</a> © WebCraft Media 2015', 2, 2, '2015-04-17 19:15:03', '2015-04-17 19:15:03'); INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('sai_copyright', 'deDE', '<a href="${project_url}" target="_blank" data-mce-href="${project_url}">${project}</a> © WebCraft Media 2015', 2, 2, '2015-04-17 19:15:03', '2015-04-17 19:15:03');
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('sai_copyright', 'enUS', '<a href="MYURL" target="_blank" data-mce-href="MYURL">MYPROJECTNAME</a> © WebCraft Media 2015', 2, 2, '2015-04-17 19:15:03', '2015-04-17 19:15:03'); INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('sai_copyright', 'enUS', '<a href="${project_url}" target="_blank" data-mce-href="${project_url}">${project}</a> © WebCraft Media 2015', 2, 2, '2015-04-17 19:15:03', '2015-04-17 19:15:03');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('sai_copyright', 'sai'); INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('sai_copyright', 'sai');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('sai_copyright', 'sai_default'); INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('sai_copyright', 'sai_default');
@ -792,10 +806,10 @@
DELETE FROM `system_text` WHERE id = 'sai_title'; DELETE FROM `system_text` WHERE id = 'sai_title';
DELETE FROM `system_text_tag` WHERE id = 'sai_title'; DELETE FROM `system_text_tag` WHERE id = 'sai_title';
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('sai_title', 'deDE', 'Admin Bereich', 1, 1, '2015-04-19 21:10:58', '2015-04-19 21:10:58'); INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('sai_title', 'deDE', '${project} - Admin Bereich', 1, 1, '2015-04-19 21:10:58', '2015-04-19 21:10:58');
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('sai_title', 'enUS', 'Admin area', 2, 1, '2015-04-19 21:09:54', '2015-04-19 21:09:54'); INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('sai_title', 'enUS', '${project} - Admin area', 2, 1, '2015-04-19 21:09:54', '2015-04-19 21:09:54');
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('sai_title', 'frFR', 'Domaine d\'administration', 3, 3, '2015-04-20 19:12:40', '2015-04-20 19:12:40'); INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('sai_title', 'frFR', '${project} - Domaine d\'administration', 3, 3, '2015-04-20 19:12:40', '2015-04-20 19:12:40');
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('sai_title', 'jaJA', 'アドミンーエリア', 1, 1, '2015-04-19 21:09:28', '2015-04-19 21:09:28'); INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('sai_title', 'jaJA', '${project} - アドミンーエリア', 1, 1, '2015-04-19 21:09:28', '2015-04-19 21:09:28');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('sai_title', 'sai'); INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('sai_title', 'sai');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('sai_title', 'sai_default'); INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('sai_title', 'sai_default');
@ -814,6 +828,7 @@
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_author', 'enUS', 'Author', 2, 2, '2015-04-18 13:36:35', '2015-04-18 13:36:35'); INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_author', 'enUS', 'Author', 2, 2, '2015-04-18 13:36:35', '2015-04-18 13:36:35');
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_author', 'frFR', 'Auteur', 3, 3, '2015-04-20 18:59:40', '2015-04-20 18:59:40'); INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_author', 'frFR', 'Auteur', 3, 3, '2015-04-20 18:59:40', '2015-04-20 18:59:40');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_author', 'sai_text'); INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_author', 'sai_text');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_author', 'sai_todo');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_author', 'table'); INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_author', 'table');
DELETE FROM `system_text` WHERE id = 'table_author_edit'; DELETE FROM `system_text` WHERE id = 'table_author_edit';
@ -1031,6 +1046,13 @@
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_value', 'enUS', 'Value', 2, 2, '2015-04-18 13:56:53', '2015-04-18 13:56:53'); INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_value', 'enUS', 'Value', 2, 2, '2015-04-18 13:56:53', '2015-04-18 13:56:53');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_value', 'sai_log'); INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_value', 'sai_log');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_value', 'table'); INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_value', 'table');
DELETE FROM `system_text` WHERE id = 'table_assignee';
DELETE FROM `system_text_tag` WHERE id = 'table_assignee';
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_assignee', 'deDE', 'Beauftragter', 2, 2, '2015-04-23 01:58:25', '2015-04-23 01:58:25');
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_assignee', 'enUS', 'Assignee', 2, 2, '2015-04-18 13:56:53', '2015-04-18 13:56:53');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_assignee', 'sai_todo');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_assignee', 'table');
-- Time -- Time

View File

@ -1,4 +1,4 @@
CREATE TABLE `system_todo_asign` ( CREATE TABLE `system_todo_assign` (
`todo` INT(10) NOT NULL, `todo` INT(10) NOT NULL,
`user` INT(10) UNSIGNED NOT NULL, `user` INT(10) UNSIGNED NOT NULL,
PRIMARY KEY (`todo`, `user`) PRIMARY KEY (`todo`, `user`)

View File

@ -1,10 +0,0 @@
<?php
namespace SYSTEM\DBD;
class system_todo_asign {
const NAME_PG = 'system.todo_asign';
const NAME_MYS = 'system_todo_asign';
const FIELD_TODO = 'todo';
const FIELD_USER = 'user';
}

View File

@ -0,0 +1,10 @@
<?php
namespace SYSTEM\DBD;
class system_todo_assign {
const NAME_PG = 'system.todo_assign';
const NAME_MYS = 'system_todo_assign';
const FIELD_TODO = 'todo';
const FIELD_USER = 'user';
}

View File

@ -50,6 +50,8 @@ function init_saimod_sys_todo_todoopen(){
}); });
}); });
register_open(); register_open();
register_assign();
register_deassign();
} }
function init_saimod_sys_todo_todoclose(){ function init_saimod_sys_todo_todoclose(){
$('#btn_edit').click(function(){ $('#btn_edit').click(function(){
@ -63,6 +65,8 @@ function init_saimod_sys_todo_todoclose(){
}); });
}); });
register_close(); register_close();
register_assign();
register_deassign();
} }
function init_saimod_sys_todo_new(){ function init_saimod_sys_todo_new(){
@ -108,3 +112,31 @@ function register_close(){
}); });
}); });
} }
function register_assign(){
$('#btn_assign').click(function(){
$.ajax({ type : 'GET',
url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=assign&todo='+$(this).attr('todo'),
success : function(data) {
if(data.status){
$('#btn_assign').hide();
$('#btn_deassign').show();
}
}
});
});
}
function register_deassign(){
$('#btn_deassign').click(function(){
$.ajax({ type : 'GET',
url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=deassign&todo='+$(this).attr('todo'),
success : function(data) {
if(data.status){
$('#btn_deassign').hide();
$('#btn_assign').show();
}
}
});
});
}

View File

@ -0,0 +1,12 @@
<?php
namespace SYSTEM\DBD;
class SYS_SAIMOD_TODO_ASSIGN extends \SYSTEM\DB\QP {
protected static function query(){
return new \SYSTEM\DB\QQuery(get_class(),
//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(?,?);'
);}}

View File

@ -1,11 +1,11 @@
<?php <?php
namespace SYSTEM\DBD; namespace SYSTEM\DBD;
class SYS_SAIMOD_TODO_TODO_COUNT extends \SYSTEM\DB\QQ { class SYS_SAIMOD_TODO_COUNT extends \SYSTEM\DB\QP {
protected static function query(){ protected static function query(){
return new \SYSTEM\DB\QQuery(get_class(), return new \SYSTEM\DB\QQuery(get_class(),
//pg //pg
'SELECT COUNT(*) as count FROM '.\SYSTEM\DBD\system_todo::NAME_PG.' WHERE '.\SYSTEM\DBD\system_todo::FIELD_STATE.'='.\SYSTEM\DBD\system_todo::FIELD_STATE_OPEN.';', 'SELECT COUNT(*) as count FROM '.\SYSTEM\DBD\system_todo::NAME_PG.' WHERE '.\SYSTEM\DBD\system_todo::FIELD_STATE.'=?;',
//mys //mys
'SELECT COUNT(*) as count FROM '.\SYSTEM\DBD\system_todo::NAME_MYS.' WHERE '.\SYSTEM\DBD\system_todo::FIELD_STATE.'='.\SYSTEM\DBD\system_todo::FIELD_STATE_OPEN.';' 'SELECT COUNT(*) as count FROM '.\SYSTEM\DBD\system_todo::NAME_MYS.' WHERE '.\SYSTEM\DBD\system_todo::FIELD_STATE.'=?;'
);}} );}}

View File

@ -0,0 +1,12 @@
<?php
namespace SYSTEM\DBD;
class SYS_SAIMOD_TODO_DEASSIGN extends \SYSTEM\DB\QP {
protected static function query(){
return new \SYSTEM\DB\QQuery(get_class(),
//pg
'TODO',
//mys
'DELETE FROM '.\SYSTEM\DBD\system_todo_assign::NAME_MYS.' WHERE '.\SYSTEM\DBD\system_todo_assign::FIELD_TODO.' = ? AND '.\SYSTEM\DBD\system_todo_assign::FIELD_USER.' = ?;'
);}}

View File

@ -1,11 +0,0 @@
<?php
namespace SYSTEM\DBD;
class SYS_SAIMOD_TODO_DOTO_COUNT extends \SYSTEM\DB\QQ {
protected static function query(){
return new \SYSTEM\DB\QQuery(get_class(),
//pg
'SELECT COUNT(*) as count FROM '.\SYSTEM\DBD\system_todo::NAME_PG.' WHERE '.\SYSTEM\DBD\system_todo::FIELD_STATE.'='.\SYSTEM\DBD\system_todo::FIELD_STATE_CLOSED.';',
//mys
'SELECT COUNT(*) as count FROM '.\SYSTEM\DBD\system_todo::NAME_MYS.' WHERE '.\SYSTEM\DBD\system_todo::FIELD_STATE.'='.\SYSTEM\DBD\system_todo::FIELD_STATE_CLOSED.';'
);}}

View File

@ -1,17 +0,0 @@
<?php
namespace SYSTEM\DBD;
class SYS_SAIMOD_TODO_DOTO_LIST extends \SYSTEM\DB\QQ {
protected static function query(){
return new \SYSTEM\DB\QQuery(get_class(),
//pg
'SELECT * FROM '.\SYSTEM\DBD\system_todo::NAME_PG.
' LEFT JOIN '.\SYSTEM\DBD\system_user::NAME_PG.' ON '.\SYSTEM\DBD\system_todo::NAME_PG.'."'.\SYSTEM\DBD\system_todo::FIELD_USER.'"='.\SYSTEM\DBD\system_user::NAME_PG.'."'.\SYSTEM\DBD\system_user::FIELD_ID.'"'.
' WHERE '.\SYSTEM\DBD\system_todo::FIELD_STATE.'='.\SYSTEM\DBD\system_todo::FIELD_STATE_CLOSED.
' ORDER BY '.\SYSTEM\DBD\system_todo::FIELD_TYPE.' DESC, '.\SYSTEM\DBD\system_todo::FIELD_COUNT.' DESC, '.\SYSTEM\DBD\system_todo::FIELD_TIME.' DESC LIMIT 100;',
//mys
'SELECT * FROM '.\SYSTEM\DBD\system_todo::NAME_MYS.
' LEFT JOIN '.\SYSTEM\DBD\system_user::NAME_MYS.' ON '.\SYSTEM\DBD\system_todo::FIELD_USER.'='.\SYSTEM\DBD\system_user::NAME_MYS.'.'.\SYSTEM\DBD\system_user::FIELD_ID.
' WHERE '.\SYSTEM\DBD\system_todo::FIELD_STATE.'='.\SYSTEM\DBD\system_todo::FIELD_STATE_CLOSED.
' ORDER BY '.\SYSTEM\DBD\system_todo::FIELD_TYPE.' DESC, '.\SYSTEM\DBD\system_todo::FIELD_COUNT.' DESC, '.\SYSTEM\DBD\system_todo::FIELD_TIME.' DESC LIMIT 100;'
);}}

View File

@ -12,14 +12,14 @@ class SYS_SAIMOD_TODO_LIST extends \SYSTEM\DB\QP {
' 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.','.
' creator.'.\SYSTEM\DBD\system_user::FIELD_ID.' as creator_id,'. ' creator.'.\SYSTEM\DBD\system_user::FIELD_ID.' as creator_id,'.
' creator.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.','. ' creator.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.','.
' asignee.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.' as asignee,'. ' assignee.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.' as assignee,'.
' asignee.'.\SYSTEM\DBD\system_user::FIELD_ID.' as asignee_id'. ' assignee.'.\SYSTEM\DBD\system_user::FIELD_ID.' as assignee_id'.
' FROM '.\SYSTEM\DBD\system_todo::NAME_MYS.' as todo'. ' FROM '.\SYSTEM\DBD\system_todo::NAME_MYS.' as todo'.
' LEFT JOIN '.\SYSTEM\DBD\system_todo_asign::NAME_MYS.' as asign ON todo.'.\SYSTEM\DBD\system_todo::FIELD_ID.'=asign.'.\SYSTEM\DBD\system_todo_asign::FIELD_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 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 asignee ON asign.'.\SYSTEM\DBD\system_todo_asign::FIELD_USER.'=asignee.'.\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.' = ?'. ' WHERE todo.'.\SYSTEM\DBD\system_todo::FIELD_STATE.' = ?'.
' ORDER BY case when asign.'.\SYSTEM\DBD\system_todo_asign::FIELD_USER.' = ? then 1 else 2 end'. ' ORDER BY case when assign.'.\SYSTEM\DBD\system_todo_assign::FIELD_USER.' = ? then 1 else 2 end'.
' LIMIT 100'. ' LIMIT 100'.
') as a'. ') as a'.
' GROUP BY a.todo_id'. ' GROUP BY a.todo_id'.

View File

@ -5,16 +5,17 @@ class SYS_SAIMOD_TODO_TODO extends \SYSTEM\DB\QP {
protected static function query(){ protected static function query(){
return new \SYSTEM\DB\QQuery(get_class(), return new \SYSTEM\DB\QQuery(get_class(),
//pg //pg
'SELECT * FROM '.\SYSTEM\DBD\system_todo::NAME_PG. 'TODO',
' LEFT JOIN '.\SYSTEM\DBD\system_user::NAME_PG.
' ON '.\SYSTEM\DBD\system_todo::NAME_PG.'.'.\SYSTEM\DBD\system_todo::FIELD_USER.
' = '.\SYSTEM\DBD\system_user::NAME_PG.'.'.\SYSTEM\DBD\system_user::FIELD_ID.
' WHERE '.\SYSTEM\DBD\system_todo::NAME_PG.'."'.\SYSTEM\DBD\system_todo::FIELD_ID.'" = $1;',
//mys //mys
'SELECT * FROM '.\SYSTEM\DBD\system_todo::NAME_MYS. 'SELECT * FROM('.
' LEFT JOIN '.\SYSTEM\DBD\system_user::NAME_MYS. ' SELECT todo.*, assignee.'.\SYSTEM\DBD\system_user::FIELD_ID.' as assignee_id, assignee.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.' as assignee, creator.'.\SYSTEM\DBD\system_user::FIELD_USERNAME.' as username'.
' ON '.\SYSTEM\DBD\system_todo::NAME_MYS.'.'.\SYSTEM\DBD\system_todo::FIELD_USER. ' FROM '.\SYSTEM\DBD\system_todo::NAME_MYS.' as todo'.
' = '.\SYSTEM\DBD\system_user::NAME_MYS.'.'.\SYSTEM\DBD\system_user::FIELD_ID. ' 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.
' WHERE '.\SYSTEM\DBD\system_todo::NAME_MYS.'.'.\SYSTEM\DBD\system_todo::FIELD_ID.' = ?;' ' 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_ID.' = ?'.
' ORDER BY case when assign.'.\SYSTEM\DBD\system_todo_assign::FIELD_USER.' = ? then 1 else 2 end'.
') as a'.
' GROUP BY '.\SYSTEM\DBD\system_todo::FIELD_ID.';'
);}} );}}

View File

@ -16,6 +16,12 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule {
throw new \SYSTEM\LOG\ERROR('Problem with your TodoStats class: '.$stats);} throw new \SYSTEM\LOG\ERROR('Problem with your TodoStats class: '.$stats);}
array_push(self::$stats,$stats);} array_push(self::$stats,$stats);}
public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_assign($todo){
\SYSTEM\DBD\SYS_SAIMOD_TODO_ASSIGN::QI(array($todo,\SYSTEM\SECURITY\Security::getUser()->id));
return \SYSTEM\LOG\JsonResult::ok();}
public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_deassign($todo){
\SYSTEM\DBD\SYS_SAIMOD_TODO_DEASSIGN::QI(array($todo,\SYSTEM\SECURITY\Security::getUser()->id));
return \SYSTEM\LOG\JsonResult::ok();}
public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_close($todo){ public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_close($todo){
\SYSTEM\DBD\SYS_SAIMOD_TODO_CLOSE::QI(array($todo)); \SYSTEM\DBD\SYS_SAIMOD_TODO_CLOSE::QI(array($todo));
return \SYSTEM\LOG\JsonResult::ok();} return \SYSTEM\LOG\JsonResult::ok();}
@ -38,19 +44,23 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule {
} }
public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_todolist(){ 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_dotolist(){
return self::generate_list(\SYSTEM\DBD\system_todo::FIELD_STATE_CLOSED);}
private static function generate_list($state){
$result = $result_user = ''; $result = $result_user = '';
$userid = \SYSTEM\SECURITY\Security::getUser()->id; $userid = \SYSTEM\SECURITY\Security::getUser()->id;
$res = \SYSTEM\DBD\SYS_SAIMOD_TODO_LIST::QQ(array(\SYSTEM\DBD\system_todo::FIELD_STATE_OPEN,$userid)); $res = \SYSTEM\DBD\SYS_SAIMOD_TODO_LIST::QQ(array($state,$userid));
$count = \SYSTEM\DBD\SYS_SAIMOD_TODO_TODO_COUNT::Q1()['count'];
while($row = $res->next()){ while($row = $res->next()){
$row['class_row'] = self::trclass($row['type'],$row['class'],$row['asignee_id'],$userid); $row['class_row'] = self::trclass($row['type'],$row['class'],$row['assignee_id'],$userid);
$row['time_elapsed'] = \SYSTEM\time::time_ago_string(strtotime($row['time'])); $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']); $row['state_string'] = self::state($row['count']);
$row['state_btn'] = self::statebtn($row['count']); $row['state_btn'] = self::statebtn($row['count']);
$row['message'] = htmlspecialchars($row['message']); $row['message'] = htmlspecialchars($row['message']);
$row['request_uri'] = htmlspecialchars($row['request_uri']); $row['request_uri'] = htmlspecialchars($row['request_uri']);
$row['openclose'] = 'close'; $row['openclose'] = $state == \SYSTEM\DBD\system_todo::FIELD_STATE_OPEN ? 'close' : 'open';
if($row['type'] == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER){ if($row['type'] == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER){
$row['message'] = str_replace("\n", '<br/>', $row['message']); $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); $result_user .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_user_list_element.tpl'), $row);
@ -58,33 +68,7 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule {
$result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_list_element.tpl'), $row); $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_list_element.tpl'), $row);
} }
} }
$vars = array(); $count = \SYSTEM\DBD\SYS_SAIMOD_TODO_COUNT::Q1(array($state))['count'];
$vars['todo_user_list_elements'] = $result_user;
$vars['todo_list_elements'] = $result;
$vars['count'] = $count;
$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);
}
public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_dotolist(){
$result = $result_user = '';
$res = \SYSTEM\DBD\SYS_SAIMOD_TODO_DOTO_LIST::QQ();
$count = \SYSTEM\DBD\SYS_SAIMOD_TODO_DOTO_COUNT::Q1()['count'];
while($row = $res->next()){
$row['class_row'] = self::trclass($row['type'],$row['class']);
$row['time_elapsed'] = \SYSTEM\time::time_ago_string(strtotime($row['time']));
$row['state_string'] = self::state($row['count']);
$row['state_btn'] = self::statebtn($row['count']);
$row['message'] = htmlspecialchars($row['message']);
$row['request_uri'] = htmlspecialchars($row['request_uri']);
$row['openclose'] = 'open';
if($row['type'] == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER){
$row['message'] = str_replace("\r", '<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);
}
}
$vars = array(); $vars = array();
$vars['todo_user_list_elements'] = $result_user; $vars['todo_user_list_elements'] = $result_user;
$vars['todo_list_elements'] = $result; $vars['todo_list_elements'] = $result;
@ -130,10 +114,10 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule {
return '<input type="submit" class="btn-danger" value="reopen">';} return '<input type="submit" class="btn-danger" value="reopen">';}
return '<input type="submit" class="btn-danger" value="close">';} return '<input type="submit" class="btn-danger" value="close">';}
private static function trclass($type,$class,$asignee,$userid){ private static function trclass($type,$class,$assignee,$userid){
if($type == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER){ if($type == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER){
if($asignee == $userid){ return 'danger';} if($assignee == $userid){ return 'danger';}
if($asignee){ return 'warning';} if($assignee){ return 'warning';}
return 'success'; return 'success';
} }
switch($class){ switch($class){
@ -143,7 +127,7 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule {
return 'info'; return 'info';
case 'SYSTEM\LOG\ERROR': case 'ERROR': case 'Exception': case 'SYSTEM\LOG\ERROR_EXCEPTION': case 'SYSTEM\LOG\ERROR': case 'ERROR': case 'Exception': case 'SYSTEM\LOG\ERROR_EXCEPTION':
case 'ErrorException': case 'SYSTEM\LOG\SHUTDOWN_EXCEPTION': case 'ErrorException': case 'SYSTEM\LOG\SHUTDOWN_EXCEPTION':
return 'error'; return 'danger';
case 'SYSTEM\LOG\WARNING': case 'WARNING': case 'SYSTEM\LOG\WARNING': case 'WARNING':
return 'warning'; return 'warning';
default: default:
@ -160,14 +144,16 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule {
return \SYSTEM\LOG\JsonResult::ok();} return \SYSTEM\LOG\JsonResult::ok();}
public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_todo($todo){ public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_todo($todo){
$vars = \SYSTEM\DBD\SYS_SAIMOD_TODO_TODO::Q1(array($todo)); $userid = \SYSTEM\SECURITY\Security::getUser()->id;
$vars = \SYSTEM\DBD\SYS_SAIMOD_TODO_TODO::Q1(array($todo,$userid));
$vars = array_merge($vars,\SYSTEM\PAGE\text::tag(\SYSTEM\DBD\system_text::TAG_SAI_TODO)); $vars = array_merge($vars,\SYSTEM\PAGE\text::tag(\SYSTEM\DBD\system_text::TAG_SAI_TODO));
$vars['trace'] = implode('</br>', array_slice(explode('#', $vars['trace']), 1, -1)); $vars['trace'] = implode('</br>', array_slice(explode('#', $vars['trace']), 1, -1));
$vars['display_assign'] = $vars['assignee_id'] != $userid ? '' : 'display: none;';
$vars['display_deassign'] = $vars['assignee_id'] == $userid ? '' : 'display: none;';
return $vars[\SYSTEM\DBD\system_todo::FIELD_TYPE] == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER ? return $vars[\SYSTEM\DBD\system_todo::FIELD_TYPE] == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER ?
\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl'), $vars) : \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl'), $vars) :
\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl'), $vars);} \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl'), $vars);}
//public static function html_li_menu(){return '<li><a id="menu_todo" href="#!todo">${sai_menu_todo}</a></li>';}
public static function html_li_menu(){return '<li><a id="menu_todo" href="#!todo"><span class="glyphicon glyphicon-list" aria-hidden="true"></span></a></li>';} public static function html_li_menu(){return '<li><a id="menu_todo" href="#!todo"><span class="glyphicon glyphicon-list" aria-hidden="true"></span></a></li>';}
public static function right_public(){return false;} public static function right_public(){return false;}
public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);} public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}

View File

@ -13,4 +13,6 @@
<button id="btn_back" onClick="system.load('todo');" class="btn btn-sm btn-success" style="margin-right: 15px; height: 32px; font-size: 13px; float: left;"><span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> ${basic_back}</button> <button id="btn_back" onClick="system.load('todo');" class="btn btn-sm btn-success" style="margin-right: 15px; height: 32px; font-size: 13px; float: left;"><span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> ${basic_back}</button>
<button id="btn_edit" class="btn btn-sm btn-danger" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> ${basic_edit}</button> <button id="btn_edit" class="btn btn-sm btn-danger" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> ${basic_edit}</button>
<button id="btn_close" class="btn btn-sm btn-danger" style="display: none; margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}"><span class="glyphicon glyphicon-remove-sign" aria-hidden="true"></span> ${basic_close}</button> <button id="btn_close" class="btn btn-sm btn-danger" style="display: none; margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}"><span class="glyphicon glyphicon-remove-sign" aria-hidden="true"></span> ${basic_close}</button>
<button id="btn_open" class="btn btn-sm btn-danger" style="display: none; margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span> ${basic_open}</button> <button id="btn_open" class="btn btn-sm btn-danger" style="display: none; margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span> ${basic_open}</button>
<button id="btn_assign" class="btn btn-sm btn-danger" style="${display_assign} margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span> ${basic_assign}</button>
<button id="btn_deassign" class="btn btn-sm btn-success" style="${display_deassign} margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}"><span class="glyphicon glyphicon-remove-sign" aria-hidden="true"></span> ${basic_deassign}</button>

View File

@ -6,7 +6,7 @@
<th>${time_ago}</th> <th>${time_ago}</th>
<th>${table_message}</th> <th>${table_message}</th>
<th>${table_author}</th> <th>${table_author}</th>
<th>${table_asignee}</th> <th>${table_assignee}</th>
</tr> </tr>
${todo_user_list_elements} ${todo_user_list_elements}
</table> </table>

View File

@ -2,5 +2,5 @@
<td>${time_elapsed}</td> <td>${time_elapsed}</td>
<td style="word-break: break-all;">${message}</td> <td style="word-break: break-all;">${message}</td>
<td>${username}</td> <td>${username}</td>
<td>${asignee}</td> <td>${assignee}</td>
</tr> </tr>

View File

@ -59,7 +59,9 @@ class default_page extends \SYSTEM\PAGE\Page {
$vars['menu_start'] = self::menu_start(); $vars['menu_start'] = self::menu_start();
$vars['menu_sys'] = self::menu_sys(); $vars['menu_sys'] = self::menu_sys();
$vars['menu_proj'] = self::menu_proj(); $vars['menu_proj'] = self::menu_proj();
$vars = array_merge($vars,\SYSTEM\PAGE\text::tag(\SYSTEM\DBD\system_text::TAG_SAI_DEFAULT)); $vars = array_merge($vars,\SYSTEM\PAGE\text::tag(\SYSTEM\DBD\system_text::TAG_SAI_DEFAULT),
array( 'project' => \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT),
'project_url' => \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL)));
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'page/tpl/sai.tpl'), $vars); return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'page/tpl/sai.tpl'), $vars);
} }
} }