OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
make start and end time required conditionally
Klaus Zanders1da8ba51966f
diff --git a/modules/costs/app/components/time_entries/days_and_hours_form.rb b/modules/costs/app/components/time_entries/days_and_hours_form.rbindex c4a42b78832..cd0c24de2bc 100644--- a/modules/costs/app/components/time_entries/days_and_hours_form.rb+++ b/modules/costs/app/components/time_entries/days_and_hours_form.rb@@ -44,7 +44,7 @@ module TimeEntriesf.group(layout: :horizontal) do |g|g.text_field name: :start_time,type: "time",- required: true,+ required: start_and_end_time_required?,label: TimeEntry.human_attribute_name(:start_time),value: model.start_timestamp&.strftime("%H:%M"),data: {@@ -54,7 +54,7 @@ module TimeEntriesg.text_field name: :end_time,type: "time",- required: true,+ required: start_and_end_time_required?,label: TimeEntry.human_attribute_name(:end_time),value: model.end_timestamp&.strftime("%H:%M"),data: {@@ -78,6 +78,10 @@ module TimeEntriesTimeEntry.can_track_start_and_end_time?end+ def start_and_end_time_required?+ TimeEntry.must_track_start_and_end_time?+ end+def hours_valueif model.hours.present?ChronicDuration.output(model.hours * 3600, format: :hours_only)