diff --git a/extension/Source/core/helper/HelperFormElement.php b/extension/Source/core/helper/HelperFormElement.php index bee39c15e08e074847daedabccd85a00084098c7..c0da9d8926d6cb69c2bcb2e628978e88eeacdd75 100644 --- a/extension/Source/core/helper/HelperFormElement.php +++ b/extension/Source/core/helper/HelperFormElement.php @@ -35,6 +35,7 @@ class HelperFormElement { * @throws UserReportException */ public static function explodeParameterInArrayElements(array &$elements, $keyName) { + foreach ($elements AS $key => $element) { self::explodeParameter($element, $keyName); $elements[$key] = $element; @@ -50,6 +51,7 @@ class HelperFormElement { public static function formElementSetDefault(array $elements) { foreach ($elements AS $key => $element) { $elements[$key][FE_TG_INDEX] = 0; +// $elements[$key][FE_DATA_REFERENCE] = ''; } return $elements; @@ -67,6 +69,7 @@ class HelperFormElement { * @throws UserReportException */ public static function explodeParameter(array &$element, $keyName, $flagAllowOverwrite = false) { + // Something to explode? if (isset($element[$keyName]) && $element[$keyName] !== '') { // Explode diff --git a/extension/Tests/unit/core/BuildFormPlainTest.php b/extension/Tests/unit/core/BuildFormPlainTest.php index fe311f62a3ecf5b4f37e1329832825db27e41dc7..7afd14c183ca95e8db4d8ce95de416127665a48d 100644 --- a/extension/Tests/unit/core/BuildFormPlainTest.php +++ b/extension/Tests/unit/core/BuildFormPlainTest.php @@ -533,6 +533,7 @@ class BuildFormPlainTest extends AbstractDatabaseTest { FE_CHECK_PATTERN => '', FE_HTML_ID => '123', FE_HIDE_ZERO => '0', + FE_DATA_REFERENCE => '', 'tabindex' => 0, ]; diff --git a/extension/Tests/unit/core/report/LinkTest.php b/extension/Tests/unit/core/report/LinkTest.php index b1e781d5c785db46f643163243ee6a5a94e744a9..7fa44b2491062e9aeb605139a39996a1588f27e7 100644 --- a/extension/Tests/unit/core/report/LinkTest.php +++ b/extension/Tests/unit/core/report/LinkTest.php @@ -1199,8 +1199,8 @@ class LinkTest extends TestCase { $js = <<<EOF id="12345" onClick="var alert = new QfqNS.Alert({ message: 'Please confirm', type: 'info', modal: true, timeout: 0, buttons: [ - { label: 'Ok', eventName: 'ok' }, - { label: 'Cancel',eventName: 'cancel'} + { label: 'Ok', eventName: 'ok' } + , { label: 'Cancel',eventName: 'cancel'} ] } ); alert.on('alert.ok', function() { window.location = $('#12345').attr('href'); @@ -1264,6 +1264,34 @@ EOF; } + /** + * + * @throws CodeException + * @throws UserFormException + * @throws UserReportException + */ + public function testQuestion2() { + $link = new Link($this->sip, DB_INDEX_DEFAULT, true); + + $js = <<<EOF +id="12345" onClick="var alert = new QfqNS.Alert({ message: 'Please confirm', type: 'info', modal: true, timeout: 0, buttons: [ + { label: 'Ok', eventName: 'ok' } + +] } ); +alert.on('alert.ok', function() { + window.location = $('#12345').attr('href'); +}); + +alert.show(); +return false;" +EOF; + + // Question: Hide 'cancel' Button + $result = $link->renderLink('p:person|c:n|q::::-'); + $this->assertEquals('<a href="?id=person" ' . $js . ' >?id=person</a>', $result); + + } + /** * @throws CodeException * @throws UserFormException diff --git a/extension/Tests/unit/core/report/ReportTest.php b/extension/Tests/unit/core/report/ReportTest.php index 0000b60d83f7799d2f2c0a8f7d45d0298b0e33c6..aa61cd52f925ea42a95323e4e57325a52022d72c 100644 --- a/extension/Tests/unit/core/report/ReportTest.php +++ b/extension/Tests/unit/core/report/ReportTest.php @@ -527,8 +527,8 @@ class ReportTest extends AbstractDatabaseTest { public function testReportPageTokenQuestion() { $js = <<<EOF id="12345" onClick="var alert = new QfqNS.Alert({ message: 'Please confirm', type: 'info', modal: true, timeout: 0, buttons: [ - { label: 'Ok', eventName: 'ok' }, - { label: 'Cancel',eventName: 'cancel'} + { label: 'Ok', eventName: 'ok' } + , { label: 'Cancel',eventName: 'cancel'} ] } ); alert.on('alert.ok', function() { window.location = $('#12345').attr('href'); @@ -605,8 +605,8 @@ EOF; $js = <<<EOF id="12345" onClick="var alert = new QfqNS.Alert({ message: 'Please confirm', type: 'info', modal: true, timeout: 0, buttons: [ - { label: 'Ok', eventName: 'ok' }, - { label: 'Cancel',eventName: 'cancel'} + { label: 'Ok', eventName: 'ok' } + , { label: 'Cancel',eventName: 'cancel'} ] } ); alert.on('alert.ok', function() { window.location = $('#12345').attr('href'); @@ -700,8 +700,8 @@ EOF; $js = <<<EOF id="12345" onClick="var alert = new QfqNS.Alert({ message: 'Please confirm!', type: 'info', modal: true, timeout: 0, buttons: [ - { label: 'Ok', eventName: 'ok' }, - { label: 'Cancel',eventName: 'cancel'} + { label: 'Ok', eventName: 'ok' } + , { label: 'Cancel',eventName: 'cancel'} ] } ); alert.on('alert.ok', function() { window.location = $('#12345').attr('href'); @@ -745,8 +745,8 @@ EOF; $js = <<<EOF id="12345" onClick="var alert = new QfqNS.Alert({ message: 'Please confirm!', type: 'info', modal: true, timeout: 0, buttons: [ - { label: 'Ok', eventName: 'ok' }, - { label: 'Cancel',eventName: 'cancel'} + { label: 'Ok', eventName: 'ok' } + , { label: 'Cancel',eventName: 'cancel'} ] } ); alert.on('alert.ok', function() { window.location = $('#12345').attr('href'); @@ -790,8 +790,8 @@ EOF; $js = <<<EOF id="12345" onClick="var alert = new QfqNS.Alert({ message: 'Do you really want to delete the record?', type: 'warning', modal: true, timeout: 0, buttons: [ - { label: 'Ok', eventName: 'ok' }, - { label: 'Cancel',eventName: 'cancel'} + { label: 'Ok', eventName: 'ok' } + , { label: 'Cancel',eventName: 'cancel'} ] } ); alert.on('alert.ok', function() { window.location = $('#12345').attr('href'); @@ -843,8 +843,8 @@ EOF; $js = <<<EOF id="12345" onClick="var alert = new QfqNS.Alert({ message: 'Do you really want to delete the record?', type: 'warning', modal: true, timeout: 0, buttons: [ - { label: 'Ok', eventName: 'ok' }, - { label: 'Cancel',eventName: 'cancel'} + { label: 'Ok', eventName: 'ok' } + , { label: 'Cancel',eventName: 'cancel'} ] } ); alert.on('alert.ok', function() { window.location = $('#12345').attr('href');