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
8add7ee2
Commit
8add7ee2
authored
11 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-627: check configuration for "last visit" on the details view of a user in members management
parent
b4e75634
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/group/ui/main/MemberInfoController.java
+18
-13
18 additions, 13 deletions
...ain/java/org/olat/group/ui/main/MemberInfoController.java
with
18 additions
and
13 deletions
src/main/java/org/olat/group/ui/main/MemberInfoController.java
+
18
−
13
View file @
8add7ee2
...
...
@@ -23,6 +23,7 @@ import java.util.Date;
import
java.util.List
;
import
org.olat.NewControllerFactory
;
import
org.olat.basesecurity.BaseSecurityModule
;
import
org.olat.core.CoreSpringFactory
;
import
org.olat.core.gui.UserRequest
;
import
org.olat.core.gui.components.form.flexible.FormItem
;
...
...
@@ -58,6 +59,7 @@ public class MemberInfoController extends FormBasicController {
private
UserCourseInformations
courseInfos
;
private
final
UserManager
userManager
;
private
final
BaseSecurityModule
securityModule
;
private
final
UserCourseInformationsManager
efficiencyStatementManager
;
public
MemberInfoController
(
UserRequest
ureq
,
WindowControl
wControl
,
Identity
identity
,
...
...
@@ -66,6 +68,7 @@ public class MemberInfoController extends FormBasicController {
setTranslator
(
Util
.
createPackageTranslator
(
UserPropertyHandler
.
class
,
ureq
.
getLocale
(),
getTranslator
()));
userManager
=
CoreSpringFactory
.
getImpl
(
UserManager
.
class
);
securityModule
=
CoreSpringFactory
.
getImpl
(
BaseSecurityModule
.
class
);
efficiencyStatementManager
=
CoreSpringFactory
.
getImpl
(
UserCourseInformationsManager
.
class
);
this
.
identity
=
identity
;
...
...
@@ -108,22 +111,24 @@ public class MemberInfoController extends FormBasicController {
//course informations
FormLayoutContainer
courseInfosContainer
=
FormLayoutContainer
.
createDefaultFormLayout
(
"courseInfos"
,
getTranslator
());
formLayout
.
add
(
"courseInfos"
,
courseInfosContainer
);
membershipCreationEl
=
uifactory
.
addStaticTextElement
(
"firstTime"
,
"course.membership.creation"
,
""
,
courseInfosContainer
);
Formatter
formatter
=
Formatter
.
getInstance
(
getLocale
());
String
lastVisit
=
""
;
String
numOfVisits
=
"0"
;
if
(
courseInfos
!=
null
)
{
if
(
courseInfos
.
getRecentLaunch
()
!=
null
)
{
lastVisit
=
formatter
.
formatDate
(
courseInfos
.
getRecentLaunch
());
if
(
securityModule
.
isUserLastVisitVisible
(
ureq
.
getUserSession
().
getRoles
()))
{
Formatter
formatter
=
Formatter
.
getInstance
(
getLocale
());
String
lastVisit
=
""
;
String
numOfVisits
=
"0"
;
if
(
courseInfos
!=
null
)
{
if
(
courseInfos
.
getRecentLaunch
()
!=
null
)
{
lastVisit
=
formatter
.
formatDate
(
courseInfos
.
getRecentLaunch
());
}
if
(
courseInfos
.
getVisit
()
>=
0
)
{
numOfVisits
=
Integer
.
toString
(
courseInfos
.
getVisit
());
}
}
if
(
courseInfos
.
getVisit
()
>=
0
)
{
numOfVisits
=
Integer
.
toString
(
courseInfos
.
getVisit
());
}
uifactory
.
addStaticTextElement
(
"lastTime"
,
"course.lastTime"
,
lastVisit
,
courseInfosContainer
);
uifactory
.
addStaticTextElement
(
"numOfVisits"
,
"course.numOfVisits"
,
numOfVisits
,
courseInfosContainer
);
}
membershipCreationEl
=
uifactory
.
addStaticTextElement
(
"firstTime"
,
"course.membership.creation"
,
""
,
courseInfosContainer
);
uifactory
.
addStaticTextElement
(
"lastTime"
,
"course.lastTime"
,
lastVisit
,
courseInfosContainer
);
uifactory
.
addStaticTextElement
(
"numOfVisits"
,
"course.numOfVisits"
,
numOfVisits
,
courseInfosContainer
);
//links
homeLink
=
uifactory
.
addFormLink
(
"home"
,
formLayout
,
"b_link_left_icon b_link_to_home"
);
...
...
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