Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-workflow
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-workflow
Commits
9c100d94
Commit
9c100d94
authored
Oct 20, 2020
by
cosine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Added extra_where, extra_select and extra_from facilities
parent
3d3b00cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
37 deletions
+66
-37
intranet-workflow-procs.tcl
tcl/intranet-workflow-procs.tcl
+66
-37
No files found.
tcl/intranet-workflow-procs.tcl
View file @
9c100d94
...
...
@@ -1167,18 +1167,31 @@ ad_proc -public im_workflow_home_inbox_component {
column_name,
column_render_tcl,
visible_for,
extra_select,
extra_from,
extra_where,
(order_by_clause is not null) as order_by_clause_exists_p
from im_view_columns
where view_id = :view_id
order by sort_order, column_id
"
set column_vars
[
list
]
set extra_selects
[
list
]
set extra_froms
[
list
]
set extra_wheres
[
list
]
set colspan 1
set table_header_html
"<tr class=
\"
list-header
\"
>
\n
"
db_foreach column_list_sql
$column
_sql
{
if
{
""
==
$visible
_for ||
[
eval
$visible
_for
]}
{
lappend column_vars
"
$column
_render_tcl"
if
{
""
ne
$extra
_select
}
{
lappend extra_selects
[
eval
"set a
\"
$extra
_select
\"
"
]
}
if
{
""
ne
$extra
_from
}
{
lappend extra_froms
$extra
_from
}
if
{
""
ne
$extra
_where
}
{
lappend extra_wheres
$extra
_where
}
if
{
""
ne
$order
_by_clause &&
$order
_by ==
$column
_name
}
{
set view_order_by_clause
$order
_by_clause
}
# Only localize reasonable columns
if
{[
regexp
{
^
[
a-zA-Z0-9_
]
+$
}
$column
_name
]}
{
regsub -all
" "
$column
_name
"_"
col_key
...
...
@@ -1203,46 +1216,62 @@ ad_proc -public im_workflow_home_inbox_component {
# ---------------------------------------------------------------
# SQL Query
set where_clause
[
join
$extra
_wheres
" and
\n
"
]
if
{
$where
_clause ne
""
}
{
set where_clause
" and
$where
_clause"
}
set extra_select
[
join
$extra
_selects
",
\n\t
"
]
if
{
$extra
_select ne
""
}
{
set extra_select
",
\n\t
$extra
_select"
}
set extra_from
[
join
$extra
_froms
",
\n\t
"
]
if
{
$extra
_from ne
""
}
{
set extra_from
",
\n\t
$extra
_from"
}
set extra_where
[
join
$extra
_wheres
"and
\n\t
"
]
if
{
$extra
_where ne
""
}
{
set extra_where
",
\n\t
$extra
_where"
}
# Get the list of all
"open"
(
=enabled or started
)
tasks with their assigned users
set tasks_sql
"
select *
from (
select
ot.pretty_name as object_type_pretty,
o.object_id,
o.creation_user as owner_id,
o.creation_date,
im_name_from_user_id(o.creation_user) as owner_name,
acs_object__name(o.object_id) as object_name,
im_biz_object__get_type_id(o.object_id) as type_id,
im_biz_object__get_status_id(o.object_id) as status_id,
ca.workflow_key,
wft.pretty_name as workflow_name,
tr.transition_name,
tr.transition_key,
t.holding_user,
t.task_id,
im_workflow_task_assignee_names(t.task_id) as assignees_pretty
from
acs_object_types ot,
acs_objects o,
wf_cases ca,
wf_transitions tr,
wf_tasks t,
acs_object_types wft
select t.*
from (
select
ot.pretty_name as object_type_pretty,
o.object_id,
o.creation_user as owner_id,
o.creation_date,
im_name_from_user_id(o.creation_user) as owner_name,
acs_object__name(o.object_id) as object_name,
im_biz_object__get_type_id(o.object_id) as type_id,
im_biz_object__get_status_id(o.object_id) as status_id,
ca.workflow_key,
wft.pretty_name as workflow_name,
tr.transition_name,
tr.transition_key,
t.holding_user,
t.task_id,
im_workflow_task_assignee_names(t.task_id) as assignees_pretty
$extra
_select
from
acs_object_types ot,
acs_objects o,
wf_cases ca,
wf_transitions tr,
wf_tasks t,
acs_object_types wft
$extra
_from
where
ot.object_type = o.object_type
and o.object_id = ca.object_id
and ca.case_id = t.case_id
and t.state in ('enabled', 'started')
and t.transition_key = tr.transition_key
and t.workflow_key = tr.workflow_key
and ca.workflow_key = wft.object_type
and (:filter_workflow_key is null OR ca.workflow_key = :filter_workflow_key)
and (:filter_object_type is null OR o.object_type = :filter_object_type)
$extra
_where
) t
where
ot.object_type = o.object_type
and o.object_id = ca.object_id
and ca.case_id = t.case_id
and t.state in ('enabled', 'started')
and t.transition_key = tr.transition_key
and t.workflow_key = tr.workflow_key
and ca.workflow_key = wft.object_type
and (:filter_workflow_key is null OR ca.workflow_key = :filter_workflow_key)
and (:filter_object_type is null OR o.object_type = :filter_object_type)
) t
where
(:filter_status_id is null OR :filter_status_id = t.status_id)
(:filter_status_id is null OR :filter_status_id = t.status_id)
"
if
{
""
!=
$order
_by_clause
}
{
...
...
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