src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt

changeset 247
e71ae69c68c0
parent 242
b7f3e972b13c
child 248
90dc13c78b5d
equal deleted inserted replaced
246:9a81a11be70e 247:e71ae69c68c0
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 package de.uapcore.lightpit.servlet 26 package de.uapcore.lightpit.servlet
27 27
28 import de.uapcore.lightpit.* 28 import de.uapcore.lightpit.AbstractServlet
29 import de.uapcore.lightpit.HttpRequest
30 import de.uapcore.lightpit.boolValidator
29 import de.uapcore.lightpit.dao.DataAccessObject 31 import de.uapcore.lightpit.dao.DataAccessObject
32 import de.uapcore.lightpit.dateOptValidator
30 import de.uapcore.lightpit.entities.* 33 import de.uapcore.lightpit.entities.*
31 import de.uapcore.lightpit.types.IssueCategory 34 import de.uapcore.lightpit.types.IssueCategory
32 import de.uapcore.lightpit.types.IssueStatus 35 import de.uapcore.lightpit.types.IssueStatus
33 import de.uapcore.lightpit.types.VersionStatus 36 import de.uapcore.lightpit.types.VersionStatus
34 import de.uapcore.lightpit.types.WebColor 37 import de.uapcore.lightpit.types.WebColor
531 if (!newComment.isNullOrBlank()) { 534 if (!newComment.isNullOrBlank()) {
532 comment.comment = newComment 535 comment.comment = newComment
533 dao.updateComment(comment) 536 dao.updateComment(comment)
534 dao.insertHistoryEvent(issue, comment) 537 dao.insertHistoryEvent(issue, comment)
535 } else { 538 } else {
536 logger().debug("Not updating comment ${comment.id} because nothing changed.") 539 logger.debug("Not updating comment ${comment.id} because nothing changed.")
537 } 540 }
538 } else { 541 } else {
539 http.response.sendError(403) 542 http.response.sendError(403)
540 return 543 return
541 } 544 }
590 593
591 if (issue.hasChanged(reference)) { 594 if (issue.hasChanged(reference)) {
592 dao.updateIssue(issue) 595 dao.updateIssue(issue)
593 dao.insertHistoryEvent(issue) 596 dao.insertHistoryEvent(issue)
594 } else { 597 } else {
595 logger().debug("Not updating issue ${issue.id} because nothing changed.") 598 logger.debug("Not updating issue ${issue.id} because nothing changed.")
596 } 599 }
597 600
598 val newComment = http.param("comment") 601 val newComment = http.param("comment")
599 if (!newComment.isNullOrBlank()) { 602 if (!newComment.isNullOrBlank()) {
600 val comment = IssueComment(-1, issue.id).apply { 603 val comment = IssueComment(-1, issue.id).apply {

mercurial