liquid_feedback_frontend
view app/main/admin/_action/cancel_issue.lua @ 1308:7ea154c9238a
Added libbsd-dev and postgresql server-dev package to list of necessary packages to be installed for compiling/running on Debian
| author | jbe |
|---|---|
| date | Thu Jun 23 03:30:57 2016 +0200 (2016-06-23) |
| parents | 42edba78d946 |
| children |
line source
1 local issue = Issue
2 :new_selector()
3 :add_where{ "id = ?", param.get_id()}
4 :single_object_mode()
5 :for_update()
6 :exec()
8 if issue.closed then
9 slot.put_into("error", _"This issue is already closed.")
10 return false
11 end
13 issue.state = "canceled_by_admin"
14 issue.closed = "now"
16 local admin_notice
17 if issue.admin_notice then
18 admin_notice = issue.admin_notice .. "\n\n"
19 else
20 admin_notice = ""
21 end
23 admin_notice = admin_notice .. param.get("admin_notice")
25 issue.admin_notice = admin_notice
27 issue:save()
29 slot.put_into("notice", _"Issue has been canceled")
