Commit e28604f4 authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Merge remote-tracking branch 'origin/crose_work' into raos_work

parents 2daaa513 cc36b6a6
This diff is collapsed.
......@@ -15,6 +15,68 @@ Features
Bug Fixes
^^^^^^^^^
Version 0.16
------------
Changes
^^^^^^^
* Play:
ALTER TABLE `FormElement` ADD INDEX `feIdContainer` (`feIdContainer`);
ALTER TABLE `FormElement` ADD INDEX `ord` (`ord`);
ALTER TABLE `FormElement` ADD INDEX `feGroup` (`feGroup`);
ALTER TABLE `FormElement` ADD `adminNote` TEXT NOT NULL AFTER `note`;
* Play formEditor.sql
Features
^^^^^^^^
* formEditor.sql:
* Added 'on update current timestamp'.
* Add three indexes to formEditor.sql.
* Column FormElement.adminNote added.
* Change default width on Form for subrecord FormElement.name
* Changed input height of 'parameter of FormEditor and FormElementEditor to 8 lines.
* Enlarge placeholder value in FormElement. Old 512, New 2048.
* #3466 / Input Typeahead: optional only allow specified input. Mode: typeAheadPedantic
* #3465 / Save button: optional 'active after form load': `Form.parameter.saveButtonActive` - if this attribute is set,
the save button will be enabled directly on form load.
* #3463 / form.mode=readonly. Make a form complete `readonly`. This can be done statically or dynamically via variable (e.g. SIP).
* #3447 / Icons das man im FrontEnd direkt das gewaehlte FormElement im Formulareditor bearbeiten kann. Add checkbox left
to the 'EditForm'-Button, to toogle the 'FormElemnt'-Icons. Like the 'Form Edit'-Pencil, the 'FormElement Checkbox'
is only displayed if the user is logged in BE.
* #3456 / LDAP: with Credentials (e.g. to access 'webpass'). Updated doc for a) config.qfq.ini: LDAP_1_RDN, LDAP_1_PASSWORD,
b) Form.parameter|FormElement.parameter: ldapUseBindCredentials
* ErrorHandler.php: removed details - the end user should not too many details.
* FormAction.php, Ldap.php, QuickFormQuery.php: implement 'ldapUseBindCredentials'
* Ldap.php: set_error_handler() to catch ldap_bind() problems. Always set LDAP_OPT_PROTOCOL_VERSION=3 - this might cause problems with som LDAP Servers - we will see.
Bug Fixes
^^^^^^^^^
* 3509 / SELECT Element: value wird nicht selektiert
* 3502 / TemplateGroups: Checkboxen werden beim ersten Speichern (insert) nicht geschrieben - ein anschliessendes Update
ist ok
* 3385 / templateGroup: insert/update/delete non primary records
* Non primary record leads to a problem that the default values, given as an array, are not replaced by scalar values. fixed.
* Update doc how to insert/update/delete non primary templateGroup records.
* Removed $templateGroupIndex - solved implicit by defining a LIMIT on 'slaveId' . Implemented '%D' (one below %d). Implemented FE_SQL_HONOR_FORM_ELEMENTS - reduces unecassary SQL queries.
* Fill STORE_RECORD during Formload - to read templateGroup records very early. Local copy of `getNativeFormElements()`, new `explodeTemplateGroupElements()`
* TypeAhead.js: Handle <ENTER> key properly.
* #3462 / FormElement.parameter: requiredList not ok for non numeric content. STORE_FORM had been called without 'sanatize class'.
Therefore, all non numeric values has been sanatized by default. New: SANATIZE_ALLOW_ALL.
* Corrected error message to use 'itemList' instead of 'itemValues'. Renamed constant too.
* #2542 / FormElement-Typ 'note' funktioniert nicht mit dynamic update. 'Label' and 'note' are fixed - 'value' is still not updated, open.
Version 0.15
------------
......@@ -30,6 +92,10 @@ Changes
UPDATE FormElement SET parameter = REPLACE(parameter, 'typeAheadLdapKeyPrintf', 'typeAheadLdapIdPrintf')
* Size 'placeholder' increased::
ALTER TABLE `FormElement` CHANGE `placeholder` `placeholder` VARCHAR( 2048 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
Features
^^^^^^^^
......
......@@ -6,8 +6,8 @@
conf.py:
copyright: 2017
project: QFQ Extension
version: 0.15.0
release: 0.15.0
version: 0.16.0
release: 0.16.0
latex_documents:
- - Index
- qfq.tex
......
......@@ -57,9 +57,9 @@ copyright = u'2017, Carsten Rose'
# built documents.
#
# The short X.Y version.
version = '0.15'
version = '0.16'
# The full version, including alpha/beta/rc tags.
release = '0.15.0'
release = '0.16.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
Release
=======
Version 0.16
------------
Changes
^^^^^^^
* Play:
ALTER TABLE `FormElement` ADD INDEX `feIdContainer` (`feIdContainer`);
ALTER TABLE `FormElement` ADD INDEX `ord` (`ord`);
ALTER TABLE `FormElement` ADD INDEX `feGroup` (`feGroup`);
ALTER TABLE `FormElement` ADD `adminNote` TEXT NOT NULL AFTER `note`;
* Play formEditor.sql
Features
^^^^^^^^
* formEditor.sql:
* Added 'on update current timestamp'.
* Add three indexes to formEditor.sql.
* Column FormElement.adminNote added.
* Change default width on Form for subrecord FormElement.name
* Changed input height of 'parameter of FormEditor and FormElementEditor to 8 lines.
* Enlarge placeholder value in FormElement. Old 512, New 2048.
* #3466 / Input Typeahead: optional only allow specified input. Mode: typeAheadPedantic
* #3465 / Save button: optional 'active after form load': `Form.parameter.saveButtonActive` - if this attribute is set,
the save button will be enabled directly on form load.
* #3463 / form.mode=readonly. Make a form complete `readonly`. This can be done statically or dynamically via variable (e.g. SIP).
* #3447 / Icons das man im FrontEnd direkt das gewaehlte FormElement im Formulareditor bearbeiten kann. Add checkbox left
to the 'EditForm'-Button, to toogle the 'FormElemnt'-Icons. Like the 'Form Edit'-Pencil, the 'FormElement Checkbox'
is only displayed if the user is logged in BE.
* #3456 / LDAP: with Credentials (e.g. to access 'webpass'). Updated doc for a) config.qfq.ini: LDAP_1_RDN, LDAP_1_PASSWORD,
b) Form.parameter|FormElement.parameter: ldapUseBindCredentials
* ErrorHandler.php: removed details - the end user should not too many details.
* FormAction.php, Ldap.php, QuickFormQuery.php: implement 'ldapUseBindCredentials'
* Ldap.php: set_error_handler() to catch ldap_bind() problems. Always set LDAP_OPT_PROTOCOL_VERSION=3 - this might cause problems with som LDAP Servers - we will see.
Bug Fixes
^^^^^^^^^
* 3509 / SELECT Element: value wird nicht selektiert
* 3502 / TemplateGroups: Checkboxen werden beim ersten Speichern (insert) nicht geschrieben - ein anschliessendes Update
ist ok
* 3385 / templateGroup: insert/update/delete non primary records
* Non primary record leads to a problem that the default values, given as an array, are not replaced by scalar values. fixed.
* Update doc how to insert/update/delete non primary templateGroup records.
* Removed $templateGroupIndex - solved implicit by defining a LIMIT on 'slaveId' . Implemented '%D' (one below %d). Implemented FE_SQL_HONOR_FORM_ELEMENTS - reduces unecassary SQL queries.
* Fill STORE_RECORD during Formload - to read templateGroup records very early. Local copy of `getNativeFormElements()`, new `explodeTemplateGroupElements()`
* TypeAhead.js: Handle <ENTER> key properly.
* #3462 / FormElement.parameter: requiredList not ok for non numeric content. STORE_FORM had been called without 'sanatize class'.
Therefore, all non numeric values has been sanatized by default. New: SANATIZE_ALLOW_ALL.
* Corrected error message to use 'itemList' instead of 'itemValues'. Renamed constant too.
* #2542 / FormElement-Typ 'note' funktioniert nicht mit dynamic update. 'Label' and 'note' are fixed - 'value' is still not updated, open.
Version 0.15
------------
......
......@@ -10,5 +10,5 @@ $EM_CONF[$_EXTKEY] = array(
'dependencies' => 'fluid,extbase',
'clearcacheonload' => true,
'state' => 'alpha',
'version' => '0.15.0'
'version' => '0.16.6'
);
\ No newline at end of file
......@@ -13,6 +13,9 @@ use qfq;
require_once(__DIR__ . '/../qfq/QuickFormQuery.php');
require_once(__DIR__ . '/../qfq/store/Store.php');
require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../qfq/exceptions/UserFormException.php');
require_once(__DIR__ . '/../qfq/exceptions/CodeException.php');
require_once(__DIR__ . '/../qfq/exceptions/DbException.php');
/**
......
......@@ -420,6 +420,9 @@ abstract class AbstractBuildForm {
$value = '';
Support::setIfNotSet($formElement, FE_VALUE);
if (is_array($formElement[FE_VALUE])) {
$formElement[FE_VALUE] = (count($formElement[FE_VALUE])) > 0 ? current($formElement[FE_VALUE][0]) : '';
}
// If is FormElement['value'] explicit defined: take it
// There are two options: a) single value, b) array of values (template Group)
// if (is_array($formElement[FE_VALUE])) {
......@@ -482,7 +485,7 @@ abstract class AbstractBuildForm {
}
// Build 'FormElement' Edit symbol
$feEditUrl = $this->createFormEditorUrl(FORM_NAME_FORM_ELEMENT, $formElement[FE_ID], ['formId' => $formElement['formId']]);
$feEditUrl = $this->createFormEditorUrl(FORM_NAME_FORM_ELEMENT, $formElement[FE_ID], ['formId' => $formElement[FE_FORM_ID]]);
$titleAttr = Support::doAttribute('title', $this->formSpec[FE_NAME] . ' / ' . $formElement[FE_NAME] . ' [' . $formElement[FE_ID] . ']');
$icon = Support::wrapTag('<span class="' . GLYPH_ICON . ' ' . GLYPH_ICON_EDIT . '">', '');
$elementHtml .= Support::wrapTag("<a class='hidden " . CLASS_FORM_ELEMENT_EDIT . "' href='$feEditUrl' $titleAttr>", $icon);
......@@ -515,8 +518,9 @@ abstract class AbstractBuildForm {
$config = array();
if (isset($formElement[FE_FILL_STORE_LDAP]) || isset($formElement[FE_TYPEAHEAD_LDAP])) {
$keyNames = [F_LDAP_SERVER, F_LDAP_BASE_DN, F_LDAP_ATTRIBUTES, F_LDAP_SEARCH, F_TYPEAHEAD_LDAP_SEARCH,
F_TYPEAHEAD_LDAP_SEARCH_PREFETCH, F_TYPEAHEAD_LIMIT, F_TYPEAHEAD_MINLENGTH, F_TYPEAHEAD_LDAP_VALUE_PRINTF,
$keyNames = [F_LDAP_SERVER, F_LDAP_BASE_DN, F_LDAP_ATTRIBUTES,
F_LDAP_SEARCH, F_TYPEAHEAD_LDAP_SEARCH, F_TYPEAHEAD_LDAP_SEARCH_PER_TOKEN, F_TYPEAHEAD_LDAP_SEARCH_PREFETCH,
F_TYPEAHEAD_LIMIT, F_TYPEAHEAD_MINLENGTH, F_TYPEAHEAD_LDAP_VALUE_PRINTF,
F_TYPEAHEAD_LDAP_ID_PRINTF, F_LDAP_TIME_LIMIT, F_LDAP_USE_BIND_CREDENTIALS];
$formElement = OnArray::copyArrayItemsIfNotAlreadyExist($this->formSpec, $formElement, $keyNames);
} else {
......@@ -529,7 +533,7 @@ abstract class AbstractBuildForm {
$config = OnArray::getArrayItems($formElement, [FE_LDAP_SERVER, FE_LDAP_BASE_DN, FE_LDAP_SEARCH, FE_LDAP_ATTRIBUTES]);
$config = $this->evaluate->parseArray($config);
if($formElement[FE_LDAP_USE_BIND_CREDENTIALS]==1) {
if ($formElement[FE_LDAP_USE_BIND_CREDENTIALS] == 1) {
$config[SYSTEM_LDAP_1_RDN] = $this->store->getVar(SYSTEM_LDAP_1_RDN, STORE_SYSTEM);
$config[SYSTEM_LDAP_1_PASSWORD] = $this->store->getVar(SYSTEM_LDAP_1_PASSWORD, STORE_SYSTEM);
}
......@@ -933,11 +937,14 @@ abstract class AbstractBuildForm {
FE_TYPEAHEAD_LDAP_SEARCH => $formElement[FE_TYPEAHEAD_LDAP_SEARCH],
FE_TYPEAHEAD_LDAP_SEARCH_PREFETCH => $formElement[FE_TYPEAHEAD_LDAP_SEARCH_PREFETCH],
FE_TYPEAHEAD_LDAP_VALUE_PRINTF => $formElement[FE_TYPEAHEAD_LDAP_VALUE_PRINTF],
FE_TYPEAHEAD_LDAP_KEY_PRINTF => $formElement[FE_TYPEAHEAD_LDAP_KEY_PRINTF],
FE_TYPEAHEAD_LIMIT => $formElement[FE_TYPEAHEAD_LIMIT],
];
if($formElement[FE_LDAP_USE_BIND_CREDENTIALS]=='1') {
if (isset($formElement[FE_TYPEAHEAD_LDAP_SEARCH_PER_TOKEN])) {
$arr[FE_TYPEAHEAD_LDAP_SEARCH_PER_TOKEN] = '1';
}
if ($formElement[FE_LDAP_USE_BIND_CREDENTIALS] == '1') {
$arr[SYSTEM_LDAP_1_RDN] = $this->store->getVar(SYSTEM_LDAP_1_RDN, STORE_SYSTEM);
$arr[SYSTEM_LDAP_1_PASSWORD] = $this->store->getVar(SYSTEM_LDAP_1_PASSWORD, STORE_SYSTEM);
}
......@@ -1553,6 +1560,26 @@ abstract class AbstractBuildForm {
}
}
/**
* @param array $formElement
* @param $htmlFormElementName
* @param $htmlHidden
* @throws CodeException
* @throws UserFormException
*/
private function fillStoreAdditionalFormElementsCheckboxHidden(array $formElement, $htmlFormElementName, $htmlHidden) {
if (isset($formElement[NAME_TG_COPIES]) && $formElement[NAME_TG_COPIES] > 0) {
for ($ii = 1; $ii <= $formElement[NAME_TG_COPIES]; $ii++) {
$key = str_replace('%d', $ii, $htmlFormElementName);
$value = str_replace('%d', $ii, $htmlHidden);
$this->store->setVar($key, $value, STORE_ADDITIONAL_FORM_ELEMENTS, true);
}
} else {
$this->store->setVar($htmlFormElementName, $htmlHidden, STORE_ADDITIONAL_FORM_ELEMENTS, false);
}
}
/**
* Build as many Checkboxes as items.
*
......@@ -1579,7 +1606,7 @@ abstract class AbstractBuildForm {
$key = HelperFormElement::prependFormElementNameCheckBoxMulti($htmlFormElementName, 'h');
$htmlHidden = $this->buildNativeHidden($key, '');
$this->store->setVar($htmlFormElementName, $htmlHidden, STORE_ADDITIONAL_FORM_ELEMENTS, false);
$this->fillStoreAdditionalFormElementsCheckboxHidden($formElement, $htmlFormElementName, $htmlHidden);
$html = '';
......@@ -1649,7 +1676,8 @@ abstract class AbstractBuildForm {
$key = HelperFormElement::prependFormElementNameCheckBoxMulti($htmlFormElementName, 'h');
$htmlHidden = $this->buildNativeHidden($key, '');
$this->store->setVar($htmlFormElementName, $htmlHidden, STORE_ADDITIONAL_FORM_ELEMENTS, false);
$this->fillStoreAdditionalFormElementsCheckboxHidden($formElement, $htmlFormElementName, $htmlHidden);
$html = '';
......@@ -1989,7 +2017,7 @@ abstract class AbstractBuildForm {
'selected' => ($itemKey[$ii] == $value && $firstSelect)
];
if ($itemKey[$ii] === $value && $firstSelect) {
if ($itemKey[$ii] == $value && $firstSelect) {
$option .= 'selected';
$firstSelect = false;
}
......@@ -2532,9 +2560,12 @@ abstract class AbstractBuildForm {
$value = substr($value, 0, $formElement[FE_MAX_LENGTH]);
}
$type = $formElement[FE_TYPE];
if ($type === 'datetime')
$type = 'datetime-local';
// See: https://project.math.uzh.ch/issues/3536
// $type = $formElement[FE_TYPE];
// if ($type === 'datetime') {
// $type = 'datetime-local';
// }
$type = 'text'; // date|time|datetime|datetime-local are not appropriate - only I18n representation possible.
$attribute .= Support::doAttribute('type', $type);
......@@ -2895,6 +2926,21 @@ abstract class AbstractBuildForm {
return $html;
}
/**
* @param array $formElementArr
* @param $tgMaxCopies
* @return array
*/
private function fillFeSpecNativeCheckboxWithTgMax(array $formElementArr, $tgMaxCopies) {
foreach ($formElementArr as $key => $formElement) {
if ($formElement[FE_TYPE] = FE_TYPE_CHECKBOX) {
$formElementArr[$key][NAME_TG_COPIES] = $tgMaxCopies;
}
}
return $formElementArr;
}
/**
* Build a 'templateGroup'. Renders all assigned FormElements of the templateGroup.
* If there are already vlaues for the formElements, fill as much copies as values exist
......@@ -2952,15 +2998,18 @@ EOT;
// child FE's
$this->feSpecNative = $this->db->getNativeFormElements(SQL_FORM_ELEMENT_SPECIFIC_CONTAINER,
['yes', $this->formSpec["id"], 'native,container', $formElement['id']], $this->formSpec);
['yes', $this->formSpec[F_ID], 'native,container', $formElement[FE_ID]], $this->formSpec);
// Count defined FormElements in the current templateGroup
$elementsTotal = count($this->feSpecNative);
if ($elementsTotal < 1) {
// Nothting to do: return.
$this->feSpecNative = $feSpecNativeSave;
return '';
}
$this->feSpecNative = $this->fillFeSpecNativeCheckboxWithTgMax($this->feSpecNative, $max);
// If there are already elements filled, take them.
$html = $this->templateGroupCollectFilledElements($max, $htmlDelete, $json);
......@@ -3025,7 +3074,8 @@ EOT;
}
$default = $this->store->getStore(STORE_TABLE_DEFAULT); // current defaults
// evaluate FE_VALUE on all templateGroup FormElements.
// evaluate FE_VALUE on all templateGroup FormElements: After this call, in case of non-primary FEs, FE_VALUE
// might contain an array of values for all copies of the current FE.
$maxForeignRecords = $this->templateGroupDoValue();
$lastFilled = 0; // Marker if there is at least one element per copy who is filled.
......@@ -3035,16 +3085,16 @@ EOT;
// Per copy, iterate over all templateGroup FormElements.
foreach ($this->feSpecNative as $fe) {
$columnName = str_replace(FE_TEMPLATE_GROUP_NAME_PATTERN, $ii, $fe[FE_NAME]);
$fe[FE_NAME] = str_replace(FE_TEMPLATE_GROUP_NAME_PATTERN, $ii, $fe[FE_NAME]);
$fe[FE_LABEL] = str_replace(FE_TEMPLATE_GROUP_NAME_PATTERN, $ii, $fe[FE_LABEL]);
$fe[FE_NOTE] = str_replace(FE_TEMPLATE_GROUP_NAME_PATTERN, $ii, $fe[FE_NOTE]);
$columnName = $fe[FE_NAME];
// Column of primary table?
if (isset($record[$columnName])) {
if ($record[$columnName] != $default[$columnName]) {
$lastFilled = max($ii, $lastFilled);
}
$fe[FE_NAME] = $columnName;
} else {
$lastFilled = max($maxForeignRecords, $lastFilled);
......@@ -3053,6 +3103,7 @@ EOT;
}
// $fe[FE_TEMPLATE_GROUP_CURRENT_IDX] = $ii;
}
$feSpecNativeCopy[$ii - 1][] = $fe; // Build array with current copy of templateGroup.
}
......@@ -3089,7 +3140,10 @@ EOT;
/**
* Evaluate for all FormElements of the current templateGroup the field FE_VALUE.
* If the specific FormElement is not a real column of the primary table, than the value is probably a '{{!SELECT ...'
* Statement, that one will be fired. Additional the maximum count of all select rows will be determined and returned.
* statement, that one will be fired.
* In case of an non-primary FE, the result array are the values for the copies of the specific FE.
*
* Additional the maximum count of all select rows will be determined and returned.
*
* @return int max number of records in FormElement[FE_VALUE] over all FormElements.
* @throws UserFormException
......
......@@ -132,14 +132,62 @@ class BuildFormBootstrap extends AbstractBuildForm {
* @return string - the rendered Checkbox
*/
private function buildShowEditFormElementCheckbox() {
// EditFormElement Icons
$js = '$(".' . CLASS_FORM_ELEMENT_EDIT . '").toggleClass("hidden")';
$element = "<input type='checkbox' onchange='" . $js . "'>" .
Support::wrapTag("<span title='Toggle: Edit form element icons' class='" . GLYPH_ICON . ' ' . GLYPH_ICON_TASKS . "'>", '');
$element = Support::wrapTag('<label class="btn btn-default navbar-btn">', $element);
return Support::wrapTag('<div class="btn-group" data-toggle="buttons">', $element);
}
/**
* Creates a link to open current form loaded in FormEditor
*
* @return string - the rendered Checkbox
*/
private function buildViewForm() {
$form = false;
$url = '';
$status = '';
switch ($this->formSpec[F_NAME]) {
case 'form':
$form = $this->store->getVar(F_NAME, STORE_RECORD);
break;
case 'formElement':
if (false !== ($formId = $this->store->getVar(FE_FORM_ID, STORE_SIP . STORE_RECORD))) {
$row = $this->db->sql("SELECT f.name FROM Form AS f WHERE id=" . $formId, ROW_EXPECT_1);
$form = current($row);
}
break;
default:
return '';
}
if ($form === false) {
$toolTip = "Form not 'form' or 'formElement'";
$status = 'disabled';
} else {
$queryStringArray = [
'id' => $this->store->getVar(SYSTEM_EDIT_FORM_PAGE, STORE_SYSTEM),
'form' => $form,
'r' => 0
];
$queryString = Support::arrayToQueryString($queryStringArray);
$sip = $this->store->getSipInstance();
$url = $sip->queryStringToSip($queryString);
$toolTip = "View current form with r=0" . PHP_EOL . PHP_EOL . OnArray::toString($queryStringArray, ' = ', PHP_EOL, "'");
}
return $this->buildButtonAnchor('form-view-' . $this->formSpec[F_ID], $url, $toolTip, GLYPH_ICON_VIEW, $status);
}
// glyphicon glyphicon-eye-open
/**
* Build Buttons panel on top right corner of form.
* Simulate Submit Button: http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml
......@@ -160,7 +208,9 @@ class BuildFormBootstrap extends AbstractBuildForm {
$toolTip = "Edit form" . PHP_EOL . PHP_EOL . OnArray::toString($this->store->getStore(STORE_SIP), ' = ', PHP_EOL, "'");
$url = $this->createFormEditorUrl(FORM_NAME_FORM, $this->formSpec[F_ID]);
$buttonEditForm = $this->buildShowEditFormElementCheckbox() . $this->buildButtonAnchor('form-edit-button', $url, $toolTip, GLYPH_ICON_TOOL);
$buttonEditForm = $this->buildViewForm() .
$this->buildShowEditFormElementCheckbox() .
$this->buildButtonAnchor('form-edit-button', $url, $toolTip, GLYPH_ICON_TOOL);
}
// Button: Save
......@@ -215,15 +265,23 @@ class BuildFormBootstrap extends AbstractBuildForm {
}
/**
* @param $id
* @param $url
* @param $title
* @param $icon
* Generic function to create a button with a given id, $url, $title, $icon (=glyph), $disabled
* @param string $id
* @param string $url
* @param string $title
* @param string $icon
* @param string $disabled
* @return string
*/
private function buildButtonAnchor($id, $url, $title, $icon, $disabled = '') {
return "<a " . Support::doAttribute('href', $url) . " id='$id' class='btn btn-default navbar-btn $disabled' " . Support::doAttribute('title', $title) . "><span class='glyphicon $icon'></span></a>";
$icon = Support::wrapTag("<span " . Support::doAttribute('class', "glyphicon $icon") . ">", '');
$attribute = Support::doAttribute('href', $url);
$attribute .= Support::doAttribute('id', $id);
$attribute .= Support::doAttribute('class', "btn btn-default navbar-btn $disabled");
$attribute .= Support::doAttribute('title', $title);
return Support::wrapTag("<a $attribute>", $icon);
}
/**
......
......@@ -549,6 +549,7 @@ const GLYPH_ICON_TOOL = 'glyphicon-wrench';
const GLYPH_ICON_CHECK = 'glyphicon-ok';
const GLYPH_ICON_CLOSE = 'glyphicon-remove';
const GLYPH_ICON_TASKS = 'glyphicon-tasks';
const GLYPH_ICON_VIEW = 'glyphicon-eye-open';
// FORM
const F_ID = 'id';
......@@ -588,6 +589,7 @@ const F_TYPEAHEAD_LDAP_VALUE_PRINTF = 'typeAheadLdapValuePrintf';
const F_TYPEAHEAD_LDAP_ID_PRINTF = 'typeAheadLdapIdPrintf';
const F_TYPEAHEAD_LDAP_SEARCH = 'typeAheadLdapSearch';
const F_TYPEAHEAD_LDAP_SEARCH_PREFETCH = 'typeAheadLdapSearchPrefetch';
const F_TYPEAHEAD_LDAP_SEARCH_PER_TOKEN = 'typeAheadLdapSearchPerToken';
const F_MODE = 'mode';
const F_MODE_READONLY = 'readonly';
......@@ -610,6 +612,7 @@ const FE_SUBRECORD_ROW_TITLE = '_rowTitle';
// FormElement columns: real
const FE_ID = 'id';
const FE_ID_CONTAINER = 'feIdContainer';
const FE_FORM_ID = 'formId';
const FE_NAME = 'name';
const FE_TYPE = 'type';
const FE_MODE = 'mode';
......@@ -626,6 +629,7 @@ const FE_WRAP_ROW_LABEL_INPUT_NOW = 'rowLabelInputNote';
const FE_MAX_LENGTH = 'maxLength';
const FE_PARAMETER = 'parameter';
const FE_TYPE_CHECKBOX = 'checkbox';
// FormElement columns: via parameter field
const FE_DATE_FORMAT = 'dateFormat'; // value: FORMAT_DATE_INTERNATIONAL | FORMAT_DATE_GERMAN
......@@ -644,6 +648,7 @@ const FE_SQL_BEFORE = 'sqlBefore'; // Action: Always fired
const FE_SQL_UPDATE = 'sqlUpdate'; // Action: Update Statement for slave record
const FE_SQL_INSERT = 'sqlInsert'; // Action: Insert Statement to create slave record.
const FE_SQL_DELETE = 'sqlDelete'; // Action: Delete Statement to delete unused slave record.
const FE_SQL_HONOR_FORM_ELEMENTS = 'sqlHonorFormElements'; // Action: Honor given list of FormElements for sqlInsert|Update|Delete
const FE_EDITOR_PREFIX = 'editor-'; // TinyMCE configuration settings.
const FE_SENDMAIL_TO = 'sendMailTo'; // Receiver email adresses. Separate multiple by comma.
const FE_SENDMAIL_CC = 'sendMailCc'; // CC Receiver email adresses. Separate multiple by comma.
......@@ -672,6 +677,7 @@ const FE_TEMPLATE_GROUP_REMOVE_TEXT = 'tgRemoveText';
const FE_TEMPLATE_GROUP_CLASS = 'tgClass';
const FE_TEMPLATE_GROUP_DEFAULT_MAX_LENGTH = 5;
const FE_TEMPLATE_GROUP_NAME_PATTERN = '%d';
const FE_TEMPLATE_GROUP_NAME_PATTERN_0 = '%D';
const FE_TEMPLATE_GROUP_CURRENT_IDX = 'tgCurentIndex';
const FE_BUTTON_CLASS = 'buttonClass';
const FE_LDAP_SERVER = F_LDAP_SERVER;
......@@ -689,15 +695,21 @@ const FE_TYPEAHEAD_LDAP_KEY_PRINTF = F_TYPEAHEAD_LDAP_ID_PRINTF;
const FE_TYPEAHEAD_LDAP = 'typeAheadLdap';
const FE_TYPEAHEAD_LDAP_SEARCH = F_TYPEAHEAD_LDAP_SEARCH;
const FE_TYPEAHEAD_LDAP_SEARCH_PREFETCH = F_TYPEAHEAD_LDAP_SEARCH_PREFETCH;
const FE_TYPEAHEAD_LDAP_SEARCH_PER_TOKEN = F_TYPEAHEAD_LDAP_SEARCH_PER_TOKEN;
const FE_FILL_STORE_LDAP = 'fillStoreLdap';
const FE_CHARACTER_COUNT_WRAP = 'characterCountWrap';
const RETYPE_FE_NAME_EXTENSION = 'RETYPE';
const TYPEAHEAD_PLACEHOLDER = '?';
const FE_HTML_ID = 'htmlId'; // Will be dynamically computed during runtime.
// FormElement Types
const FE_TYPE_UPLOAD = 'upload';
const FE_TYPE_EXTRA = 'extra';
const FE_TYPE_SUBRECORD = 'subrecord';
const FE_TYPE_NOTE = 'note';
const FE_TYPE_SENDMAIL = 'sendMail';
const FE_TYPE_BEFORE_LOAD = 'beforeLoad';
const FE_TYPE_BEFORE_SAVE = 'beforeSave';
......@@ -710,6 +722,8 @@ const FE_TYPE_AFTER_INSERT = 'afterInsert';
const FE_TYPE_AFTER_UPDATE = 'afterUpdate';
const FE_TYPE_AFTER_DELETE = 'afterDelete';
const FE_TYPE_TEMPLATE_GROUP = 'templateGroup';
// SUPPORT
const PARAM_T3_ALL = 't3 all';
const PARAM_T3_NO_ID = "t3 no id";
......@@ -816,4 +830,6 @@ const COLUMN_PAGEN = "pagen";
const COLUMN_PAGES = "pages";
const FORM_NAME_FORM = 'form';
const FORM_NAME_FORM_ELEMENT = 'formElement';
\ No newline at end of file
const FORM_NAME_FORM_ELEMENT = 'formElement';
const PENALTY_TIME_BROKEN_SIP = 5;
\ No newline at end of file
......@@ -650,9 +650,6 @@ class Database {
// Check for retype FormElements which have to duplicated.
$feSpecNative = HelperFormElement::duplicateRetypeElements($feSpecNative);
// Check for templateGroup Elements to explode them
$feSpecNative = HelperFormElement::explodeTemplateGroupElements($feSpecNative);
// Copy Attributes to FormElements
$feSpecNative = HelperFormElement::copyAttributesToFormElements($formSpec, $feSpecNative);
......
......@@ -226,7 +226,9 @@ class QuickFormQuery {
$fillStoreForm->process();
}
$formName = $this->loadFormSpecification($formMode, $foundInStore);
$recordId = $this->store->getVar(SIP_RECORD_ID, STORE_SIP . STORE_TYPO3 . STORE_CLIENT);