Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
671eb0e0
Commit
671eb0e0
authored
9 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-1780: remap the groups after copy of e-mail course element to the right configuration
parent
a5ca87f7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/olat/course/nodes/COCourseNode.java
+9
-12
9 additions, 12 deletions
src/main/java/org/olat/course/nodes/COCourseNode.java
src/main/java/org/olat/course/nodes/co/CORunController.java
+5
-10
5 additions, 10 deletions
src/main/java/org/olat/course/nodes/co/CORunController.java
with
14 additions
and
22 deletions
src/main/java/org/olat/course/nodes/COCourseNode.java
+
9
−
12
View file @
671eb0e0
...
...
@@ -133,28 +133,26 @@ public class COCourseNode extends AbstractAccessableCourseNode {
ModuleConfiguration
mc
=
getModuleConfiguration
();
String
coachesGroupNames
=
(
String
)
mc
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOCOACHES_GROUP
);
String
particpantsGroupNames
=
(
String
)
mc
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOPARTICIPANTS_GROUP
);
@SuppressWarnings
(
"unchecked"
)
List
<
Long
>
coachesGroupKeys
=
(
List
<
Long
>)
mc
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOCOACHES_GROUP_ID
);
@SuppressWarnings
(
"unchecked"
)
List
<
Long
>
participantsGroupKeys
=
(
List
<
Long
>)
mc
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOPARTICIPANTS_GROUP_ID
);
//remap group keys
List
<
Long
>
coachesGroupKeys
=
mc
.
getList
(
COEditController
.
CONFIG_KEY_EMAILTOCOACHES_GROUP_ID
,
Long
.
class
);
if
(
coachesGroupKeys
==
null
)
{
coachesGroupKeys
=
envMapper
.
toGroupKeyFromOriginalNames
(
coachesGroupNames
);
}
else
{
coachesGroupKeys
=
envMapper
.
toGroupKeyFromOriginalKeys
(
coachesGroupKeys
);
}
mc
.
set
(
COEditController
.
CONFIG_KEY_EMAILTOGROUP_IDS
,
coachesGroupKeys
);
mc
.
set
(
COEditController
.
CONFIG_KEY_EMAILTOCOACHES_GROUP_ID
,
coachesGroupKeys
);
List
<
Long
>
participantsGroupKeys
=
mc
.
getList
(
COEditController
.
CONFIG_KEY_EMAILTOPARTICIPANTS_GROUP_ID
,
Long
.
class
);
if
(
participantsGroupKeys
==
null
)
{
participantsGroupKeys
=
envMapper
.
toGroupKeyFromOriginalNames
(
particpantsGroupNames
);
}
else
{
participantsGroupKeys
=
envMapper
.
toGroupKeyFromOriginalKeys
(
participantsGroupKeys
);
}
mc
.
set
(
COEditController
.
CONFIG_KEY_EMAILTOGROUP_IDS
,
participantsGroupKeys
);
mc
.
set
(
COEditController
.
CONFIG_KEY_EMAILTOPARTICIPANTS_GROUP_ID
,
participantsGroupKeys
);
//remap area keys
String
coachesAreaNames
=
(
String
)
mc
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOCOACHES_AREA
);
@SuppressWarnings
(
"unchecked"
)
List
<
Long
>
coachesAreaKeys
=
(
List
<
Long
>)
mc
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOCOACHES_AREA_IDS
);
List
<
Long
>
coachesAreaKeys
=
mc
.
getList
(
COEditController
.
CONFIG_KEY_EMAILTOCOACHES_AREA_IDS
,
Long
.
class
);
if
(
coachesAreaKeys
==
null
)
{
coachesAreaKeys
=
envMapper
.
toAreaKeyFromOriginalNames
(
coachesAreaNames
);
}
else
{
...
...
@@ -163,8 +161,7 @@ public class COCourseNode extends AbstractAccessableCourseNode {
mc
.
set
(
COEditController
.
CONFIG_KEY_EMAILTOCOACHES_AREA_IDS
,
coachesAreaKeys
);
String
participantsAreaNames
=
(
String
)
mc
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOPARTICIPANTS_AREA
);
@SuppressWarnings
(
"unchecked"
)
List
<
Long
>
participantsAreaKeys
=
(
List
<
Long
>)
mc
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOPARTICIPANTS_AREA_ID
);
List
<
Long
>
participantsAreaKeys
=
mc
.
getList
(
COEditController
.
CONFIG_KEY_EMAILTOPARTICIPANTS_AREA_ID
,
Long
.
class
);
if
(
participantsAreaKeys
==
null
)
{
participantsAreaKeys
=
envMapper
.
toAreaKeyFromOriginalNames
(
participantsAreaNames
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/olat/course/nodes/co/CORunController.java
+
5
−
10
View file @
671eb0e0
...
...
@@ -95,8 +95,7 @@ public class CORunController extends BasicController {
Translator
fallback
=
Util
.
createPackageTranslator
(
ContactFormController
.
class
,
ureq
.
getLocale
());
setTranslator
(
Util
.
createPackageTranslator
(
CORunController
.
class
,
ureq
.
getLocale
(),
fallback
));
@SuppressWarnings
(
"unchecked"
)
List
<
String
>
emailListConfig
=
(
List
<
String
>)
moduleConfiguration
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOADRESSES
);
List
<
String
>
emailListConfig
=
moduleConfiguration
.
getList
(
COEditController
.
CONFIG_KEY_EMAILTOADRESSES
,
String
.
class
);
String
mSubject
=
(
String
)
moduleConfiguration
.
get
(
COEditController
.
CONFIG_KEY_MSUBJECT_DEFAULT
);
String
mBody
=
(
String
)
moduleConfiguration
.
get
(
COEditController
.
CONFIG_KEY_MBODY_DEFAULT
);
...
...
@@ -110,29 +109,25 @@ public class CORunController extends BasicController {
String
participantGroupNames
=
(
String
)
moduleConfiguration
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOPARTICIPANTS_GROUP
);
@SuppressWarnings
(
"unchecked"
)
List
<
Long
>
participantGroupKeys
=
(
List
<
Long
>)
moduleConfiguration
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOPARTICIPANTS_GROUP_ID
);
List
<
Long
>
participantGroupKeys
=
moduleConfiguration
.
getList
(
COEditController
.
CONFIG_KEY_EMAILTOPARTICIPANTS_GROUP_ID
,
Long
.
class
);
if
(
participantGroupKeys
==
null
&&
StringHelper
.
containsNonWhitespace
(
participantGroupNames
))
{
participantGroupKeys
=
businessGroupService
.
toGroupKeys
(
participantGroupNames
,
cgm
.
getCourseEntry
());
}
String
participantAreaNames
=
(
String
)
moduleConfiguration
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOPARTICIPANTS_AREA
);
@SuppressWarnings
(
"unchecked"
)
List
<
Long
>
participantAreaKeys
=
(
List
<
Long
>)
moduleConfiguration
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOPARTICIPANTS_AREA_ID
);
List
<
Long
>
participantAreaKeys
=
moduleConfiguration
.
getList
(
COEditController
.
CONFIG_KEY_EMAILTOPARTICIPANTS_AREA_ID
,
Long
.
class
);
if
(
participantAreaKeys
==
null
&&
StringHelper
.
containsNonWhitespace
(
participantAreaNames
))
{
participantAreaKeys
=
businessGroupService
.
toGroupKeys
(
participantAreaNames
,
cgm
.
getCourseEntry
());
}
String
coachGroupNames
=
(
String
)
moduleConfiguration
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOCOACHES_GROUP
);
@SuppressWarnings
(
"unchecked"
)
List
<
Long
>
coachGroupKeys
=
(
List
<
Long
>)
moduleConfiguration
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOCOACHES_GROUP_ID
);
List
<
Long
>
coachGroupKeys
=
moduleConfiguration
.
getList
(
COEditController
.
CONFIG_KEY_EMAILTOCOACHES_GROUP_ID
,
Long
.
class
);
if
(
coachGroupKeys
==
null
&&
StringHelper
.
containsNonWhitespace
(
coachGroupNames
))
{
coachGroupKeys
=
businessGroupService
.
toGroupKeys
(
coachGroupNames
,
cgm
.
getCourseEntry
());
}
String
coachAreaNames
=
(
String
)
moduleConfiguration
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOCOACHES_AREA
);
@SuppressWarnings
(
"unchecked"
)
List
<
Long
>
coachAreaKeys
=
(
List
<
Long
>)
moduleConfiguration
.
get
(
COEditController
.
CONFIG_KEY_EMAILTOCOACHES_AREA_IDS
);
List
<
Long
>
coachAreaKeys
=
moduleConfiguration
.
getList
(
COEditController
.
CONFIG_KEY_EMAILTOCOACHES_AREA_IDS
,
Long
.
class
);
if
(
coachAreaKeys
==
null
&&
StringHelper
.
containsNonWhitespace
(
coachAreaNames
))
{
coachAreaKeys
=
businessGroupService
.
toGroupKeys
(
coachAreaNames
,
cgm
.
getCourseEntry
());
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment