Commit 194bbd0c authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch '6249-subrecord-dnd' into 'master'

6249 subrecord dnd

See merge request !57
parents 37d1eb37 26322c4f
Pipeline #763 passed with stage
in 1 minute and 37 seconds
......@@ -3301,6 +3301,31 @@ will be rendered inside the form as a HTML table.
* *subrecordTableClass*: Optional. Default: 'table table-hover qfq-table-100'. If given, the default will be overwritten.
**Subrecord DragAndDrop**
Subrecords inherently support drag-and-drop, see also `drag_and_drop`_.
The following parameters can be used in the `parameter` field to customize/activate drag-and-drop:
* *orderInterval*: The order interval to be used, default is 10.
* *dndTable*: The table that contains the records to be ordered.
If not given, the table name of the form specified via `form=...` is used.
* *orderColumn*: The dedicated order column in the specified dndTable (needs to match a column in the table definition).
Default is `ord`.
If `dndTable` is an actual table with a column `orderColumn`, QFQ automatically applies drag-and-drop logic
to the rendered subrecord. It does so by using the subrecord field *sql1*. The `sql1` query should
therefore include both a column id (or _id) and ord (or _ord).
Tips:
* If you want to deactivate a drag-and-drop that QFQ automatically renders, set the `orderColumn` to a non-existing column.
E.g., `orderColumn = nonExistingColumn`. This will deactivate drag-and-drop.
* In order to evaluate the `sql1` query dynamically during a drag-and-drop event, the fill store R (with the current form)
is loaded. Currently, SIP parameters and other variables are not supplied to be evaluated during a drag-and-drop event.
This may be added later upon request.
* If the subrecord is rendered with drag-and-drop active, but the order is not affected upon reload, there is
most likely a problem with evaluating the `sql1` query at runtime.
Type: time
^^^^^^^^^^
......@@ -6522,13 +6547,13 @@ A typical QFQ report which generates those `<div>` HTML: ::
WHERE grId=28
ORDER BY n.ord
head = <div class="qfq-dnd-sort" {{'form=dndSortNote&grId=28|A:dnd-sort' AS _data-dnd-api}}">
head = <div class="qfq-dnd-sort" {{'form=dndSortNote&grId=28' AS _data-dnd-api}}">
tail = </div>
}
A `<table>` based setup is also possible. Note the attribute `data-columns="3"` - those generates a dropzone
which the same column width as the outer table. ::
A `<table>` based setup is also possible. Note the attribute `data-columns="3"` - this generates a dropzone
which is the same column width as the outer table. ::
<table>
<tbody class="qfq-dnd-sort" data-dnd-api="typo3conf/ext/qfq/qfq/api/dragAndDrop.php?s=badcaffee1234" data-columns="3">
......@@ -6544,7 +6569,7 @@ which the same column width as the outer table. ::
</tbody>
</table>
A typical QFQ report which generates those HTML: ::
A typical QFQ report which generates this HTML: ::
10 {
sql = SELECT '<tr id="anytag-', n.id,'" data-dnd-id="', n.id,'" data-columns="3">' , n.id AS '_+td', n.note AS '_+td', n.ord AS '_+td', '</tr>'
......@@ -6621,7 +6646,7 @@ QFQ iterates over the result set of `dragAndDropOrderSql`. The value of column `
Take care that the query of part 1 (display list) does a) select the same records and b) in the same order as the query
defined in part 2 (order records) via `dragAndDropOrderSql`.
If you find that the reorder does not work at expected, those two sql queries are not identically.
If you find that the reorder does not work at expected, those two sql queries are not identical.
QFQ CSS Classes
---------------
......
......@@ -2410,6 +2410,31 @@ abstract class AbstractBuildForm {
$linkNew = $flagNew ? Support::wrapTag('<th>', $this->createFormLink($formElement, 0, $primaryRecord, $this->symbol[SYMBOL_NEW], 'New')) : '<th></th>';
}
// Determine if DragAndDrop is active
$hasDragAndDrop = false;
$orderColumn = $formElement[FE_ORDER_COLUMN] ?? DND_COLUMN_ORD;
$dndTable = '';
if (isset($formElement[FE_DND_TABLE])) {
// Table is specified in parameter field
$dndTable = $formElement[FE_DND_TABLE];
} else {
// Read table from form specified in subrecord
$formName = $formElement[SUBRECORD_PARAMETER_FORM];
$form = $this->dbArray[$this->dbIndexQfq]->sql("SELECT * FROM Form AS f WHERE f." . F_NAME . " LIKE ? AND f.deleted='no'",
ROW_REGULAR, [$formName]);
if (count($form) > 0) { $dndTable = $form[0][F_TABLE_NAME]; }
}
if ($dndTable) {
$columns = $this->dbArray[$this->dbIndexQfq]->sql("SHOW COLUMNS FROM $dndTable");
foreach ($columns as $column) {
if ($column['Field'] === $orderColumn) {
// DragAndDrop is active if the dndTable has the orderColumn
$hasDragAndDrop = true;
break;
}
}
}
$firstRow = isset($formElement[FE_SQL1][0]) ? $formElement[FE_SQL1][0] : array();
$htmlHead = $this->subrecordHead($linkNew, $flagDelete, $firstRow, $control);
$htmlBody = '';
......@@ -2456,12 +2481,37 @@ abstract class AbstractBuildForm {
}
$rowAttribute = Support::doAttribute('class', $rowClass);
$rowAttribute .= Support::doAttribute('title', $rowTooltip);
if ($hasDragAndDrop) {
$rowAttribute .= Support::doAttribute('id', $formElement[FE_HTML_ID] . '-' . $row[$nameColumnId]);
$rowAttribute .= Support::doAttribute('data-dnd-id', $row[$nameColumnId]);
}
$htmlBody .= Support::wrapTag("<tr $rowAttribute>", $rowHtml, true);
}
// Handle DragAndDrop
$dndAttributes = '';
if ($hasDragAndDrop) {
$orderInterval = 10;
$numColumns = 0;
if (count($formElement[FE_SQL1]) > 0) {
$numColumns = count($formElement[FE_SQL1][0]) + (int)$flagDelete + (int)($flagNew || $flagEdit);
}
$dataDndApi = DND_SUBRECORD_ID . '=' . $formElement[FE_ID];
$dataDndApi .= '&' . DND_SUBRECORD_FORM_ID . '=' . $this->store->getVar('id', STORE_RECORD);
$dataDndApi .= '&' . FE_ORDER_INTERVAL . '=' . $orderInterval;
$dataDndApi .= '&' . FE_ORDER_COLUMN . '=' . $orderColumn;
$dataDndApi .= '&' . FE_DND_TABLE . '=' . $dndTable;
$dndAttributes = Support::doAttribute('class', 'qfq-dnd-sort');
$dndAttributes .= $this->evaluate->parse( "{{ '$dataDndApi' AS _data-dnd-api }}").' ';
$dndAttributes .= Support::doAttribute('data-columns', $numColumns);
}
$attribute = Support::doAttribute('class', $formElement[FE_SUBRECORD_TABLE_CLASS]);
return Support::wrapTag("<table $attribute>", $htmlHead . Support::wrapTag('<tbody>', $htmlBody), true);
return Support::wrapTag("<table $attribute>",
$htmlHead . Support::wrapTag("<tbody $dndAttributes>", $htmlBody), true);
}
/**
......
......@@ -55,6 +55,7 @@ const RETURN_URL = 'return_url';
const RETURN_SIP = 'return_sip';
const RETURN_ARRAY = 'return_array';
const SQL_FORM_ELEMENT_BY_ID = "SELECT * FROM FormElement AS fe WHERE fe.id = ?";
const SQL_FORM_ELEMENT_RAW = "SELECT * FROM FormElement AS fe WHERE fe.formId = ? AND fe.deleted = 'no' AND fe.enabled='yes' ORDER BY fe.ord, fe.id";
const SQL_FORM_ELEMENT_SPECIFIC_CONTAINER = "SELECT *, ? AS 'nestedInFieldSet' FROM FormElement AS fe WHERE fe.formId = ? AND fe.deleted = 'no' AND FIND_IN_SET(fe.class, ? ) AND fe.feIdContainer = ? AND fe.enabled='yes' ORDER BY fe.ord, fe.id";
const SQL_FORM_ELEMENT_ALL_CONTAINER = "SELECT *, ? AS 'nestedInFieldSet' FROM FormElement AS fe WHERE fe.formId = ? AND fe.deleted = 'no' AND FIND_IN_SET(fe.class, ? ) AND fe.enabled='yes' ORDER BY fe.ord, fe.id";
......@@ -1096,6 +1097,10 @@ const FE_TYPE_PILL = 'pill';
const FE_HTML_ID = 'htmlId'; // Will be dynamically computed during runtime.
const FE_ORDER_INTERVAL = 'orderInterval';
const FE_ORDER_COLUMN = 'orderColumn';
const FE_DND_TABLE = 'dndTable';
const MODE_ENCODE = 'encode';
const MODE_DECODE = 'decode';
const MODE_NONE = 'none';
......@@ -1549,5 +1554,7 @@ const DND_COLUMN_ID = 'id';
const DND_COLUMN_ORD = 'ord';
const DND_COLUMN_ORD_NEW = 'ordNew';
const DND_DATA_DND_API = 'data-dnd-api';
const DND_SUBRECORD_ID = 'dnd-subrecord-id'; // Internal qualifier used to communicate with dnd api for subrecord dnd
const DND_SUBRECORD_FORM_ID = 'dnd-subrecord-form-id';
const DND_ORD_HTML_ID_PREFIX = 'qfq-dnd-ord-id-';
......@@ -322,7 +322,7 @@ class QuickFormQuery {
$flagApiStructureReGroup=true;
// Fill STORE_FORM
if ($formMode === FORM_UPDATE || $formMode === FORM_SAVE || $formMode === FORM_DRAG_AND_DROP) {
if ($formMode === FORM_UPDATE || $formMode === FORM_SAVE) {
$fillStoreForm = new FillStoreForm();
$fillStoreForm->process($formMode);
}
......@@ -1381,8 +1381,40 @@ class QuickFormQuery {
* @throws UserReportException
*/
public function dragAndDrop() {
$fillStoreForm = new FillStoreForm();
$fillStoreForm->process(FORM_DRAG_AND_DROP);
$json = "";
$dndSubrecordId = $this->store->getVar(DND_SUBRECORD_ID, STORE_SIP . STORE_CLIENT . STORE_ZERO);
if ($dndSubrecordId > 0) {
// Subrecord DragAndDrop
$subrecord = $this->dbArray[$this->dbIndexQfq]->sql(SQL_FORM_ELEMENT_BY_ID, ROW_REGULAR, [$dndSubrecordId]);
$recordId = $this->store->getVar(DND_SUBRECORD_FORM_ID, STORE_SIP . STORE_ZERO);
$this->fillStoreWithRecord('Form', $recordId);
$dndOrderSql = $this->eval->parse($subrecord[0][FE_SQL1]);
foreach ($dndOrderSql as $i => $row) {
foreach ($row as $key => $value) {
if (substr($key, 0, 1) === '_') {
$dndOrderSql[$i][substr($key, 1)] = $value;
}
}
}
$dummyFormSpec= [
F_ORDER_INTERVAL => $this->store->getVar(FE_ORDER_INTERVAL, STORE_SIP . STORE_ZERO),
F_ORDER_COLUMN => $this->store->getVar(FE_ORDER_COLUMN, STORE_SIP . STORE_ZERO),
F_DRAG_AND_DROP_ORDER_SQL => $dndOrderSql,
F_TABLE_NAME => $this->store->getVar(FE_DND_TABLE, STORE_SIP . STORE_ZERO)
];
return $this->doForm(FORM_DRAG_AND_DROP);
$dragAndDrop = new DragAndDrop($dummyFormSpec);
$json = $dragAndDrop->process();
} else {
// User-defined DragAndDrop
$json = $this->doForm(FORM_DRAG_AND_DROP);
}
return $json;
}
/**
......
......@@ -182,7 +182,7 @@ class Database {
$result = array();
$this->closeMysqliStmt();
// CR often forgets to specify the $mode and use prepared statement with parameter instead.
// CR (& EV) often forgets to specify the $mode and use prepared statement with parameter instead.
if (is_array($mode)) {
throw new CodeException("Probably a parameter forgotten: \$mode ?");
}
......
......@@ -52,6 +52,7 @@ class DragAndDrop {
* @throws CodeException
* @throws DbException
* @throws UserFormException
* @throws UserReportException
*/
public function __construct(array $formSpec = array(), $phpUnit = false) {
......
......@@ -192,4 +192,4 @@ class Excel {
return $column;
}
}
\ No newline at end of file
}
......@@ -172,18 +172,18 @@ INSERT INTO Form (id, name, title, noteInternal, tableName, permitNew, permitEdi
INSERT INTO FormElement (id, formId, name, label, mode, type, checkType, class, ord, size, note, clientJs, value,
sql1, parameter, feIdContainer, subrecordOption, modeSql, placeholder)
VALUES
(1, 1, 'basic', 'Basic', 'show', 'pill', 'all', 'container', 10, 0, '', '', '', '', '', 0, '', '', ''),
(2, 1, 'access', 'Access', 'show', 'pill', 'all', 'container', 20, 0, '', '', '', '', '', 0, '', '', ''),
(3, 1, 'various', 'Various', 'show', 'pill', 'all', 'container', 30, 0, '', '', '', '', '', 0, '', '', ''),
(4, 1, 'multi', 'Multi', 'show', 'pill', 'all', 'container', 40, 0, '', '', '', '', '', 0, '', '', ''),
(5, 1, 'formelement', 'Formelement', 'show', 'pill', 'all', 'container', 50, 0, '', '', '', '', '', 0, '', '', '');
(1, 1, 'basic', 'Basic', 'show', 'pill', 'all', 'container', 100, 0, '', '', '', '', '', 0, '', '', ''),
(2, 1, 'access', 'Access', 'show', 'pill', 'all', 'container', 400, 0, '', '', '', '', '', 0, '', '', ''),
(3, 1, 'various', 'Various', 'show', 'pill', 'all', 'container', 200, 0, '', '', '', '', '', 0, '', '', ''),
(4, 1, 'multi', 'Multi', 'show', 'pill', 'all', 'container', 300, 0, '', '', '', '', '', 0, '', '', ''),
(5, 1, 'formelement', 'Formelement', 'show', 'pill', 'all', 'container', 500, 0, '', '', '', '', '', 0, '', '', '');
# FormEditor: FormElements for 'form'
INSERT INTO FormElement (formId, name, label, mode, type, checkType, class, ord, size, maxLength, note, clientJs, value,
sql1, parameter, feIdContainer, subrecordOption, modeSql, placeholder, encode, dynamicUpdate, checkPattern)
VALUES
# Make the form a 'delete form' for records Form/FormElement.
(1, 'Delete FE', '', 'show', 'beforeDelete', 'all', 'action', 100, 0, 0, '', '', '', '',
(1, 'Delete FE', '', 'show', 'beforeDelete', 'all', 'action', 10, 0, 0, '', '', '', '',
'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',
......@@ -200,42 +200,42 @@ VALUES
'<a href="{{documentation:Y}}#multi-language-form">Info</a>', '', '', '', '', 1, '', '{{SELECT IF("{{formLanguageCId:YE}}"="","hidden","show" ) }}', '', 'none', 'no', ''),
(1, 'parameterLanguageD', 'Language: {{formLanguageDLabel:YE}}', 'show', 'text', 'all', 'native', 160, '60,2', 0,
'<a href="{{documentation:Y}}#multi-language-form">Info</a>', '', '', '', '', 1, '', '{{SELECT IF("{{formLanguageDId:YE}}"="","hidden","show" ) }}', '', 'none', 'no', ''),
(1, 'requiredParameterNew', 'Required Parameter NEW', 'show', 'text', 'all', 'native', 200, 0, 0, '<a href="{{documentation:Y}}#required-parameter-new-edit">Info</a>', '', '', '', '', 2, '', '', '', 'specialchar', 'no', ''),
(1, 'requiredParameterEdit', 'Required Parameter EDIT', 'show', 'text', 'all', 'native', 200, 0, 0, '<a href="{{documentation:Y}}#required-parameter-new-edit">Info</a>', '', '', '', '', 2, '', '', '', 'specialchar', 'no', ''),
(1, 'permitNew', 'Permit New', 'show', 'radio', 'all', 'native', 210, 0, 10, '<a href="{{documentation:Y}}#form-permitnewedit">Info</a>', '', '', '', 'buttonClass=btn-default', 2, '', '', '', 'specialchar', 'no', ''),
(1, 'permitEdit', 'Permit Edit', 'show', 'radio', 'all', 'native', 220, 0, 10, '<a href="{{documentation:Y}}#form-permitnewedit">Info</a>', '', '', '', 'buttonClass=btn-default', 2, '', '', '', 'specialchar', 'no', ''),
(1, 'escapeTypeDefault', 'Escape type default', 'show', 'radio', 'all', 'native', 230, 0, 10, '<a href="{{documentation:Y}}#variable-escape">Info</a>', '', '', '',
(1, 'requiredParameterNew', 'Required Parameter NEW', 'show', 'text', 'all', 'native', 410, 0, 0, '<a href="{{documentation:Y}}#required-parameter-new-edit">Info</a>', '', '', '', '', 2, '', '', '', 'specialchar', 'no', ''),
(1, 'requiredParameterEdit', 'Required Parameter EDIT', 'show', 'text', 'all', 'native', 410, 0, 0, '<a href="{{documentation:Y}}#required-parameter-new-edit">Info</a>', '', '', '', '', 2, '', '', '', 'specialchar', 'no', ''),
(1, 'permitNew', 'Permit New', 'show', 'radio', 'all', 'native', 420, 0, 10, '<a href="{{documentation:Y}}#form-permitnewedit">Info</a>', '', '', '', 'buttonClass=btn-default', 2, '', '', '', 'specialchar', 'no', ''),
(1, 'permitEdit', 'Permit Edit', 'show', 'radio', 'all', 'native', 430, 0, 10, '<a href="{{documentation:Y}}#form-permitnewedit">Info</a>', '', '', '', 'buttonClass=btn-default', 2, '', '', '', 'specialchar', 'no', ''),
(1, 'escapeTypeDefault', 'Escape type default', 'show', 'radio', 'all', 'native', 440, 0, 10, '<a href="{{documentation:Y}}#variable-escape">Info</a>', '', '', '',
'itemList=c:config,s:single,d:double,l:ldap search,L:ldap value,m:mysql realEscapeString,-:none\nbuttonClass=btn-default', 2, '', '', '', 'specialchar', 'no', ''),
(1, 'dirtyMode', 'Record Locking', 'show', 'radio', 'all', 'native', 240, 0, 10, '<a href="{{documentation:Y}}#locking-record">Info</a>', '', '', '',
(1, 'dirtyMode', 'Record Locking', 'show', 'radio', 'all', 'native', 450, 0, 10, '<a href="{{documentation:Y}}#locking-record">Info</a>', '', '', '',
'buttonClass=btn-default', 2, '', '', '', 'specialchar', 'no', ''),
(1, 'recordLockTimeoutSeconds', 'Lock timeout (seconds)', 'show', 'text', 'all', 'native', 245, 0, 0, '<a href="{{documentation:Y}}#locking-record">Info</a>', '',
(1, 'recordLockTimeoutSeconds', 'Lock timeout (seconds)', 'show', 'text', 'all', 'native', 455, 0, 0, '<a href="{{documentation:Y}}#locking-record">Info</a>', '',
'{{SELECT IF("{{recordLockTimeoutSeconds:R0}}"=0,"{{recordLockTimeoutSeconds:Y0}}","{{recordLockTimeoutSeconds:R0}}")}}', '', '', 2, '', '', '', 'specialchar', 'no', ''),
(1, 'showButton', 'Show button', 'show', 'checkbox', 'all', 'native', 250, 0, 5, '<a href="{{documentation:Y}}#showbutton">Info</a>', '', '', '', 'checkBoxMode = multi\norientation=vertical', 2, '', '', '', 'specialchar', 'no', ''),
(1, 'forwardMode', 'Forward', 'show', 'radio', 'all', 'native', 300, 0, 0, '<a href="{{documentation:Y}}#form-forward">Info</a>', '', '', '', 'buttonClass=btn-default', 3, '', '', '', 'specialchar', 'no', ''),
(1, 'forwardPage', 'Forward URL / Page', 'show', 'text', 'all', 'native', 310, 0, 0, '<a href="{{documentation:Y}}#form-forward">Info</a>', '', '', '', '', 3, '',
(1, 'showButton', 'Show button', 'show', 'checkbox', 'all', 'native', 450, 0, 5, '<a href="{{documentation:Y}}#showbutton">Info</a>', '', '', '', 'checkBoxMode = multi\norientation=vertical', 2, '', '', '', 'specialchar', 'no', ''),
(1, 'forwardMode', 'Forward', 'show', 'radio', 'all', 'native', 210, 0, 0, '<a href="{{documentation:Y}}#form-forward">Info</a>', '', '', '', 'buttonClass=btn-default', 3, '', '', '', 'specialchar', 'no', ''),
(1, 'forwardPage', 'Forward URL / Page', 'show', 'text', 'all', 'native', 220, 0, 0, '<a href="{{documentation:Y}}#form-forward">Info</a>', '', '', '', '', 3, '',
'', '', 'none', 'no', ''),
(1, 'parameter', 'Parameter', 'show', 'text', 'all', 'native', 320, '40,8', 0, '<a href="{{documentation:Y}}#form-parameter">Info</a>', '', '', '', '', 3, '', '', '', 'none', 'no', ''),
(1, 'bsLabelColumns', 'BS Label Columns', 'show', 'text', 'all', 'native', 330, 0, 0, '<a href="{{documentation:Y}}#form-layout">Info</a>', '', '', '', '', 3, '', '', '{{bsLabelColumns:Y}}', 'specialchar', 'no', ''),
(1, 'bsInputColumns', 'BS Input Columns', 'show', 'text', 'all', 'native', 340, 0, 0, '', '', '', '', '', 3, '', '', '{{bsInputColumns:Y}}', 'specialchar', 'no', ''),
(1, 'bsNoteColumns', 'BS Note Columns', 'show', 'text', 'all', 'native', 350, 0, 0, '', '', '', '', '', 3, '', '', '{{bsNoteColumns:Y}}', 'specialchar', 'no', ''),
(1, 'deleted', 'Deleted', 'show', 'checkbox', 'all', 'native', 360, 0, 0, '', '', '', '', '', 3, '', '', '', 'specialchar', 'no', ''),
(1, 'modified', 'Modified', 'readonly', 'text', 'all', 'native', 370, 0, 20, '', '', '', '', '', 3, '', '', '', 'specialchar', 'no', ''),
(1, 'created', 'Created', 'readonly', 'text', 'all', 'native', 380, 0, 20, '', '', '', '', '', 3, '', '', '',
(1, 'parameter', 'Parameter', 'show', 'text', 'all', 'native', 230, '40,8', 0, '<a href="{{documentation:Y}}#form-parameter">Info</a>', '', '', '', '', 3, '', '', '', 'none', 'no', ''),
(1, 'bsLabelColumns', 'BS Label Columns', 'show', 'text', 'all', 'native', 240, 0, 0, '<a href="{{documentation:Y}}#form-layout">Info</a>', '', '', '', '', 3, '', '', '{{bsLabelColumns:Y}}', 'specialchar', 'no', ''),
(1, 'bsInputColumns', 'BS Input Columns', 'show', 'text', 'all', 'native', 250, 0, 0, '', '', '', '', '', 3, '', '', '{{bsInputColumns:Y}}', 'specialchar', 'no', ''),
(1, 'bsNoteColumns', 'BS Note Columns', 'show', 'text', 'all', 'native', 260, 0, 0, '', '', '', '', '', 3, '', '', '{{bsNoteColumns:Y}}', 'specialchar', 'no', ''),
(1, 'deleted', 'Deleted', 'show', 'checkbox', 'all', 'native', 270, 0, 0, '', '', '', '', '', 3, '', '', '', 'specialchar', 'no', ''),
(1, 'modified', 'Modified', 'readonly', 'text', 'all', 'native', 280, 0, 20, '', '', '', '', '', 3, '', '', '', 'specialchar', 'no', ''),
(1, 'created', 'Created', 'readonly', 'text', 'all', 'native', 290, 0, 20, '', '', '', '', '', 3, '', '', '',
'specialchar', 'no', ''),
(1, 'multi', 'Multi', 'show', 'fieldset', 'all', 'native', 400, 0, 0, '', '', '', '', '', 4, '', '', '',
(1, 'multi', 'Multi', 'show', 'fieldset', 'all', 'native', 310, 0, 0, '', '', '', '', '', 4, '', '', '',
'specialchar', 'no', ''),
(1, 'multiMode', 'Multi Mode', 'show', 'radio', 'all', 'native', 410, 0, 0, '', '', '', '', '', 4, '', '', '',
(1, 'multiMode', 'Multi Mode', 'show', 'radio', 'all', 'native', 320, 0, 0, '', '', '', '', '', 4, '', '', '',
'specialchar', 'no', ''),
(1, 'multiSql', 'Multi SQL', 'show', 'text', 'all', 'native', 420, '40,3', 0, '', '', '', '', '', 4, '', '', '',
(1, 'multiSql', 'Multi SQL', 'show', 'text', 'all', 'native', 330, '40,3', 0, '', '', '', '', '', 4, '', '', '',
'none', 'no', ''),
(1, 'multiDetailForm', 'Multi Detail Form', 'show', 'text', 'all', 'native', 430, 0, 0, '', '', '', '', '', 4,
(1, 'multiDetailForm', 'Multi Detail Form', 'show', 'text', 'all', 'native', 340, 0, 0, '', '', '', '', '', 4,
'', '', '', 'specialchar', 'no', ''),
(1, 'multiDetailFormParameter', 'Multi Detail Form Parameter', 'show', 'text', 'all', 'native', 440, 0, 0, '', '',
(1, 'multiDetailFormParameter', 'Multi Detail Form Parameter', 'show', 'text', 'all', 'native', 350, 0, 0, '', '',
'', '', '', 4, '', '', '', 'none', 'no', ''),
(1, '', 'FormElements', 'show', 'subrecord', 'all', 'native', 500, 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.class DESC, feC.ord, fe.ord, fe.id}}',
(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(''<span id="qfq-dnd-ord-id-'', fe.id,''">'', fe.ord, ''</span><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',
'');
......@@ -256,11 +256,11 @@ INSERT INTO FormElement (id, formId, name, label, mode, type, checkType, class,
VALUES
(100, 2, 'basic', 'Basic', 'show', 'pill', 'all', 'container', 10, 0, '', '', '', '', '', 0, '', ''),
(101, 2, 'check_order', 'Check & Order', 'show', 'pill', 'all', 'container', 20, 0, '', '', '', '', '', 0, '',
(101, 2, 'check_order', 'Check & Order', 'show', 'pill', 'all', 'container', 290, 0, '', '', '', '', '', 0, '',
''),
(102, 2, 'layout', 'Layout', 'show', 'pill', 'all', 'container', 20, 0, '', '', '', '', '', 0, '', ''),
(103, 2, 'value', 'Value', 'show', 'pill', 'all', 'container', 20, 0, '', '', '', '', '', 0, '', ''),
(104, 2, 'info', 'Info', 'show', 'pill', 'all', 'container', 20, 0, '', '', '', '', '', 0, '', '');
(102, 2, 'layout', 'Layout', 'show', 'pill', 'all', 'container', 390, 0, '', '', '', '', '', 0, '', ''),
(103, 2, 'value', 'Value', 'show', 'pill', 'all', 'container', 490, 0, '', '', '', '', '', 0, '', ''),
(104, 2, 'info', 'Info', 'show', 'pill', 'all', 'container', 590, 0, '', '', '', '', '', 0, '', '');
INSERT INTO FormElement (formId, name, label, mode, type, checkType, class, ord, size, maxLength, note, clientJs, value,
sql1, parameter, feIdContainer, subrecordOption, dynamicUpdate, bsLabelColumns, bsInputColumns,
......
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