From bbe840cd8bb72a4f854137948493784b3c4c2a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Van=C3=AD=C4=8Dek?= Date: Thu, 23 Mar 2023 12:49:36 +0100 Subject: [PATCH] Squashed 'plugins/redmine_hourglass/' content from commit ec937a4 git-subtree-dir: plugins/redmine_hourglass git-subtree-split: ec937a4ed4717e358207dd3857fac248b9e625e9 --- .devcontainer/postgres/Dockerfile | 12 + .devcontainer/postgres/Gemfile.local | 14 + .devcontainer/postgres/database.yml | 16 + .devcontainer/postgres/devcontainer.json | 58 + .devcontainer/postgres/docker-compose.yml | 42 + .devcontainer/postgres/post-create.sh | 27 + .devcontainer/postgres/redmine5_i18n.patch | 13 + .gitattributes | 10 + .github/data/mysql2_database.yml | 7 + .github/data/postgresql_database.yml | 7 + .github/data/sqlite3_database.yml | 3 + .github/workflows/main.yml | 75 + .gitignore | 11 + .rubocop.yml | 5 + CHANGELOG.md | 125 + CODE_OF_CONDUCT.md | 74 + CONTRIBUTING.md | 39 + COPYRIGHT.txt | 19 + Dockerfile | 5 + GPL.txt | 339 + Gemfile | 45 + README.md | 150 + app/assets/images/icons/arrow_join.png | Bin 0 -> 626 bytes app/assets/images/icons/time_continue.png | Bin 0 -> 2762 bytes app/assets/images/icons/time_start.png | Bin 0 -> 774 bytes app/assets/images/icons/time_stop.png | Bin 0 -> 885 bytes app/assets/javascripts/application.coffee | 6 + app/assets/javascripts/forms.coffee | 189 + app/assets/javascripts/global.coffee | 4 + app/assets/javascripts/jqplot.coffee | 42 + app/assets/javascripts/lists.coffee | 153 + .../javascripts/redmine_integrations.coffee | 145 + app/assets/javascripts/timeFields.coffee | 12 + .../javascripts/time_tracker_form.coffee | 96 + app/assets/javascripts/timer.coffee | 30 + app/assets/javascripts/utils.coffee | 55 + app/assets/javascripts/validators.coffee | 82 + app/assets/stylesheets/application.scss | 252 + app/assets/stylesheets/global.scss | 48 + .../concerns/authorization_concern.rb | 30 + app/controllers/concerns/boolean_parsing.rb | 15 + .../concerns/hourglass_ui/overview.rb | 34 + .../concerns/hourglass_ui/time_bookings.rb | 39 + .../concerns/hourglass_ui/time_logs.rb | 36 + .../concerns/hourglass_ui/time_trackers.rb | 22 + app/controllers/concerns/list_concern.rb | 50 + app/controllers/concerns/query_concern.rb | 72 + app/controllers/concerns/sort_concern.rb | 11 + .../hourglass/api_base_controller.rb | 156 + .../hourglass/time_bookings_controller.rb | 82 + .../hourglass/time_logs_controller.rb | 137 + .../hourglass/time_trackers_controller.rb | 124 + .../hourglass_completion_controller.rb | 49 + .../hourglass_import_controller.rb | 13 + .../hourglass_projects_controller.rb | 24 + .../hourglass_queries_controller.rb | 82 + app/controllers/hourglass_ui_controller.rb | 41 + app/helpers/hourglass/application_helper.rb | 80 + app/helpers/hourglass/chart_helper.rb | 59 + app/helpers/hourglass/list_helper.rb | 110 + app/helpers/hourglass/report_helper.rb | 54 + app/helpers/hourglass/ui_helper.rb | 64 + app/models/concerns/hourglass/namespace.rb | 7 + .../hourglass/project_issue_syncing.rb | 11 + app/models/concerns/hourglass/query_base.rb | 222 + app/models/concerns/hourglass/type_parsing.rb | 23 + app/models/hourglass/application_record.rb | 25 + app/models/hourglass/chart_query.rb | 24 + app/models/hourglass/global_settings.rb | 77 + app/models/hourglass/project_settings.rb | 72 + app/models/hourglass/time_booking.rb | 88 + app/models/hourglass/time_booking_query.rb | 109 + app/models/hourglass/time_log.rb | 138 + app/models/hourglass/time_log_query.rb | 75 + app/models/hourglass/time_tracker.rb | 98 + app/models/hourglass/time_tracker_query.rb | 77 + .../concerns/redmine_authorization.rb | 40 + app/policies/hourglass/application_policy.rb | 56 + app/policies/hourglass/time_booking_policy.rb | 4 + app/policies/hourglass/time_log_policy.rb | 26 + app/policies/hourglass/time_tracker_policy.rb | 31 + app/policies/hourglass/ui_policy.rb | 12 + app/views/hooks/_account_menu_link.slim | 8 + app/views/hooks/_issue_actions.slim | 11 + app/views/hooks/_issue_context_actions.slim | 1 + app/views/hooks/_javascript_setup.slim | 8 + app/views/hooks/_user_preferences.slim | 4 + .../_activity_dialog_content.slim | 4 + .../time_tracker/_start_dialog_content.slim | 18 + app/views/hooks/time_tracker/_start_link.slim | 4 + app/views/hooks/time_tracker/_stop_link.slim | 3 + .../_hourglass_settings.slim | 37 + .../_label_with_global_value_tag.slim | 4 + app/views/hourglass_projects/settings.js.slim | 2 + app/views/hourglass_queries/edit.slim | 6 + app/views/hourglass_queries/new.slim | 7 + app/views/hourglass_ui/_flash_array.slim | 3 + .../hourglass_ui/_time_tracker_control.slim | 41 + app/views/hourglass_ui/api_docs.slim | 45 + .../hourglass_ui/forms/fields/_activity.slim | 5 + .../hourglass_ui/forms/fields/_comments.slim | 5 + .../hourglass_ui/forms/fields/_duration.slim | 5 + .../hourglass_ui/forms/fields/_issue.slim | 8 + .../hourglass_ui/forms/fields/_project.slim | 7 + .../hourglass_ui/forms/fields/_start.slim | 1 + .../forms/fields/_start_stop.slim | 12 + .../hourglass_ui/forms/fields/_stop.slim | 1 + .../hourglass_ui/forms/fields/_user_id.slim | 6 + app/views/hourglass_ui/index.slim | 19 + .../hourglass_ui/layouts/_hourglass.slim | 20 + app/views/hourglass_ui/lists/_chart.slim | 11 + app/views/hourglass_ui/lists/_group.slim | 6 + app/views/hourglass_ui/lists/_list.slim | 36 + app/views/hourglass_ui/lists/_list_entry.slim | 7 + app/views/hourglass_ui/lists/_query_form.slim | 34 + app/views/hourglass_ui/query_view.slim | 12 + app/views/hourglass_ui/report.slim | 20 + app/views/hourglass_ui/report/_list.slim | 19 + app/views/hourglass_ui/time_bookings.slim | 12 + .../time_bookings/_list_entry_actions.slim | 14 + .../time_bookings/context_menu.slim | 6 + .../hourglass_ui/time_bookings/edit.slim | 25 + app/views/hourglass_ui/time_bookings/new.slim | 25 + app/views/hourglass_ui/time_logs.slim | 5 + .../time_logs/_list_entry_actions.slim | 6 + app/views/hourglass_ui/time_logs/book.slim | 24 + .../hourglass_ui/time_logs/context_menu.slim | 8 + app/views/hourglass_ui/time_logs/edit.slim | 20 + app/views/hourglass_ui/time_logs/new.slim | 14 + .../time_trackers/_list_entry_actions.slim | 4 + .../time_trackers/context_menu.slim | 4 + .../hourglass_ui/time_trackers/edit.slim | 14 + app/views/settings/_form_errors.slim | 5 + app/views/settings/_redmine_hourglass.slim | 54 + app/views/settings/global_settings.slim | 7 + assets/images/swagger.png | Bin 0 -> 628 bytes assets/javascripts/swagger-ui-bundle.js | 3 + assets/stylesheets/swagger-ui.css | 4 + bin/rails | 6 + bin/rspec | 4 + coffeelint.json | 135 + config/initializers/assets.rb | 15 + config/initializers/autoload.rb | 14 + config/initializers/redmine_integration.rb | 22 + config/initializers/rswag.rb | 18 + config/locales/de.yml | 203 + config/locales/en.yml | 198 + config/locales/pt-BR.yml | 178 + config/locales/ru.yml | 178 + config/routes.rb | 84 + .../1418311263_create_hourglass_time_logs.rb | 12 + ...18311331_create_hourglass_time_bookings.rb | 13 + ...18914331_create_hourglass_time_trackers.rb | 18 + ...hange_hourglass_time_log_comments_limit.rb | 9 + doc/images/DeveloperRights.png | Bin 0 -> 20006 bytes doc/images/ManagerRights.png | Bin 0 -> 20070 bytes doc/images/ProjectModules.png | Bin 0 -> 9314 bytes doc/images/ProjectSettings.png | Bin 0 -> 26895 bytes docker-compose.yml | 31 + init.rb | 98 + lib/hourglass.rb | 17 + lib/hourglass/access_control.rb | 10 + lib/hourglass/assets.rb | 90 + lib/hourglass/date_time_calculations.rb | 116 + lib/hourglass/migration.rb | 4 + lib/hourglass/redmine_hooks.rb | 48 + .../redmine_patches/mirror_assets_patch.rb | 12 + .../redmine_patches/project_patch.rb | 31 + .../redmine_patches/projects_helper_patch.rb | 31 + lib/hourglass/redmine_patches/query_patch.rb | 23 + .../settings_controller_patch.rb | 47 + .../time_entry_activity_patch.rb | 13 + .../redmine_patches/time_entry_patch.rb | 11 + lib/hourglass/redmine_patches/user_patch.rb | 25 + .../redmine_patches/user_preference_patch.rb | 21 + lib/hourglass/redmine_time_tracker_import.rb | 142 + lib/hourglass/settings_storage.rb | 106 + lib/tasks/hourglass.rake | 26 + spec/factories/hourglass_time_bookings.rb | 11 + spec/factories/hourglass_time_logs.rb | 10 + spec/factories/hourglass_time_tracker.rb | 7 + spec/factories/members.rb | 14 + spec/factories/projects.rb | 13 + spec/factories/roles.rb | 5 + spec/factories/time_entries.rb | 11 + spec/factories/time_entry_activities.rb | 5 + spec/factories/users.rb | 23 + spec/faker_patches.rb | 16 + spec/integration/time_bookings_spec.rb | 221 + spec/integration/time_logs_spec.rb | 349 + spec/integration/time_trackers_spec.rb | 273 + spec/lib/date_time_calculations_spec.rb | 84 + spec/lib/settings_storage_spec.rb | 270 + spec/models/time_booking_spec.rb | 46 + spec/models/time_log_spec.rb | 540 + spec/models/time_tracker_spec.rb | 68 + spec/spec_helper.rb | 80 + spec/support/access_rights.rb | 37 + spec/support/model_definitions.yml | 159 + spec/support/responses.rb | 28 + spec/support/time_helpers.rb | 3 + spec/swagger_helper.rb | 40 + swagger/v1/swagger.json | 1522 ++ .../javascripts/jqplot/jqplot.barRenderer.js | 801 ++ .../jqplot/jqplot.categoryAxisRenderer.js | 682 + .../javascripts/jqplot/jqplot.highlighter.js | 465 + .../javascripts/jqplot/jquery.jqplot.js | 11477 ++++++++++++++++ .../stylesheets/jqplot/jquery.jqplot.css | 259 + 208 files changed, 25031 insertions(+) create mode 100644 .devcontainer/postgres/Dockerfile create mode 100644 .devcontainer/postgres/Gemfile.local create mode 100644 .devcontainer/postgres/database.yml create mode 100644 .devcontainer/postgres/devcontainer.json create mode 100644 .devcontainer/postgres/docker-compose.yml create mode 100755 .devcontainer/postgres/post-create.sh create mode 100644 .devcontainer/postgres/redmine5_i18n.patch create mode 100644 .gitattributes create mode 100644 .github/data/mysql2_database.yml create mode 100644 .github/data/postgresql_database.yml create mode 100644 .github/data/sqlite3_database.yml create mode 100644 .github/workflows/main.yml create mode 100644 .gitignore create mode 100644 .rubocop.yml create mode 100644 CHANGELOG.md create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 COPYRIGHT.txt create mode 100644 Dockerfile create mode 100644 GPL.txt create mode 100644 Gemfile create mode 100644 README.md create mode 100644 app/assets/images/icons/arrow_join.png create mode 100644 app/assets/images/icons/time_continue.png create mode 100644 app/assets/images/icons/time_start.png create mode 100644 app/assets/images/icons/time_stop.png create mode 100644 app/assets/javascripts/application.coffee create mode 100644 app/assets/javascripts/forms.coffee create mode 100644 app/assets/javascripts/global.coffee create mode 100644 app/assets/javascripts/jqplot.coffee create mode 100644 app/assets/javascripts/lists.coffee create mode 100644 app/assets/javascripts/redmine_integrations.coffee create mode 100644 app/assets/javascripts/timeFields.coffee create mode 100644 app/assets/javascripts/time_tracker_form.coffee create mode 100644 app/assets/javascripts/timer.coffee create mode 100644 app/assets/javascripts/utils.coffee create mode 100644 app/assets/javascripts/validators.coffee create mode 100644 app/assets/stylesheets/application.scss create mode 100644 app/assets/stylesheets/global.scss create mode 100644 app/controllers/concerns/authorization_concern.rb create mode 100644 app/controllers/concerns/boolean_parsing.rb create mode 100644 app/controllers/concerns/hourglass_ui/overview.rb create mode 100644 app/controllers/concerns/hourglass_ui/time_bookings.rb create mode 100644 app/controllers/concerns/hourglass_ui/time_logs.rb create mode 100644 app/controllers/concerns/hourglass_ui/time_trackers.rb create mode 100644 app/controllers/concerns/list_concern.rb create mode 100644 app/controllers/concerns/query_concern.rb create mode 100644 app/controllers/concerns/sort_concern.rb create mode 100644 app/controllers/hourglass/api_base_controller.rb create mode 100644 app/controllers/hourglass/time_bookings_controller.rb create mode 100644 app/controllers/hourglass/time_logs_controller.rb create mode 100644 app/controllers/hourglass/time_trackers_controller.rb create mode 100644 app/controllers/hourglass_completion_controller.rb create mode 100644 app/controllers/hourglass_import_controller.rb create mode 100644 app/controllers/hourglass_projects_controller.rb create mode 100644 app/controllers/hourglass_queries_controller.rb create mode 100644 app/controllers/hourglass_ui_controller.rb create mode 100644 app/helpers/hourglass/application_helper.rb create mode 100644 app/helpers/hourglass/chart_helper.rb create mode 100644 app/helpers/hourglass/list_helper.rb create mode 100644 app/helpers/hourglass/report_helper.rb create mode 100644 app/helpers/hourglass/ui_helper.rb create mode 100644 app/models/concerns/hourglass/namespace.rb create mode 100644 app/models/concerns/hourglass/project_issue_syncing.rb create mode 100644 app/models/concerns/hourglass/query_base.rb create mode 100644 app/models/concerns/hourglass/type_parsing.rb create mode 100644 app/models/hourglass/application_record.rb create mode 100644 app/models/hourglass/chart_query.rb create mode 100644 app/models/hourglass/global_settings.rb create mode 100644 app/models/hourglass/project_settings.rb create mode 100644 app/models/hourglass/time_booking.rb create mode 100644 app/models/hourglass/time_booking_query.rb create mode 100644 app/models/hourglass/time_log.rb create mode 100644 app/models/hourglass/time_log_query.rb create mode 100644 app/models/hourglass/time_tracker.rb create mode 100644 app/models/hourglass/time_tracker_query.rb create mode 100644 app/policies/concerns/redmine_authorization.rb create mode 100644 app/policies/hourglass/application_policy.rb create mode 100644 app/policies/hourglass/time_booking_policy.rb create mode 100644 app/policies/hourglass/time_log_policy.rb create mode 100644 app/policies/hourglass/time_tracker_policy.rb create mode 100644 app/policies/hourglass/ui_policy.rb create mode 100644 app/views/hooks/_account_menu_link.slim create mode 100644 app/views/hooks/_issue_actions.slim create mode 100644 app/views/hooks/_issue_context_actions.slim create mode 100644 app/views/hooks/_javascript_setup.slim create mode 100644 app/views/hooks/_user_preferences.slim create mode 100644 app/views/hooks/time_tracker/_activity_dialog_content.slim create mode 100644 app/views/hooks/time_tracker/_start_dialog_content.slim create mode 100644 app/views/hooks/time_tracker/_start_link.slim create mode 100644 app/views/hooks/time_tracker/_stop_link.slim create mode 100644 app/views/hourglass_projects/_hourglass_settings.slim create mode 100644 app/views/hourglass_projects/_label_with_global_value_tag.slim create mode 100644 app/views/hourglass_projects/settings.js.slim create mode 100644 app/views/hourglass_queries/edit.slim create mode 100644 app/views/hourglass_queries/new.slim create mode 100644 app/views/hourglass_ui/_flash_array.slim create mode 100644 app/views/hourglass_ui/_time_tracker_control.slim create mode 100644 app/views/hourglass_ui/api_docs.slim create mode 100644 app/views/hourglass_ui/forms/fields/_activity.slim create mode 100644 app/views/hourglass_ui/forms/fields/_comments.slim create mode 100644 app/views/hourglass_ui/forms/fields/_duration.slim create mode 100644 app/views/hourglass_ui/forms/fields/_issue.slim create mode 100644 app/views/hourglass_ui/forms/fields/_project.slim create mode 100644 app/views/hourglass_ui/forms/fields/_start.slim create mode 100644 app/views/hourglass_ui/forms/fields/_start_stop.slim create mode 100644 app/views/hourglass_ui/forms/fields/_stop.slim create mode 100644 app/views/hourglass_ui/forms/fields/_user_id.slim create mode 100644 app/views/hourglass_ui/index.slim create mode 100644 app/views/hourglass_ui/layouts/_hourglass.slim create mode 100644 app/views/hourglass_ui/lists/_chart.slim create mode 100644 app/views/hourglass_ui/lists/_group.slim create mode 100644 app/views/hourglass_ui/lists/_list.slim create mode 100644 app/views/hourglass_ui/lists/_list_entry.slim create mode 100644 app/views/hourglass_ui/lists/_query_form.slim create mode 100644 app/views/hourglass_ui/query_view.slim create mode 100644 app/views/hourglass_ui/report.slim create mode 100644 app/views/hourglass_ui/report/_list.slim create mode 100644 app/views/hourglass_ui/time_bookings.slim create mode 100644 app/views/hourglass_ui/time_bookings/_list_entry_actions.slim create mode 100644 app/views/hourglass_ui/time_bookings/context_menu.slim create mode 100644 app/views/hourglass_ui/time_bookings/edit.slim create mode 100644 app/views/hourglass_ui/time_bookings/new.slim create mode 100644 app/views/hourglass_ui/time_logs.slim create mode 100644 app/views/hourglass_ui/time_logs/_list_entry_actions.slim create mode 100644 app/views/hourglass_ui/time_logs/book.slim create mode 100644 app/views/hourglass_ui/time_logs/context_menu.slim create mode 100644 app/views/hourglass_ui/time_logs/edit.slim create mode 100644 app/views/hourglass_ui/time_logs/new.slim create mode 100644 app/views/hourglass_ui/time_trackers/_list_entry_actions.slim create mode 100644 app/views/hourglass_ui/time_trackers/context_menu.slim create mode 100644 app/views/hourglass_ui/time_trackers/edit.slim create mode 100644 app/views/settings/_form_errors.slim create mode 100644 app/views/settings/_redmine_hourglass.slim create mode 100644 app/views/settings/global_settings.slim create mode 100644 assets/images/swagger.png create mode 100644 assets/javascripts/swagger-ui-bundle.js create mode 100644 assets/stylesheets/swagger-ui.css create mode 100644 bin/rails create mode 100644 bin/rspec create mode 100644 coffeelint.json create mode 100644 config/initializers/assets.rb create mode 100644 config/initializers/autoload.rb create mode 100644 config/initializers/redmine_integration.rb create mode 100644 config/initializers/rswag.rb create mode 100644 config/locales/de.yml create mode 100644 config/locales/en.yml create mode 100644 config/locales/pt-BR.yml create mode 100644 config/locales/ru.yml create mode 100644 config/routes.rb create mode 100644 db/migrate/1418311263_create_hourglass_time_logs.rb create mode 100644 db/migrate/1418311331_create_hourglass_time_bookings.rb create mode 100644 db/migrate/1418914331_create_hourglass_time_trackers.rb create mode 100644 db/migrate/20190307074023_change_hourglass_time_log_comments_limit.rb create mode 100644 doc/images/DeveloperRights.png create mode 100644 doc/images/ManagerRights.png create mode 100644 doc/images/ProjectModules.png create mode 100644 doc/images/ProjectSettings.png create mode 100644 docker-compose.yml create mode 100644 init.rb create mode 100644 lib/hourglass.rb create mode 100644 lib/hourglass/access_control.rb create mode 100644 lib/hourglass/assets.rb create mode 100644 lib/hourglass/date_time_calculations.rb create mode 100644 lib/hourglass/migration.rb create mode 100644 lib/hourglass/redmine_hooks.rb create mode 100644 lib/hourglass/redmine_patches/mirror_assets_patch.rb create mode 100644 lib/hourglass/redmine_patches/project_patch.rb create mode 100644 lib/hourglass/redmine_patches/projects_helper_patch.rb create mode 100644 lib/hourglass/redmine_patches/query_patch.rb create mode 100644 lib/hourglass/redmine_patches/settings_controller_patch.rb create mode 100644 lib/hourglass/redmine_patches/time_entry_activity_patch.rb create mode 100644 lib/hourglass/redmine_patches/time_entry_patch.rb create mode 100644 lib/hourglass/redmine_patches/user_patch.rb create mode 100644 lib/hourglass/redmine_patches/user_preference_patch.rb create mode 100644 lib/hourglass/redmine_time_tracker_import.rb create mode 100644 lib/hourglass/settings_storage.rb create mode 100644 lib/tasks/hourglass.rake create mode 100644 spec/factories/hourglass_time_bookings.rb create mode 100644 spec/factories/hourglass_time_logs.rb create mode 100644 spec/factories/hourglass_time_tracker.rb create mode 100644 spec/factories/members.rb create mode 100644 spec/factories/projects.rb create mode 100644 spec/factories/roles.rb create mode 100644 spec/factories/time_entries.rb create mode 100644 spec/factories/time_entry_activities.rb create mode 100644 spec/factories/users.rb create mode 100644 spec/faker_patches.rb create mode 100644 spec/integration/time_bookings_spec.rb create mode 100644 spec/integration/time_logs_spec.rb create mode 100644 spec/integration/time_trackers_spec.rb create mode 100644 spec/lib/date_time_calculations_spec.rb create mode 100644 spec/lib/settings_storage_spec.rb create mode 100644 spec/models/time_booking_spec.rb create mode 100644 spec/models/time_log_spec.rb create mode 100644 spec/models/time_tracker_spec.rb create mode 100644 spec/spec_helper.rb create mode 100644 spec/support/access_rights.rb create mode 100644 spec/support/model_definitions.yml create mode 100644 spec/support/responses.rb create mode 100644 spec/support/time_helpers.rb create mode 100644 spec/swagger_helper.rb create mode 100644 swagger/v1/swagger.json create mode 100644 vendor/assets/javascripts/jqplot/jqplot.barRenderer.js create mode 100644 vendor/assets/javascripts/jqplot/jqplot.categoryAxisRenderer.js create mode 100644 vendor/assets/javascripts/jqplot/jqplot.highlighter.js create mode 100644 vendor/assets/javascripts/jqplot/jquery.jqplot.js create mode 100644 vendor/assets/stylesheets/jqplot/jquery.jqplot.css diff --git a/.devcontainer/postgres/Dockerfile b/.devcontainer/postgres/Dockerfile new file mode 100644 index 0000000..14d71b4 --- /dev/null +++ b/.devcontainer/postgres/Dockerfile @@ -0,0 +1,12 @@ +ARG RUBY_VERSION=3.1 +ARG REDMINE_VERSION=5-stable + +FROM alpinelab/ruby-dev:${RUBY_VERSION} AS redmine +ARG REDMINE_VERSION +ENV REDMINE_VERSION=${REDMINE_VERSION} + +RUN \ + cd / \ + && mv /app /redmine \ + && chmod ugo+w /redmine +WORKDIR /redmine diff --git a/.devcontainer/postgres/Gemfile.local b/.devcontainer/postgres/Gemfile.local new file mode 100644 index 0000000..e46bb47 --- /dev/null +++ b/.devcontainer/postgres/Gemfile.local @@ -0,0 +1,14 @@ +group :development do + # gem 'better_errors' + # gem 'binding_of_caller' + # gem 'meta_request' # support RailsPanel in Chrome + # + # gem 'pry' + # gem 'pry-byebug' + # gem 'pry-rails' + + # gem "debase", "0.2.5.beta2", require: false + # gem "ruby-debug-ide", "~> 0.7.3" + gem "debug" + gem 'rufo', require: false +end diff --git a/.devcontainer/postgres/database.yml b/.devcontainer/postgres/database.yml new file mode 100644 index 0000000..1d511cb --- /dev/null +++ b/.devcontainer/postgres/database.yml @@ -0,0 +1,16 @@ + +development: &postgres + adapter: postgresql + encoding: utf8 + database: redmine + username: postgres + password: postgres + host: postgres + port: 5432 + +test: + <<: *postgres + database: redmine_test + +production: + <<: *postgres diff --git a/.devcontainer/postgres/devcontainer.json b/.devcontainer/postgres/devcontainer.json new file mode 100644 index 0000000..893d973 --- /dev/null +++ b/.devcontainer/postgres/devcontainer.json @@ -0,0 +1,58 @@ +{ + "name": "Redmine - Postgres", + "dockerComposeFile": "docker-compose.yml", + "service": "redmine", + "workspaceFolder": "/redmine", + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "username": "vscode", + "userUid": "1000", + "userGid": "1000" + }, + "ghcr.io/devcontainers/features/ruby:1": "none", + "ghcr.io/devcontainers/features/node:1": "none", + "ghcr.io/devcontainers/features/git:1": { + "version": "latest", + "ppa": "false" + } + }, + "customizations": { + "vscode": { + "extensions": [ + "rebornix.Ruby", + "mtxr.sqltools", + "mtxr.sqltools-driver-pg", + "craigmaslowski.erb", + "hridoy.rails-snippets", + "misogi.ruby-rubocop", + "jnbt.vscode-rufo", + "donjayamanne.git-extension-pack" + ], + "settings": { + "sqltools.connections": [ + { + "name": "Rails Development Database", + "driver": "PostgreSQL", + "previewLimit": 50, + "server": "localhost", + "port": 5432, + "database": "redmine", + "username": "postgres" + }, + { + "name": "Rails Test Database", + "driver": "PostgreSQL", + "previewLimit": 50, + "server": "localhost", + "port": 5432, + "database": "redmine_test", + "username": "postgres" + } + ] + } + } + }, + "forwardPorts": [ 5000 ], + "postCreateCommand": "sh -x /redmine/post-create.sh", + "remoteUser": "vscode" +} diff --git a/.devcontainer/postgres/docker-compose.yml b/.devcontainer/postgres/docker-compose.yml new file mode 100644 index 0000000..9628cca --- /dev/null +++ b/.devcontainer/postgres/docker-compose.yml @@ -0,0 +1,42 @@ +version: '3.7' + +services: + redmine: + build: + context: . + target: redmine + args: + RUBY_VERSION: "3.1.3" + REDMINE_VERSION: "5.0-stable" + NODE_VERSION: "lts/*" + volumes: + - redmine-data:/redmine/files + - node_modules:/redmine/node_modules + - bundle:/bundle + - ../..:/redmine/plugins/redmine_hourglass + - ./Gemfile.local:/redmine/Gemfile.local + - ./database.yml:/redmine/config/database.yml + - ./post-create.sh:/redmine/post-create.sh + environment: + RAILS_ENV: development + REDMINE_SECRET_KEY_BASE: supersecretkey + REDMINE_PLUGINS_MIGRATE: 'true' + command: sleep infinity + depends_on: + - postgres + + postgres: + image: postgres:latest + restart: unless-stopped + volumes: + - postgres-data:/var/lib/postgresql/data + environment: + POSTGRES_DB: redmine + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + +volumes: + postgres-data: null + redmine-data: + node_modules: + bundle: diff --git a/.devcontainer/postgres/post-create.sh b/.devcontainer/postgres/post-create.sh new file mode 100755 index 0000000..8b03215 --- /dev/null +++ b/.devcontainer/postgres/post-create.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -e + +. ${NVM_DIR}/nvm.sh +nvm install --lts + +sudo chown -R vscode:vscode . +sudo chmod ugo+w /bundle + +git config --global --add safe.directory /redmine +git init +git remote add origin https://github.com/redmine/redmine.git +git fetch +git checkout -t origin/${REDMINE_VERSION} -f +git apply plugins/redmine_hourglass/.devcontainer/postgres/redmine5_i18n.patch + +bundle + +bundle exec rails config/initializers/secret_token.rb +bundle exec rails db:create +bundle exec rails db:migrate +bundle exec rails redmine:plugins + +# RAILS_ENV=test bundle exec rails db:drop +# RAILS_ENV=test bundle exec rails db:create +# RAILS_ENV=test bundle exec rails db:migrate +# RAILS_ENV=test bundle exec rails redmine:plugins diff --git a/.devcontainer/postgres/redmine5_i18n.patch b/.devcontainer/postgres/redmine5_i18n.patch new file mode 100644 index 0000000..cc91d7e --- /dev/null +++ b/.devcontainer/postgres/redmine5_i18n.patch @@ -0,0 +1,13 @@ +diff --git a/lib/redmine/i18n.rb b/lib/redmine/i18n.rb +index 805e3c61c..42b5ab23f 100644 +--- a/lib/redmine/i18n.rb ++++ b/lib/redmine/i18n.rb +@@ -125,7 +125,7 @@ module Redmine + if options[:cache] == false + available_locales = ::I18n.backend.available_locales + valid_languages. +- select {|locale| available_locales.include?(locale)}. ++ select {|locale| available_locales.include?(locale) && (ll(locale.to_s, :general_lang_name) rescue false) }. + map {|lang| [ll(lang.to_s, :general_lang_name), lang.to_s]}. + sort_by(&:first) + else diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e79608c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,10 @@ +* text=auto +*.rb text eol=lf +*.sh text eol=lf +*.yml text eol=lf +*.slim text eol=lf +*.coffee text eol=lf +*.scss text eol=lf +*.rake text eol=lf +*.json text eol=lf +Gemfile text eol=lf \ No newline at end of file diff --git a/.github/data/mysql2_database.yml b/.github/data/mysql2_database.yml new file mode 100644 index 0000000..b142008 --- /dev/null +++ b/.github/data/mysql2_database.yml @@ -0,0 +1,7 @@ +test: + adapter: mysql2 + host: 127.0.0.1 + port: 3306 + database: redmine_test + username: root + password: redmine_hourglass diff --git a/.github/data/postgresql_database.yml b/.github/data/postgresql_database.yml new file mode 100644 index 0000000..f0f7a60 --- /dev/null +++ b/.github/data/postgresql_database.yml @@ -0,0 +1,7 @@ +test: + adapter: postgresql + host: localhost + port: 5432 + database: redmine_test + username: redmine_hourglass + password: redmine_hourglass diff --git a/.github/data/sqlite3_database.yml b/.github/data/sqlite3_database.yml new file mode 100644 index 0000000..56d19b0 --- /dev/null +++ b/.github/data/sqlite3_database.yml @@ -0,0 +1,3 @@ +test: + adapter: sqlite3 + database: db/redmine_test.sqlite3 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9b8b7e7 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,75 @@ +name: Specs + +on: [push, pull_request] + +jobs: + specs: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + redmine: [ '5.0.4', '4.2.9' ] + ruby: [ '2.7.7', '2.6.8' ] + database: [ 'sqlite3', 'postgresql', 'mysql2' ] + include: + - redmine: '5.0.4' + ruby: '3.1.3' + database: 'postgresql' + - redmine: '5.0.4' + ruby: '3.1.3' + database: 'mysql2' + + services: + postgresql: + image: postgres + ports: + - 5432:5432 + env: + POSTGRES_DB: redmine_test + POSTGRES_USER: redmine_hourglass + POSTGRES_PASSWORD: redmine_hourglass + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + mysql: + image: mysql:5 + ports: + - 3306:3306 + env: + MYSQL_DATABASE: redmine_test + MYSQL_ROOT_PASSWORD: redmine_hourglass + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + steps: + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + + - name: Install redmine + run: wget https://github.com/redmine/redmine/archive/${{ matrix.redmine }}.tar.gz -qO- | tar -C $GITHUB_WORKSPACE -xz --strip=1 --show-transformed -f - + + - uses: actions/checkout@v3 + with: + path: 'plugins/redmine_hourglass' + + - name: Create database config + run: cp $GITHUB_WORKSPACE/plugins/redmine_hourglass/.github/data/${{ matrix.database }}_database.yml $GITHUB_WORKSPACE/config/database.yml + + - name: Install dependencies + run: | + bundle config set --local without 'rmagick' + bundle install --jobs=3 --retry=3 + + - name: Setup database and plugin + run: | + bundle exec rake db:create + bundle exec rake db:migrate + bundle exec rake redmine:load_default_data REDMINE_LANG=en + bundle exec rake generate_secret_token + bundle exec rake redmine:plugins:migrate + env: + RAILS_ENV: test + + - name: Run specs + run: bundle exec rake --trace redmine:plugins:hourglass:spec + env: + RAILS_ENV: test diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..85098dd --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +*.swp +*.user +*~ +~* + +.idea/* +Gemfile.lock + +tmp/rubycritic/ +/.bundle +.ruby-version diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..4c50f5f --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,5 @@ +Metrics/LineLength: + Max: 120 + +Style: + Enabled: false diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..2a89cc4 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,125 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + +## [unreleased] - TBA + +### Added +- [please add new features] + +### Changed +- [please add noteworthy changes] + +### Removed +- [please add dropped features] + +### Fixed +- [please add bug fixes] + +## [1.3.0] - TBA + +### Added +- support for Redmine 5 +- support for Ruby >2.6 +- Added .devcontainer to ease development + +### Changed +- Upgraded Gems to support Rails 6 +- Fixed Swagger API documentation for mass update and create + +### Fixed +- Asset compilation for Redmine images + +## [1.2.0] - 2023-02-21 + +Non-Beta Release after proving that everything works. + +### Changed +- added more time clamping options +- many bugfixes +- fixed styling +- fixed timer stops when brower tab in background + +### Known issues +- no support for Redmine 5 + +## [1.2.0-beta] - 2021-06-27 + +Upgraded to support Redmine 4.2.1 + +### Changed +- resolved blockers for current Redmine versions +- dropped support for older Redmine versions + +### Fixed +- issue filter for administrators works as expected +- update for issue, project and activity work normal + +## [1.1.2] - 2019-04-18 + +Bugfix release. + +### Changed +- enhanced activity display in report by adding a dash + +### Fixed +- fixed issue where changes to the project filter in time bookings queries would corrupt activity and user filters + +## [1.1.1] - 2019-04-04 + +Bugfix release. + +### Fixed +- creating & updating saved queries for time logs, time bookings and tracker +- position of the edit & delete buttons for saved queries for hourglass views + +## [1.1.0] - 2019-03-25 + +First release with Redmine 4.0 support. +Redmine versions 3.x are still supported, but will be removed in future releases. + +### Added +- support for Redmine version 4.0.0 and above +- backend and frontend validation of settings + +### Changed +- improved testing of multiple databases + +### Fixed +- removal of database specific tests that led to errors +- enhanced datetime parsing +- enhanced filters of time logs + + +## [1.0.0] - 2019-02-26 + +This is the first mature release after a long beta testing period. +We added plenty of new features which were long time overdue. +Some of the things were requested several years before and were finally possible. + +### Added +- functionality is available as an API, so desktop and mobile clients are possible +- rounding can be configured to only affect sums +- proper support for grouping entries in list views +- project specific plugin settings +- time trackers can now be queried +- direct links from running time tracker to issue and project +- error messages for client side validations +- a qr code on the overview page intended to help integrating the upcoming companion app +- there is now version filter for time trackers +- you can now set up activity default per user, which will be automatically used for time trackers and bookings + +### Changed +- rounding is now only for time bookings instead of time logs +- enhanced access rights +- changed data structure massively, if anyone relied on the database tables, please update your code +- we improved the timezone handling cause there was a synchronisation problem between client and server + +### Removed +- dropped support for Redmine below version 3.2 +- dropped support for Ruby below 2.0.0 +- removed the extra report tab, it's now merged in the time bookings tab +- ability to remove time logs with time bookings, you now need to remove the time booking first diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..7f7e9f1 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at conduct@hicknhack-software.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..eb9be00 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,39 @@ +# How to contribute to Redmine Hourglass + +First off all, thanks for your interest in contributing to Redmine Hourglass. + +The following is a set of guidelines for contributing to this project. These are just guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. + +But please notice that all of your interactions in the project are +expected to follow our [Code of Conduct](CODE_OF_CONDUCT.md). + +#### Reporting Issues + +Please make sure your issue wasn't already reported or even fixed by searching through our [issues](https://github.com/hicknhack-software/redmine_hourglass/issues). + +Otherwise create a new one, but add a proper title and a clear description. + +If you report a bug, please include as much information as you can provide, for example: + * Redmine version + * Plugin version + * Other plugins installed + * Gem versions + * Operating system + +If you report a feature request, please add some use cases for what that feature could be used, so we can elaborate better about it. + +Avoid opening new issues to ask questions in our issues tracker. Please go through +the project wiki, documentation and source code first. If you really can't understand something, maybe we missed documenting it properly. Feel free to add a documentation feature request for that. + +#### Pull Requests + +We appreciate every bug fix or enhancement because we sometimes don't have the time besides day work to do everything we would like to do with this plugin. + +So you can easily speed things up by creating Pull Requests adding that functionality you are craving for. + +We also like to have this plugin translated in more languages than the few we are capable of speaking ourselves. + +In any ways, please make sure that your Pull Request has a proper title and a clear description what it adds. Also make sure that your addition works in all our supported redmine versions. + +Thanks,
+HicknHack Software Team diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt new file mode 100644 index 0000000..fda132f --- /dev/null +++ b/COPYRIGHT.txt @@ -0,0 +1,19 @@ +Hourglass is a Redmine plugin intended to aid in time tracking on issues and projects with reports and management supporting tools. + +Authors: Robert Kranz + +Copyright (C) 2017 HicknHack Software GmbH + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3974784 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM redmine:4.1.1 + +RUN apt-get update && apt-get install -y build-essential libffi-dev +RUN rm /usr/src/redmine/Gemfile.lock.mysql2 +RUN touch /usr/src/redmine/Gemfile.lock.mysql2 diff --git a/GPL.txt b/GPL.txt new file mode 100644 index 0000000..d511905 --- /dev/null +++ b/GPL.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..666f14b --- /dev/null +++ b/Gemfile @@ -0,0 +1,45 @@ +source 'https://rubygems.org' + +# asset pipeline +gem 'uglifier' +gem 'coffee-script', '~> 2.4.1' +gem 'sass', '~> 3.5.1' +gem 'sprockets', '~> 3.7.2', require: 'sprockets/railtie' + +# access control +gem 'pundit', '~> 1.1.0' + +# this is useful for unix based systems which don't have a js runtime installed +# if you are on windows and this makes problems, simply remove the line +# gem 'therubyracer', :platform => :ruby + +# views +gem 'slim', '~> 3.0.8' +gem 'js-routes', '~> 2.2.4' +gem 'momentjs-rails', '>= 2.10.7' + +gem 'rswag', '~> 2.5.1' # api docs +gem 'rspec-core' +gem 'rqrcode' unless dependencies.any? { |d| d.name == 'rqrcode' } + +group :development, :test do + gem 'rspec-rails', '~> 5.1.2' + gem 'factory_bot_rails' + gem 'zonebie' + gem 'database_cleaner' + gem 'faker' +end + +if RUBY_VERSION < "2.1" + group :development, :test do + gem 'rubycritic', '<2.9.0', require: false + end +elsif RUBY_VERSION < "2.3" + group :development, :test do + gem 'rubycritic', '<4.0.0', require: false + end +else + group :development, :test do + gem 'rubycritic', require: false + end +end diff --git a/README.md b/README.md new file mode 100644 index 0000000..7196cd1 --- /dev/null +++ b/README.md @@ -0,0 +1,150 @@ +# Redmine Hourglass Plugin +[![Code Climate](https://codeclimate.com/github/hicknhack-software/redmine_hourglass.png)](https://codeclimate.com/github/hicknhack-software/redmine_hourglass) +[![Build Status](https://github.com/hicknhack-software/redmine_hourglass/workflows/Specs/badge.svg)](https://github.com/hicknhack-software/redmine_hourglass/actions?query=workflow%3ASpecs) +[![Join the chat at https://gitter.im/hicknhack-software/redmine_hourglass](https://badges.gitter.im/hicknhack-software/redmine_hourglass.svg)](https://gitter.im/hicknhack-software/redmine_hourglass?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +Hourglass is a Redmine plugin to aid in tracking spent time on projects and issues. It allows users to start / stop a timer with an optional reference to what they are working on. + +It allows various queries for time entries as well as possibilities to update existing entries. + +Hourglass can be configured on a global base as well as per project. + +See [CHANGELOG.md](CHANGELOG.md) for the latest features. + + +## Migrate from old Time Tracker plugin + +_Note: This is a complete rewrite of the [Redmine Time Tracker Plugin](https://github.com/hicknhack-software/redmine_time_tracker). While it has feature parity (atleast we hope we didn't forget anything), the code base has changed positively, so further additions are no longer a pain to do._ + +___To ease migrating we added a function to import time entries from the redmine_time_tracker. You can find this in the plugin settings and as a rake task. For more information about migrating from the old time tracker take a look on the [Migration Guide](https://github.com/hicknhack-software/redmine_hourglass/wiki/Migration-Guide)___ + + +## Companion App + +We made an app to ease use of the time tracker on mobile (android only for now), check it out: + +- [Hourglass for Android](https://play.google.com/store/apps/details?id=hnh.software.hourglass) + +The Binaries are made available as downloads in the [Releases](https://github.com/hicknhack-software/redmine_hourglass/releases) section + + +## Features + +- Per user time tracking +- Integrates well with Redmine by reusing time entries +- Overview of spent time for users +- Track project unrelated time +- Book tracked time on issues +- Detailed statistics for team management +- Status monitor of currently running trackers +- Detailed list views with Redmine queries integrated +- Report generation for projects with graphical time representation with customizable company logo +- Project specific settings + + +## Requirements + +* Ruby 2.6.8 +* Redmine 4.2.1 (The only version fully tested! - Try older versions of the plugin for older versions of Redmine.) +* An [ExecJS](https://github.com/sstephenson/execjs) compatible runtime, the gemfile includes [therubyracer](https://github.com/cowboyd/therubyracer) for unix based systems and windows ships with a default js interpreter (from Win 7 upwards), so most people should be set. If you happen to have problems like for example [#29](https://github.com/hicknhack-software/redmine_hourglass/issues/29), take a look on the linked ExecJS and install one of the mentioned runtimes. + +See [.github/workflows/main.yml](.github/workflows/main.yml) for details about supported versions. +If a newer version doesn't appear in there, feel free to open an issue and report your experience with that Redmine or Ruby version. + + +## Installation + +1. If you use Mysql please make sure you have the timezone details loaded, otherwise you miss a lot of nice features. + ```bash + sudo mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql + ``` +1. Place the source code of this plugin at the `plugins/redmine_hourglass` folder. + Either by: + - Download a release from [Releases](https://github.com/hicknhack-software/redmine_hourglass/releases) and extract it into your Redmine. + - Or clone the repository: + ```bash + git clone https://github.com/hicknhack-software/redmine_hourglass.git plugins/redmine_hourglass + ``` +1. Install required Gems by: + ```bash + bundle install + ``` +1. Update the database schema by running the following command from the root of Redmine: + ```bash + bundle exec rake redmine:plugins:migrate RAILS_ENV=production + ``` +1. Precompile the assets. + - If your Redmine is accessed with a path on your domain, like `www.example.com/redmine` use this option: + ```bash + bundle exec rake redmine:plugins:assets RAILS_ENV=production RAILS_RELATIVE_URL_ROOT=/redmine + ``` + - If your Redmine is on the root you might simply run: + ```bash + bundle exec rake redmine:plugins:assets RAILS_ENV=production + ``` +1. (Re)start your Redmine +1. Done. *Please read the "First time usage" section below.* + + +## Update + +The process is roughly the same as installing. Make sure you have the desired version in the `plugins` directory and run the steps above (except 1). + +If you had it installed via git before, the first step is simply doing `git pull` in the `plugins/redmine_hourglass` directory. + + +## First time usage + +1. Login as an administrator and setup the permissions for your roles + - developers should have the rights to track time + + ![Developer Rights](doc/images/DeveloperRights.png) + + - managers should have the rights to fix times + + ![Manager Rights](doc/images/ManagerRights.png) + +1. Enable the "Hourglass" module for your project + - works well in combination with the built in `Time tracking` + + ![Project Modules](doc/images/ProjectModules.png) + +1. You should now see the Time Tracking link in the top menu. + +To track time directly on an issue, you can use the context menu (right click in the issues list) in +the issue list to start or stop the timer or press the "Start Tracking" button on the top right, next to the default "Book Time" Redmine button. + + +### What's what? + +The plugin is intended to help us create invoices for customers. This requires the separation of time that was spent and time that is booked. Only booked times can be billed. +More information are available in the [wiki](http://github.com/hicknhack-software/redmine_hourglass/wiki). + +#### Time Tracker + +The stop watch. Time you spent gets "generated" by the trackers. + +#### Time Log + +A time log is a spent amount of time. If you stop the tracker, a time log is created. A time log has nothing attached to it. To add this time to issues or projects, you **book** time. +Role permissions can be edited to disable logging. This might be useful for reviewers, that do not generate time on their own but want to look up statistics on a project or user. + +#### Time Booking + +A booking is time that is actually connected to a task (project or issue). To create a booking, you book time from a time log. You are not limited to spent the whole time of a single booking, you can divide as you wish. You however aren't able book more time than what was actually logged. The role you have on projects and their settings determine if you are able to edit bookings or are just allowed to create them. + +#### Settings + +The plugin offers a list of settings at the Redmine roles and permission settings page. Also you can set the size and file for a logo to be displayed at the report in the Redmine plugin settings, enable rounding behaviour and interval as well as snapping percentage. You can also refine this settings per project if you have different accounting rules per project. + +![Project Settings](doc/images/ProjectSettings.png) + + +## Contributing + +Bug reports and pull requests are welcome on [GitHub](https://github.com/hicknhack-software/redmine_hourglass). Please check the [contribution guide](CONTRIBUTING.md).This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to our [code of conduct](CODE_OF_CONDUCT.md). + + +## License + +The plugin is available released under the terms of [GPL](https://www.gnu.org/licenses/gpl). diff --git a/app/assets/images/icons/arrow_join.png b/app/assets/images/icons/arrow_join.png new file mode 100644 index 0000000000000000000000000000000000000000..a128413d8892dede67a722b755a0e5a241e22cef GIT binary patch literal 626 zcmV-&0*(ENP)rYsPY01;xw|q+1XP62ZKNNf0i}lORw#-+^ z#eWjGI5)D~*%m(1>5Uva|KRl7dV8+T7A`G}x7k6Q#1cL#?^nclzafIHF=frdfxTM;5eU`G(t3ZL>h zq%#>uD8p~AzniHE4Br`SCb{0b_i(V?*A7x4Yp)<*$j^%sM0Q8xU9lJpTqqXT@nX^1 z5K1V0^Sv}x0%NoVtwF!n4+^nruOj~?pIo^7eBkL7YanOml9_B4qKQB-fL6CVNJ_L8 zqEZAEp`_BgUC2WzPE>s=#fe zaB^>EX>4U6ba`-PAZ2)IW&i+q+O1e?(jzGj{Ld-&2uR|291sw(H`wEEQiyW5r>7@o zcJ2P`Dhh;9rc!dd`JaC;_bwJ?B&!^q^d-2n_dmk`{ z1mALQ)3o^wj0JMU|oSIm&`87I4U)z-D}!*T47)y$gl z@B5Guj1gf^*zpt+kI%Gs5qKa)+8)Cv3-cbyxb_n9DZ;;woqI38g7;p1#m+Yym!Cu7 ze6k7YD@Ha>@oQY(ZTK6tyYo*Eq`xHiL+sWXWvzKm*Fr+1lCwkIqdZrb*bz#3mL>wPijyeW&k0=-Vx4_ z00Ey!A|>*fITIm{1^6_0&Jwr-0g90axdm)Q62K|E_r{t`&s>gth9NBgB1%H46d=?9 zRtORN$)SKlElLb7#+YJ`CDz!Iq>y4tDW|PbElUnL=9F_Tx#m`+gc3_Cxs*~%t6T*V z7Hg{6)lzG14VyNYZdlzgqqWXmdg!sIo_p!FHwAq(Xw;-xi&kxehYY0uNF%#ZMjdU^ z1eIo(ai*DPnRT`Wt}R(%#g$fGW!2SQ)C|?1QKK*9evcX%Y8$ce%*!9tFr4!>L0eAZ z#tevYARwMM0w6SR%zU8`cq6wl^Ocblk%1b;4bGsA7!VATI4*jz`ylsQ+*}NQ3pf5V z3=n#O)WTjrLR&c>vm3xMS*NLD(>+9hsY<&syg}&_}$6LaXz5|7`7aA zh?31PNbc_mSKX2!TXD|W%T4$`T#(|A0q6i*SQVLp4#~nl;&%BOOJ#}9*3Ldpy-SCX zT81xY7Pz(e0M<&u?#C@icsax*#CBa~rDc(26bVPhqb>2l$f8QK)tSyM;vef=XdH}6 znyY?5FzUI9O$yB_XI9@G*-U1=L#P$HYc!2@@C|+Ad_4Cl7f{0O6&kXf+zqu+zQ@No zqnW_vVy0nWn+qbjIjMl7`clWbAb z&8tR7v%5l^Hh(S0MiNBi)uCXEC_rpiAPbrYg{lQ@B9$Few4wTmxqR97~IkPHy9FwBKbtpdVq1$>l>28O>c#9Oa-8fm{+9F#nMjofTDw#>K zXqjfiKqPY>h@oYfW}1l8c(qYeW+ON90y#ROolzW88P&+x+$)MlHgO2(wNAl6#-a6! zR(o{dhfVHQV-`wI3v@h!8kB1*LBX$_Fj9Do^Pu4;($xf%q+PGif?8D}!tN~?>B?!t zkH--$InXnfnQlff@Q~In5w}*V&2%GU-7Qv79&b5?JWNP-TN8Fhj9ayP0(ZWOx&sOQ zr)CTjOthr!23co-pq*>9sj1spYekoDr%lyqNmltLer)0>mnOU1rp46@sE;nEs)Cjgv zwimZDubqM$EOgM6Fe<)Ky}NS}TYYY*h-rX|2Ul zkj4k8RU%l_hJsQxeNhS#A6mR1T5L_MO;k*ywh4%_+frlKxF)-CcV~BYHnTIce;*c> zY9D;?JRS}|KECgKk`RLbGfn?qj2}I)LG_t0sQ&7$KETiiIebtlL zrOc*PmI^kvtcnxWWdssA!{hsNS;DH!je3$FkBwLrU%Y?&^TX3JfUlO{8|k=D$yRh0 za?5PFr-!&E$eAW#Jw#Wh&gP9PSuE99l2_BVqCMzY`DX!S09mruhT)Ygd6u^nnPn@Y8Y?bY4Q7$rjCFu^t#eMgGpN8TiS zuOOnQdGV!T?ryJ}F9Vd#%AdyKc_Ja1xdjVPl0o)!+qygJQKiBtYs%E_nxdMCaP^ko z7%v0@4M3^F#P72cB(4uIIlYLYLddVszrGIuV_s(Am`>9%^T>7JcWIK%~a~y~4#W2mP&BBEm*|9EK?@!egY}@np%(4i+ zeD=%FSR0!n(PMIaJjuRye*mEBRj=qkzUtyCMjZg~)ZpR$dDB1m?I)vV@yzQy&~=ih zH_idz2NXp?Zofpn>Y{XKxOT(OPx# literal 0 HcmV?d00001 diff --git a/app/assets/images/icons/time_start.png b/app/assets/images/icons/time_start.png new file mode 100644 index 0000000000000000000000000000000000000000..70119f77a2a331d89e09bbc11ecd88ba9b3db42a GIT binary patch literal 774 zcmV+h1Nr=kP)A6M4~?7#@r-CT>YJsEJq%ieXFGq)fHKcZTzs))SSAbSlP;FLo_Lr?=*j#hK@ArWqyjWQ@!>p5_ zuReZTTAq~mN5HToztV0H!sl_r>h|INpbOQVv#65IpjBzdlx-a@s~(EF#}MVmW&Q?G zwel|*dNN4wh6`HbD!PVTurK@J^#|ecZ^OFeN2}V74rFQ#6FeC ze$IoqOOC8(JgD{Kun;8D1mjq8jiZr!bB6)+)yD67Hyz-Kj93bi6yy-gL;$Z!O2eDA zMl(DIfWb>5x#APtjuA9uvwi|P%VL}kixL$w6Gj#YtWuX=4vm3F2nNuUA0rx;a-cWaz?WI!p&I5Rfxsap%I_GJfY%X=-WdU=SJf!* zPe63}X`D+uQ4$6;6egZ&c@e!cZ)icAauTm)^Dw%;B1rWk7$Ol{bQy9>1>|#8;TI|y zc!=_Wcp9+Fe56`lEax5n7UssPF*IR7foKd*sz#Asp~Dq!Bos6C_|-m|1vKFIe=W$p zmsiWV5tIw>VoH+_=bRYM*(OA#oJ6tu0SeXZ@a94l`*;NmBro=CWhSfrP1-fLFyrbD zEp|$zpH*@SrRuow$@ECinI8O$sKtCr0lMrTBcG0c2XZw1Mli^)n*aa+07*qoM6N<$ Ef<`E0fB*mh literal 0 HcmV?d00001 diff --git a/app/assets/images/icons/time_stop.png b/app/assets/images/icons/time_stop.png new file mode 100644 index 0000000000000000000000000000000000000000..a10eb94e405628bf3a04a2b4711b54ba0aa739b4 GIT binary patch literal 885 zcmV-*1B(2KP)Px#24YJ`L;wH)0002_L%V+f000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igk- z6fOZ+P-ff!00Q+%L_t(I%cYY|XdHDIho710bT+#?vtNx_^I=l5P1`g|BW973V*G$Y z1)CJ{7^M|2rD6q38fg!eHpHAlHJ6}Z@nCI_BAQ^E)Wa63M5&31prL8A?Iz1+H@n%% z?0o#aZEC#;zVKdNemwjR&npQb_&>Al@x#=Wk(V^3^r7af>{nDpcO8MbVdgeU+%lb- z;Un){NIjaD9&PaB)uFL)c>Q>!xp%u})S~$#2;ou6r^(%)BRzj(qfk_b-+1rRNB;s$ zU%5Ein25d`Z9dFuS?A851yMZj-*A7NWW!S1J)S0zB1Z(ECa&nW9HlZl`W%gWoN$y$>J*$Wpm85N+h=g&ZAi zG0KiWRaGXx|Bm%S0o$^en7l!I+YVB5dE#wJ6jAA}0)!A@Um!v{TP7B(!Ey!L{eJE* zEirk0nhQh2=z4(26Mi1#HVM_Xpdi&%0k&o1c@}2H!*ap)V5Lwb5DaqX*I#(Gw~x-Q zB$flV?IFBPgeSH<*eIC~3YkB4h6430J}k4VF$A)YXPml&N* zQ5o0iXoy#;4T>hy_vWTa?yey7cz_)d1LN9N!nafS&s;>BnnyeT8C^|D zgL?U-4B*Q8=+eTX8MSZGq?h>o+5&f%^GKGBWZK9de}HtP4|)zlA^}H_A|+ZSA;hVw zNaN>^4Ft8)(Egqm$;e4kvkv*9i|YwSMqWUg_zl|kY&rbqYw*Lj;vXuHo$WuXI>pm< z&Hi9h+djfiHiK}efBhudz$eh(zXdqlftZ + $issueField = $(@) + $projectField = $issueField.closest('form').find("[name*='[project_id]']") + $issueField.autocomplete + source: (request, response) -> + $.ajax + url: hourglassRoutes.hourglass_completion_issues(project_id: $projectField.val()), + dataType: 'json', + data: request + success: response + minLength: 1, + autoFocus: true, + response: (event, ui) -> + $(event.target).next().val('') + select: (event, ui) -> + event.preventDefault() + $issueField + .val(ui.item.label) + .next().val(ui.item.issue_id) + .trigger('change') + $projectField.val(ui.item.project_id).trigger('changefromissue') if $projectField.val() isnt ui.item.project_id + focus: (event, ui) -> + event.preventDefault() + +updateActivityField = ($activityField, $projectField) -> + $selected_activity = $activityField.find("option:selected") + $.ajax + url: hourglassRoutes.hourglass_completion_activities() + data: + project_id: $projectField.val() + success: (activities) -> + $activityField.find('option[value!=""]').remove() + for {id, name, isDefault} in activities + do -> + $activityField.append $('