Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-helpdesk
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-helpdesk
Commits
2f9cbe95
Commit
2f9cbe95
authored
Sep 09, 2008
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Started the Quote page
parent
1256db95
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
326 additions
and
103 deletions
+326
-103
intranet-helpdesk-create.sql
sql/postgresql/intranet-helpdesk-create.sql
+41
-0
intranet-helpdesk-procs.tcl
tcl/intranet-helpdesk-procs.tcl
+6
-1
index.tcl
www/index.tcl
+1
-1
new.adp
www/new.adp
+0
-9
new.tcl
www/new.tcl
+3
-92
quote.adp
www/quote.adp
+17
-0
quote.tcl
www/quote.tcl
+258
-0
No files found.
sql/postgresql/intranet-helpdesk-create.sql
View file @
2f9cbe95
...
@@ -878,6 +878,47 @@ SELECT acs_permission__grant_permission(
...
@@ -878,6 +878,47 @@ SELECT acs_permission__grant_permission(
'read'
'read'
);
);
SELECT
acs_permission__grant_permission
(
(
select
plugin_id
from
im_component_plugins
where
plugin_name
=
'Workflow Actions'
and
package_name
=
'intranet-helpdesk'
),
(
select
group_id
from
groups
where
group_name
=
'Customers'
),
'read'
);
SELECT
acs_permission__grant_permission
(
(
select
plugin_id
from
im_component_plugins
where
plugin_name
=
'Workflow Actions'
and
package_name
=
'intranet-helpdesk'
),
(
select
group_id
from
groups
where
group_name
=
'Freelancers'
),
'read'
);
-- ------------------------------------------------------
-- Show the customer contacts information
-- to allow the helpdesk to contact the customer
--
SELECT
im_component_plugin__new
(
null
,
-- plugin_id
'acs_object'
,
-- object_type
now
(),
-- creation_date
null
,
-- creation_user
null
,
-- creation_ip
null
,
-- context_id
'Customer Info'
,
-- plugin_name
'intranet-helpdesk'
,
-- package_name
'right'
,
-- location
'/intranet-helpdesk/new'
,
-- page_url
null
,
-- view_name
10
,
-- sort_order
'im_user_base_info_component -user_id $ticket_customer_contact_id'
,
'lang::message::lookup "" intranet-helpdesk.Customer_Info "Customer Info"'
);
SELECT
acs_permission__grant_permission
(
(
select
plugin_id
from
im_component_plugins
where
plugin_name
=
'Customer Info'
and
package_name
=
'intranet-helpdesk'
),
(
select
group_id
from
groups
where
group_name
=
'Employees'
),
'read'
);
-----------------------------------------------------------
-----------------------------------------------------------
...
...
tcl/intranet-helpdesk-procs.tcl
View file @
2f9cbe95
...
@@ -254,7 +254,12 @@ ad_proc -public im_helpdesk_ticket_sla_options {
...
@@ -254,7 +254,12 @@ ad_proc -public im_helpdesk_ticket_sla_options {
set include_create_sla_p 0
set include_create_sla_p 0
set permission_sql
"and p.project_id in (
set permission_sql
"and p.project_id in (
select object_id_one from acs_rels where object_id_two = :user_id UNION
select object_id_one from acs_rels where object_id_two = :user_id UNION
select project_id from im_projects where company_id = :customer_id
select project_id from im_projects where company_id = :customer_id UNION
select project_id from im_projects where company_id in (
select object_id_one
from acs_rels
where object_id_two = :user_id
)
)"
)"
}
}
...
...
www/index.tcl
View file @
2f9cbe95
...
@@ -115,7 +115,7 @@ set ticket_member_options [util_memoize "db_list_of_lists ticket_members {
...
@@ -115,7 +115,7 @@ set ticket_member_options [util_memoize "db_list_of_lists ticket_members {
set
ticket_member_options
[
linsert
$ticket
_member_options 0
[
list
[
_ intranet-core.All
]
""
]]
set
ticket_member_options
[
linsert
$ticket
_member_options 0
[
list
[
_ intranet-core.All
]
""
]]
set
ticket_queue_options
[
im_helpdesk_ticket_queue_options
]
set
ticket_queue_options
[
im_helpdesk_ticket_queue_options
]
set
ticket_sla_options
[
im_helpdesk_ticket_sla_options -include_create_sla_p 1
]
set
ticket_sla_options
[
im_helpdesk_ticket_sla_options -include_create_sla_p 1
-include_empty_p 0
]
ad_form
\
ad_form
\
-name
$form
_id
\
-name
$form
_id
\
...
...
www/new.adp
View file @
2f9cbe95
...
@@ -35,15 +35,6 @@
...
@@ -35,15 +35,6 @@
</td>
</td>
<td width="50%">
<td width="50%">
<%= [im_component_bay right] %>
<%= [im_component_bay right] %>
<if @show_user_info_p@>
<%= [im_box_header "Basic Information About You"] %>
<formtemplate id="userinfo"></formtemplate>
<%= [im_box_footer] %>
<%= [im_box_header "Your Complete Contact Information"] %>
<%= $contact_html %>
<%= [im_box_footer] %>
</if>
</td>
</td>
</tr>
</tr>
</table>
</table>
...
...
www/new.tcl
View file @
2f9cbe95
...
@@ -39,7 +39,6 @@ if {![info exists task]} {
...
@@ -39,7 +39,6 @@ if {![info exists task]} {
set show_components_p 1
set show_components_p 1
set enable_master_p 1
set enable_master_p 1
set show_user_info_p 1
}
else
{
}
else
{
...
@@ -55,7 +54,6 @@ if {![info exists task]} {
...
@@ -55,7 +54,6 @@ if {![info exists task]} {
set show_components_p 0
set show_components_p 0
set enable_master_p 0
set enable_master_p 0
set show_user_info_p 0
set ticket_type_id
""
set ticket_type_id
""
set ticket_sla_id
""
set ticket_sla_id
""
set ticket_customer_contact_id
""
set ticket_customer_contact_id
""
...
@@ -77,8 +75,6 @@ set current_user_id [ad_maybe_redirect_for_registration]
...
@@ -77,8 +75,6 @@ set current_user_id [ad_maybe_redirect_for_registration]
set
current_url
[
im_url_with_query
]
set
current_url
[
im_url_with_query
]
set
action_url
"/intranet-helpdesk/new"
set
action_url
"/intranet-helpdesk/new"
set
focus
"ticket.var_name"
set
focus
"ticket.var_name"
set
td_class
(
0
)
"class=roweven"
set
td_class
(
1
)
"class=rowodd"
if
{[
info
exists ticket_id
]
&&
""
==
$ticket
_id
}
{
unset ticket_id
}
if
{[
info
exists ticket_id
]
&&
""
==
$ticket
_id
}
{
unset ticket_id
}
...
@@ -134,8 +130,9 @@ if {[exists_and_not_null ticket_id]} {
...
@@ -134,8 +130,9 @@ if {[exists_and_not_null ticket_id]} {
# The base form. Define this early so we can extract the form status
# The base form. Define this early so we can extract the form status
# ---------------------------------------------
# ---------------------------------------------
set
actions
[
list
{
"Edit"
edit
}]
set
actions
{}
if
{[
im_permission
$current
_user_id add_tickets
]}
{
lappend actions
{
"Delete"
delete
}
}
if
{[
im_permission
$current
_user_id add_tickets_for_customer
]}
{
lappend actions
{
"Edit"
edit
}
}
if
{[
im_permission
$current
_user_id add_tickets_for_customer
]}
{
lappend actions
{
"Delete"
delete
}
}
ad_form
\
ad_form
\
-name ticket
\
-name ticket
\
...
@@ -506,92 +503,6 @@ ad_form -extend -name ticket -on_request {
...
@@ -506,92 +503,6 @@ ad_form -extend -name ticket -on_request {
}
}
}
}
# ------------------------------------------------------------------
#
# ------------------------------------------------------------------
set
user_id
$current
_user_id
set
info_actions
[
list
{
"Edit"
edit
}]
set
info_action_url
"/intranet/users/view"
ad_form
\
-name userinfo
\
-action
$info
_action_url
\
-actions
$info
_actions
\
-mode
"display"
\
-export
{
next_url return_url
}
\
-form
{
{
user_id:key
}
{
email:text
(
text
)
{
label
"
[
_ intranet-core.Email
]
"
}
{
html
{
size 30
}}}
{
first_names:text
(
text
)
{
label
"
[
_ intranet-core.First_names
]
"
}
{
html
{
size 30
}}}
{
last_name:text
(
text
)
{
label
"
[
_ intranet-core.Last_name
]
"
}
{
html
{
size 30
}}}
}
-select_query
{
select u.*
from cc_users u
where u.user_id = :user_id
}
# ------------------------------------------------------------------
# Contact information
# ------------------------------------------------------------------
# ToDo: Convert into component and use component for /users/view
set
read 1
set
write 1
db_1row user_info
"
select u.*,
uc.*,
(select country_name from country_codes where iso = uc.ha_country_code) as ha_country_name,
(select country_name from country_codes where iso = uc.wa_country_code) as wa_country_name
from cc_users u
LEFT OUTER JOIN users_contact uc ON (u.user_id = uc.user_id)
where u.user_id = :user_id
"
set
view_id
[
db_string get_view_id
"select view_id from im_views where view_name='user_contact'"
]
set
column_sql
"
select column_name,
column_render_tcl,
visible_for
from im_view_columns
where view_id=:view_id
and group_id is null
order by sort_order
"
set
contact_html
"
<form method=POST action=/intranet/users/contact-edit>
[
export_form_vars user_id return_url
]
<table cellpadding=0 cellspacing=2 border=0>
<tr>
<td colspan=2 class=rowtitle align=center>
[
_ intranet-core.Contact_Information
]
</td>
</tr>
"
set
ctr 1
db_foreach column_list_sql
$column
_sql
{
if
{
""
==
$visible
_for ||
[
eval
$visible
_for
]}
{
append contact_html
"
<tr
$td
_class(
[
expr
$ctr
% 2
]
)>
<td>"
set cmd0
"append contact_html
$column
_name"
eval
"
$cmd0
"
append contact_html
" </td><td>"
set cmd
"append contact_html
$column
_render_tcl"
eval
$cmd
append contact_html
"</td></tr>
\n
"
incr ctr
}
}
append contact_html
"</table>
\n
</form>
\n
"
# ---------------------------------------------------------------
# ---------------------------------------------------------------
# Ticket Menu
# Ticket Menu
# ---------------------------------------------------------------
# ---------------------------------------------------------------
...
...
www/quote.adp
0 → 100755
View file @
2f9cbe95
<if @enable_master_p@>
<master src="../../intranet-core/www/master">
</if>
<property name="title">@page_title@</property>
<property name="context">@context;noquote@</property>
<property name="main_navbar_label">helpdesk</property>
<property name="focus">@focus;noquote@</property>
<property name="sub_navbar">@sub_navbar;noquote@</property>
<if @message@ not nil>
<div class="general-message">@message@</div>
</if>
<%= [im_box_header $page_title] %>
<formtemplate id="ticket"></formtemplate>
<%= [im_box_footer] %>
www/quote.tcl
0 → 100755
View file @
2f9cbe95
# /packages/intranet-helpdesk/www/quote.tcl
#
# Copyright (c
)
2003-2008
]
project-open
[
#
# All rights reserved. Please check
# http://www.project-open.com/license/ for details.
# -----------------------------------------------------------
# Page Head
#
# There are two different heads, depending whether it's called
# "standalone" (TCL-page
)
or as a Workflow Panel.
# -----------------------------------------------------------
# Skip if this page is called as part of a Workflow panel
if
{
!
[
info
exists task
]}
{
ad_page_contract
{
@author frank.bergmann@project-open.com
}
{
ticket_id:integer,optional
{
ticket_name
""
}
{
ticket_nr
""
}
{
ticket_sla_id
""
}
{
ticket_customer_contact_id
""
}
{
task_id
""
}
{
return_url
""
}
edit_p:optional
message:optional
{
ticket_type_id
""
}
{
return_url
"/intranet-helpdesk/"
}
{
vars_from_url
""
}
{
plugin_id:integer
""
}
{
view_name
"standard"
}
{
form_mode
"display"
}
}
set show_components_p 1
set enable_master_p 1
}
else
{
set form_mode
"display"
set task_id
$task
(
task_id
)
set case_id
$task
(
case_id
)
set vars_from_url
""
set return_url
[
im_url_with_query
]
set ticket_id
[
db_string pid
"select object_id from wf_cases where case_id = :case_id"
-default
""
]
set transition_key
[
db_string transition_key
"select transition_key from wf_tasks where task_id = :task_id"
]
set task_page_url
[
export_vars -base
[
ns_conn url
]
{
ticket_id task_id return_url
}]
set show_components_p 0
set enable_master_p 0
set ticket_type_id
""
set ticket_sla_id
""
set ticket_customer_contact_id
""
set plugin_id
""
set view_name
"standard"
# Don't show this page in WF panel.
ad_returnredirect
"/intranet-helpdesk/quote?ticket_id=
$task
(object_id)"
}
# ------------------------------------------------------------------
# Default & Security
# ------------------------------------------------------------------
set
current_user_id
[
ad_maybe_redirect_for_registration
]
set
current_url
[
im_url_with_query
]
set
action_url
"/intranet-helpdesk/new"
set
focus
"ticket.var_name"
if
{[
info
exists ticket_id
]
&&
""
==
$ticket
_id
}
{
unset ticket_id
}
# Can the currrent user create new helpdesk customers?
set
user_can_create_new_customer_p 1
set
user_can_create_new_customer_sla_p 1
set
user_can_create_new_customer_contact_p 1
set
ticket_name
[
db_string title
"select project_name from im_projects where project_id = :ticket_id"
-default
""
]
set
page_title
[
lang::message::lookup
""
intranet-helpdesk.Ticket_Quote
"Quote for ticket %ticket_name%"
]
set
context
[
list
$page
_title
]
# ----------------------------------------------
# Get everything about the ticket
# ----------------------------------------------
db_1row ticket_info
"
select t.*, p.*,
p.company_id as ticket_customer_id
from im_projects p,
im_tickets t
where p.project_id = t.ticket_id
and p.project_id = :ticket_id
"
# ---------------------------------------------
# The form
# ---------------------------------------------
set
title_label
[
lang::message::lookup
{}
intranet-helpdesk.Name
{
Title
}]
set
title_help
[
lang::message::lookup
{}
intranet-helpdesk.Title_Help
{
Please enter a descriptive name for the new ticket.
}]
set
actions
{}
if
{[
im_permission
$current
_user_id add_tickets_for_customer
]}
{
lappend actions
{
"Edit"
edit
}
}
if
{[
im_permission
$current
_user_id add_tickets_for_customer
]}
{
lappend actions
{
"Delete"
delete
}
}
ad_form
\
-name ticket
\
-cancel_url
$return
_url
\
-action
$action
_url
\
-actions
$actions
\
-has_edit 1
\
-mode
$form
_mode
\
-export
{
next_url return_url
}
\
-form
{
ticket_id:key
{
ticket_name:text
(
text
)
{
label
$title
_label
}
{
html
{
size 50
}}
{
help_text
$title
_help
}
}
{
ticket_nr:text
(
hidden
)
,optional
}
{
start_date:date
(
hidden
)
,optional
}
{
end_date:date
(
hidden
)
,optional
}
}
# ------------------------------------------------------------------
#
# ------------------------------------------------------------------
ad_form -extend -name ticket -on_request
{
# Populate elements from local variables
}
-select_query
{
select t.*,
p.*,
p.parent_id as ticket_sla_id,
p.project_name as ticket_name,
p.project_nr as ticket_nr,
p.company_id as ticket_customer_id
from im_projects p,
im_tickets t
where p.project_id = t.ticket_id and
t.ticket_id = :ticket_id
}
-new_data
{
# Create a new forum topic of type
"Note"
set topic_id
[
db_nextval im_forum_topics_seq
]
db_transaction
{
set ticket_nr
[
db_nextval im_ticket_seq
]
set start_date
[
db_string now
"select now()::date from dual"
]
set end_date
[
db_string now
"select (now()::date)+1 from dual"
]
set start_date_sql
[
template::util::date get_property sql_date
$start
_date
]
set end_date_sql
[
template::util::date get_property sql_timestamp
$end
_date
]
set ticket_id
[
db_string ticket_insert
{}]
db_dml ticket_update
{}
db_dml project_update
{}
# Add the current user to the project
im_biz_object_add_role
$current
_user_id
$ticket
_id
[
im_biz_object_role_project_manager
]
# Start a new workflow case
im_workflow_start_wf -object_id
$ticket
_id -object_type_id
$ticket
_type_id -skip_first_transition_p 1
# Write Audit Trail
im_project_audit
$ticket
_id
# Create a new forum topic of type
"Note"
set topic_type_id
[
im_topic_type_id_task
]
set topic_status_id
[
im_topic_status_id_open
]
set message
""
if
{[
info
exists ticket_note
]}
{
append message
$ticket
_note
}
if
{[
info
exists ticket_description
]}
{
append message
$ticket
_description
}
if
{
""
==
$message
}
{
set message
[
lang::message::lookup
""
intranet-helpdesk.Empty_Forum_Message
"No message specified"
]}
db_dml topic_insert
{
insert into im_forum_topics
(
topic_id, object_id, parent_id,
topic_type_id, topic_status_id, owner_id,
subject, message
)
values
(
:topic_id, :ticket_id, null,
:topic_type_id, :topic_status_id, :current_user_id,
:ticket_name, :message
)
}
# Error handling. Doesn't work yet for some unknown reason
}
on_error
{
ad_return_complaint 1
"<b>Error inserting new ticket</b>:<br> <br>
<pre>
$errmsg
</pre>"
}
}
-edit_data
{
set ticket_nr
[
string
tolower
$ticket
_nr
]
if
{
""
==
$ticket
_nr
}
{
set ticket_nr
[
db_nextval im_ticket_seq
]
}
set start_date_sql
[
template::util::date get_property sql_date
$start
_date
]
set end_date_sql
[
template::util::date get_property sql_timestamp
$end
_date
]
db_dml ticket_update
{}
db_dml project_update
{}
im_dynfield::attribute_store
\
-object_type
"im_ticket"
\
-object_id
$ticket
_id
\
-form_id ticket
# Write Audit Trail
im_project_audit
$ticket
_id
}
-on_submit
{
ns_log Notice
"new: on_submit"
}
-after_submit
{
ad_returnredirect
$return
_url
ad_script_abort
}
-validate
{
{
ticket_name
{
[
string
length
$ticket
_name
]
< 1000
}
"
[
lang::message::lookup
{}
intranet-helpdesk.Ticket_name_too_long
{
Ticket Name too long
(
max 1000 characters
)
.
}]
"
}
}
# ---------------------------------------------------------------
# Ticket Menu
# ---------------------------------------------------------------
# Setup the subnavbar
set
bind_vars
[
ns_set create
]
if
{[
info
exists ticket_id
]}
{
ns_set put
$bind
_vars ticket_id
$ticket
_id
}
if
{
!
[
info
exists ticket_id
]}
{
set ticket_id
""
}
set
ticket_menu_id
[
db_string parent_menu
"select menu_id from im_menus where label='helpdesk'"
-default 0
]
set
sub_navbar
[
im_sub_navbar
\
-components
\
-current_plugin_id
$plugin
_id
\
-base_url
"/intranet-helpdesk/new?ticket_id=
$ticket
_id"
\
-plugin_url
"/intranet-helpdesk/new"
\
$ticket
_menu_id
\
$bind
_vars
""
"pagedesriptionbar"
"helpdesk_summary"
]
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