From 89ced24ddfc1e485b9dee2e90d94838cdaf36081 Mon Sep 17 00:00:00 2001 From: Ross Parker <> Date: Thu, 27 Oct 2022 17:37:13 +0800 Subject: [PATCH] v5.21.05 --- Free Learning/CHANGEDB.php | 5 +++++ Free Learning/CHANGELOG.txt | 4 ++++ Free Learning/manifest.php | 2 +- Free Learning/units_manage.php | 2 +- Free Learning/units_manageProcessBulk.php | 9 +++++++++ Free Learning/version.php | 2 +- 6 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Free Learning/CHANGEDB.php b/Free Learning/CHANGEDB.php index 9ff583f..9f7d71f 100644 --- a/Free Learning/CHANGEDB.php +++ b/Free Learning/CHANGEDB.php @@ -2151,3 +2151,8 @@ ++$count; $sql[$count][0] = '5.21.04'; $sql[$count][1] = ""; + +//v5.21.05 +++$count; +$sql[$count][0] = '5.21.05'; +$sql[$count][1] = ""; diff --git a/Free Learning/CHANGELOG.txt b/Free Learning/CHANGELOG.txt index c07ed7c..f70caab 100644 --- a/Free Learning/CHANGELOG.txt +++ b/Free Learning/CHANGELOG.txt @@ -1,5 +1,9 @@ CHANGELOG ========= +v5.21.05 +-------- +Added bulk Lock/Unlock option in Manage Units + v5.21.04 -------- Gives student with Exemption the ability to see unit contents diff --git a/Free Learning/manifest.php b/Free Learning/manifest.php index f717ca2..f6fe07f 100644 --- a/Free Learning/manifest.php +++ b/Free Learning/manifest.php @@ -25,7 +25,7 @@ $entryURL = 'units_browse.php'; $type = 'Additional'; $category = 'Learn'; -$version = '5.21.04'; +$version = '5.21.05'; $author = 'Ross Parker'; $url = 'http://rossparker.org/free-learning'; diff --git a/Free Learning/units_manage.php b/Free Learning/units_manage.php index 8fcc7f4..b2680bf 100755 --- a/Free Learning/units_manage.php +++ b/Free Learning/units_manage.php @@ -94,7 +94,7 @@ $form = BulkActionForm::create('bulkAction', $session->get('absoluteURL').'/modules/Free Learning/units_manageProcessBulk.php'); - $bulkActions = ['Export' => __('Export'), 'Duplicate' => __('Duplicate')]; + $bulkActions = ['Export' => __('Export'), 'Duplicate' => __('Duplicate'), 'Lock' => __m('Lock'), 'Unlock' => __m('Unlock')]; $col = $form->createBulkActionColumn($bulkActions); $col->addSubmit(__('Go')); diff --git a/Free Learning/units_manageProcessBulk.php b/Free Learning/units_manageProcessBulk.php index ce3b95e..94553cc 100755 --- a/Free Learning/units_manageProcessBulk.php +++ b/Free Learning/units_manageProcessBulk.php @@ -19,6 +19,7 @@ use Gibbon\Module\FreeLearning\UnitExporter; use Gibbon\Module\FreeLearning\UnitDuplicator; +use Gibbon\Module\FreeLearning\Domain\UnitGateway; $_POST['address'] = '/modules/Free Learning/units_manage.php'; @@ -69,6 +70,14 @@ $partialFail = $duplicator->duplicateUnit($freeLearningUnitID); } + } else if ($action == 'Lock' or $action == 'Unlock') { + + $unitGateway = $container->get(UnitGateway::class); + + foreach ($freeLearningUnitIDList as $freeLearningUnitID) { + $partialFail = !$unitGateway->update($freeLearningUnitID, ['editLock' => ($action == 'Lock' ? 'Y' : 'N')]); + } + } else { $URL .= '&return=error1'; header("Location: {$URL}"); diff --git a/Free Learning/version.php b/Free Learning/version.php index b98c3de..290b675 100755 --- a/Free Learning/version.php +++ b/Free Learning/version.php @@ -20,5 +20,5 @@ /** * Sets version information. */ -$moduleVersion = '5.21.04'; +$moduleVersion = '5.21.05'; $coreVersion = '24.0.00';