# HG changeset patch # User luisf # Date 1311963326 -3600 # Node ID 56ad0c490f5e65dc5514b53031d92531bff4daa0 # Parent 7c4b96efa40281a1f785027bc7722f40bd8d9a2e Closes Bug #217. The project_id parameter is now being sent in all links. This may generate some errors when outside a project, but I shall file new issues as I detect them. diff -r 7c4b96efa402 -r 56ad0c490f5e vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Fri Jul 29 18:14:28 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Fri Jul 29 19:15:26 2011 +0100 @@ -68,7 +68,9 @@ end end - def edit + def edit + find_project_by_project_id unless params[:project_id].nil? + @publication = Publication.find(params[:id]) @selected_bibtex_entry_type_id = @publication.bibtex_entry.entry_type end @@ -92,12 +94,10 @@ end def show - logger.error { "PARAMS PROJECT_ID #{params[:project_id]} <---" } - find_project_by_project_id unless params[:project_id].nil? @publication = Publication.find(params[:id]) - + if @publication.nil? @publications = Publication.all render "index", :alert => 'The publication was not found!' diff -r 7c4b96efa402 -r 56ad0c490f5e vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb Fri Jul 29 18:14:28 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb Fri Jul 29 19:15:26 2011 +0100 @@ -12,8 +12,6 @@

<%= link_to_add_fields l(:label_add_another_author), f, :authorships %>

- <%= f.submit %> -
diff -r 7c4b96efa402 -r 56ad0c490f5e vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb Fri Jul 29 18:14:28 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb Fri Jul 29 19:15:26 2011 +0100 @@ -6,8 +6,10 @@ <% form_for @publication, :url => { :project_id => @project_id, :action => :update }, :builder => TabularFormBuilder do |f| -%> <%= render :partial => 'form', :locals => { :f => f } %> + + <%= f.submit %> <% end %>

- <%= link_to "Show", @publication %> | - <%= link_to "View All", publications_path %> + <%= link_to l(:label_publication_show), { :controller => "publications", :action => "show", :id => @publication, :project_id => @project } %> | + <%= link_to l(:label_publication_index), { :controller => "publications", :action => "index", :project_id => @project } %>

diff -r 7c4b96efa402 -r 56ad0c490f5e vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb Fri Jul 29 18:14:28 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb Fri Jul 29 19:15:26 2011 +0100 @@ -6,4 +6,5 @@ <% form_for @publication, :url => { :project_id => @project_id, :action => :create }, :builder => TabularFormBuilder do |f| -%> <%= render :partial => 'form', :locals => { :f => f } %> + <%= f.submit %> <% end %> \ No newline at end of file diff -r 7c4b96efa402 -r 56ad0c490f5e vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb Fri Jul 29 18:14:28 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb Fri Jul 29 19:15:26 2011 +0100 @@ -22,7 +22,7 @@ <%- end -%>

- <%= link_to "Edit", edit_publication_path(@publication) %> | + <%= link_to l(:label_publication_edit), { :controller => "publications", :action => "edit", :id => @publication, :project_id => @project } %> | <%= link_to "Destroy", @publication, :confirm => 'Are you sure?', :method => :delete %> | <%= link_to "View All", publications_path %>

@@ -32,13 +32,10 @@ <% projects = Project.active.find(:all, :limit => 100, :order => 'name ASC') - @publication.projects %>
- - -

List of Projects

+ +

<%=l(:label_publication_project_index)%>

<%= render :partial => 'list_projects' %>

- - <%= render :partial => 'add_project_form' %> - + <%= render :partial => 'add_project_form' %>
\ No newline at end of file diff -r 7c4b96efa402 -r 56ad0c490f5e vendor/plugins/redmine_bibliography/config/locales/en.yml --- a/vendor/plugins/redmine_bibliography/config/locales/en.yml Fri Jul 29 18:14:28 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/config/locales/en.yml Fri Jul 29 19:15:26 2011 +0100 @@ -29,6 +29,8 @@ label_publication_show: "Publication Details" label_add_project_to_publication: "Add Project to Publication" label_project_search: "Search by name: " + label_publication_project_index: "Projects associated with this publication" + label_publication_index: "View all publications" text_author_email: "Author's email address as on the paper." text_author_institution: "Author's institution name as on paper."