Skip to content

Commit

Permalink
[candidate_profile] Show Consent Summary card iff useConsent Yes (ace…
Browse files Browse the repository at this point in the history
  • Loading branch information
zaliqarosli authored and spell00 committed Aug 13, 2020
1 parent 6f816f7 commit 69afebf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/candidate_parameters/php/module.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ class Module extends \Module
return [];
}

if (!\NDB_Factory::singleton()->settings()->consentEnabled()) {
return [];
}

// The candidate getConsents only returns the types of
// consents that the candidate has saved, we want to
// summarize all of the types configured in the database.
Expand Down
12 changes: 12 additions & 0 deletions php/libraries/Settings.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -164,5 +164,17 @@ class Settings
return false;
}

/**
* Determines whether the useConsent configuration setting is
* enabled
*
* @return bool True if the useConsent setting is enabled
*/
function consentEnabled(): bool
{
return \NDB_Factory::singleton()->config()->settingEnabled(
'useConsent'
);
}

}

0 comments on commit 69afebf

Please # to comment.