diff --git a/redmine_reporting/README b/README similarity index 100% rename from redmine_reporting/README rename to README diff --git a/redmine_reporting/README.rdoc b/README.rdoc similarity index 100% rename from redmine_reporting/README.rdoc rename to README.rdoc diff --git a/redmine_reporting/app/controllers/cost_reports_controller.rb b/app/controllers/cost_reports_controller.rb similarity index 100% rename from redmine_reporting/app/controllers/cost_reports_controller.rb rename to app/controllers/cost_reports_controller.rb diff --git a/redmine_reporting/app/helpers/reporting_helper.rb b/app/helpers/reporting_helper.rb similarity index 100% rename from redmine_reporting/app/helpers/reporting_helper.rb rename to app/helpers/reporting_helper.rb diff --git a/redmine_reporting/app/models/cost_query.rb b/app/models/cost_query.rb similarity index 100% rename from redmine_reporting/app/models/cost_query.rb rename to app/models/cost_query.rb diff --git a/redmine_reporting/app/models/cost_query/chainable.rb b/app/models/cost_query/chainable.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/chainable.rb rename to app/models/cost_query/chainable.rb diff --git a/redmine_reporting/app/models/cost_query/custom_field_mixin.rb b/app/models/cost_query/custom_field_mixin.rb similarity index 91% rename from redmine_reporting/app/models/cost_query/custom_field_mixin.rb rename to app/models/cost_query/custom_field_mixin.rb index dadf5bf6aa..e6b6c3babd 100644 --- a/redmine_reporting/app/models/cost_query/custom_field_mixin.rb +++ b/app/models/cost_query/custom_field_mixin.rb @@ -5,9 +5,10 @@ module CostQuery::CustomFieldMixin SQL_TYPES = { 'string' => mysql? ? 'char' : 'varchar', 'list' => mysql? ? 'char' : 'varchar', - 'text' => 'text', 'date' => 'date', - 'int' => 'decimal(60,3)', 'float' => 'decimal(60,3)', - 'bool' => 'boolean' } + 'text' => mysql? ? 'char' : 'text', + 'bool' => mysql? ? 'unsigned' : 'boolean', + 'date' => 'date', + 'int' => 'decimal(60,3)', 'float' => 'decimal(60,3)' } def self.extended(base) base.inherited_attribute :factory diff --git a/redmine_reporting/app/models/cost_query/filter.rb b/app/models/cost_query/filter.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter.rb rename to app/models/cost_query/filter.rb diff --git a/redmine_reporting/app/models/cost_query/filter/activity_id.rb b/app/models/cost_query/filter/activity_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/activity_id.rb rename to app/models/cost_query/filter/activity_id.rb diff --git a/redmine_reporting/app/models/cost_query/filter/assigned_to_id.rb b/app/models/cost_query/filter/assigned_to_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/assigned_to_id.rb rename to app/models/cost_query/filter/assigned_to_id.rb diff --git a/redmine_reporting/app/models/cost_query/filter/author_id.rb b/app/models/cost_query/filter/author_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/author_id.rb rename to app/models/cost_query/filter/author_id.rb diff --git a/redmine_reporting/app/models/cost_query/filter/base.rb b/app/models/cost_query/filter/base.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/base.rb rename to app/models/cost_query/filter/base.rb diff --git a/redmine_reporting/app/models/cost_query/filter/category_id.rb b/app/models/cost_query/filter/category_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/category_id.rb rename to app/models/cost_query/filter/category_id.rb diff --git a/redmine_reporting/app/models/cost_query/filter/cost_object_id.rb b/app/models/cost_query/filter/cost_object_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/cost_object_id.rb rename to app/models/cost_query/filter/cost_object_id.rb diff --git a/redmine_reporting/app/models/cost_query/filter/cost_type_id.rb b/app/models/cost_query/filter/cost_type_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/cost_type_id.rb rename to app/models/cost_query/filter/cost_type_id.rb diff --git a/redmine_reporting/app/models/cost_query/filter/created_on.rb b/app/models/cost_query/filter/created_on.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/created_on.rb rename to app/models/cost_query/filter/created_on.rb diff --git a/redmine_reporting/app/models/cost_query/filter/custom_field.rb b/app/models/cost_query/filter/custom_field.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/custom_field.rb rename to app/models/cost_query/filter/custom_field.rb diff --git a/redmine_reporting/app/models/cost_query/filter/due_date.rb b/app/models/cost_query/filter/due_date.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/due_date.rb rename to app/models/cost_query/filter/due_date.rb diff --git a/redmine_reporting/app/models/cost_query/filter/fixed_version_id.rb b/app/models/cost_query/filter/fixed_version_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/fixed_version_id.rb rename to app/models/cost_query/filter/fixed_version_id.rb diff --git a/redmine_reporting/app/models/cost_query/filter/issue_id.rb b/app/models/cost_query/filter/issue_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/issue_id.rb rename to app/models/cost_query/filter/issue_id.rb diff --git a/redmine_reporting/app/models/cost_query/filter/no_filter.rb b/app/models/cost_query/filter/no_filter.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/no_filter.rb rename to app/models/cost_query/filter/no_filter.rb diff --git a/redmine_reporting/app/models/cost_query/filter/overridden_costs.rb b/app/models/cost_query/filter/overridden_costs.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/overridden_costs.rb rename to app/models/cost_query/filter/overridden_costs.rb diff --git a/redmine_reporting/app/models/cost_query/filter/permission_filter.rb b/app/models/cost_query/filter/permission_filter.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/permission_filter.rb rename to app/models/cost_query/filter/permission_filter.rb diff --git a/redmine_reporting/app/models/cost_query/filter/priority_id.rb b/app/models/cost_query/filter/priority_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/priority_id.rb rename to app/models/cost_query/filter/priority_id.rb diff --git a/redmine_reporting/app/models/cost_query/filter/project_id.rb b/app/models/cost_query/filter/project_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/project_id.rb rename to app/models/cost_query/filter/project_id.rb diff --git a/redmine_reporting/app/models/cost_query/filter/spent_on.rb b/app/models/cost_query/filter/spent_on.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/spent_on.rb rename to app/models/cost_query/filter/spent_on.rb diff --git a/redmine_reporting/app/models/cost_query/filter/start_date.rb b/app/models/cost_query/filter/start_date.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/start_date.rb rename to app/models/cost_query/filter/start_date.rb diff --git a/redmine_reporting/app/models/cost_query/filter/status_id.rb b/app/models/cost_query/filter/status_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/status_id.rb rename to app/models/cost_query/filter/status_id.rb diff --git a/redmine_reporting/app/models/cost_query/filter/subject.rb b/app/models/cost_query/filter/subject.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/subject.rb rename to app/models/cost_query/filter/subject.rb diff --git a/redmine_reporting/app/models/cost_query/filter/tmonth.rb b/app/models/cost_query/filter/tmonth.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/tmonth.rb rename to app/models/cost_query/filter/tmonth.rb diff --git a/redmine_reporting/app/models/cost_query/filter/tracker_id.rb b/app/models/cost_query/filter/tracker_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/tracker_id.rb rename to app/models/cost_query/filter/tracker_id.rb diff --git a/redmine_reporting/app/models/cost_query/filter/tweek.rb b/app/models/cost_query/filter/tweek.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/tweek.rb rename to app/models/cost_query/filter/tweek.rb diff --git a/redmine_reporting/app/models/cost_query/filter/tyear.rb b/app/models/cost_query/filter/tyear.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/tyear.rb rename to app/models/cost_query/filter/tyear.rb diff --git a/redmine_reporting/app/models/cost_query/filter/updated_on.rb b/app/models/cost_query/filter/updated_on.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/updated_on.rb rename to app/models/cost_query/filter/updated_on.rb diff --git a/redmine_reporting/app/models/cost_query/filter/user_id.rb b/app/models/cost_query/filter/user_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/filter/user_id.rb rename to app/models/cost_query/filter/user_id.rb diff --git a/redmine_reporting/app/models/cost_query/group_by.rb b/app/models/cost_query/group_by.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by.rb rename to app/models/cost_query/group_by.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/activity_id.rb b/app/models/cost_query/group_by/activity_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/activity_id.rb rename to app/models/cost_query/group_by/activity_id.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/assigned_to_id.rb b/app/models/cost_query/group_by/assigned_to_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/assigned_to_id.rb rename to app/models/cost_query/group_by/assigned_to_id.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/author_id.rb b/app/models/cost_query/group_by/author_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/author_id.rb rename to app/models/cost_query/group_by/author_id.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/base.rb b/app/models/cost_query/group_by/base.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/base.rb rename to app/models/cost_query/group_by/base.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/category_id.rb b/app/models/cost_query/group_by/category_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/category_id.rb rename to app/models/cost_query/group_by/category_id.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/cost_object_id.rb b/app/models/cost_query/group_by/cost_object_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/cost_object_id.rb rename to app/models/cost_query/group_by/cost_object_id.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/cost_type_id.rb b/app/models/cost_query/group_by/cost_type_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/cost_type_id.rb rename to app/models/cost_query/group_by/cost_type_id.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/custom_field.rb b/app/models/cost_query/group_by/custom_field.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/custom_field.rb rename to app/models/cost_query/group_by/custom_field.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/fixed_version_id.rb b/app/models/cost_query/group_by/fixed_version_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/fixed_version_id.rb rename to app/models/cost_query/group_by/fixed_version_id.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/issue_id.rb b/app/models/cost_query/group_by/issue_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/issue_id.rb rename to app/models/cost_query/group_by/issue_id.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/priority_id.rb b/app/models/cost_query/group_by/priority_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/priority_id.rb rename to app/models/cost_query/group_by/priority_id.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/project_id.rb b/app/models/cost_query/group_by/project_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/project_id.rb rename to app/models/cost_query/group_by/project_id.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/ruby_aggregation.rb b/app/models/cost_query/group_by/ruby_aggregation.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/ruby_aggregation.rb rename to app/models/cost_query/group_by/ruby_aggregation.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/singleton_value.rb b/app/models/cost_query/group_by/singleton_value.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/singleton_value.rb rename to app/models/cost_query/group_by/singleton_value.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/spent_on.rb b/app/models/cost_query/group_by/spent_on.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/spent_on.rb rename to app/models/cost_query/group_by/spent_on.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/sql_aggregation.rb b/app/models/cost_query/group_by/sql_aggregation.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/sql_aggregation.rb rename to app/models/cost_query/group_by/sql_aggregation.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/status_id.rb b/app/models/cost_query/group_by/status_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/status_id.rb rename to app/models/cost_query/group_by/status_id.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/tmonth.rb b/app/models/cost_query/group_by/tmonth.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/tmonth.rb rename to app/models/cost_query/group_by/tmonth.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/tracker_id.rb b/app/models/cost_query/group_by/tracker_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/tracker_id.rb rename to app/models/cost_query/group_by/tracker_id.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/tweek.rb b/app/models/cost_query/group_by/tweek.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/tweek.rb rename to app/models/cost_query/group_by/tweek.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/tyear.rb b/app/models/cost_query/group_by/tyear.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/tyear.rb rename to app/models/cost_query/group_by/tyear.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/user_id.rb b/app/models/cost_query/group_by/user_id.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/user_id.rb rename to app/models/cost_query/group_by/user_id.rb diff --git a/redmine_reporting/app/models/cost_query/group_by/week.rb b/app/models/cost_query/group_by/week.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/group_by/week.rb rename to app/models/cost_query/group_by/week.rb diff --git a/redmine_reporting/app/models/cost_query/inherited_attribute.rb b/app/models/cost_query/inherited_attribute.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/inherited_attribute.rb rename to app/models/cost_query/inherited_attribute.rb diff --git a/redmine_reporting/app/models/cost_query/operator.rb b/app/models/cost_query/operator.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/operator.rb rename to app/models/cost_query/operator.rb diff --git a/redmine_reporting/app/models/cost_query/query_utils.rb b/app/models/cost_query/query_utils.rb similarity index 98% rename from redmine_reporting/app/models/cost_query/query_utils.rb rename to app/models/cost_query/query_utils.rb index 01cb4c0f82..d40d825932 100644 --- a/redmine_reporting/app/models/cost_query/query_utils.rb +++ b/app/models/cost_query/query_utils.rb @@ -127,14 +127,13 @@ module CostQuery::QueryUtils def iso_year_week(field, default_table = nil) field = field_name_for(field, default_table) "-- code specific for #{adapter_name}\n\t" << \ - case adapter_name - when :mysql + if mysql? "yearweek(#{field}, 1)" - when :postgresql + elsif postgresql? "(EXTRACT(isoyear from #{field})*100 + \n\t\t" \ "EXTRACT(week from #{field} - \n\t\t" \ "(EXTRACT(dow FROM #{field})::int+6)%7))" - when :sqlite + elsif sqlite? # enjoy <<-EOS case @@ -197,7 +196,7 @@ module CostQuery::QueryUtils end def mysql? - adapter_name == :mysql + [:mysql, :mysql2].include? adapter_name.to_s.downcase.to_sym end def sqlite? diff --git a/redmine_reporting/app/models/cost_query/result.rb b/app/models/cost_query/result.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/result.rb rename to app/models/cost_query/result.rb diff --git a/redmine_reporting/app/models/cost_query/sql_statement.rb b/app/models/cost_query/sql_statement.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/sql_statement.rb rename to app/models/cost_query/sql_statement.rb diff --git a/redmine_reporting/app/models/cost_query/table.rb b/app/models/cost_query/table.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/table.rb rename to app/models/cost_query/table.rb diff --git a/redmine_reporting/app/models/cost_query/transformer.rb b/app/models/cost_query/transformer.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/transformer.rb rename to app/models/cost_query/transformer.rb diff --git a/redmine_reporting/app/models/cost_query/validation.rb b/app/models/cost_query/validation.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/validation.rb rename to app/models/cost_query/validation.rb diff --git a/redmine_reporting/app/models/cost_query/validation/dates.rb b/app/models/cost_query/validation/dates.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/validation/dates.rb rename to app/models/cost_query/validation/dates.rb diff --git a/redmine_reporting/app/models/cost_query/validation/integers.rb b/app/models/cost_query/validation/integers.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/validation/integers.rb rename to app/models/cost_query/validation/integers.rb diff --git a/redmine_reporting/app/models/cost_query/validation/sql.rb b/app/models/cost_query/validation/sql.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/validation/sql.rb rename to app/models/cost_query/validation/sql.rb diff --git a/redmine_reporting/app/models/cost_query/walker.rb b/app/models/cost_query/walker.rb similarity index 100% rename from redmine_reporting/app/models/cost_query/walker.rb rename to app/models/cost_query/walker.rb diff --git a/redmine_reporting/app/models/entry.rb b/app/models/entry.rb similarity index 100% rename from redmine_reporting/app/models/entry.rb rename to app/models/entry.rb diff --git a/redmine_reporting/app/views/cost_reports/_cost_entry_table.rhtml b/app/views/cost_reports/_cost_entry_table.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/_cost_entry_table.rhtml rename to app/views/cost_reports/_cost_entry_table.rhtml diff --git a/redmine_reporting/app/views/cost_reports/_cost_report_table.rhtml b/app/views/cost_reports/_cost_report_table.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/_cost_report_table.rhtml rename to app/views/cost_reports/_cost_report_table.rhtml diff --git a/redmine_reporting/app/views/cost_reports/_filters.rhtml b/app/views/cost_reports/_filters.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/_filters.rhtml rename to app/views/cost_reports/_filters.rhtml diff --git a/redmine_reporting/app/views/cost_reports/_group_by.rhtml b/app/views/cost_reports/_group_by.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/_group_by.rhtml rename to app/views/cost_reports/_group_by.rhtml diff --git a/redmine_reporting/app/views/cost_reports/_restore_query.rhtml b/app/views/cost_reports/_restore_query.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/_restore_query.rhtml rename to app/views/cost_reports/_restore_query.rhtml diff --git a/redmine_reporting/app/views/cost_reports/_simple_cost_report_table.rhtml b/app/views/cost_reports/_simple_cost_report_table.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/_simple_cost_report_table.rhtml rename to app/views/cost_reports/_simple_cost_report_table.rhtml diff --git a/redmine_reporting/app/views/cost_reports/_sortable_init.rhtml b/app/views/cost_reports/_sortable_init.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/_sortable_init.rhtml rename to app/views/cost_reports/_sortable_init.rhtml diff --git a/redmine_reporting/app/views/cost_reports/available_values.rhtml b/app/views/cost_reports/available_values.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/available_values.rhtml rename to app/views/cost_reports/available_values.rhtml diff --git a/redmine_reporting/app/views/cost_reports/filters/_activate_filter.rhtml b/app/views/cost_reports/filters/_activate_filter.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/filters/_activate_filter.rhtml rename to app/views/cost_reports/filters/_activate_filter.rhtml diff --git a/redmine_reporting/app/views/cost_reports/filters/_available_value.rhtml b/app/views/cost_reports/filters/_available_value.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/filters/_available_value.rhtml rename to app/views/cost_reports/filters/_available_value.rhtml diff --git a/redmine_reporting/app/views/cost_reports/filters/_date.rhtml b/app/views/cost_reports/filters/_date.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/filters/_date.rhtml rename to app/views/cost_reports/filters/_date.rhtml diff --git a/redmine_reporting/app/views/cost_reports/filters/_heavy_values.rhtml b/app/views/cost_reports/filters/_heavy_values.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/filters/_heavy_values.rhtml rename to app/views/cost_reports/filters/_heavy_values.rhtml diff --git a/redmine_reporting/app/views/cost_reports/filters/_multi_values.rhtml b/app/views/cost_reports/filters/_multi_values.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/filters/_multi_values.rhtml rename to app/views/cost_reports/filters/_multi_values.rhtml diff --git a/redmine_reporting/app/views/cost_reports/filters/_operators.rhtml b/app/views/cost_reports/filters/_operators.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/filters/_operators.rhtml rename to app/views/cost_reports/filters/_operators.rhtml diff --git a/redmine_reporting/app/views/cost_reports/filters/_remove_filter.rhtml b/app/views/cost_reports/filters/_remove_filter.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/filters/_remove_filter.rhtml rename to app/views/cost_reports/filters/_remove_filter.rhtml diff --git a/redmine_reporting/app/views/cost_reports/filters/_text.rhtml b/app/views/cost_reports/filters/_text.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/filters/_text.rhtml rename to app/views/cost_reports/filters/_text.rhtml diff --git a/redmine_reporting/app/views/cost_reports/filters/_text_box.rhtml b/app/views/cost_reports/filters/_text_box.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/filters/_text_box.rhtml rename to app/views/cost_reports/filters/_text_box.rhtml diff --git a/redmine_reporting/app/views/cost_reports/index.rhtml b/app/views/cost_reports/index.rhtml similarity index 100% rename from redmine_reporting/app/views/cost_reports/index.rhtml rename to app/views/cost_reports/index.rhtml diff --git a/redmine_reporting/app/views/hooks/_view_projects_show_sidebar_bottom_hook.rhtml b/app/views/hooks/_view_projects_show_sidebar_bottom_hook.rhtml similarity index 100% rename from redmine_reporting/app/views/hooks/_view_projects_show_sidebar_bottom_hook.rhtml rename to app/views/hooks/_view_projects_show_sidebar_bottom_hook.rhtml diff --git a/redmine_reporting/assets/images/arrow_B_down.gif b/assets/images/arrow_B_down.gif similarity index 100% rename from redmine_reporting/assets/images/arrow_B_down.gif rename to assets/images/arrow_B_down.gif diff --git a/redmine_reporting/assets/images/arrow_B_left.gif b/assets/images/arrow_B_left.gif similarity index 100% rename from redmine_reporting/assets/images/arrow_B_left.gif rename to assets/images/arrow_B_left.gif diff --git a/redmine_reporting/assets/images/arrow_B_right.gif b/assets/images/arrow_B_right.gif similarity index 100% rename from redmine_reporting/assets/images/arrow_B_right.gif rename to assets/images/arrow_B_right.gif diff --git a/redmine_reporting/assets/images/arrow_B_up.gif b/assets/images/arrow_B_up.gif similarity index 100% rename from redmine_reporting/assets/images/arrow_B_up.gif rename to assets/images/arrow_B_up.gif diff --git a/redmine_reporting/assets/images/arrow_D_down.gif b/assets/images/arrow_D_down.gif similarity index 100% rename from redmine_reporting/assets/images/arrow_D_down.gif rename to assets/images/arrow_D_down.gif diff --git a/redmine_reporting/assets/images/arrow_D_left.gif b/assets/images/arrow_D_left.gif similarity index 100% rename from redmine_reporting/assets/images/arrow_D_left.gif rename to assets/images/arrow_D_left.gif diff --git a/redmine_reporting/assets/images/arrow_D_right.gif b/assets/images/arrow_D_right.gif similarity index 100% rename from redmine_reporting/assets/images/arrow_D_right.gif rename to assets/images/arrow_D_right.gif diff --git a/redmine_reporting/assets/images/arrow_D_up.gif b/assets/images/arrow_D_up.gif similarity index 100% rename from redmine_reporting/assets/images/arrow_D_up.gif rename to assets/images/arrow_D_up.gif diff --git a/redmine_reporting/assets/images/button_hover.png b/assets/images/button_hover.png similarity index 100% rename from redmine_reporting/assets/images/button_hover.png rename to assets/images/button_hover.png diff --git a/redmine_reporting/assets/images/button_inactive.png b/assets/images/button_inactive.png similarity index 100% rename from redmine_reporting/assets/images/button_inactive.png rename to assets/images/button_inactive.png diff --git a/redmine_reporting/assets/images/button_normal.png b/assets/images/button_normal.png similarity index 100% rename from redmine_reporting/assets/images/button_normal.png rename to assets/images/button_normal.png diff --git a/redmine_reporting/assets/images/remove.png b/assets/images/remove.png similarity index 100% rename from redmine_reporting/assets/images/remove.png rename to assets/images/remove.png diff --git a/redmine_reporting/assets/javascripts/reporting.js b/assets/javascripts/reporting.js similarity index 100% rename from redmine_reporting/assets/javascripts/reporting.js rename to assets/javascripts/reporting.js diff --git a/redmine_reporting/assets/javascripts/select_list_move_optgroup.js b/assets/javascripts/select_list_move_optgroup.js similarity index 100% rename from redmine_reporting/assets/javascripts/select_list_move_optgroup.js rename to assets/javascripts/select_list_move_optgroup.js diff --git a/redmine_reporting/assets/javascripts/sortable.js b/assets/javascripts/sortable.js similarity index 100% rename from redmine_reporting/assets/javascripts/sortable.js rename to assets/javascripts/sortable.js diff --git a/redmine_reporting/assets/stylesheets/reporting.css b/assets/stylesheets/reporting.css similarity index 100% rename from redmine_reporting/assets/stylesheets/reporting.css rename to assets/stylesheets/reporting.css diff --git a/redmine_reporting/config/locales/de.yml b/config/locales/de.yml similarity index 100% rename from redmine_reporting/config/locales/de.yml rename to config/locales/de.yml diff --git a/redmine_reporting/config/locales/en.yml b/config/locales/en.yml similarity index 100% rename from redmine_reporting/config/locales/en.yml rename to config/locales/en.yml diff --git a/redmine_reporting/config/routes.rb b/config/routes.rb similarity index 100% rename from redmine_reporting/config/routes.rb rename to config/routes.rb diff --git a/redmine_reporting/doc/untitled.html b/doc/untitled.html similarity index 100% rename from redmine_reporting/doc/untitled.html rename to doc/untitled.html diff --git a/redmine_reporting/features/calculations.feature b/features/calculations.feature similarity index 100% rename from redmine_reporting/features/calculations.feature rename to features/calculations.feature diff --git a/redmine_reporting/features/filter.feature b/features/filter.feature similarity index 87% rename from redmine_reporting/features/filter.feature rename to features/filter.feature index c8d7864521..15e5edf87a 100644 --- a/redmine_reporting/features/filter.feature +++ b/features/filter.feature @@ -54,6 +54,16 @@ Feature: Filter And "2" should be selected for "user_id_arg_1_val" And "!" should be selected for "operators_user_id" + @javascript + Scenario: A click on clear enables the option in the Add-Filter-Selectbox + Given there is a standard cost control project named "First Project" + And I am logged in as "controller" + And I am on the Cost Reports page for the project called "First Project" + Then "user_id" should not be selectable from "add_filter_select" + And filter "user_id" should be visible + When I click on "Clear" + Then "user_id" should be selectable from "add_filter_select" + @javascript Scenario: Setting a Filter disables the option in the Add-Filter-Selectbox Given there is a standard cost control project named "First Project" diff --git a/redmine_reporting/features/grouping.feature b/features/grouping.feature similarity index 65% rename from redmine_reporting/features/grouping.feature rename to features/grouping.feature index c02d9b8296..bd8690d859 100644 --- a/redmine_reporting/features/grouping.feature +++ b/features/grouping.feature @@ -13,9 +13,13 @@ Feature: Groups Given there is a standard cost control project named "First Project" And I am logged in as "controller" And I am on the Cost Reports page for the project called "First Project" + And I group rows by "User" + And I group rows by "Cost type" And I click on "Clear" Then I should not see "Week (Spent)" within "select[@id='group_by_columns']" And I should not see "Issue" within "select[@id='group_by_rows']" + And I should not see "User" within "select[@id='group_by_rows']" + And I should not see "Cost type" within "select[@id='group_by_rows']" @javascript Scenario: Groups can be added to either rows or columns @@ -30,6 +34,23 @@ Feature: Groups Then I should see "Project" within "select[@id='group_by_rows']" And I should not see "Project" within "select[@id='group_by_container']" + @javascript + Scenario: Groups can be removed from rows and columns + Given there is a standard cost control project named "First Project" + And I am logged in as "controller" + And I am on the Cost Reports page for the project called "First Project" + And I click on "Clear" + And I group columns by "Issue" + And I group rows by "Project" + Then I should see "Issue" within "select[@id='group_by_columns']" + And I should see "Project" within "select[@id='group_by_rows']" + When I remove "Project" from rows + And I remove "Issue" from columns + Then I should not see "Issue" within "select[@id='group_by_columns']" + And I should not see "Project" within "select[@id='group_by_rows']" + And I should see "Project" within "select[@id='group_by_container']" + And I should see "Issue" within "select[@id='group_by_container']" + @javascript Scenario: Groups get restored after sending a query Given there is a standard cost control project named "First Project" @@ -44,4 +65,4 @@ Feature: Groups Then I should see "Project" within "select[@id='group_by_columns']" And I should see "Issue" within "select[@id='group_by_columns']" And I should see "User" within "select[@id='group_by_rows']" - And I should see "User" within "select[@id='group_by_rows']" + And I should see "Cost type" within "select[@id='group_by_rows']" diff --git a/redmine_reporting/features/links.feature b/features/links.feature similarity index 100% rename from redmine_reporting/features/links.feature rename to features/links.feature diff --git a/redmine_reporting/features/permission_variations.feature b/features/permission_variations.feature similarity index 100% rename from redmine_reporting/features/permission_variations.feature rename to features/permission_variations.feature diff --git a/redmine_reporting/features/permissions.feature b/features/permissions.feature similarity index 100% rename from redmine_reporting/features/permissions.feature rename to features/permissions.feature diff --git a/redmine_reporting/features/step_definitions/custom_steps.rb b/features/step_definitions/custom_steps.rb similarity index 91% rename from redmine_reporting/features/step_definitions/custom_steps.rb rename to features/step_definitions/custom_steps.rb index 93acf435df..89368b9e6f 100644 --- a/redmine_reporting/features/step_definitions/custom_steps.rb +++ b/features/step_definitions/custom_steps.rb @@ -67,3 +67,9 @@ Given /^I group (rows|columns) by "([^"]*)"/ do |target, group| When %{I select "#{group}" from "group_by_container"} find(:xpath, "//input[@class='buttons group_by move #{destination}']").click end + +Given /^I remove "([^"]*)" from (rows|columns)/ do |group, source| + movement = source == "rows" ? "moveRight" : "moveDown" + When %{I select "#{group}" from "group_by_#{source}"} + find(:xpath, "//input[@class='buttons group_by move #{movement}']").click +end diff --git a/redmine_reporting/init.rb b/init.rb similarity index 100% rename from redmine_reporting/init.rb rename to init.rb diff --git a/redmine_reporting/lang/de.yml b/lang/de.yml similarity index 100% rename from redmine_reporting/lang/de.yml rename to lang/de.yml diff --git a/redmine_reporting/lang/en.yml b/lang/en.yml similarity index 100% rename from redmine_reporting/lang/en.yml rename to lang/en.yml diff --git a/redmine_reporting/lib/big_decimal_patch.rb b/lib/big_decimal_patch.rb similarity index 100% rename from redmine_reporting/lib/big_decimal_patch.rb rename to lib/big_decimal_patch.rb diff --git a/redmine_reporting/lib/to_date_patch.rb b/lib/to_date_patch.rb similarity index 100% rename from redmine_reporting/lib/to_date_patch.rb rename to lib/to_date_patch.rb diff --git a/redmine_reporting/lib/view_projects_show_sidebar_bottom_hook.rb b/lib/view_projects_show_sidebar_bottom_hook.rb similarity index 100% rename from redmine_reporting/lib/view_projects_show_sidebar_bottom_hook.rb rename to lib/view_projects_show_sidebar_bottom_hook.rb diff --git a/redmine_reporting/spec/fixtures/cost_entries.yml b/spec/fixtures/cost_entries.yml similarity index 100% rename from redmine_reporting/spec/fixtures/cost_entries.yml rename to spec/fixtures/cost_entries.yml diff --git a/redmine_reporting/spec/fixtures/cost_types.yml b/spec/fixtures/cost_types.yml similarity index 100% rename from redmine_reporting/spec/fixtures/cost_types.yml rename to spec/fixtures/cost_types.yml diff --git a/redmine_reporting/spec/fixtures/custom_fields.yml b/spec/fixtures/custom_fields.yml similarity index 100% rename from redmine_reporting/spec/fixtures/custom_fields.yml rename to spec/fixtures/custom_fields.yml diff --git a/redmine_reporting/spec/fixtures/custom_fields_projects.yml b/spec/fixtures/custom_fields_projects.yml similarity index 100% rename from redmine_reporting/spec/fixtures/custom_fields_projects.yml rename to spec/fixtures/custom_fields_projects.yml diff --git a/redmine_reporting/spec/fixtures/custom_fields_trackers.yml b/spec/fixtures/custom_fields_trackers.yml similarity index 100% rename from redmine_reporting/spec/fixtures/custom_fields_trackers.yml rename to spec/fixtures/custom_fields_trackers.yml diff --git a/redmine_reporting/spec/fixtures/custom_values.yml b/spec/fixtures/custom_values.yml similarity index 100% rename from redmine_reporting/spec/fixtures/custom_values.yml rename to spec/fixtures/custom_values.yml diff --git a/redmine_reporting/spec/fixtures/enabled_modules.yml b/spec/fixtures/enabled_modules.yml similarity index 100% rename from redmine_reporting/spec/fixtures/enabled_modules.yml rename to spec/fixtures/enabled_modules.yml diff --git a/redmine_reporting/spec/fixtures/enumerations.yml b/spec/fixtures/enumerations.yml similarity index 100% rename from redmine_reporting/spec/fixtures/enumerations.yml rename to spec/fixtures/enumerations.yml diff --git a/redmine_reporting/spec/fixtures/issue_categories.yml b/spec/fixtures/issue_categories.yml similarity index 100% rename from redmine_reporting/spec/fixtures/issue_categories.yml rename to spec/fixtures/issue_categories.yml diff --git a/redmine_reporting/spec/fixtures/issue_statuses.yml b/spec/fixtures/issue_statuses.yml similarity index 100% rename from redmine_reporting/spec/fixtures/issue_statuses.yml rename to spec/fixtures/issue_statuses.yml diff --git a/redmine_reporting/spec/fixtures/issues.yml b/spec/fixtures/issues.yml similarity index 100% rename from redmine_reporting/spec/fixtures/issues.yml rename to spec/fixtures/issues.yml diff --git a/redmine_reporting/spec/fixtures/projects.yml b/spec/fixtures/projects.yml similarity index 100% rename from redmine_reporting/spec/fixtures/projects.yml rename to spec/fixtures/projects.yml diff --git a/redmine_reporting/spec/fixtures/rates.yml b/spec/fixtures/rates.yml similarity index 100% rename from redmine_reporting/spec/fixtures/rates.yml rename to spec/fixtures/rates.yml diff --git a/redmine_reporting/spec/fixtures/roles.yml b/spec/fixtures/roles.yml similarity index 100% rename from redmine_reporting/spec/fixtures/roles.yml rename to spec/fixtures/roles.yml diff --git a/redmine_reporting/spec/fixtures/time_entries.yml b/spec/fixtures/time_entries.yml similarity index 100% rename from redmine_reporting/spec/fixtures/time_entries.yml rename to spec/fixtures/time_entries.yml diff --git a/redmine_reporting/spec/fixtures/trackers.yml b/spec/fixtures/trackers.yml similarity index 100% rename from redmine_reporting/spec/fixtures/trackers.yml rename to spec/fixtures/trackers.yml diff --git a/redmine_reporting/spec/fixtures/users.yml b/spec/fixtures/users.yml similarity index 100% rename from redmine_reporting/spec/fixtures/users.yml rename to spec/fixtures/users.yml diff --git a/redmine_reporting/spec/fixtures/versions.yml b/spec/fixtures/versions.yml similarity index 100% rename from redmine_reporting/spec/fixtures/versions.yml rename to spec/fixtures/versions.yml diff --git a/redmine_reporting/spec/models/cost_query/chaining_spec.rb b/spec/models/cost_query/chaining_spec.rb similarity index 100% rename from redmine_reporting/spec/models/cost_query/chaining_spec.rb rename to spec/models/cost_query/chaining_spec.rb diff --git a/redmine_reporting/spec/models/cost_query/filter_spec.rb b/spec/models/cost_query/filter_spec.rb similarity index 100% rename from redmine_reporting/spec/models/cost_query/filter_spec.rb rename to spec/models/cost_query/filter_spec.rb diff --git a/redmine_reporting/spec/models/cost_query/group_by_spec.rb b/spec/models/cost_query/group_by_spec.rb similarity index 100% rename from redmine_reporting/spec/models/cost_query/group_by_spec.rb rename to spec/models/cost_query/group_by_spec.rb diff --git a/redmine_reporting/spec/models/cost_query/integration_spec.rb b/spec/models/cost_query/integration_spec.rb similarity index 100% rename from redmine_reporting/spec/models/cost_query/integration_spec.rb rename to spec/models/cost_query/integration_spec.rb diff --git a/redmine_reporting/spec/models/cost_query/operator_spec.rb b/spec/models/cost_query/operator_spec.rb similarity index 100% rename from redmine_reporting/spec/models/cost_query/operator_spec.rb rename to spec/models/cost_query/operator_spec.rb diff --git a/redmine_reporting/spec/models/cost_query/query_helper.rb b/spec/models/cost_query/query_helper.rb similarity index 100% rename from redmine_reporting/spec/models/cost_query/query_helper.rb rename to spec/models/cost_query/query_helper.rb diff --git a/redmine_reporting/spec/models/cost_query/result_spec.rb b/spec/models/cost_query/result_spec.rb similarity index 100% rename from redmine_reporting/spec/models/cost_query/result_spec.rb rename to spec/models/cost_query/result_spec.rb diff --git a/redmine_reporting/spec/models/cost_query/validation_spec.rb b/spec/models/cost_query/validation_spec.rb similarity index 100% rename from redmine_reporting/spec/models/cost_query/validation_spec.rb rename to spec/models/cost_query/validation_spec.rb diff --git a/redmine_reporting/spec/models/cost_query/walker_spec.rb b/spec/models/cost_query/walker_spec.rb similarity index 100% rename from redmine_reporting/spec/models/cost_query/walker_spec.rb rename to spec/models/cost_query/walker_spec.rb diff --git a/redmine_reporting/spec/models/helpers/project_helper.rb b/spec/models/helpers/project_helper.rb similarity index 100% rename from redmine_reporting/spec/models/helpers/project_helper.rb rename to spec/models/helpers/project_helper.rb diff --git a/redmine_reporting/spec/models/helpers/query_helper.rb b/spec/models/helpers/query_helper.rb similarity index 100% rename from redmine_reporting/spec/models/helpers/query_helper.rb rename to spec/models/helpers/query_helper.rb diff --git a/redmine_reporting/spec/spec_helper.rb b/spec/spec_helper.rb similarity index 100% rename from redmine_reporting/spec/spec_helper.rb rename to spec/spec_helper.rb diff --git a/redmine_reporting/tasks/spec.rake b/tasks/spec.rake similarity index 100% rename from redmine_reporting/tasks/spec.rake rename to tasks/spec.rake diff --git a/redmine_reporting/test/test_helper.rb b/test/test_helper.rb similarity index 100% rename from redmine_reporting/test/test_helper.rb rename to test/test_helper.rb