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
5d4cf90a
Commit
5d4cf90a
authored
10 years ago
by
srosse
Browse files
Options
Downloads
Plain Diff
Merge OpenOLAT 9.3 to OpenOLAT default branch with 54255520527e4fa31d5375d15284887276626359
parents
04e638e4
82b4a4e1
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/de/bps/olat/modules/cl/Checklist.java
+5
-1
5 additions, 1 deletion
src/main/java/de/bps/olat/modules/cl/Checklist.java
src/main/java/de/bps/olat/modules/cl/ChecklistEditCheckpointsController.java
+35
-23
35 additions, 23 deletions
...s/olat/modules/cl/ChecklistEditCheckpointsController.java
with
40 additions
and
24 deletions
src/main/java/de/bps/olat/modules/cl/Checklist.java
+
5
−
1
View file @
5d4cf90a
...
...
@@ -138,7 +138,11 @@ public class Checklist extends PersistentObject implements ModifiedInfo, Seriali
* @param checkpoint
*/
public
void
addCheckpoint
(
int
index
,
Checkpoint
checkpoint
)
{
checkpoints
.
add
(
index
,
checkpoint
);
if
(
index
>=
0
&&
index
<
checkpoints
.
size
())
{
checkpoints
.
add
(
index
,
checkpoint
);
}
else
{
checkpoints
.
add
(
checkpoint
);
}
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/bps/olat/modules/cl/ChecklistEditCheckpointsController.java
+
35
−
23
View file @
5d4cf90a
...
...
@@ -127,9 +127,8 @@ public class ChecklistEditCheckpointsController extends FormBasicController {
}
checklist
=
checklistManager
.
updateChecklist
(
checklist
);
DBFactory
.
getInstance
().
commit
();
checkpointsInVc
.
clear
();
checkpointsInVc
.
addAll
(
checklist
.
getCheckpointsSorted
(
checkpointComparator
));
titleContainer
.
contextPut
(
"checkpoints"
,
checkpointsInVc
);
loadCheckpointInVC
();
titleContainer
.
setDirty
(
true
);
// Inform all listeners about the changes
fireEvent
(
ureq
,
Event
.
CHANGED_EVENT
);
}
...
...
@@ -223,27 +222,12 @@ public class ChecklistEditCheckpointsController extends FormBasicController {
titleContainer
=
FormLayoutContainer
.
createCustomFormLayout
(
"titleLayout"
,
getTranslator
(),
velocity_root
+
"/edit.html"
);
fic
.
add
(
titleContainer
);
// create gui elements for all checkpoints
int
numOfCheckpoints
=
checklist
.
getCheckpoints
().
size
();
if
(
numOfCheckpoints
==
0
)
{
Checkpoint
newCheckpoint
=
new
Checkpoint
();
newCheckpoint
.
setChecklist
(
checklist
);
newCheckpoint
.
setLastModified
(
new
Date
());
newCheckpoint
.
setTitle
(
""
);
newCheckpoint
.
setDescription
(
""
);
newCheckpoint
.
setMode
(
CheckpointMode
.
MODE_EDITABLE
);
checklist
.
addCheckpoint
(
0
,
newCheckpoint
);
addNewFormCheckpoint
(
0
,
newCheckpoint
);
}
else
{
for
(
int
i
=
0
;
i
<
numOfCheckpoints
;
i
++)
{
Checkpoint
checkpoint
=
checklist
.
getCheckpointsSorted
(
checkpointComparator
).
get
(
i
);
addNewFormCheckpoint
(
i
,
checkpoint
);
}
}
loadCheckpointInVC
();
addButton
=
new
FormLinkImpl
(
"add"
+
counter
,
"add"
+
counter
,
"cl.table.add"
,
Link
.
BUTTON_SMALL
);
addButton
.
setUserObject
(
checklist
.
getCheckpointsSorted
(
checkpointComparator
).
get
(
checklist
.
getCheckpoints
().
size
()
-
1
));
titleContainer
.
add
(
addButton
);
checkpointsInVc
.
addAll
(
checklist
.
getCheckpointsSorted
(
checkpointComparator
));
titleContainer
.
contextPut
(
"checkpoints"
,
checkpointsInVc
);
titleContainer
.
contextPut
(
"titleInputList"
,
titleInputList
);
titleContainer
.
contextPut
(
"descriptionInputList"
,
descriptionInputList
);
...
...
@@ -258,6 +242,36 @@ public class ChecklistEditCheckpointsController extends FormBasicController {
uifactory
.
addFormSubmitButton
(
"subm"
,
submitKey
,
buttonContainer
);
}
private
void
loadCheckpointInVC
()
{
checkpointsInVc
.
clear
();
titleInputList
.
clear
();
descriptionInputList
.
clear
();
modeInputList
.
clear
();
delButtonList
.
clear
();
int
numOfCheckpoints
=
checklist
.
getCheckpoints
().
size
();
if
(
numOfCheckpoints
==
0
)
{
Checkpoint
newCheckpoint
=
new
Checkpoint
();
newCheckpoint
.
setChecklist
(
checklist
);
newCheckpoint
.
setLastModified
(
new
Date
());
newCheckpoint
.
setTitle
(
""
);
newCheckpoint
.
setDescription
(
""
);
newCheckpoint
.
setMode
(
CheckpointMode
.
MODE_EDITABLE
);
checklist
.
addCheckpoint
(
0
,
newCheckpoint
);
addNewFormCheckpoint
(
0
,
newCheckpoint
);
List
<
Checkpoint
>
checkpoints
=
checklist
.
getCheckpointsSorted
(
checkpointComparator
);
checkpointsInVc
.
addAll
(
checkpoints
);
}
else
{
List
<
Checkpoint
>
checkpoints
=
checklist
.
getCheckpointsSorted
(
checkpointComparator
);
for
(
int
i
=
0
;
i
<
numOfCheckpoints
;
i
++)
{
Checkpoint
checkpoint
=
checkpoints
.
get
(
i
);
addNewFormCheckpoint
(
i
,
checkpoint
);
}
checkpointsInVc
.
addAll
(
checkpoints
);
}
}
@Override
protected
void
event
(
UserRequest
ureq
,
Controller
source
,
Event
event
)
{
if
(
source
==
yesNoController
)
{
...
...
@@ -290,7 +304,6 @@ public class ChecklistEditCheckpointsController extends FormBasicController {
return
isOk
;
}
@Override
protected
void
formCancelled
(
UserRequest
ureq
)
{
// reset complete form
...
...
@@ -304,5 +317,4 @@ public class ChecklistEditCheckpointsController extends FormBasicController {
initForm
(
flc
,
this
,
ureq
);
fireEvent
(
ureq
,
Event
.
CANCELLED_EVENT
);
}
}
}
\ No newline at end of file
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