1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-22 14:49:42 +02:00

Merge branch 'master' into github-tidy-up

This commit is contained in:
Elliott Stoneham 2016-08-02 10:33:44 +01:00
commit 678ceedfe1
5 changed files with 30 additions and 9 deletions

View file

@ -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) {
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
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`
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)
return
}
//SELECT CONVERT_TZ(a.created, @@session.time_zone, '+00:00') as
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
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')
ORDER BY a.created DESC;`

View 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;

View file

@ -9,7 +9,6 @@
//
// https://documize.com
// Package extensions represents Enterprise Edition capabilities.
package core
import "fmt"
@ -31,7 +30,7 @@ func Product() (p ProdInfo) {
p.Patch = "0"
p.Version = fmt.Sprintf("%s.%s.%s", p.Major, p.Minor, p.Patch)
p.Edition = "Community"
p.Title = fmt.Sprintf("Documize %s Edition", p.Edition)
p.Title = fmt.Sprintf("%s Edition", p.Edition)
return p
}