Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor sop_data_activity_log.php #23

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

kcmcg
Copy link
Contributor

@kcmcg kcmcg commented Feb 14, 2024

Moved all REDCap::getData() calls to top of page to reduce number of DB calls
Compressed table row output to one set of echo statements to make refactoring table easier in future

@knil-maloon
Copy link
Contributor

SHouldn't this be an else if as you separated it in Print data?

Line 332: if(array_key_exists("IS_DELETED_ROW", $recent_activity)) {

@knil-maloon
Copy link
Contributor

I think regarding the empty I think we would still want to show the data for those uploads/downloads.


echo '<tr><td width="150px">'.$module->escape($comment_time).'</td>';
echo '<td width="105px">'.$activityColumn.'</td>';
echo '<td width="220px">'.$module->escape($name).'</td>';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is always empty. $peopleDetails doesn't have indexes

echo '</tr>';

if ($recent_activity['deletion_type'][0] == '1') {
$name = filter_tags("<em>Automatic</em>");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow this is showing with the tags

echo '<tr><td width="150px">'.$module->escape($comment_time).'</td>';
echo '<td width="105px">'.$activityColumn.'</td>';
echo '<td width="220px">'.$module->escape($name).'</td>';
echo '<td width="20px">'.$module->escape($region_code).'</td>';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as $name it's empty

Comment on lines +315 to +319
$assoc_concept = \Vanderbilt\HarmonistHubExternalModule\getReqAssocConceptLink($module, $pidsArray, $recent_activity['data_assoc_concept']);

$activity = '<i class="fa fa-fw fa-arrow-up text-success" aria-hidden="true"></i> upload ';
if($current_user['person_region'] == $recent_activity['data_upload_region'] || $isAdmin) {
$file = \Vanderbilt\HarmonistHubExternalModule\getFileLink($module, $pidsArray['PROJECTS'], $recent_activity['data_upload_pdf'], '1', '', $secret_key, $secret_iv, $current_user['record_id'], "");
Copy link
Contributor

@knil-maloon knil-maloon Mar 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we have the namespace we can probably remove the \Vanderbilt\HarmonistHubExternalModule\ There are several other spots with it

echo '<td width="80px">'.$module->escape($data_request).'</td>';
echo '<td width="220px">'.$module->escape($filenameColumn).'</td>';
echo '<td>'.$module->escape($activityHiddenColumn).'</td>';
echo '<td width="50px"> '.$module->escape($file).'</td>';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is showing as <a href=.... instead of the downloadable file add filter_tags instead

$peopleDetails[$personDetails["record_id"]] = $personDetails;
}

$regions = \REDCap::getData($pidsArray['REGIONS'], 'json-array', null, array('region_code'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I commented on the issue, and this is the fix. "record_id" is missing for regions

@@ -3,16 +3,68 @@

$record = htmlentities($_REQUEST['record'],ENT_QUOTES);

### Fetch People and Region data for inclusion in upload/download details
$people = \REDCap::getData($pidsArray['PEOPLE'], 'json-array', null, array('firstname','lastname','person_region'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as regions, missing "record_id" might fix the missing data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants