changeset 548:3954b253cdb3 luisf

Merge from branch "feature_36"
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Fri, 29 Jul 2011 19:28:55 +0100
parents 8a26a0e291cf (current diff) 56ad0c490f5e (diff)
children 1710ec37bb6a
files
diffstat 67 files changed, 1454 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/app/models/user.rb	Mon Jul 25 14:53:18 2011 +0100
+++ b/app/models/user.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -54,6 +54,8 @@
   
   has_one :ssamr_user_detail, :dependent => :destroy, :class_name => 'SsamrUserDetail'
   accepts_nested_attributes_for :ssamr_user_detail
+  
+  has_one :author
 
   # Active non-anonymous users scope
   named_scope :active, :conditions => "#{User.table_name}.status = #{STATUS_ACTIVE}"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/README.rdoc	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,3 @@
+= bibliography
+
+Description goes here
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/controllers/authors_controller.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,7 @@
+class AuthorsController < ApplicationController
+  
+  def index
+    @authors = Author.find(:all)
+  end
+
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/controllers/authorships_controller.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,10 @@
+class AuthorshipsController < ApplicationController
+  
+  def index
+    
+  end
+  
+
+  def update
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/controllers/bibtex_entries_controller.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,3 @@
+class BibtexEntriesController < ApplicationController
+
+end
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,242 @@
+# vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb
+
+class PublicationsController < ApplicationController
+  unloadable
+  
+  # before_filter :find_project, :except => [:autocomplete_for_project, :add_author, :sort_authors, :autocomplete_for_author]
+    
+  def new
+    find_project_by_project_id
+    @publication = Publication.new
+    
+    # we'll always want a new publication to have its bibtex entry
+    @publication.build_bibtex_entry
+    
+    # and at least one author
+    # @publication.authorships.build.build_author
+    
+    @project_id = params[:project_id]
+    @current_user = User.current    
+  end
+
+
+  def create    
+    find_project_by_project_id
+    
+    @publication = Publication.new(params[:publication])
+
+    # @project = Project.find(params[:project_id])
+    @publication.projects << @project
+    
+    if @publication.save 
+      flash[:notice] = "Successfully created publication."
+      redirect_to :action => :show, :id => @publication, :project_id => @project.id
+    else
+      render :action => 'new'
+    end
+  end
+
+  def index
+    if !params[:project_id].nil?
+      find_project_by_project_id
+      @project = Project.find(params[:project_id])
+      @publications = Publication.find :all, :joins => :projects, :conditions => ["project_id = ?", @project.id]
+    else
+      @publications = Publication.find :all
+    end
+  end
+
+  def new_from_bibfile
+    @publication.current_step = session[:publication_step]
+    
+    # contents of the paste text area
+    bibtex_entry = params[:bibtex_entry]
+
+    # method for creating "pasted" bibtex entries
+    if bibtex_entry
+      parse_bibtex_list bibtex_entry    
+    end
+  end
+
+  def add_author
+    if (request.xhr?)
+      render :text => User.find(params[:user_id]).name
+    else
+      # No?  Then render an action.
+      #render :action => 'view_attribute', :attr => @name
+      logger.error { "ERRO ADD AUTHOR" }
+    end
+  end
+
+  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
+
+  def update    
+    @publication = Publication.find(params[:id])        
+
+    logger.error { "INSIDE THE UPDATE ACTION IN THE PUBLICATION CONTROLLER" }
+
+    if @publication.update_attributes(params[:publication])
+      flash[:notice] = "Successfully updated Publication."
+
+      if !params[:project_id].nil?
+        redirect_to :action => :show, :id => @publication, :project_id => params[:project_id]
+      else
+        redirect_to :action => :show, :id => @publication
+      end
+    else
+      render :action => 'edit'
+    end   
+  end
+
+  def show
+    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!'
+    else
+      @authors = @publication.authors
+      @bibtext_entry = @publication.bibtex_entry
+    end
+  end
+
+  # parse string with bibtex authors
+  def parse_authors(authors_entry)
+    # in bibtex the authors are always seperated by "and"
+    return authors_entry.split(" and ")
+  end
+
+  # parses a list of bibtex 
+  def parse_bibtex_list(bibtex_list)
+    bibliography = BibTeX.parse bibtex_list
+
+    no_entries = bibliography.data.length
+
+    # parses the bibtex entries
+    bibliography.data.map do |d|
+
+      if d.class == BibTeX::Entry
+        create_bibtex_entry d
+      end
+    end
+  end 
+
+  def create_bibtex_entry(d)        
+    @publication = Publication.new
+    @bentry = BibtexEntry.new        
+    authors = []
+    institution = ""
+    email = ""
+
+    d.fields.keys.map do |field|
+      case field.to_s
+      when "author"
+        authors = parse_authors d[field]
+      when "title"
+        @publication.title = d[field]
+      when "institution"
+        institution = d[field]
+      when "email"
+        email = d[field]
+      else
+        @bentry[field] = d[field]
+      end
+    end 
+
+    @publication.bibtex_entry = @bentry
+    @publication.save
+
+    # what is this for??? 
+    # @created_publications << @publication.id
+
+    # need to save all authors
+    #   and establish the author-publication association 
+    #   via the authorships table 
+    authors.each_with_index.map do |authorname, idx|
+      author = Author.new(:name => authorname)
+      if author.save!
+        puts "SAVED"
+      else
+        puts "NOT SAVED"
+      end
+
+      author.authorships.create!(
+        :publication => @publication,
+        :institution => institution,
+        :email => email,
+        :order => idx)
+    end
+  end
+
+  # parses the bibtex file
+  def parse_bibtex_file
+
+  end
+
+  def import
+    @publication = Publication.new
+    
+    
+  end
+  
+  def add_project
+    @projects = Project.find(params[:publication][:project_ids])    
+    @publication = Publication.find(params[:id])        
+    @publication.projects << @projects
+    
+    # TODO luisf should also respond to HTML??? 
+    respond_to do |format|
+      format.js      
+    end
+  end
+
+  def autocomplete_for_project
+    @publication = Publication.find(params[:id])
+        
+    @projects = Project.active.like(params[:q]).find(:all, :limit => 100) - @publication.projects            
+    logger.debug "Query for \"#{params[:q]}\" returned \"#{@projects.size}\" results"
+    render :layout => false
+  end
+
+  def autocomplete_for_author
+    @results = []
+    
+    authors_list = Author.like(params[:q]).find(:all, :limit => 100)    
+    users_list = User.active.like(params[:q]).find(:all, :limit => 100)
+
+    logger.debug "Query for \"#{params[:q]}\" returned \"#{authors_list.size}\" authors and \"#{users_list.size}\" users"
+    
+    # need to subtract both lists
+    # give priority to the users    
+    users_list.each do |user|      
+      @results << user
+    end
+    
+    authors_list.each do |author|      
+      @results << author unless users_list.include?(author.user_id)
+    end
+                 
+    render :layout => false
+  end
+
+  def sort_authors
+    params[:authors].each_with_index do |id, index|
+      Author.update_all(['order=?', index+1], ['id=?', id])
+    end
+    render :nothing => true
+  end
+
+  def identify_author
+    
+  end
+
+  private
+
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/helpers/authors_helper.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,20 @@
+module AuthorsHelper
+  unloadable
+  
+  def render_author_publications(author)
+    s = ""
+    pubs = []
+
+    author.publications.each do |pub|
+     pubs << link_to(pub.title, pub)
+    end
+
+    if pubs.size < 3
+      s << '<nobr>' << pubs.join(', ') << '</nobr>'
+    else
+      s << pubs.join(', ')
+    end
+    s    
+  end
+  
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/helpers/authorships_helper.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,2 @@
+module AuthorshipsHelper
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/helpers/bibtex_entries_helper.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,3 @@
+module BibtexEntriesHelper
+
+end
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/helpers/my_helper.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,45 @@
+module MyHelper
+
+  def get_my_publications()
+    if not User.current.author.nil?
+      @my_publications = Publication.all(:include => :authors, :conditions => "authors.id = #{User.current.author.id}")
+    else
+      @my_publications = []
+    end
+  end 
+
+  def render_publications_projects(publication)    
+    s = ""
+    projs = []
+    
+    publication.projects.each do |proj|
+      projs << link_to(proj.name, proj)               
+    end
+    
+    if projs.size < 3
+        s << '<nobr>' << projs.join(', ') << '</nobr>'
+      else
+        s << projs.join(', ')
+    end  
+    
+    s
+  end
+
+  def render_publications_authors(publication)    
+    s = ""
+    auths = []
+          
+    publication.authorships.each do |auth|
+      auths << h(auth.name_on_paper)
+    end
+    
+    if auths.size < 3
+        s << '<nobr>' << auths.join(', ') << '</nobr>'
+      else
+        s << auths.join(', ')
+    end
+    s
+  end
+
+
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,98 @@
+require 'bibtex'
+
+module PublicationsHelper
+  def projects_check_box_tags(name, projects)
+    s = ''
+    projects.sort.each do |project|
+      s << "<label>#{ check_box_tag name, project.id, false } #{link_to_project project}</label>\n"
+    end
+    s 
+  end
+  
+  def identify_author(author)
+    if author.class == User      
+      author_info = {
+        :name_on_paper => author.name,
+        :user_id => author.id
+      }
+    
+    else 
+      if author.class == Author    
+      author_info = { 
+        :name_on_paper => author.name, 
+        :user_id => author.user_id,
+        :id => author.id
+      }
+      end
+    end
+                
+    link_to_function(author.name, "update_author_info(this," + author_info.to_json + ")")
+  end
+  
+  def choose_author_link(name, authors_users)
+    s = ''
+    authors_users.sort.each do |author_user|
+      s << "#{identify_author author_user}\n"
+    end
+    s 
+  end
+
+  def link_to_remove_fields(name, f)
+    f.hidden_field(:_destroy) + link_to_function(name, "remove_fields(this)")
+  end
+    
+  def link_to_add_fields(name, f, association)
+    new_object = f.object.class.reflect_on_association(association).klass.new
+    fields = f.fields_for(association, new_object, :child_index => "new_#{association}") do |builder|
+      render(association.to_s.singularize + "_fields", :f => builder)
+    end    
+    link_to_function(name, h("add_fields(this, '#{association}', '#{escape_javascript(fields)}')"), { :class => 'icon icon-add', :id => "add_another_author" })
+  end  
+
+  def sanitized_object_name(object_name)
+    object_name.gsub(/\]\[|[^-a-zA-Z0-9:.]/,"_").sub(/_$/,"")
+  end
+
+  def sanitized_method_name(method_name)
+    method_name.sub(/\?$/, "")
+  end
+
+  def form_tag_id(object_name, method_name)    
+    str = "#{sanitized_object_name(object_name.to_s)}_#{sanitized_method_name(method_name.to_s)}"
+    str.to_sym
+  end
+  
+  def render_projects_list(publication)
+    s = ""
+    projs = []
+    
+    publication.projects.each do |proj|
+      projs << link_to_project(proj)
+    end
+    
+    if projs.size < 3
+      s << '<nobr>' << projs.join(', ') << '</nobr>'
+    else
+      s << projs.join(', ')
+    end
+    s
+  end
+  
+  def show_bibtex_fields(bibtex_entry)
+    s = ""
+
+    bibtex_entry.attributes.each do |field|
+      if field[1] != nil
+        s << "<h4>" + field[0].titleize + "</h4>" 
+
+        if field[0] == "entry_type"
+          s << bibtex_entry.entry_type_name.capitalize
+        else
+          s << bibtex_entry.attributes[field[0]].to_s
+        end
+      end
+    end
+    s
+  end 
+end
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/models/author.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,18 @@
+class Author < ActiveRecord::Base
+  has_many :authorships, :dependent => :destroy
+  has_many :publications, :through => :authorships
+
+  belongs_to :user
+
+  def <=>(author)
+    name.downcase <=> author.name.downcase
+  end
+  
+  named_scope :like, lambda {|q| 
+    s = "%#{q.to_s.strip.downcase}%"
+    {:conditions => ["LOWER(name) LIKE :s", {:s => s}],
+     :order => 'name'
+    }
+  }
+
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/models/authorship.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,27 @@
+class Authorship < ActiveRecord::Base
+  belongs_to :author
+  belongs_to :publication
+  
+  accepts_nested_attributes_for :author
+  accepts_nested_attributes_for :publication
+  
+  
+  # setter and getter for virtual attribute :user_id
+  def user_id    
+  end 
+  
+  def user_id=(uid)  
+    unless uid.blank?
+      user = User.find(uid)                         
+      if user.author.nil?      
+        # TODO: should reflect the name_on_paper parameter
+        author = Author.new :name => user.name
+        author.save!
+        user.author = author
+        user.save!
+     end
+           
+    self.author_id = user.author.id
+    end    
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/models/bibtex_entry.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,14 @@
+class BibtexEntry < ActiveRecord::Base
+  unloadable
+
+  belongs_to :publication
+  validates_presence_of :entry_type
+  
+  def entry_type_name
+    entry_type = self.entry_type
+    BibtexEntryType.find(entry_type).name
+  end
+  
+  
+  
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/models/bibtex_entry_type.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,2 @@
+class BibtexEntryType < ActiveRecord::Base
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/models/publication.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,19 @@
+# vendor/plugins/redmine_bibliography/app/models/publication.rb
+
+class Publication < ActiveRecord::Base
+  unloadable
+  
+  has_many :authorships, :dependent => :destroy
+  has_many :authors, :through => :authorships, :uniq => true
+  
+  has_one :bibtex_entry, :dependent => :destroy
+
+  validates_presence_of :title
+
+  accepts_nested_attributes_for :authorships
+  accepts_nested_attributes_for :authors, :allow_destroy => true
+  accepts_nested_attributes_for :bibtex_entry, :allow_destroy => true
+  
+  has_and_belongs_to_many :projects, :uniq => true
+  
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/authors/index.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,26 @@
+<h2>Authors#index</h2>
+
+<table class="list authors">		
+	<thead><tr>
+	<th><%=l(:field_author_name)%></th>
+	<th><%=l(:field_author_username)%></th>
+	<th><%=l(:field_author_publications)%></th>
+	</tr></thead>
+	<tbody>
+	  	
+  <% @authors.each do |author|%>    
+	<tr id="author-<%= author.id %>" class="<%= cycle('odd', 'even') %>">
+		<td class="title">
+			<%= h author.name %>
+		</td>
+    <td class="username ">
+      <%= link_to author.user unless author.user.nil? %>
+    </td>
+    <td class="project">             
+      <%= render_author_publications(author) %>	
+    </td>
+	</tr>
+	<% end %>
+	</tbody>
+</table>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/authorships/update.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,1 @@
+<h2>Authorships#update</h2>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/my/blocks/_publications_box.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,30 @@
+<% get_my_publications %>
+
+<h3><%=l(:label_my_publications_box) %> <%= "(" + @my_publications.count.to_s + ")" %> </h3>
+
+<table class="list publications">		
+	<thead><tr>
+	<th><%=l(:field_publication_title)%></th>
+	<th><%=l(:field_publication_authors)%></th>
+	<th><%=l(:field_publication_projects)%></th>
+	</tr></thead>
+	<tbody>
+	  	
+  <% @my_publications.each do |publication|%>    
+	<tr id="publication-<%= publication.id %>" class="<%= cycle('odd', 'even') %>">
+		<td class="title">
+			<%= link_to publication.title, publication %>
+		</td>
+    <td class="authors">
+      <%= render_publications_authors(publication) %>
+    </td>
+    <td class="project">             
+      <%= render_publications_projects(publication) %>	
+    </td>
+	</tr>
+	<% end %>
+	</tbody>
+</table>
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,8 @@
+<% if @project.publications.any? %>
+  <div class="bibliography box">
+	  <h3><%=l(:label_publications_plural)%></h3>	
+	  <p><% @project.publications.each do |publication| %>
+	    <%= link_to publication.title, :controller => 'publications', :action => 'show', :id => publication, :project_id => @project %><br />
+	  <% end %></p>
+  </div>
+<% end %>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/projects/show.rhtml	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,86 @@
+<div class="contextual">
+	<% if User.current.allowed_to?(:add_subprojects, @project) %>
+		<%= link_to l(:label_subproject_new), {:controller => 'projects', :action => 'new', :parent_id => @project}, :class => 'icon icon-add' %>
+	<% end %>
+	
+	<%= link_to l(:label_add_publication_to_project), {:controller => 'publications', :action => 'new', :project_id => @project}, :class => 'icon icon-add' %>
+	
+</div>
+
+<h2><%=l(:label_overview)%></h2> 
+	
+<div class="splitcontentleft">
+	<div class="wiki">
+		<%= textilizable @project.description %>
+	</div>	
+	<ul>
+	<% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)) %></li><% end %>
+  <% if @subprojects.any? %>
+ 	<li><%=l(:label_subproject_plural)%>:
+	    <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li>
+  <% end %>
+	<% @project.visible_custom_field_values.each do |custom_value| %>
+	<% if !custom_value.value.blank? %>
+	   <li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li>
+	<% end %>
+	<% end %>
+	</ul>	
+
+  <% if User.current.allowed_to?(:view_issues, @project) %>
+  <div class="issues box">    
+    <h3><%=l(:label_issue_tracking)%></h3>
+    <ul>
+    <% for tracker in @trackers %>    
+      <li><%= link_to tracker.name, :controller => 'issues', :action => 'index', :project_id => @project, 
+                                                :set_filter => 1, 
+                                                "tracker_id" => tracker.id %>:
+					<%= l(:label_x_open_issues_abbr_on_total, :count => @open_issues_by_tracker[tracker].to_i,
+																										:total => @total_issues_by_tracker[tracker].to_i) %>
+			</li>
+    <% end %>
+    </ul>
+    <p>
+    	<%= link_to l(:label_issue_view_all), :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1 %>
+	    <% if User.current.allowed_to?(:view_calendar, @project, :global => true) %>
+				| <%= link_to(l(:label_calendar), :controller => 'calendars', :action => 'show', :project_id => @project) %>
+			<% end %>
+			<% if User.current.allowed_to?(:view_gantt, @project, :global => true) %>
+				| <%= link_to(l(:label_gantt), :controller => 'gantts', :action => 'show', :project_id => @project) %>
+			<% end %>
+		</p>
+  </div>
+  <% end %>
+  <%= call_hook(:view_projects_show_left, :project => @project) %>
+</div>
+
+<div class="splitcontentright">
+  
+  <%= render :partial => 'bibliography_box' %>
+  
+  <%= render :partial => 'members_box' %>
+    
+  <% if @news.any? && authorize_for('news', 'index') %>
+  <div class="news box">
+    <h3><%=l(:label_news_latest)%></h3>  
+    <%= render :partial => 'news/news', :collection => @news %>
+    <p><%= link_to l(:label_news_view_all), :controller => 'news', :action => 'index', :project_id => @project %></p>
+  </div>  
+  <% end %>
+  <%= call_hook(:view_projects_show_right, :project => @project) %>
+</div>
+
+<% content_for :sidebar do %>
+    <% if @total_hours && User.current.allowed_to?(:view_time_entries, @project) %>
+    <h3><%= l(:label_spent_time) %></h3>
+    <p><span class="icon icon-time"><%= l_hours(@total_hours) %></span></p>
+    <p><%= link_to(l(:label_details), {:controller => 'timelog', :action => 'index', :project_id => @project}) %> |
+    <%= link_to(l(:label_report), {:controller => 'time_entry_reports', :action => 'report', :project_id => @project}) %></p>
+    <% end %>
+    <%= call_hook(:view_projects_show_sidebar_bottom, :project => @project) %>
+<% end %>
+
+<% content_for :header_tags do %>
+<%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :key => User.current.rss_key}) %>
+<% end %>
+
+<% html_title(l(:label_overview)) -%>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_add_project_form.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,29 @@
+<% form_remote_for(:publication, 
+                     :url => {:controller => 'publications', :action => 'add_project', :id => @publication, :project_id => @project}, 
+                     :method => :post,
+                     :html => { :id => 'add_project_form' }, 
+									   :loading => "$('project-add-submit').disable()",
+									   :complete => "$('project-add-submit').enable()") do |f| %>
+								<fieldset><legend><%=l(:label_add_project_to_publication)%></legend>
+	      <p>
+	        <%= label_tag "project_search", l(:label_project_search) %><%= text_field_tag 'project_search', nil %>
+	      </p>
+	     
+	      <%= observe_field(:project_search,
+               :frequency => 0.5,
+               :update => :projects,
+               :url => { :controller => 'publications', :action => 'autocomplete_for_project', :id => @publication },
+               :with => 'q')
+                %>
+
+					<div id="projects">
+					<% if params[:q] && params[:q].length > 1 %>
+			  		  <%= projects_check_box_tags 'project[project_ids][]', @projects %>
+					<% end %>
+					</div>
+
+        <p><%= submit_tag l(:button_add), :id => 'project-add-submit' %></p>
+    
+    
+      </fieldset>
+  <% end %>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,28 @@
+<div id="authors" class="fields">
+  <p>        
+    <%= f.text_field :name_on_paper %><br />
+    <em><%= h l("text_author_name_on_paper") %></em><br />
+                                                
+    <%= link_to_function "Add Me as Author", "update_author_info(this," + User.current.get_author_info.to_json + ")", :class => 'icon icon-add', :id => "add_me_as_author" %>
+
+    <%= observe_field( form_tag_id(f.object_name, :name_on_paper), :frequency => 0.5, :update => form_tag_id(f.object_name, :identify_author), :url => { :controller => 'publications', :action => 'autocomplete_for_author' }, :with => 'q')
+    %>
+    
+    <div id="<%= form_tag_id(f.object_name, :identify_author) %>">
+      <% if params[:q] && params[:q].length > 1 %>
+        <%= select_author_links 'author[author_ids][]', @authors %>
+      <% end %>
+    </div>
+      
+    <%= f.text_field :institution, :size => 60 %><br />
+    <em><%= h l("text_author_institution") %></em><br />
+
+    <%= f.text_field :email, :size => 60  %><br />
+    <em><%= h l("text_author_email") %></em><br />
+    
+    <%= f.hidden_field :user_id %>
+    
+    <%= link_to_remove_fields l("remove_author"), f %>    
+    
+  </p>
+</div>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_bibtex_fields.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,26 @@
+<div class="box">
+
+
+<p><label for="bibtex_entry_type"><%=l("field_entry_type")%> <span class="required">*</span></label>
+	<%= f.collection_select(:entry_type, BibtexEntryType.find(:all), :id, :name,  {:selected => @selected_bibtex_entry_type_id, :prompt => true})  %>
+    </p>
+    <p> 
+      <%= f.text_field :year, :size => 60 %>  
+    </p>  
+    <p>   
+      <%= f.text_field :chapter, :size => 60 %>  
+    </p>  
+    <p>   
+      <%= f.text_field :editor, :size => 60  %>  
+    </p>  
+    <p>   
+      <%= f.text_field :booktitle,:size => 60  %>  
+    </p>  
+    <p>   
+      <%= f.text_field :publisher,:size => 60  %>  
+    </p>  
+    <p>   
+      <%= f.text_field :pages, :size => 60  %>  
+    </p>
+
+</div>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,30 @@
+
+<div class="splitcontentleft">
+    <%= f.error_messages %>  
+    <p>
+      <%= f.text_field :title, :required => true, :size => 60 %>
+    </p>
+
+    <h3><%= l(:authors) %></h3>    
+    <% f.fields_for :authorships do |builder| %>
+      <%= render "authorship_fields", :f => builder %>
+    <% end %>
+
+    <p><%= link_to_add_fields l(:label_add_another_author), f, :authorships %></p>
+
+</div>
+
+<div class="splitcontentright">      
+  <h3>Other Details</h3>
+  <% f.fields_for :bibtex_entry do |builder| -%>
+    <%= render :partial => 'bibtex_fields', :locals => { :f => builder}  %>
+  <%- end -%>
+</div>
+
+<% content_for :sidebar do %>
+
+  placeholder
+
+<% end %>
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_identify_author_form.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,25 @@
+<legend><%= "Identify Authors in the system…" %></legend>
+
+<%= link_to_remote "It's me!", 
+   { :url => { :controller => 'publications', 
+     :action => 'add_me_as_author',
+     :project_id => @project }, :method => 'post'}, 
+   { :class => 'icon icon-add', :id => "add_me_as_author" } %>
+
+<p>
+  <%= label_tag "author_search", l(:label_project_search) %><%= text_field_tag 'author_search', nil %>
+</p>
+	     
+<%= observe_field( form_tag_id(f.object_name, :name),
+     :frequency => 0.5,
+     :update => :identify_author,
+     :url => { :controller => 'publications', :action => 'autocomplete_for_author' },
+     :with => 'q')
+%>
+
+<div id="identify_author">
+  <% if params[:q] && params[:q].length > 1 %>
+    <%= select_author_links 'author[author_ids][]', @authors %>
+  <% end %>
+</div>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_list_projects.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,1 @@
+<%= render_projects_list(@publication) %>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_new_bibtex_step.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,9 @@
+<h3>New Bibtex</h3>
+
+<h4>Paste your Bibtex entries here</h4>
+<p>
+  <%=label_tag :bibtex_entry %>
+  <%=text_area_tag :bibtex_entry%>  
+</p>
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_review_bibtex_step.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,2 @@
+<h2>Review new entries</h2>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/add_project.rjs	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,3 @@
+page.replace_html :list_projects, :partial => 'list_projects'
+page[:add_project_form].reset
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/autocomplete_for_author.rhtml	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,3 @@
+<% if params[:q] && params[:q].length > 1 %>
+	<%= choose_author_link 'publication[author_ids][]', @results %>
+<% end %>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/autocomplete_for_project.rhtml	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,3 @@
+<% if params[:q] && params[:q].length > 1 %>
+	<%= projects_check_box_tags 'publication[project_ids][]', @projects %>
+<% end %>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/create.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,1 @@
+<h2>Publications#create</h2>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,15 @@
+<% content_for :header_tags do %>
+    <%= javascript_include_tag 'authors', :plugin => 'redmine_bibliography' %>
+<% end %>
+
+<h2><%=l(:label_publication_show)%></h2>
+
+<% form_for @publication, :url => { :project_id  => @project_id, :action => :update }, :builder => TabularFormBuilder do |f| -%>
+  <%= render :partial => 'form', :locals => { :f => f }  %>
+  
+  <%= f.submit %>
+<% end %>
+<p>
+  <%= 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 } %>
+</p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/import.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,12 @@
+<h1>New Publication</h1>
+
+<% form_for @publication, :url => { :action => "create" } do |f| %>
+  <% f.error_messages %>
+
+  <%= render :partial  => "#{@publication.current_step}_bibtex_step", :locals => { :f => f }  %>
+
+  <p><%= f.submit "Submit" %></p>
+  <p><%= f.submit "Back", :name => "back_button" unless @publication.first_step? %></p>
+  
+<% end %>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/index.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,33 @@
+<div class="contextual">		
+		<%= link_to l(:label_publication_new), {:controller => 'publications', :action => 'new', :project_id => @project}, :class => 'icon icon-add' %>
+</div>
+
+<div class="splitcontentleft">
+  <h3>Publications#index</h3>
+
+
+  <table>
+    <tr>
+      <th>Number</th>
+      <th>Title</th> 
+    </tr>
+
+    <% @publications.each do |publication| %>
+	    <tr>
+	      <td><%= publication.id %></td>
+	      <td><%= link_to publication.title, :controller => "publications", :action => "show", :id => publication, :project_id => @project %></td>
+	 	  </tr>
+    <% end %>    
+  </table>
+
+</div>
+
+<div class="splitcontentright">
+  placeholder div
+</div>
+
+
+<% content_for :sidebar do %>
+  Sidebar
+<% end %>
+  
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,10 @@
+<% content_for :header_tags do %>
+    <%= javascript_include_tag 'authors', :plugin => 'redmine_bibliography' %>
+<% end %>
+
+<h2><%=l(:label_publication_new)%></h2>
+
+<% 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,41 @@
+<h2><%=l(:label_publication_show)%></h2>
+
+<div class="splitcontentleft">
+<h4>Title</h4>
+<%= h @publication.title %>
+
+<h4><%= l(:authors) %></h4>
+<ul id="authorships">
+  <% for authorship in @publication.authorships %>
+    <% content_tag_for :li, authorship do %>
+      <%= h authorship.name_on_paper %> <br />
+      <%= h authorship.institution %> <br />
+    <% end %>
+  <% end %>
+</ul>
+<%= sortable_element("authorships", :url => { :controller => :publications, :action => :sort_authors }) %>
+
+<br />
+
+<%- if @publication.bibtex_entry != nil -%>
+  <%= show_bibtex_fields(@publication.bibtex_entry) %>
+<%- end -%>
+
+<p>
+  <%= 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 %>
+</p>
+</div>
+
+
+<% projects = Project.active.find(:all, :limit => 100, :order => 'name ASC') - @publication.projects %>
+
+<div class="splitcontentright">
+  
+  <h4><%=l(:label_publication_project_index)%></h4>
+  <p id="list_projects">
+    <%= render :partial => 'list_projects' %>
+  </p>
+    <%= render :partial => 'add_project_form' %>    
+</div>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/update.html.erb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,1 @@
+<h2>Publications#update</h2>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/settings/_bibliography.rhtml	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,3 @@
+<p><label>Menu caption</label>
+<%= text_field_tag 'settings[menu]', @settings['menu'], :size => 30 %>
+<br /><em>Clear this field if you don't want to add a tab to the project menu</em></p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/assets/javascripts/authors.js	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,24 @@
+function remove_fields(link) {
+  $(link).previous("input[type=hidden]").value = "1";
+  $(link).up(".fields").hide();
+}
+
+function add_fields(link, association, content) {
+  var new_id = new Date().getTime();
+  var regexp = new RegExp("new_" + association, "g")
+  $(link).up().insert({
+    before: content.replace(regexp, new_id)
+  });
+}
+
+function update_author_info(link, author_info){
+		
+	$(link).up('div').up('div').select('input[id^=publication_authorships_attributes]').each(
+		function(e){
+			key = e.name.split("[").last().trim().sub(']','');
+			
+			// test for undefined			
+			e.value = author_info[key];
+		}		
+	)
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/config/locales/en.yml	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,76 @@
+# English strings go here for Rails i18n
+en:
+  title: "Title"
+  authors: "Authors"
+  author: "Author"
+  name: "Name"
+  publications_box: "My Publications"
+  label_my_publications_box: "My Publications"
+  
+  field_publication_title: Title
+  field_publication_authors: Authors
+  field_publication_projects: "Associated Projects"
+  field_author_name: Author
+  field_author_username: "Associated User"
+  field_author_publications: "Publications by this Author" 
+  
+  bibtex_entry:
+    entry_type: "Bibtex Entry Type"
+  
+  label_add_me_as_author: "Add me as an author"
+  label_add_another_author: "Add another author"
+
+  remove_author: "Remove this author"
+  
+  label_publications_plural: "Publications"
+  label_publication_new: "Create New Publication"
+  label_add_publication_to_project: "Add Publication to this project"
+  label_publication_edit: "Edit Publication"
+  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."
+  text_author_name_on_paper: "Name of the author as it appears on paper. (In case it applies, please use the autocomplete suggestions.)"
+  
+  # authorships model
+  field_institution: "Institution"
+  field_name_on_paper: "Name" 
+  field_email: "Email Address"
+      
+  # bibtex_entries model
+  field_entry_type: "Entry Type"
+  field_id: "id" 
+  field_publication_id: "Publication_id"
+  field_entry_type: "Entry Type"
+  field_address: "Address"
+  field_annote: "Annote"
+  field_booktitle: "Book Title"
+  field_chapter: "Chapter"
+  field_crossref: "Cross Reference"
+  field_edition: "Edition"
+  field_editor: "Editor"
+  field_eprint: "eprint"
+  field_howpublished: "How was it Published"
+  field_journal: "Journal"
+  field_key: "Key"
+  field_month: "Month"
+  field_note: "Note"
+  field_number: "Number"
+  field_organization: "Organization"
+  field_pages: "Pages"
+  field_publisher: "Publisher"
+  field_school: "School"
+  field_series: "Series"
+  field_type: "Type"
+  field_url: "URL"
+  field_volume: "Volume"
+  field_year: "Year"
+  
+  
+  
+  
+  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/config/routes.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,3 @@
+ActionController::Routing::Routes.draw do |map|
+  map.resources :publications, :collection => { :sort_authors => :post }
+end
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/db/migrate/001_create_authors.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,12 @@
+class CreateAuthors < ActiveRecord::Migration
+  def self.up
+    create_table :authors do |t|
+      t.column :user_id, :integer
+      t.column :name, :string
+    end
+  end
+
+  def self.down
+    drop_table :authors
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/db/migrate/002_create_publications.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,12 @@
+class CreatePublications < ActiveRecord::Migration
+  def self.up
+    create_table :publications do |t|
+      t.column :title, :string
+      t.column :reviewed, :boolean, :default => false
+    end
+  end
+
+  def self.down
+    drop_table :publications
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/db/migrate/003_create_authorships.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,16 @@
+class CreateAuthorships < ActiveRecord::Migration
+  def self.up
+    create_table :authorships do |t|
+      t.column :author_id, :integer
+      t.column :publication_id, :integer
+      t.column :name_on_paper, :string
+      t.column :order, :integer
+      t.column :institution, :string
+      t.column :email, :string
+    end
+  end
+
+  def self.down
+    drop_table :authorships
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/db/migrate/004_create_bibtex_entries.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,35 @@
+class CreateBibtexEntries < ActiveRecord::Migration
+  def self.up
+    create_table :bibtex_entries do |t|
+      t.column :publication_id, :integer
+      t.column :entry_type, :integer
+      t.column :address, :string
+      t.column :annote, :string
+      t.column :booktitle, :string
+      t.column :chapter, :string
+      t.column :crossref, :string
+      t.column :edition, :string
+      t.column :editor, :string
+      t.column :eprint, :string
+      t.column :howpublished, :string
+      t.column :journal, :string
+      t.column :key, :string
+      t.column :month, :string
+      t.column :note, :text
+      t.column :number, :string
+      t.column :organization, :string
+      t.column :pages, :string
+      t.column :publisher, :string
+      t.column :school, :string
+      t.column :series, :string
+      t.column :type, :string
+      t.column :url, :string
+      t.column :volume, :integer
+      t.column :year, :integer
+    end
+  end
+
+  def self.down
+    drop_table :bibtex_entries
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/db/migrate/005_create_projects_publications_join_table.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,12 @@
+class CreateProjectsPublicationsJoinTable < ActiveRecord::Migration
+  def self.up
+    create_table :projects_publications, :id => false do |t|
+      t.integer :project_id
+      t.integer :publication_id
+    end
+  end
+
+  def self.down
+    drop_table :projects_publications
+  end
+end
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/db/migrate/006_create_bibtex_entry_types.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,13 @@
+class CreateBibtexEntryTypes < ActiveRecord::Migration
+  def self.up
+    create_table :bibtex_entry_types do |t|
+      t.string :name
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :bibtex_entry_types
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/db/seed_data/bibtex_entry_types_list.txt	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,14 @@
+article
+book
+booklet
+conference
+inbook
+incollection
+inproceedings
+manual
+masterthesis
+misc
+phdthesis
+proceedings
+techreport
+unpublished
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/init.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,43 @@
+require 'redmine'
+require 'dispatcher'
+
+RAILS_DEFAULT_LOGGER.info 'Starting Bibliography Plugin for RedMine'
+
+# Patches to the Redmine core.
+Dispatcher.to_prepare :redmine_model_dependencies do
+  require_dependency 'project'
+  require_dependency 'user'
+
+  unless Project.included_modules.include? Bibliography::ProjectPublicationsPatch
+    Project.send(:include, Bibliography::ProjectPublicationsPatch)
+  end
+
+  unless User.included_modules.include? Bibliography::UserAuthorPatch
+    User.send(:include, Bibliography::UserAuthorPatch)
+  end
+
+end
+
+
+# Plugin Info
+Redmine::Plugin.register :redmine_bibliography do
+  name 'Redmine Bibliography plugin'
+  author 'Chris Cannam, Luis Figueira'
+  description 'This is a bibliography management plugin for Redmine'
+  version '0.0.1'
+  url 'http://example.com/path/to/plugin'
+  author_url 'http://example.com/about'
+
+  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]}, :public => true
+    permission :add_publication, {:redmine_bibliography => [:new, :create]}, :public => true
+  end
+
+  # extending the Project Menu
+  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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/lang/en.yml	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,2 @@
+# English strings go here
+my_label: "My label"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/lib/bibliography/project_publications_patch.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,25 @@
+require_dependency 'project'
+
+module Bibliography
+  module ProjectPublicationsPatch
+    def self.included(base)
+          base.class_eval do
+            has_and_belongs_to_many :publications, :uniq => true
+          
+            named_scope :like, lambda {|q| 
+              s = "%#{q.to_s.strip.downcase}%"
+              {:conditions => ["LOWER(name) LIKE :s OR LOWER(homepage) LIKE :s", {:s => s}],
+               :order => 'name'
+              }
+            }
+          end
+    end #self.included
+        
+    module ProjectMethods
+
+
+
+    
+    end #ProjectMethods
+  end #ProjectPublicationsPatch
+end #RedmineBibliography
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,53 @@
+require_dependency 'user'
+
+module Bibliography
+  module UserAuthorPatch    
+    def self.included(base)
+      base.send(:include, InstanceMethods) 
+      extend ClassMethods     
+          
+      base.class_eval do
+        has_one :publication
+                                    
+      end
+    end #self.included
+    
+    module ClassMethods
+    end  
+    
+    module InstanceMethods
+
+      def get_author_info
+        info = { 
+          :name_on_paper => "",
+          :email => "",
+          :institution => "",
+          :user_id => self.id                    
+        }
+        
+        unless self.author.nil?
+          logger.error { "We've got author" }          
+          info[:name_on_paper] = self.author.name            
+
+          if self.author.authorships.length > 0
+            info[:email] = self.author.authorships.first.email
+            info[:institution] = self.author.authorships.first.institution
+          end
+
+        else
+          logger.error { "No author" }
+          
+          info[:name_on_paper] = "No Name"
+          info[:email] = self.mail
+          if not self.ssamr_user_detail.nil?
+            info[:institution]  = self.ssamr_user_detail.institution_name
+          end
+        end
+        
+        return info
+        
+      end            
+    end #InstanceMethods
+    
+  end #UserPublicationsPatch
+end #RedmineBibliography
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/lib/tasks/seed_bibtex_entry_types.rake	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,20 @@
+namespace :redmine do
+  namespace :plugins do
+    namespace :redmine_bibliography do
+
+      task :seed_bibtex_entry_types  => :environment do    
+        desc "Seeds the Bibtex Entry Types Table"
+  
+        quoted = ActiveRecord::Base.connection.quote_table_name('bibtex_entry_types')
+        ActiveRecord::Base.connection.execute("TRUNCATE #{quoted}")
+
+        open(File.dirname(__FILE__) + "/../../db/seed_data/bibtex_entry_types_list.txt") do |bibtex_entry_types|
+          bibtex_entry_types.read.each_line do |bibtex_entry_type|
+            BibtexEntryType.create(:name => bibtex_entry_type.chomp)
+          end
+        end
+      end 
+
+    end 
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/fixtures/authors.yml	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,17 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+one:
+  id: 1
+  user_id: 
+  name: MyString
+two:
+  id: 2
+  user_id: 
+  name: MyString
+one:
+  id: 3
+  user_id: 
+  name: MyString
+two:
+  id: 4
+  user_id: 
+  name: MyString
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/fixtures/authorships.yml	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,33 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+one:
+  id: 1
+  author_id: 1
+  publication_id: 1
+  name_on_paper: Yih-Farn R. Chen
+  order: 1
+  institution: 
+  email: MyString
+two:
+  id: 2
+  author_id: 2
+  publication_id: 1
+  name_on_paper: Glenn S. Fowler
+  order: 2
+  institution: 
+  email: MyString
+three:
+  id: 3
+  author_id: 1
+  publication_id: 1
+  name_on_paper: Yih-Farn R. Chen
+  order: 1
+  institution: 
+  email: MyString
+four:
+  id: 4
+  author_id: 2
+  publication_id: 1
+  name_on_paper: Glenn S. Fowler
+  order: 2
+  institution: 
+  email: MyString
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/fixtures/bibtex_entries.yml	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,6 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+one:
+  id: 1
+  entry_type: InProceedings
+  booktitle: International Conference on Software Maintenance
+  year: 1995
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/fixtures/publications.yml	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,9 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+one:
+  id: 1
+  title: Test Fixture Title No1
+  bibtex_entry_id: 1
+two:
+  id: 2
+  title: MyString
+  bibtex_entry_id: MyString
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/functional/authors_controller_test.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class AuthorsControllerTest < ActionController::TestCase
+  # Replace this with your real tests.
+  def test_truth
+    assert true
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/functional/authorships_controller_test.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class AuthorshipsControllerTest < ActionController::TestCase
+  # Replace this with your real tests.
+  def test_truth
+    assert true
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/functional/publications_controller_test.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class PublicationsControllerTest < ActionController::TestCase
+  # Replace this with your real tests.
+  def test_truth
+    assert true
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/test_helper.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,24 @@
+# Load the normal Rails helper
+require File.expand_path(File.dirname(__FILE__) + '/../../../../test/test_helper')
+require 'publications_controller'
+
+# Ensure that we are using the temporary fixture path
+Engines::Testing.set_fixture_path
+
+class BibliographyControllerTest < ActionController::TestCase
+  fixtures :all
+
+  def setup
+  end
+
+  def test_publication
+  
+  end
+  
+
+  def test_routing
+    assert_routing(
+          {:method => :get, :path => '/requirements'},
+          :controller => 'requirements', :action => 'index'
+        )
+  end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/unit/author_test.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class AuthorTest < ActiveSupport::TestCase
+  fixtures :authors
+
+  # Replace this with your real tests.
+  def test_truth
+    assert true
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/unit/authorship_test.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class AuthorshipTest < ActiveSupport::TestCase
+  fixtures :authorships
+
+  # Replace this with your real tests.
+  def test_truth
+    assert true
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/unit/bibtex_entry_test.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class BibtexEntryTest < ActiveSupport::TestCase
+  fixtures :bibtex_entries
+
+  # Replace this with your real tests.
+  def test_truth
+    assert true
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/unit/publication_test.rb	Fri Jul 29 19:28:55 2011 +0100
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class PublicationTest < ActiveSupport::TestCase
+  fixtures :publications
+
+  # Replace this with your real tests.
+  def test_truth
+    assert true
+  end
+end