Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-timesheet2
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
1
Merge Requests
1
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
Commits
d29444d2
Commit
d29444d2
authored
Oct 29, 2021
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixed timesheet home portlet
parent
ac0b7a75
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
intranet-timesheet2-procs.tcl
tcl/intranet-timesheet2-procs.tcl
+11
-12
No files found.
tcl/intranet-timesheet2-procs.tcl
View file @
d29444d2
...
...
@@ -280,12 +280,17 @@ ad_proc -public im_timesheet_home_component {user_id} {
set expected_hours
[
parameter::get -package_id
[
im_package_timesheet2_id
]
-parameter
"TimesheetRedirectNumHoursInDays"
-default 32
]
set available_perc
[
util_memoize
[
list
db_string percent_available
"select availability from im_employees where employee_id =
$user
_id"
-default 100
]
60
]
if
{
""
==
$available
_perc
}
{
set available_perc 100
}
set expected_hours
[
expr
{
$expected
_hours *
$available
_perc / 100
}
]
set expected_hours
[
expr
$expected
_hours *
$available
_perc / 100
]
set hours_html
""
set log_them_now_link
"<a href=/intranet-timesheet2/hours/index>"
set num_hours
[
im_timesheet_hours_sum -user_id
$user
_id -number_days
$num
_days
]
set absences_hours
[
im_timesheet_absences_sum -user_id
$user
_id -number_days
$num
_days
]
set absence_hours
[
im_timesheet_absences_sum -user_id
$user
_id -number_days
$num
_days
]
set absences_hours_message
""
if
{
$absence
_hours > 0
}
{
set absences_hours_message
[
lang::message::lookup
""
intranet-timesheet2.and_absence_hours
"and %absence_hours% hours of absences"
]
}
if
{
$num
_hours == 0
}
{
set message
"<b>
[
_ intranet-timesheet2.lt_You_havent_logged_you
]
</a></b>
\n
"
...
...
@@ -293,17 +298,11 @@ ad_proc -public im_timesheet_home_component {user_id} {
set message
"
[
_ intranet-timesheet2.lt_You_logged_num_hours_
]
"
}
set absences_hours_message
""
if
{
[
expr
{
$num
_hours +
$absences
_hours
}]
<
$expected
_hours &&
$add
_hours
}
{
if
{[
expr
$num
_hours +
$absence
_hours
]
<
$expected
_hours &&
$add
_hours
}
{
if
{
$absences
_hours > 0
}
{
set absences_hours_message
[
lang::message::lookup
""
\
intranet-timesheet2.and_absences_hours
\
"and %absences_hours% hours of absences"
]
}
set default_message
"
You have only logged
%num_hours% hours %absences_hours_message%
in the last
%num_days% days out of %expected_hours%
expected hours.
You have only logged
$num
_hours hours of project work
$absences
_hours_message
in the last
$num
_days days out of
$expected
_hours
expected hours.
"
set message
"<b>
[
lang::message::lookup
""
intranet-timesheet2.You_need_to_log_hours
$default
_message
]
</b>"
...
...
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