Commit 41506f2e authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'master' into 6249-subrecord-dnd

# Conflicts:
#	extension/Documentation/Manual.rst
#	extension/qfq/qfq/Constants.php
#	extension/qfq/qfq/QuickFormQuery.php
#	extension/qfq/sql/formEditor.sql
parents 2fdb9a29 37d1eb37
......@@ -25,7 +25,7 @@ require_once(__DIR__ . '/../helper/HelperFile.php');
require_once(__DIR__ . '/../exceptions/DownloadException.php');
//require_once(__DIR__ . '/../Evaluate.php');
//require_once(__DIR__ . '/../helper/KeyValueStringParser.php');
//require __DIR__ . '/../../../Resources/Private/vendor/autoload.php';
require __DIR__ . '/../../../Resources/Private/vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
......@@ -142,10 +142,15 @@ class Excel {
case EXCEL_STRING2:
case EXCEL_FORMULA:
case EXCEL_NUMERIC:
case EXCEL_BOOL:
case EXCEL_BASE64:
case EXCEL_NULL:
case EXCEL_INLINE:
case EXCEL_ERROR:
if($key==EXCEL_BASE64){
$value=base64_decode($value);
$key=EXCEL_STRING;
}
$spreadsheet->getActiveSheet()
->setCellValueExplicit(
$posColumn . $posRow,
......@@ -156,7 +161,10 @@ class Excel {
break;
default:
throw new downloadException("Excel Export: unknown token " . $key, ERROR_UNKNOWN_TOKEN);
$errorMsg[ERROR_MESSAGE_TO_USER] = 'Excel Export: unknown token';
$errorMsg[ERROR_MESSAGE_SUPPORT] = 'Unknown Token: ' . $key;
throw new downloadException(json_encode($errorMsg), ERROR_UNKNOWN_TOKEN);
}
}
......
......@@ -498,14 +498,14 @@ class Link {
* Iterate over all given token. Check for double definition.
*
* @param string $str
* @param array $tokenGiven
* @param array $rcTokenGiven - return an array with found token.
*
* @return array
* @throws CodeException
* @throws UserFormException
* @throws UserReportException
*/
private function fillParameter($str, array &$tokenGiven) {
private function fillParameter($str, array &$rcTokenGiven) {
// Define all possible vars: no more isset().
$vars = $this->initVars();
......@@ -530,13 +530,15 @@ class Link {
$value = isset($arr[1]) ? $arr[1] : '';
// Bookkeeping defined parameter.
if (isset($tokenGiven[$key])) {
if (isset($rcTokenGiven[$key])) {
throw new UserReportException ("Multiple definitions for key '$key'", ERROR_MULTIPLE_DEFINITION);
}
$tokenGiven[$key] = true;
$rcTokenGiven[$key] = true;
if (!isset($this->tableVarName[$key])) {
throw new UserReportException ("Unknown link qualifier: '$key' - did you forget the one character qualifier?", ERROR_UNKNOWN_LINK_QUALIFIER);
$msg[ERROR_MESSAGE_TO_USER] = "Unknown link qualifier: '$key' - did you forget the one character qualifier?";
$msg[ERROR_MESSAGE_SUPPORT] = $str;
throw new UserReportException (json_encode($msg), ERROR_UNKNOWN_LINK_QUALIFIER);
}
$keyName = $this->tableVarName[$key]; // convert token to name
......@@ -549,12 +551,12 @@ class Link {
$value = $this->checkValue($key, $value);
// Store value
if ((isset($tokenGiven[TOKEN_DOWNLOAD]) || isset($tokenGiven[TOKEN_COPY_TO_CLIPBOARD])) &&
if ((isset($rcTokenGiven[TOKEN_DOWNLOAD]) || isset($rcTokenGiven[TOKEN_COPY_TO_CLIPBOARD])) &&
($key == TOKEN_PAGE || $key == TOKEN_URL || $key == TOKEN_URL_PARAM || $key == TOKEN_FILE || $key == TOKEN_FILE_DEPRECATED)) {
$vars[NAME_COLLECT_ELEMENTS][] = $key . ':' . $value;
unset($tokenGiven[$key]); // Skip Bookkeeping for TOKEN_URL_PARAM | TOKEN_FILE | TOKEN_URL.
unset($rcTokenGiven[$key]); // Skip Bookkeeping for TOKEN_URL_PARAM | TOKEN_FILE | TOKEN_URL.
continue;
} else {
// TOKEN_GLYPH should not treated as an regular image. Same applies to the other Glyph symbols, but those don't have a value, and therefore do not fill $vars['image'].
......@@ -585,17 +587,17 @@ class Link {
}
// Download Link needs some extra work
if ($tokenGiven[TOKEN_DOWNLOAD]) {
if ($rcTokenGiven[TOKEN_DOWNLOAD]) {
$vars = $this->buildDownloadLate($vars);
}
// CopyToClipboard (Download) Link needs some extra work
if ($tokenGiven[TOKEN_COPY_TO_CLIPBOARD]) {
if ($rcTokenGiven[TOKEN_COPY_TO_CLIPBOARD]) {
$vars = $this->buildCopyToClipboardLate($vars);
}
// Final Checks
$this->checkParam($tokenGiven, $vars);
$this->checkParam($rcTokenGiven, $vars);
return $vars;
}
......@@ -1431,7 +1433,7 @@ EOF;
// Clipboard Source
if ($vars[NAME_COPY_TO_CLIPBOARD] !== '') {
$jsAction = 'onClick';
$source = "{text: '" . $vars[NAME_COPY_TO_CLIPBOARD] . " '}";
$source = "{text: '" . OnString::replaceByUnicode($vars[NAME_COPY_TO_CLIPBOARD]) . "' }";
} elseif ($vars[NAME_FILE] !== '') {
$jsAction = 'onmousedown';
......
......@@ -738,6 +738,11 @@ class Report {
$content .= $this->link->renderLink($linkValue);
break;
case COLUMN_YANK:
$linkValue = $this->doYank($columnName, $columnValue);
$content .= $this->link->renderLink($linkValue);
break;
case COLUMN_PPDF:
case COLUMN_FFILE:
case COLUMN_ZZIP:
......@@ -796,6 +801,9 @@ class Report {
case COLUMN_EXCEL_STRING:
$content .= EXCEL_STRING . '=' . $columnValue . PHP_EOL;
break;
case COLUMN_EXCEL_BASE64:
$content .= EXCEL_BASE64 . '=' . base64_encode($columnValue) . PHP_EOL;
break;
case COLUMN_EXCEL_NUMERIC:
$content .= EXCEL_NUMERIC . '=' . $columnValue . PHP_EOL;
break;
......@@ -1171,6 +1179,25 @@ class Report {
return ($columnValue);
}
/**
* Checks if a token 'y' is given. If not, prepend one.
*
* @param $columnName
* @param $columnValue
* @return string
* @throws UserFormException
*/
private function doYank($columnName, $columnValue) {
$token = KeyValueStringParser::parse($columnValue, PARAM_TOKEN_DELIMITER, PARAM_DELIMITER);
if (!isset($token[TOKEN_COPY_TO_CLIPBOARD])) {
$columnValue = TOKEN_COPY_TO_CLIPBOARD . PARAM_DELIMITER . $columnValue;
}
return $columnValue;
}
/**
* Renders _download: extract token and determine if any default value has to be applied
* [d:<exportFilename][U:<params>][u:<url>][f:file][t:<text>][a:<message>]|[o:<tooltip>]|[c:<class>]|[r:<render
......
CREATE TABLE IF NOT EXISTS `Form` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL DEFAULT '',
`title` VARCHAR(512) NOT NULL DEFAULT '',
`title` VARCHAR(511) NOT NULL DEFAULT '',
`noteInternal` TEXT NOT NULL,
`tableName` VARCHAR(255) NOT NULL DEFAULT '',
`permitNew` ENUM('sip', 'logged_in', 'logged_out', 'always', 'never') NOT NULL DEFAULT 'sip',
`permitEdit` ENUM('sip', 'logged_in', 'logged_out', 'always', 'never') NOT NULL DEFAULT 'sip',
`permitNew` ENUM ('sip', 'logged_in', 'logged_out', 'always', 'never') NOT NULL DEFAULT 'sip',
`permitEdit` ENUM ('sip', 'logged_in', 'logged_out', 'always', 'never') NOT NULL DEFAULT 'sip',
`escapeTypeDefault` VARCHAR(32) NOT NULL DEFAULT 'c',
`render` ENUM('bootstrap', 'table', 'plain') NOT NULL DEFAULT 'bootstrap',
`render` ENUM ('bootstrap', 'table', 'plain') NOT NULL DEFAULT 'bootstrap',
`requiredParameterNew` VARCHAR(255) NOT NULL DEFAULT '',
`requiredParameterEdit` VARCHAR(255) NOT NULL DEFAULT '',
`dirtyMode` ENUM('exclusive', 'advisory', 'none') NOT NULL DEFAULT 'exclusive',
`showButton` SET('new', 'delete', 'close', 'save') NOT NULL DEFAULT 'new,delete,close,save',
`multiMode` ENUM('none', 'horizontal', 'vertical') NOT NULL DEFAULT 'none',
`dirtyMode` ENUM ('exclusive', 'advisory', 'none') NOT NULL DEFAULT 'exclusive',
`showButton` SET ('new', 'delete', 'close', 'save') NOT NULL DEFAULT 'new,delete,close,save',
`multiMode` ENUM ('none', 'horizontal', 'vertical') NOT NULL DEFAULT 'none',
`multiSql` TEXT NOT NULL,
`multiDetailForm` VARCHAR(255) NOT NULL DEFAULT '',
`multiDetailFormParameter` VARCHAR(255) NOT NULL DEFAULT '',
`forwardMode` ENUM('client', 'no', 'url', 'url-skip-history', 'url-sip') NOT NULL DEFAULT 'client',
`forwardMode` ENUM ('client', 'no', 'url', 'url-skip-history', 'url-sip') NOT NULL DEFAULT 'client',
`forwardPage` VARCHAR(255) NOT NULL DEFAULT '',
`bsLabelColumns` VARCHAR(255) NOT NULL DEFAULT '',
......@@ -33,8 +33,9 @@ CREATE TABLE IF NOT EXISTS `Form` (
`parameterLanguageD` TEXT NOT NULL,
`recordLockTimeoutSeconds` INT(11) NOT NULL DEFAULT 900,
`deleted` ENUM('yes', 'no') NOT NULL DEFAULT 'no',
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`deleted` ENUM ('yes', 'no') NOT NULL DEFAULT 'no',
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
......@@ -50,24 +51,24 @@ CREATE TABLE IF NOT EXISTS `FormElement` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`formId` INT(11) NOT NULL,
`feIdContainer` INT(11) NOT NULL DEFAULT '0',
`dynamicUpdate` ENUM('yes', 'no') NOT NULL DEFAULT 'no',
`dynamicUpdate` ENUM ('yes', 'no') NOT NULL DEFAULT 'no',
`enabled` ENUM('yes', 'no') NOT NULL DEFAULT 'yes',
`enabled` ENUM ('yes', 'no') NOT NULL DEFAULT 'yes',
`name` VARCHAR(255) NOT NULL DEFAULT '',
`label` VARCHAR(511) NOT NULL DEFAULT '',
`mode` ENUM('show', 'required', 'readonly', 'hidden') NOT NULL DEFAULT 'show',
`mode` ENUM ('show', 'required', 'readonly', 'hidden') NOT NULL DEFAULT 'show',
`modeSql` TEXT NOT NULL,
`class` ENUM('native', 'action', 'container') NOT NULL DEFAULT 'native',
`type` ENUM('checkbox', 'date', 'datetime', 'dateJQW', 'datetimeJQW', 'extra', 'gridJQW', 'text',
`class` ENUM ('native', 'action', 'container') NOT NULL DEFAULT 'native',
`type` ENUM ('checkbox', 'date', 'datetime', 'dateJQW', 'datetimeJQW', 'extra', 'gridJQW', 'text',
'editor', 'time', 'note', 'password', 'radio', 'select', 'subrecord', 'upload',
'annotate', 'imageCut', 'fieldset', 'pill', 'templateGroup',
'beforeLoad', 'beforeSave', 'beforeInsert', 'beforeUpdate', 'beforeDelete', 'afterLoad',
'afterSave', 'afterInsert', 'afterUpdate', 'afterDelete', 'sendMail', 'paste') NOT NULL DEFAULT 'text',
`subrecordOption` SET('edit', 'delete', 'new') NOT NULL DEFAULT '',
`encode` ENUM('none', 'specialchar') NOT NULL DEFAULT 'specialchar',
`checkType` ENUM('auto', 'alnumx', 'digit', 'numerical', 'email', 'pattern', 'allbut', 'all') NOT NULL DEFAULT 'auto',
`subrecordOption` SET ('edit', 'delete', 'new') NOT NULL DEFAULT '',
`encode` ENUM ('none', 'specialchar') NOT NULL DEFAULT 'specialchar',
`checkType` ENUM ('auto', 'alnumx', 'digit', 'numerical', 'email', 'pattern', 'allbut', 'all') NOT NULL DEFAULT 'auto',
`checkPattern` VARCHAR(255) NOT NULL DEFAULT '',
`onChange` VARCHAR(255) NOT NULL DEFAULT '',
......@@ -80,7 +81,7 @@ CREATE TABLE IF NOT EXISTS `FormElement` (
`bsLabelColumns` VARCHAR(255) NOT NULL DEFAULT '',
`bsInputColumns` VARCHAR(255) NOT NULL DEFAULT '',
`bsNoteColumns` VARCHAR(255) NOT NULL DEFAULT '',
`rowLabelInputNote` SET('row', 'label', '/label', 'input', '/input', 'note', '/note', '/row') NOT NULL DEFAULT 'row,label,/label,input,/input,note,/note,/row',
`rowLabelInputNote` SET ('row', 'label', '/label', 'input', '/input', 'note', '/note', '/row') NOT NULL DEFAULT 'row,label,/label,input,/input,note,/note,/row',
`note` TEXT NOT NULL,
`adminNote` TEXT NOT NULL,
`tooltip` VARCHAR(255) NOT NULL DEFAULT '',
......@@ -96,8 +97,9 @@ CREATE TABLE IF NOT EXISTS `FormElement` (
`clientJs` TEXT NOT NULL,
`feGroup` VARCHAR(255) NOT NULL DEFAULT '',
`deleted` ENUM('yes', 'no') NOT NULL DEFAULT 'no',
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`deleted` ENUM ('yes', 'no') NOT NULL DEFAULT 'no',
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
......@@ -122,9 +124,10 @@ CREATE TABLE IF NOT EXISTS `Dirty` (
`recordHashMd5` CHAR(32) NOT NULL,
`feUser` VARCHAR(255) NOT NULL,
`qfqUserSessionCookie` VARCHAR(255) NOT NULL,
`dirtyMode` ENUM('exclusive', 'advisory', 'none') NOT NULL DEFAULT 'exclusive',
`dirtyMode` ENUM ('exclusive', 'advisory', 'none') NOT NULL DEFAULT 'exclusive',
`remoteAddress` VARCHAR(45) NOT NULL,
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL,
PRIMARY KEY (`id`),
KEY `sip` (`sip`),
......@@ -140,7 +143,8 @@ 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,
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL,
PRIMARY KEY (`id`),
KEY `start` (`start`)
......@@ -180,7 +184,8 @@ INSERT INTO FormElement (formId, name, label, mode, type, checkType, class, ord,
VALUES
# Make the form a 'delete form' for records Form/FormElement.
(1, 'Delete FE', '', 'show', 'beforeDelete', 'all', 'action', 10, 0, 0, '', '', '', '',
'sqlAfter={{DELETE FROM FormElement WHERE formId={{id:R}} }}', 0, '', '', '', 'none', 'no', ''),
'sqlAfter={{DELETE FROM FormElement WHERE formId={{id:R}} }}',
0, '', '', '', 'none', 'no', ''),
(1, 'name', 'Name', 'required', 'text', 'pattern', 'native', 120, 0, 0, '<a href="{{documentation:Y}}#form-name">Info</a>', '', '', '', 'autofocus',
1, '', '', '', 'specialchar', 'no', '[a-zA-Z0-9._+-]+'),
(1, 'title', 'Title', 'show', 'text', 'all', 'native', 130, 0, 0, '<a href="{{documentation:Y}}#form-title">Info</a>', '', '', '', '', 1, '', '', '', 'none', 'no', ''),
......@@ -231,7 +236,9 @@ VALUES
(1, '', 'FormElements', 'show', 'subrecord', 'all', 'native', 510, 0, 0, '', '', '',
'{{!SELECT IF( fe.enabled="yes", IF( fe.enabled="yes" AND fe.feIdContainer=0 AND !ISNULL(feCX.id) AND fe.class="native", "danger", IF( fe.class="container", "text-info", IF( fe.class="action", "text-success", ""))), "text-muted") AS _rowClass, IF( fe.enabled="yes", IF(fe.feIdContainer=0 AND !ISNULL(feCX.id) AND fe.class="native", "Please choose a container for this formelement", fe.class), "Disabled") AS _rowTitle, fe.id AS _id, CONCAT(fe.ord, ''<br><small class="text-muted">'',fe.id, ''</small>'') AS ''Ord|nostrip'', CONCAT( IFNULL( CONCAT( feC.name, " (", fe.feIdContainer, ")"),"")) AS Container, fe.name AS "Name|50", fe.label AS Label, fe.mode AS Mode, fe.class AS Class, fe.type AS Type, IF(fe.dynamicUpdate="yes", \'<span class="glyphicon glyphicon-random"></span>\',"") AS "Dyn|nostrip" FROM FormElement AS fe LEFT JOIN FormElement AS feC ON feC.id=fe.feIdContainer AND feC.formId=fe.formId LEFT JOIN FormElement AS feCX ON feCX.class="container" AND feCX.enabled="yes" AND feCX.formId=fe.formId WHERE fe.formId={{id:R0}} GROUP BY fe.id ORDER BY fe.ord, fe.id}}',
'form=formElement\ndetail=id:formId', 5, 'new,edit,delete', '', '', 'none', 'no', '');
'form=formElement\ndetail=id:formId', 5,
'new,edit,delete', '', '', 'none', 'no',
'');
#
# FormEditor: FormElement
......@@ -360,7 +367,8 @@ CREATE TABLE IF NOT EXISTS `Clipboard` (
`formIdPaste` INT(11) NOT NULL DEFAULT '0',
`idSrc` INT(11) NOT NULL DEFAULT '0',
`xId` INT(11) NOT NULL DEFAULT '0',
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
......@@ -392,7 +400,6 @@ VALUES
'{{!SELECT fe.id AS id, {{formId:P}} AS formId FROM FormElement AS fe WHERE fe.formId={{id:P}} ORDER BY fe.ord}}',
'recordDestinationTable=FormElement\ntranslateIdColumn=feIdContainer');
# Default record for table Period
INSERT INTO Period (start, name, created) VALUES (NOW(), 'dummy', NOW());
......@@ -400,20 +407,21 @@ INSERT INTO Period (start, name, created) VALUES (NOW(), 'dummy', NOW());
CREATE TABLE IF NOT EXISTS `Cron` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`grId` INT(11) NOT NULL,
`type` ENUM('mail', 'website') NOT NULL DEFAULT 'website',
`type` ENUM ('mail', 'website') NOT NULL DEFAULT 'website',
`lastRun` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`lastStatus` TEXT NOT NULL,
`nextRun` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`frequency` VARCHAR(32) NOT NULL,
`inProgress` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` ENUM('enable', 'disable') NOT NULL DEFAULT 'enable',
`status` ENUM ('enable', 'disable') NOT NULL DEFAULT 'enable',
`sql1` TEXT NOT NULL,
`content` TEXT NOT NULL,
`comment` TEXT NOT NULL,
`outputFile` VARCHAR(255) NOT NULL,
`outputMode` ENUM('overwrite', 'append') NOT NULL DEFAULT 'append',
`outputMode` ENUM ('overwrite', 'append') NOT NULL DEFAULT 'append',
`outputPattern` VARCHAR(255) NOT NULL,
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
)
......@@ -461,7 +469,8 @@ CREATE TABLE IF NOT EXISTS `Split` (
`tableName` VARCHAR(255) NOT NULL,
`xId` INT(11) NOT NULL,
`pathFileName` VARCHAR(255) NOT NULL,
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
)
......
......@@ -129,12 +129,11 @@ var QfqNS = QfqNS || {};
*/
n.Alert.prototype.makeAlertContainerSingleton = function () {
var alertContainer = $(n.Alert.constants.alertContainerSelector);
if (alertContainer.length === 0) {
alertContainer.remove();
// No container so far, create one
alertContainer = $("<div>").attr("id", n.Alert.constants.alertContainerId);
$("body").append(alertContainer);
}
return alertContainer;
};
......@@ -220,6 +219,7 @@ var QfqNS = QfqNS || {};
* @public
*/
n.Alert.prototype.show = function () {
$(".removeMe").remove();
var $alertContainer;
if (this.shown) {
// We only allow showing once
......@@ -268,6 +268,7 @@ var QfqNS = QfqNS || {};
} else {
this.$alertDiv.addClass("alert-side");
}
this.$alertDiv.addClass("removeMe");
var buttons = this.getButtons();
if (buttons) {
......@@ -310,6 +311,7 @@ var QfqNS = QfqNS || {};
* @private
*/
n.Alert.prototype.removeAlert = function () {
// In case we have an armed timer (or expired timer, for that matter), disarm it.
if (this.timerId) {
window.clearTimeout(this.timerId);
......
......@@ -6,6 +6,7 @@
/* global EventEmitter */
/* @depend QfqEvents.js */
/* @depend Alert.js */
/* @depend ElementUpdate.js */
/**
* Qfq Namespace
......@@ -258,11 +259,9 @@ var QfqNS = QfqNS || {};
console.error(data.message);
} else {
console.log("status:" + data.status + " message: " + data.message);
if (data.elementUpdate) {
if (!this.elementUpdate) {
this.elementUpdate = new n.ElementUpdate();
}
this.elementUpdate.updateAll(data.elementUpdate);
if (data['element-update']) {
var configuration = data['element-update'];
n.ElementUpdate.updateAll(configuration);
}
}
};
......
......@@ -146,7 +146,13 @@ select.qfq-locked:invalid {
padding-top: 4px;
}
.qfq-form-title {
.qfq-subrecord-table {
margin-left: 10px;
margin-right: 10px;
width: calc(~"100% - 20px");
}
.qfq-form-title, .qfq-subrecord-title {
border: 1px solid #ccc;
border-radius: 4px 4px 0 0;
background-image: linear-gradient(to bottom, #fefefe 0, #dedede 100%);
......@@ -157,6 +163,44 @@ select.qfq-locked:invalid {
font-weight: bold;
}
.qfq-subrecord-title {
color: #333;
padding: 10px 12px;
}
.qfq-subrecord-table .btn {
padding: 5px 10px;
}
.qfq-subrecord-head {
background-color: #dedede;
border: 1px solid #ccc;
border-top: none;
}
.qfq-subrecord-head th, .qfq-subrecord-table td {
padding: 3px !important;
vertical-align: middle !important;
border-bottom: 1px solid #ccc !important;
}
.qfq-subrecord-table tbody {
border: 1px solid #ccc;
border-radius: 0 0 3px 3px;
}
.qfq-subrecord-table>tbody>tr {
background-color: #ededed;
}
.qfq-subrecord-table>tbody>tr:hover {
background-color: #efefef;
}
.qfq-table-button-width {
width: 44px;
}
.nav-pills>li>a {
border-radius: 0;
}
......
......@@ -61,7 +61,7 @@
</ul>
</div>
</div>
<form class="form-horizontal">
<form class="form-horizontal clearfix">
<div class="col-md-12 qfq-form-body qfq-color-grey-2">
<div class="form-group clearfix">
<div class="col-md-3 qfq-label">
......@@ -99,11 +99,77 @@
<div class="col-md-6"><input class="form-control" type="text"></div>
<div class="col-md-3"></div>
</div>
<!-- Start Subrecords -->
<div class="form-group clearfix">
<table class="table qfq-subrecord-table">
<caption class="qfq-subrecord-title">
Subrecords Title
</caption>
<thead>
<tr class="qfq-subrecord-head">
<th class="qfq-table-button-width">
<a class="btn btn-default" href="#" title="New"><span class="glyphicon glyphicon-plus"></span></a>
</th>
<th>
#
</th>
<th>
Name
</th>
<th>
Date
</th>
<th class="qfq-table-button-width">
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a class="btn btn-default" href="#" title="Edit"><span class="glyphicon glyphicon-pencil"></span></a>
</td>
<td>1</td>
<td>Test</td>
<td>01.07.18</td>
<td><button type="button" class="record-delete btn btn-default" data-sip="5b6d9eb7c18aa" title="Delete"><span class="glyphicon glyphicon-trash"></span></button></td>
</tr>
<tr>
<td>
<a class="btn btn-default" href="#" title="Edit"><span class="glyphicon glyphicon-pencil"></span></a>
</td>
<td>2</td>
<td>Test</td>
<td>01.07.18</td>
<td><button type="button" class="record-delete btn btn-default" data-sip="5b6d9eb7c18aa" title="Delete"><span class="glyphicon glyphicon-trash"></span></button></td>
</tr>
<tr>
<td>
<a class="btn btn-default" href="#" title="Edit"><span class="glyphicon glyphicon-pencil"></span></a>
</td>
<td>3</td>
<td>Test</td>
<td>01.07.18</td>
<td><button type="button" class="record-delete btn btn-default" data-sip="5b6d9eb7c18aa" title="Delete"><span class="glyphicon glyphicon-trash"></span></button></td>
</tr>
<tr>
<td>
<a class="btn btn-default" href="#" title="Edit"><span class="glyphicon glyphicon-pencil"></span></a>
</td>
<td>4</td>
<td>Test</td>
<td>01.07.18</td>
<td><button type="button" class="record-delete btn btn-default" data-sip="5b6d9eb7c18aa" title="Delete"><span class="glyphicon glyphicon-trash"></span></button></td>
</tr>
</tbody>
</table>
</div>
<!-- End Subrecords -->
</div>
</form>
<p style="margin-bottom: 40px;"><br>&nbsp;</p>
<p style="height: 40px;"></p>
<div class="row">
<div class="col-md-12">
......
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