Skip to content

Commit

Permalink
v5.21.05
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Parker committed Oct 27, 2022
1 parent 1114768 commit 89ced24
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Free Learning/CHANGEDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -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] = "";
4 changes: 4 additions & 0 deletions Free Learning/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Free Learning/manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion Free Learning/units_manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));

Expand Down
9 changes: 9 additions & 0 deletions Free Learning/units_manageProcessBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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}");
Expand Down
2 changes: 1 addition & 1 deletion Free Learning/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
/**
* Sets version information.
*/
$moduleVersion = '5.21.04';
$moduleVersion = '5.21.05';
$coreVersion = '24.0.00';

0 comments on commit 89ced24

Please sign in to comment.