Commit 632211d4 authored by Frank Bergmann's avatar Frank Bergmann

- Beautified timesheet entry in case of very long task/ticket

  names, added two new parameters
parent c5d610fe
......@@ -67,6 +67,11 @@
<parameter datatype="string" min_n_values="1" max_n_values="1" name="AbsenceDefaultDurationUnit" default="days" description="How should users enter absence duration by default? Options are 'days' or 'hours'. The days are multiplied with 8.0 in order to get hours. Default is 'days'."/>
<parameter scope="instance" datatype="number" min_n_values="1" max_n_values="1" name="TimesheetNoteTextareaRows" default="1" description="Should we show a textarea instead of a textbox field? '0' means standard text input. '1' means showing a textarea with 1 row, which is similar to a textbox, but allows resizing. Values > 1 will show bigger textareas. Default is '1' for showing a (resizable) textarea with 1 row."/>
<parameter scope="instance" datatype="string" min_n_values="1" max_n_values="1" name="TimesheetRedirectPackageUrl" default="" description="Use a custom implementation of intranet-timesheet2? Default is '' (empty string), in order to use the standard implementation. A value of '/intranet-cust-custname/timesheet' (no trailing slash '/'!) would redirect to a custom implementation in ~/packages/intranet-cust-custname/www/timesheet/."/>
<parameter scope="instance" datatype="number" min_n_values="1" max_n_values="1" name="TimesheetProjectNameMaxLength" default="50" description="Should we cut down the name of a task or ticket in the timesheet entry page to a maximum size? Default is 50, 0 disables this feature."/>
<parameter scope="instance" datatype="number" min_n_values="1" max_n_values="1" name="TimesheetProjectNrMaxLength" default="12" description="Should we cut down the nr (short name) of a task or ticket in the timesheet entry page to a maximum size? Default is 12, 0 disables this feature."/>
</parameters>
</version>
......
......@@ -292,6 +292,10 @@ set log_hours_on_future_project_p [parameter::get_from_package_key -package_key
set list_sort_order [parameter::get_from_package_key -package_key "intranet-timesheet2" -parameter TimesheetAddHoursSortOrder -default "order"]
set show_project_nr_p [parameter::get_from_package_key -package_key "intranet-timesheet2" -parameter ShowProjectNrAndProjectNameP -default 0]
set show_company_p [parameter::get_from_package_key -package_key "intranet-timesheet2" -parameter ShowProjectNameAndCompanyNameP -default 0]
set project_name_max_length [parameter::get_from_package_key -package_key "intranet-timesheet2" -parameter TimesheetProjectNameMaxLength -default 50]
set project_nr_max_length [parameter::get_from_package_key -package_key "intranet-timesheet2" -parameter TimesheetProjectNrMaxLength -default 12]
# Should we allow users to log hours on a parent project, even though it has children?
set log_hours_on_parent_with_children_p [parameter::get_from_package_key -package_key "intranet-timesheet2" -parameter LogHoursOnParentWithChildrenP -default 1]
......@@ -1137,9 +1141,23 @@ template::multirow foreach hours_multirow {
# Set project title & URL
set project_url [export_vars -base "/intranet/projects/view?" {project_id return_url}]
set ptitle $project_name
if {$show_project_nr_p} { set ptitle "$project_nr - $project_name" }
if {$show_company_p} { set ptitle "$project_name <b>($company_name)</b>" }
# Cut down the name of the task/ticket
set pname $project_name
if {$project_name_max_length != 0} {
set pname [string range $project_name 0 $project_name_max_length]
if {$pname ne $project_name} { append pname "..." }
}
set pnr $project_nr
if {$project_nr_max_length != 0} {
set pnr [string range $project_nr 0 $project_nr_max_length]
if {$pnr ne $project_nr} { append pnr "..." }
}
set ptitle $pname
if {$show_project_nr_p} { set ptitle "$pnr - $pname" }
if {$show_company_p} { set ptitle "$pname <b>($company_name)</b>" }
if { !$filter_surpress_output_p } {
if { !$top_parent_shown_p && $project_id != $top_project_id && "" != $search_task } {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment