Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-timesheet2-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-timesheet2-workflow
Commits
64703ab3
Commit
64703ab3
authored
Jan 05, 2011
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fixed hard-coded workflow key for timesheet approval workflow
on behalf of OneBCG
parent
5dcdf9b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
33 deletions
+31
-33
intranet-timesheet2-workflow-procs.tcl
tcl/intranet-timesheet2-workflow-procs.tcl
+31
-32
new-timesheet-workflow.tcl
www/conf-objects/new-timesheet-workflow.tcl
+0
-1
No files found.
tcl/intranet-timesheet2-workflow-procs.tcl
View file @
64703ab3
...
...
@@ -30,7 +30,7 @@ ad_proc -public im_timesheet_workflow_spawn_update_workflow {
-user_id:required
-start_date:required
-end_date:required
{
-workflow_key
"
timesheet_approval_workflow_wf
"
}
{
-workflow_key
""
}
}
{
Check if there is already a WF running for that project/user/date
and either reset this WF or create a new one if there wasn't one before.
...
...
@@ -63,15 +63,20 @@ ad_proc -public im_timesheet_workflow_spawn_update_workflow {
# ---------------------------------------------------------------
# Create a new Timesheet Confirmation Object if not there
set conf_object_id
[
im_timesheet_conf_object_new
\
-project_id
$project
_id
\
-user_id
$wf
_user_id
\
-start_date
$start
_date
\
-end_date
$end
_date
\
]
set conf_type_id
[
im_timesheet_conf_obj_type_default
]
set conf_status_id
[
im_timesheet_conf_obj_status_active
]
# Mark all hours in the included conf_obj as included
db_dml update_hours
"
set conf_object_id
[
im_timesheet_conf_object_new
\
-project_id
$project
_id
\
-user_id
$wf
_user_id
\
-start_date
$start
_date
\
-end_date
$end
_date
\
-conf_type_id
$conf
_type_id
\
-conf_status_id
$conf
_status_id
\
]
# Mark all hours in the included conf_obj as included
db_dml update_hours
"
update im_hours
set conf_object_id = :conf_object_id
from (
...
...
@@ -91,31 +96,25 @@ ad_proc -public im_timesheet_workflow_spawn_update_workflow {
im_hours.day = h.day and
im_hours.user_id = h.user_id and
im_hours.project_id = h.project_id
"
set
ttt
{
switch
[
llength
$conf
_object_ids
]
{
0
{
append result_html
"<li>No previous confirmation object found - Creating new confirmation object.
\n
"
}
1
{
set conf_object_id
[
lindex
$conf
_object_ids 0
]
append result_html
"<li>Confirmation object already exists: #
$conf
_object_id
\n
"
}
default
{
ad_return_complaint 1
"<b>Internal Error: Too many confirmation objects</b>:
We have found more the one confirmation object (
$conf
_object_ids)
for the given project_id=
$project
_id, user_id=
$user
_id and start_date=
$start
_date.
Please inform your System Administrator.
"
ad_script_abort
}
}
}
"
# ---------------------------------------------------------------
# Check if the WF-Key is valid
# Determine workflow key from im_category.aux_string1 and
# check if the WF-Key is valid.
if
{
""
==
$workflow
_key
}
{
set workflow_key
[
db_string conf_object_wf_key
"
select aux_string1
from im_categories
where category_id = :conf_type_id
"
]
}
if
{
""
==
$workflow
_key
}
{
# Fallback to factory provided default approval WF
set workflow_key
"timesheet_approval_wf"
}
set wf_valid_p
[
db_string wf_valid_check
"
select count(*)
...
...
www/conf-objects/new-timesheet-workflow.tcl
View file @
64703ab3
...
...
@@ -90,7 +90,6 @@ foreach project_id $project_list {
-user_id
$wf
_user_id
\
-start_date
$start
_date
\
-end_date
$end
_date
\
-workflow_key
"timesheet_approval_wf"
\
]
append li_html
"<ul>
\n
$debug
_html
\n
</ul>
\n
"
...
...
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