From c54935da6817b4a7da765652bfb6e229f82b2f20 Mon Sep 17 00:00:00 2001 From: ferishili Date: Tue, 12 Mar 2024 16:29:27 +0100 Subject: [PATCH] changes according to requests --- batchupload.php | 7 +++---- classes/local/batchupload_form.php | 4 +--- lang/en/block_opencast.php | 10 +++++----- settings.php | 2 +- version.php | 4 ++-- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/batchupload.php b/batchupload.php index c613a0bc..97fa0d9c 100644 --- a/batchupload.php +++ b/batchupload.php @@ -30,7 +30,6 @@ use block_opencast\local\upload_helper; use core\output\notification; use tool_opencast\local\settings_api; -use moodle_exception; global $PAGE, $OUTPUT, $CFG, $USER, $SITE, $DB; @@ -87,8 +86,8 @@ $records = $DB->get_records('tool_opencast_series', ['series' => $series, 'ocinstanceid' => $ocinstanceid]); $haspermission = false; foreach ($records as $record) { - $cc = context_course::instance($record->courseid, IGNORE_MISSING); - if ($cc && has_capability('block/opencast:addvideo', $cc)) { + $coursecontext = context_course::instance($record->courseid, IGNORE_MISSING); + if ($coursecontext && has_capability('block/opencast:addvideo', $coursecontext)) { $haspermission = true; break; } @@ -199,7 +198,7 @@ $id = $field->name; if (property_exists($data, $field->name) && $data->$id) { if ($field->name == 'subjects') { - !is_array($data->$id) ? $data->$id = [$data->$id] : $data->$id = $data->$id; + $data->$id = !is_array($data->$id) ? [$data->$id] : $data->$id; } $obj = [ 'id' => $id, diff --git a/classes/local/batchupload_form.php b/classes/local/batchupload_form.php index 298cc003..2b66876f 100644 --- a/classes/local/batchupload_form.php +++ b/classes/local/batchupload_form.php @@ -30,10 +30,8 @@ use coding_exception; use core\notification; use html_writer; -use local_chunkupload\chunkupload_form_element; use moodle_url; use moodleform; -use MoodleQuickForm; defined('MOODLE_INTERNAL') || die(); @@ -55,7 +53,7 @@ class batchupload_form extends moodleform { * Form definition. */ public function definition() { - global $CFG, $DB, $PAGE , $OUTPUT; + global $DB, $PAGE; // Get the renderer to use its methods. $renderer = $PAGE->get_renderer('block_opencast'); $ocinstanceid = $this->_customdata['ocinstanceid']; diff --git a/lang/en/block_opencast.php b/lang/en/block_opencast.php index d8df41bc..e5150415 100644 --- a/lang/en/block_opencast.php +++ b/lang/en/block_opencast.php @@ -903,17 +903,17 @@ $string['batchupload'] = 'Add videos (batch)'; $string['batchupload_errornotenabled'] = 'Unfortunately the batch video upload feature is unavailable for this Opencast instance, please try to contanct your system administrator.'; $string['batchupload_metadata_header'] = 'Batch Metadata'; -$string['batchupload_metadata_desc'] = 'By uploading batch of videos to Opencast at once, the following metadata will be set for each video.'; +$string['batchupload_metadata_desc'] = 'By uploading a batch of videos to Opencast at once, the following metadata will be set for each video.'; $string['batchupload_visibility_header'] = 'Batch Visibility'; $string['batchupload_visibility_desc'] = 'The batch visibility setting will be applied for each uploaded video in the batch.'; $string['heading_batchable'] = 'Batchable'; $string['descriptionmdbatchable'] = 'Batchable'; -$string['descriptionmdbatchable_help'] = 'When enabled, the metadata field will be provide for batch videos upload.'; +$string['descriptionmdbatchable_help'] = 'When enabled, the metadata field can be set for batch video upload.'; $string['batchupload_form_header'] = 'Batch Upload Files'; -$string['batchuploadexplanation'] = 'In this section you are able to Upload multiple files at once.
NOTE: Please keep in mind that the batch video upload is only available for presenter flavors.'; +$string['batchuploadexplanation'] = 'In this section you are able to upload multiple files at once.
NOTE: Please keep in mind that the batch video upload is only available for presenter flavors.'; $string['batchupload_filemanager_presenter_title'] = 'Presenter videos'; $string['batchupload_emptyvideosuploaderror'] = 'You must upload at least one presenter video file.'; -$string['batchupload_jobssaved'] = 'Batch of {$a} Video(s) successfully uploaded.
The videos are queued for transffering to Opencast, therefore, you do not need to wait on this page for them to finish.'; -$string['batchupload_errorsaveuploadjobs'] = 'There were error uploading {$a->count} out of {$a->total} video(s).'; +$string['batchupload_jobssaved'] = 'Batch of {$a} Video(s) successfully uploaded.
The videos are queued for transferring to Opencast. Therefore, you do not need to wait on this page for them to finish.'; +$string['batchupload_errorsaveuploadjobs'] = 'There were errors uploading {$a->count} out of {$a->total} video(s).'; // Deprecated since version 2021062300. $string['video_already_uploaded'] = 'Video already uploaded'; diff --git a/settings.php b/settings.php index f0dc68dd..5daf2e97 100644 --- a/settings.php +++ b/settings.php @@ -268,7 +268,7 @@ $uploadtimeouturl = new moodle_url('/admin/settings.php?section=block_opencast_sharedsettings'); $uploadtimeoutlink = html_writer::link($uploadtimeouturl, get_string('uploadtimeout', 'block_opencast'), ['target' => '_blank']); - $toolopencastinstanceurl = new moodle_url('admin/settings.php?section=tool_opencast_configuration_' . $instance->id); + $toolopencastinstanceurl = new moodle_url('/admin/settings.php?section=tool_opencast_configuration_' . $instance->id); $toolopencastinstancelink = html_writer::link($toolopencastinstanceurl, get_string('configuration_instance', 'tool_opencast', $instance->name), ['target' => '_blank']); $stringobj = new \stdClass(); diff --git a/version.php b/version.php index e623df0f..35b2843b 100644 --- a/version.php +++ b/version.php @@ -24,8 +24,8 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'block_opencast'; -$plugin->release = 'v4.3-r1-i-350'; -$plugin->version = 2023112202; +$plugin->release = 'v4.3-r1'; +$plugin->version = 2023112200; $plugin->requires = 2022112800; // Requires Moodle 4.1+. $plugin->maturity = MATURITY_STABLE; $plugin->dependencies = [