1 class PublicationsController < ApplicationController
4 # before_filter :authorize, :only => [:issues]
7 @publications = Publication.all
10 format.xml { render :xml => @publications }
11 format.json { render :json => @publications }
16 regexp = Regexp.new(Setting.plugin_redmine_publications[:pattern])
17 Repository.all.each do |repo|
18 repo.entries.each do |entry|
19 match = entry.path.match(regexp)
21 Publication.find_or_create_by_name(:name => match[1],
22 :source_file => entry.path, :repository_id => repo.id)
29 @publication = Publication.find_by_name(params[:pub])
31 joins = "JOIN issue_publications ON (issues.id = issue_publications.issue_id)"
32 conditions = ['issue_publications.publication_id = ? ', @publication.id ]
33 @issues = Issue.all(:joins => joins, :conditions => conditions)
34 respond_to do |format|
37 render :xml => @issues
41 headers['Content-Type'] = 'application/json'
42 render :json => @issues
47 def redirect_to_platform
54 @project = Project.find(params[:project_id])