Skip to content

Commit

Permalink
Merge branch 'release-7.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jun 14, 2021
2 parents b850288 + 0d287a1 commit ff43412
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
"oat-sa/generis" : ">=14.0.0",
"oat-sa/tao-core" : ">=47.0.0",
"oat-sa/extension-tao-backoffice" : ">=6.0.0",
"oat-sa/extension-tao-testtaker" : ">=8.0.0"
"oat-sa/extension-tao-testtaker" : ">=8.2.0"
}
}
}
3 changes: 3 additions & 0 deletions controller/Groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ public function editGroup()
$memberProperty = $this->getProperty(GroupsService::PROPERTY_MEMBERS_URI);
$memberForm = tao_helpers_form_GenerisTreeForm::buildReverseTree($group, $memberProperty);
$memberForm->setData('title', __('Select group test takers'));

$memberForm->setData('saveUrl', _url('setReverseValues', 'TestTakerGenerisTree', 'taoTestTaker'));

$this->setData('memberForm', $memberForm->render());

if ($this->getServiceLocator()->get(common_ext_ExtensionsManager::SERVICE_ID)->isEnabled('taoDeliveryRdf')) {
Expand Down
30 changes: 26 additions & 4 deletions helpers/TestTakerForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2013 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
* Copyright (c) 2013-2021 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
*
*
*/

declare(strict_types=1);

namespace oat\taoGroups\helpers;

use \common_ext_ExtensionsManager;
Expand All @@ -43,16 +45,36 @@ class TestTakerForm
*
* @param core_kernel_classes_Resource $subject
* @return string
*
* @throws \common_ext_ExtensionException
*/
public static function renderGroupTreeForm(core_kernel_classes_Resource $subject)
public static function renderGroupTreeForm(core_kernel_classes_Resource $subject): string
{

// Ensure groups constants are loaded
common_ext_ExtensionsManager::singleton()->getExtensionById('taoGroups');

$memberProperty = new core_kernel_classes_Property(GroupsService::PROPERTY_MEMBERS_URI);
$groupForm = tao_helpers_form_GenerisTreeForm::buildTree($subject, $memberProperty);
$groupForm->setData('title', __('Add to group'));
return $groupForm->render();
}

/**
* Returns non-rendered form
* @param core_kernel_classes_Resource $subject
* @return tao_helpers_form_GenerisTreeForm
* @throws \common_ext_ExtensionException
*/
public static function returnGroupTreeFormObject(core_kernel_classes_Resource $subject): tao_helpers_form_GenerisTreeForm
{
// Ensure groups constants are loaded
common_ext_ExtensionsManager::singleton()->getExtensionById('taoGroups');

$memberProperty = new core_kernel_classes_Property(GroupsService::PROPERTY_MEMBERS_URI);
$groupForm = tao_helpers_form_GenerisTreeForm::buildTree($subject, $memberProperty);
$groupForm->setData('title', __('Add to group'));

return $groupForm;
}
}

0 comments on commit ff43412

Please sign in to comment.