Skip to content

Commit 737b67e

Browse files
authored
[instruments] Fix properly disabling/enabling 'Delete instrument data' button display (#8686)
Currently, if the 'InstrumentResetting' config is set to 'No', the 'Delete instrument data' button is displayed and the user is able to clear the instrument. This fixes that by letting the if statement check a true boolean instead of string "true" by calling 'settingEnabled'. The PR also modifies the testing plan so this is tested in the future.
1 parent d7e1de1 commit 737b67e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

modules/instruments/test/TestPlan.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ is correct.
1919
5. If the instrument has multiple pages (on the left pane), move from page to page and check that the
2020
saved data stays the same. The data that wasn't saved should be lost.
2121
6. Make sure that the 'Delete instrument data' button on the left pane is only visible when the user
22-
has the 'Send to DCC' permission.
22+
has the 'Send to DCC' permission, and the configuration `InstrumentResetting` (_"Instrument Resetting"_) is set to
23+
'Yes' in the Configuration module.
2324
7. Click on the 'Delete instrument data' button and check if the instrument's data is cleared.
2425
8. Select a candidate with a Date Of Death (DoD) or put one in for a candidate as needed, then select an
2526
instrument for that candidate. Enter a date (same a step 4) posterior to the DoD. Refresh the page and check that the

php/libraries/NDB_BVL_InstrumentStatus_ControlPanel.class.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class NDB_BVL_InstrumentStatus_ControlPanel extends NDB_BVL_InstrumentStatus
143143
$this->tpl_data['access']['validity'] = $this->_displayValidity();
144144
}
145145

146-
if ($config->getSetting('InstrumentResetting')
146+
if ($config->settingEnabled('InstrumentResetting')
147147
&& $this->getDataEntryStatus() != 'Complete'
148148
) {
149149
$user = User::singleton();

0 commit comments

Comments
 (0)