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
999ab52a
Commit
999ab52a
authored
Nov 25, 2015
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Gustaf changes
parent
89abdddf
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
55 additions
and
55 deletions
+55
-55
intranet-timesheet2-tasks-procs.tcl
tcl/intranet-timesheet2-tasks-procs.tcl
+29
-29
add-dependency.tcl
www/add-dependency.tcl
+1
-1
delete-dependency.tcl
www/delete-dependency.tcl
+3
-3
delete-resource.tcl
www/delete-resource.tcl
+2
-2
index.adp
www/index.adp
+5
-5
index.tcl
www/index.tcl
+3
-3
new.adp
www/new.adp
+5
-5
new.tcl
www/new.tcl
+1
-1
report-timesheet.adp
www/report-timesheet.adp
+2
-2
report-timesheet.tcl
www/report-timesheet.tcl
+1
-1
task-action.tcl
www/task-action.tcl
+1
-1
task-delete.tcl
www/task-delete.tcl
+2
-2
No files found.
tcl/intranet-timesheet2-tasks-procs.tcl
View file @
999ab52a
...
...
@@ -223,7 +223,7 @@ ad_proc -public im_timesheet_task_list_component {
set task_start_idx
[
ns_set get
$form
_vars
"task_start_idx"
]
}
if
{
""
==
$task
_start_idx
}
{
set task_start_idx 0
}
set task_end_idx
[
expr
$task
_start_idx +
$task
_how_many - 1
]
set task_end_idx
[
expr
{
$task
_start_idx +
$task
_how_many - 1
}
]
set bgcolor
(
0
)
" class=roweven"
set bgcolor
(
1
)
" class=rowodd"
...
...
@@ -234,7 +234,7 @@ ad_proc -public im_timesheet_task_list_component {
set current_url
[
im_url_with_query
]
if
{
!
[
info
exists current_page_url
]}
{
set current_page_url
[
ad_conn url
]
}
if
{
!
[
exists_and_not_null return_url
]
}
{
set return_url
$current
_url
}
if
{
(
!
[
info
exists return_url
]
||
$return
_url eq
""
)
}
{
set return_url
$current
_url
}
# Get the
"view"
(
=list of columns to show
)
set view_id
[
im_view_id_from_name
$view
_name
]
...
...
@@ -299,7 +299,7 @@ ad_proc -public im_timesheet_task_list_component {
if
{
$debug
}
{
ns_log Notice
"im_timesheet_task_component:
$var
<-
$value
"
}
}
else
{
set value
[
ns_set get
$form
_vars
$var
]
if
{
!
[
string
equal
""
$value
]
}
{
if
{
$value
ne
""
}
{
ns_set put
$bind
_vars
$var
$value
if
{
$debug
}
{
ns_log Notice
"im_timesheet_task_component:
$var
<-
$value
"
}
}
...
...
@@ -313,7 +313,7 @@ ad_proc -public im_timesheet_task_list_component {
for
{
set
i 0
}
{
$i
<
$len
}
{
incr
i
}
{
set key
[
ns_set key
$bind
_vars
$i
]
set value
[
ns_set value
$bind
_vars
$i
]
if
{
!
[
string
equal
$value
""
]
}
{
if
{
$value
ne
""
}
{
lappend params
"
$key
=
[
ns_urlencode
$value
]
"
}
}
...
...
@@ -322,7 +322,7 @@ ad_proc -public im_timesheet_task_list_component {
# ---------------------- Format Header ----------------------------------
# Set up colspan to be the number of headers + 1 for the # column
set colspan
[
expr
[
llength
$column
_headers
]
+ 1
]
set colspan
[
expr
{[
llength
$column
_headers
]
+ 1
}
]
# Format the header names with links that modify the
# sort order of the SQL query.
...
...
@@ -380,13 +380,13 @@ ad_proc -public im_timesheet_task_list_component {
}
set extra_select
[
join
$extra
_selects
",
\n\t\t
"
]
if
{
!
[
empty_string_p
$extra
_select
]
}
{
set extra_select
",
\n\t
$extra
_select"
}
if
{
$extra
_select ne
""
}
{
set extra_select
",
\n\t
$extra
_select"
}
set extra_from
[
join
$extra
_froms
",
\n\t\t
"
]
if
{
!
[
empty_string_p
$extra
_from
]
}
{
set extra_from
",
\n\t
$extra
_from"
}
if
{
$extra
_from ne
""
}
{
set extra_from
",
\n\t
$extra
_from"
}
set extra_where
[
join
$extra
_wheres
" and
\n\t\t
"
]
if
{
!
[
empty_string_p
$extra
_where
]
}
{
set extra_where
" and
\n\t
$extra
_where"
}
if
{
$extra
_where ne
""
}
{
set extra_where
" and
\n\t
$extra
_where"
}
# ---------------------- Inner Permission Query -------------------------
...
...
@@ -608,7 +608,7 @@ ad_proc -public im_timesheet_task_list_component {
incr skip_first_ctr -1
# Create a link back to the previous page
set prev_task_start_idx
[
expr
$task
_start_idx -
$task
_how_many
]
set prev_task_start_idx
[
expr
{
$task
_start_idx -
$task
_how_many
}
]
if
{
$prev
_task_start_idx < 0
}
{
set
$prev
_task_start_idx 0
}
set prev_page_url
[
export_vars -base
"/intranet-timesheet2-tasks/index"
{
\
task_how_many
\
...
...
@@ -684,7 +684,7 @@ ad_proc -public im_timesheet_task_list_component {
# Table fields for timesheet tasks
set percent_done_input
"<input type=textbox size=3 name=percent_completed.
$task
_id value=
$percent
_completed_rounded>"
set billable_hours_input
"<input type=textbox size=3 name=billable_units.
$task
_id value=
$billable
_units>"
if
{
!
[
empty_string_p
$task
_id
]
}
{
if
{
$task
_id ne
""
}
{
set status_select
[
im_category_select
{
Intranet Project Status
}
task_status_id.$task_id
$task
_status_id
]
}
else
{
set status_select
""
...
...
@@ -736,7 +736,7 @@ ad_proc -public im_timesheet_task_list_component {
# We've got a task.
# Write out a line with task information
append table_body_html
"<tr
$bgcolor
(
[
expr
$ctr
% 2
]
)>
\n
"
append table_body_html
"<tr
$bgcolor
(
[
expr
{
$ctr
% 2
}
]
)>
\n
"
foreach column_var
$column
_vars
{
append table_body_html
"
\t
<td valign=top>"
set cmd
"append table_body_html
$column
_var"
...
...
@@ -749,7 +749,7 @@ ad_proc -public im_timesheet_task_list_component {
incr ctr
if
{
$task
_how_many > 0 &&
$ctr
>=
$task
_how_many
}
{
set next_task_start_idx
[
expr
$task
_start_idx +
$task
_how_many
]
set next_task_start_idx
[
expr
{
$task
_start_idx +
$task
_how_many
}
]
set next_page_url
[
export_vars -base
"/intranet-timesheet2-tasks/index"
{
\
task_how_many
\
view_name
\
...
...
@@ -771,7 +771,7 @@ ad_proc -public im_timesheet_task_list_component {
# ----------------------------------------------------
# Show a reasonable message when there are no result rows:
#
if
{
[
empty_string_p
$table
_body_html
]
&&
""
==
$prev
_page_url &&
""
==
$next
_page_url
}
{
if
{
$table
_body_html eq
""
&&
""
==
$prev
_page_url &&
""
==
$next
_page_url
}
{
set new_task_url
[
export_vars -base
"/intranet-timesheet2-tasks/new"
{{
project_id
$restrict
_to_project_id
}
{
return_url
$current
_url
}}]
set table_body_html
"
<tr class=table_list_page_plain>
...
...
@@ -831,8 +831,8 @@ ad_proc -public im_timesheet_task_list_component {
</tr>
"
set task_start_idx_pretty
[
expr
$task
_start_idx+1
]
set task_end_idx_pretty
[
expr
$task
_end_idx+1
]
set task_start_idx_pretty
[
expr
{
$task
_start_idx+1
}
]
set task_end_idx_pretty
[
expr
{
$task
_end_idx+1
}
]
set next_prev_html
"
$prev
_page_html
...
...
@@ -934,7 +934,7 @@ ad_proc -public im_timesheet_task_info_component {
project_nr
{
label
"
[
_ intranet-timesheet2-tasks.Task_Nr
]
"
link_url_eval
{
[
return
"/intranet-timesheet2-tasks/new?
[
export_vars -url -override
{{
task_id
$id
}}
{
return_url project_id
}
]
"
]
[
return
[
export_vars -base /intranet-timesheet2-tasks/new -override
{{
task_id
$id
}}
{
return_url project_id
}
]
]
}
}
dependency_type
{
...
...
@@ -1021,7 +1021,7 @@ ad_proc -public im_timesheet_task_members_component {
percentage
{
label
"
[
_ intranet-core.Percentage
]
"
link_url_eval
{
[
return
"/intranet-timesheet2-tasks/edit-resource?
[
export_vars -url
{
return_url rel_id
}]
"
]
[
return
[
export_vars -base /intranet-timesheet2-tasks/edit-resource
{
return_url rel_id
}]
]
}
}
}
\
...
...
@@ -1109,9 +1109,9 @@ ad_proc im_timesheet_project_advance {
# Multiply units with 8.0 if UoM =
"Day"
.
# We need this in order to deal with
"mixed"
hour/day projects
if
{
$task
_uom_id ==
[
im_uom_day
]}
{
set planned_units
[
expr
$planned
_units *
$hours
_per_day
]
set billable_units
[
expr
$billable
_units *
$hours
_per_day
]
set advanced_units
[
expr
$advanced
_units *
$hours
_per_day
]
set planned_units
[
expr
{
$planned
_units *
$hours
_per_day
}
]
set billable_units
[
expr
{
$billable
_units *
$hours
_per_day
}
]
set advanced_units
[
expr
{
$advanced
_units *
$hours
_per_day
}
]
}
# Deal with translation projects.
...
...
@@ -1121,9 +1121,9 @@ ad_proc im_timesheet_project_advance {
if
{
""
!=
$trans
_project_hours ||
""
!=
$trans
_project_words
}
{
if
{
""
==
$trans
_project_hours
}
{
set trans_project_hours 0.0
}
if
{
""
==
$trans
_project_words
}
{
set trans_project_words 0.0
}
set planned_units
[
expr
$trans
_project_hours +
$trans
_project_words /
$translation
_words_per_hour
]
set planned_units
[
expr
{
$trans
_project_hours +
$trans
_project_words /
$translation
_words_per_hour
}
]
set billable_units
$planned
_units
set advanced_units
[
expr
$planned
_units *
$percent
_completed / 100.0
]
set advanced_units
[
expr
{
$planned
_units *
$percent
_completed / 100.0
}
]
}
}
...
...
@@ -1175,9 +1175,9 @@ ad_proc im_timesheet_project_advance {
if
{[
info
exists billable_sum_hash
(
$parent
_id
)]}
{
set billable_sum
$billable
_sum_hash
(
$parent
_id
)
}
if
{[
info
exists advanced_sum_hash
(
$parent
_id
)]}
{
set advanced_sum
$advanced
_sum_hash
(
$parent
_id
)
}
set planned_sum
[
expr
$planned
_sum +
$pid
_planned
]
set billable_sum
[
expr
$billable
_sum +
$pid
_billable
]
set advanced_sum
[
expr
$advanced
_sum +
$pid
_advanced
]
set planned_sum
[
expr
{
$planned
_sum +
$pid
_planned
}
]
set billable_sum
[
expr
{
$billable
_sum +
$pid
_billable
}
]
set advanced_sum
[
expr
{
$advanced
_sum +
$pid
_advanced
}
]
set planned_sum_hash
(
$parent
_id
)
$planned
_sum
set advanced_sum_hash
(
$parent
_id
)
$advanced
_sum
...
...
@@ -1251,13 +1251,13 @@ ad_proc -public im_timesheet_next_task_nr {
# Adjust the position of the start of date and nr in the invoice_nr
set date_format_len
[
string
length
$date
_format
]
set nr_start_idx
[
expr
1+$date_format_len
]
set nr_start_idx
[
expr
{
1+$date_format_len
}
]
set date_start_idx 1
set num_check_sql
""
set zeros
""
for
{
set
i 0
}
{
$i
<
$nr
_digits
}
{
incr
i
}
{
set digit_idx
[
expr
1 +
$i
]
set digit_idx
[
expr
{
1 +
$i
}
]
append num_check_sql
"
and ascii(substr(p.nr,
$digit
_idx,1)) > 47
and ascii(substr(p.nr,
$digit
_idx,1)) < 58
...
...
@@ -1279,8 +1279,8 @@ ad_proc -public im_timesheet_next_task_nr {
set last_project_nr
[
db_string max_project_nr
$sql
-default
$zeros
]
set last_project_nr
[
string
trimleft
$last
_project_nr
"0"
]
if
{
[
empty_string_p
$last
_project_nr
]
}
{
set last_project_nr 0
}
set next_number
[
expr
$last
_project_nr + 1
]
if
{
$last
_project_nr eq
""
}
{
set last_project_nr 0
}
set next_number
[
expr
{
$last
_project_nr + 1
}
]
# ----------------------------------------------------
# Put together the new project_nr
...
...
www/add-dependency.tcl
View file @
999ab52a
...
...
@@ -6,7 +6,7 @@ ad_page_contract {
return_url
}
set
current_user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
current_user_id
[
a
uth::require_logi
n
]
im_timesheet_task_permissions
$current
_user_id
$task
_id view read write admin
if
{
!$write
}
{
ad_return_complaint 1
"You don't have sufficient permissions to perform this operation"
...
...
www/delete-dependency.tcl
View file @
999ab52a
...
...
@@ -7,7 +7,7 @@ ad_page_contract {
return_url
}
set
current_user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
current_user_id
[
a
uth::require_logi
n
]
im_timesheet_task_permissions
$current
_user_id
$task
_id view read write admin
if
{
!$write
}
{
ad_return_complaint 1
"You don't have sufficient permissions to perform this operation"
...
...
@@ -15,11 +15,11 @@ if {!$write} {
}
if
{
$task
_id_one
!=
""
}
{
if
{
$task
_id_one
ne
""
}
{
foreach i
$task
_id_one
{
db_dml delete_dependency1
"delete from im_timesheet_task_dependencies where task_id_one=:i and task_id_two=:task_id"
}
}
else
if
{
$task
_id_two
!=
""
}
{
}
else
if
{
$task
_id_two
ne
""
}
{
foreach i
$task
_id_two
{
db_dml delete_dependency2
"delete from im_timesheet_task_dependencies where task_id_one=:task_id and task_id_two=:i"
}
...
...
www/delete-resource.tcl
View file @
999ab52a
...
...
@@ -7,7 +7,7 @@ ad_page_contract {
}
set
current_user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
current_user_id
[
a
uth::require_logi
n
]
im_timesheet_task_permissions
$current
_user_id
$task
_id view read write admin
if
{
!$write
}
{
ad_return_complaint 1
"You don't have sufficient permissions to perform this operation"
...
...
@@ -21,7 +21,7 @@ if {$sub_list_len > 1} {
}
if
{
$user
_id
!=
""
}
{
if
{
$user
_id
ne
""
}
{
foreach i
$user
_id
{
db_string delete_resource
"select im_biz_object_member__delete (:task_id, :i);"
}
...
...
www/index.adp
View file @
999ab52a
...
...
@@ -3,12 +3,12 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<master src="../../intranet-core/www/master">
<property name="
title">@page_title
@</property>
<property name="context">@context_bar@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="context">@context_bar
;literal
@</property>
<property name="main_navbar_label">projects</property>
<property name="sub_navbar">@sub_navbar;
noquote
@</property>
<property name="left_navbar">@left_navbar;
noquote
@</property>
<property name="show_context_help_p">@show_context_help_p;
noquote
@</property>
<property name="sub_navbar">@sub_navbar;
literal
@</property>
<property name="left_navbar">@left_navbar;
literal
@</property>
<property name="show_context_help_p">@show_context_help_p;
literal
@</property>
@task_content;noquote@
www/index.tcl
View file @
999ab52a
...
...
@@ -32,7 +32,7 @@ ad_page_contract {
set
show_context_help_p 1
# User id already verified by filters
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
set
current_user_id
$user
_id
set
page_focus
"im_header_form.keywords"
set
user_admin_p
[
im_is_user_site_wide_or_intranet_admin
$current
_user_id
]
...
...
@@ -62,7 +62,7 @@ set current_url [ns_conn url]
set
company_view_page
"/intranet/companies/view"
if
{
[
empty_string_p
$task
_how_many
]
||
$task
_how_many < 1
}
{
if
{
$task
_how_many eq
""
||
$task
_how_many < 1
}
{
set task_how_many
[
im_parameter -package_id
[
im_package_core_id
]
NumberResultsPerPage
""
50
]
}
...
...
@@ -71,7 +71,7 @@ if { [empty_string_p $task_how_many] || $task_how_many < 1 } {
# Admin Links
# ---------------------------------------------------------------
set
admin_links
"<li><a href=
\"
new?
[
export_vars -url
{
project_id return_url
}]
\"
>
[
_ intranet-timesheet2-tasks.New_Timesheet_Task
]
</a>
\n
"
set
admin_links
"<li><a href=
\"
[
export_vars -base new
{
project_id return_url
}]
\"
>
[
_ intranet-timesheet2-tasks.New_Timesheet_Task
]
</a>
\n
"
append
admin_links
[
im_menu_ul_list -no_uls 1
"timesheet_tasks"
{}]
...
...
www/new.adp
View file @
999ab52a
<master src="../../intranet-core/www/master">
<property name="
title">@page_title
@</property>
<property name="context">@context;
noquote
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="context">@context;
literal
@</property>
<property name="main_navbar_label">projects</property>
<property name="focus">@focus;
noquote
@</property>
<property name="sub_navbar">@sub_navbar;
noquote
@</property>
<property name="focus">@focus;
literal
@</property>
<property name="sub_navbar">@sub_navbar;
literal
@</property>
<if @message@ not nil>
...
...
@@ -33,7 +33,7 @@
</tr>
<tr>
<td colspan=
2
>
<td colspan=
"2"
>
<%= [im_component_bay bottom] %>
</td>
</tr>
...
...
www/new.tcl
View file @
999ab52a
...
...
@@ -35,7 +35,7 @@ if {[info exists task_id]} {
}
set
user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
user_id
[
a
uth::require_logi
n
]
set
action_url
"/intranet-timesheet2-tasks/new"
set
focus
"task.var_name"
set
page_title
[
_ intranet-timesheet2-tasks.New_Timesheet_Task
]
...
...
www/report-timesheet.adp
View file @
999ab52a
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<master
src=
"../../intranet-core/www/master"
>
<property
name=
"
title"
>
@page_title
@
</property>
<property
name=
"context"
>
@context_bar@
</property>
<property
name=
"
doc(title)"
>
@page_title;literal
@
</property>
<property
name=
"context"
>
@context_bar
;literal
@
</property>
<property
name=
"main_navbar_label"
>
projects
</property>
...
...
www/report-timesheet.tcl
View file @
999ab52a
...
...
@@ -22,7 +22,7 @@ ad_page_contract {
# Defaults & Security
# ---------------------------------------------------------------
set
current_user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
current_user_id
[
a
uth::require_logi
n
]
set
page_focus
"im_header_form.keywords"
set
package_name
"intranet-reporting"
...
...
www/task-action.tcl
View file @
999ab52a
...
...
@@ -35,7 +35,7 @@ ad_page_contract {
# ---------------------------------------------------------------------
set
org_project_id
$project
_id
set
current_user_id
[
a
d_maybe_redirect_for_registratio
n
]
set
current_user_id
[
a
uth::require_logi
n
]
set
all_task_list
[
array
names task_id
]
# Append dummy task in case the list is empty
lappend
all_task_list 0
...
...
www/task-delete.tcl
View file @
999ab52a
...
...
@@ -103,7 +103,7 @@ foreach old_id $task_id {
and day::date = :old_day::date
"
set hours
[
expr
$old
_hours +
$new
_hours
]
set hours
[
expr
{
$old
_hours +
$new
_hours
}
]
set note
[
string
trim
[
join
[
list
$old
_note
$new
_note
]
" "
]]
# Insert a new im_hours entry with the summed up hours
...
...
@@ -169,7 +169,7 @@ foreach i $tmp {
set task_id
(
$i
)
$i
}
set
vars
[
export_vars
-url
{
task_id:array project_id return_url
}]
set
vars
[
export_vars
{
task_id:array project_id return_url
}]
ad_returnredirect
"/intranet-timesheet2-tasks/task-action?action=delete&
$vars
"
...
...
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