mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-04-29 03:55:42 +08:00
移除工单类型
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
},
|
||||
"ticket": {
|
||||
"": "工单",
|
||||
"type": "类型",
|
||||
"title": "标题",
|
||||
"status": "状态",
|
||||
"create": "创建",
|
||||
|
||||
@@ -9,7 +9,6 @@ sample =
|
||||
title: 'Ticket Title'
|
||||
content: 'Ticket Content(Markdown)'
|
||||
content_html: 'Ticket Conetnt(HTML)'
|
||||
type: 'linux'
|
||||
status: 'open/pending/finish/closed'
|
||||
|
||||
attribute:
|
||||
@@ -28,7 +27,7 @@ sample =
|
||||
attribute: {}
|
||||
]
|
||||
|
||||
exports.createTicket = (account, title, content, type, members, status, attribute, callback) ->
|
||||
exports.createTicket = (account, title, content, members, status, attribute, callback) ->
|
||||
membersID = []
|
||||
|
||||
for member in members
|
||||
@@ -41,7 +40,6 @@ exports.createTicket = (account, title, content, type, members, status, attribut
|
||||
title: title
|
||||
content: content
|
||||
content_html: markdown.toHTML content
|
||||
type: type
|
||||
status: status
|
||||
members: membersID
|
||||
attribute: attribute
|
||||
|
||||
@@ -21,8 +21,7 @@ exports.get '/list', requestAuthenticate, renderAccount, (req, res) ->
|
||||
tickets: tickets
|
||||
|
||||
exports.get '/create', requestAuthenticate, renderAccount, (req, res) ->
|
||||
res.render 'ticket/create',
|
||||
ticketTypes: config.ticket.availableType
|
||||
res.render 'ticket/create'
|
||||
|
||||
exports.get '/view', requestAuthenticate, renderAccount, getParam, (req, res) ->
|
||||
mTicket.findId req.body.id, (err, ticket) ->
|
||||
@@ -57,11 +56,8 @@ exports.post '/create', requestAuthenticate, (req, res) ->
|
||||
unless /^.+$/.test req.body.title
|
||||
return res.error 'invalid_title'
|
||||
|
||||
unless req.body.type in config.ticket.availableType
|
||||
return res.error 'invalid_type'
|
||||
|
||||
createTicket = (members, status) ->
|
||||
mTicket.createTicket req.account, req.body.title, req.body.content, req.body.type, members, status, {}, (err, ticket) ->
|
||||
mTicket.createTicket req.account, req.body.title, req.body.content, members, status, {}, (err, ticket) ->
|
||||
return res.json
|
||||
id: ticket._id
|
||||
|
||||
@@ -114,9 +110,6 @@ exports.post '/list', requestAuthenticate, (req, res) ->
|
||||
members: req.account._id
|
||||
]
|
||||
|
||||
if req.body.type?.toLowerCase() in config.ticket.availableType
|
||||
selector['type'] = req.body.type.toLowerCase()
|
||||
|
||||
if req.body.status?.toLowerCase() in ['open', 'pending', 'finish', 'closed']
|
||||
selector['status'] = req.body.status.toLowerCase()
|
||||
|
||||
@@ -131,7 +124,6 @@ exports.post '/list', requestAuthenticate, (req, res) ->
|
||||
return {
|
||||
id: item._id
|
||||
title: item.title
|
||||
type: item.type
|
||||
status: item.status
|
||||
updated_at: item.updated_at
|
||||
}
|
||||
@@ -150,12 +142,6 @@ exports.post '/update', requestAuthenticate, (req, res) ->
|
||||
unless mAccount.inGroup req.account, 'root'
|
||||
return res.error 'forbidden'
|
||||
|
||||
if req.body.type
|
||||
if req.body.type in config.ticket.availableType
|
||||
modifier['type'] = req.body.type
|
||||
else
|
||||
return res.error 'invalid_type'
|
||||
|
||||
if req.body.status
|
||||
if mAccount.inGroup req.account, 'root'
|
||||
allow_status = ['open', 'pending', 'finish', 'closed']
|
||||
|
||||
@@ -7,13 +7,8 @@ prepend head
|
||||
block main
|
||||
header= t('ticket.create_ticket')
|
||||
form.form-horizontal(method='post', role='form')
|
||||
.form-group
|
||||
.col-sm-3
|
||||
select#type.form-control(name='type')
|
||||
for type in ticketTypes
|
||||
option(value=type)= type
|
||||
.col-sm-9
|
||||
input#title.form-control(type='text', name='title', required)
|
||||
.form-group.padding
|
||||
input#title.form-control(type='text', name='title', placeholder= t('ticket.title'),required)
|
||||
.form-group.padding
|
||||
textarea#content.form-control(name='content', rows='15', required)
|
||||
.form-group.padding
|
||||
|
||||
@@ -9,13 +9,11 @@ block main
|
||||
table.table.table-hover
|
||||
thead
|
||||
tr
|
||||
th= t('ticket.type')
|
||||
th= t('ticket.title')
|
||||
th= t('ticket.status')
|
||||
tbody
|
||||
for ticket in tickets
|
||||
tr(data-id= '#{ticket._id}')
|
||||
td= ticket.type
|
||||
td
|
||||
a(href='/ticket/view/?id=#{ticket._id}')= ticket.title
|
||||
td= ticket.status
|
||||
|
||||
Reference in New Issue
Block a user