Compare commits
225 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 77be1e3fe3 | |||
| de7b3e37b3 | |||
| ffd8dfcf27 | |||
| 8a82f51043 | |||
| 68cab31dba | |||
| 3f50c24fc3 | |||
| 9973646ca7 | |||
| f14420c739 | |||
| 70868d8648 | |||
| 8f45c9b6a5 | |||
| 1f5c6c6b7a | |||
| 26999dda23 | |||
| 022206f2fe | |||
| f9e0f61467 | |||
| c07bc83480 | |||
| 7d7d3520a7 | |||
| f34f8131ba | |||
| 85ba5d1d88 | |||
| e0b8a3b17a | |||
| 5577e472e5 | |||
| 571f508d4e | |||
| 764ec8d7fb | |||
| eb04dc8792 | |||
| 6fefb88819 | |||
| 1b2a8dad89 | |||
| ec63d3eab4 | |||
| 5f4250dc43 | |||
| b024306e5c | |||
| 0d285e9334 | |||
| bed212f61b | |||
| 14d58697a3 | |||
| e98103354d | |||
| d8dfb98417 | |||
| 3684d9e03c | |||
| 629ef7772f | |||
| 9e57c09d7b | |||
| 949d3f1c02 | |||
| 11524653b0 | |||
| f9b2f6634d | |||
| dafe4c5a78 | |||
| 550c4e1c42 | |||
| 0287928c4b | |||
| 701d27e5d9 | |||
| 13d5d3edb1 | |||
| abc8f149ce | |||
| c3a6437220 | |||
| c910982c49 | |||
| 4d5849b0e4 | |||
| cc0b18ec0e | |||
| 3c7ebda9a5 | |||
| 19401adbdd | |||
| a7fb29a8ff | |||
| c53861fd66 | |||
| 88d4a01089 | |||
| b71e7b79e8 | |||
| 6c7199a426 | |||
| 827f3cd471 | |||
| 0260074ba1 | |||
| edab811944 | |||
| 348ceb4631 | |||
| 5544dc1cc7 | |||
| c02d168cd7 | |||
| 53fde6278a | |||
| 25221f73a6 | |||
| b901252f6d | |||
| be73a0ed4e | |||
| e654258446 | |||
| 8c14984028 | |||
| dd6bbf3962 | |||
| 01e84ac720 | |||
| b423c5ad38 | |||
| f70cc95a13 | |||
| d9887f7350 | |||
| f2db42f921 | |||
| b85896f7bc | |||
| 6350a758d7 | |||
| a3ea0db227 | |||
| cd62c520e2 | |||
| 86d4aca10d | |||
| 40ba9d9cfa | |||
| 5c510b92e2 | |||
| 754ecb5768 | |||
| e7a122bba9 | |||
| 13edb4f9f9 | |||
| db394d5b08 | |||
| d18802eb2f | |||
| ead3a41240 | |||
| ae7b1be0b6 | |||
| cca393d2f6 | |||
| 69430157a3 | |||
| f077d9fbea | |||
| 8c20e76d43 | |||
| a0ac535549 | |||
| 11260d5f3f | |||
| 67fc9943b9 | |||
| 29a5f6eaa2 | |||
| a6fd7ada34 | |||
| c86c872db3 | |||
| 7b4848ca80 | |||
| d9e3c11834 | |||
| 1437e35d2d | |||
| 914d5ab82d | |||
| fbf0c8810b | |||
| 25da0b49ea | |||
| 70e47fdc2a | |||
| 3bfdc05d3a | |||
| d64a94713e | |||
| 8d7f1fd428 | |||
| a7268b4f8a | |||
| 4792cc508e | |||
| 7bc625d846 | |||
| 6dc25cc165 | |||
| 747000a2fe | |||
| bec0808b18 | |||
| 7f40272535 | |||
| f9735bbde7 | |||
| 4dc1413cc7 | |||
| 79b6a4acac | |||
| cf50c5f1cb | |||
| fc74a6e6d2 | |||
| a48bd1c4e3 | |||
| ee215ddd43 | |||
| f3e7533b9d | |||
| 921469db8f | |||
| b99f2bce77 | |||
| 7df9eb36cd | |||
| aee09a6357 | |||
| 8ae7a4ad68 | |||
| d911548cf4 | |||
| c8435454a7 | |||
| df2bda2f00 | |||
| bf52b2a3bc | |||
| f130c810f9 | |||
| d294483e9c | |||
| ca89aca702 | |||
| 7e561cc4a8 | |||
| 57d601bc23 | |||
| 7cdc332930 | |||
| 484eab15e3 | |||
| 0a0d55a3e1 | |||
| 773b1f738f | |||
| 96475f49de | |||
| 9a64cc2b0b | |||
| 56c570f68a | |||
| ab2bb07f2e | |||
| d0aa6bf098 | |||
| 132e638209 | |||
| 6713912510 | |||
| 96c48a5058 | |||
| d3de95f446 | |||
| 6d98038c8f | |||
| 83e5983a88 | |||
| 0ddd9c54bc | |||
| 39bd01c11a | |||
| 1e58e180d4 | |||
| 163bff4a18 | |||
| 910c2ab7b4 | |||
| fcf199b0ec | |||
| bb511f30d6 | |||
| 481ad40e0e | |||
| 031f3a1d4b | |||
| 5548689ead | |||
| f751a8edbe | |||
| 0de719024c | |||
| ac084982cf | |||
| d3158895a8 | |||
| 0e58303ea3 | |||
| f0d380703a | |||
| baf264ebc8 | |||
| e61f7ba324 | |||
| afda296526 | |||
| 6d6b14e8a4 | |||
| 27d6bd5de1 | |||
| 907db7f06b | |||
| 33bfd161cd | |||
| f88b4e9f81 | |||
| 114f0b612f | |||
| a5f1dd6cb1 | |||
| 283cd6db67 | |||
| 3eac4851e3 | |||
| 006ec3c96f | |||
| cabc1dafa9 | |||
| 1b4c878f48 | |||
| 91286bb138 | |||
| 71af7accff | |||
| ce97501b2b | |||
| dadb3cb372 | |||
| 5cb05d8b77 | |||
| e29b355121 | |||
| 95ca6f656e | |||
| fbd1829594 | |||
| 0c91305856 | |||
| c42b488aaf | |||
| 5bde4eb35e | |||
| 1943c03bbb | |||
| 0da427c800 | |||
| 7045a22f3a | |||
| c7f9c7ae0f | |||
| 751e4964b1 | |||
| 5a108a3064 | |||
| 417ff4f035 | |||
| d3a5df14f7 | |||
| 82853489ca | |||
| 9eaea6a7bf | |||
| f11b82df7c | |||
| 5d2f8bd98d | |||
| 023109f1b1 | |||
| 51bedcee13 | |||
| 7cec76396f | |||
| daed88e656 | |||
| 212595bbd0 | |||
| 6cff678c08 | |||
| 980193f55b | |||
| b4f9c2e906 | |||
| 93ed2a597c | |||
| a2c6a69070 | |||
| 7a68a37fda | |||
| 3c1b6ed7bd | |||
| 8ff55e3b1b | |||
| 7d05f78363 | |||
| d0a9211f51 | |||
| e2a0a42003 | |||
| 7e24491f2c | |||
| 4619c8a7e3 | |||
| 2aff0046c1 |
+1
-1
@@ -30,7 +30,7 @@ $category = required_param('category', PARAM_SAFEDIR);
|
||||
$return = optional_param('return','', PARAM_ALPHA);
|
||||
$adminediting = optional_param('adminedit', -1, PARAM_BOOL);
|
||||
|
||||
require_admin();
|
||||
require_login(0, false);
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_url('/admin/category.php', array('category' => $category));
|
||||
$PAGE->set_pagetype('admin-setting-' . $category);
|
||||
|
||||
@@ -131,7 +131,8 @@ class task_log_table extends \table_sql {
|
||||
}
|
||||
|
||||
$sql = "SELECT
|
||||
tl.*,
|
||||
tl.id, tl.type, tl.component, tl.classname, tl.userid, tl.timestart, tl.timeend,
|
||||
tl.dbreads, tl.dbwrites, tl.result,
|
||||
tl.dbreads + tl.dbwrites AS db,
|
||||
tl.timeend - tl.timestart AS duration,
|
||||
{$userfields}
|
||||
|
||||
@@ -2982,4 +2982,185 @@
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="3.9" requires="3.5">
|
||||
<UNICODE level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unicoderequired" />
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mariadb" version="10.2.29" />
|
||||
<VENDOR name="mysql" version="5.6" />
|
||||
<VENDOR name="postgres" version="9.5" />
|
||||
<VENDOR name="mssql" version="11.0" />
|
||||
<VENDOR name="oracle" version="11.2" />
|
||||
</DATABASE>
|
||||
<PHP version="7.2.0" level="required">
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="mbstringrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="opensslrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlrpc" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="xmlrpcrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zlib" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="gd" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="gdrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="dom" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xml" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlreader" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="intl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="intlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="json" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="hash" level="required"/>
|
||||
<PHP_EXTENSION name="fileinfo" level="required"/>
|
||||
</PHP_EXTENSIONS>
|
||||
<PHP_SETTINGS>
|
||||
<PHP_SETTING name="memory_limit" value="96M" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="settingmemorylimit" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="file_uploads" value="1" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="settingfileuploads" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="opcache.enable" value="1" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opcacherecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
</PHP_SETTINGS>
|
||||
<CUSTOM_CHECKS>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbstorageengine" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="quizattemptsupgradedmessage" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="slashargumentswarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="unsupporteddbtablerowformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="unoconvwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbfileformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbfilepertable" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddblargeprefix" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="ishttpswarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="incompleteunicodesupport" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="sixtyfourbitswarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
</COMPATIBILITY_MATRIX>
|
||||
|
||||
+31
-11
@@ -33,13 +33,17 @@ $allprocessors = get_message_processors();
|
||||
$processors = array_filter($allprocessors, function($processor) {
|
||||
return $processor->enabled;
|
||||
});
|
||||
$disabledprocessors = array_filter($allprocessors, function($processor) {
|
||||
return !$processor->enabled;
|
||||
});
|
||||
|
||||
// Fetch message providers.
|
||||
$providers = get_message_providers();
|
||||
// Fetch the manage message outputs interface.
|
||||
$preferences = get_message_output_default_preferences();
|
||||
|
||||
if (($form = data_submitted()) && confirm_sesskey()) {
|
||||
$preferences = array();
|
||||
$newpreferences = array();
|
||||
// Prepare default message outputs settings.
|
||||
foreach ($providers as $provider) {
|
||||
$componentproviderbase = $provider->component.'_'.$provider->name;
|
||||
@@ -47,9 +51,9 @@ if (($form = data_submitted()) && confirm_sesskey()) {
|
||||
$providerdisabled = false;
|
||||
if (!isset($form->$disableprovidersetting)) {
|
||||
$providerdisabled = true;
|
||||
$preferences[$disableprovidersetting] = 1;
|
||||
$newpreferences[$disableprovidersetting] = 1;
|
||||
} else {
|
||||
$preferences[$disableprovidersetting] = 0;
|
||||
$newpreferences[$disableprovidersetting] = 0;
|
||||
}
|
||||
|
||||
foreach (array('permitted', 'loggedin', 'loggedoff') as $setting) {
|
||||
@@ -75,20 +79,36 @@ if (($form = data_submitted()) && confirm_sesskey()) {
|
||||
$form->{$componentproviderbase.'_loggedoff'}[$processor->name] = 1;
|
||||
}
|
||||
// Record the site preference.
|
||||
$preferences[$processor->name.'_provider_'.$componentprovidersetting] = $value;
|
||||
$newpreferences[$processor->name.'_provider_'.$componentprovidersetting] = $value;
|
||||
}
|
||||
} else if (property_exists($form, $componentprovidersetting)) {
|
||||
// We must be processing loggedin or loggedoff checkboxes. Store
|
||||
// defained comma-separated processors as setting value.
|
||||
// Using array_filter eliminates elements set to 0 above.
|
||||
$value = join(',', array_keys(array_filter($form->{$componentprovidersetting})));
|
||||
} else {
|
||||
$newsettings = array();
|
||||
if (array_key_exists($componentprovidersetting, $form)) {
|
||||
// We must be processing loggedin or loggedoff checkboxes.
|
||||
// Store defained comma-separated processors as setting value.
|
||||
// Using array_filter eliminates elements set to 0 above.
|
||||
$newsettings = array_keys(array_filter($form->{$componentprovidersetting}));
|
||||
}
|
||||
|
||||
// Let's join existing setting values for disabled processors.
|
||||
$property = 'message_provider_'.$componentprovidersetting;
|
||||
if (property_exists($preferences, $property)) {
|
||||
$existingsetting = $preferences->$property;
|
||||
foreach ($disabledprocessors as $disable) {
|
||||
if (strpos($existingsetting, $disable->name) > -1) {
|
||||
$newsettings[] = $disable->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$value = join(',', $newsettings);
|
||||
if (empty($value)) {
|
||||
$value = null;
|
||||
}
|
||||
}
|
||||
if ($setting != 'permitted') {
|
||||
// We have already recoded site preferences for 'permitted' type.
|
||||
$preferences['message_provider_'.$componentprovidersetting] = $value;
|
||||
$newpreferences['message_provider_'.$componentprovidersetting] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,7 +122,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
|
||||
\core_message\api::update_processor_status($processor, $enabled);
|
||||
}
|
||||
|
||||
foreach ($preferences as $name => $value) {
|
||||
foreach ($newpreferences as $name => $value) {
|
||||
set_config($name, $value, 'message');
|
||||
}
|
||||
$transaction->allow_commit();
|
||||
|
||||
@@ -157,19 +157,19 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
// Allowed roles.
|
||||
$allow = optional_param_array('allowassign', null, PARAM_INT);
|
||||
if (!is_null($allow)) {
|
||||
$this->allowassign = $allow;
|
||||
$this->allowassign = array_filter($allow);
|
||||
}
|
||||
$allow = optional_param_array('allowoverride', null, PARAM_INT);
|
||||
if (!is_null($allow)) {
|
||||
$this->allowoverride = $allow;
|
||||
$this->allowoverride = array_filter($allow);
|
||||
}
|
||||
$allow = optional_param_array('allowswitch', null, PARAM_INT);
|
||||
if (!is_null($allow)) {
|
||||
$this->allowswitch = $allow;
|
||||
$this->allowswitch = array_filter($allow);
|
||||
}
|
||||
$allow = optional_param_array('allowview', null, PARAM_INT);
|
||||
if (!is_null($allow)) {
|
||||
$this->allowview = $allow;
|
||||
$this->allowview = array_filter($allow);
|
||||
}
|
||||
|
||||
// Now read the permissions for each capability.
|
||||
@@ -618,7 +618,9 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
if ($this->roleid == 0) {
|
||||
$options[-1] = get_string('thisnewrole', 'core_role');
|
||||
}
|
||||
return html_writer::select($options, 'allow'.$type.'[]', $selected, false, array('multiple' => 'multiple',
|
||||
return
|
||||
html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'allow'.$type.'[]', 'value' => "")) .
|
||||
html_writer::select($options, 'allow'.$type.'[]', $selected, false, array('multiple' => 'multiple',
|
||||
'size' => 10, 'class' => 'form-control'));
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ $logid = optional_param('logid', null, PARAM_INT);
|
||||
$download = optional_param('download', false, PARAM_BOOL);
|
||||
|
||||
if (null !== $logid) {
|
||||
// Raise memory limit in case the log is large.
|
||||
raise_memory_limit(MEMORY_HUGE);
|
||||
$log = $DB->get_record('task_log', ['id' => $logid], '*', MUST_EXIST);
|
||||
|
||||
if ($download) {
|
||||
|
||||
@@ -144,6 +144,10 @@ class api {
|
||||
$rolesadded = array();
|
||||
$rolesremoved = array();
|
||||
|
||||
// Remove any cohort role mappings for roles which have been deleted.
|
||||
// The role assignments are not a consideration because these will have been removed when the role was.
|
||||
$DB->delete_records_select('tool_cohortroles', "roleid NOT IN (SELECT id FROM {role})");
|
||||
|
||||
// Get all cohort role assignments and group them by user and role.
|
||||
$all = cohort_role_assignment::get_records(array(), 'userid, roleid');
|
||||
// We build an better structure to loop on.
|
||||
|
||||
@@ -44,5 +44,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -712,7 +712,7 @@ class api {
|
||||
'requestedby' => $requestedby->fullname,
|
||||
'requesttype' => $typetext,
|
||||
'requestdate' => userdate($requestdata->timecreated),
|
||||
'requestorigin' => $SITE->fullname,
|
||||
'requestorigin' => format_string($SITE->fullname, true, ['context' => context_system::instance()]),
|
||||
'requestoriginurl' => new moodle_url('/'),
|
||||
'requestcomments' => $requestdata->messagehtml,
|
||||
'datarequestsurl' => $datarequestsurl
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace tool_dataprivacy\task;
|
||||
|
||||
use action_link;
|
||||
use coding_exception;
|
||||
use context_system;
|
||||
use core\message\message;
|
||||
use core\task\adhoc_task;
|
||||
use core_user;
|
||||
@@ -152,7 +153,7 @@ class process_data_request_task extends adhoc_task {
|
||||
$message->name = 'datarequestprocessingresults';
|
||||
$message->userfrom = $dpo;
|
||||
$message->replyto = $dpo->email;
|
||||
$message->replytoname = fullname($dpo->email);
|
||||
$message->replytoname = fullname($dpo);
|
||||
|
||||
$typetext = null;
|
||||
// Prepare the context data for the email message body.
|
||||
@@ -180,7 +181,8 @@ class process_data_request_task extends adhoc_task {
|
||||
$message->contexturl = $datarequestsurl;
|
||||
$message->contexturlname = get_string('datarequests', 'tool_dataprivacy');
|
||||
// Message to the recipient.
|
||||
$messagetextdata['message'] = get_string('resultdownloadready', 'tool_dataprivacy', $SITE->fullname);
|
||||
$messagetextdata['message'] = get_string('resultdownloadready', 'tool_dataprivacy',
|
||||
format_string($SITE->fullname, true, ['context' => context_system::instance()]));
|
||||
// Prepare download link.
|
||||
$downloadurl = moodle_url::make_pluginfile_url($usercontext->id, 'tool_dataprivacy', 'export', $thing->get_itemid(),
|
||||
$thing->get_filepath(), $thing->get_filename(), true);
|
||||
@@ -192,7 +194,8 @@ class process_data_request_task extends adhoc_task {
|
||||
// No point notifying a deleted user in Moodle.
|
||||
$message->notification = 0;
|
||||
// Message to the recipient.
|
||||
$messagetextdata['message'] = get_string('resultdeleted', 'tool_dataprivacy', $SITE->fullname);
|
||||
$messagetextdata['message'] = get_string('resultdeleted', 'tool_dataprivacy',
|
||||
format_string($SITE->fullname, true, ['context' => context_system::instance()]));
|
||||
// Message will be sent to the deleted user via email only.
|
||||
$emailonly = true;
|
||||
break;
|
||||
|
||||
@@ -319,5 +319,8 @@ function xmldb_tool_dataprivacy_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -301,6 +301,11 @@ class tool_dataprivacy_api_testcase extends advanced_testcase {
|
||||
$datarequest = api::create_data_request($student->id, api::DATAREQUEST_TYPE_EXPORT);
|
||||
|
||||
$requestid = $datarequest->get('id');
|
||||
|
||||
// Login as a user without DPO role.
|
||||
$this->setUser($teacher);
|
||||
$this->expectException(required_capability_exception::class);
|
||||
api::approve_data_request($requestid);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,5 +48,8 @@ function xmldb_tool_log_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -49,5 +49,8 @@ function xmldb_logstore_database_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -49,5 +49,8 @@ function xmldb_logstore_standard_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
// No example context because the JS is connected to webservices
|
||||
}}
|
||||
<div class="float-sm-right card card-block">
|
||||
<div class="float-sm-right border p-2 mb-2">
|
||||
{{#hascompetencies}}
|
||||
<span>
|
||||
<label for="competency-nav-{{uniqid}}" class="accesshide">{{#str}}jumptocompetency, tool_lp{{/str}}</label>
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
{{/comppath}}
|
||||
{{#usercompetencycourse}}
|
||||
{{#grade}}
|
||||
<span class="badge {{^proficiency}}badge-danger{{/proficiency}}">{{gradename}}</span>
|
||||
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}}">{{gradename}}</span>
|
||||
{{/grade}}
|
||||
{{/usercompetencycourse}}
|
||||
{{#canmanagecoursecompetencies}}
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
Template statistics template.
|
||||
}}
|
||||
{{#competencycount}}
|
||||
<div data-region="coursecompetencystatistics" class="card">
|
||||
<div data-region="coursecompetencystatistics" class="border p-2 mb-2">
|
||||
{{#canbegradedincourse}}
|
||||
{{< tool_lp/progress_bar}}
|
||||
{{$progresstext}}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
"id": 1
|
||||
}
|
||||
}}
|
||||
<div class="card well-small evidence" data-region="evidence" data-id="{{id}}">
|
||||
<div class="border p-2 mb-2 evidence" data-region="evidence" data-id="{{id}}">
|
||||
{{#candelete}}
|
||||
<div class="float-sm-right">
|
||||
<a href="#" data-action="delete-evidence">{{#pix}}t/delete{{/pix}}</a>
|
||||
|
||||
@@ -50,10 +50,12 @@
|
||||
<div class="col-lg-6">
|
||||
<p>
|
||||
<form data-region="filtercompetencies" data-frameworkid="{{framework.id}}" class="form-inline">
|
||||
<div class="form-group">
|
||||
<div class="input-group mb-3">
|
||||
<label class="accesshide" for="filter{{uniqid}}">{{#str}}search, tool_lp{{/str}}</label>
|
||||
<input class="form-control" type="text" id="filter{{uniqid}}" placeholder="{{#str}}search, tool_lp{{/str}}" value="{{search}}">
|
||||
<button class="btn btn-secondary">{{#pix}}a/search, , {{#str}}search{{/str}}{{/pix}}</button>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary">{{#pix}}a/search, , {{#str}}search{{/str}}{{/pix}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</p>
|
||||
@@ -62,8 +64,8 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="card col-lg-6">
|
||||
<div class="card-block card-body">
|
||||
<div class="col-lg-6">
|
||||
<div class="border p-2 mb-2">
|
||||
<div class="card-title">
|
||||
<h4 data-region="selected-competency">{{#str}}selectedcompetency, tool_lp{{/str}}</h4>
|
||||
<span data-region="competencyactionsmenu" class="float-sm-right">
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
// No example context because the JS is connected to webservices
|
||||
}}
|
||||
<div class="float-right card p-2">
|
||||
<div class="float-right border mb-2 p-2">
|
||||
<form class="user-competency-course-navigation">
|
||||
<input type="hidden" name="courseid" value="{{courseid}}"/>
|
||||
<input type="hidden" name="mod" value="{{moduleid}}"/>
|
||||
|
||||
@@ -26,10 +26,8 @@
|
||||
</h2>
|
||||
<div>{{{template.description}}}</div>
|
||||
{{#canmanagetemplatecompetencies}}
|
||||
<div data-region="actions" class="clearfix">
|
||||
<div class="float-left">
|
||||
<button disabled class="btn btn-secondary">{{#str}}addtemplatecompetencies, tool_lp{{/str}}</button>
|
||||
</div>
|
||||
<div data-region="actions" class="my-4">
|
||||
<button disabled class="btn btn-secondary">{{#str}}addtemplatecompetencies, tool_lp{{/str}}</button>
|
||||
</div>
|
||||
{{/canmanagetemplatecompetencies}}
|
||||
<h3 class="mt-1">{{#str}}templatecompetencies, tool_lp{{/str}}</h3>
|
||||
@@ -41,7 +39,7 @@
|
||||
<div class="drag-parentnode">
|
||||
{{#competencies}}
|
||||
<div class="drag-samenode" data-id="{{competency.id}}">
|
||||
<div class="card">
|
||||
<div class="border p-2 mb-2">
|
||||
{{#canmanagetemplatecompetencies}}
|
||||
<span class="drag-handlecontainer float-left"></span>
|
||||
<div class="float-sm-right">
|
||||
|
||||
@@ -45,8 +45,7 @@
|
||||
Template statistics template.
|
||||
}}
|
||||
{{#competencycount}}
|
||||
<div data-region="templatestatistics" class="card">
|
||||
<div class="card-block">
|
||||
<div data-region="templatestatistics" class="border p-2 mb-2">
|
||||
{{< tool_lp/progress_bar}}
|
||||
{{$progresstext}}
|
||||
{{#str}}xcompetencieslinkedoutofy, tool_lp, { "x": "{{linkedcompetencycount}}", "y": "{{competencycount}}" } {{/str}}
|
||||
@@ -90,6 +89,5 @@
|
||||
</div>
|
||||
</div>
|
||||
{{/leastproficientcount}}
|
||||
</div>
|
||||
</div>
|
||||
{{/competencycount}}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
// No example context because the JS is connected to webservices
|
||||
}}
|
||||
<div class="float-sm-right card card-block p-x-1 p-b-1">
|
||||
<div class="float-sm-right border p-2 mb-2">
|
||||
<p>{{{groupselector}}}</p>
|
||||
<form class="user-competency-course-navigation">
|
||||
<input type="hidden" name="userid" value="{{userid}}"/>
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
</dd>
|
||||
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
|
||||
<dd>
|
||||
<span class="badge{{^proficiency}} badge-danger{{/proficiency}} float-left">
|
||||
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}} float-left">
|
||||
{{proficiencyname}}
|
||||
</span>
|
||||
</dd>
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
{{#usercompetencycourse}}
|
||||
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
|
||||
<dd>
|
||||
<span class="badge{{^proficiency}} badge-danger{{/proficiency}} float-left">
|
||||
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}} float-left">
|
||||
{{proficiencyname}}
|
||||
</span>
|
||||
</dd>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
</dd>
|
||||
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
|
||||
<dd>
|
||||
<span class="badge{{^proficiency}} badge-danger{{/proficiency}} float-left">
|
||||
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}} float-left">
|
||||
{{proficiencyname}}
|
||||
</span>
|
||||
</dd>
|
||||
@@ -101,7 +101,7 @@
|
||||
<dd>{{gradename}} - {{#str}}plancompleted, tool_lp{{/str}}</dd>
|
||||
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
|
||||
<dd>
|
||||
<span class="badge{{^proficiency}} badge-danger{{/proficiency}} float-left">
|
||||
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}} float-left">
|
||||
{{proficiencyname}}
|
||||
</span>
|
||||
</dd>
|
||||
|
||||
@@ -45,5 +45,8 @@ function xmldb_tool_mobile_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
|
||||
|
||||
set_config('hostname', 'localhost', 'auth_cas');
|
||||
set_config('auth_logo', 'http://invalidurl.com//invalid/', 'auth_cas');
|
||||
|
||||
set_config('auth_name', 'CAS', 'auth_cas');
|
||||
set_config('auth', 'oauth2,cas');
|
||||
|
||||
list($authinstructions, $notusedformat) = external_format_text($authinstructions, FORMAT_MOODLE, $context->id);
|
||||
|
||||
@@ -65,5 +65,8 @@ function xmldb_tool_monitor_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -66,5 +66,8 @@ function xmldb_tool_policy_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -720,6 +720,12 @@ class tool_uploadcourse_course {
|
||||
}
|
||||
}
|
||||
|
||||
// Visibility can only be 0 or 1.
|
||||
if (!empty($coursedata['visible']) AND !($coursedata['visible'] == 0 OR $coursedata['visible'] == 1)) {
|
||||
$this->error('invalidvisibilitymode', new lang_string('invalidvisibilitymode', 'tool_uploadcourse'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Saving data.
|
||||
$this->data = $coursedata;
|
||||
$this->enrolmentdata = tool_uploadcourse_helper::get_enrolment_data($this->rawdata);
|
||||
|
||||
@@ -90,6 +90,7 @@ $string['invalidcsvfile'] = 'Invalid input CSV file';
|
||||
$string['invalidencoding'] = 'Invalid encoding';
|
||||
$string['invalidmode'] = 'Invalid mode selected';
|
||||
$string['invalideupdatemode'] = 'Invalid update mode selected';
|
||||
$string['invalidvisibilitymode'] = 'Invalid visible mode';
|
||||
$string['invalidroles'] = 'Invalid role names: {$a}';
|
||||
$string['invalidshortname'] = 'Invalid shortname';
|
||||
$string['missingmandatoryfields'] = 'Missing value for mandatory fields: {$a}';
|
||||
|
||||
@@ -82,6 +82,16 @@ class tool_uploadcourse_course_testcase extends advanced_testcase {
|
||||
$this->assertArrayHasKey('invalidshortname', $co->get_errors());
|
||||
}
|
||||
|
||||
public function test_invalid_visibility() {
|
||||
$this->resetAfterTest(true);
|
||||
$mode = tool_uploadcourse_processor::MODE_CREATE_NEW;
|
||||
$updatemode = tool_uploadcourse_processor::UPDATE_NOTHING;
|
||||
$data = array('shortname' => 'test', 'fullname' => 'New course', 'summary' => 'New', 'category' => 1, 'visible' => 2);
|
||||
$co = new tool_uploadcourse_course($mode, $updatemode, $data);
|
||||
$this->assertFalse($co->prepare());
|
||||
$this->assertArrayHasKey('invalidvisibilitymode', $co->get_errors());
|
||||
}
|
||||
|
||||
public function test_create() {
|
||||
global $DB;
|
||||
$this->resetAfterTest(true);
|
||||
|
||||
@@ -64,5 +64,8 @@ function xmldb_tool_usertours_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ class test_analysis extends \core_analytics\analysis {
|
||||
*/
|
||||
public function process_analysable(\core_analytics\analysable $analysable): array {
|
||||
// Half a second.
|
||||
usleep(500000);
|
||||
sleep(1);
|
||||
return parent::process_analysable($analysable);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ class analytics_model_testcase extends advanced_testcase {
|
||||
|
||||
$this->resetAfterTest(true);
|
||||
|
||||
set_config('modeltimelimit', 1, 'analytics');
|
||||
set_config('modeltimelimit', 2, 'analytics');
|
||||
|
||||
$courses = array();
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
|
||||
@@ -54,5 +54,8 @@ function xmldb_auth_cas_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -54,5 +54,8 @@ function xmldb_auth_db_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -54,5 +54,8 @@ function xmldb_auth_email_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -72,5 +72,8 @@ function xmldb_auth_ldap_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -54,5 +54,8 @@ function xmldb_auth_manual_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -54,5 +54,8 @@ function xmldb_auth_mnet_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -54,5 +54,8 @@ function xmldb_auth_none_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -84,5 +84,8 @@ function xmldb_auth_oauth2_upgrade($oldversion) {
|
||||
upgrade_plugin_savepoint(true, 2019052001, 'auth', 'oauth2');
|
||||
}
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -54,5 +54,8 @@ function xmldb_auth_shibboleth_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,8 @@ if (empty($CFG->enablebadges)) {
|
||||
|
||||
$hash = required_param('b', PARAM_ALPHANUM); // Issued badge unique hash for badge assertion.
|
||||
$action = optional_param('action', null, PARAM_BOOL); // Generates badge class if true.
|
||||
$obversion = optional_param('obversion', OPEN_BADGES_V1, PARAM_INT); // For control format OB specification version.
|
||||
// OB specification version. If it's not defined, the site will be used as default.
|
||||
$obversion = optional_param('obversion', badges_open_badges_backpack_api(), PARAM_INT);
|
||||
|
||||
$assertion = new core_badges_assertion($hash, $obversion);
|
||||
|
||||
|
||||
@@ -54,6 +54,9 @@ class issued_badge implements renderable {
|
||||
/** @var badge class */
|
||||
public $badgeid = 0;
|
||||
|
||||
/** @var unique hash identifying the issued badge */
|
||||
public $hash;
|
||||
|
||||
/**
|
||||
* Initializes the badge to display
|
||||
*
|
||||
@@ -62,7 +65,8 @@ class issued_badge implements renderable {
|
||||
public function __construct($hash) {
|
||||
global $DB;
|
||||
|
||||
$assertion = new \core_badges_assertion($hash);
|
||||
$this->hash = $hash;
|
||||
$assertion = new \core_badges_assertion($hash, badges_open_badges_backpack_api());
|
||||
$this->issued = $assertion->get_badge_assertion();
|
||||
$this->badgeclass = $assertion->get_badge_class();
|
||||
|
||||
|
||||
+3
-3
@@ -337,13 +337,13 @@ class core_badges_renderer extends plugin_renderer_base {
|
||||
|
||||
if ($USER->id == $userinfo->id && !empty($CFG->enablebadges)) {
|
||||
$output .= $this->output->single_button(
|
||||
new moodle_url('/badges/badge.php', array('hash' => $issued['uid'], 'bake' => true)),
|
||||
new moodle_url('/badges/badge.php', array('hash' => $ibadge->hash, 'bake' => true)),
|
||||
get_string('download'),
|
||||
'POST');
|
||||
if (!empty($CFG->badges_allowexternalbackpack) && ($expiration > $now) && badges_user_has_backpack($USER->id)) {
|
||||
|
||||
if (badges_open_badges_backpack_api() == OPEN_BADGES_V1) {
|
||||
$assertion = new moodle_url('/badges/assertion.php', array('b' => $issued['uid']));
|
||||
$assertion = new moodle_url('/badges/assertion.php', array('b' => $ibadge->hash));
|
||||
$action = new component_action('click', 'addtobackpack', array('assertion' => $assertion->out(false)));
|
||||
$attributes = array(
|
||||
'type' => 'button',
|
||||
@@ -354,7 +354,7 @@ class core_badges_renderer extends plugin_renderer_base {
|
||||
$this->output->add_action_handler($action, 'addbutton');
|
||||
$output .= $tobackpack;
|
||||
} else {
|
||||
$assertion = new moodle_url('/badges/backpack-add.php', array('hash' => $issued['uid']));
|
||||
$assertion = new moodle_url('/badges/backpack-add.php', array('hash' => $ibadge->hash));
|
||||
$attributes = ['class' => 'btn btn-secondary m-1', 'role' => 'button'];
|
||||
$tobackpack = html_writer::link($assertion, get_string('addtobackpack', 'badges'), $attributes);
|
||||
$output .= $tobackpack;
|
||||
|
||||
@@ -60,5 +60,8 @@ function xmldb_block_badges_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ function block_blog_tags_sort($a, $b) {
|
||||
}
|
||||
|
||||
if (is_numeric($a->$tagsort)) {
|
||||
return ($a->$tagsort == $b->$tagsort) ? 0 : ($a->$tagsort > $b->$tagsort) ? 1 : -1;
|
||||
return (($a->$tagsort == $b->$tagsort) ? 0 : ($a->$tagsort > $b->$tagsort)) ? 1 : -1;
|
||||
} elseif (is_string($a->$tagsort)) {
|
||||
return strcmp($a->$tagsort, $b->$tagsort); //TODO: this is not compatible with UTF-8!!
|
||||
} else {
|
||||
|
||||
@@ -60,5 +60,8 @@ function xmldb_block_calendar_month_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -60,5 +60,8 @@ function xmldb_block_calendar_upcoming_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -63,5 +63,8 @@ function xmldb_block_completionstatus_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -63,5 +63,8 @@ function xmldb_block_course_summary_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -48,5 +48,8 @@ function xmldb_block_html_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -366,7 +366,9 @@ class main implements renderable, templatable {
|
||||
return [];
|
||||
}
|
||||
$field = \core_customfield\field_controller::create($fieldid);
|
||||
if (!$field->supports_course_grouping()) {
|
||||
$isvisible = $field->get_configdata_property('visibility') == \core_course\customfield\course_handler::VISIBLETOALL;
|
||||
// Only visible fields to everybody supporting course grouping will be displayed.
|
||||
if (!$field->supports_course_grouping() || !$isvisible) {
|
||||
return []; // The field shouldn't have been selectable in the global settings, but just skip it now.
|
||||
}
|
||||
$values = $field->course_grouping_format_values($values);
|
||||
|
||||
@@ -55,5 +55,8 @@ function xmldb_block_myoverview_upgrade($oldversion) {
|
||||
upgrade_block_savepoint(true, 2019091800, 'myoverview', false);
|
||||
}
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ $string['courseprogress'] = 'Course progress:';
|
||||
$string['completepercent'] = '{$a}% complete';
|
||||
$string['customfield'] = 'Custom field';
|
||||
$string['customfiltergrouping'] = 'Field to use';
|
||||
$string['customfiltergrouping_nofields'] = 'This option requires a course custom field to be set up.';
|
||||
$string['customfiltergrouping_nofields'] = 'This option requires a course custom field to be set up and visible to everyone.';
|
||||
$string['displaycategories'] = 'Display categories';
|
||||
$string['displaycategories_help'] = 'Display the course category on dashboard course items including cards, list items and summary items.';
|
||||
$string['favourites'] = 'Starred';
|
||||
|
||||
@@ -13,14 +13,16 @@ Feature: The my overview block allows users to group courses by custom fields
|
||||
| Checkbox field | Course fields | checkbox | checkboxfield | |
|
||||
| Date field | Course fields | date | datefield | {"mindate":0, "maxdate":0} |
|
||||
| Select field | Course fields | select | selectfield | {"options":"Option 1\nOption 2\nOption 3\nOption 4"} |
|
||||
| Text field | Course fields | text | textfield | |
|
||||
| Text field | Course fields | text | textfield | {"visibility":"2"} |
|
||||
| Text field 2 | Course fields | text | textfield2 | {"visibility":"2"} |
|
||||
| Hidden field | Course fields | text | hiddenfield | {"visibility":"0"} |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category | customfield_checkboxfield | customfield_datefield | customfield_selectfield | customfield_textfield |
|
||||
| Course 1 | C1 | 0 | 1 | 981028800 | 1 | fish |
|
||||
| Course 2 | C2 | 0 | 0 | 334324800 | | |
|
||||
| Course 3 | C3 | 0 | 0 | 981028800 | 2 | dog |
|
||||
| Course 4 | C4 | 0 | 1 | | 3 | cat |
|
||||
| Course 5 | C5 | 0 | | 334411200 | 2 | fish |
|
||||
| fullname | shortname | category | customfield_checkboxfield | customfield_datefield | customfield_selectfield | customfield_textfield | customfield_textfield2 |
|
||||
| Course 1 | C1 | 0 | 1 | 981028800 | 1 | fish | penguin |
|
||||
| Course 2 | C2 | 0 | 0 | 334324800 | | | |
|
||||
| Course 3 | C3 | 0 | 0 | 981028800 | 2 | dog | |
|
||||
| Course 4 | C4 | 0 | 1 | | 3 | cat | |
|
||||
| Course 5 | C5 | 0 | | 334411200 | 2 | fish | penguin |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| student1 | C1 | student |
|
||||
@@ -172,3 +174,24 @@ Feature: The my overview block allows users to group courses by custom fields
|
||||
And I should not see "Course 3" in the "Course overview" "block"
|
||||
And I should not see "Course 4" in the "Course overview" "block"
|
||||
And I should not see "Course 5" in the "Course overview" "block"
|
||||
|
||||
Scenario: Hidden fields not displayed when configuring the custom field filters
|
||||
Given I log in as "admin"
|
||||
When I navigate to "Plugins > Blocks > Course overview" in site administration
|
||||
And I set the field "Custom field" to "1"
|
||||
Then the "Field to use" select box should not contain "Hidden field"
|
||||
|
||||
Scenario: Hidden fields not displayed in the filter
|
||||
Given the following config values are set as admin:
|
||||
| displaygroupingcustomfield | 1 | block_myoverview |
|
||||
| customfiltergrouping | textfield2 | block_myoverview |
|
||||
And I log in as "admin"
|
||||
And I navigate to "Courses > Course custom fields" in site administration
|
||||
And I click on "Edit" "link" in the "Text field 2" "table_row"
|
||||
And I set the field "Visible to" to "Nobody"
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
When I log in as "student1"
|
||||
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
|
||||
Then I should not see "penguin" in the "Course overview" "block"
|
||||
Then I should not see "No text field" in the "Course overview" "block"
|
||||
|
||||
@@ -70,5 +70,8 @@ function xmldb_block_navigation_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -60,5 +60,8 @@ function xmldb_block_quiz_results_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -62,5 +62,8 @@ function xmldb_block_recent_activity_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -69,5 +69,8 @@ function xmldb_block_recentlyaccesseditems_upgrade($oldversion, $block) {
|
||||
upgrade_block_savepoint(true, 2019052001, 'recentlyaccesseditems', false);
|
||||
}
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -48,5 +48,8 @@ function xmldb_block_rss_client_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -64,5 +64,8 @@ function xmldb_block_section_links_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -63,5 +63,8 @@ function xmldb_block_selfcompletion_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -70,5 +70,8 @@ function xmldb_block_settings_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
define ("block_timeline/event_list",["jquery","core/notification","core/templates","core/paged_content_factory","core/str","core/user_date","block_timeline/calendar_events_repository"],function(a,b,c,d,e,f,g){var h={EMPTY_MESSAGE:"[data-region=\"empty-message\"]",ROOT:"[data-region=\"event-list-container\"]",EVENT_LIST_CONTENT:"[data-region=\"event-list-content\"]",EVENT_LIST_LOADING_PLACEHOLDER:"[data-region=\"event-list-loading-placeholder\"]"},i={EVENT_LIST_CONTENT:"block_timeline/event-list-content"},j={ignoreControlWhileLoading:!0,controlPlacementBottom:!0,ariaLabels:{itemsperpagecomponents:"ariaeventlistpagelimit, block_timeline"}},k=function(a){a.find(h.EVENT_LIST_CONTENT).addClass("hidden");a.find(h.EMPTY_MESSAGE).removeClass("hidden")},l=function(a){a.find(h.EVENT_LIST_CONTENT).removeClass("hidden");a.find(h.EMPTY_MESSAGE).addClass("hidden")},m=function(a){a.find(h.EVENT_LIST_CONTENT).empty()},n=function(a,b){var c={},d={eventsbyday:[]};a.forEach(function(a){var d=f.getUserMidnightForTimestamp(a.timesort,b);if(c[d]){c[d].push(a)}else{c[d]=[a]}});Object.keys(c).forEach(function(a){var e=c[a];d.eventsbyday.push({past:a<b,dayTimestamp:a,events:e})});return d},o=function(a,b){var d=n(a,b),e=i.EVENT_LIST_CONTENT;return c.render(e,d)},p=function(a,b,c,d,e,f){var h=d!=void 0?a+d*86400:!1,i={starttime:a+c*86400,limit:b};if(e){i.aftereventid=e}if(h){i.endtime=h}if(f){i.courseid=f;return g.queryByCourse(i)}else{return g.queryByTime(i)}},q=function(a,b,c,d,e,f,g,h){var i=a.pageNumber,j=a.limit,k=i;while(!d.hasOwnProperty(k)){k--}var l=d[k],m=null;if(e&&e.hasOwnProperty(i)){m=e[i]}else{m=p(c,j+1,g,h,l,f)}return m.then(function(a){if(!a.events.length){b.allItemsLoaded(i);return[]}var c=a.events.filter(function(a){return"open"!=a.eventtype&&"opensubmission"!=a.eventtype}),d=c.length<=j;if(d){b.allItemsLoaded(i)}else{c.pop()}return c})},r=function(c,f,g,h,i,k,l,m,n){var p={1:0},r=!1,s=a.extend({},j,n);return e.get_string("ariaeventlistpagelimit","block_timeline",a.isArray(c)?c[0].value:c).then(function(a){s.ariaLabels.itemsperpage=a;s.ariaLabels.paginationnav=m;return a}).then(function(){return d.createWithLimit(c,function(c,d){var e=[];c.forEach(function(a){var c=a.pageNumber,h=q(a,d,g,p,f,i,k,l).then(function(a){if(a.length){r=!0;var b=a[a.length-1].id;p[c+1]=b;return o(a,g)}else{return a}}).catch(b.exception);e.push(h)});a.when.apply(a,e).then(function(){h.resolve(r)}).catch(function(){h.resolve(r)});return e},s)})};return{init:function init(d,e,f,g,i){d=a(d);var j=a.Deferred(),n=d.find(h.EVENT_LIST_CONTENT),o=d.find(h.EVENT_LIST_LOADING_PLACEHOLDER),p=d.attr("data-course-id"),q=parseInt(d.attr("data-days-offset"),10),s=d.attr("data-days-limit"),t=parseInt(d.attr("data-midnight"),10);m(d);l(d);o.removeClass("hidden");if(s!=void 0){s=parseInt(s,10)}return r(e,f,t,j,p,q,s,g,i).then(function(b,e){b=a(b);b.addClass("hidden");c.replaceNodeContents(n,b,e);j.then(function(a){b.removeClass("hidden");o.addClass("hidden");if(!a){k(d)}return a}).catch(function(){return!1});return b}).catch(b.exception)},rootSelector:h.ROOT}});
|
||||
define ("block_timeline/event_list",["jquery","core/notification","core/templates","core/paged_content_factory","core/str","core/user_date","block_timeline/calendar_events_repository"],function(a,b,c,d,e,f,g){var h={EMPTY_MESSAGE:"[data-region=\"empty-message\"]",ROOT:"[data-region=\"event-list-container\"]",EVENT_LIST_CONTENT:"[data-region=\"event-list-content\"]",EVENT_LIST_LOADING_PLACEHOLDER:"[data-region=\"event-list-loading-placeholder\"]"},i={EVENT_LIST_CONTENT:"block_timeline/event-list-content"},j={ignoreControlWhileLoading:!0,controlPlacementBottom:!0,ariaLabels:{itemsperpagecomponents:"ariaeventlistpagelimit, block_timeline"}},k=function(a){a.find(h.EVENT_LIST_CONTENT).addClass("hidden");a.find(h.EMPTY_MESSAGE).removeClass("hidden")},l=function(a){a.find(h.EVENT_LIST_CONTENT).removeClass("hidden");a.find(h.EMPTY_MESSAGE).addClass("hidden")},m=function(a){a.find(h.EVENT_LIST_CONTENT).empty()},n=function(a,b){var c={},d={eventsbyday:[]};a.forEach(function(a){var d=f.getUserMidnightForTimestamp(a.timesort,b);if(c[d]){c[d].push(a)}else{c[d]=[a]}});Object.keys(c).forEach(function(a){var e=c[a];d.eventsbyday.push({past:a<b,dayTimestamp:a,events:e})});return d},o=function(a,b){var d=n(a,b),e=i.EVENT_LIST_CONTENT;return c.render(e,d)},p=function(a,b,c,d,e,f){var h=d!=void 0?a+d*86400:!1,i={starttime:a+c*86400,limit:b};if(e){i.aftereventid=e}if(h){i.endtime=h}if(f){i.courseid=f;return g.queryByCourse(i)}else{return g.queryByTime(i)}},q=function(a,b,c,d,e,g,h,i){var j=a.pageNumber,k=a.limit,l=j;while(!d.hasOwnProperty(l)){l--}var m=d[l],n=null;if(e&&e.hasOwnProperty(j)){n=e[j]}else{n=p(c,k+1,h,i,m,g)}return n.then(function(a){if(!a.events.length){b.allItemsLoaded(j);return[]}var d=a.events.filter(function(a){if("open"==a.eventtype||"opensubmission"==a.eventtype){var b=f.getUserMidnightForTimestamp(a.timesort,c);return b>c}return!0}),e=d.length<=k;if(e){b.allItemsLoaded(j)}else{d.pop()}return d})},r=function(c,f,g,h,i,k,l,m,n){var p={1:0},r=!1,s=a.extend({},j,n);return e.get_string("ariaeventlistpagelimit","block_timeline",a.isArray(c)?c[0].value:c).then(function(a){s.ariaLabels.itemsperpage=a;s.ariaLabels.paginationnav=m;return a}).then(function(){return d.createWithLimit(c,function(c,d){var e=[];c.forEach(function(a){var c=a.pageNumber,h=q(a,d,g,p,f,i,k,l).then(function(a){if(a.length){r=!0;var b=a[a.length-1].id;p[c+1]=b;return o(a,g)}else{return a}}).catch(b.exception);e.push(h)});a.when.apply(a,e).then(function(){h.resolve(r)}).catch(function(){h.resolve(r)});return e},s)})};return{init:function init(d,e,f,g,i){d=a(d);var j=a.Deferred(),n=d.find(h.EVENT_LIST_CONTENT),o=d.find(h.EVENT_LIST_LOADING_PLACEHOLDER),p=d.attr("data-course-id"),q=parseInt(d.attr("data-days-offset"),10),s=d.attr("data-days-limit"),t=parseInt(d.attr("data-midnight"),10);m(d);l(d);o.removeClass("hidden");if(s!=void 0){s=parseInt(s,10)}return r(e,f,t,j,p,q,s,g,i).then(function(b,e){b=a(b);b.addClass("hidden");c.replaceNodeContents(n,b,e);j.then(function(a){b.removeClass("hidden");o.addClass("hidden");if(!a){k(d)}return a}).catch(function(){return!1});return b}).catch(b.exception)},rootSelector:h.ROOT}});
|
||||
//# sourceMappingURL=event_list.min.js.map
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -266,8 +266,11 @@ function(
|
||||
}
|
||||
|
||||
var calendarEvents = result.events.filter(function(event) {
|
||||
// Do not include events that does not have a due date.
|
||||
return event.eventtype != "open" && event.eventtype != "opensubmission";
|
||||
if (event.eventtype == "open" || event.eventtype == "opensubmission") {
|
||||
var dayTimestamp = UserDate.getUserMidnightForTimestamp(event.timesort, midnight);
|
||||
return dayTimestamp > midnight;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
// We expect to receive limit + 1 events back from the server.
|
||||
// Any less means there are no more events to load.
|
||||
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
define ("core_calendar/repository",["jquery","core/ajax"],function(a,b){return{getEventById:function getEventById(a){return b.call([{methodname:"core_calendar_get_calendar_event_by_id",args:{eventid:a}}])[0]},deleteEvent:function deleteEvent(a,c){if("undefined"==typeof c){c=!1}var d={methodname:"core_calendar_delete_calendar_events",args:{events:[{eventid:a,repeat:c}]}};return b.call([d])[0]},updateEventStartDay:function updateEventStartDay(a,c){return b.call([{methodname:"core_calendar_update_event_start_day",args:{eventid:a,daytimestamp:c}}])[0]},submitCreateUpdateForm:function submitCreateUpdateForm(a){return b.call([{methodname:"core_calendar_submit_create_update_form",args:{formdata:a}}])[0]},getCalendarMonthData:function getCalendarMonthData(a,c,d,e,f,g){return b.call([{methodname:"core_calendar_get_calendar_monthly_view",args:{year:a,month:c,courseid:d,categoryid:e,includenavigation:f,mini:g}}])[0]},getCalendarDayData:function getCalendarDayData(a,c,d,e,f){return b.call([{methodname:"core_calendar_get_calendar_day_view",args:{year:a,month:c,day:d,courseid:e,categoryid:f}}])[0]},getCalendarUpcomingData:function getCalendarUpcomingData(a,c){return b.call([{methodname:"core_calendar_get_calendar_upcoming_view",args:{courseid:a,categoryid:c}}])[0]},getCourseGroupsData:function getCourseGroupsData(a){return b.call([{methodname:"core_group_get_course_groups",args:{courseid:a}}])[0]}}});
|
||||
define ("core_calendar/repository",["jquery","core/ajax"],function(a,b){return{getEventById:function getEventById(a){return b.call([{methodname:"core_calendar_get_calendar_event_by_id",args:{eventid:a}}])[0]},deleteEvent:function deleteEvent(a,c){if("undefined"==typeof c){c=!1}var d={methodname:"core_calendar_delete_calendar_events",args:{events:[{eventid:a,repeat:c}]}};return b.call([d])[0]},updateEventStartDay:function updateEventStartDay(a,c){return b.call([{methodname:"core_calendar_update_event_start_day",args:{eventid:a,daytimestamp:c}}])[0]},submitCreateUpdateForm:function submitCreateUpdateForm(a){return b.call([{methodname:"core_calendar_submit_create_update_form",args:{formdata:a}}])[0]},getCalendarMonthData:function getCalendarMonthData(a,c,d,e,f,g,h){h=h||1;var i={methodname:"core_calendar_get_calendar_monthly_view",args:{year:a,month:c,courseid:d,categoryid:e,includenavigation:f,mini:g,day:h}};return b.call([i])[0]},getCalendarDayData:function getCalendarDayData(a,c,d,e,f){return b.call([{methodname:"core_calendar_get_calendar_day_view",args:{year:a,month:c,day:d,courseid:e,categoryid:f}}])[0]},getCalendarUpcomingData:function getCalendarUpcomingData(a,c){return b.call([{methodname:"core_calendar_get_calendar_upcoming_view",args:{courseid:a,categoryid:c}}])[0]},getCourseGroupsData:function getCourseGroupsData(a){return b.call([{methodname:"core_group_get_course_groups",args:{courseid:a}}])[0]}}});
|
||||
//# sourceMappingURL=repository.min.js.map
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -94,11 +94,13 @@ define(['jquery', 'core/ajax'], function($, Ajax) {
|
||||
* @param {Number} month Month
|
||||
* @param {Number} courseid The course id.
|
||||
* @param {Number} categoryid The category id.
|
||||
* @param {Bool} includenavigation Whether to include navigation.
|
||||
* @param {Bool} mini Whether the month is in mini view.
|
||||
* @param {Boolean} includenavigation Whether to include navigation.
|
||||
* @param {Boolean} mini Whether the month is in mini view.
|
||||
* @param {Number} day Day (optional)
|
||||
* @return {promise} Resolved with the month view data.
|
||||
*/
|
||||
var getCalendarMonthData = function(year, month, courseid, categoryid, includenavigation, mini) {
|
||||
var getCalendarMonthData = function(year, month, courseid, categoryid, includenavigation, mini, day) {
|
||||
day = day || 1;
|
||||
var request = {
|
||||
methodname: 'core_calendar_get_calendar_monthly_view',
|
||||
args: {
|
||||
@@ -107,7 +109,8 @@ define(['jquery', 'core/ajax'], function($, Ajax) {
|
||||
courseid: courseid,
|
||||
categoryid: categoryid,
|
||||
includenavigation: includenavigation,
|
||||
mini: mini
|
||||
mini: mini,
|
||||
day: day
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -94,7 +94,8 @@ define([
|
||||
var link = $(e.currentTarget);
|
||||
|
||||
if (view === 'month') {
|
||||
changeMonth(root, link.attr('href'), link.data('year'), link.data('month'), courseId, categoryId);
|
||||
changeMonth(root, link.attr('href'), link.data('year'), link.data('month'), courseId, categoryId,
|
||||
link.data('day'));
|
||||
e.preventDefault();
|
||||
} else if (view === 'day') {
|
||||
changeDay(root, link.attr('href'), link.data('year'), link.data('month'), link.data('day'),
|
||||
@@ -124,7 +125,7 @@ define([
|
||||
categoryId = option.data('categoryid');
|
||||
|
||||
if (view == 'month') {
|
||||
refreshMonthContent(root, year, month, courseId, categoryId, root, 'core_calendar/calendar_month')
|
||||
refreshMonthContent(root, year, month, courseId, categoryId, root, 'core_calendar/calendar_month', day)
|
||||
.then(function() {
|
||||
return window.history.pushState({}, '', '?view=month');
|
||||
}).fail(Notification.exception);
|
||||
@@ -153,17 +154,19 @@ define([
|
||||
* @param {Number} categoryid The id of the category whose events are shown
|
||||
* @param {object} target The element being replaced. If not specified, the calendarwrapper is used.
|
||||
* @param {String} template The template to be rendered.
|
||||
* @param {Number} day Day (optional)
|
||||
* @return {promise}
|
||||
*/
|
||||
var refreshMonthContent = function(root, year, month, courseid, categoryid, target, template) {
|
||||
var refreshMonthContent = function(root, year, month, courseid, categoryid, target, template, day) {
|
||||
startLoading(root);
|
||||
|
||||
target = target || root.find(CalendarSelectors.wrapper);
|
||||
template = template || root.attr('data-template');
|
||||
day = day || 1;
|
||||
M.util.js_pending([root.get('id'), year, month, courseid].join('-'));
|
||||
var includenavigation = root.data('includenavigation');
|
||||
var mini = root.data('mini');
|
||||
return CalendarRepository.getCalendarMonthData(year, month, courseid, categoryid, includenavigation, mini)
|
||||
return CalendarRepository.getCalendarMonthData(year, month, courseid, categoryid, includenavigation, mini, day)
|
||||
.then(function(context) {
|
||||
context.viewingmonth = true;
|
||||
return Templates.render(template, context);
|
||||
@@ -191,10 +194,12 @@ define([
|
||||
* @param {Number} month Month
|
||||
* @param {Number} courseid The id of the course whose events are shown
|
||||
* @param {Number} categoryid The id of the category whose events are shown
|
||||
* @param {Number} day Day (optional)
|
||||
* @return {promise}
|
||||
*/
|
||||
var changeMonth = function(root, url, year, month, courseid, categoryid) {
|
||||
return refreshMonthContent(root, year, month, courseid, categoryid)
|
||||
var changeMonth = function(root, url, year, month, courseid, categoryid, day) {
|
||||
day = day || 1;
|
||||
return refreshMonthContent(root, year, month, courseid, categoryid, null, null, day)
|
||||
.then(function() {
|
||||
if (url.length && url !== '#') {
|
||||
window.history.pushState({}, '', url);
|
||||
@@ -218,6 +223,7 @@ define([
|
||||
var reloadCurrentMonth = function(root, courseId, categoryId) {
|
||||
var year = root.find(CalendarSelectors.wrapper).data('year');
|
||||
var month = root.find(CalendarSelectors.wrapper).data('month');
|
||||
var day = root.find(CalendarSelectors.wrapper).data('day');
|
||||
|
||||
if (typeof courseId === 'undefined') {
|
||||
courseId = root.find(CalendarSelectors.wrapper).data('courseid');
|
||||
@@ -227,7 +233,7 @@ define([
|
||||
categoryId = root.find(CalendarSelectors.wrapper).data('categoryid');
|
||||
}
|
||||
|
||||
return refreshMonthContent(root, year, month, courseId, categoryId);
|
||||
return refreshMonthContent(root, year, month, courseId, categoryId, null, null, day);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -988,10 +988,11 @@ class core_calendar_external extends external_api {
|
||||
* @param int $categoryid The category to be included
|
||||
* @param bool $includenavigation Whether to include navigation
|
||||
* @param bool $mini Whether to return the mini month view or not
|
||||
* @param int $day The day we want to keep as the current day
|
||||
* @return array
|
||||
*/
|
||||
public static function get_calendar_monthly_view($year, $month, $courseid, $categoryid, $includenavigation, $mini) {
|
||||
global $DB, $USER, $PAGE;
|
||||
public static function get_calendar_monthly_view($year, $month, $courseid, $categoryid, $includenavigation, $mini, $day) {
|
||||
global $USER, $PAGE;
|
||||
|
||||
// Parameter validation.
|
||||
$params = self::validate_parameters(self::get_calendar_monthly_view_parameters(), [
|
||||
@@ -1001,6 +1002,7 @@ class core_calendar_external extends external_api {
|
||||
'categoryid' => $categoryid,
|
||||
'includenavigation' => $includenavigation,
|
||||
'mini' => $mini,
|
||||
'day' => $day,
|
||||
]);
|
||||
|
||||
$context = \context_user::instance($USER->id);
|
||||
@@ -1009,7 +1011,7 @@ class core_calendar_external extends external_api {
|
||||
|
||||
$type = \core_calendar\type_factory::get_calendar_instance();
|
||||
|
||||
$time = $type->convert_to_timestamp($params['year'], $params['month'], 1);
|
||||
$time = $type->convert_to_timestamp($params['year'], $params['month'], $params['day']);
|
||||
$calendar = \calendar_information::create($time, $params['courseid'], $params['categoryid']);
|
||||
self::validate_context($calendar->context);
|
||||
|
||||
@@ -1045,6 +1047,7 @@ class core_calendar_external extends external_api {
|
||||
false,
|
||||
NULL_ALLOWED
|
||||
),
|
||||
'day' => new external_value(PARAM_INT, 'Day to be viewed', VALUE_DEFAULT, 1),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
+45
-35
@@ -3016,7 +3016,7 @@ function calendar_get_icalendar($url) {
|
||||
* Import events from an iCalendar object into a course calendar.
|
||||
*
|
||||
* @param iCalendar $ical The iCalendar object.
|
||||
* @param int $courseid The course ID for the calendar.
|
||||
* @param int $unused Deprecated
|
||||
* @param int $subscriptionid The subscription ID.
|
||||
* @return string A log of the import progress, including errors.
|
||||
*/
|
||||
@@ -3066,7 +3066,8 @@ function calendar_import_icalendar_events($ical, $unused = null, $subscriptionid
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($subscriptionid)) {
|
||||
$existing = $DB->get_field('event_subscriptions', 'lastupdated', ['id' => $subscriptionid]);
|
||||
if (!empty($existing)) {
|
||||
$eventsuuids = $DB->get_records_menu('event', ['subscriptionid' => $subscriptionid], '', 'id, uuid');
|
||||
|
||||
$icaleventscount = count($icaluuids);
|
||||
@@ -3722,23 +3723,8 @@ function calendar_get_allowed_event_types(int $courseid = null) {
|
||||
|
||||
if (!empty($courseid) && $courseid != SITEID) {
|
||||
$context = \context_course::instance($courseid);
|
||||
$groups = groups_get_all_groups($courseid);
|
||||
|
||||
$types['user'] = has_capability('moodle/calendar:manageownentries', $context);
|
||||
|
||||
if (has_capability('moodle/calendar:manageentries', $context)) {
|
||||
$types['course'] = true;
|
||||
|
||||
$types['group'] = (!empty($groups) && has_capability('moodle/site:accessallgroups', $context))
|
||||
|| array_filter($groups, function($group) use ($USER) {
|
||||
return groups_is_member($group->id);
|
||||
});
|
||||
} else if (has_capability('moodle/calendar:managegroupentries', $context)) {
|
||||
$types['group'] = (!empty($groups) && has_capability('moodle/site:accessallgroups', $context))
|
||||
|| array_filter($groups, function($group) use ($USER) {
|
||||
return groups_is_member($group->id);
|
||||
});
|
||||
}
|
||||
calendar_internal_update_course_and_group_permission($courseid, $context, $types);
|
||||
}
|
||||
|
||||
if (has_capability('moodle/calendar:manageentries', \context_course::instance(SITEID))) {
|
||||
@@ -3823,23 +3809,7 @@ function calendar_get_allowed_event_types(int $courseid = null) {
|
||||
context_helper::preload_from_record($coursewithgroup);
|
||||
$context = context_course::instance($coursewithgroup->id);
|
||||
|
||||
if (has_capability('moodle/calendar:manageentries', $context)) {
|
||||
// The user has access to manage calendar entries for the whole course.
|
||||
// This includes groups if they have the accessallgroups capability.
|
||||
$types['course'] = true;
|
||||
if (has_capability('moodle/site:accessallgroups', $context)) {
|
||||
// The user also has access to all groups so they can add calendar entries to any group.
|
||||
// The manageentries capability overrides the managegroupentries capability.
|
||||
$types['group'] = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (empty($types['group']) && has_capability('moodle/calendar:managegroupentries', $context)) {
|
||||
// The user has the managegroupentries capability.
|
||||
// If they have access to _any_ group, then they can create calendar entries within that group.
|
||||
$types['group'] = !empty(groups_get_all_groups($coursewithgroup->id, $USER->id));
|
||||
}
|
||||
}
|
||||
calendar_internal_update_course_and_group_permission($coursewithgroup->id, $context, $types);
|
||||
|
||||
// Okay, course and group event types are allowed, no need to keep the loop iteration.
|
||||
if ($types['course'] == true && $types['group'] == true) {
|
||||
@@ -3873,3 +3843,43 @@ function calendar_get_allowed_event_types(int $courseid = null) {
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a course id, and context, updates the permission types array to add the 'course' or 'group'
|
||||
* permission if it is relevant for that course.
|
||||
*
|
||||
* For efficiency, if they already have 'course' or 'group' then it skips checks.
|
||||
*
|
||||
* Do not call this function directly, it is only for use by calendar_get_allowed_event_types().
|
||||
*
|
||||
* @param int $courseid Course id
|
||||
* @param context $context Context for that course
|
||||
* @param array $types Current permissions
|
||||
*/
|
||||
function calendar_internal_update_course_and_group_permission(int $courseid, context $context, array &$types) {
|
||||
if (!$types['course']) {
|
||||
// If they have manageentries permission on the course, then they can update this course.
|
||||
if (has_capability('moodle/calendar:manageentries', $context)) {
|
||||
$types['course'] = true;
|
||||
}
|
||||
}
|
||||
// To update group events they must have EITHER manageentries OR managegroupentries.
|
||||
if (!$types['group'] && (has_capability('moodle/calendar:manageentries', $context) ||
|
||||
has_capability('moodle/calendar:managegroupentries', $context))) {
|
||||
// And they also need for a group to exist on the course.
|
||||
$groups = groups_get_all_groups($courseid);
|
||||
if (!empty($groups)) {
|
||||
// And either accessallgroups, or belong to one of the groups.
|
||||
if (has_capability('moodle/site:accessallgroups', $context)) {
|
||||
$types['group'] = true;
|
||||
} else {
|
||||
foreach ($groups as $group) {
|
||||
if (groups_is_member($group->id)) {
|
||||
$types['group'] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
}} data-categoryid="{{categoryid}}"{{!
|
||||
}} data-month="{{date.mon}}"{{!
|
||||
}} data-year="{{date.year}}"{{!
|
||||
}} data-day="{{date.mday}}"{{!
|
||||
}} data-view="month"{{!
|
||||
}}>
|
||||
{{> core/overlay_loading}}
|
||||
|
||||
@@ -2372,7 +2372,7 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase {
|
||||
$data = external_api::clean_returnvalue(
|
||||
core_calendar_external::get_calendar_monthly_view_returns(),
|
||||
core_calendar_external::get_calendar_monthly_view($timestart->format('Y'), $timestart->format('n'),
|
||||
$course->id, null, false, true)
|
||||
$course->id, null, false, true, $timestart->format('j'))
|
||||
);
|
||||
$this->assertEquals($data['courseid'], $course->id);
|
||||
// User enrolled in the course can load the course calendar.
|
||||
@@ -2380,7 +2380,7 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase {
|
||||
$data = external_api::clean_returnvalue(
|
||||
core_calendar_external::get_calendar_monthly_view_returns(),
|
||||
core_calendar_external::get_calendar_monthly_view($timestart->format('Y'), $timestart->format('n'),
|
||||
$course->id, null, false, true)
|
||||
$course->id, null, false, true, $timestart->format('j'))
|
||||
);
|
||||
$this->assertEquals($data['courseid'], $course->id);
|
||||
// User not enrolled in the course cannot load the course calendar.
|
||||
@@ -2389,10 +2389,26 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase {
|
||||
$data = external_api::clean_returnvalue(
|
||||
core_calendar_external::get_calendar_monthly_view_returns(),
|
||||
core_calendar_external::get_calendar_monthly_view($timestart->format('Y'), $timestart->format('n'),
|
||||
$course->id, null, false, false)
|
||||
$course->id, null, false, false, $timestart->format('j'))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get_calendar_monthly_view when a day parameter is provided.
|
||||
*/
|
||||
public function test_get_calendar_monthly_view_with_day_provided() {
|
||||
$this->resetAfterTest();
|
||||
$this->setAdminUser();
|
||||
|
||||
$timestart = new DateTime();
|
||||
$data = external_api::clean_returnvalue(
|
||||
core_calendar_external::get_calendar_monthly_view_returns(),
|
||||
core_calendar_external::get_calendar_monthly_view($timestart->format('Y'), $timestart->format('n'),
|
||||
SITEID, null, false, true, $timestart->format('j'))
|
||||
);
|
||||
$this->assertEquals($data['date']['mday'], $timestart->format('d'));
|
||||
}
|
||||
|
||||
/**
|
||||
* A user should not be able load the calendar day view for a course they cannot access.
|
||||
*/
|
||||
|
||||
@@ -227,6 +227,24 @@ class core_calendar_lib_testcase extends advanced_testcase {
|
||||
calendar_import_icalendar_events($ical, null, $sub->id);
|
||||
$count = $DB->count_records('event', array('subscriptionid' => $sub->id));
|
||||
$this->assertEquals($count, 1);
|
||||
|
||||
// Test for ICS file with repeated events.
|
||||
$subscription = new stdClass();
|
||||
$subscription->name = 'Repeated events';
|
||||
$subscription->importfrom = CALENDAR_IMPORT_FROM_FILE;
|
||||
$subscription->eventtype = 'site';
|
||||
$id = calendar_add_subscription($subscription);
|
||||
$calendar = file_get_contents($CFG->dirroot . '/lib/tests/fixtures/repeated_events.ics');
|
||||
$ical = new iCalendar();
|
||||
$ical->unserialize($calendar);
|
||||
$this->assertEquals($ical->parser_errors, []);
|
||||
|
||||
$sub = calendar_get_subscription($id);
|
||||
$output = calendar_import_icalendar_events($ical, null, $sub->id);
|
||||
$this->assertStringNotContainsString('Events deleted: 17', $output);
|
||||
$this->assertStringContainsString('Events imported: 1', $output);
|
||||
$this->assertStringContainsString('Events skipped: 0', $output);
|
||||
$this->assertStringContainsString('Events updated: 0', $output);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -546,6 +564,10 @@ class core_calendar_lib_testcase extends advanced_testcase {
|
||||
|
||||
$this->setUser($user);
|
||||
|
||||
// In general for all courses, they don't have the ability to add course events yet.
|
||||
$types = calendar_get_allowed_event_types();
|
||||
$this->assertFalse($types['course']);
|
||||
|
||||
assign_capability('moodle/calendar:manageentries', CAP_ALLOW, $roleid, $context1, true);
|
||||
assign_capability('moodle/calendar:manageentries', CAP_PROHIBIT, $roleid, $context2, true);
|
||||
|
||||
@@ -554,12 +576,20 @@ class core_calendar_lib_testcase extends advanced_testcase {
|
||||
$types = calendar_get_allowed_event_types($course1->id);
|
||||
$this->assertTrue($types['course']);
|
||||
|
||||
// If calling function without specified course, there is still a course where they have it.
|
||||
$types = calendar_get_allowed_event_types();
|
||||
$this->assertTrue($types['course']);
|
||||
|
||||
assign_capability('moodle/calendar:manageentries', CAP_PROHIBIT, $roleid, $context1, true);
|
||||
|
||||
// The user only now has the correct capability in both course 1 and 2 so we
|
||||
// expect both to be in the results.
|
||||
$types = calendar_get_allowed_event_types($course3->id);
|
||||
$this->assertFalse($types['course']);
|
||||
|
||||
// They now do not have permission in any course.
|
||||
$types = calendar_get_allowed_event_types();
|
||||
$this->assertFalse($types['course']);
|
||||
}
|
||||
|
||||
public function test_calendar_get_allowed_event_types_group_no_acces_to_diff_groups() {
|
||||
@@ -582,6 +612,11 @@ class core_calendar_lib_testcase extends advanced_testcase {
|
||||
$types = calendar_get_allowed_event_types($course->id);
|
||||
$this->assertTrue($types['course']);
|
||||
$this->assertFalse($types['group']);
|
||||
|
||||
// Same result applies when not providing a specific course as they are only on one course.
|
||||
$types = calendar_get_allowed_event_types();
|
||||
$this->assertTrue($types['course']);
|
||||
$this->assertFalse($types['group']);
|
||||
}
|
||||
|
||||
public function test_calendar_get_allowed_event_types_group_no_groups() {
|
||||
@@ -598,6 +633,12 @@ class core_calendar_lib_testcase extends advanced_testcase {
|
||||
// no groups so we shouldn't see a group type.
|
||||
$types = calendar_get_allowed_event_types($course->id);
|
||||
$this->assertTrue($types['course']);
|
||||
$this->assertFalse($types['group']);
|
||||
|
||||
// Same result applies when not providing a specific course as they are only on one course.
|
||||
$types = calendar_get_allowed_event_types();
|
||||
$this->assertTrue($types['course']);
|
||||
$this->assertFalse($types['group']);
|
||||
}
|
||||
|
||||
public function test_calendar_get_allowed_event_types_group_access_all_groups() {
|
||||
@@ -623,7 +664,12 @@ class core_calendar_lib_testcase extends advanced_testcase {
|
||||
// the accessallgroups capability.
|
||||
$types = calendar_get_allowed_event_types($course1->id);
|
||||
$this->assertTrue($types['group']);
|
||||
|
||||
// Same result applies when not providing a specific course as they are only on one course.
|
||||
$types = calendar_get_allowed_event_types();
|
||||
$this->assertTrue($types['group']);
|
||||
}
|
||||
|
||||
public function test_calendar_get_allowed_event_types_group_no_access_all_groups() {
|
||||
$generator = $this->getDataGenerator();
|
||||
$user = $generator->create_user();
|
||||
@@ -642,10 +688,87 @@ class core_calendar_lib_testcase extends advanced_testcase {
|
||||
// groups that they are not a member of.
|
||||
$types = calendar_get_allowed_event_types($course->id);
|
||||
$this->assertFalse($types['group']);
|
||||
|
||||
// Same result applies when not providing a specific course as they are only on one course.
|
||||
$types = calendar_get_allowed_event_types();
|
||||
$this->assertFalse($types['group']);
|
||||
|
||||
assign_capability('moodle/calendar:manageentries', CAP_ALLOW, $roleid, $context, true);
|
||||
assign_capability('moodle/site:accessallgroups', CAP_ALLOW, $roleid, $context, true);
|
||||
$types = calendar_get_allowed_event_types($course->id);
|
||||
$this->assertTrue($types['group']);
|
||||
|
||||
// Same result applies when not providing a specific course as they are only on one course.
|
||||
$types = calendar_get_allowed_event_types();
|
||||
$this->assertTrue($types['group']);
|
||||
}
|
||||
|
||||
public function test_calendar_get_allowed_event_types_group_cap_no_groups() {
|
||||
$generator = $this->getDataGenerator();
|
||||
$user = $generator->create_user();
|
||||
$course = $generator->create_course();
|
||||
$context = context_course::instance($course->id);
|
||||
$roleid = $generator->create_role();
|
||||
$group = $generator->create_group(['courseid' => $course->id]);
|
||||
$generator->enrol_user($user->id, $course->id, 'student');
|
||||
$generator->role_assign($roleid, $user->id, $context->id);
|
||||
assign_capability('moodle/calendar:managegroupentries', CAP_ALLOW, $roleid, $context, true);
|
||||
|
||||
$this->setUser($user);
|
||||
$types = calendar_get_allowed_event_types($course->id);
|
||||
$this->assertFalse($types['course']);
|
||||
$this->assertFalse($types['group']);
|
||||
|
||||
// Check without specifying a course (same result as user only has one course).
|
||||
$types = calendar_get_allowed_event_types();
|
||||
$this->assertFalse($types['course']);
|
||||
$this->assertFalse($types['group']);
|
||||
}
|
||||
|
||||
public function test_calendar_get_allowed_event_types_group_cap_has_group() {
|
||||
$generator = $this->getDataGenerator();
|
||||
$user = $generator->create_user();
|
||||
$course = $generator->create_course();
|
||||
$context = context_course::instance($course->id);
|
||||
$roleid = $generator->create_role();
|
||||
$group = $generator->create_group(['courseid' => $course->id]);
|
||||
$generator->enrol_user($user->id, $course->id, 'student');
|
||||
$generator->role_assign($roleid, $user->id, $context->id);
|
||||
groups_add_member($group, $user);
|
||||
assign_capability('moodle/calendar:managegroupentries', CAP_ALLOW, $roleid, $context, true);
|
||||
|
||||
$this->setUser($user);
|
||||
$types = calendar_get_allowed_event_types($course->id);
|
||||
$this->assertFalse($types['course']);
|
||||
$this->assertTrue($types['group']);
|
||||
|
||||
// Check without specifying a course (same result as user only has one course).
|
||||
$types = calendar_get_allowed_event_types();
|
||||
$this->assertFalse($types['course']);
|
||||
$this->assertTrue($types['group']);
|
||||
}
|
||||
|
||||
public function test_calendar_get_allowed_event_types_group_cap_access_all_groups() {
|
||||
$generator = $this->getDataGenerator();
|
||||
$user = $generator->create_user();
|
||||
$course = $generator->create_course();
|
||||
$context = context_course::instance($course->id);
|
||||
$roleid = $generator->create_role();
|
||||
$group = $generator->create_group(['courseid' => $course->id]);
|
||||
$generator->enrol_user($user->id, $course->id, 'student');
|
||||
$generator->role_assign($roleid, $user->id, $context->id);
|
||||
assign_capability('moodle/calendar:managegroupentries', CAP_ALLOW, $roleid, $context, true);
|
||||
assign_capability('moodle/site:accessallgroups', CAP_ALLOW, $roleid, $context, true);
|
||||
|
||||
$this->setUser($user);
|
||||
$types = calendar_get_allowed_event_types($course->id);
|
||||
$this->assertFalse($types['course']);
|
||||
$this->assertTrue($types['group']);
|
||||
|
||||
// Check without specifying a course (same result as user only has one course).
|
||||
$types = calendar_get_allowed_event_types();
|
||||
$this->assertFalse($types['course']);
|
||||
$this->assertTrue($types['group']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2302,7 +2302,7 @@ class core_competency_privacy_testcase extends provider_testcase {
|
||||
$this->assertEquals('-', $comp['rating']['rating']);
|
||||
$comp = $data->competencies[2];
|
||||
$this->assertEquals($comp4->get('shortname'), $comp['name']);
|
||||
$this->assertNull($comp['rating']['rating']);
|
||||
$this->assertNull($comp['rating']);
|
||||
$data = writer::with_context($u1ctx)->get_data(array_merge($path, ["{$p1a->get('name')} ({$p1a->get('id')})",
|
||||
get_string('commentsubcontext', 'core_comment')]));
|
||||
$this->assert_exported_comments(['Hello.', 'It\'s me.', 'After all these years...'], $data->comments);
|
||||
@@ -2320,7 +2320,7 @@ class core_competency_privacy_testcase extends provider_testcase {
|
||||
$this->assertEquals('C', $comp['rating']['rating']);
|
||||
$comp = $data->competencies[2];
|
||||
$this->assertEquals($comp4->get('shortname'), $comp['name']);
|
||||
$this->assertNull($comp['rating']['rating']);
|
||||
$this->assertNull($comp['rating']);
|
||||
|
||||
// This plan is complete.
|
||||
$data = writer::with_context($u1ctx)->get_data(array_merge($path, ["{$p1c->get('name')} ({$p1c->get('id')})"]));
|
||||
|
||||
Generated
+90
-91
@@ -506,20 +506,21 @@
|
||||
],
|
||||
"description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
|
||||
"homepage": "https://github.com/container-interop/container-interop",
|
||||
"abandoned": "psr/container",
|
||||
"time": "2017-02-14T19:40:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/instantiator",
|
||||
"version": "1.2.0",
|
||||
"version": "1.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/instantiator.git",
|
||||
"reference": "a2c590166b2133a4633738648b6b064edae0814a"
|
||||
"reference": "ae466f726242e637cebdd526a7d991b9433bacf1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a",
|
||||
"reference": "a2c590166b2133a4633738648b6b064edae0814a",
|
||||
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1",
|
||||
"reference": "ae466f726242e637cebdd526a7d991b9433bacf1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -562,7 +563,7 @@
|
||||
"constructor",
|
||||
"instantiate"
|
||||
],
|
||||
"time": "2019-03-17T17:37:11+00:00"
|
||||
"time": "2019-10-21T16:45:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "fabpot/goutte",
|
||||
@@ -870,16 +871,16 @@
|
||||
},
|
||||
{
|
||||
"name": "mikey179/vfsstream",
|
||||
"version": "v1.6.7",
|
||||
"version": "v1.6.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/bovigo/vfsStream.git",
|
||||
"reference": "2b544ac3a21bcc4dde5d90c4ae8d06f4319055fb"
|
||||
"reference": "231c73783ebb7dd9ec77916c10037eff5a2b6efe"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/bovigo/vfsStream/zipball/2b544ac3a21bcc4dde5d90c4ae8d06f4319055fb",
|
||||
"reference": "2b544ac3a21bcc4dde5d90c4ae8d06f4319055fb",
|
||||
"url": "https://api.github.com/repos/bovigo/vfsStream/zipball/231c73783ebb7dd9ec77916c10037eff5a2b6efe",
|
||||
"reference": "231c73783ebb7dd9ec77916c10037eff5a2b6efe",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -912,7 +913,7 @@
|
||||
],
|
||||
"description": "Virtual file system to mock the real file system in unit tests.",
|
||||
"homepage": "http://vfs.bovigo.org/",
|
||||
"time": "2019-08-01T01:38:37+00:00"
|
||||
"time": "2019-10-30T15:31:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "moodlehq/behat-extension",
|
||||
@@ -1816,16 +1817,16 @@
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
"reference": "bf73deb2b3b896a9d9c75f3f0d88185d2faa27e2"
|
||||
"reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/bf73deb2b3b896a9d9c75f3f0d88185d2faa27e2",
|
||||
"reference": "bf73deb2b3b896a9d9c75f3f0d88185d2faa27e2",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801",
|
||||
"reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1859,7 +1860,7 @@
|
||||
"psr",
|
||||
"psr-3"
|
||||
],
|
||||
"time": "2019-10-25T08:06:51+00:00"
|
||||
"time": "2019-11-01T11:05:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "ralouphie/getallheaders",
|
||||
@@ -2068,16 +2069,16 @@
|
||||
},
|
||||
{
|
||||
"name": "sebastian/environment",
|
||||
"version": "4.2.2",
|
||||
"version": "4.2.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/environment.git",
|
||||
"reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404"
|
||||
"reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/f2a2c8e1c97c11ace607a7a667d73d47c19fe404",
|
||||
"reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368",
|
||||
"reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2117,7 +2118,7 @@
|
||||
"environment",
|
||||
"hhvm"
|
||||
],
|
||||
"time": "2019-05-05T09:05:15+00:00"
|
||||
"time": "2019-11-20T08:46:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/exporter",
|
||||
@@ -2469,27 +2470,27 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/browser-kit",
|
||||
"version": "v4.3.5",
|
||||
"version": "v4.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/browser-kit.git",
|
||||
"reference": "78b7611c45039e8ce81698be319851529bf040b1"
|
||||
"reference": "e19e465c055137938afd40cfddd687e7511bbbf0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/browser-kit/zipball/78b7611c45039e8ce81698be319851529bf040b1",
|
||||
"reference": "78b7611c45039e8ce81698be319851529bf040b1",
|
||||
"url": "https://api.github.com/repos/symfony/browser-kit/zipball/e19e465c055137938afd40cfddd687e7511bbbf0",
|
||||
"reference": "e19e465c055137938afd40cfddd687e7511bbbf0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"symfony/dom-crawler": "~3.4|~4.0"
|
||||
"symfony/dom-crawler": "^3.4|^4.0|^5.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/css-selector": "~3.4|~4.0",
|
||||
"symfony/http-client": "^4.3",
|
||||
"symfony/mime": "^4.3",
|
||||
"symfony/process": "~3.4|~4.0"
|
||||
"symfony/css-selector": "^3.4|^4.0|^5.0",
|
||||
"symfony/http-client": "^4.3|^5.0",
|
||||
"symfony/mime": "^4.3|^5.0",
|
||||
"symfony/process": "^3.4|^4.0|^5.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/process": ""
|
||||
@@ -2497,7 +2498,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.3-dev"
|
||||
"dev-master": "4.4-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -2524,11 +2525,11 @@
|
||||
],
|
||||
"description": "Symfony BrowserKit Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2019-09-10T11:25:17+00:00"
|
||||
"time": "2019-10-28T20:30:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/class-loader",
|
||||
"version": "v3.4.32",
|
||||
"version": "v3.4.35",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/class-loader.git",
|
||||
@@ -2584,32 +2585,32 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/config",
|
||||
"version": "v4.3.5",
|
||||
"version": "v4.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/config.git",
|
||||
"reference": "0acb26407a9e1a64a275142f0ae5e36436342720"
|
||||
"reference": "f08e1c48e1f05d07c32f2d8599ed539e62105beb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/config/zipball/0acb26407a9e1a64a275142f0ae5e36436342720",
|
||||
"reference": "0acb26407a9e1a64a275142f0ae5e36436342720",
|
||||
"url": "https://api.github.com/repos/symfony/config/zipball/f08e1c48e1f05d07c32f2d8599ed539e62105beb",
|
||||
"reference": "f08e1c48e1f05d07c32f2d8599ed539e62105beb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"symfony/filesystem": "~3.4|~4.0",
|
||||
"symfony/filesystem": "^3.4|^4.0|^5.0",
|
||||
"symfony/polyfill-ctype": "~1.8"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/finder": "<3.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/dependency-injection": "~3.4|~4.0",
|
||||
"symfony/event-dispatcher": "~3.4|~4.0",
|
||||
"symfony/finder": "~3.4|~4.0",
|
||||
"symfony/messenger": "~4.1",
|
||||
"symfony/yaml": "~3.4|~4.0"
|
||||
"symfony/event-dispatcher": "^3.4|^4.0|^5.0",
|
||||
"symfony/finder": "^3.4|^4.0|^5.0",
|
||||
"symfony/messenger": "^4.1|^5.0",
|
||||
"symfony/service-contracts": "^1.1|^2",
|
||||
"symfony/yaml": "^3.4|^4.0|^5.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/yaml": "To use the yaml reference dumper"
|
||||
@@ -2617,7 +2618,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.3-dev"
|
||||
"dev-master": "4.4-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -2644,7 +2645,7 @@
|
||||
],
|
||||
"description": "Symfony Config Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2019-09-19T15:51:53+00:00"
|
||||
"time": "2019-11-16T15:22:42+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
@@ -2716,7 +2717,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/css-selector",
|
||||
"version": "v3.4.32",
|
||||
"version": "v3.4.35",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/css-selector.git",
|
||||
@@ -2769,16 +2770,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/debug",
|
||||
"version": "v3.4.32",
|
||||
"version": "v3.4.35",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/debug.git",
|
||||
"reference": "b3e7ce815d82196435d16dc458023f8fb6b36ceb"
|
||||
"reference": "f72e33fdb1170b326e72c3157f0cd456351dd086"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/b3e7ce815d82196435d16dc458023f8fb6b36ceb",
|
||||
"reference": "b3e7ce815d82196435d16dc458023f8fb6b36ceb",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/f72e33fdb1170b326e72c3157f0cd456351dd086",
|
||||
"reference": "f72e33fdb1170b326e72c3157f0cd456351dd086",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2821,7 +2822,7 @@
|
||||
],
|
||||
"description": "Symfony Debug Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2019-09-19T15:32:51+00:00"
|
||||
"time": "2019-10-24T15:33:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/dependency-injection",
|
||||
@@ -2895,16 +2896,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/dom-crawler",
|
||||
"version": "v4.3.5",
|
||||
"version": "v4.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/dom-crawler.git",
|
||||
"reference": "e9f7b4d19d69b133bd638eeddcdc757723b4211f"
|
||||
"reference": "36bbcab9369fc2f583220890efd43bf262d563fd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/e9f7b4d19d69b133bd638eeddcdc757723b4211f",
|
||||
"reference": "e9f7b4d19d69b133bd638eeddcdc757723b4211f",
|
||||
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/36bbcab9369fc2f583220890efd43bf262d563fd",
|
||||
"reference": "36bbcab9369fc2f583220890efd43bf262d563fd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2917,7 +2918,7 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"masterminds/html5": "^2.6",
|
||||
"symfony/css-selector": "~3.4|~4.0"
|
||||
"symfony/css-selector": "^3.4|^4.0|^5.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/css-selector": ""
|
||||
@@ -2925,7 +2926,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.3-dev"
|
||||
"dev-master": "4.4-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -2952,20 +2953,20 @@
|
||||
],
|
||||
"description": "Symfony DomCrawler Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2019-09-28T21:25:05+00:00"
|
||||
"time": "2019-10-29T11:38:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher",
|
||||
"version": "v3.4.32",
|
||||
"version": "v3.4.35",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/event-dispatcher.git",
|
||||
"reference": "3e922c4c3430b9de624e8a285dada5e61e230959"
|
||||
"reference": "f9031c22ec127d4a2450760f81a8677fe8a10177"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3e922c4c3430b9de624e8a285dada5e61e230959",
|
||||
"reference": "3e922c4c3430b9de624e8a285dada5e61e230959",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f9031c22ec127d4a2450760f81a8677fe8a10177",
|
||||
"reference": "f9031c22ec127d4a2450760f81a8677fe8a10177",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3015,20 +3016,20 @@
|
||||
],
|
||||
"description": "Symfony EventDispatcher Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2019-08-23T08:05:57+00:00"
|
||||
"time": "2019-10-24T15:33:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/filesystem",
|
||||
"version": "v4.3.5",
|
||||
"version": "v4.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/filesystem.git",
|
||||
"reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263"
|
||||
"reference": "d12b01cba60be77b583c9af660007211e3909854"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/filesystem/zipball/9abbb7ef96a51f4d7e69627bc6f63307994e4263",
|
||||
"reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263",
|
||||
"url": "https://api.github.com/repos/symfony/filesystem/zipball/d12b01cba60be77b583c9af660007211e3909854",
|
||||
"reference": "d12b01cba60be77b583c9af660007211e3909854",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3038,7 +3039,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.3-dev"
|
||||
"dev-master": "4.4-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3065,20 +3066,20 @@
|
||||
],
|
||||
"description": "Symfony Filesystem Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2019-08-20T14:07:54+00:00"
|
||||
"time": "2019-11-12T14:51:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
"version": "v1.12.0",
|
||||
"version": "v1.13.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||
"reference": "550ebaac289296ce228a706d0867afc34687e3f4"
|
||||
"reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4",
|
||||
"reference": "550ebaac289296ce228a706d0867afc34687e3f4",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3",
|
||||
"reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3090,7 +3091,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.12-dev"
|
||||
"dev-master": "1.13-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3123,20 +3124,20 @@
|
||||
"polyfill",
|
||||
"portable"
|
||||
],
|
||||
"time": "2019-08-06T08:03:45+00:00"
|
||||
"time": "2019-11-27T13:56:44+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.12.0",
|
||||
"version": "v1.13.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17"
|
||||
"reference": "7b4aab9743c30be783b73de055d24a39cf4b954f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17",
|
||||
"reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f",
|
||||
"reference": "7b4aab9743c30be783b73de055d24a39cf4b954f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3148,7 +3149,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.12-dev"
|
||||
"dev-master": "1.13-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3182,11 +3183,11 @@
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"time": "2019-08-06T08:03:45+00:00"
|
||||
"time": "2019-11-27T14:18:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v2.8.50",
|
||||
"version": "v2.8.52",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
@@ -3395,31 +3396,29 @@
|
||||
},
|
||||
{
|
||||
"name": "webmozart/assert",
|
||||
"version": "1.5.0",
|
||||
"version": "1.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webmozart/assert.git",
|
||||
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4"
|
||||
"reference": "573381c0a64f155a0d9a23f4b0c797194805b925"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4",
|
||||
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4",
|
||||
"url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925",
|
||||
"reference": "573381c0a64f155a0d9a23f4b0c797194805b925",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.3.3 || ^7.0",
|
||||
"symfony/polyfill-ctype": "^1.8"
|
||||
},
|
||||
"conflict": {
|
||||
"vimeo/psalm": "<3.6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.8.36 || ^7.5.13"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.3-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Webmozart\\Assert\\": "src/"
|
||||
@@ -3441,7 +3440,7 @@
|
||||
"check",
|
||||
"validate"
|
||||
],
|
||||
"time": "2019-08-24T08:43:50+00:00"
|
||||
"time": "2019-11-24T13:36:37+00:00"
|
||||
}
|
||||
],
|
||||
"aliases": [
|
||||
|
||||
+1
-1
@@ -543,7 +543,7 @@ $CFG->admin = 'admin';
|
||||
//
|
||||
// Location for lock files used by the File locking factory. This must exist
|
||||
// on a shared file system that supports locking.
|
||||
// $CFG->lock_file_root = $CFG->dataroot . '/lock';
|
||||
// $CFG->file_lock_root = $CFG->dataroot . '/lock';
|
||||
//
|
||||
//
|
||||
// Alternative task logging.
|
||||
|
||||
@@ -68,5 +68,8 @@ function xmldb_format_topics_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -104,5 +104,8 @@ function xmldb_format_weeks_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -964,7 +964,6 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
|
||||
foreach ($sections[2]['modules'] as $module) {
|
||||
if ($module['id'] == $urlcm->id and $module['modname'] == 'url') {
|
||||
$this->assertContains('width=100,height=100', $module['onclick']);
|
||||
$this->assertContains('moodle.org', $module['customdata']);
|
||||
$testexecuted = $testexecuted + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,7 +431,9 @@ class api {
|
||||
$fields = $DB->get_records_sql($sql);
|
||||
foreach ($fields as $field) {
|
||||
$inst = field_controller::create(0, $field);
|
||||
if ($inst->supports_course_grouping()) {
|
||||
$isvisible = $inst->get_configdata_property('visibility') == \core_course\customfield\course_handler::VISIBLETOALL;
|
||||
// Only visible fields to everybody supporting course grouping will be displayed.
|
||||
if ($inst->supports_course_grouping() && $isvisible) {
|
||||
$ret[$inst->get('shortname')] = $inst->get('name');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,5 +42,8 @@ function xmldb_enrol_database_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -42,5 +42,8 @@ function xmldb_enrol_flatfile_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -42,5 +42,8 @@ function xmldb_enrol_guest_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -48,5 +48,8 @@ function xmldb_enrol_imsenterprise_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -69,5 +69,8 @@ function xmldb_enrol_lti_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
define ("enrol_manual/form-potential-user-selector",["jquery","core/ajax","core/templates","core/str"],function(a,b,c,d){return{processResults:function processResults(b,c){var d=[];if(a.isArray(c)){a.each(c,function(a,b){d.push({value:b.id,label:b._label})});return d}else{return c}},transport:function transport(e,f,g,h){var i,j=a(e).attr("courseid"),k=a(e).attr("userfields").split(",");if("undefined"==typeof j){j="1"}var l=a(e).attr("enrolid");if("undefined"==typeof l){l=""}var m=a(e).attr("perpage");if("undefined"==typeof m){m=100}i=b.call([{methodname:"core_enrol_get_potential_users",args:{courseid:j,enrolid:l,search:f,searchanywhere:!0,page:0,perpage:m+1}}]);i[0].then(function(b){var e=[],f=0;if(b.length<=m){a.each(b,function(b,d){var f=d,g=[];a.each(k,function(a,b){if("undefined"!=typeof d[b]&&""!==d[b]){f.hasidentity=!0;g.push(d[b])}});f.identity=g.join(", ");e.push(c.render("enrol_manual/form-user-selector-suggestion",f))});return a.when.apply(a.when,e).then(function(){var c=arguments;a.each(b,function(a,b){b._label=c[f];f++});g(b)})}else{return d.get_string("toomanyuserstoshow","core",">"+m).then(function(a){g(a)})}}).fail(h)}}});
|
||||
define ("enrol_manual/form-potential-user-selector",["jquery","core/ajax","core/templates","core/str"],function(a,b,c,d){return{processResults:function processResults(b,c){var d=[];if(a.isArray(c)){a.each(c,function(a,b){d.push({value:b.id,label:b._label})});return d}else{return c}},transport:function transport(e,f,g,h){var i,j=a(e).attr("courseid"),k=a(e).attr("userfields").split(",");if("undefined"==typeof j){j="1"}var l=a(e).attr("enrolid");if("undefined"==typeof l){l=""}var m=parseInt(a(e).attr("perpage"));if(isNaN(m)){m=100}i=b.call([{methodname:"core_enrol_get_potential_users",args:{courseid:j,enrolid:l,search:f,searchanywhere:!0,page:0,perpage:m+1}}]);i[0].then(function(b){var e=[],f=0;if(b.length<=m){a.each(b,function(b,d){var f=d,g=[];a.each(k,function(a,b){if("undefined"!=typeof d[b]&&""!==d[b]){f.hasidentity=!0;g.push(d[b])}});f.identity=g.join(", ");e.push(c.render("enrol_manual/form-user-selector-suggestion",f))});return a.when.apply(a.when,e).then(function(){var c=arguments;a.each(b,function(a,b){b._label=c[f];f++});g(b)})}else{return d.get_string("toomanyuserstoshow","core",">"+m).then(function(a){g(a)})}}).fail(h)}}});
|
||||
//# sourceMappingURL=form-potential-user-selector.min.js.map
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -54,8 +54,8 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'], function($, Ajax,
|
||||
if (typeof enrolid === "undefined") {
|
||||
enrolid = '';
|
||||
}
|
||||
var perpage = $(selector).attr('perpage');
|
||||
if (typeof perpage === "undefined") {
|
||||
var perpage = parseInt($(selector).attr('perpage'));
|
||||
if (isNaN(perpage)) {
|
||||
perpage = 100;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,5 +42,8 @@ function xmldb_enrol_manual_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+4
-2
@@ -120,10 +120,12 @@ class enrol_meta_plugin extends enrol_plugin {
|
||||
require_once("$CFG->dirroot/enrol/meta/locallib.php");
|
||||
|
||||
// Support creating multiple at once.
|
||||
if (is_array($fields['customint1'])) {
|
||||
if (isset($fields['customint1']) && is_array($fields['customint1'])) {
|
||||
$courses = array_unique($fields['customint1']);
|
||||
} else {
|
||||
} else if (isset($fields['customint1'])) {
|
||||
$courses = array($fields['customint1']);
|
||||
} else {
|
||||
$courses = array(null); // Strange? Yes, but that's how it's working or instance is not created ever.
|
||||
}
|
||||
foreach ($courses as $courseid) {
|
||||
if (!empty($fields['customint2']) && $fields['customint2'] == ENROL_META_CREATE_GROUP) {
|
||||
|
||||
@@ -42,5 +42,8 @@ function xmldb_enrol_mnet_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.8.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user