Skip to content

Commit

Permalink
travis
Browse files Browse the repository at this point in the history
  • Loading branch information
cmadjar committed Feb 4, 2020
1 parent 355289d commit 6ac387e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 18 deletions.
10 changes: 5 additions & 5 deletions modules/electrophysiology_browser/php/module.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ class Module extends \Module
{
return parent::hasAccess($user) &&
$user->hasAnyPermission(
[
'electrophysiology_browser_view_allsites',
'electrophysiology_browser_view_site'
]
);
[
'electrophysiology_browser_view_allsites',
'electrophysiology_browser_view_site'
]
);
}

/**
Expand Down
42 changes: 29 additions & 13 deletions modules/electrophysiology_browser/php/sessions.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ class Sessions extends \NDB_Page
$sessions = $db->pselect($query, array());
$sessions = array_column($sessions, 'SessionID');
$response['patient'] = $this->getSubjectData($outputType);
$response['database'] = array_values($this->getFilesData($sessionID, $outputType));
$response['database'] = array_values(
$this->getFilesData($sessionID, $outputType)
);
$response['sessions'] = $sessions;
$currentIndex = array_search($sessionID, $sessions);
$response['nextSession'] = $sessions[$currentIndex+1] ?? '';
Expand All @@ -181,7 +183,9 @@ class Sessions extends \NDB_Page
function getSubjectData($outputType)
{
$subjectData = array();
$candidate = \NDB_Factory::singleton()->candidate($this->timepoint->getCandID());
$candidate = \NDB_Factory::singleton()->candidate(
$this->timepoint->getCandID()
);

$subjectData['pscid'] = $candidate->getPSCID();
$subjectData['dccid'] = $candidate->getCandID();
Expand Down Expand Up @@ -236,8 +240,12 @@ class Sessions extends \NDB_Page
$fileSummary = array();
$physiologicalFileID = $file['PhysiologicalFileID'];
$physiologicalFile = $file['FilePath'];
$physioFileObj = new ElectrophysioFile(intval($physiologicalFileID));
$fileName = basename($physioFileObj->getParameter('FilePath'));
$physioFileObj = new ElectrophysioFile(
intval($physiologicalFileID)
);
$fileName = basename(
$physioFileObj->getParameter('FilePath')
);

// -----------------------------------------------------
// Create a file summary object with file's information
Expand Down Expand Up @@ -298,13 +306,21 @@ class Sessions extends \NDB_Page
$intituteAddress = $physioFileObj->getParameter('InstitutionAddress');
$miscChannelCount = $physioFileObj->getParameter('MiscChannelCount');
$manufacturer = $physioFileObj->getParameter('Manufacturer');
$modelName = $physioFileObj->getParameter('ManufacturerModelName');
$capManufacturer = $physioFileObj->getParameter('ManufacturerCapModelName');
$capModelName = $physioFileObj->getParameter('ManufacturerCapModelName');
$modelName = $physioFileObj->getParameter(
'ManufacturerModelName'
);
$capManufacturer = $physioFileObj->getParameter(
'ManufacturerCapModelName'
);
$capModelName = $physioFileObj->getParameter(
'ManufacturerCapModelName'
);
$hardwareFilters = $physioFileObj->getParameter('HardwareFilters');
$duration = $physioFileObj->getParameter('RecordingDuration');
$epochLength = $physioFileObj->getParameter('EpochLength');
$softwareVersion = $physioFileObj->getParameter('DeviceSoftwareVersion');
$softwareVersion = $physioFileObj->getParameter(
'DeviceSoftwareVersion'
);
$serialNumber = $physioFileObj->getParameter('DeviceSerialNumber');
$artefactDesc = $physioFileObj->getParameter(
'SubjectArtefactDescription'
Expand Down Expand Up @@ -352,22 +368,22 @@ class Sessions extends \NDB_Page
* Gets the download link for the files associated to the electrophysiology
* file (channels.tsv, electrodes.tsv, task events.tsv...)
*
* @param int $physiologicalFileID FileID of the electrophysiology file
* @param string $physiologicalFile electrophysiology file's relative path
* @param int $physioFileID FileID of the electrophysiology file
* @param string $physioFile electrophysiology file's relative path
*
* @return array array with the path to the different files associated to the
* electrophysiology file
*/
function getDownloadlinks(int $physiologicalFileID, string $physiologicalFile): array
function getDownloadlinks(int $physioFileID, string $physioFile): array
{
$db = \NDB_Factory::singleton()->database();

$params = array();
$params['PFID'] = $physiologicalFileID;
$params['PFID'] = $physioFileID;
$downloadLinks = array();
$downloadLinks[] = array(
'type' => 'physiological_file',
'file' => $physiologicalFile,
'file' => $physioFile,
);

$queries = [
Expand Down

0 comments on commit 6ac387e

Please sign in to comment.