# HG changeset patch # User luisf # Date 1301594347 -3600 # Node ID ad71d0604ac2f1fd6cd9be932028a9b59d189f1e # Parent d750431a4102ff4627b76c4ab0aa1c58cdd4ef2d controller now saving; menus not working; permissions can be set by admins diff -r d750431a4102 -r ad71d0604ac2 vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Wed Mar 30 00:55:57 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Thu Mar 31 18:59:07 2011 +0100 @@ -1,10 +1,21 @@ class PublicationsController < ApplicationController def new + @publication = Publication.new(params[:publication]) + + if @publication.save + logger.error "GRAVOU XXXdsfgXXX" + else + logger.error "nao gravou" + end + end def create + + logger.error "AAAA create" + @publication.save end @@ -13,9 +24,15 @@ end def edit + logger.error "AAAA edit" + end def update + + logger.error "AAAA update" + + end def show diff -r d750431a4102 -r ad71d0604ac2 vendor/plugins/redmine_bibliography/app/models/publication.rb --- a/vendor/plugins/redmine_bibliography/app/models/publication.rb Wed Mar 30 00:55:57 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/models/publication.rb Thu Mar 31 18:59:07 2011 +0100 @@ -1,4 +1,7 @@ class Publication < ActiveRecord::Base has_many :authorships has_many :authors, :through => :authorships + + validates_presence_of :title + end diff -r d750431a4102 -r ad71d0604ac2 vendor/plugins/redmine_bibliography/init.rb --- a/vendor/plugins/redmine_bibliography/init.rb Wed Mar 30 00:55:57 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/init.rb Thu Mar 31 18:59:07 2011 +0100 @@ -7,4 +7,10 @@ version '0.0.1' url 'http://example.com/path/to/plugin' author_url 'http://example.com/about' + + permission :view_bibliography, :redmine_bibliography => :index + + menu :project_menu, :redmine_bibliography, {:controller => 'publications', :action => 'index'}, :caption => 'Bibliography', :after => :activity, :param => :project_id + end +