Skip to content

Commit

Permalink
fixed #106
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Treubert committed Aug 17, 2022
1 parent f93b606 commit cf582da
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 96 deletions.
Empty file.
100 changes: 98 additions & 2 deletions init.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,100 @@
require_relative './lib/mega_calendar/filters.rb'
## SNIP - Filters
$mc_filters = {}
$mc_filters['assignee'] = {
:type => 'lookup',
:label => 'field_assigned_to',
:db_field => 'issues.assigned_to_id',
:db_field_holiday => 'holidays.user_id',
:lookup_id => 'id',
:operators => [:contains, :not_contains],
:lookup_value => 'name',
:lookup_query_model => 'Holiday',
:lookup_query_method => 'get_activated_users',
:lookup_query_order => nil,
:condition => nil,
:condition_holiday => nil
}
$mc_filters['assignee_group'] = {
:type => 'lookup',
:label => 'label_group',
:db_field => 'issues.assigned_to_id',
:db_field_holiday => 'holidays.user_id',
:lookup_id => 'id',
:operators => [:contains, :not_contains],
:lookup_value => 'lastname',
:lookup_query_model => 'Holiday',
:lookup_query_method => 'get_activated_groups',
:lookup_query_order => nil,
:condition => '##FIELD_ID## IN (SELECT user_id FROM groups_users WHERE group_id ##OPERATOR## (?)) OR ##FIELD_ID## ##OPERATOR## (?)',
:condition_holiday => '##FIELD_ID## IN (SELECT user_id FROM groups_users WHERE group_id ##OPERATOR## (?))'
}
$mc_filters['status'] = {
:type => 'lookup',
:label => 'label_issue_status',
:db_field => 'issues.status_id',
:lookup_id => 'id',
:operators => [:contains, :not_contains],
:lookup_value => 'name',
:lookup_query_model => 'IssueStatus',
:lookup_query_method => 'all',
:lookup_query_order => "issue_statuses.name ASC",
:condition => nil,
:condition_holiday => nil
}
$mc_filters['project'] = {
:type => 'lookup',
:label => 'label_project',
:db_field => 'issues.project_id',
:lookup_id => 'id',
:operators => [:contains, :not_contains],
:lookup_value => 'name',
:lookup_query_model => 'Project',
:lookup_query_method => 'all',
:lookup_query_order => "projects.name ASC",
:condition => nil,
:condition_holiday => nil
}
$mc_filters['tracker'] = {
:type => 'lookup',
:label => 'label_tracker',
:db_field => 'issues.tracker_id',
:lookup_id => 'id',
:operators => [:contains, :not_contains],
:lookup_value => 'name',
:lookup_query_model => 'Tracker',
:lookup_query_method => 'all',
:lookup_query_order => "trackers.name ASC",
:condition => nil,
:condition_holiday => nil
}
$mc_filters['priority'] = {
:type => 'lookup',
:label => 'field_priority',
:db_field => 'issues.priority_id',
:lookup_id => 'id',
:operators => [:contains, :not_contains],
:lookup_value => 'name',
:lookup_query_model => 'IssuePriority',
:lookup_query_method => 'all',
:lookup_query_order => nil,
:condition => nil,
:condition_holiday => nil
}
$mc_filters['version'] = {
:type => 'lookup',
:label => 'field_version',
:db_field => 'issues.fixed_version_id',
:lookup_id => 'id',
:operators => [:contains, :not_contains],
:lookup_value => 'name',
:lookup_query_model => 'Version',
:lookup_query_method => 'all',
:lookup_query_order => "versions.name ASC",
:condition => nil,
:condition_holiday => nil
}
## SNAP - Filters

require 'vpim'
require_dependency Rails.root.join('plugins','mega_calendar','lib','mega_calendar','users_controller_patch')
require_dependency Rails.root.join('plugins','mega_calendar','lib','mega_calendar','issues_controller_patch')
Expand All @@ -7,7 +103,7 @@
name 'Mega Calendar plugin'
author 'Andreas Treubert'
description 'Better calendar for redmine'
version '1.9.0'
version '1.9.1'
url 'https://github.com/berti92/mega_calendar'
author_url 'https://github.com/berti92'
requires_redmine :version_or_higher => '5.0.0'
Expand Down
94 changes: 0 additions & 94 deletions lib/mega_calendar/filters.rb

This file was deleted.

0 comments on commit cf582da

Please sign in to comment.