Mercurial > hg > soundsoftware-site
diff vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb @ 554:026c9747fe9b feature_36
Addresses Feature #228. Already able to remove projects associated with a publication.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Tue, 02 Aug 2011 16:50:22 +0100 |
parents | e25c069ab3b8 |
children | 2fe129b04d82 |
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Mon Aug 01 21:18:37 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Tue Aug 02 16:50:22 2011 +0100 @@ -232,6 +232,26 @@ end render :nothing => true end + + def remove_from_project_list + pub = Publication.find(params[:id]) + proj = Project.find(params[:project_id]) + + if pub.projects.length > 1 + if pub.projects.exists? proj + pub.projects.delete proj if request.post? + end + else + logger.error { "Cannot remove project from publication list" } + end + + respond_to do |format| + format.js { render(:update) {|page| page.replace_html "list_projects", :partial => 'list_projects', :id => pub} } + end + + + end + def identify_author