Skip to content

Commit

Permalink
Bug fix and cleanup
Browse files Browse the repository at this point in the history
Remove unused files
Fix issue with "Save & Stay" then "Save & Exit"
  • Loading branch information
lsgs committed Aug 25, 2024
1 parent b7c345c commit 8469aa4
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 69 deletions.
4 changes: 0 additions & 4 deletions .gitattributes

This file was deleted.

2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

28 changes: 0 additions & 28 deletions .vscode/launch.json

This file was deleted.

18 changes: 0 additions & 18 deletions EM.code-workspace

This file was deleted.

44 changes: 27 additions & 17 deletions InstanceTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ protected function setTaggedFields() {
$recordData = REDCap::getData('array', $this->record, $matches[1], $this->event_id, null, false, false, false, null, false); // export raw
$join_val = $recordData[1]['repeat_instances'][$this->event_id][$this->instrument][$this->repeat_instance][$matches[1]];
if (preg_match("/".self::ACTION_TAG_DST."='?((\w+_arm_\d+[a-z]?:)?\w+)'?\s?/", $fieldDetails['field_annotation'], $matches)) {
$filter = "[" . $matches[1] ."]='" .$join_val."'";
$filter = $this->escape("[" . $matches[1] ."]='" .$join_val."'");
}
}

Expand Down Expand Up @@ -891,6 +891,16 @@ protected function popupViewTweaks() {
window.opener.refreshTables();
dataEntrySubmit(this);
});
$('#submit-btn-savecontinue') // Save & Stay - preserve &extmod_instance_table=1 in url when reload
.attr('name', 'submit-btn-savecontinue')
.removeAttr('onclick')
.click(function(event) {
var redirectUrl = window.location.href.replace('&extmod_instance_table_add_new=1','');
event.preventDefault();
window.opener.refreshTables();
dataEntrySubmit(this);
window.setTimeout($.redirectUrl, 500, redirectUrl);
});
$('#submit-btn-savenextinstance')// Save & Next Instance (not necessarily a new instance)
.attr('name', 'submit-btn-savenextinstance')
.removeAttr('onclick')
Expand All @@ -908,14 +918,14 @@ protected function popupViewTweaks() {
window.opener.refreshTables();
window.close();
});
<?php
if ( isset($_GET['extmod_instance_table_add_new'])) {
?>
$('button[name=submit-btn-deleteform]').css("display", "none");
<?php
} else {
?>
$('button[name=submit-btn-deleteform]')
<?php
if ( isset($_GET['extmod_instance_table_add_new'])) {
?>
$('button[name=submit-btn-deleteform]').css("display", "none");
<?php
} else {
?>
$('button[name=submit-btn-deleteform]')
.removeAttr('onclick')
.click(function(event) {
$('#form').append('<input type="hidden" name="extmod_closerec_home" value="<?=$record?>">');
Expand All @@ -932,19 +942,19 @@ function(){
);
return false;
});
<?php
}
if (isset($_GET['__reqmsg'])) {
?>
setTimeout(function() {
<?php
}
if (isset($_GET['__reqmsg'])) {
?>
setTimeout(function() {
$('div[aria-describedby="reqPopup"]').find('div.ui-dialog-buttonpane').find('button').not(':last').hide(); // .css('visibility', 'visible'); // required fields message show only "OK" button, not ignore & leave
}, 100);
<?php
<?php
}
?>
?>
});
</script>
<?php
<?php
}

/**
Expand Down

0 comments on commit 8469aa4

Please sign in to comment.