Mercurial > hg > soundsoftware-site
changeset 614:712324fee0c0 feature_36
Started working on Feature #241.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Tue, 23 Aug 2011 15:47:15 +0100 |
parents | 3b63cea01e7b |
children | c4ddb9531f4c 156bd1153f47 |
files | vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb vendor/plugins/redmine_bibliography/init.rb |
diffstat | 2 files changed, 11 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Tue Aug 23 14:49:27 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Tue Aug 23 15:47:15 2011 +0100 @@ -7,6 +7,9 @@ model_object Publication before_filter :find_model_object, :except => [:new, :create, :index, :autocomplete_for_project, :add_author, :sort_author_order, :autocomplete_for_author, :get_user_info ] + before_filter :find_project_by_project_id, :authorize, :only => :edit + + # before_filter :find_project, :except => [:autocomplete_for_project, :add_author, :sort_authors, :autocomplete_for_author] def new @@ -18,14 +21,16 @@ # and at least one author # @publication.authorships.build.build_author - @author_options = Authorship.like_unique(User.name).find(:all, :limit => 100) + @author_options = [User.current] + + end def create @project = Project.find(params[:project_id]) - @author_options = Authorship.like_unique(User.name).find(:all, :limit => 100) - + @author_options = [User.current] + @publication = Publication.new(params[:publication]) @publication.projects << @project unless @project.nil?
--- a/vendor/plugins/redmine_bibliography/init.rb Tue Aug 23 14:49:27 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/init.rb Tue Aug 23 15:47:15 2011 +0100 @@ -31,8 +31,8 @@ settings :default => { 'menu' => 'Bibliography' }, :partial => 'settings/bibliography' project_module :redmine_bibliography do - permission :publications, { :publications => :index }, :public => true - permission :edit_redmine_bibliography, {:redmine_bibliography => [:edit, :update]} + permission :publications, { :publications => :index } + permission :edit_publication, {:redmine_bibliography => [:edit, :update]} permission :add_publication, {:redmine_bibliography => [:new, :create]} end @@ -40,4 +40,4 @@ menu :project_menu, :publications, { :controller => 'publications', :action => 'index', :path => nil }, :after => :activity, :param => :project_id, :caption => Proc.new { Setting.plugin_redmine_bibliography['menu'] }, :if => Proc.new { !Setting.plugin_redmine_bibliography['menu'].blank? } -end \ No newline at end of file +end