Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-sla-management
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-sla-management
Commits
1723bc56
Commit
1723bc56
authored
Jan 13, 2011
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Implemented Ticket Priority mapping for Versia
- Started to implement Project import for KPMG
parent
a87e26a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
5 deletions
+70
-5
intranet-sla-management-procs.tcl
tcl/intranet-sla-management-procs.tcl
+69
-4
ticket-priority-component.adp
www/ticket-priority-component.adp
+1
-1
No files found.
tcl/intranet-sla-management-procs.tcl
View file @
1723bc56
...
...
@@ -150,16 +150,81 @@ ad_proc -public im_ticket_priority_map_component {
}
ad_proc -callback im_ticket_after_create
{
ad_proc -public im_ticket_priority_lookup
{
-sla_id:required
-ticket_type_id:required
-ticket_status_id:required
-map:required
}
{
Takes ticket_type and ticket_status to lookup
the ticket priority in the
"map"
.
"Map"
contains triples of
{
type_id severity_id prio_id
}
Returns the mapped value or
""
if no match has been found.
}
{
set result
""
foreach tuple
$map
{
set t0
[
lindex
$tuple
0
]
set t1
[
lindex
$tuple
1
]
set t2
[
lindex
$tuple
2
]
if
{
$t0
==
$ticket
_type_id &&
$t1
==
$ticket
_status_id
}
{
set result
$t2
}
}
return
$result
}
ad_proc -callback im_ticket_after_create -impl im_sla_management
{
-object_id
-status_id
-type_id
}
{
Callback after a ticket has been created.
Sets the ticket priority depending on parameters
Callback to be executed after the creation of any ticket.
The callback performs a lookup of certain ticket properties
(
ticket_type_id and ticket_severity_id
)
and assigns a suitable
priority to the ticket.
The assigned priority overwrites the possibly user-defined priority.
}
{
ns_log Notice
"im_ticket_after_create -impl im_sla_management: Entering callback code"
set found_p
[
db_0or1row ticket_info
"
select t.*,
p.*,
sla.project_id as sla_id,
sla.sla_ticket_priority_map
from im_tickets t,
im_projects p,
im_projects sla
where t.ticket_id = p.project_id and
t.ticket_id = :object_id and
p.parent_id = sla.project_id
"
]
if
{
!$found_p
}
{
ns_log Error
"im_ticket_after_create -impl im_sla_management -object_id=
$object
_id: Didn't find object, skipping"
return
""
}
set priority_id
[
im_ticket_priority_lookup
\
-sla_id
$sla
_id
\
-ticket_type_id
$ticket
_type_id
\
-ticket_status_id
$ticket
_status_id
\
-map
$sla
_ticket_priority_map
\
]
# Update the ticket if the mapping was successfull
if
{
""
!=
$priority
_id
}
{
db_dml update_ticket
"
update im_tickets
set ticket_prio_id = :priority_id
where ticket_id = :object_id
"
ns_log Notice
"im_ticket_after_create -impl im_sla_management: Updated ticket
\#
$ticket
_id with prio_id=
$priority
_id"
}
ad_return_complaint 1 asdf
}
...
...
www/ticket-priority-component.adp
View file @
1723bc56
...
...
@@ -15,7 +15,7 @@
</tr>
<tr>
<td><%= [im_category_select "Intranet Ticket Type" ticket_type_id ""] %></td>
<td><%= [im_category_select "Intranet Ticket
Clas
s" ticket_severity_id ""] %></td>
<td><%= [im_category_select "Intranet Ticket
Statu
s" ticket_severity_id ""] %></td>
<td><%= [im_category_select "Intranet Ticket Priority" ticket_prio_id ""] %></td>
</tr>
<tr><td colspan=3><input type=submit value='@create_new_entry_msg@'></td></tr>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment