Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-timesheet2-tasks
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-tasks
Commits
a880546e
Commit
a880546e
authored
Jan 06, 2007
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- updated for the case of changing the project_type to "Task"
parent
7fd2f037
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
7 deletions
+47
-7
new.tcl
www/new.tcl
+47
-7
No files found.
www/new.tcl
View file @
a880546e
...
...
@@ -65,6 +65,16 @@ if {"display" == $form_mode} {
}
# most used material...
set
default_material_id
[
db_string default_cost_center
"
select material_id
from im_timesheet_tasks_view
group by material_id
order by count(*) DESC
limit 1
"
-default
""
]
set
button_pressed
[
template::form get_action task
]
if
{
"delete"
==
$button
_pressed
}
{
...
...
@@ -74,6 +84,42 @@ if {"delete" == $button_pressed} {
}
# ------------------------------------------------------------------
# Check if converted from a project
# ------------------------------------------------------------------
# ... then no entry in im_timesheet_tasks will be available and
# the select_query below will fail
if
{[
info
exists task_id
]}
{
set project_exists_p
[
db_string project_exists
"
select count(*)
from im_projects
where project_id = :task_id
and not exists (
select task_id
from im_timesheet_tasks
where task_id = :task_id
)
"
]
if
{
$project
_exists_p
}
{
# Create a new task entry
db_dml insert_task
"
insert into im_timesheet_tasks (
task_id, material_id, uom_id
) values (
:task_id, :default_material_id,
[
im_uom_hour
]
)
"
}
}
# ------------------------------------------------------------------
# Build the form
# ------------------------------------------------------------------
...
...
@@ -134,13 +180,7 @@ ad_form -extend -name task -on_request {
"
-default
""
]
# Set default Material to most used Material
set material_id
[
db_string default_cost_center
"
select material_id
from im_timesheet_tasks_view
group by material_id
order by count(*) DESC
limit 1
"
-default
""
]
set material_id
$default
_material_id
}
-select_query
{
...
...
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