mirror of
https://github.com/documize/community.git
synced 2025-07-19 21:29:42 +02:00
Merge branch 'master' into github-tidy-up
This commit is contained in:
commit
678ceedfe1
5 changed files with 30 additions and 9 deletions
|
@ -63,7 +63,7 @@ export default Ember.Service.extend({
|
||||||
"administrator": user.admin,
|
"administrator": user.admin,
|
||||||
company: {
|
company: {
|
||||||
id: self.get('appMeta.orgId'),
|
id: self.get('appMeta.orgId'),
|
||||||
name: self.get('appMeta.title').string,
|
name: self.get('appMeta.title'),
|
||||||
"domain": netUtil.getSubdomain(),
|
"domain": netUtil.getSubdomain(),
|
||||||
"version": self.get('appMeta.version')
|
"version": self.get('appMeta.version')
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
> .login {
|
> .login {
|
||||||
padding: 15px 0 0 0;
|
padding: 0;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
> a {
|
> a {
|
||||||
|
|
|
@ -77,9 +77,12 @@ func (p *Persister) GetDocument(id string) (document entity.Document, err error)
|
||||||
func (p *Persister) GetDocumentMeta(id string) (meta entity.DocumentMeta, err error) {
|
func (p *Persister) GetDocumentMeta(id string) (meta entity.DocumentMeta, err error) {
|
||||||
err = nil
|
err = nil
|
||||||
|
|
||||||
sqlViewers := `SELECT CONVERT_TZ(MAX(a.created), @@session.time_zone, '+00:00') as created, a.userid, u.firstname, u.lastname
|
sqlViewers := `SELECT CONVERT_TZ(MAX(a.created), @@session.time_zone, '+00:00') as created,
|
||||||
|
IFNULL(a.userid, '') AS userid, IFNULL(u.firstname, '') AS firstname, IFNULL(u.lastname, '') AS lastname
|
||||||
FROM audit a LEFT JOIN user u ON a.userid=u.refid
|
FROM audit a LEFT JOIN user u ON a.userid=u.refid
|
||||||
WHERE a.orgid=? AND a.documentid=? AND a.userid != '0' AND action='get-document'
|
WHERE a.orgid=? AND a.documentid=?
|
||||||
|
AND a.userid != '0' AND a.userid != ''
|
||||||
|
AND action='get-document'
|
||||||
GROUP BY a.userid ORDER BY MAX(a.created) DESC`
|
GROUP BY a.userid ORDER BY MAX(a.created) DESC`
|
||||||
|
|
||||||
err = Db.Select(&meta.Viewers, sqlViewers, p.Context.OrgID, id)
|
err = Db.Select(&meta.Viewers, sqlViewers, p.Context.OrgID, id)
|
||||||
|
@ -88,11 +91,12 @@ func (p *Persister) GetDocumentMeta(id string) (meta entity.DocumentMeta, err er
|
||||||
log.Error(fmt.Sprintf("Unable to execute select GetDocumentMeta.viewers %s", id), err)
|
log.Error(fmt.Sprintf("Unable to execute select GetDocumentMeta.viewers %s", id), err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//SELECT CONVERT_TZ(a.created, @@session.time_zone, '+00:00') as
|
//SELECT CONVERT_TZ(a.created, @@session.time_zone, '+00:00') as
|
||||||
sqlEdits := `SELECT CONVERT_TZ(a.created, @@session.time_zone, '+00:00') as created,
|
sqlEdits := `SELECT CONVERT_TZ(a.created, @@session.time_zone, '+00:00') as created,
|
||||||
a.action, a.userid, u.firstname, u.lastname, a.pageid
|
IFNULL(a.action, '') AS action, IFNULL(a.userid, '') AS userid, IFNULL(u.firstname, '') AS firstname, IFNULL(u.lastname, '') AS lastname, IFNULL(a.pageid, '') AS pageid
|
||||||
FROM audit a LEFT JOIN user u ON a.userid=u.refid
|
FROM audit a LEFT JOIN user u ON a.userid=u.refid
|
||||||
WHERE a.orgid=? AND a.documentid=? AND a.userid != '0'
|
WHERE a.orgid=? AND a.documentid=? AND a.userid != '0' AND a.userid != ''
|
||||||
AND (a.action='update-page' OR a.action='add-page' OR a.action='remove-page')
|
AND (a.action='update-page' OR a.action='add-page' OR a.action='remove-page')
|
||||||
ORDER BY a.created DESC;`
|
ORDER BY a.created DESC;`
|
||||||
|
|
||||||
|
|
18
core/database/scripts/autobuild/db_00001.sql
Normal file
18
core/database/scripts/autobuild/db_00001.sql
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `share`;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `share` (
|
||||||
|
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`orgid` CHAR(16) NOT NULL COLLATE utf8_bin,
|
||||||
|
`documentid` CHAR(16) NOT NULL COLLATE utf8_bin,
|
||||||
|
`userid` CHAR(16) DEFAULT '' COLLATE utf8_bin,
|
||||||
|
`email` NVARCHAR(250) NOT NULL DEFAULT '',
|
||||||
|
`message` NVARCHAR(500) NOT NULL DEFAULT '',
|
||||||
|
`viewed` VARCHAR(500) NOT NULL DEFAULT '',
|
||||||
|
`secret` VARCHAR(200) NOT NULL DEFAULT '',
|
||||||
|
`expires` CHAR(16) DEFAULT '' COLLATE utf8_bin,
|
||||||
|
`active` BOOL NOT NULL DEFAULT 1,
|
||||||
|
`created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
CONSTRAINT pk_id PRIMARY KEY (id))
|
||||||
|
DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
|
||||||
|
ENGINE = InnoDB;
|
|
@ -9,7 +9,6 @@
|
||||||
//
|
//
|
||||||
// https://documize.com
|
// https://documize.com
|
||||||
|
|
||||||
// Package extensions represents Enterprise Edition capabilities.
|
|
||||||
package core
|
package core
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
@ -31,7 +30,7 @@ func Product() (p ProdInfo) {
|
||||||
p.Patch = "0"
|
p.Patch = "0"
|
||||||
p.Version = fmt.Sprintf("%s.%s.%s", p.Major, p.Minor, p.Patch)
|
p.Version = fmt.Sprintf("%s.%s.%s", p.Major, p.Minor, p.Patch)
|
||||||
p.Edition = "Community"
|
p.Edition = "Community"
|
||||||
p.Title = fmt.Sprintf("Documize %s Edition", p.Edition)
|
p.Title = fmt.Sprintf("%s Edition", p.Edition)
|
||||||
|
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue