liquid_feedback_frontend

annotate app/main/admin/_action/cancel_issue.lua @ 1029:08fe525b5bd6

Fixed syntax error from issue model
author bsw
date Sun Aug 11 23:00:55 2013 +0200 (2013-08-11)
parents 413fd413c4d9
children 42edba78d946
rev   line source
bsw@1025 1 local issue = Issue
bsw@1025 2 :new_selector()
bsw@1025 3 :add_where{ "id = ?", param.get_id()}
bsw@1025 4 :single_object_mode()
bsw@1025 5 :for_update()
bsw@1025 6 :exec()
bsw@1025 7
bsw@1025 8 if issue.closed then
bsw@1025 9 error("issue is already closed")
bsw@1025 10 return false
bsw@1025 11 end
bsw@1025 12
bsw@1025 13 issue.state = "canceled_by_admin"
bsw@1025 14 issue.closed = "now"
bsw@1025 15
bsw@1025 16 local admin_notice
bsw@1025 17 if issue.admin_notice then
bsw@1025 18 admin_notice = issue.admin_notice .. "\n\n"
bsw@1025 19 else
bsw@1025 20 admin_notice = ""
bsw@1025 21 end
bsw@1025 22
bsw@1025 23 admin_notice = admin_notice .. param.get("admin_notice")
bsw@1025 24
bsw@1025 25 issue.admin_notice = admin_notice
bsw@1025 26
bsw@1025 27 issue:save()

Impressum / About Us