fixed merge problem, pg adjustments, pg schema
This commit is contained in:
parent
b42176ed8a
commit
a298181219
@ -1,14 +1,24 @@
|
|||||||
CREATE TABLE `system_todo` (
|
CREATE TABLE `system_todo` (
|
||||||
`ID` INT(10) NOT NULL AUTO_INCREMENT,
|
`ID` INT(10) NOT NULL AUTO_INCREMENT,
|
||||||
|
`class` TEXT NOT NULL,
|
||||||
|
`message` TEXT NOT NULL,
|
||||||
|
`code` INT(10) UNSIGNED NOT NULL,
|
||||||
|
`file` TEXT NOT NULL,
|
||||||
|
`line` INT(11) NOT NULL,
|
||||||
|
`trace` TEXT NOT NULL,
|
||||||
|
`ip` TEXT NOT NULL,
|
||||||
|
`querytime` DOUBLE NOT NULL,
|
||||||
`time` DATETIME NOT NULL,
|
`time` DATETIME NOT NULL,
|
||||||
`author` INT(11) NOT NULL,
|
`server_name` CHAR(255) NOT NULL,
|
||||||
`type` INT(11) NOT NULL,
|
`server_port` INT(10) UNSIGNED NOT NULL,
|
||||||
`state` INT(11) NOT NULL,
|
`request_uri` CHAR(255) NOT NULL,
|
||||||
`msg_1` TEXT NOT NULL,
|
`post` TEXT NOT NULL,
|
||||||
`msg_2` TEXT NULL,
|
`http_referer` CHAR(255) NOT NULL,
|
||||||
`msg_3` TEXT NULL,
|
`http_user_agent` TEXT NOT NULL,
|
||||||
`msg_4` TEXT NULL,
|
`user` INT(10) UNSIGNED NOT NULL,
|
||||||
`msg_5` TEXT NULL,
|
`thrown` BIT(1) NOT NULL,
|
||||||
|
`type` INT(11) NOT NULL DEFAULT '0',
|
||||||
|
`count` INT(11) NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ID`)
|
PRIMARY KEY (`ID`)
|
||||||
)
|
)
|
||||||
COLLATE='utf8_general_ci'
|
COLLATE='utf8_general_ci'
|
||||||
|
|||||||
17
dbd/sql/pg/schema/system_cron.sql
Normal file
17
dbd/sql/pg/schema/system_cron.sql
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
CREATE TABLE system.cron
|
||||||
|
(
|
||||||
|
"class" character varying(255) NOT NULL,
|
||||||
|
"min" integer DEFAULT NULL,
|
||||||
|
"hour" integer DEFAULT NULL,
|
||||||
|
"day" integer DEFAULT NULL,
|
||||||
|
"day_week" integer DEFAULT NULL,
|
||||||
|
"month" integer DEFAULT NULL,
|
||||||
|
"last_run" timestamp with time zone DEFAULT NULL,
|
||||||
|
"status" integer NOT NULL DEFAULT 0,
|
||||||
|
PRIMARY KEY ("class")
|
||||||
|
)
|
||||||
|
WITH (
|
||||||
|
OIDS=FALSE
|
||||||
|
);
|
||||||
|
ALTER TABLE system.log
|
||||||
|
OWNER TO dasense;
|
||||||
30
dbd/sql/pg/schema/system_log.sql
Normal file
30
dbd/sql/pg/schema/system_log.sql
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
CREATE TABLE system.log
|
||||||
|
(
|
||||||
|
"ID" integer NOT NULL DEFAULT nextval('system."sys_log_ID_seq"'::regclass),
|
||||||
|
class text NOT NULL,
|
||||||
|
message text NOT NULL,
|
||||||
|
code integer NOT NULL,
|
||||||
|
file text NOT NULL,
|
||||||
|
line integer NOT NULL,
|
||||||
|
trace text NOT NULL,
|
||||||
|
ip text NOT NULL,
|
||||||
|
querytime double precision NOT NULL,
|
||||||
|
"time" timestamp with time zone NOT NULL DEFAULT now(),
|
||||||
|
server_name character varying(255),
|
||||||
|
server_port integer,
|
||||||
|
request_uri character varying(512),
|
||||||
|
post text,
|
||||||
|
http_referer character varying(255),
|
||||||
|
http_user_agent text,
|
||||||
|
"user" integer,
|
||||||
|
thrown integer,
|
||||||
|
CONSTRAINT system_log_pk_id PRIMARY KEY ("ID"),
|
||||||
|
CONSTRAINT system_log_fk_user FOREIGN KEY ("user")
|
||||||
|
REFERENCES system."user" (id) MATCH SIMPLE
|
||||||
|
ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
)
|
||||||
|
WITH (
|
||||||
|
OIDS=FALSE
|
||||||
|
);
|
||||||
|
ALTER TABLE system.log
|
||||||
|
OWNER TO dasense;
|
||||||
@ -1,19 +0,0 @@
|
|||||||
CREATE TABLE system.sys_log
|
|
||||||
(
|
|
||||||
"ID" integer NOT NULL DEFAULT nextval('system."sys_log_ID_seq"'::regclass),
|
|
||||||
class text NOT NULL,
|
|
||||||
message text NOT NULL,
|
|
||||||
code integer NOT NULL,
|
|
||||||
file text NOT NULL,
|
|
||||||
line integer NOT NULL,
|
|
||||||
trace text NOT NULL,
|
|
||||||
ip text NOT NULL,
|
|
||||||
querytime double precision NOT NULL,
|
|
||||||
"time" timestamp with time zone NOT NULL DEFAULT now()
|
|
||||||
)
|
|
||||||
WITH (
|
|
||||||
OIDS=FALSE
|
|
||||||
);
|
|
||||||
ALTER TABLE system.sys_log
|
|
||||||
OWNER TO username;
|
|
||||||
|
|
||||||
@ -1,19 +1,32 @@
|
|||||||
CREATE TABLE system.todo
|
CREATE TABLE system.todo
|
||||||
(
|
(
|
||||||
"ID" integer NOT NULL,
|
"ID" integer NOT NULL,
|
||||||
|
"class" text NOT NULL,
|
||||||
|
"message" text NOT NULL,
|
||||||
|
"code" integer NOT NULL,
|
||||||
|
"file" text NOT NULL,
|
||||||
|
"line" integer NOT NULL,
|
||||||
|
"trace" text NOT NULL,
|
||||||
|
"ip" text NOT NULL,
|
||||||
|
"querytime" double precision NOT NULL,
|
||||||
"time" timestamp with time zone NOT NULL,
|
"time" timestamp with time zone NOT NULL,
|
||||||
author integer NOT NULL,
|
server_name character varying(255),
|
||||||
type integer NOT NULL,
|
server_port integer,
|
||||||
state integer NOT NULL,
|
request_uri character varying(512),
|
||||||
msg_1 text NOT NULL,
|
post text,
|
||||||
msg_2 text,
|
http_referer character varying(255),
|
||||||
msg_3 text,
|
http_user_agent text,
|
||||||
msg_4 text,
|
"user" integer,
|
||||||
msg_5 text,
|
thrown integer,
|
||||||
CONSTRAINT system_todo_pk_id PRIMARY KEY ("ID")
|
"type" integer NOT NULL DEFAULT 0,
|
||||||
|
"count" integer NOT NULL DEFAULT 0,
|
||||||
|
CONSTRAINT system_todo_pk_id PRIMARY KEY ("ID"),
|
||||||
|
CONSTRAINT system_todo_fk_user FOREIGN KEY ("user")
|
||||||
|
REFERENCES system."user" (id) MATCH SIMPLE
|
||||||
|
ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
)
|
)
|
||||||
WITH (
|
WITH (
|
||||||
OIDS=FALSE
|
OIDS=FALSE
|
||||||
);
|
);
|
||||||
ALTER TABLE system.todo
|
ALTER TABLE system.todo
|
||||||
OWNER TO username;
|
OWNER TO dasense;
|
||||||
@ -5,7 +5,7 @@ class SYS_SAIMOD_CRON extends \SYSTEM\DB\QQ {
|
|||||||
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_cron::NAME_PG.' ORDER BY class;',
|
||||||
//mys
|
//mys
|
||||||
'SELECT * FROM system_cron ORDER BY class;'
|
'SELECT * FROM '.\SYSTEM\DBD\system_cron::NAME_MYS.' ORDER BY class;'
|
||||||
);}}
|
);}}
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
<td><input type="text" id="new_cron_day_week" placeholder="day_week" style="width: 140px;"></td>
|
<td><input type="text" id="new_cron_day_week" placeholder="day_week" style="width: 140px;"></td>
|
||||||
<td><input type="text" id="new_cron_month" placeholder="month" style="width: 140px;"></td>
|
<td><input type="text" id="new_cron_month" placeholder="month" style="width: 140px;"></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
<td></td>
|
||||||
<td><button type="button" class="btn-small btn-success" id="addcron">Add</button></td>
|
<td><button type="button" class="btn-small btn-success" id="addcron">Add</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@ -4,8 +4,7 @@ namespace SYSTEM\SAI;
|
|||||||
class saimod_sys_locale extends \SYSTEM\SAI\SaiModule {
|
class saimod_sys_locale extends \SYSTEM\SAI\SaiModule {
|
||||||
|
|
||||||
public static function getLanguages(){
|
public static function getLanguages(){
|
||||||
return \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS);
|
return \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS);}
|
||||||
}
|
|
||||||
|
|
||||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_locale(){
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_locale(){
|
||||||
$vars = array();
|
$vars = array();
|
||||||
@ -34,22 +33,30 @@ class saimod_sys_locale extends \SYSTEM\SAI\SaiModule {
|
|||||||
|
|
||||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_locale_action_load($lang, $group){
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_locale_action_load($lang, $group){
|
||||||
$con = new \SYSTEM\DB\Connection();
|
$con = new \SYSTEM\DB\Connection();
|
||||||
$query = 'SELECT id, '.$lang.' FROM '.\SYSTEM\DBD\system_locale_string::NAME_MYS.' WHERE category='.$group.' ORDER BY category ASC;';
|
if(\SYSTEM\system::isSystemDbInfoPG()){
|
||||||
$res = $con->query($query);
|
$query = 'SELECT id, "'.$lang.'" FROM '.\SYSTEM\DBD\system_locale_string::NAME_PG.' WHERE category='.$group.' ORDER BY category ASC;';
|
||||||
$entries = '';
|
} else {
|
||||||
$temparr = array();
|
$query = 'SELECT id, '.$lang.' FROM '.\SYSTEM\DBD\system_locale_string::NAME_MYS.' WHERE category='.$group.' ORDER BY category ASC;';
|
||||||
while($r = $res->next()){
|
}
|
||||||
$temparr['lang'] = $r[$lang];
|
$res = $con->query($query);
|
||||||
$temparr['id'] = $r['id'];
|
$entries = '';
|
||||||
$entries .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_locale/tpl/entry.tpl'), $temparr);
|
$temparr = array();
|
||||||
}
|
while($r = $res->next()){
|
||||||
|
$temparr['lang'] = $r[$lang];
|
||||||
|
$temparr['id'] = $r['id'];
|
||||||
|
$entries .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_locale/tpl/entry.tpl'), $temparr);
|
||||||
|
}
|
||||||
return $entries;
|
return $entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_locale_action_singleload($id, $lang){
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_locale_action_singleload($id, $lang){
|
||||||
$con = new \SYSTEM\DB\Connection();
|
$con = new \SYSTEM\DB\Connection();
|
||||||
$result = "";
|
$result = "";
|
||||||
$query = 'SELECT '.$lang.' FROM `'.\SYSTEM\DBD\system_locale_string::NAME_MYS.'` WHERE id=\''.$id.'\' ORDER BY category ASC;';
|
if(\SYSTEM\system::isSystemDbInfoPG()){
|
||||||
|
$query = 'SELECT "'.$lang.'" FROM '.\SYSTEM\DBD\system_locale_string::NAME_PG.' WHERE id=\''.$id.'\' ORDER BY category ASC;';
|
||||||
|
} else {
|
||||||
|
$query = 'SELECT '.$lang.' FROM `'.\SYSTEM\DBD\system_locale_string::NAME_MYS.'` WHERE id=\''.$id.'\' ORDER BY category ASC;';
|
||||||
|
}
|
||||||
$res = $con->query($query);
|
$res = $con->query($query);
|
||||||
$entries = '';
|
$entries = '';
|
||||||
$temparr = array();
|
$temparr = array();
|
||||||
|
|||||||
@ -19,8 +19,6 @@ class RIGHTS {
|
|||||||
|
|
||||||
const SYS_SAI_CRON = 25;
|
const SYS_SAI_CRON = 25;
|
||||||
|
|
||||||
const SYS_SAI_CRON = 25;
|
|
||||||
|
|
||||||
//Reserve first 1000 ids.
|
//Reserve first 1000 ids.
|
||||||
const RESERVED_SYS_0_999 = 999;
|
const RESERVED_SYS_0_999 = 999;
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user