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

Export Coral Organizations #629

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

tristanhoppe
Copy link

Export Feature for Coral Organization Module

This PR is an adaption of jcuenod's Resource export feature. It allows the user to download a csv file of all of the Organization information they have currently selected with the search tools.

@jeffnm jeffnm changed the base branch from master to development April 7, 2020 15:26
@jeffnm jeffnm changed the title added export files Export Coral Organizations Apr 7, 2020
Copy link

@gmcharlt gmcharlt left a comment

Choose a reason for hiding this comment

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

Overall this works for me (once I made a copy of CoralSession.php), but I've suggested some improvements.

foreach ($search as $key => $value) {
$search[$key] = trim($value);
}
CoralSession::set('OrgSearch', $search);

Choose a reason for hiding this comment

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

This doesn't work for me, since CoralSession isn't defined as a class for the organizations module. Copying over CoralSession.php from resources/admin/classes/common would fix this.

@@ -923,6 +923,7 @@ function generateDowntimeHTML($downtime) {
}else{
$thisPageNum = count($organizationArray) + $pageStart - 1;
echo "<span style='font-weight:bold;'>"._("Displaying ") . $pageStart . _(" to ") . $thisPageNum . _(" of ") . $totalRecords . _(" Organization Records")."</span><br />";
echo "</span><span style='float:right;width:34px;'><a href='javascript:void(0);'><img src='images/xls.gif' id='export'></a></span>";

Choose a reason for hiding this comment

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

This has a couple accessibility issues:

  • there's no label or alt text
  • it can't be activated via keyboard navigation; making the element a button is one way of fixing that


/*
**************************************************************************************************************************
** CORAL Resources Module v. 1.2

Choose a reason for hiding this comment

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

Nitpick: "Organizations Module" would be more accurate.


/*
**************************************************************************************************************************
** CORAL Licenses Module v. 1.2

Choose a reason for hiding this comment

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

Nitpick: "Organizations Module"

LEFT JOIN Contact C ON C.organizationID = O.organizationID
LEFT JOIN Alias A ON A.organizationID = O.organizationID
LEFT JOIN ContactRoleProfile CRP ON CRP.contactID = C.contactID
LEFT JOIN ContactRole CR ON CR.contactRoleID = CRP.contactRoleID

Choose a reason for hiding this comment

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

All of these joins mean that an organization export may have more rows in the spreadsheet than hits indicated by the organization search. For example, an organization with aliases will show up multiple times in the export.

That may well be OK, as consumers of the export may prefer that to splitting apart repeats merged together via GROUP_CONCAT(), but it's probably worth a note in the documentation.

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