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
11b4c963
Commit
11b4c963
authored
Mar 26, 2024
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cosine #5807: Admins are not requested to log hours anymore if they are not member of Employees
parent
5a2bca1c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
intranet-timesheet2-procs.tcl
tcl/intranet-timesheet2-procs.tcl
+7
-2
No files found.
tcl/intranet-timesheet2-procs.tcl
View file @
11b4c963
...
...
@@ -283,6 +283,11 @@ ad_proc -public im_timesheet_home_component {user_id} {
if
{
!$add_hours && !$add_absences && !$view_hours_all
}
{
return
""
}
set admin_p
[
im_is_user_site_wide_or_intranet_admin
$user
_id
]
# All users need to log hours here, because they got
"add_hours"
privilege.
# However, Admins who are note employees don't need to do that.
# We need to go with group membership here, because admins have all privileges.
set needs_to_add_hours
[
im_user_is_employee_p
$user
_id
]
# Get the number of hours in the number of days, and whether
# we should redirect if the user didn't log them...
#
...
...
@@ -303,13 +308,13 @@ ad_proc -public im_timesheet_home_component {user_id} {
set absences_hours_message
[
lang::message::lookup
""
intranet-timesheet2.and_absence_hours
"and %absence_hours% hours of absences"
]
}
if
{
$num
_hours == 0
}
{
if
{
$num
_hours == 0
&&
$needs
_to_add_hours
}
{
set message
"<b>
[
_ intranet-timesheet2.lt_You_havent_logged_you
]
</a></b>
\n
"
}
else
{
set message
"
[
_ intranet-timesheet2.lt_You_logged_num_hours_
]
"
}
if
{[
expr
$num
_hours +
$absence
_hours
]
<
$expected
_hours &&
$add
_hours
}
{
if
{[
expr
$num
_hours +
$absence
_hours
]
<
$expected
_hours &&
$
needs
_to_
add_hours
}
{
set default_message
"
You have only logged
$num
_hours hours of project work
$absences
_hours_message
...
...
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