mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-40600 core_courseformat: duplicate a named section with copy
When a named section is duplicated, the name must have a (copy) particle to make visible what section is the original and what is the copy.
This commit is contained in:
parent
f1c4cc73df
commit
01d6ba02a3
4 changed files with 18 additions and 2 deletions
|
@ -1752,7 +1752,11 @@ abstract class base {
|
|||
$oldsectioninfo = get_fast_modinfo($course)->get_section_info($originalsection->section);
|
||||
$newsection = course_create_section($course, $oldsectioninfo->section + 1); // Place new section after existing one.
|
||||
|
||||
$newsection->name = $originalsection->name;
|
||||
if (!empty($originalsection->name)) {
|
||||
$newsection->name = get_string('duplicatedsection', 'moodle', $originalsection->name);
|
||||
} else {
|
||||
$newsection->name = $originalsection->name;
|
||||
}
|
||||
$newsection->summary = $originalsection->summary;
|
||||
$newsection->summaryformat = $originalsection->summaryformat;
|
||||
$newsection->visible = $originalsection->visible;
|
||||
|
|
|
@ -22,5 +22,13 @@ Feature: Duplicate a section
|
|||
@javascript
|
||||
Scenario: Duplicate section
|
||||
Given I open section "1" edit menu
|
||||
And I click on "Duplicate" "link" in the "Topic 1" "section"
|
||||
When I click on "Duplicate" "link" in the "Topic 1" "section"
|
||||
Then I should see "Activity sample 2" in the "Topic 2" "section"
|
||||
|
||||
@javascript
|
||||
Scenario: Duplicate a named section
|
||||
Given I set the field "Edit topic name" in the "Topic 1" "section" to "New name"
|
||||
And I should see "New name" in the "New name" "section"
|
||||
When I open section "1" edit menu
|
||||
And I click on "Duplicate" "link" in the "New name" "section"
|
||||
Then I should see "Activity sample 2" in the "New name (copy)" "section"
|
||||
|
|
|
@ -4,6 +4,9 @@ information provided here is intended especially for developers.
|
|||
=== 4.2 ===
|
||||
* course/mod.php now accepts parameter beforemod for adding course modules. It contains the course module id
|
||||
of an existing course module. The new module is inserted before this module.
|
||||
* The function duplicate_module() now has two new optional parameters:
|
||||
- $sectionid to specify section the duplicated course module is placed in
|
||||
- $changename to disable changing the name of the course module using the 'duplicatedmodule' lang string
|
||||
|
||||
=== 4.1 ===
|
||||
* The function course_modchooser() has been finally deprecated and can not be used anymore. Please use
|
||||
|
|
|
@ -583,6 +583,7 @@ $string['doyouagree'] = 'Have you read these conditions and understood them?';
|
|||
$string['droptoupload'] = 'Drop files here to upload';
|
||||
$string['duplicate'] = 'Duplicate';
|
||||
$string['duplicatedmodule'] = '{$a} (copy)';
|
||||
$string['duplicatedsection'] = '{$a} (copy)';
|
||||
$string['edhelpaspellpath'] = 'To use spell-checking within the editor, you MUST have <strong>aspell 0.50</strong> or later installed on your server, and you must specify the correct path to access the aspell binary. On Unix/Linux systems, this path is usually <strong>/usr/bin/aspell</strong>, but it might be something else.';
|
||||
$string['edhelpbgcolor'] = 'Define the edit area\'s background color.<br />Valid values are, for example: #FFFFFF or white';
|
||||
$string['edhelpcleanword'] = 'This setting enables or disables Word-specific format filtering.';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue