Commit 4b24be4f authored by Carsten  Rose's avatar Carsten Rose
Browse files

#4426 / Subrecord: mode=hidden - still shown

AbstractBuildForm.php: remove some useless code.
BuildFormBootsrap.php: wrap whole subrecord element in a span class. Add HTML id to the span class to later enable/disable them.
parent 286ad90b
......@@ -2290,7 +2290,7 @@ abstract class AbstractBuildForm {
public function buildSubrecord(array $formElement, $htmlFormElementName, $value, array &$json, $mode = FORM_LOAD) {
$rcText = false;
$nameColumnId = 'id';
$targetTableName = '';
// $targetTableName = '';
$flagNew = false;
$flagEdit = false;
$flagDelete = false;
......@@ -2313,9 +2313,9 @@ abstract class AbstractBuildForm {
// Decode settings in subrecordOption
$flagNew = Support::findInSet(SUBRECORD_NEW, $formElement[FE_SUBRECORD_OPTION]);
$flagEdit = Support::findInSet(SUBRECORD_EDIT, $formElement[FE_SUBRECORD_OPTION]);
if ($flagDelete = Support::findInSet(SUBRECORD_DELETE, $formElement[FE_SUBRECORD_OPTION])) {
$targetTableName = $this->getFormTable($formElement[SUBRECORD_PARAMETER_FORM]);
}
// if ($flagDelete = Support::findInSet(SUBRECORD_DELETE, $formElement[FE_SUBRECORD_OPTION])) {
// $targetTableName = $this->getFormTable($formElement[SUBRECORD_PARAMETER_FORM]);
// }
}
$columns = $linkNew;
......@@ -2379,7 +2379,7 @@ abstract class AbstractBuildForm {
$html .= Support::wrapTag("<tr $rowAttribute>", $rowHtml, true);
}
return Support::wrapTag('<table class="table table-hover">', $html, true);
return Support::wrapTag("<table class='table table-hover'>", $html, true);
}
/**
......
......@@ -704,11 +704,14 @@ EOF;
* @return string
*/
public function buildRowSubrecord(array $formElement, $elementHtml) {
$html = '';
$html .= $this->wrapItem(WRAP_SETUP_ELEMENT, $this->wrapItem(WRAP_SETUP_SUBRECORD, $formElement[FE_LABEL]));
$html = $this->wrapItem(WRAP_SETUP_ELEMENT, $this->wrapItem(WRAP_SETUP_SUBRECORD, $formElement[FE_LABEL]));
$html .= $this->wrapItem(WRAP_SETUP_ELEMENT, $this->wrapItem(WRAP_SETUP_SUBRECORD, $elementHtml));
$html .= $this->wrapItem(WRAP_SETUP_ELEMENT, $this->wrapItem(WRAP_SETUP_SUBRECORD, $formElement[FE_NOTE]));
return $html;
$attribute = ($formElement[FE_MODE] == FE_MODE_HIDDEN) ? ' style="display: none;"' : '';
$attribute .= Support::doAttribute('id', $formElement[FE_HTML_ID]);
return Support::wrapTag("<span name='qfq-subrecord' $attribute>", $html);
}
}
\ No newline at end of file
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