Commit aa222792 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge remote-tracking branch 'origin/bug_4253'

# Conflicts:
#	extension/qfq/sql/formEditor.sql
parents 774f2fa3 b68612a7
...@@ -59,6 +59,19 @@ $UPDATE_ARRAY = array( ...@@ -59,6 +59,19 @@ $UPDATE_ARRAY = array(
"CREATE TABLE IF NOT EXISTS `Period` (`id` INT(11) NOT NULL AUTO_INCREMENT, `start` DATETIME NOT NULL, `name` VARCHAR(255) NOT NULL, `modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `created` DATETIME NOT NULL, PRIMARY KEY (`id`), KEY `start` (`start`)) ENGINE = InnoDB DEFAULT CHARSET = utf8 AUTO_INCREMENT = 0;", "CREATE TABLE IF NOT EXISTS `Period` (`id` INT(11) NOT NULL AUTO_INCREMENT, `start` DATETIME NOT NULL, `name` VARCHAR(255) NOT NULL, `modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `created` DATETIME NOT NULL, PRIMARY KEY (`id`), KEY `start` (`start`)) ENGINE = InnoDB DEFAULT CHARSET = utf8 AUTO_INCREMENT = 0;",
"INSERT INTO Period (start, name, created) VALUES (NOW(), 'dummy', NOW());" "INSERT INTO Period (start, name, created) VALUES (NOW(), 'dummy', NOW());"
], ],
'0.19.4' => [
"ALTER TABLE `Form` ADD `parameterL1` TEXT NOT NULL AFTER `parameter`",
"ALTER TABLE `Form` ADD `parameterL2` TEXT NOT NULL AFTER `parameterL1`",
"ALTER TABLE `Form` ADD `parameterL3` TEXT NOT NULL AFTER `parameterL2`",
"ALTER TABLE `Form` ADD `parameterL4` TEXT NOT NULL AFTER `parameterL3`",
"ALTER TABLE `FormElement` ADD `parameterL1` TEXT NOT NULL AFTER `parameter`",
"ALTER TABLE `FormElement` ADD `parameterL2` TEXT NOT NULL AFTER `parameterL1`",
"ALTER TABLE `FormElement` ADD `parameterL3` TEXT NOT NULL AFTER `parameterL2`",
"ALTER TABLE `FormElement` ADD `parameterL4` TEXT NOT NULL AFTER `parameterL3`"
],
); );
......
...@@ -27,6 +27,9 @@ CREATE TABLE IF NOT EXISTS `Form` ( ...@@ -27,6 +27,9 @@ CREATE TABLE IF NOT EXISTS `Form` (
`bsNoteColumns` VARCHAR(255) NOT NULL DEFAULT '', `bsNoteColumns` VARCHAR(255) NOT NULL DEFAULT '',
`parameter` TEXT NOT NULL, `parameter` TEXT NOT NULL,
`parameterL1` TEXT NOT NULL,
`parameterL2` TEXT NOT NULL,
`parameterL3` TEXT NOT NULL,
`recordLockTimeoutSeconds` INT(11) NOT NULL DEFAULT 900, `recordLockTimeoutSeconds` INT(11) NOT NULL DEFAULT 900,
`deleted` ENUM('yes', 'no') NOT NULL DEFAULT 'no', `deleted` ENUM('yes', 'no') NOT NULL DEFAULT 'no',
...@@ -100,6 +103,9 @@ CREATE TABLE IF NOT EXISTS `FormElement` ( ...@@ -100,6 +103,9 @@ CREATE TABLE IF NOT EXISTS `FormElement` (
`value` TEXT NOT NULL, `value` TEXT NOT NULL,
`sql1` TEXT NOT NULL, `sql1` TEXT NOT NULL,
`parameter` TEXT NOT NULL, `parameter` TEXT NOT NULL,
`parameterL1` TEXT NOT NULL,
`parameterL2` TEXT NOT NULL,
`parameterL3` TEXT NOT NULL,
`clientJs` TEXT NOT NULL, `clientJs` TEXT NOT NULL,
`feGroup` VARCHAR(255) NOT NULL DEFAULT '', `feGroup` VARCHAR(255) NOT NULL DEFAULT '',
......
...@@ -186,8 +186,11 @@ var QfqNS = QfqNS || {}; ...@@ -186,8 +186,11 @@ var QfqNS = QfqNS || {};
* @param sip {string} sip * @param sip {string} sip
* @public * @public
*/ */
n.Dirty.prototype.release = function (sip, optionalQueryParameters) { n.Dirty.prototype.release = function (sip, optionalQueryParameters, async) {
var eventData; var eventData;
if (async === undefined) {
async = true;
}
if (!this.dirtyUrl) { if (!this.dirtyUrl) {
n.Log.debug("release: cannot contact server, no dirtyUrl."); n.Log.debug("release: cannot contact server, no dirtyUrl.");
...@@ -198,7 +201,8 @@ var QfqNS = QfqNS || {}; ...@@ -198,7 +201,8 @@ var QfqNS = QfqNS || {};
$.ajax({ $.ajax({
url: this.makeUrl(sip, n.Dirty.ENDPOINT_OPERATIONS.RELEASE, optionalQueryParameters), url: this.makeUrl(sip, n.Dirty.ENDPOINT_OPERATIONS.RELEASE, optionalQueryParameters),
type: 'GET', type: 'GET',
cache: false cache: false,
async: async
}) })
.done(this.ajaxReleaseSuccessHandler.bind(this)) .done(this.ajaxReleaseSuccessHandler.bind(this))
.fail(this.ajaxReleaseErrorHandler.bind(this)); .fail(this.ajaxReleaseErrorHandler.bind(this));
...@@ -211,6 +215,7 @@ var QfqNS = QfqNS || {}; ...@@ -211,6 +215,7 @@ var QfqNS = QfqNS || {};
* @param jqXHR * @param jqXHR
*/ */
n.Dirty.prototype.ajaxReleaseSuccessHandler = function (data, textStatus, jqXHR) { n.Dirty.prototype.ajaxReleaseSuccessHandler = function (data, textStatus, jqXHR) {
n.Log.debug("Dirty Release: Response received.");
var eventData = n.EventEmitter.makePayload(this, data); var eventData = n.EventEmitter.makePayload(this, data);
if (data.status && data.status === "success") { if (data.status && data.status === "success") {
this.eventEmitter.emitEvent(n.Dirty.EVENTS.RELEASE_SUCCESS, eventData); this.eventEmitter.emitEvent(n.Dirty.EVENTS.RELEASE_SUCCESS, eventData);
......
...@@ -152,13 +152,13 @@ var QfqNS = QfqNS || {}; ...@@ -152,13 +152,13 @@ var QfqNS = QfqNS || {};
/** /**
* @public * @public
*/ */
n.QfqForm.prototype.releaseLock = function () { n.QfqForm.prototype.releaseLock = function (async) {
if (!this.lockAcquired) { if (!this.lockAcquired) {
n.Log.debug("releaseLock(): no lock acquired or already released."); n.Log.debug("releaseLock(): no lock acquired or already released.");
return; return;
} }
n.Log.debug("releaseLock(): releasing lock."); n.Log.debug("releaseLock(): releasing lock.");
this.dirty.release(this.getSip(), this.getRecordHashMd5AsQueryParameter()); this.dirty.release(this.getSip(), this.getRecordHashMd5AsQueryParameter(), async);
this.resetLockState(); this.resetLockState();
}; };
......
...@@ -80,8 +80,7 @@ var QfqNS = QfqNS || {}; ...@@ -80,8 +80,7 @@ var QfqNS = QfqNS || {};
// We have to use 'pagehide'. 'unload' is too late and the ajax request is lost. // We have to use 'pagehide'. 'unload' is too late and the ajax request is lost.
window.addEventListener("pagehide", (function (that) { window.addEventListener("pagehide", (function (that) {
return function () { return function () {
n.Log.debug("release lock"); that.qfqForm.releaseLock(false);
that.qfqForm.releaseLock();
}; };
})(this)); })(this));
} catch (e) { } catch (e) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment