Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

move from sidebar to "also available in" bottom links

  • Loading branch information...
commit 61a1f211758d14623539180b114303110d94d5dd 1 parent 14a9a64
@yeah yeah authored
View
2  README.rdoc
@@ -10,6 +10,8 @@ GPL v2
This plug-in requires icalendar >= 1.1.5 (http://icalendar.rubyforge.org/).
+Further, a the hook view_calendars_show_bottom needs to be present in app/views/calendars/show.html.erb. The hook is not yet in Redmine core, a patch can be found in extra/. If you want this hook in Redmine Core to avoid patching your Redmine, please vote for it here: http://www.redmine.org/issues/6586
+
== Implementation details
Issues are exported as VEVENT-items with their due-date as the event date. The same applies to versions. Unassigned issues have the status TENTATIVE.
View
5 app/views/hooks/redmine_icalendar_export/_view_calendars_show_bottom.html.erb
@@ -0,0 +1,5 @@
+<% if User.current.allowed_to?(:view_calendar, @project, :global => true)%>
+ <% other_formats_links do |f| %>
+ <%= f.link_to 'ICS', :url => { :status => 'all', :assigned_to => '*', :controller => 'i_calendar', :action => 'index', :project_id => @project, :key => User.current.rss_key, :format => 'atom' } %>
+ <% end %>
+<% end %>
View
10 init.rb
@@ -1,5 +1,6 @@
# redmics - redmine icalendar export plugin
-# Copyright (c) 2010 Frank Schwarz, frank.schwarz@buschmais.com
+# Copyright (c) 2010 Frank Schwarz, frank.schwarz@buschmais.com,
+# Jan Schulz-Hofen (Planio), jan@plan.io
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -17,14 +18,15 @@
require 'redmine'
-require 'sidebar_hooks'
+require 'redmine_icalendar_export/hooks'
Redmine::Plugin.register :redmine_icalendar_export do
name 'redmine icalendar export plugin (aka redmics)'
- author 'Frank Schwarz'
+ author 'Frank Schwarz, Jan Schulz-Hofen (Planio)'
description 'ICalendar view of issue- and version-deadlines'
- version '1.0'
+ version '1.1'
url 'http://code.google.com/p/redmics/'
author_url 'http://www.buschmais.de/'
end
+
View
22 lib/redmine_icalendar_export/hooks.rb
@@ -0,0 +1,22 @@
+# redmics - redmine icalendar export plugin
+# Copyright (c) 2010 Frank Schwarz, frank.schwarz@buschmais.com,
+# Jan Schulz-Hofen (Planio), jan@plan.io
+#
+# 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.
+module RedmineIcalendarExport
+ class ViewHooks < Redmine::Hook::ViewListener
+ render_on :view_calendars_show_bottom, :partial => 'hooks/redmine_icalendar_export/view_calendars_show_bottom'
+ end
+end
View
45 lib/sidebar_hooks.rb
@@ -1,45 +0,0 @@
-# redmics - redmine icalendar export plugin
-# Copyright (c) 2010 Frank Schwarz, frank.schwarz@buschmais.com
-#
-# 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.
-
-class SidebarHooks < Redmine::Hook::ViewListener
-
- def view_issues_sidebar_planning_bottom(context = { })
- project = context[:project]
-
- unless User.current.allowed_to?(:view_calendar, project, :global => true)
- return ""
- end
-
- result = "<h3>%s</h3>\n" % l(:label_icalendar_header)
-
- label = {
- 'me' => l(:label_issues_mine),
- '+' => l(:label_issues_assigned),
- '*' => l(:label_issues_all)
- }
- label_open = l(:label_issues_open_only)
- label.keys.sort.each {|type|
- link_all = link_to(label[type], :status => 'all', :assigned_to => type, :controller => 'i_calendar', :action => 'index', :project_id => project, :key => User.current.rss_key, :format => 'atom')
- link_open = link_to(label_open, :status => 'open', :assigned_to => type, :controller => 'i_calendar', :action => 'index', :project_id => project, :key => User.current.rss_key, :format => 'atom')
- result += "#{link_all} (#{link_open})<br/>\n";
- }
-
- return result
- end
-
-end
-
Please sign in to comment.
Something went wrong with that request. Please try again.