Commit c30f49bd authored by Elias Villiger's avatar Elias Villiger
Browse files

Merge branch 'master' into 5308-timeIsOptional-parameter

parents ce5793b8 7365bbcd
......@@ -484,7 +484,7 @@ abstract class AbstractBuildForm {
$storeRecord = $this->store->getStore(STORE_RECORD);
$value = $this->report->process($this->bodytextParser->process($value), false);
$this->store->setStore($storeRecord, STORE_RECORD, true);
$this->store->setVar(SYSTEM_REPORT_FULL_LEVEL, '', STORE_SYSTEM);
}
return $value;
......@@ -1325,6 +1325,7 @@ abstract class AbstractBuildForm {
$column = $formElement[FE_NAME];
$matches = array();
$inputType = 'number';
$typeSpec = $this->store->getVar($column, STORE_TABLE_COLUMN_TYPES);
switch ($typeSpec) {
......@@ -1389,6 +1390,7 @@ abstract class AbstractBuildForm {
case 'float':
case 'double':
$checkType = SANITIZE_ALLOW_NUMERICAL;
$inputType = 'text';
break;
case 'bit':
$checkType = SANITIZE_ALLOW_DIGIT;
......@@ -1408,7 +1410,7 @@ abstract class AbstractBuildForm {
$formElement[FE_CHECK_TYPE] = $checkType;
if (empty($formElement[FE_INPUT_TYPE])) {
$formElement[FE_INPUT_TYPE] = 'number';
$formElement[FE_INPUT_TYPE] = $inputType;
}
}
......
......@@ -67,7 +67,7 @@ class AbstractException extends \Exception {
// Debug Information
if ($store !== null && Support::findInSet(SYSTEM_SHOW_DEBUG_INFO_YES, $store->getVar(SYSTEM_SHOW_DEBUG_INFO, STORE_SYSTEM))) {
$arrDebugShow = $this->messageArrayDebug;
$arrDebugShow = array_merge([EXCEPTION_REPORT_FULL_LEVEL => Store::getVar(SYSTEM_REPORT_FULL_LEVEL, STORE_SYSTEM)], $this->messageArrayDebug);
$arrDebugShow[EXCEPTION_SIP] = $store->getStore(STORE_SIP);
$arrDebugShow[EXCEPTION_PAGE_ID] = $t3Vars[TYPO3_PAGE_ID];
......
......@@ -28,6 +28,8 @@ class UserReportException extends AbstractException {
$this->messageArrayDebug[EXCEPTION_SQL_RAW] = Store::getVar(SYSTEM_SQL_RAW, STORE_SYSTEM);
$this->messageArrayDebug[EXCEPTION_SQL_FINAL] = Store::getVar(SYSTEM_SQL_FINAL, STORE_SYSTEM);
$this->messageArrayDebug[EXCEPTION_SQL_PARAM_ARRAY] = Store::getVar(SYSTEM_SQL_PARAM_ARRAY, STORE_SYSTEM);
$this->messageArrayDebug[EXCEPTION_REPORT_COLUMN_INDEX] = Store::getVar(SYSTEM_REPORT_COLUMN_INDEX, STORE_SYSTEM);
$this->messageArrayDebug[EXCEPTION_REPORT_COLUMN_NAME] = Store::getVar(SYSTEM_REPORT_COLUMN_NAME, STORE_SYSTEM);
$this->messageArrayDebug[EXCEPTION_REPORT_COLUMN_VALUE] = Store::getVar(SYSTEM_REPORT_COLUMN_VALUE, STORE_SYSTEM);
......
......@@ -97,6 +97,8 @@ var QfqNS = QfqNS || {};
// new style
this.message = options.message || "MESSAGE";
this.messageType = options.type || "info";
this.messageTitle = options.title || false;
this.errorCode = options.code || false;
this.buttons = options.buttons || [];
this.modal = options.modal || false;
this.timeout = options.timeout || n.Alert.constants.NO_TIMEOUT;
......@@ -115,7 +117,7 @@ var QfqNS = QfqNS || {};
n.Alert.prototype.on = n.EventEmitter.onMixin;
n.Alert.constants = {
alertContainerId: "qfqAlertContainer",
alertContainerId: "alert-interactive",
alertContainerSelector: "#qfqAlertContainer",
jQueryAlertRemoveEventName: "qfqalert.remove:",
NO_TIMEOUT: 0
......@@ -159,14 +161,14 @@ var QfqNS = QfqNS || {};
n.Alert.prototype.getAlertClassBasedOnMessageType = function () {
switch (this.messageType) {
case "warning":
return "alert-warning";
return "border-warning";
case "danger":
case "error":
return "alert-danger";
return "border-error";
case "info":
return "alert-info";
return "border-info";
case "success":
return "alert-success";
return "border-success";
/* jshint -W086 */
default:
n.Log.warning("Message type '" + this.messageType + "' unknown. Use default type.");
......@@ -179,7 +181,7 @@ var QfqNS = QfqNS || {};
*/
n.Alert.prototype.getButtons = function () {
var $buttons = null;
var $container = $("<div>").addClass("alert-buttons");
var $container = $("<p>").addClass("buttons");
var numberOfButtons = this.buttons.length;
var index;
var buttonConfiguration;
......@@ -226,17 +228,35 @@ var QfqNS = QfqNS || {};
$alertContainer = this.makeAlertContainerSingleton();
if (this.modal) {
this.$modalDiv = $("<div>");
this.$modalDiv.css('width', "100%");
this.$modalDiv.css('height', Math.max(document.documentElement.clientHeight, window.innerHeight || 0));
//this.$modalDiv.css('width', "100%");
//this.$modalDiv.css('height', Math.max(document.documentElement.clientHeight, window.innerHeight || 0));
}
if (this.messageTitle) {
this.$titleWrap = $("<p>")
.addClass("title")
.append(this.messageTitle);
}
this.$messageWrap = $("<p>")
.addClass("body")
.append(this.message);
this.$alertDiv = $("<div>")
.hide()
.addClass("alert")
.addClass(this.getAlertClassBasedOnMessageType())
.attr("role", "alert")
.append(this.message);
.append(this.$messageWrap);
if (this.$titleWrap) {
this.$alertDiv.prepend(this.$titleWrap);
}
if (this.modal) {
this.$alertDiv.addClass("alert-interactive");
} else {
this.$alertDiv.addClass("alert-side");
}
var buttons = this.getButtons();
if (buttons) {
......@@ -250,18 +270,18 @@ var QfqNS = QfqNS || {};
this.$alertDiv.on(n.Alert.constants.jQueryAlertRemoveEventName, this.removeAlert.bind(this));
}
if (this.modal) {
this.$modalDiv.append(this.$alertDiv);
$alertContainer.append(this.$modalDiv);
$alertContainer.append(this.$alertDiv);
//this.$alertDiv.slideDown(this.fadeInDuration, this.afterFadeIn.bind(this));
if (!this.modal) {
this.$alertDiv.animate({width:'show'}, this.fadeInDuration, this.afterFadeIn.bind(this));
} else {
$alertContainer.append(this.$alertDiv);
this.$alertDiv.fadeIn(this.fadeInDuration);
}
this.$alertDiv.slideDown(this.fadeInDuration, this.afterFadeIn.bind(this));
this.$alertDiv.find(".wants-focus").focus();
this.shown = true;
};
/**
......@@ -286,20 +306,26 @@ var QfqNS = QfqNS || {};
}
var that = this;
this.$alertDiv.slideUp(this.fadeOutDuration, function () {
that.$alertDiv.remove();
that.$alertDiv = null;
if (that.modal) {
that.$modalDiv.remove();
that.$modalDiv = null;
}
that.shown = false;
if (!this.modal) {
this.$alertDiv.animate({width:'hide'}, this.fadeOutDuration, function () {
that.$alertDiv.remove();
that.$alertDiv = null;
that.shown = false;
// TODO: removeAlert should not have knowledge on how to handle alert container
if (that.countAlertsInAlertContainer() === 0) {
that.removeAlertContainer();
}
});
} else {
this.$alertDiv.fadeOut(this.fadeOutDuration, function(){
this.$alertDiv.remove();
this.$alertDiv = null;
this.shown = false;
});
}
// TODO: removeAlert should not have knowledge on how to handle alert container
if (that.countAlertsInAlertContainer() === 0) {
that.removeAlertContainer();
}
});
};
......
......@@ -955,6 +955,13 @@ var QfqNS = QfqNS || {};
alert.show();
}
// Skip other checks if external Save is called
if (this.goToAfterSave) {
console.log("Called goToAfterSave = " + this.goToAfterSave);
window.location = this.goToAfterSave;
return;
}
// do we have to update the HTML Form?
if (data['form-update']) {
this.applyFormConfiguration(data['form-update']);
......@@ -973,12 +980,6 @@ var QfqNS = QfqNS || {};
return;
}
if (this.goToAfterSave) {
console.log("Called goToAfterSave = " + this.goToAfterSave);
window.location = this.goToAfterSave;
return;
}
break;
case 'close':
if (!data.redirect || data.redirect === "no") {
......
......@@ -366,6 +366,23 @@ i.@{spinner_class} {
background-color: #333;
}
.alert-side > p.body {
margin: 0px;
overflow: hidden;
white-space: nowrap;
}
.alert-side {
position: fixed;
display: box;
right: 0px;
top: 20px;
padding: 20px;
color: #d0d0d0;
border-left: 5px solid;
background-color: #333;
}
.border-success {
border-color: #5cb85c;
}
......@@ -390,8 +407,4 @@ i.@{spinner_class} {
.alert-interactive p.buttons {
margin-top: 20px;
text-align: center;
}
.alert-interactive p.buttons button {
margin-right: 4px;
}
\ No newline at end of file
Markdown is supported
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