Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
1c59a11d
Commit
1c59a11d
authored
Aug 26, 2018
by
Carsten Rose
Browse files
Merge branch '5876-subrecord-edit-delete-head' into 'master'
Feature #5876 - subrecordColumnTitleEdit/Delete See merge request
!61
parents
e1b5c8ad
99e00c01
Pipeline
#766
passed with stage
in 1 minute and 41 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extension/Documentation/Manual.rst
View file @
1c59a11d
...
...
@@ -3300,6 +3300,8 @@ will be rendered inside the form as a HTML table.
statements) might be used.
* *subrecordTableClass*: Optional. Default: 'table table-hover qfq-table-100'. If given, the default will be overwritten.
* *subrecordColumnTitleEdit*: Optional. Will be rendered as the column title for the new/edit column.
* *subrecordColumnTitleDelete*: Optional. Will be rendered as the column title for the delete column.
**Subrecord DragAndDrop**
...
...
@@ -3821,7 +3823,7 @@ Parameter
* FormElement.type = subrecord
Subrecord's will automatically create `new`, `edit` and `delete` links. To inject parameter in those automatically created
links, use `FormElement.parameter.detail` . See
`
subrecord-option
`
.
links, use `FormElement.parameter.detail` . See subrecord-option
_
.
* FormElement.type = extra
...
...
extension/qfq/qfq/AbstractBuildForm.php
View file @
1c59a11d
...
...
@@ -2337,14 +2337,14 @@ abstract class AbstractBuildForm {
/**
* @param string $linkNew Complete Button, incl. SIP href
* @param
bool $flagDelete Flag to show if there is columns 'delete'
rendered
.
* @param
string $deleteColumnTitle - if null, no delete column is
rendered
* @param array $firstRow First row of all subrecords to extract columntitles
* @param array $control Array with <th> column names / format.
*
* @return string
* @throws UserFormException
*/
private
function
subrecordHead
(
$linkNew
,
$flagDelete
,
array
$firstRow
,
array
&
$control
)
{
private
function
subrecordHead
(
$linkNew
,
$flagDelete
,
$deleteTitle
,
array
$firstRow
,
array
&
$control
)
{
$columns
=
$linkNew
;
...
...
@@ -2357,7 +2357,7 @@ abstract class AbstractBuildForm {
}
if
(
$flagDelete
)
{
$columns
.
=
'
<th></th>
'
;
$columns
.
=
"
<th>
$deleteTitle
</th>
"
;
}
return
Support
::
wrapTag
(
'<thead><tr>'
,
$columns
);
...
...
@@ -2407,7 +2407,9 @@ abstract class AbstractBuildForm {
$flagEdit
=
Support
::
findInSet
(
SUBRECORD_EDIT
,
$formElement
[
FE_SUBRECORD_OPTION
]);
$flagDelete
=
Support
::
findInSet
(
SUBRECORD_DELETE
,
$formElement
[
FE_SUBRECORD_OPTION
])
&&
(
$formElement
[
FE_MODE
]
!=
FE_MODE_READONLY
);
$linkNew
=
$flagNew
?
Support
::
wrapTag
(
'<th>'
,
$this
->
createFormLink
(
$formElement
,
0
,
$primaryRecord
,
$this
->
symbol
[
SYMBOL_NEW
],
'New'
))
:
'<th></th>'
;
$editColumnTitle
=
$flagNew
?
$this
->
createFormLink
(
$formElement
,
0
,
$primaryRecord
,
$this
->
symbol
[
SYMBOL_NEW
],
'New'
)
:
''
;
$editColumnTitle
.
=
' '
.
$formElement
[
SUBRECORD_COLUMN_TITLE_EDIT
];
$linkNew
=
Support
::
wrapTag
(
'<th>'
,
$editColumnTitle
);
}
// Determine if DragAndDrop is active
...
...
@@ -2436,7 +2438,7 @@ abstract class AbstractBuildForm {
}
$firstRow
=
isset
(
$formElement
[
FE_SQL1
][
0
])
?
$formElement
[
FE_SQL1
][
0
]
:
array
();
$htmlHead
=
$this
->
subrecordHead
(
$linkNew
,
$flagDelete
,
$firstRow
,
$control
);
$htmlHead
=
$this
->
subrecordHead
(
$linkNew
,
$flagDelete
,
$formElement
[
SUBRECORD_COLUMN_TITLE_DELETE
],
$firstRow
,
$control
);
$htmlBody
=
''
;
foreach
(
$formElement
[
FE_SQL1
]
as
$row
)
{
$rowHtml
=
''
;
...
...
extension/qfq/qfq/Constants.php
View file @
1c59a11d
...
...
@@ -754,6 +754,8 @@ const ALIGN_VERTICAL = 'vertical';
// Subrecord
const
SUBRECORD_COLUMN_DEFAULT_MAX_LENGTH
=
20
;
const
SUBRECORD_COLUMN_TITLE_EDIT
=
'subrecordColumnTitleEdit'
;
const
SUBRECORD_COLUMN_TITLE_DELETE
=
'subrecordColumnTitleDelete'
;
const
FORM_ELEMENTS_NATIVE
=
'native'
;
const
FORM_ELEMENTS_SUBRECORD
=
'subrecord'
;
const
FORM_ELEMENTS_NATIVE_SUBRECORD
=
'native_subrecord'
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment