Skip to content

Commit 411414d

Browse files
committed
Merge branch 'release/3.3.10'
2 parents 0668063 + a87c08d commit 411414d

File tree

4 files changed

+39
-8
lines changed

4 files changed

+39
-8
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
All notable changes to the Form Render Skip Logic module will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
6+
## [3.3.10] - 2019-10-14
7+
### Changed
8+
- Document the limited repeating event support in FRSL (Philip Chase)
9+
- Document how to use FRSL with surveys (Philip Chase)
10+
- Go to correct instance when using Save and Go to Next Form (Kyle Chesney)
11+
- Fix bug on Record Home wherein FRSL would quietly fail to hide forms when returning from Save and Exit Record (Kyle Chesney)
12+
- Address cosmetic error caused by "Delete all data on event" row of Record Home (Kyle Chesney)
13+
14+
515
## [3.3.9] - 2019-10-11
616
### Changed
717
- Use only the records for the DAG if one is specified in Record Status Dashboard (Kyle Chesney)

ExternalModule.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function redcap_every_page_top($project_id) {
4848
}
4949

5050
// Do not load FRSL on the add/edit record splash page
51-
if ( strpos(PAGE, 'DataEntry/record_home.php') !== false && (!$_GET['arm'] || !$_GET['id']) ) {
51+
if ( strpos(PAGE, 'DataEntry/record_home.php') !== false && !$_GET['id'] ) {
5252
return;
5353
}
5454

@@ -59,12 +59,12 @@ function redcap_every_page_top($project_id) {
5959
/**
6060
* @inheritdoc
6161
*/
62-
function redcap_data_entry_form_top($project_id, $record = null, $instrument, $event_id, $group_id = null) {
62+
function redcap_data_entry_form_top($project_id, $record = null, $instrument, $event_id, $group_id = null, $instance = null) {
6363
if (empty($record)) {
6464
$record = $this->getQueryParam('id');
6565
}
6666

67-
$this->loadFRSL('data_entry_form', $record, $event_id, $instrument);
67+
$this->loadFRSL('data_entry_form', $record, $event_id, $instrument, $instance);
6868
}
6969

7070
/**
@@ -388,8 +388,10 @@ function getFormsAccessMatrix($event_id = null, $record = null) {
388388
* The event ID. Only required when $location = "data_entry_form".
389389
* @param string $instrument
390390
* The form/instrument name.
391+
* @param int $instance
392+
* The repeat instance number. Only required when $location = "data_entry_form" and the form is a repeating instance
391393
*/
392-
protected function loadFRSL($location, $record = null, $event_id = null, $instrument = null) {
394+
protected function loadFRSL($location, $record = null, $event_id = null, $instrument = null, $instance = null) {
393395
global $Proj;
394396

395397
$next_step_path = '';
@@ -413,7 +415,7 @@ protected function loadFRSL($location, $record = null, $event_id = null, $instru
413415

414416
if (isset($next_instrument)) {
415417
// Path to the next available form in the current event.
416-
$next_step_path = APP_PATH_WEBROOT . 'DataEntry/index.php?pid=' . $Proj->project_id . '&id=' . $record . '&event_id=' . $event_id . '&page=' . $next_instrument;
418+
$next_step_path = APP_PATH_WEBROOT . 'DataEntry/index.php?pid=' . $Proj->project_id . '&id=' . $record . '&event_id=' . $event_id . '&page=' . $next_instrument . '&instance=' . $instance;
417419
}
418420

419421
// Access denied to the current page.

README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,19 @@ If you want to make sure no filled forms will be affected by FRSL rules, check "
5757
![Prevent hiding of filled forms](img/prevent_hidden_data_checkbox.png)
5858

5959

60-
## Upgrading From Version 2.x - 3.x
60+
## Survey support
61+
62+
FRSL works in surveys, but you must enable the `Auto-continue to next survey` option of `Survey Termination Options`.
63+
64+
Survey queues and FRSL are somewhat redundant in their ability to skip forms based on logic. If you want to use them together, you must skip the survey in both places, the queue and FRSL. Given that one constraint, they are completely compatible.
65+
66+
67+
## Repeating event support
68+
69+
Repeating events are not fully supported by FRSL. FRSL should not be used to hide any repeating form. Repeating events work correctly only if FRSL *does not* control them. Proper repeating events support is planned for a future release.
70+
71+
72+
## Upgrading from Version 2.x - 3.x
6173

6274
Note that version 3.0.0 introduced a breaking change in the configuration. When you upgrade to version 3.x all of your old configurations in 2.x will be converted into the 3.x configuration scheme. Thereafter, if you decided to switch back and forth between the two versions, your configurations will not transfer. This is to ensure that all of your old 2.x configurations will still be available to you if you decide to go back to version 2.x.
6375

js/frsl.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,15 @@ document.addEventListener('DOMContentLoaded', function() {
2525
}
2626

2727
var params = getQueryParameters(this.href,this.getAttribute('onclick'));
28-
if (!formRenderSkipLogic.formsAccess[params.id][params.event_id][params.page]) {
29-
disableForm(this);
28+
try {
29+
if (!formRenderSkipLogic.formsAccess[params.id][params.event_id][params.page]) {
30+
disableForm(this);
31+
}
32+
} catch (err) {
33+
if (this.firstChild.getAttribute('title') === 'Delete this event') {
34+
// on record home the final row is "delete all data on event" buttons and should not be processed
35+
return;
36+
}
3037
}
3138
});
3239

0 commit comments

Comments
 (0)