-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
Combined upload/download printing due to their similarities
Combined deletion log printing with normal row printing as they're similar enough
SHouldn't this be an else if as you separated it in Print data? Line 332: |
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>'; |
There was a problem hiding this comment.
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>"); |
There was a problem hiding this comment.
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>'; |
There was a problem hiding this comment.
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
$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'], ""); |
There was a problem hiding this comment.
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>'; |
There was a problem hiding this comment.
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')); |
There was a problem hiding this comment.
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')); |
There was a problem hiding this comment.
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
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