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
580327c3
Commit
580327c3
authored
9 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-1875: don't remove the attachment after every save of the project details
parent
a60b54b7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/course/nodes/projectbroker/ProjectEditDetailsFormController.java
+16
-14
16 additions, 14 deletions
...nodes/projectbroker/ProjectEditDetailsFormController.java
with
16 additions
and
14 deletions
src/main/java/org/olat/course/nodes/projectbroker/ProjectEditDetailsFormController.java
+
16
−
14
View file @
580327c3
...
...
@@ -34,7 +34,6 @@ import java.util.List;
import
java.util.Map
;
import
java.util.StringTokenizer
;
import
org.olat.core.CoreSpringFactory
;
import
org.olat.core.gui.UserRequest
;
import
org.olat.core.gui.components.form.flexible.FormItem
;
import
org.olat.core.gui.components.form.flexible.FormItemContainer
;
...
...
@@ -56,6 +55,7 @@ import org.olat.core.gui.control.Event;
import
org.olat.core.gui.control.WindowControl
;
import
org.olat.core.id.Identity
;
import
org.olat.core.id.UserConstants
;
import
org.olat.core.util.StringHelper
;
import
org.olat.core.util.vfs.LocalFileImpl
;
import
org.olat.core.util.vfs.VFSLeaf
;
import
org.olat.course.nodes.CourseNode
;
...
...
@@ -68,6 +68,7 @@ import org.olat.course.nodes.projectbroker.service.ProjectBrokerModuleConfigurat
import
org.olat.course.nodes.projectbroker.service.ProjectGroupManager
;
import
org.olat.course.run.environment.CourseEnvironment
;
import
org.olat.resource.OLATResource
;
import
org.springframework.beans.factory.annotation.Autowired
;
/**
*
...
...
@@ -86,7 +87,7 @@ public class ProjectEditDetailsFormController extends FormBasicController {
private
RichTextElement
projectDescription
;
private
IntegerElement
maxMembers
;
private
StaticTextElement
projectState
;
FormLayoutContainer
stateLayout
;
private
FormLayoutContainer
stateLayout
;
private
FileElement
attachmentFileName
;
private
TextElement
projectLeaders
;
...
...
@@ -111,9 +112,12 @@ public class ProjectEditDetailsFormController extends FormBasicController {
private
final
static
String
[]
values
=
new
String
[]
{
""
};
private
static
final
int
MAX_MEMBERS_DEFAULT
=
1
;
private
final
ProjectBrokerMailer
projectBrokerMailer
;
private
final
ProjectGroupManager
projectGroupManager
;
private
final
ProjectBrokerManager
projectBrokerManager
;
@Autowired
private
ProjectBrokerMailer
projectBrokerMailer
;
@Autowired
private
ProjectGroupManager
projectGroupManager
;
@Autowired
private
ProjectBrokerManager
projectBrokerManager
;
/**
* Modules selection form.
...
...
@@ -127,12 +131,9 @@ public class ProjectEditDetailsFormController extends FormBasicController {
this
.
courseNode
=
courseNode
;
this
.
projectBrokerModuleConfiguration
=
projectBrokerModuleConfiguration
;
this
.
enableCancel
=
enableCancel
;
projectBrokerMailer
=
CoreSpringFactory
.
getImpl
(
ProjectBrokerMailer
.
class
);
projectGroupManager
=
CoreSpringFactory
.
getImpl
(
ProjectGroupManager
.
class
);
projectBrokerManager
=
CoreSpringFactory
.
getImpl
(
ProjectBrokerManager
.
class
);
customfieldElementList
=
new
ArrayList
<
FormItem
>();
eventStartElementList
=
new
HashMap
<
Project
.
EventType
,
DateChooser
>();
eventEndElementList
=
new
HashMap
<
Project
.
EventType
,
DateChooser
>();
customfieldElementList
=
new
ArrayList
<>();
eventStartElementList
=
new
HashMap
<>();
eventEndElementList
=
new
HashMap
<>();
initForm
(
ureq
);
}
...
...
@@ -343,12 +344,13 @@ public class ProjectEditDetailsFormController extends FormBasicController {
projectGroupManager
.
setProjectGroupMaxMembers
(
getIdentity
(),
project
.
getProjectGroup
(),
maxMembers
.
getIntValue
());
projectChanged
=
true
;
}
if
(
attachmentFileName
.
getUploadFileName
()
!=
null
&&
!
attachmentFileName
.
getUploadFileName
()
.
equals
(
""
))
{
if
(
StringHelper
.
containsNonWhitespace
(
attachmentFileName
.
getUploadFileName
()))
{
// First call uploadFiles than setAttachedFileName because uploadFiles needs old attachment name
uploadFiles
(
attachmentFileName
);
project
.
setAttachedFileName
(
attachmentFileName
.
getUploadFileName
());
projectChanged
=
true
;
}
else
if
(
project
.
getAttachmentFileName
()
!=
null
&&
!
project
.
getAttachmentFileName
().
equals
(
""
))
{
}
else
if
(
StringHelper
.
containsNonWhitespace
(
project
.
getAttachmentFileName
())
&&
attachmentFileName
.
getInitialFile
()
==
null
)
{
// Attachment file has been removed
project
.
setAttachedFileName
(
""
);
projectChanged
=
true
;
...
...
@@ -396,7 +398,7 @@ public class ProjectEditDetailsFormController extends FormBasicController {
projectBrokerManager
.
updateProject
(
project
);
projectBrokerMailer
.
sendProjectChangedEmailToParticipants
(
ureq
.
getIdentity
(),
project
,
this
.
getTranslator
());
}
else
{
this
.
showInfo
(
"info.project.nolonger.exist"
,
project
.
getTitle
());
showInfo
(
"info.project.nolonger.exist"
,
project
.
getTitle
());
}
}
fireEvent
(
ureq
,
Event
.
DONE_EVENT
);
...
...
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