diff --git a/app/app/services/audit.js b/app/app/services/audit.js index 6de40fd7..50d37510 100644 --- a/app/app/services/audit.js +++ b/app/app/services/audit.js @@ -63,7 +63,7 @@ export default Ember.Service.extend({ "administrator": user.admin, company: { id: self.get('appMeta.orgId'), - name: self.get('appMeta.title').string, + name: self.get('appMeta.title'), "domain": netUtil.getSubdomain(), "version": self.get('appMeta.version') } diff --git a/app/app/styles/view/layout.scss b/app/app/styles/view/layout.scss index 2d8476fc..1fc0f236 100644 --- a/app/app/styles/view/layout.scss +++ b/app/app/styles/view/layout.scss @@ -26,7 +26,7 @@ vertical-align: middle; } > .login { - padding: 15px 0 0 0; + padding: 0; font-size: 1rem; display: inline-block; > a { @@ -125,4 +125,4 @@ font-size: 0.8rem; color: $color-gray; } -} \ No newline at end of file +} diff --git a/core/api/request/document.go b/core/api/request/document.go index db112c0b..63fe0f95 100644 --- a/core/api/request/document.go +++ b/core/api/request/document.go @@ -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;` diff --git a/core/database/scripts/autobuild/db_00001.sql b/core/database/scripts/autobuild/db_00001.sql new file mode 100644 index 00000000..d01f0b42 --- /dev/null +++ b/core/database/scripts/autobuild/db_00001.sql @@ -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; diff --git a/core/product.go b/core/product.go index 8159d862..ddcfee0d 100644 --- a/core/product.go +++ b/core/product.go @@ -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 }