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
543ab060
Commit
543ab060
authored
Jan 04, 2007
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- added a function to close editing hours for the last month
parent
50a8709d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
3 deletions
+37
-3
new.tcl
www/hours/new.tcl
+37
-3
No files found.
www/hours/new.tcl
View file @
543ab060
...
...
@@ -69,6 +69,29 @@ set context_bar [im_context_bar [list index "[_ intranet-timesheet2.Hours]"] "[_
set
permissive_logging
[
parameter::get_from_package_key -package_key intranet-timesheet2 -parameter PermissiveHourLogging -default
"permissive"
]
# ---------------------------------------------------------
# Logic to check if the user is allowed to log hours
# ---------------------------------------------------------
set
edit_hours_p
"t"
# When should we consider the last month to be closed?
set
last_month_closing_day
[
parameter::get_from_package_key -package_key intranet-timesheet2 -parameter TimesheetLastMonthClosingDay -default 0
]
if
{
0 !=
$last
_month_closing_day &&
""
!=
$last
_month_closing_day
}
{
# Check that
$julian
_date is before the Nth of the next month:
# Select the 1st day of the last month:
set first_of_last_month
[
db_string last_month
"
select to_char(now()::date - :last_month_closing_day::integer + '0 Month'::interval, 'YYYY-MM-01')
"
]
set edit_hours_p
[
db_string e
"select to_date(:julian_date, 'J') > :first_of_last_month::date"
]
}
# ---------------------------------------------------------
# Check for registered hours
# ---------------------------------------------------------
...
...
@@ -370,15 +393,26 @@ db_foreach hours_timesheet $sql {
<td>
$child
_tree_sortkey</td>
<td>
$parent
_project_nr</td>
\n
"
}
append results
"
if
{
"t"
==
$edit
_hours_p
}
{
append results
"
<td><nobr>
$indent
<A href=
\"
$project
_url
\"
>
$project
_nr -
$project
_name</A></nobr></td>
<td><INPUT NAME=hours.
$project
_id size=5 MAXLENGTH=5 value=
\"
$hours
\"
>
$p
_hours</td>
<td>
<INPUT NAME=notes.
$project
_id size=60 value=
\"
[
ns_quotehtml
[
value_if_exists note
]]
\"
>
$p
_notes
</td>
</tr>
"
"
}
else
{
if
{
""
==
$hours
}
{
set hours
"-"
}
append results
"
<td><nobr>
$indent
<A href=
\"
$project
_url
\"
>
$project
_nr -
$project
_name</A></nobr></td>
<td align=right>
$hours
</td>
<td>
[
value_if_exists note
]
$p
_notes</td>
"
}
append results
"</tr>
\n
"
incr ctr
}
...
...
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