Commit e762eba7 authored by Doris Tam's avatar Doris Tam
Browse files

Bug 1832691: Add SmartEvidence to group collections

Group portfolios can have SmartEvidence so members can copy the collection
template into their own account and have SmartEvidence available directly.

behatnotneeded

Change-Id: Ibb10fb180704c2f4d073902486ff6b7b59dffbf6
parent 4da766a1
......@@ -1092,9 +1092,6 @@ class Collection {
*/
public function get_framework_institution() {
require_once('institution.php');
if (!empty($this->group)) {
return false;
}
if (!is_plugin_active('framework', 'module')) {
return false;
......@@ -1106,9 +1103,16 @@ class Collection {
$allowsmartevidence = ($institution->allowinstitutionsmartevidence) ? $institution : false;
}
else {
$user = new User();
$user->find_by_id($this->owner);
$institutionids = array_keys($user->get('institutions'));
$institutionids = array();
if (!empty($this->group)) {
$group = get_group_by_id($this->group);
$institutionids[] = $group->institution;
}
else {
$user = new User();
$user->find_by_id($this->owner);
$institutionids = array_keys($user->get('institutions'));
}
if (!empty($institutionids)) {
foreach ($institutionids as $institution) {
$institution = new Institution($institution);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment