Commit 5e52d4d5 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Bug #4158 / Delete Button im Form fehlen die SIP Parameter.

Store.php: change function getNonSystemSipParam() from private to public
AbstractBuildForm.php, BuildFormBootstrap.php, BuildFormTable.php: use of getNonSystemSipParam() in deriveNewRecordUrlFromExistingSip() and createDeleteUrl()..
parent 2dda9bf2
......@@ -840,11 +840,10 @@ abstract class AbstractBuildForm {
* @throws \qfq\UserFormException
public function deriveNewRecordUrlFromExistingSip(&$toolTipNew) {
$urlParam = $this->store->getStore(STORE_SIP);
$urlParam[SIP_RECORD_ID] = 0;
$urlParam = $this->store->getNonSystemSipParam();
$urlParam[SIP_RECORD_ID] = 0;
$urlParam[SIP_FORM] = $this->formSpec[F_NAME];
......@@ -2227,7 +2226,7 @@ abstract class AbstractBuildForm {
// $buttonDelete = $this->buildButtonCode('delete-button', $toolTip, GLYPH_ICON_DELETE, $disabled);
$s = $this->createDeleteUrl($formElement[F_FINAL_DELETE_FORM], '', $row[$nameColumnId], RETURN_SIP);
$s = $this->createDeleteUrl($formElement[F_FINAL_DELETE_FORM], $row[$nameColumnId], RETURN_SIP);
// $rowHtml .= Support::wrapTag('<td>', Support::wrapTag("<button type='button' class='record-delete btn btn-default' data-sip='$s'>", '<span class="glyphicon ' . GLYPH_ICON_DELETE . '"></span>'));
$rowHtml .= Support::wrapTag('<td>', Support::wrapTag("<button type='button' class='record-delete btn btn-default' data-sip='$s' " . Support::doAttribute('title', $toolTip) . ">", '<span class="glyphicon ' . GLYPH_ICON_DELETE . '"></span>'));
......@@ -2531,22 +2530,15 @@ abstract class AbstractBuildForm {
* @return string String: "API_DIR/delete.php?sip=...."
* @throws CodeException
public function createDeleteUrl($formName, $tableName, $recordId, $mode = RETURN_URL) {
$queryStringArray = [
SIP_RECORD_ID => $recordId,
public function createDeleteUrl($formName, $recordId, $mode = RETURN_URL) {
if ($formName !== '') {
$queryStringArray[SIP_FORM] = $formName;
if ($tableName !== '') {
$queryStringArray[SIP_TABLE] = $tableName;
$urlParam = $this->store->getNonSystemSipParam(); // especially 'periodId' from calling URL should be passed to delete.php to evaluate it later.
$urlParam[SIP_RECORD_ID] = $recordId;
$urlParam[SIP_FORM] = $formName;
$queryString = Support::arrayToQueryString($queryStringArray);
$queryString = Support::arrayToQueryString($urlParam);
$sip = $this->store->getSipInstance();
......@@ -2656,8 +2648,8 @@ abstract class AbstractBuildForm {
$showTime = ($formElement[FE_TYPE] == 'time' || $formElement[FE_TYPE] == 'datetime') ? 1 : 0;
if($value=='CURRENT_TIMESTAMP') {
$value=date('Y-m-d H:i:s');
if ($value == 'CURRENT_TIMESTAMP') {
$value = date('Y-m-d H:i:s');
$value = Support::convertDateTime($value, $formElement[FE_DATE_FORMAT], $formElement[FE_SHOW_ZERO], $showTime, $formElement[FE_SHOW_SECONDS]);
......@@ -2678,7 +2670,7 @@ abstract class AbstractBuildForm {
throw new UserFormException("Checktype not applicable for date/time: '" . $formElement[FE_CHECK_TYPE] . "'", ERROR_NOT_APPLICABLE);
......@@ -483,7 +483,7 @@ class BuildFormBootstrap extends AbstractBuildForm {
$tabId = $this->getTabId();
if (0 < ($recordId = $this->store->getVar(SIP_RECORD_ID, STORE_SIP))) {
$deleteUrl = $this->createDeleteUrl($this->formSpec[F_FINAL_DELETE_FORM], '', $recordId);
$deleteUrl = $this->createDeleteUrl($this->formSpec[F_FINAL_DELETE_FORM], $recordId);
$actionUpload = FILE_ACTION . '=' . FILE_ACTION_UPLOAD;
......@@ -492,7 +492,7 @@ class BuildFormBootstrap extends AbstractBuildForm {
$apiDir = API_DIR;
$apiDeletePhp = API_DIR . '/' . API_DELETE_PHP;
$dirtyAction = ($this->formSpec[F_DIRTY_MODE]==DIRTY_MODE_NONE) ? '' : "dirtyUrl: '$apiDir/dirty.php',";
$dirtyAction = ($this->formSpec[F_DIRTY_MODE] == DIRTY_MODE_NONE) ? '' : "dirtyUrl: '$apiDir/dirty.php',";
$html .= '</form>'; // <form class="form-horizontal" ...
$html .= <<<EOF
......@@ -80,7 +80,7 @@ class BuildFormTable extends AbstractBuildForm {
$formEditUrl = $this->createFormEditorUrl(FORM_NAME_FORM, $this->formSpec[F_ID]);
$html .= "<p><a " . Support::doAttribute('href', $formEditUrl) . ">Edit</a><small>[$sipParamString]</small></p>";
$deleteUrl = $this->createDeleteUrl($this->formSpec[F_FINAL_DELETE_FORM], '', $this->store->getVar(SIP_RECORD_ID, STORE_SIP));
$deleteUrl = $this->createDeleteUrl($this->formSpec[F_FINAL_DELETE_FORM], $this->store->getVar(SIP_RECORD_ID, STORE_SIP));
$html .= "<p><a " . Support::doAttribute('href', $deleteUrl) . ">Delete</a>";
$html .= $this->wrapItem(WRAP_SETUP_TITLE, $this->formSpec[F_TITLE], true);
......@@ -627,7 +627,7 @@ class Store {
* @throws UserFormException
* @throws \qfq\CodeException
private static function getNonSystemSipParam() {
public static function getNonSystemSipParam() {
$tmpParam = array();
$sipArray = self::getStore(STORE_SIP);
......@@ -781,11 +781,11 @@ class Store {
public static function systemStoreUpdate() {
$storeSystem = self::getStore(STORE_SYSTEM);
if(!empty($storeSystem[SYSTEM_VAR_ADD_BY_SQL])) {
if (!empty($storeSystem[SYSTEM_VAR_ADD_BY_SQL])) {
$db = new qfq\Database();
$arr = $db->sql($storeSystem[SYSTEM_VAR_ADD_BY_SQL], ROW_EXPECT_0_1);
if(!empty($arr)) {
if (!empty($arr)) {
$storeSystem = array_merge($storeSystem, $arr);
self::setStore($storeSystem, STORE_SYSTEM, true);
Form.parameter & FormElement.parameter: Lines starting with '#' are treated as comments and will not be parsed.
Evaluate.php: parseArray() will skip lines starting with a '#'
AbstractBuildForm.php: templateGroup / row with the 'add' button , will be wrapped with the bs*Columns as defined in the FormElement templateGroup.
FillStoreForm.php: fixed problem with checkBoxes in templateGroups. During fillStoreForm the template group has been expanded to all possible elements - the logic for checkboxes expected that at least the '_h_<fe name>' Post Variable exist - which is not true for unexpanded elements.
index.rst: description for bsLabelColumn, bsInputColumn, bsNoteColumn
index.rst: styling errors fixed.
index.rst: reformat FormElement.parameter.
templateGroup: fixed problem with missing <div class='qfq-line'> around each copy of prefilled templateGroup.
AbstractBuildForm.php: pattern '%d' will be replaced by number of copy in FormElement 'label' and 'note'. Recode Logic to wrap templateGroup copies.
templateGroup values load until no further values exist
Load templateGroup values during form load.
AbstractBuildForm.php: implemented function templateGroupCollectFilledElements(). Add function.
FE_DYNAMIC_UPDATE: replaced explicit string against constant.
Save templateGroup.
AdministratorManual/Index.rst: extend sphinx setup doc, fix typo
UserManual/Index.rst: add doc for templateGroup
FillStore.php: Implement save for templateGroup
Merge remote-tracking branch 'origin/crose_work' into crose_work
index.rst: Form Layout
StoreTest.php: fixed phpunit problem with new config.qfq.ini
Merge remote-tracking branch 'origin/raos_work' into crose_work
#3232 Button individuelle 'on-change' Farbe definieren
BuildFormBootstrap.php, Store.php: conig.qfq.ini extended to hold new parameter, save button will be build with new attribute.
Respect attribute `data-class-on-change` on save buttons.
Index.rst: started to document form layout options
#3224, #3231 Html Tag <hr> als FormElement. >> htmlBefore | htmlAfter, FormElement.parameter = htmlBefore|htmlAfter implemented.
#3230 templateGroup: Abstaende zwischen Elementen. 'tgClass' implemented
BuildFormPlain.php: code restructured
Support.php: doAttribute() - Add feature to submit param arrays
TemplateGroup: implemented tags 'tgAddClass', 'tgAdd Text', 'tgRemoveClass', 'tgRemovceText'
AbstractBuildForm.php: see title
Merge remote-tracking branch 'origin/raos_work' into crose_work
Set template data on existing lines in order to enable renumbering.
AdminstratorManual/Index.rst: add description page.meta...
Fix off-by-one on max children constraint.
Merge remote-tracking branch 'origin/raos_work' into crose_work
Start numbering at 1 instead 0.
FieldTemplate.js: replace `%d` in `<label>` text when no children are present.
TestFormEditor.sql updated, played.
Wrap Row & Input Elements: specify 'row,/row' and bs*columns to 0 or bigger will enable/disable mutliple Elements per Row. FormElement.parameter.wrap* still have precedence over bs*Column settings.
Support.php, AbstractBuildForm.php: Recode way of initializing FormElements.
AbstractBuildForm.php: parameter to limit max number ob templateGrouup Elements.
BuildFormBootstrap.php: Labels will be hided if FormElement.bsLabelColumns=0.
BuildFormPlainTest.php: Fixed missing 'hidden'
AbstractBuildForm.php: #3066 / help-text with-error - Klasse 'hidden' wird nun gerendert und ausgeliefert.
Add 'templateGroup' as a new 'container' option. Beschreibung in Deutsch wie die Formularelemente , rekursiv, gerendert werden.
AbstractBuildForm.php: new function buildTemplateGroup()
BuildFormBootstrap.php, BuildFormPlain.php, BuildFormTable.php: Preparation for new optional TemplateGroup wrap.
QuickFormQuery.php: update comments.
formEditor.sql: column 'type' definition extended - new 'templateGroup' enum. FormElement 'type' updated to new container element 'templateGroup'
Do not use deprecated functions.
Introduced more suitable function names. Deprecated old function names. Documented public functions.
Index.rst: Add globalize.js to be included. Needed by jqx-all.js - *UPDATE EXUSTING TypoScript TEMPLATES of QFQ Installation* !!!
Implemented for FormElement: wrapRow, wrapLabel, wrapInput, wrapNote
FormElement.rowLabelInputNote are not respected anymore.
AbstractBuildForm.php: cleanup
BuildFormBootsrap.php: new function customWrap()
Constants.php: new wrapRow, wrapLabel, wrapInput, wrapNote
formEditor.sql: add new column 'rowLabelInputNote'
UPDATE `FormElement` SET rowLabelInputNote = 'row,label,/label,input,/input,note,/note,/row'
Merge remote-tracking branch 'origin/raos_work' into crose_work
Re-expand placeholders upon removal of line.
Retain placeholders when expanding template. This allows for re-expand.
Index.rst: Add a comment in FAQ.
formEditor.sql: The defintion as 'editor' (not text) for FormElement 'note' has been lost - reinsert in formEditor.sql.
Merge remote-tracking branch 'origin/crose_work' into raos_work
Expand Field Templates. QfqNS.addFields() requires now requires maximum lines argument.
Field Templates scaffold.
Index.rst: documented 3 examples for upload forms.
AbstractBuildForm.php: fixed bug with uninitialized FE_SLAVE_ID small updates in upload part
Support.php, AbstractBuildForm.php: new function falseemptyToZero().
Constants.php: New UPLOAD_MODE_*
Evaluate.php: fixed bug in 'skip' logic of evaluate->parseArray()
Save.php: doUpload() now returns $modeUpload, which are needed in doUploadSlave(), rewrote logic of doUploadSlave(),
'Upload advanced mode' implementiert. V2 (kein FormElement Action 'afterSave' mehr noetig)
Default fuer Store Prioritaet hat sich geaendert: alt='FSRD', neu='FSRVD' - damit wird ist es ueberfluessig den V Store anzugeben.
Variable '_filename' umbenannt in 'filename' und verschoben von STORE_FORM nach STORE_VARS. Damit ist es ueberfluessig eine Sanatize Klasse anzugeben.
STORE_VAR hat zwei neue Variablen: 'filename', 'fileDestination'.
Bei Form-Action Elemente gibt es zwei neue Typen: 'sqlBefore' und 'sqlAfter'
Index.rst: Dokumentation auf V2 angepasst. Doku fuer V1 hat es nie gegeben.
FormAction.php: Moved function initActionFormElement to HelperFormElement::initActionFormElement(), Implement sqlBefore & sqlAfter for Action Elemente.
HelperFormElement.php: new class initActionFormElement(), initUploadFormElement().
FillStoreForm.php, AbstractBuildForm.php, Evaluate.php: Implemented the $skip parameter to suppress unwanted variable expansion during form load.
- User Input will be UTF8 normalized.
* Install 'php5-intl' or 'php7.0-intl' on Webserver.
- formEditor.sql: Added HTML 'placeholder' in FormEditor for bs*Columns.
* Play 'formEditor.sql'.
- User input will be UTF8 normalized
- config.qfq-ini:
- Comment empty variables - the new default setting is, that empty parameter in config.qfq.ini means EMPTY (=parameter is set and will not be overwritten by internal default), not UNDEFINED (overwritten by internal default).
- FileUpload: Implemented new Formelement.parameter: fileReplace=always - will replace existing files.
- Multiple / Advanced Upload: new logic implements slaveId, sqlInsert, sqlUpdate, sqlDelete.
- FormElement.parameter: sqlBefore / sqlAfter fired during Form save.
- Index.rst:
- Fixed double include of validator.js in T3 Typoscript template example.
- Fix wrong store name SYSTEM: S > Y
- Update 'file-upload' doc.
- Fixed wrong STORE_FORM variable names.
- Use of 'decryptCurlyBraces()' to get better error messages.
- formEditor.sql: fixed problem while playing SQL query - deleting old FormElements of Formeditor deletes also FormElements of other forms.
New tag 0.11.0
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