|
@ -1438,6 +1438,13 @@ function attforblock_upgrade() { |
|
|
WHERE itemmodule = ?"; |
|
|
WHERE itemmodule = ?"; |
|
|
$DB->execute($sql, array('attendance', 'attforblock')); |
|
|
$DB->execute($sql, array('attendance', 'attforblock')); |
|
|
|
|
|
|
|
|
|
|
|
// Now convert role capabilities to 'attendance' |
|
|
|
|
|
$sql = "UPDATE {role_capabilities} |
|
|
|
|
|
SET capability = REPLACE(capability, ?, ?) |
|
|
|
|
|
WHERE " . $DB->sql_like('capability', '?'); |
|
|
|
|
|
$params = array("mod/attforblock:", "mod/attendance:", "mod/attforblock:%"); |
|
|
|
|
|
$DB->execute($sql, $params); |
|
|
|
|
|
|
|
|
// Clear cache for courses with attendances. |
|
|
// Clear cache for courses with attendances. |
|
|
$attendances = $DB->get_recordset('attendance', array(), '', 'course'); |
|
|
$attendances = $DB->get_recordset('attendance', array(), '', 'course'); |
|
|
foreach ($attendances as $attendance) { |
|
|
foreach ($attendances as $attendance) { |
|
|