diff --git a/Gemfile b/Gemfile index 6ccc952..20e69a9 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,6 @@ # ------------------------------------------------ # DATABASE/SERVER gem 'pg' -gem 'mysql2', '~> 0.3.18' # ------------------------------------------------ # JS <-> RUBY BRIDGE diff --git a/Gemfile.lock b/Gemfile.lock index d2532a9..cf1e73d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -211,7 +211,6 @@ ruby-progressbar multi_json (1.12.1) multipart-post (2.0.0) - mysql2 (0.3.21) nokogiri (1.6.8) mini_portile2 (~> 2.1.0) pkg-config (~> 1.1.7) @@ -351,7 +350,6 @@ libv8 minitest-rails-capybara minitest-reporters - mysql2 (~> 0.3.18) omniauth omniauth-shibboleth pg diff --git a/app/admin/dmptemplate.rb b/app/admin/dmptemplate.rb index e0cd394..8fdbcb3 100644 --- a/app/admin/dmptemplate.rb +++ b/app/admin/dmptemplate.rb @@ -108,7 +108,7 @@ f.input :description f.input :organisation_id, :label => I18n.t('admin.org_title'), :as => :select, - :collection => Organisation.order('name').map{|orgp|[orgp.name, orgp.id]} + :collection => Org.order('name').map{|orgp|[orgp.name, orgp.id]} f.input :published f.input :is_default end diff --git a/app/admin/guidance_group.rb b/app/admin/guidance_group.rb index 76667f7..c193af9 100644 --- a/app/admin/guidance_group.rb +++ b/app/admin/guidance_group.rb @@ -56,7 +56,7 @@ f.input :name f.input :organisation_id, :label => I18n.t('admin.org_title'), :as => :select, - :collection => Organisation.order('name').map{|orgp|[orgp.name, orgp.id]} + :collection => Org.order('name').map{|orgp|[orgp.name, orgp.id]} f.input :published f.input :optional_subset end diff --git a/app/admin/org.rb b/app/admin/org.rb index 0f92a58..7d9391b 100644 --- a/app/admin/org.rb +++ b/app/admin/org.rb @@ -93,7 +93,7 @@ as: :select, multiple: true, include_blank: I18n.t('helpers.none'), collection: TokenPermissionType.order(:token_type).map{|token| [token.token_type, token.id]}, hint: I18n.t('admin.choose_api_permissions') - # f.input :parent_id, :label => I18n.t('admin.org_parent'), :as => :select, :collection => Organisation.find(:all, :order => 'name ASC').map{|orgp|[orgp.name, orgp.id]} + # f.input :parent_id, :label => I18n.t('admin.org_parent'), :as => :select, :collection => Org.find(:all, :order => 'name ASC').map{|orgp|[orgp.name, orgp.id]} # f.input :stylesheet_file_id end f.actions diff --git a/app/admin/section.rb b/app/admin/section.rb index c8ceab8..4cc6c37 100644 --- a/app/admin/section.rb +++ b/app/admin/section.rb @@ -78,7 +78,7 @@ f.input :title f.input :number f.input :version, :collection => Version.all.map{ |ver| [ver.title, ver.id] } - f.input :organisation, :as => :select, :collection => Organisation.order('name').map{|orgp|[orgp.name, orgp.id]} + f.input :organisation, :as => :select, :collection => Org.order('name').map{|orgp|[orgp.name, orgp.id]} f.input :description end diff --git a/app/admin/suggested_answer.rb b/app/admin/suggested_answer.rb index ab957eb..9c46eab 100644 --- a/app/admin/suggested_answer.rb +++ b/app/admin/suggested_answer.rb @@ -18,7 +18,7 @@ :collection => Question.order('text').map{|ques|[ques.text, ques.id]} f.input :organisation_id, :label => I18n.t('admin.org_title'), :as => :select, - :collection => Organisation.order('name').map{|orgp|[orgp.name, orgp.id]} + :collection => Org.order('name').map{|orgp|[orgp.name, orgp.id]} f.input :text f.input :is_example end diff --git a/app/admin/user.rb b/app/admin/user.rb index 8f89d6b..1456f53 100644 --- a/app/admin/user.rb +++ b/app/admin/user.rb @@ -74,7 +74,7 @@ # f.input :shibboleth_id f.input :organisation_id, :label => I18n.t('admin.org_title'), :as => :select, - :collection => Organisation.order('name').map{|orgp|[orgp.name, orgp.id]} + :collection => Org.order('name').map{|orgp|[orgp.name, orgp.id]} f.input :other_organisation f.input :role_ids, :label => I18n.t('admin.user_role'), :as => :select, diff --git a/app/controllers/api/v0/projects_controller.rb b/app/controllers/api/v0/projects_controller.rb index 47bae8d..ad76c3d 100644 --- a/app/controllers/api/v0/projects_controller.rb +++ b/app/controllers/api/v0/projects_controller.rb @@ -19,9 +19,9 @@ # find the user's api_token permissions # then ensure that they have the permission associated with creating plans if has_auth(constant("api_endpoint_types.plans")) - #params[:organization_id] = Organisation.where(name: params[:template][:organization]) + #params[:organization_id] = Org.where(name: params[:template][:organization]) # find_by returns nil if none found, find_by! raises an ActiveRecord error - organization = Organisation.find_by name: params[:template][:organisation] + organization = Org.find_by name: params[:template][:organisation] # if organization exists if !organization.nil? diff --git a/app/controllers/organisations_controller.rb b/app/controllers/organisations_controller.rb index cd4c340..2d121b7 100644 --- a/app/controllers/organisations_controller.rb +++ b/app/controllers/organisations_controller.rb @@ -3,7 +3,7 @@ # GET /organisations/1 def admin_show - @organisation = Organisation.find(params[:id]) + @organisation = Org.find(params[:id]) authorize @organisation respond_to do |format| format.html # show.html.erb @@ -12,7 +12,7 @@ # GET /organisations/1/edit def admin_edit - @organisation = Organisation.find(params[:id]) + @organisation = Org.find(params[:id]) authorize @organisation @languages = Language.all.order("name") @@ -21,7 +21,7 @@ # PUT /organisations/1 def admin_update - @organisation = Organisation.find(params[:id]) + @organisation = Org.find(params[:id]) authorize @organisation @organisation.banner_text = params["org_banner_text"] @organisation.logo = params[:organisation][:logo] if params[:organisation][:logo] @@ -47,7 +47,7 @@ #TODO: see if this is used by the ajax... otherwise lock it down def parent - @organisation = Organisation.find(params[:id]) + @organisation = Org.find(params[:id]) authorize @organisation parent_org = @organisation.find_by {|o| o.parent_id } return parent_org @@ -55,7 +55,7 @@ #TODO: see is this is used by the ajax... otherwise lock it down def children - @organisation = Organisation.find(params[:id]) + @organisation = Org.find(params[:id]) authorize @organisation #if user_signed_in? then children = {} @@ -72,7 +72,7 @@ #TODO: see if this is used by the ajax... otherwise lock it down def templates - @organisation = Organisation.find(params[:id]) + @organisation = Org.find(params[:id]) authorize @organisation #if user_signed_in? then templates = {} diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index e5b9bed..103341a 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -124,7 +124,7 @@ @project = Project.new(params[:project]) authorize @project if @project.dmptemplate.nil? && params[:project][:funder_id] != "" then # this shouldn't be necessary - see setter for funder_id in project.rb - funder = Organisation.find(params[:project][:funder_id]) + funder = Org.find(params[:project][:funder_id]) if funder.dmptemplates.count == 1 then @project.dmptemplate = funder.published_templates.first end @@ -193,12 +193,12 @@ # GET /projects/possible_templates.json def possible_templates if !params[:funder].nil? && params[:funder] != "" && params[:funder] != "undefined" then - funder = Organisation.find(params[:funder]) + funder = Org.find(params[:funder]) else funder = nil end if !params[:institution].nil? && params[:institution] != "" && params[:institution] != "undefined" then - institution = Organisation.find(params[:institution]) + institution = Org.find(params[:institution]) else institution = nil end @@ -234,11 +234,11 @@ template = nil end if !params[:institution].nil? && params[:institution] != "" && params[:institution] != "undefined" then - institution = Organisation.find(params[:institution]) + institution = Org.find(params[:institution]) else institution = nil end - excluded_orgs = orgs_of_type(constant("organisation_types.funder")) + orgs_of_type(constant("organisation_types.institution")) + Organisation.orgs_with_parent_of_type(constant("organisation_types.institution")) + excluded_orgs = orgs_of_type(constant("organisation_types.funder")) + orgs_of_type(constant("organisation_types.institution")) + Org.orgs_with_parent_of_type(constant("organisation_types.institution")) guidance_groups = {} ggs = GuidanceGroup.guidance_groups_excluding(excluded_orgs) @@ -317,7 +317,7 @@ # Exclude Funders, Institutions, or children of Institutions excluded_orgs = orgs_of_type(constant("organisation_types.funder")) + orgs_of_type(constant("organisation_types.institution")) + - Organisation.orgs_with_parent_of_type(constant("organisation_types.institution")) + Org.orgs_with_parent_of_type(constant("organisation_types.institution")) GuidanceGroup.guidance_groups_excluding(excluded_orgs) end diff --git a/app/models/guidance.rb b/app/models/guidance.rb index 04e001e..929690d 100644 --- a/app/models/guidance.rb +++ b/app/models/guidance.rb @@ -13,7 +13,6 @@ ## # Associations belongs_to :guidance_group - belongs_to :question has_and_belongs_to_many :themes, join_table: "themes_in_guidance" # depricated, but required for migration "single_group_for_guidance" has_and_belongs_to_many :guidance_groups, join_table: "guidance_in_group" @@ -48,7 +47,7 @@ # @return [Array] list of guidance def self.by_organisation(org_id) org_guidance = [] - Organisation.find_by(id: org_id).guidance_groups.each do |group| + Org.find_by(id: org_id).guidance_groups.each do |group| org_guidance += group.guidances end return org_guidance @@ -96,7 +95,7 @@ end # guidance groups are viewable if they are owned by the Managing Curation Center - if guidance_group.organisation.id == Organisation.find_by( name: GlobalHelpers.constant("organisation_types.managing_organisation")).id + if guidance_group.organisation.id == Org.find_by( name: GlobalHelpers.constant("organisation_types.managing_organisation")).id viewable = true end @@ -119,7 +118,7 @@ # @param user [User] a user object # @return [Array] a list of all "viewable" guidances to a user def self.all_viewable(user) - managing_groups = (Organisation.find_by name: GlobalHelpers.constant("organisation_types.managing_organisation")).guidance_groups + managing_groups = (Org.find_by name: GlobalHelpers.constant("organisation_types.managing_organisation")).guidance_groups # find all groups owned by a Funder organisation funder_groups = [] funders = OrganisationType.find_by( name: GlobalHelpers.constant("organisation_types.funder")) diff --git a/app/models/guidance_group.rb b/app/models/guidance_group.rb index a88a529..b7a2ad0 100644 --- a/app/models/guidance_group.rb +++ b/app/models/guidance_group.rb @@ -81,7 +81,7 @@ viewable = true end # groups are viewable if they are owned by the managing curation center - Organisation.where( name: GlobalHelpers.constant("organisation_types.managing_organisation")).find_each do |managing_group| + Org.where( name: GlobalHelpers.constant("organisation_types.managing_organisation")).find_each do |managing_group| if guidance_group.organisation.id == managing_group.id viewable = true end @@ -106,7 +106,7 @@ def self.all_viewable(user) # first find all groups owned by the Managing Curation Center managing_org_groups = [] - Organisation.where( name: GlobalHelpers.constant("organisation_types.managing_organisation")).find_each do |managing_org| + Org.where( name: GlobalHelpers.constant("organisation_types.managing_organisation")).find_each do |managing_org| managing_org_groups = managing_org_groups + managing_org.guidance_groups end diff --git a/app/models/plan.rb b/app/models/plan.rb index acd7eff..4a76116 100644 --- a/app/models/plan.rb +++ b/app/models/plan.rb @@ -548,7 +548,7 @@ # @return [Organisation] the new funder def funder_id=(new_funder_id) if new_funder_id != "" then - new_funder = Organisation.find(new_funder_id); + new_funder = Org.find(new_funder_id); if new_funder.dmptemplates.count >= 1 && self.dmptemplate.nil? then self.dmptemplate = new_funder.dmptemplates.first end @@ -606,10 +606,10 @@ # @return [Integer, nil] the org_id of the new funder def funder_name=(new_funder_name) write_attribute(:funder_name, new_funder_name) - org_table = Organisation.arel_table - existing_org = Organisation.where(org_table[:name].matches(new_funder_name)) + org_table = Org.arel_table + existing_org = Org.where(org_table[:name].matches(new_funder_name)) if existing_org.nil? - existing_org = Organisation.where(org_table[:abbreviation].matches(new_funder_name)) + existing_org = Org.where(org_table[:abbreviation].matches(new_funder_name)) end unless existing_org.empty? self.funder_id=existing_org.id diff --git a/app/models/template.rb b/app/models/template.rb index a110e38..07206d9 100644 --- a/app/models/template.rb +++ b/app/models/template.rb @@ -89,7 +89,7 @@ funders_templates = self.funders_templates #verify if org type is not a funder - current_org = Organisation.find(org_id) + current_org = Org.find(org_id) if current_org.organisation_type.name != GlobalHelpers.constant("organisation_types.funder") then own_institutional_templates = self.own_institutional_templates(org_id) else diff --git a/app/models/token_permission_type.rb b/app/models/token_permission_type.rb index 8d368b6..0d1f291 100644 --- a/app/models/token_permission_type.rb +++ b/app/models/token_permission_type.rb @@ -1,13 +1,25 @@ class TokenPermissionType < ActiveRecord::Base - - attr_accessible :token_type, :text_description, :as => [:default, :admin] - - #associations between tables + ## + # Associations #has_and_belongs_to_many :org_token_permissions, join_table: "org_token_permissions" has_and_belongs_to_many :organisations, join_table: 'org_token_permissions' + ## + # Possibly needed for active_admin + # - relies on proetected_attributes gem as syntax depricated in rails 4.2 + attr_accessible :token_type, :text_description, :as => [:default, :admin] + + ## + # Validators validates :token_type, presence: true, uniqueness: true + + # EVALUATE CLASS AND INSTANCE METHODS BELOW + # + # What do they do? do they do it efficiently, and do we need them? + + + ## # returns the token_type of the token_permission_type # diff --git a/app/views/api/v0/dmptemplates/index.json.jbuilder b/app/views/api/v0/dmptemplates/index.json.jbuilder index 33ebd74..8ea25b3 100644 --- a/app/views/api/v0/dmptemplates/index.json.jbuilder +++ b/app/views/api/v0/dmptemplates/index.json.jbuilder @@ -1,7 +1,7 @@ # builds a json response to api query for a list of all dmptemplates json.prettify! -json.templates Organisation.all.each do |org| +json.templates Org.all.each do |org| unless org.published_templates.blank? json.organisation_name org.name json.organisation_id org.id diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 5ff15d9..dd293f1 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -37,12 +37,12 @@ <%= t("helpers.org_type.organisation") %> <%= collection_select(:user, - :organisation_id, Organisation.where("parent_id IS NULL").order("name"), + :organisation_id, Org.where("parent_id IS NULL").order("name"), :id, :name, {include_blank: constant("organisation_types.organisation")}, { :class => "typeahead org_sign_up" }) %> <% other_organisations = Array.new %> - <% Organisation.where("parent_id IS ? AND is_other = ?", nil, true).each do |org| %> + <% Org.where("parent_id IS ? AND is_other = ?", nil, true).each do |org| %> <% other_organisations << org.id %> <% end %> "> diff --git a/app/views/shared/_register_form.html.erb b/app/views/shared/_register_form.html.erb index b026327..462083a 100644 --- a/app/views/shared/_register_form.html.erb +++ b/app/views/shared/_register_form.html.erb @@ -21,11 +21,11 @@ <% end %>
  • - <%= collection_select(:user, :organisation_id, Organisation.where("parent_id IS NULL").order("sort_name ASC, name ASC"), :id, :name, {include_blank: constant("organisation_types.organisation")}, { :class => 'typeahead org_sign_up' }) %> + <%= collection_select(:user, :organisation_id, Org.where("parent_id IS NULL").order("sort_name ASC, name ASC"), :id, :name, {include_blank: constant("organisation_types.organisation")}, { :class => 'typeahead org_sign_up' }) %>
  • <% other_organisations = Array.new %> - <% Organisation.where("parent_id IS ? AND is_other = ?", nil, true).each do |org| %> + <% Org.where("parent_id IS ? AND is_other = ?", nil, true).each do |org| %> <% other_organisations << org.id %> <% end %>
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -309,38 +309,59 @@
    # File app/models/ability.rb, line 4
    -def initialize(user)
    -  # Define abilities for the passed in user here. For example:
    
    -  #
    
    -    user ||= User.new # guest user (not logged in)
    
    -    if user.has_role? :admin
    -      can :manage, :all
    -    else
    -      can :read, :all
    -    end
    -
    -  can :manage_settings, User do |viewed_user|
    -    viewed_user.present? && user.id == viewed_user.id
    -  end
    -  #
    
    -  # The first argument to `can` is the action you are giving the user 
    
    -  # permission to do.
    
    -  # If you pass :manage it will apply to every action. Other common actions
    
    -  # here are :read, :create, :update and :destroy.
    
    -  #
    
    -  # The second argument is the resource the user can perform the action on. 
    
    -  # If you pass :all it will apply to every resource. Otherwise pass a Ruby
    
    -  # class of the resource.
    
    -  #
    
    -  # The third argument is an optional hash of conditions to further filter the
    
    -  # objects.
    
    -  # For example, here the user can only update published articles.
    
    -  #
    
    -  #   can :update, Article, :published => true
    
    -  #
    
    -  # See the wiki for details:
    
    -  # https://github.com/ryanb/cancan/wiki/Defining-Abilities
    
    - 
    +def initialize(user)
    +  # Define abilities for the passed in user here. For example:
    +
    +  #
    +
    +    user ||= User.new # guest user (not logged in)
    +
    +    if user.has_role? :admin
    +      can :manage, :all
    +    else
    +      can :read, :all
    +    end
    +
    +  can :manage_settings, User do |viewed_user|
    +    viewed_user.present? && user.id == viewed_user.id
    +  end
    +  #
    +
    +  # The first argument to `can` is the action you are giving the user 
    +
    +  # permission to do.
    +
    +  # If you pass :manage it will apply to every action. Other common actions
    +
    +  # here are :read, :create, :update and :destroy.
    +
    +  #
    +
    +  # The second argument is the resource the user can perform the action on. 
    +
    +  # If you pass :all it will apply to every resource. Otherwise pass a Ruby
    +
    +  # class of the resource.
    +
    +  #
    +
    +  # The third argument is an optional hash of conditions to further filter the
    +
    +  # objects.
    +
    +  # For example, here the user can only update published articles.
    +
    +  #
    +
    +  #   can :update, Article, :published => true
    +
    +  #
    +
    +  # See the wiki for details:
    +
    +  # https://github.com/ryanb/cancan/wiki/Defining-Abilities
    +
    + 
     end
    diff --git a/html/ActiveAdmin.html b/html/ActiveAdmin.html index 03afd0f..aeb8dc4 100644 --- a/html/ActiveAdmin.html +++ b/html/ActiveAdmin.html @@ -154,7 +154,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/ActiveAdmin/Views.html b/html/ActiveAdmin/Views.html index c44200e..8b4e4fe 100644 --- a/html/ActiveAdmin/Views.html +++ b/html/ActiveAdmin/Views.html @@ -154,7 +154,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/ActiveAdmin/Views/Pages.html b/html/ActiveAdmin/Views/Pages.html index 2b52a94..cc0eccd 100644 --- a/html/ActiveAdmin/Views/Pages.html +++ b/html/ActiveAdmin/Views/Pages.html @@ -154,7 +154,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/ActiveAdmin/Views/Pages/Base.html b/html/ActiveAdmin/Views/Pages/Base.html index 9ed6a69..0920d9a 100644 --- a/html/ActiveAdmin/Views/Pages/Base.html +++ b/html/ActiveAdmin/Views/Pages/Base.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -299,11 +299,12 @@ diff --git a/html/AdminUser.html b/html/AdminUser.html index 842707c..25177a0 100644 --- a/html/AdminUser.html +++ b/html/AdminUser.html @@ -159,7 +159,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Answer.html b/html/Answer.html index d180dc9..0693ae3 100644 --- a/html/Answer.html +++ b/html/Answer.html @@ -161,7 +161,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/AnswersController.html b/html/AnswersController.html index e97eb8f..b017bbd 100644 --- a/html/AnswersController.html +++ b/html/AnswersController.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/ApplicationController.html b/html/ApplicationController.html index 6a420af..4e977fd 100644 --- a/html/ApplicationController.html +++ b/html/ApplicationController.html @@ -183,7 +183,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/ApplicationHelper.html b/html/ApplicationHelper.html index 9c7890b..c5ea91c 100644 --- a/html/ApplicationHelper.html +++ b/html/ApplicationHelper.html @@ -173,7 +173,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Comment.html b/html/Comment.html index aec80f8..9f7cf6b 100644 --- a/html/Comment.html +++ b/html/Comment.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/CommentsController.html b/html/CommentsController.html index 7a3489f..7c5267e 100644 --- a/html/CommentsController.html +++ b/html/CommentsController.html @@ -181,7 +181,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -307,20 +307,20 @@
    # File app/controllers/comments_controller.rb, line 73
    -def archive
    -  @comment = Comment.find(params[:comment][:id])
    -  @comment.archived = true
    -  @comment.archived_by = params[:comment][:archived_by]
    -  
    -  @plan = Plan.find(@comment.plan_id)
    -  @project = Project.find(@plan.project_id)
    -
    -  respond_to do |format|
    -    if @comment.update_attributes(params[:comment])
    -      session[:question_id_comments] = @comment.question_id
    -      format.html { redirect_to edit_project_plan_path(@project, @plan), status: :found, notice: 'Comment has been removed.' }     
    -    end   
    -  end
    +def archive
    +  @comment = Comment.find(params[:comment][:id])
    +  @comment.archived = true
    +  @comment.archived_by = params[:comment][:archived_by]
    +  
    +  @plan = Plan.find(@comment.plan_id)
    +  @project = Project.find(@plan.project_id)
    +
    +  respond_to do |format|
    +    if @comment.update_attributes(params[:comment])
    +      session[:question_id_comments] = @comment.question_id
    +      format.html { redirect_to edit_project_plan_path(@project, @plan), status: :found, notice: 'Comment has been removed.' }     
    +    end   
    +  end
     end
    @@ -349,25 +349,25 @@
    # File app/controllers/comments_controller.rb, line 32
    -def create
    - if user_signed_in? then
    -      @comment = Comment.new(params[:new_comment])
    -      @comment.text = params["#{params[:new_comment][:question_id]}new_comment_text"]
    -      @comment.question_id = params[:new_comment][:question_id]
    -      @comment.user_id = params[:new_comment][:user_id]
    -      @comment.plan_id = params[:new_comment][:plan_id]
    -      
    -      @plan = Plan.find(@comment.plan_id)
    -      @project = Project.find(@plan.project_id)
    -      
    -      respond_to do |format|
    -        if @comment.save
    -          session[:question_id_comments] = @comment.question_id
    -          format.html { redirect_to edit_project_plan_path(@project, @plan), status: :found, notice: 'Comment was successfully created.' }
    -          format.json { head :no_content  }
    -        end
    -      end
    -  end    
    +def create
    + if user_signed_in? then
    +      @comment = Comment.new(params[:new_comment])
    +      @comment.text = params["#{params[:new_comment][:question_id]}new_comment_text"]
    +      @comment.question_id = params[:new_comment][:question_id]
    +      @comment.user_id = params[:new_comment][:user_id]
    +      @comment.plan_id = params[:new_comment][:plan_id]
    +      
    +      @plan = Plan.find(@comment.plan_id)
    +      @project = Project.find(@plan.project_id)
    +      
    +      respond_to do |format|
    +        if @comment.save
    +          session[:question_id_comments] = @comment.question_id
    +          format.html { redirect_to edit_project_plan_path(@project, @plan), status: :found, notice: 'Comment was successfully created.' }
    +          format.json { head :no_content  }
    +        end
    +      end
    +  end    
     end
    @@ -396,8 +396,8 @@
    # File app/controllers/comments_controller.rb, line 26
    -def edit
    -  @comment = Comment.find(params[:id])
    +def edit
    +  @comment = Comment.find(params[:id])
     end
    @@ -426,13 +426,14 @@
    # File app/controllers/comments_controller.rb, line 4
    -def index
    -  @comments = Comment.all
    -
    -  respond_to do |format|
    -    format.html # index.html.erb
    
    -    format.json { render json: @comments }
    -  end
    +def index
    +  @comments = Comment.all
    +
    +  respond_to do |format|
    +    format.html # index.html.erb
    +
    +    format.json { render json: @comments }
    +  end
     end
    @@ -461,13 +462,14 @@
    # File app/controllers/comments_controller.rb, line 15
    -def show
    -  @comment = Comment.find(params[:id])
    -
    -  respond_to do |format|
    -    format.html # show.html.erb
    
    -    format.json { render json: @comment }
    -  end
    +def show
    +  @comment = Comment.find(params[:id])
    +
    +  respond_to do |format|
    +    format.html # show.html.erb
    +
    +    format.json { render json: @comment }
    +  end
     end
    @@ -496,20 +498,20 @@
    # File app/controllers/comments_controller.rb, line 55
    -def update
    -  @comment = Comment.find(params[:comment][:id])
    -  @comment.text = params["#{params[:comment][:id]}_comment_text"]
    -  
    -  @plan = Plan.find(@comment.plan_id)
    -  @project = Project.find(@plan.project_id)
    -  
    -  respond_to do |format|
    -    if @comment.update_attributes(params[:comment])
    -      session[:question_id_comments] = @comment.question_id
    -      format.html { redirect_to edit_project_plan_path(@project, @plan), status: :found, notice: 'Comment was successfully updated.' }
    -      format.json { head :no_content }
    -    end
    -  end
    +def update
    +  @comment = Comment.find(params[:comment][:id])
    +  @comment.text = params["#{params[:comment][:id]}_comment_text"]
    +  
    +  @plan = Plan.find(@comment.plan_id)
    +  @project = Project.find(@plan.project_id)
    +  
    +  respond_to do |format|
    +    if @comment.update_attributes(params[:comment])
    +      session[:question_id_comments] = @comment.question_id
    +      format.html { redirect_to edit_project_plan_path(@project, @plan), status: :found, notice: 'Comment was successfully updated.' }
    +      format.json { head :no_content }
    +    end
    +  end
     end
    diff --git a/html/ConfirmationsController.html b/html/ConfirmationsController.html index b4c7297..11e2609 100644 --- a/html/ConfirmationsController.html +++ b/html/ConfirmationsController.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/ContactsController.html b/html/ContactsController.html index 96d5d5e..5cbc8c6 100644 --- a/html/ContactsController.html +++ b/html/ContactsController.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/CustomFailure.html b/html/CustomFailure.html index 3a6aca8..00e20d5 100644 --- a/html/CustomFailure.html +++ b/html/CustomFailure.html @@ -173,7 +173,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/DMPonline4.html b/html/DMPonline4.html index dfdcbc5..299d664 100644 --- a/html/DMPonline4.html +++ b/html/DMPonline4.html @@ -156,7 +156,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/DMPonline4/Application.html b/html/DMPonline4/Application.html index 8777970..35ca2cd 100644 --- a/html/DMPonline4/Application.html +++ b/html/DMPonline4/Application.html @@ -162,7 +162,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Dmptemplate.html b/html/Dmptemplate.html index 55f87f2..3de2e67 100644 --- a/html/Dmptemplate.html +++ b/html/Dmptemplate.html @@ -185,7 +185,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -311,23 +311,24 @@
    # File app/models/dmptemplate.rb, line 63
    -def self.funders_and_own_templates(org_id)
    -        funders_templates = self.funders_templates
    -
    -#verify if org type is not a funder
    
    -current_org = Organisation.find(org_id)
    -if current_org.organisation_type.name != I18n.t("helpers.org_type.funder") then 
    -    own_institutional_templates = self.own_institutional_templates(org_id)
    -        else
    -    own_institutional_templates = []
    -end    
    -    
    -        templates_list = Array.new
    -        templates_list += own_institutional_templates
    -        templates_list += funders_templates
    -        templates_list = templates_list.sort_by { |f| f['title'].downcase }
    -                        
    -        return templates_list
    +def self.funders_and_own_templates(org_id)
    +        funders_templates = self.funders_templates
    +
    +#verify if org type is not a funder
    +
    +current_org = Organisation.find(org_id)
    +if current_org.organisation_type.name != I18n.t("helpers.org_type.funder") then 
    +    own_institutional_templates = self.own_institutional_templates(org_id)
    +        else
    +    own_institutional_templates = []
    +end    
    +    
    +        templates_list = Array.new
    +        templates_list += own_institutional_templates
    +        templates_list += funders_templates
    +        templates_list = templates_list.sort_by { |f| f['title'].downcase }
    +                        
    +        return templates_list
     end
    @@ -356,15 +357,15 @@
    # File app/models/dmptemplate.rb, line 44
    -    def self.funders_templates
    -            new_org_obejcts = OrganisationType.find_by_name(I18n.t("helpers.org_type.funder")).organisations
    -      org_templates = Array.new
    -    
    -    new_org_obejcts.each do |neworg|
    -    org_templates += neworg.dmptemplates
    -end
    -
    -return org_templates        
    +    def self.funders_templates
    +            new_org_obejcts = OrganisationType.find_by_name(I18n.t("helpers.org_type.funder")).organisations
    +      org_templates = Array.new
    +    
    +    new_org_obejcts.each do |neworg|
    +    org_templates += neworg.dmptemplates
    +end
    +
    +return org_templates        
         end
    @@ -393,9 +394,9 @@
    # File app/models/dmptemplate.rb, line 57
    -def self.own_institutional_templates(org_id)
    -        new_templates = self.where("organisation_id = ?", org_id)
    -        return new_templates
    +def self.own_institutional_templates(org_id)
    +        new_templates = self.where("organisation_id = ?", org_id)
    +        return new_templates
     end
    @@ -424,15 +425,15 @@
    # File app/models/dmptemplate.rb, line 32
    -def self.templates_org_type(ot)
    -  new_org_obejcts = OrganisationType.find_by_name(ot).organisations
    -  
    -  org_templates = Array.new
    -  new_org_obejcts.each do |neworg|
    -     org_templates += neworg.dmptemplates.where("published = ?", true)
    -  end
    -  
    -  return org_templates
    +def self.templates_org_type(ot)
    +  new_org_obejcts = OrganisationType.find_by_name(ot).organisations
    +  
    +  org_templates = Array.new
    +  new_org_obejcts.each do |neworg|
    +     org_templates += neworg.dmptemplates.where("published = ?", true)
    +  end
    +  
    +  return org_templates
     end
    @@ -467,20 +468,20 @@
    # File app/models/dmptemplate.rb, line 88
    -def has_customisations?(org_id, temp)
    -        if temp.organisation_id != org_id then
    -                temp.phases.each do |phase|
    -                        phase.versions.each do |version|
    -                                version.sections.each do |section|
    -                                        return true if section.organisation_id == org_id 
    -                                                                                
    -                                end        
    -                        end
    -                        return false 
    -                end
    -        else
    -                return false         
    -        end   
    +def has_customisations?(org_id, temp)
    +        if temp.organisation_id != org_id then
    +                temp.phases.each do |phase|
    +                        phase.versions.each do |version|
    +                                version.sections.each do |section|
    +                                        return true if section.organisation_id == org_id 
    +                                                                                
    +                                end        
    +                        end
    +                        return false 
    +                end
    +        else
    +                return false         
    +        end   
     end
    @@ -509,11 +510,11 @@
    # File app/models/dmptemplate.rb, line 106
    -def has_published_versions?
    -        phases.each do |phase|
    -                return true if !phase.latest_published_version.nil?
    -        end
    -        return false 
    +def has_published_versions?
    +        phases.each do |phase|
    +                return true if !phase.latest_published_version.nil?
    +        end
    +        return false 
     end
    @@ -542,9 +543,9 @@
    # File app/models/dmptemplate.rb, line 82
    -def org_type
    -        org_type = organisation.organisation_type.name
    -        return org_type
    +def org_type
    +        org_type = organisation.organisation_type.name
    +        return org_type
     end
    @@ -573,8 +574,8 @@
    # File app/models/dmptemplate.rb, line 28
    -def to_s
    -  "#{title}"
    +def to_s
    +  "#{title}"
     end
    diff --git a/html/DmptemplatesController.html b/html/DmptemplatesController.html index 547fccf..f4c7d37 100644 --- a/html/DmptemplatesController.html +++ b/html/DmptemplatesController.html @@ -217,7 +217,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/ExistingUsersController.html b/html/ExistingUsersController.html index 207ddd3..a3baca4 100644 --- a/html/ExistingUsersController.html +++ b/html/ExistingUsersController.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/ExportedPlan.html b/html/ExportedPlan.html index 1c12381..e7911e1 100644 --- a/html/ExportedPlan.html +++ b/html/ExportedPlan.html @@ -199,7 +199,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/FileType.html b/html/FileType.html index ab97dc6..749a3b5 100644 --- a/html/FileType.html +++ b/html/FileType.html @@ -161,7 +161,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/FileUpload.html b/html/FileUpload.html index 14c28de..a91679c 100644 --- a/html/FileUpload.html +++ b/html/FileUpload.html @@ -161,7 +161,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Guidance.html b/html/Guidance.html index 2700bfe..f65c3d8 100644 --- a/html/Guidance.html +++ b/html/Guidance.html @@ -175,7 +175,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/GuidanceGroup.html b/html/GuidanceGroup.html index b9de7cb..0907393 100644 --- a/html/GuidanceGroup.html +++ b/html/GuidanceGroup.html @@ -175,7 +175,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/GuidanceGroupsController.html b/html/GuidanceGroupsController.html index ed9a143..7283e1a 100644 --- a/html/GuidanceGroupsController.html +++ b/html/GuidanceGroupsController.html @@ -181,7 +181,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/GuidancesController.html b/html/GuidancesController.html index 661593b..7e036ea 100644 --- a/html/GuidancesController.html +++ b/html/GuidancesController.html @@ -191,7 +191,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/HomeController.html b/html/HomeController.html index de06c21..dcc676f 100644 --- a/html/HomeController.html +++ b/html/HomeController.html @@ -173,7 +173,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Object.html b/html/Object.html index 52debe7..e231136 100644 --- a/html/Object.html +++ b/html/Object.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -297,8 +297,9 @@
    # File app/admin/user.rb, line 118
    -def scoped_collection
    -  resource_class.includes(:organisations) # prevents N+1 queries to your database
    
    +def scoped_collection
    +  resource_class.includes(:organisations) # prevents N+1 queries to your database
    +
     end
    diff --git a/html/Option.html b/html/Option.html index 84cec1e..1798432 100644 --- a/html/Option.html +++ b/html/Option.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/OptionWarning.html b/html/OptionWarning.html index 89da768..921cfe8 100644 --- a/html/OptionWarning.html +++ b/html/OptionWarning.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Organisation.html b/html/Organisation.html index 359bcb0..d71187f 100644 --- a/html/Organisation.html +++ b/html/Organisation.html @@ -187,7 +187,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/OrganisationType.html b/html/OrganisationType.html index ace8b80..1448f7c 100644 --- a/html/OrganisationType.html +++ b/html/OrganisationType.html @@ -161,7 +161,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/OrganisationUsersController.html b/html/OrganisationUsersController.html index 5ffe280..cd53ddb 100644 --- a/html/OrganisationUsersController.html +++ b/html/OrganisationUsersController.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/OrganisationsController.html b/html/OrganisationsController.html index 0dd652a..91d1f12 100644 --- a/html/OrganisationsController.html +++ b/html/OrganisationsController.html @@ -189,7 +189,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Page.html b/html/Page.html index 013ca0c..a4a8cea 100644 --- a/html/Page.html +++ b/html/Page.html @@ -159,7 +159,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/PagesController.html b/html/PagesController.html index 45ae69a..b067c7c 100644 --- a/html/PagesController.html +++ b/html/PagesController.html @@ -181,7 +181,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -309,18 +309,18 @@
    # File app/controllers/pages_controller.rb, line 42
    -def create
    -  @page = Page.new(params[:page])
    -
    -  respond_to do |format|
    -    if @page.save
    -      format.html { redirect_to @page, notice: 'Page was successfully created.' }
    -      format.json { render json: @page, status: :created, location: @page }
    -    else
    -      format.html { render action: "new" }
    -      format.json { render json: @page.errors, status: :unprocessable_entity }
    -    end
    -  end
    +def create
    +  @page = Page.new(params[:page])
    +
    +  respond_to do |format|
    +    if @page.save
    +      format.html { redirect_to @page, notice: 'Page was successfully created.' }
    +      format.json { render json: @page, status: :created, location: @page }
    +    else
    +      format.html { render action: "new" }
    +      format.json { render json: @page.errors, status: :unprocessable_entity }
    +    end
    +  end
     end
    @@ -349,14 +349,14 @@
    # File app/controllers/pages_controller.rb, line 74
    -def destroy
    -  @page = Page.find(params[:id])
    -  @page.destroy
    -
    -  respond_to do |format|
    -    format.html { redirect_to pages_url }
    -    format.json { head :no_content }
    -  end
    +def destroy
    +  @page = Page.find(params[:id])
    +  @page.destroy
    +
    +  respond_to do |format|
    +    format.html { redirect_to pages_url }
    +    format.json { head :no_content }
    +  end
     end
    @@ -385,8 +385,8 @@
    # File app/controllers/pages_controller.rb, line 36
    -def edit
    -  @page = Page.find(params[:id])
    +def edit
    +  @page = Page.find(params[:id])
     end
    @@ -415,13 +415,14 @@
    # File app/controllers/pages_controller.rb, line 4
    -def index
    -  @pages = Page.all
    -
    -  respond_to do |format|
    -    format.html # index.html.erb
    
    -    format.json { render json: @pages }
    -  end
    +def index
    +  @pages = Page.all
    +
    +  respond_to do |format|
    +    format.html # index.html.erb
    +
    +    format.json { render json: @pages }
    +  end
     end
    @@ -450,13 +451,14 @@
    # File app/controllers/pages_controller.rb, line 26
    -def new
    -  @page = Page.new
    -
    -  respond_to do |format|
    -    format.html # new.html.erb
    
    -    format.json { render json: @page }
    -  end
    +def new
    +  @page = Page.new
    +
    +  respond_to do |format|
    +    format.html # new.html.erb
    +
    +    format.json { render json: @page }
    +  end
     end
    @@ -485,13 +487,14 @@
    # File app/controllers/pages_controller.rb, line 15
    -def show
    -  @page = Page.find(params[:id])
    -
    -  respond_to do |format|
    -    format.html # show.html.erb
    
    -    format.json { render json: @page }
    -  end
    +def show
    +  @page = Page.find(params[:id])
    +
    +  respond_to do |format|
    +    format.html # show.html.erb
    +
    +    format.json { render json: @page }
    +  end
     end
    @@ -520,18 +523,18 @@
    # File app/controllers/pages_controller.rb, line 58
    -def update
    -  @page = Page.find(params[:id])
    -
    -  respond_to do |format|
    -    if @page.update_attributes(params[:page])
    -      format.html { redirect_to @page, notice: 'Page was successfully updated.' }
    -      format.json { head :no_content }
    -    else
    -      format.html { render action: "edit" }
    -      format.json { render json: @page.errors, status: :unprocessable_entity }
    -    end
    -  end
    +def update
    +  @page = Page.find(params[:id])
    +
    +  respond_to do |format|
    +    if @page.update_attributes(params[:page])
    +      format.html { redirect_to @page, notice: 'Page was successfully updated.' }
    +      format.json { head :no_content }
    +    else
    +      format.html { render action: "edit" }
    +      format.json { render json: @page.errors, status: :unprocessable_entity }
    +    end
    +  end
     end
    diff --git a/html/PasswordsController.html b/html/PasswordsController.html index 082953f..3364f85 100644 --- a/html/PasswordsController.html +++ b/html/PasswordsController.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Phase.html b/html/Phase.html index 5a67745..c5491a9 100644 --- a/html/Phase.html +++ b/html/Phase.html @@ -177,7 +177,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Plan.html b/html/Plan.html index ec37741..9f0b894 100644 --- a/html/Plan.html +++ b/html/Plan.html @@ -217,7 +217,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -376,28 +376,28 @@
    # File app/models/plan.rb, line 119
    -def add_guidance_to_array(guidance_array, guidance_group, theme, guidance)
    -        
    -        if guidance_array[guidance_group].nil? then
    -                guidance_array[guidance_group] = {}
    -        end
    -        if theme.nil? then
    -                if guidance_array[guidance_group]["no_theme"].nil? then
    -                        guidance_array[guidance_group]["no_theme"] = []
    -                end
    -                if !guidance_array[guidance_group]["no_theme"].include?(guidance) then
    -                        guidance_array[guidance_group]["no_theme"].push(guidance)
    -                end
    -        else
    -                if guidance_array[guidance_group][theme].nil? then
    -                        guidance_array[guidance_group][theme] = []
    -                end
    -                if !guidance_array[guidance_group][theme].include?(guidance) then
    -                        guidance_array[guidance_group][theme].push(guidance)
    -                end
    -        end
    -        
    -return guidance_array
    +def add_guidance_to_array(guidance_array, guidance_group, theme, guidance)
    +        
    +        if guidance_array[guidance_group].nil? then
    +                guidance_array[guidance_group] = {}
    +        end
    +        if theme.nil? then
    +                if guidance_array[guidance_group]["no_theme"].nil? then
    +                        guidance_array[guidance_group]["no_theme"] = []
    +                end
    +                if !guidance_array[guidance_group]["no_theme"].include?(guidance) then
    +                        guidance_array[guidance_group]["no_theme"].push(guidance)
    +                end
    +        else
    +                if guidance_array[guidance_group][theme].nil? then
    +                        guidance_array[guidance_group][theme] = []
    +                end
    +                if !guidance_array[guidance_group][theme].include?(guidance) then
    +                        guidance_array[guidance_group][theme].push(guidance)
    +                end
    +        end
    +        
    +return guidance_array
     end
    @@ -426,8 +426,8 @@
    # File app/models/plan.rb, line 168
    -def administerable_by(user_id)
    -        return project.readable_by(user_id)
    +def administerable_by(user_id)
    +        return project.readable_by(user_id)
     end
    @@ -456,23 +456,23 @@
    # File app/models/plan.rb, line 53
    -def answer(qid, create_if_missing = true)
    -        answer = answers.where(:question_id => qid).order("created_at DESC").first
    -        question = Question.find(qid)
    -        if answer.nil? && create_if_missing then
    -                answer = Answer.new
    -                answer.plan_id = id
    -                answer.question_id = qid
    -                answer.text = question.default_value
    -                default_options = Array.new
    -                question.options.each do |option|
    -                        if option.is_default
    -                                default_options << option
    -                        end
    -                end
    -                answer.options = default_options
    -        end
    -        return answer
    +def answer(qid, create_if_missing = true)
    +        answer = answers.where(:question_id => qid).order("created_at DESC").first
    +        question = Question.find(qid)
    +        if answer.nil? && create_if_missing then
    +                answer = Answer.new
    +                answer.plan_id = id
    +                answer.question_id = qid
    +                answer.text = question.default_value
    +                default_options = Array.new
    +                question.options.each do |option|
    +                        if option.is_default
    +                                default_options << option
    +                        end
    +                end
    +                answer.options = default_options
    +        end
    +        return answer
     end
    @@ -501,10 +501,10 @@
    # File app/models/plan.rb, line 291
    -def delete_recent_locks(user_id)
    -        plan_sections.where(:user_id => user_id).each do |lock|
    -                lock.delete
    -        end
    +def delete_recent_locks(user_id)
    +        plan_sections.where(:user_id => user_id).each do |lock|
    +                lock.delete
    +        end
     end
    @@ -533,34 +533,34 @@
    # File app/models/plan.rb, line 230
    -def details
    -        details = {
    -                "project_title" => project.title,
    -                "phase_title" => version.phase.title,
    -                "sections" => {}
    -        }
    -        sections.sort_by(&:"number").each do |s|
    -                details["sections"][s.number] = {}
    -                details["sections"][s.number]["title"] = s.title
    -                details["sections"][s.number]["questions"] = {}
    -                s.questions.order("number").each do |q|
    -                        details["sections"][s.number]["questions"][q.number] = {}
    -                        details["sections"][s.number]["questions"][q.number]["question_text"] = q.text
    -                        answer = answer(q.id, false)
    -                        if ! answer.nil? then
    -            q_format = q.question_format
    -                                if (q_format.title == t("helpers.checkbox") || q_format.title == t("helpers.multi_select_box") ||
    -                                q_format.title == t("helpers.radio_buttons") || q_format.title == t("helpers.dropdown")) then
    -                                        details["sections"][s.number]["questions"][q.number]["selections"] = {}
    -                                        answer.options.each do |o|
    -                                                details["sections"][s.number]["questions"][q.number]["selections"][o.number] = o.text
    -                                        end
    -                                end
    -                                details["sections"][s.number]["questions"][q.number]["answer_text"] = answer.text
    -                        end
    -                end
    -        end
    -        return details
    +def details
    +        details = {
    +                "project_title" => project.title,
    +                "phase_title" => version.phase.title,
    +                "sections" => {}
    +        }
    +        sections.sort_by(&:"number").each do |s|
    +                details["sections"][s.number] = {}
    +                details["sections"][s.number]["title"] = s.title
    +                details["sections"][s.number]["questions"] = {}
    +                s.questions.order("number").each do |q|
    +                        details["sections"][s.number]["questions"][q.number] = {}
    +                        details["sections"][s.number]["questions"][q.number]["question_text"] = q.text
    +                        answer = answer(q.id, false)
    +                        if ! answer.nil? then
    +            q_format = q.question_format
    +                                if (q_format.title == t("helpers.checkbox") || q_format.title == t("helpers.multi_select_box") ||
    +                                q_format.title == t("helpers.radio_buttons") || q_format.title == t("helpers.dropdown")) then
    +                                        details["sections"][s.number]["questions"][q.number]["selections"] = {}
    +                                        answer.options.each do |o|
    +                                                details["sections"][s.number]["questions"][q.number]["selections"][o.number] = o.text
    +                                        end
    +                                end
    +                                details["sections"][s.number]["questions"][q.number]["answer_text"] = answer.text
    +                        end
    +                end
    +        end
    +        return details
     end
    @@ -589,8 +589,8 @@
    # File app/models/plan.rb, line 36
    -def dmptemplate
    -        self.project.try(:dmptemplate) || Dmptemplate.new
    +def dmptemplate
    +        self.project.try(:dmptemplate) || Dmptemplate.new
     end
    @@ -619,8 +619,8 @@
    # File app/models/plan.rb, line 156
    -def editable_by(user_id)
    -        return project.editable_by(user_id)
    +def editable_by(user_id)
    +        return project.editable_by(user_id)
     end
    @@ -649,42 +649,45 @@
    # File app/models/plan.rb, line 81
    -def guidance_for_question(question)
    -        guidances = {}
    -        # If project org isn't nil, get guidance by theme from any "non-subset" groups belonging to project org
    
    -        unless project.organisation.nil? then
    -                project.organisation.guidance_groups.each do |group|
    -                        if !group.optional_subset && (group.dmptemplates.pluck(:id).include?(project.dmptemplate_id) || group.dmptemplates.count == 0) then
    -                                group.guidances.each do |guidance|
    -                                        guidance.themes.where("id IN (?)", question.theme_ids).each do |theme|
    -                                                guidances = self.add_guidance_to_array(guidances, group, theme, guidance)
    -                                        end
    -                                end
    -                        end
    -                end
    -        end
    -
    -        # Get guidance by theme from any guidance groups selected on creation
    
    -        project.guidance_groups.each do |group|
    -                if group.dmptemplates.pluck(:id).include?(project.dmptemplate_id) || group.dmptemplates.count == 0 then
    -                        group.guidances.each do |guidance|
    -                                guidance.themes.where("id IN (?)", question.theme_ids).each do |theme|
    -                                        guidances = self.add_guidance_to_array(guidances, group, theme, guidance)
    -                                end
    -                        end
    -                end 
    -end
    -        
    -        # Get guidance by question where guidance group was selected on creation or if group is organisation default
    
    -        question.guidances.each do |guidance|
    -                guidance.guidance_groups.each do |group|
    -                        if (group.organisation == project.organisation && !group.optional_subset) || project.guidance_groups.include?(group) then
    -                                guidances = self.add_guidance_to_array(guidances, group, nil, guidance)
    -                        end
    -    end
    -        end
    -
    -        return guidances
    +def guidance_for_question(question)
    +        guidances = {}
    +        # If project org isn't nil, get guidance by theme from any "non-subset" groups belonging to project org
    +
    +        unless project.organisation.nil? then
    +                project.organisation.guidance_groups.each do |group|
    +                        if !group.optional_subset && (group.dmptemplates.pluck(:id).include?(project.dmptemplate_id) || group.dmptemplates.count == 0) then
    +                                group.guidances.each do |guidance|
    +                                        guidance.themes.where("id IN (?)", question.theme_ids).each do |theme|
    +                                                guidances = self.add_guidance_to_array(guidances, group, theme, guidance)
    +                                        end
    +                                end
    +                        end
    +                end
    +        end
    +
    +        # Get guidance by theme from any guidance groups selected on creation
    +
    +        project.guidance_groups.each do |group|
    +                if group.dmptemplates.pluck(:id).include?(project.dmptemplate_id) || group.dmptemplates.count == 0 then
    +                        group.guidances.each do |guidance|
    +                                guidance.themes.where("id IN (?)", question.theme_ids).each do |theme|
    +                                        guidances = self.add_guidance_to_array(guidances, group, theme, guidance)
    +                                end
    +                        end
    +                end 
    +end
    +        
    +        # Get guidance by question where guidance group was selected on creation or if group is organisation default
    +
    +        question.guidances.each do |guidance|
    +                guidance.guidance_groups.each do |group|
    +                        if (group.organisation == project.organisation && !group.optional_subset) || project.guidance_groups.include?(group) then
    +                                guidances = self.add_guidance_to_array(guidances, group, nil, guidance)
    +                        end
    +    end
    +        end
    +
    +        return guidances
     end
    @@ -713,17 +716,17 @@
    # File app/models/plan.rb, line 321
    -def latest_update
    -        if answers.any? then
    -                last_answered = answers.order("updated_at DESC").first.updated_at
    -                if last_answered > updated_at then
    -                        return last_answered
    -                else
    -                        return updated_at
    -                end
    -        else
    -                return updated_at
    -        end
    +def latest_update
    +        if answers.any? then
    +                last_answered = answers.order("updated_at DESC").first.updated_at
    +                if last_answered > updated_at then
    +                        return last_answered
    +                else
    +                        return updated_at
    +                end
    +        else
    +                return updated_at
    +        end
     end
    @@ -752,10 +755,10 @@
    # File app/models/plan.rb, line 279
    -def lock_all_sections(user_id)
    -        sections.each do |s|
    -                lock_section(s.id, user_id, 1800)
    -        end
    +def lock_all_sections(user_id)
    +        sections.each do |s|
    +                lock_section(s.id, user_id, 1800)
    +        end
     end
    @@ -784,22 +787,22 @@
    # File app/models/plan.rb, line 297
    -def lock_section(section_id, user_id, release_time = 60)
    -        status = locked(section_id, user_id)
    -        if ! status["locked"] then
    -                plan_section = PlanSection.new
    -                plan_section.plan_id = id
    -                plan_section.section_id = section_id
    -                plan_section.release_time = Time.now + release_time.seconds
    -                plan_section.user_id = user_id
    -                plan_section.save
    -        elsif status["current_user"] then
    -                plan_section = PlanSection.find(status["id"])
    -                plan_section.release_time = Time.now + release_time.seconds
    -                plan_section.save
    -        else
    -                return false
    -        end
    +def lock_section(section_id, user_id, release_time = 60)
    +        status = locked(section_id, user_id)
    +        if ! status["locked"] then
    +                plan_section = PlanSection.new
    +                plan_section.plan_id = id
    +                plan_section.section_id = section_id
    +                plan_section.release_time = Time.now + release_time.seconds
    +                plan_section.user_id = user_id
    +                plan_section.save
    +        elsif status["current_user"] then
    +                plan_section = PlanSection.find(status["id"])
    +                plan_section.release_time = Time.now + release_time.seconds
    +                plan_section.save
    +        else
    +                return false
    +        end
     end
    @@ -828,23 +831,23 @@
    # File app/models/plan.rb, line 260
    -def locked(section_id, user_id)
    -        plan_section = plan_sections.where("section_id = ? AND user_id != ? AND release_time > ?", section_id, user_id, Time.now).last
    -        if plan_section.nil? then
    -                status = {
    -                        "locked" => false,
    -                        "locked_by" => nil,
    -                        "timestamp" => nil,
    -                        "id" => nil
    -                }
    -        else
    -                status = {
    -                        "locked" => true,
    -                        "locked_by" => plan_section.user.name,
    -                        "timestamp" => plan_section.updated_at,
    -                        "id" => plan_section.id
    -                }
    -        end
    +def locked(section_id, user_id)
    +        plan_section = plan_sections.where("section_id = ? AND user_id != ? AND release_time > ?", section_id, user_id, Time.now).last
    +        if plan_section.nil? then
    +                status = {
    +                        "locked" => false,
    +                        "locked_by" => nil,
    +                        "timestamp" => nil,
    +                        "id" => nil
    +                }
    +        else
    +                status = {
    +                        "locked" => true,
    +                        "locked_by" => plan_section.user.name,
    +                        "timestamp" => plan_section.updated_at,
    +                        "id" => plan_section.id
    +                }
    +        end
     end
    @@ -873,12 +876,12 @@
    # File app/models/plan.rb, line 160
    -def readable_by(user_id)
    -        if project.nil?
    -                return false
    -        else
    -                return project.readable_by(user_id)
    -        end
    +def readable_by(user_id)
    +        if project.nil?
    +                return false
    +        else
    +                return project.readable_by(user_id)
    +        end
     end
    @@ -907,33 +910,34 @@
    # File app/models/plan.rb, line 334
    -def section_answers(section_id)
    -        section = Section.find(section_id)
    -        section_questions = Array.new
    -        counter = 0
    -        section.questions.each do |q|
    -                section_questions[counter] = {}
    -                section_questions[counter]["id"] = q.id
    -                #section_questions[counter]["multiple_choice"] = q.multiple_choice
    
    -                q_answer = answer(q.id, false)
    -                if q_answer.nil? then
    -                        section_questions[counter]["answer_id"] = nil
    -                        if q.suggested_answers.find_by_organisation_id(project.organisation_id).nil? then
    -                                section_questions[counter]["answer_text"] = ""
    -                        else
    -                                section_questions[counter]["answer_text"] = q.default_value
    -                        end
    -                        section_questions[counter]["answer_timestamp"] = nil
    -                        section_questions[counter]["answer_options"] = Array.new
    -                else
    -                        section_questions[counter]["answer_id"] = q_answer.id
    -                        section_questions[counter]["answer_text"] = q_answer.text
    -                        section_questions[counter]["answer_timestamp"] = q_answer.created_at
    -                        section_questions[counter]["answer_options"] = q_answer.options.pluck(:id)
    -                end
    -                counter = counter + 1
    -        end
    -        return section_questions
    +def section_answers(section_id)
    +        section = Section.find(section_id)
    +        section_questions = Array.new
    +        counter = 0
    +        section.questions.each do |q|
    +                section_questions[counter] = {}
    +                section_questions[counter]["id"] = q.id
    +                #section_questions[counter]["multiple_choice"] = q.multiple_choice
    +
    +                q_answer = answer(q.id, false)
    +                if q_answer.nil? then
    +                        section_questions[counter]["answer_id"] = nil
    +                        if q.suggested_answers.find_by_organisation_id(project.organisation_id).nil? then
    +                                section_questions[counter]["answer_text"] = ""
    +                        else
    +                                section_questions[counter]["answer_text"] = q.default_value
    +                        end
    +                        section_questions[counter]["answer_timestamp"] = nil
    +                        section_questions[counter]["answer_options"] = Array.new
    +                else
    +                        section_questions[counter]["answer_id"] = q_answer.id
    +                        section_questions[counter]["answer_text"] = q_answer.text
    +                        section_questions[counter]["answer_timestamp"] = q_answer.created_at
    +                        section_questions[counter]["answer_options"] = q_answer.options.pluck(:id)
    +                end
    +                counter = counter + 1
    +        end
    +        return section_questions
     end
    @@ -962,13 +966,13 @@
    # File app/models/plan.rb, line 72
    -def sections
    -        unless project.organisation.nil? then
    -                sections = version.global_sections + project.organisation.all_sections(version_id)
    -        else
    -                sections = version.global_sections
    -        end
    -        return sections.uniq.sort_by &:number
    +def sections
    +        unless project.organisation.nil? then
    +                sections = version.global_sections + project.organisation.all_sections(version_id)
    +        else
    +                sections = version.global_sections
    +        end
    +        return sections.uniq.sort_by &:number
     end
    @@ -1000,11 +1004,11 @@
    # File app/models/plan.rb, line 29
    -def settings(key)
    -        self_settings = self.super_settings(key)
    -        return self_settings if self_settings.value?
    -
    -        self.dmptemplate.settings(key)
    +def settings(key)
    +        self_settings = self.super_settings(key)
    +        return self_settings if self_settings.value?
    +
    +        self.dmptemplate.settings(key)
     end
    @@ -1037,62 +1041,64 @@
    # File app/models/plan.rb, line 172
    -def status
    -        status = {
    -                "num_questions" => 0,
    -                "num_answers" => 0,
    -                "sections" => {},
    -                "questions" => {},
    -                "space_used" => 0 # percentage of available space in pdf used
    
    -        }
    -
    -        space_used = height_of_text(self.project.title, 2, 2)
    -
    -        sections.each do |s|
    -                space_used += height_of_text(s.title, 1, 1)
    -                section_questions = 0
    -                section_answers = 0
    -                status["sections"][s.id] = {}
    -                status["sections"][s.id]["questions"] = Array.new
    -                s.questions.each do |q|
    -                        status["num_questions"] += 1
    -                        section_questions += 1
    -                        status["sections"][s.id]["questions"] << q.id
    -                        status["questions"][q.id] = {}
    -                        answer = answer(q.id, false)
    -
    -                        space_used += height_of_text(q.text) unless q.text == s.title
    -                        space_used += height_of_text(answer.try(:text) || I18n.t('helpers.plan.export.pdf.question_not_answered'))
    -
    -                        if ! answer.nil? then
    -                                status["questions"][q.id] = {
    -                                        "answer_id" => answer.id,
    -                                        "answer_created_at" => answer.created_at.to_i,
    -                                        "answer_text" => answer.text,
    -                                        "answer_option_ids" => answer.option_ids,
    -                                        "answered_by" => answer.user.name
    -                                }
    -            q_format = q.question_format
    -                                status["num_answers"] += 1 if (q_format.title == I18n.t("helpers.checkbox") || q_format.title == I18n.t("helpers.multi_select_box") ||
    -                                q_format.title == I18n.t("helpers.radio_buttons") || q_format.title == I18n.t("helpers.dropdown")) || answer.text.present?
    -                                section_answers += 1
    -                                #TODO: include selected options in space estimate
    
    -                        else
    -                                status["questions"][q.id] = {
    -                                        "answer_id" => nil,
    -                                        "answer_created_at" => nil,
    -                                        "answer_text" => nil,
    -                                        "answer_option_ids" => nil,
    -                                        "answered_by" => nil
    -                                }
    -                        end
    -                        status["sections"][s.id]["num_questions"] = section_questions
    -                        status["sections"][s.id]["num_answers"] = section_answers
    -                end
    -        end
    -
    -        status['space_used'] = estimate_space_used(space_used)
    -        return status
    +def status
    +        status = {
    +                "num_questions" => 0,
    +                "num_answers" => 0,
    +                "sections" => {},
    +                "questions" => {},
    +                "space_used" => 0 # percentage of available space in pdf used
    +
    +        }
    +
    +        space_used = height_of_text(self.project.title, 2, 2)
    +
    +        sections.each do |s|
    +                space_used += height_of_text(s.title, 1, 1)
    +                section_questions = 0
    +                section_answers = 0
    +                status["sections"][s.id] = {}
    +                status["sections"][s.id]["questions"] = Array.new
    +                s.questions.each do |q|
    +                        status["num_questions"] += 1
    +                        section_questions += 1
    +                        status["sections"][s.id]["questions"] << q.id
    +                        status["questions"][q.id] = {}
    +                        answer = answer(q.id, false)
    +
    +                        space_used += height_of_text(q.text) unless q.text == s.title
    +                        space_used += height_of_text(answer.try(:text) || I18n.t('helpers.plan.export.pdf.question_not_answered'))
    +
    +                        if ! answer.nil? then
    +                                status["questions"][q.id] = {
    +                                        "answer_id" => answer.id,
    +                                        "answer_created_at" => answer.created_at.to_i,
    +                                        "answer_text" => answer.text,
    +                                        "answer_option_ids" => answer.option_ids,
    +                                        "answered_by" => answer.user.name
    +                                }
    +            q_format = q.question_format
    +                                status["num_answers"] += 1 if (q_format.title == I18n.t("helpers.checkbox") || q_format.title == I18n.t("helpers.multi_select_box") ||
    +                                q_format.title == I18n.t("helpers.radio_buttons") || q_format.title == I18n.t("helpers.dropdown")) || answer.text.present?
    +                                section_answers += 1
    +                                #TODO: include selected options in space estimate
    +
    +                        else
    +                                status["questions"][q.id] = {
    +                                        "answer_id" => nil,
    +                                        "answer_created_at" => nil,
    +                                        "answer_text" => nil,
    +                                        "answer_option_ids" => nil,
    +                                        "answered_by" => nil
    +                                }
    +                        end
    +                        status["sections"][s.id]["num_questions"] = section_questions
    +                        status["sections"][s.id]["num_answers"] = section_answers
    +                end
    +        end
    +
    +        status['space_used'] = estimate_space_used(space_used)
    +        return status
     end
    @@ -1148,17 +1154,17 @@
    # File app/models/plan.rb, line 40
    -def title
    -        logger.debug "Title in settings: #{self.settings(:export).title}"
    -        if self.settings(:export).title == ""
    -    if !self.version.nil? && !self.version.phase.nil? && !self.version.phase.title? then
    -        return self.version.phase.title
    -    else
    -        return "DMP title"
    -                end
    -        else
    -                return self.settings(:export).title
    -        end
    +def title
    +        logger.debug "Title in settings: #{self.settings(:export).title}"
    +        if self.settings(:export).title == ""
    +    if !self.version.nil? && !self.version.phase.nil? && !self.version.phase.title? then
    +        return self.version.phase.title
    +    else
    +        return "DMP title"
    +                end
    +        else
    +                return self.settings(:export).title
    +        end
     end
    @@ -1187,10 +1193,10 @@
    # File app/models/plan.rb, line 285
    -def unlock_all_sections(user_id)
    -        plan_sections.where(:user_id => user_id).order("created_at DESC").each do |lock|
    -                lock.delete
    -        end
    +def unlock_all_sections(user_id)
    +        plan_sections.where(:user_id => user_id).order("created_at DESC").each do |lock|
    +                lock.delete
    +        end
     end
    @@ -1219,10 +1225,10 @@
    # File app/models/plan.rb, line 315
    -def unlock_section(section_id, user_id)
    -        plan_sections.where(:section_id => section_id, :user_id => user_id).order("created_at DESC").each do |lock|
    -                lock.delete
    -        end
    +def unlock_section(section_id, user_id)
    +        plan_sections.where(:section_id => section_id, :user_id => user_id).order("created_at DESC").each do |lock|
    +                lock.delete
    +        end
     end
    @@ -1251,12 +1257,12 @@
    # File app/models/plan.rb, line 148
    -def warning(option_id)
    -        if project.organisation.nil?
    -                return nil
    -        else
    -                return project.organisation.warning(option_id)
    -        end
    +def warning(option_id)
    +        if project.organisation.nil?
    +                return nil
    +        else
    +                return project.organisation.warning(option_id)
    +        end
     end
    @@ -1297,17 +1303,19 @@
    # File app/models/plan.rb, line 372
    -def estimate_space_used(used_height)
    -        @formatting ||= self.settings(:export).formatting
    -
    -        return 0 unless @formatting[:font_size] > 0
    -
    -        margin_height    = @formatting[:margin][:top].to_i + @formatting[:margin][:bottom].to_i
    -        page_height      = A4_PAGE_HEIGHT - margin_height # 297mm for A4 portrait
    
    -        available_height = page_height * self.dmptemplate.settings(:export).max_pages
    -
    -        percentage = (used_height / available_height) * 100
    -        (percentage / ROUNDING).ceil * ROUNDING # round up to nearest five
    
    +def estimate_space_used(used_height)
    +        @formatting ||= self.settings(:export).formatting
    +
    +        return 0 unless @formatting[:font_size] > 0
    +
    +        margin_height    = @formatting[:margin][:top].to_i + @formatting[:margin][:bottom].to_i
    +        page_height      = A4_PAGE_HEIGHT - margin_height # 297mm for A4 portrait
    +
    +        available_height = page_height * self.dmptemplate.settings(:export).max_pages
    +
    +        percentage = (used_height / available_height) * 100
    +        (percentage / ROUNDING).ceil * ROUNDING # round up to nearest five
    +
     end
    @@ -1342,21 +1350,23 @@
    # File app/models/plan.rb, line 392
    -def height_of_text(text, font_size_inc = 0, vertical_margin = 0)
    -        @formatting     ||= self.settings(:export).formatting
    -        @margin_width   ||= @formatting[:margin][:left].to_i + @formatting[:margin][:right].to_i
    -        @base_font_size ||= @formatting[:font_size]
    -
    -        return 0 unless @base_font_size > 0
    -
    -        font_height = FONT_HEIGHT_CONVERSION_FACTOR * (@base_font_size + font_size_inc)
    -        font_width  = font_height * FONT_WIDTH_HEIGHT_RATIO # Assume glyph width averages at 2/5s the height
    
    -        leading     = font_height / 2
    -
    -        chars_in_line = (A4_PAGE_WIDTH - @margin_width) / font_width # 210mm for A4 portrait
    
    -        num_lines = (text.length / chars_in_line).ceil
    -
    -        (num_lines * font_height) + vertical_margin + leading
    +def height_of_text(text, font_size_inc = 0, vertical_margin = 0)
    +        @formatting     ||= self.settings(:export).formatting
    +        @margin_width   ||= @formatting[:margin][:left].to_i + @formatting[:margin][:right].to_i
    +        @base_font_size ||= @formatting[:font_size]
    +
    +        return 0 unless @base_font_size > 0
    +
    +        font_height = FONT_HEIGHT_CONVERSION_FACTOR * (@base_font_size + font_size_inc)
    +        font_width  = font_height * FONT_WIDTH_HEIGHT_RATIO # Assume glyph width averages at 2/5s the height
    +
    +        leading     = font_height / 2
    +
    +        chars_in_line = (A4_PAGE_WIDTH - @margin_width) / font_width # 210mm for A4 portrait
    +
    +        num_lines = (text.length / chars_in_line).ceil
    +
    +        (num_lines * font_height) + vertical_margin + leading
     end
    diff --git a/html/PlanSection.html b/html/PlanSection.html index c6ff3ba..563df5e 100644 --- a/html/PlanSection.html +++ b/html/PlanSection.html @@ -161,7 +161,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/PlansController.html b/html/PlansController.html index 1efa659..6992368 100644 --- a/html/PlansController.html +++ b/html/PlansController.html @@ -193,7 +193,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -319,15 +319,15 @@
    # File app/controllers/plans_controller.rb, line 142
    -def answer
    -        @plan = Plan.find(params[:id])
    -        if user_signed_in? && @plan.readable_by(current_user.id) then
    -                respond_to do |format|
    -                        format.json { render json: @plan.answer(params[:q_id], false).to_json(:include => :options) }
    -                end
    -        else
    -                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    -        end
    +def answer
    +        @plan = Plan.find(params[:id])
    +        if user_signed_in? && @plan.readable_by(current_user.id) then
    +                respond_to do |format|
    +                        format.json { render json: @plan.answer(params[:q_id], false).to_json(:include => :options) }
    +                end
    +        else
    +                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    +        end
     end
    @@ -356,21 +356,21 @@
    # File app/controllers/plans_controller.rb, line 74
    -def delete_recent_locks
    -        @plan = Plan.find(params[:id])
    -        if user_signed_in? && @plan.editable_by(current_user.id) then
    -                respond_to do |format|
    -                        if @plan.delete_recent_locks(current_user.id)
    -                                format.html { render action: "edit" }
    -                                format.json { head :no_content }
    -                        else
    -                                format.html { render action: "edit" }
    -                                format.json { render json: @plan.errors, status: :unprocessable_entity }
    -                        end
    -                end
    -        else
    -                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    -        end
    +def delete_recent_locks
    +        @plan = Plan.find(params[:id])
    +        if user_signed_in? && @plan.editable_by(current_user.id) then
    +                respond_to do |format|
    +                        if @plan.delete_recent_locks(current_user.id)
    +                                format.html { render action: "edit" }
    +                                format.json { head :no_content }
    +                        else
    +                                format.html { render action: "edit" }
    +                                format.json { render json: @plan.errors, status: :unprocessable_entity }
    +                        end
    +                end
    +        else
    +                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    +        end
     end
    @@ -399,19 +399,19 @@
    # File app/controllers/plans_controller.rb, line 6
    -    def edit
    -            @plan = Plan.find(params[:id])
    -    
    -   
    -if !user_signed_in? then
    -  respond_to do |format|
    -                            format.html { redirect_to edit_user_registration_path }
    -                    end
    -            elsif !@plan.readable_by(current_user.id) then
    -                    respond_to do |format|
    -                            format.html { redirect_to projects_url, notice: "This account does not have access to that plan." }
    -                    end
    -            end
    +    def edit
    +            @plan = Plan.find(params[:id])
    +    
    +   
    +if !user_signed_in? then
    +  respond_to do |format|
    +                            format.html { redirect_to edit_user_registration_path }
    +                    end
    +            elsif !@plan.readable_by(current_user.id) then
    +                    respond_to do |format|
    +                            format.html { redirect_to projects_url, notice: "This account does not have access to that plan." }
    +                    end
    +            end
         end
    @@ -440,52 +440,53 @@
    # File app/controllers/plans_controller.rb, line 164
    -def export
    -        @plan = Plan.find(params[:id])
    -
    -        if user_signed_in? && @plan.readable_by(current_user.id) then
    -                @exported_plan = ExportedPlan.new.tap do |ep|
    -                        ep.plan = @plan
    -                        ep.user = current_user
    -                        ep.format = request.format.try(:symbol)
    -                        plan_settings = @plan.settings(:export)
    -
    -                        Settings::Dmptemplate::DEFAULT_SETTINGS.each do |key, value|
    -                                ep.settings(:export).send("#{key}=", plan_settings.send(key))
    -                        end
    -                end
    -
    -                @exported_plan.save! # FIXME: handle invalid request types without erroring?
    
    -                file_name = @exported_plan.project_name
    -
    -                respond_to do |format|
    -        format.html
    -        format.xml
    -        format.json
    -        format.csv  { send_data @exported_plan.as_csv, filename: "#{file_name}.csv" }
    -        format.text { send_data @exported_plan.as_txt, filename: "#{file_name}.txt" }
    -                        format.docx { headers["Content-Disposition"] = "attachment; filename=\"#{file_name}.docx\""}
    -        format.pdf do
    -            @formatting = @plan.settings(:export).formatting
    -            render pdf: file_name,
    -                                 margin: @formatting[:margin],
    -                                 footer: {
    -                                   center:    t('helpers.plan.export.pdf.generated_by'),
    -                                   font_size: 8,
    -                                   spacing:   (@formatting[:margin][:bottom] / 2) - 4,
    -                                   right:     '[page] of [topage]'
    -                                 }
    -                  end
    -                end
    -        elsif !user_signed_in? then
    -       respond_to do |format|
    -                        format.html { redirect_to edit_user_registration_path }
    -                end
    -        elsif !@plan.editable_by(current_user.id) then
    -                respond_to do |format|
    -                        format.html { redirect_to projects_url, notice: "This account does not have access to that plan." }
    -                end
    -        end
    +def export
    +        @plan = Plan.find(params[:id])
    +
    +        if user_signed_in? && @plan.readable_by(current_user.id) then
    +                @exported_plan = ExportedPlan.new.tap do |ep|
    +                        ep.plan = @plan
    +                        ep.user = current_user
    +                        ep.format = request.format.try(:symbol)
    +                        plan_settings = @plan.settings(:export)
    +
    +                        Settings::Dmptemplate::DEFAULT_SETTINGS.each do |key, value|
    +                                ep.settings(:export).send("#{key}=", plan_settings.send(key))
    +                        end
    +                end
    +
    +                @exported_plan.save! # FIXME: handle invalid request types without erroring?
    +
    +                file_name = @exported_plan.project_name
    +
    +                respond_to do |format|
    +        format.html
    +        format.xml
    +        format.json
    +        format.csv  { send_data @exported_plan.as_csv, filename: "#{file_name}.csv" }
    +        format.text { send_data @exported_plan.as_txt, filename: "#{file_name}.txt" }
    +                        format.docx { headers["Content-Disposition"] = "attachment; filename=\"#{file_name}.docx\""}
    +        format.pdf do
    +            @formatting = @plan.settings(:export).formatting
    +            render pdf: file_name,
    +                                 margin: @formatting[:margin],
    +                                 footer: {
    +                                   center:    t('helpers.plan.export.pdf.generated_by'),
    +                                   font_size: 8,
    +                                   spacing:   (@formatting[:margin][:bottom] / 2) - 4,
    +                                   right:     '[page] of [topage]'
    +                                 }
    +                  end
    +                end
    +        elsif !user_signed_in? then
    +       respond_to do |format|
    +                        format.html { redirect_to edit_user_registration_path }
    +                end
    +        elsif !@plan.editable_by(current_user.id) then
    +                respond_to do |format|
    +                        format.html { redirect_to projects_url, notice: "This account does not have access to that plan." }
    +                end
    +        end
     end
    @@ -514,21 +515,21 @@
    # File app/controllers/plans_controller.rb, line 108
    -def lock_section
    -        @plan = Plan.find(params[:id])
    -        if user_signed_in? && @plan.editable_by(current_user.id) then
    -                respond_to do |format|
    -                        if @plan.lock_section(params[:section_id], current_user.id)
    -                                format.html { render action: "edit" }
    -                                format.json { head :no_content }
    -                        else
    -                                format.html { render action: "edit" }
    -                                format.json { render json: @plan.errors, status: :unprocessable_entity }
    -                        end
    -                end
    -        else
    -                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    -        end
    +def lock_section
    +        @plan = Plan.find(params[:id])
    +        if user_signed_in? && @plan.editable_by(current_user.id) then
    +                respond_to do |format|
    +                        if @plan.lock_section(params[:section_id], current_user.id)
    +                                format.html { render action: "edit" }
    +                                format.json { head :no_content }
    +                        else
    +                                format.html { render action: "edit" }
    +                                format.json { render json: @plan.errors, status: :unprocessable_entity }
    +                        end
    +                end
    +        else
    +                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    +        end
     end
    @@ -557,15 +558,15 @@
    # File app/controllers/plans_controller.rb, line 63
    -def locked
    -        @plan = Plan.find(params[:id])
    -        if !@plan.nil? && user_signed_in? && @plan.readable_by(current_user.id) then
    -                respond_to do |format|
    -                        format.json { render json: @plan.locked(params[:section_id],current_user.id) }
    -                end
    -        else
    -                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    -        end
    +def locked
    +        @plan = Plan.find(params[:id])
    +        if !@plan.nil? && user_signed_in? && @plan.readable_by(current_user.id) then
    +                respond_to do |format|
    +                        format.json { render json: @plan.locked(params[:section_id],current_user.id) }
    +                end
    +        else
    +                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    +        end
     end
    @@ -594,15 +595,15 @@
    # File app/controllers/plans_controller.rb, line 52
    -def section_answers
    -        @plan = Plan.find(params[:id])
    -        if user_signed_in? && @plan.readable_by(current_user.id) then
    -                respond_to do |format|
    -                        format.json { render json: @plan.section_answers(params[:section_id]) }
    -                end
    -        else
    -                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    -        end
    +def section_answers
    +        @plan = Plan.find(params[:id])
    +        if user_signed_in? && @plan.readable_by(current_user.id) then
    +                respond_to do |format|
    +                        format.json { render json: @plan.section_answers(params[:section_id]) }
    +                end
    +        else
    +                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    +        end
     end
    @@ -631,15 +632,15 @@
    # File app/controllers/plans_controller.rb, line 41
    -def status
    -        @plan = Plan.find(params[:id])
    -        if user_signed_in? && @plan.readable_by(current_user.id) then
    -                respond_to do |format|
    -                        format.json { render json: @plan.status }
    -                end
    -        else
    -                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    -        end
    +def status
    +        @plan = Plan.find(params[:id])
    +        if user_signed_in? && @plan.readable_by(current_user.id) then
    +                respond_to do |format|
    +                        format.json { render json: @plan.status }
    +                end
    +        else
    +                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    +        end
     end
    @@ -668,21 +669,21 @@
    # File app/controllers/plans_controller.rb, line 91
    -def unlock_all_sections
    -        @plan = Plan.find(params[:id])
    -        if user_signed_in? && @plan.editable_by(current_user.id) then
    -                respond_to do |format|
    -                        if @plan.unlock_all_sections(current_user.id)
    -                                format.html { render action: "edit" }
    -                                format.json { head :no_content }
    -                        else
    -                                format.html { render action: "edit" }
    -                                format.json { render json: @plan.errors, status: :unprocessable_entity }
    -                        end
    -                end
    -        else
    -                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    -        end
    +def unlock_all_sections
    +        @plan = Plan.find(params[:id])
    +        if user_signed_in? && @plan.editable_by(current_user.id) then
    +                respond_to do |format|
    +                        if @plan.unlock_all_sections(current_user.id)
    +                                format.html { render action: "edit" }
    +                                format.json { head :no_content }
    +                        else
    +                                format.html { render action: "edit" }
    +                                format.json { render json: @plan.errors, status: :unprocessable_entity }
    +                        end
    +                end
    +        else
    +                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    +        end
     end
    @@ -711,21 +712,21 @@
    # File app/controllers/plans_controller.rb, line 125
    -def unlock_section
    -        @plan = Plan.find(params[:id])
    -        if user_signed_in? && @plan.editable_by(current_user.id) then
    -                respond_to do |format|
    -                        if @plan.unlock_section(params[:section_id], current_user.id)
    -                                format.html { render action: "edit" }
    -                                format.json { head :no_content }
    -                        else
    -                                format.html { render action: "edit" }
    -                                format.json { render json: @plan.errors, status: :unprocessable_entity }
    -                        end
    -                end
    -        else
    -                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    -        end
    +def unlock_section
    +        @plan = Plan.find(params[:id])
    +        if user_signed_in? && @plan.editable_by(current_user.id) then
    +                respond_to do |format|
    +                        if @plan.unlock_section(params[:section_id], current_user.id)
    +                                format.html { render action: "edit" }
    +                                format.json { head :no_content }
    +                        else
    +                                format.html { render action: "edit" }
    +                                format.json { render json: @plan.errors, status: :unprocessable_entity }
    +                        end
    +                end
    +        else
    +                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    +        end
     end
    @@ -754,21 +755,21 @@
    # File app/controllers/plans_controller.rb, line 23
    -def update
    -        @plan = Plan.find(params[:id])
    -        if user_signed_in? && @plan.editable_by(current_user.id) then
    -                respond_to do |format|
    -                if @plan.update_attributes(params[:plan])
    -                        format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }
    -                        format.json { head :no_content }
    -                else
    -                        format.html { render action: "edit" }
    -                        format.json { render json: @plan.errors, status: :unprocessable_entity }
    -                end
    -        end
    -else
    -                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    -end
    +def update
    +        @plan = Plan.find(params[:id])
    +        if user_signed_in? && @plan.editable_by(current_user.id) then
    +                respond_to do |format|
    +                if @plan.update_attributes(params[:plan])
    +                        format.html { redirect_to @plan, notice: 'Plan was successfully updated.' }
    +                        format.json { head :no_content }
    +                else
    +                        format.html { render action: "edit" }
    +                        format.json { render json: @plan.errors, status: :unprocessable_entity }
    +                end
    +        end
    +else
    +                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    +end
     end
    @@ -797,15 +798,15 @@
    # File app/controllers/plans_controller.rb, line 153
    -def warning
    -        @plan = Plan.find(params[:id])
    -        if user_signed_in? && @plan.readable_by(current_user.id) then
    -                respond_to do |format|
    -                        format.json { render json: @plan.warning(params[:option_id]) }
    -                end
    -        else
    -                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    -        end
    +def warning
    +        @plan = Plan.find(params[:id])
    +        if user_signed_in? && @plan.readable_by(current_user.id) then
    +                respond_to do |format|
    +                        format.json { render json: @plan.warning(params[:option_id]) }
    +                end
    +        else
    +                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    +        end
     end
    diff --git a/html/PlansHelper.html b/html/PlansHelper.html index bd647f7..6373cd5 100644 --- a/html/PlansHelper.html +++ b/html/PlansHelper.html @@ -169,7 +169,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Project.html b/html/Project.html index 0e46ebb..ca0dd35 100644 --- a/html/Project.html +++ b/html/Project.html @@ -223,7 +223,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/ProjectGroup.html b/html/ProjectGroup.html index 140de14..70c5421 100644 --- a/html/ProjectGroup.html +++ b/html/ProjectGroup.html @@ -177,7 +177,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/ProjectGroupsController.html b/html/ProjectGroupsController.html index b7c5415..96cea38 100644 --- a/html/ProjectGroupsController.html +++ b/html/ProjectGroupsController.html @@ -175,7 +175,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/ProjectPartner.html b/html/ProjectPartner.html index ed1b6aa..07f619b 100644 --- a/html/ProjectPartner.html +++ b/html/ProjectPartner.html @@ -161,7 +161,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/ProjectsController.html b/html/ProjectsController.html index 32ed62b..3d7254b 100644 --- a/html/ProjectsController.html +++ b/html/ProjectsController.html @@ -193,7 +193,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -319,36 +319,37 @@
    # File app/controllers/projects_controller.rb, line 113
    -def create
    -if user_signed_in? then
    -                @project = Project.new(params[:project])
    -                if @project.dmptemplate.nil? && params[:project][:funder_id] != "" then # this shouldn't be necessary - see setter for funder_id in project.rb
    
    -                        funder = Organisation.find(params[:project][:funder_id])
    -                        if funder.dmptemplates.count == 1 then
    -                                @project.dmptemplate = funder.published_templates.first
    -                        end
    -                elsif @project.dmptemplate.nil? || params[:default_tag] == 'true' then
    -                        if @project.organisation.nil?  || params[:default_tag] == 'true'  || @project.organisation.published_templates.first.nil? then
    -                                @project.dmptemplate = Dmptemplate.find_by_is_default(true)
    -                        else
    -                                @project.dmptemplate = @project.organisation.published_templates.first
    -                        end
    -                end
    -                @project.principal_investigator = current_user.name(false)
    -                @project.title = I18n.t('helpers.project.my_project_name')+' ('+@project.dmptemplate.title+')'
    -                @project.assign_creator(current_user.id)
    -                respond_to do |format|
    -                        if @project.save
    -                                format.html { redirect_to({:action => "show", :id => @project.slug, :show_form => "yes"}, {:notice => I18n.t('helpers.project.success')}) }
    -                                format.json { render json: @project, status: :created, location: @project }
    -                        else
    -                                format.html { render action: "new" }
    -                                format.json { render json: @project.errors, status: :unprocessable_entity }
    -                        end
    -                end
    -        else
    -                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    -        end
    +def create
    +if user_signed_in? then
    +                @project = Project.new(params[:project])
    +                if @project.dmptemplate.nil? && params[:project][:funder_id] != "" then # this shouldn't be necessary - see setter for funder_id in project.rb
    +
    +                        funder = Organisation.find(params[:project][:funder_id])
    +                        if funder.dmptemplates.count == 1 then
    +                                @project.dmptemplate = funder.published_templates.first
    +                        end
    +                elsif @project.dmptemplate.nil? || params[:default_tag] == 'true' then
    +                        if @project.organisation.nil?  || params[:default_tag] == 'true'  || @project.organisation.published_templates.first.nil? then
    +                                @project.dmptemplate = Dmptemplate.find_by_is_default(true)
    +                        else
    +                                @project.dmptemplate = @project.organisation.published_templates.first
    +                        end
    +                end
    +                @project.principal_investigator = current_user.name(false)
    +                @project.title = I18n.t('helpers.project.my_project_name')+' ('+@project.dmptemplate.title+')'
    +                @project.assign_creator(current_user.id)
    +                respond_to do |format|
    +                        if @project.save
    +                                format.html { redirect_to({:action => "show", :id => @project.slug, :show_form => "yes"}, {:notice => I18n.t('helpers.project.success')}) }
    +                                format.json { render json: @project, status: :created, location: @project }
    +                        else
    +                                format.html { render action: "new" }
    +                                format.json { render json: @project.errors, status: :unprocessable_entity }
    +                        end
    +                end
    +        else
    +                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    +        end
     end
    @@ -377,18 +378,18 @@
    # File app/controllers/projects_controller.rb, line 166
    -def destroy
    -        @project = Project.find(params[:id])
    -        if user_signed_in? && @project.editable_by(current_user.id) then
    -                @project.destroy
    -
    -                respond_to do |format|
    -                        format.html { redirect_to projects_url }
    -                        format.json { head :no_content }
    -                end
    -        else
    -                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    -        end
    +def destroy
    +        @project = Project.find(params[:id])
    +        if user_signed_in? && @project.editable_by(current_user.id) then
    +                @project.destroy
    +
    +                respond_to do |format|
    +                        format.html { redirect_to projects_url }
    +                        format.json { head :no_content }
    +                end
    +        else
    +                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    +        end
     end
    @@ -417,17 +418,17 @@
    # File app/controllers/projects_controller.rb, line 71
    -def edit
    -        @project = Project.find(params[:id])
    -        if !user_signed_in? then
    -       respond_to do |format|
    -                        format.html { redirect_to edit_user_registration_path }
    -                end
    -        elsif !@project.editable_by(current_user.id) then
    -                respond_to do |format|
    -                        format.html { redirect_to projects_url, notice: "This account does not have access to that plan." }
    -                end
    -        end
    +def edit
    +        @project = Project.find(params[:id])
    +        if !user_signed_in? then
    +       respond_to do |format|
    +                        format.html { redirect_to edit_user_registration_path }
    +                end
    +        elsif !@project.editable_by(current_user.id) then
    +                respond_to do |format|
    +                        format.html { redirect_to projects_url, notice: "This account does not have access to that plan." }
    +                end
    +        end
     end
    @@ -456,18 +457,18 @@
    # File app/controllers/projects_controller.rb, line 97
    -def export
    -        @project = Project.find(params[:id])
    -        if !user_signed_in? then
    -       respond_to do |format|
    -                        format.html { redirect_to edit_user_registration_path }
    -                end
    -        else 
    -                respond_to do |format|
    -                        format.html { render action: "export" }
    -        
    -                end
    -        end
    +def export
    +        @project = Project.find(params[:id])
    +        if !user_signed_in? then
    +       respond_to do |format|
    +                        format.html { redirect_to edit_user_registration_path }
    +                end
    +        else 
    +                respond_to do |format|
    +                        format.html { render action: "export" }
    +        
    +                end
    +        end
     end
    @@ -496,24 +497,26 @@
    # File app/controllers/projects_controller.rb, line 6
    -def index
    -        if user_signed_in? then
    -                if (current_user.shibboleth_id.nil? || current_user.shibboleth_id.length == 0) && !cookies[:show_shib_link].nil? && cookies[:show_shib_link] == "show_shib_link" then
    -                        flash.notice = "Would you like to #{view_context.link_to 'link your DMPonline account to your institutional credentials?', user_omniauth_shibboleth_path}".html_safe
    -                end
    -
    -                @projects = current_user.projects.filter(params[:filter])
    -                @has_projects = current_user.projects.any? # unfiltered count
    
    -
    -                respond_to do |format|
    -                        format.html # index.html.erb
    
    -                        format.json { render json: @projects }
    -                end
    -        else
    -                respond_to do |format|
    -                        format.html { redirect_to edit_user_registration_path }
    -                end
    -        end
    +def index
    +        if user_signed_in? then
    +                if (current_user.shibboleth_id.nil? || current_user.shibboleth_id.length == 0) && !cookies[:show_shib_link].nil? && cookies[:show_shib_link] == "show_shib_link" then
    +                        flash.notice = "Would you like to #{view_context.link_to 'link your DMPonline account to your institutional credentials?', user_omniauth_shibboleth_path}".html_safe
    +                end
    +
    +                @projects = current_user.projects.filter(params[:filter])
    +                @has_projects = current_user.projects.any? # unfiltered count
    +
    +
    +                respond_to do |format|
    +                        format.html # index.html.erb
    +
    +                        format.json { render json: @projects }
    +                end
    +        else
    +                respond_to do |format|
    +                        format.html { redirect_to edit_user_registration_path }
    +                end
    +        end
     end
    @@ -542,21 +545,22 @@
    # File app/controllers/projects_controller.rb, line 52
    -def new
    -        if user_signed_in? then
    -                @project = Project.new
    -                @project.organisation = current_user.organisation
    -                @funders = orgs_of_type(t('helpers.org_type.funder'), true)
    -                @institutions = orgs_of_type(t('helpers.org_type.institution'))
    -                respond_to do |format|
    -                  format.html # new.html.erb
    
    -                  format.json { render json: @project }
    -                end
    -        else
    -                respond_to do |format|
    -                        format.html { redirect_to edit_user_registration_path }
    -                end
    -        end
    +def new
    +        if user_signed_in? then
    +                @project = Project.new
    +                @project.organisation = current_user.organisation
    +                @funders = orgs_of_type(t('helpers.org_type.funder'), true)
    +                @institutions = orgs_of_type(t('helpers.org_type.institution'))
    +                respond_to do |format|
    +                  format.html # new.html.erb
    +
    +                  format.json { render json: @project }
    +                end
    +        else
    +                respond_to do |format|
    +                        format.html { redirect_to edit_user_registration_path }
    +                end
    +        end
     end
    @@ -585,60 +589,62 @@
    # File app/controllers/projects_controller.rb, line 213
    -def possible_guidance
    -        if !params[:template].nil? && params[:template] != "" && params[:template] != "undefined" then
    -                template = Dmptemplate.find(params[:template])
    -        else
    -                template = nil
    -        end
    -        if !params[:institution].nil? && params[:institution] != "" && params[:institution] != "undefined" then
    -                institution = Organisation.find(params[:institution])
    -        else
    -                institution = nil
    -        end
    -        excluded_orgs = orgs_of_type(t('helpers.org_type.funder')) + orgs_of_type(t('helpers.org_type.institution')) + Organisation.orgs_with_parent_of_type(t('helpers.org_type.institution'))
    -        guidance_groups = {}
    -        ggs = GuidanceGroup.guidance_groups_excluding(excluded_orgs) 
    -
    -        ggs.each do |gg|
    -                guidance_groups[gg.id] = gg.name
    -        end
    -
    -#subset guidance that belong to the institution
    
    -        unless institution.nil? then
    -                optional_gg = GuidanceGroup.where("optional_subset =  ? && organisation_id = ?", true, institution.id)
    -                optional_gg.each do|optional|
    -                        guidance_groups[optional.id] = optional.name
    -                end
    -                
    -                institution.children.each do |o|
    -                        o.guidance_groups.each do |gg|
    -                                include = false
    -                                gg.guidances.each do |g|
    -                                        if g.dmptemplate.nil? || g.dmptemplate_id == template.id then
    -                                                include = true
    -                                                break
    -                                        end
    -                                end
    -                                if include then
    -                                        guidance_groups[gg.id] = gg.name
    -                                end
    -                        end
    -                end
    -        end
    -
    -#If template belongs to a funder and that funder has subset guidance display then.
    
    -if !template.nil? && template.organisation.organisation_type.name == t('helpers.org_type.funder') then
    -    optional_gg = GuidanceGroup.where("optional_subset =  ? && organisation_id = ?", true, template.organisation_id)
    -                optional_gg.each do|optional|
    -                        guidance_groups[optional.id] = optional.name
    -                end
    -end
    -
    -
    -        respond_to do |format|
    -                format.json { render json: guidance_groups.to_json }
    -        end
    +def possible_guidance
    +        if !params[:template].nil? && params[:template] != "" && params[:template] != "undefined" then
    +                template = Dmptemplate.find(params[:template])
    +        else
    +                template = nil
    +        end
    +        if !params[:institution].nil? && params[:institution] != "" && params[:institution] != "undefined" then
    +                institution = Organisation.find(params[:institution])
    +        else
    +                institution = nil
    +        end
    +        excluded_orgs = orgs_of_type(t('helpers.org_type.funder')) + orgs_of_type(t('helpers.org_type.institution')) + Organisation.orgs_with_parent_of_type(t('helpers.org_type.institution'))
    +        guidance_groups = {}
    +        ggs = GuidanceGroup.guidance_groups_excluding(excluded_orgs) 
    +
    +        ggs.each do |gg|
    +                guidance_groups[gg.id] = gg.name
    +        end
    +
    +#subset guidance that belong to the institution
    +
    +        unless institution.nil? then
    +                optional_gg = GuidanceGroup.where("optional_subset =  ? && organisation_id = ?", true, institution.id)
    +                optional_gg.each do|optional|
    +                        guidance_groups[optional.id] = optional.name
    +                end
    +                
    +                institution.children.each do |o|
    +                        o.guidance_groups.each do |gg|
    +                                include = false
    +                                gg.guidances.each do |g|
    +                                        if g.dmptemplate.nil? || g.dmptemplate_id == template.id then
    +                                                include = true
    +                                                break
    +                                        end
    +                                end
    +                                if include then
    +                                        guidance_groups[gg.id] = gg.name
    +                                end
    +                        end
    +                end
    +        end
    +
    +#If template belongs to a funder and that funder has subset guidance display then.
    +
    +if !template.nil? && template.organisation.organisation_type.name == t('helpers.org_type.funder') then
    +    optional_gg = GuidanceGroup.where("optional_subset =  ? && organisation_id = ?", true, template.organisation_id)
    +                optional_gg.each do|optional|
    +                        guidance_groups[optional.id] = optional.name
    +                end
    +end
    +
    +
    +        respond_to do |format|
    +                format.json { render json: guidance_groups.to_json }
    +        end
     end
    @@ -667,36 +673,36 @@
    # File app/controllers/projects_controller.rb, line 181
    -def possible_templates
    -        if !params[:funder].nil? && params[:funder] != "" && params[:funder] != "undefined" then
    -                funder = Organisation.find(params[:funder])
    -        else
    -                funder = nil
    -        end
    -        if !params[:institution].nil? && params[:institution] != "" && params[:institution] != "undefined" then
    -                institution = Organisation.find(params[:institution])
    -        else
    -                institution = nil
    -        end
    -        templates = {}
    -        unless funder.nil? then
    -                funder.published_templates.each do |t|
    -                        templates[t.id] = t.title
    -                end
    -        end
    -        if templates.count == 0 && !institution.nil? then
    -                institution.published_templates.each do |t|
    -                        templates[t.id] = t.title
    -                end
    -                institution.children.each do |o|
    -                        o.published_templates.each do |t|
    -                                templates[t.id] = t.title
    -                        end
    -                end
    -        end
    -        respond_to do |format|
    -                format.json { render json: templates.to_json }
    -        end
    +def possible_templates
    +        if !params[:funder].nil? && params[:funder] != "" && params[:funder] != "undefined" then
    +                funder = Organisation.find(params[:funder])
    +        else
    +                funder = nil
    +        end
    +        if !params[:institution].nil? && params[:institution] != "" && params[:institution] != "undefined" then
    +                institution = Organisation.find(params[:institution])
    +        else
    +                institution = nil
    +        end
    +        templates = {}
    +        unless funder.nil? then
    +                funder.published_templates.each do |t|
    +                        templates[t.id] = t.title
    +                end
    +        end
    +        if templates.count == 0 && !institution.nil? then
    +                institution.published_templates.each do |t|
    +                        templates[t.id] = t.title
    +                end
    +                institution.children.each do |o|
    +                        o.published_templates.each do |t|
    +                                templates[t.id] = t.title
    +                        end
    +                end
    +        end
    +        respond_to do |format|
    +                format.json { render json: templates.to_json }
    +        end
     end
    @@ -725,17 +731,17 @@
    # File app/controllers/projects_controller.rb, line 84
    -def share
    -        @project = Project.find(params[:id])
    -        if !user_signed_in? then
    -       respond_to do |format|
    -                        format.html { redirect_to edit_user_registration_path }
    -                end
    -        elsif !@project.editable_by(current_user.id) then
    -                respond_to do |format|
    -                        format.html { redirect_to projects_url, notice: "This account does not have access to that plan." }
    -                end
    -        end
    +def share
    +        @project = Project.find(params[:id])
    +        if !user_signed_in? then
    +       respond_to do |format|
    +                        format.html { redirect_to edit_user_registration_path }
    +                end
    +        elsif !@project.editable_by(current_user.id) then
    +                respond_to do |format|
    +                        format.html { redirect_to projects_url, notice: "This account does not have access to that plan." }
    +                end
    +        end
     end
    @@ -764,26 +770,27 @@
    # File app/controllers/projects_controller.rb, line 28
    -def show
    -        @project = Project.find(params[:id])
    -        @show_form = false
    -        if params[:show_form] == "yes" then
    -                @show_form = true
    -        end
    -        if user_signed_in? && @project.readable_by(current_user.id) then
    -                respond_to do |format|
    -                        format.html # show.html.erb
    
    -                        format.json { render json: @project }
    -                end
    -        elsif user_signed_in? then
    -                respond_to do |format|
    -                        format.html { redirect_to projects_url, notice: "This account does not have access to that plan." }
    -                end
    -        else
    -                respond_to do |format|
    -                        format.html { redirect_to edit_user_registration_path }
    -                end
    -        end
    +def show
    +        @project = Project.find(params[:id])
    +        @show_form = false
    +        if params[:show_form] == "yes" then
    +                @show_form = true
    +        end
    +        if user_signed_in? && @project.readable_by(current_user.id) then
    +                respond_to do |format|
    +                        format.html # show.html.erb
    +
    +                        format.json { render json: @project }
    +                end
    +        elsif user_signed_in? then
    +                respond_to do |format|
    +                        format.html { redirect_to projects_url, notice: "This account does not have access to that plan." }
    +                end
    +        else
    +                respond_to do |format|
    +                        format.html { redirect_to edit_user_registration_path }
    +                end
    +        end
     end
    @@ -812,21 +819,21 @@
    # File app/controllers/projects_controller.rb, line 147
    -def update
    -        @project = Project.find(params[:id])
    -        if user_signed_in? && @project.editable_by(current_user.id) then
    -                respond_to do |format|
    -                        if @project.update_attributes(params[:project])
    -                                format.html { redirect_to @project, notice: 'Project was successfully updated.' }
    -                                format.json { head :no_content }
    -                        else
    -                                format.html { render action: "edit" }
    -                                format.json { render json: @project.errors, status: :unprocessable_entity }
    -                        end
    -                end
    -        else
    -                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    -        end
    +def update
    +        @project = Project.find(params[:id])
    +        if user_signed_in? && @project.editable_by(current_user.id) then
    +                respond_to do |format|
    +                        if @project.update_attributes(params[:project])
    +                                format.html { redirect_to @project, notice: 'Project was successfully updated.' }
    +                                format.json { head :no_content }
    +                        else
    +                                format.html { render action: "edit" }
    +                                format.json { render json: @project.errors, status: :unprocessable_entity }
    +                        end
    +                end
    +        else
    +                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    +        end
     end
    @@ -861,20 +868,20 @@
    # File app/controllers/projects_controller.rb, line 271
    -def orgs_of_type(org_type_name, published_templates = false)
    -        org_type = OrganisationType.find_by_name(org_type_name)
    -        all_such_orgs = org_type.organisations
    -        if published_templates then
    -                with_published = Array.new
    -                all_such_orgs.each do |o|
    -                        if o.published_templates.count > 0 then
    -                                with_published << o
    -                        end
    -                end
    -                return with_published.sort_by {|o| [o.sort_name, o.name] }
    -        else
    -                return all_such_orgs.sort_by {|o| [o.sort_name, o.name] }
    -        end
    +def orgs_of_type(org_type_name, published_templates = false)
    +        org_type = OrganisationType.find_by_name(org_type_name)
    +        all_such_orgs = org_type.organisations
    +        if published_templates then
    +                with_published = Array.new
    +                all_such_orgs.each do |o|
    +                        if o.published_templates.count > 0 then
    +                                with_published << o
    +                        end
    +                end
    +                return with_published.sort_by {|o| [o.sort_name, o.name] }
    +        else
    +                return all_such_orgs.sort_by {|o| [o.sort_name, o.name] }
    +        end
     end
    diff --git a/html/Question.html b/html/Question.html index c4c84ab..a45775f 100644 --- a/html/Question.html +++ b/html/Question.html @@ -177,7 +177,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -303,9 +303,9 @@
    # File app/models/question.rb, line 99
    -def get_suggested_answer(org_id)
    -        suggested_answer = suggested_answers.find_by_organisation_id(org_id)
    -        return suggested_answer
    +def get_suggested_answer(org_id)
    +        suggested_answer = suggested_answers.find_by_organisation_id(org_id)
    +        return suggested_answer
     end
    @@ -334,29 +334,31 @@
    # File app/models/question.rb, line 69
    -def guidance_for_question(question, org_admin)
    -# pulls together guidance from various sources for question
    
    -guidances = {}
    -theme_ids = question.theme_ids
    -
    -GuidanceGroup.where("organisation_id = ?", org_admin.id).each do |group|
    -    group.guidances.each do |g|
    -        g.themes.where("id IN (?)", theme_ids).each do |gg|
    -           guidances["#{group.name} guidance on #{gg.title}"] = g
    -        end
    -    end
    -end
    -
    -       # Guidance link to directly to a question
    
    -question.guidances.each do |g_by_q|
    -    g_by_q.guidance_groups.each do |group|
    -        if group.organisation == org_admin
    -            guidances["#{group.name} guidance for this question"] = g_by_q
    -        end
    -    end
    -       end
    -
    -        return guidances
    +def guidance_for_question(question, org_admin)
    +# pulls together guidance from various sources for question
    +
    +guidances = {}
    +theme_ids = question.theme_ids
    +
    +GuidanceGroup.where("organisation_id = ?", org_admin.id).each do |group|
    +    group.guidances.each do |g|
    +        g.themes.where("id IN (?)", theme_ids).each do |gg|
    +           guidances["#{group.name} guidance on #{gg.title}"] = g
    +        end
    +    end
    +end
    +
    +       # Guidance link to directly to a question
    +
    +question.guidances.each do |g_by_q|
    +    g_by_q.guidance_groups.each do |group|
    +        if group.organisation == org_admin
    +            guidances["#{group.name} guidance for this question"] = g_by_q
    +        end
    +    end
    +       end
    +
    +        return guidances
     end
    @@ -397,21 +399,21 @@
    # File app/models/question.rb, line 51
    -def question_themes?
    -        themes_label = {}
    -        i = 1
    -        themes_quest = self.themes
    -
    -        themes_quest.each do |tt|
    -                themes_label = tt.title
    -
    -                if themes_quest.count > i then
    -                        themes_label +=     ','
    -                        i +=1
    -                end
    -        end
    -
    -        return themes_label
    +def question_themes?
    +        themes_label = {}
    +        i = 1
    +        themes_quest = self.themes
    +
    +        themes_quest.each do |tt|
    +                themes_label = tt.title
    +
    +                if themes_quest.count > i then
    +                        themes_label +=     ','
    +                        i +=1
    +                end
    +        end
    +
    +        return themes_label
     end
    @@ -440,8 +442,8 @@
    # File app/models/question.rb, line 29
    -    def to_s
    -    "#{text}"
    +    def to_s
    +    "#{text}"
     end
    diff --git a/html/QuestionFormat.html b/html/QuestionFormat.html index 965e64b..7d098d1 100644 --- a/html/QuestionFormat.html +++ b/html/QuestionFormat.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/README_rdoc.html b/html/README_rdoc.html index 935fa33..1100184 100644 --- a/html/README_rdoc.html +++ b/html/README_rdoc.html @@ -137,7 +137,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/RegistrationsController.html b/html/RegistrationsController.html index 178170a..c12611d 100644 --- a/html/RegistrationsController.html +++ b/html/RegistrationsController.html @@ -177,7 +177,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -305,36 +305,36 @@
    # File app/controllers/registrations_controller.rb, line 6
    -def create
    -      if sign_up_params[:accept_terms] != "1" then
    -        redirect_to after_sign_up_error_path_for(resource), alert: 'You must accept the terms and conditions to register.'
    -      else
    -              existing_user = User.find_by_email(sign_up_params[:email])
    -              if !existing_user.nil? then
    -                      if existing_user.dmponline3 && (existing_user.password == "" || existing_user.password.nil?) && existing_user.confirmed_at.nil? then
    -                              @user = existing_user
    -                              do_update(false, true)
    -                      else
    -                          redirect_to after_sign_up_error_path_for(resource), alert: 'That email address is already registered.'
    -                      end
    -              else
    -                      build_resource(sign_up_params)
    -                      if resource.save
    -                        if resource.active_for_authentication?
    -                              set_flash_message :notice, :signed_up if is_navigational_format?
    -                              sign_up(resource_name, resource)
    -                              respond_with resource, :location => after_sign_up_path_for(resource)
    -                        else
    -                              set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_navigational_format?
    -                              expire_session_data_after_sign_in!
    -                              respond_with resource, :location => after_inactive_sign_up_path_for(resource)
    -                        end
    -                      else
    -                        clean_up_passwords resource
    -                        redirect_to after_sign_up_error_path_for(resource), alert: 'Error processing registration. Please check that you have entered a valid email address and that your chosen password is at least 8 characters long.'
    -                      end
    -              end
    -  end
    +def create
    +      if sign_up_params[:accept_terms] != "1" then
    +        redirect_to after_sign_up_error_path_for(resource), alert: 'You must accept the terms and conditions to register.'
    +      else
    +              existing_user = User.find_by_email(sign_up_params[:email])
    +              if !existing_user.nil? then
    +                      if existing_user.dmponline3 && (existing_user.password == "" || existing_user.password.nil?) && existing_user.confirmed_at.nil? then
    +                              @user = existing_user
    +                              do_update(false, true)
    +                      else
    +                          redirect_to after_sign_up_error_path_for(resource), alert: 'That email address is already registered.'
    +                      end
    +              else
    +                      build_resource(sign_up_params)
    +                      if resource.save
    +                        if resource.active_for_authentication?
    +                              set_flash_message :notice, :signed_up if is_navigational_format?
    +                              sign_up(resource_name, resource)
    +                              respond_with resource, :location => after_sign_up_path_for(resource)
    +                        else
    +                              set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_navigational_format?
    +                              expire_session_data_after_sign_in!
    +                              respond_with resource, :location => after_inactive_sign_up_path_for(resource)
    +                        end
    +                      else
    +                        clean_up_passwords resource
    +                        redirect_to after_sign_up_error_path_for(resource), alert: 'Error processing registration. Please check that you have entered a valid email address and that your chosen password is at least 8 characters long.'
    +                      end
    +              end
    +  end
     end
    @@ -363,14 +363,14 @@
    # File app/controllers/registrations_controller.rb, line 39
    -def update
    -       if user_signed_in? then
    -               @user = User.find(current_user.id)
    -
    -       do_update
    -   else
    -       render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    -   end
    +def update
    +       if user_signed_in? then
    +               @user = User.find(current_user.id)
    +
    +       do_update
    +   else
    +       render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
    +   end
      end
    @@ -405,45 +405,49 @@
    # File app/controllers/registrations_controller.rb, line 59
    -def do_update(require_password = true, confirm = false)
    -
    -        if require_password then
    -                successfully_updated = if needs_password?(@user, params)
    -    @user.update_with_password(params[:user])
    -    else
    -      # remove the virtual current_password attribute update_without_password
    
    -      # doesn't know how to ignore it
    
    -      params[:user].delete(:current_password)
    -      @user.update_without_password(params[:user])
    -    end
    -  else
    -      @user.update_attributes(:password => params[:user][:password], :password_confirmation => params[:user][:password_confirmation])
    -      successfully_updated = @user.update_without_password(params[:user])
    -  end
    -
    -  #unlink shibboleth from user's details
    
    -  if params[:unlink_flag] == 'true' then
    -    @user.update_attributes(:shibboleth_id => "")
    -  end
    -
    -  if successfully_updated
    -              if confirm then
    -                      @user.skip_confirmation!
    -                      @user.save!
    -              end
    -      set_flash_message :notice, :updated
    -      # Sign in the user bypassing validation in case his password changed
    
    -      sign_in @user, :bypass => true
    -      
    -      if params[:unlink_flag] == 'true' then
    -          redirect_to({:controller => "registrations", :action => "edit"}, {:notice => "Details successfully updated."})
    -      else
    -          redirect_to({:controller => "projects", :action => "index"}, {:notice => "Details successfully updated."})
    -      end
    -
    -  else
    -    render "edit"
    -  end
    +def do_update(require_password = true, confirm = false)
    +
    +        if require_password then
    +                successfully_updated = if needs_password?(@user, params)
    +    @user.update_with_password(params[:user])
    +    else
    +      # remove the virtual current_password attribute update_without_password
    +
    +      # doesn't know how to ignore it
    +
    +      params[:user].delete(:current_password)
    +      @user.update_without_password(params[:user])
    +    end
    +  else
    +      @user.update_attributes(:password => params[:user][:password], :password_confirmation => params[:user][:password_confirmation])
    +      successfully_updated = @user.update_without_password(params[:user])
    +  end
    +
    +  #unlink shibboleth from user's details
    +
    +  if params[:unlink_flag] == 'true' then
    +    @user.update_attributes(:shibboleth_id => "")
    +  end
    +
    +  if successfully_updated
    +              if confirm then
    +                      @user.skip_confirmation!
    +                      @user.save!
    +              end
    +      set_flash_message :notice, :updated
    +      # Sign in the user bypassing validation in case his password changed
    +
    +      sign_in @user, :bypass => true
    +      
    +      if params[:unlink_flag] == 'true' then
    +          redirect_to({:controller => "registrations", :action => "edit"}, {:notice => "Details successfully updated."})
    +      else
    +          redirect_to({:controller => "projects", :action => "index"}, {:notice => "Details successfully updated."})
    +      end
    +
    +  else
    +    render "edit"
    +  end
     end
    @@ -473,9 +477,9 @@
    # File app/controllers/registrations_controller.rb, line 54
    -def needs_password?(user, params)
    -  user.email != params[:user][:email] ||
    -    params[:user][:password].present?
    +def needs_password?(user, params)
    +  user.email != params[:user][:email] ||
    +    params[:user][:password].present?
     end
    diff --git a/html/Role.html b/html/Role.html index 47d8af5..02d87ea 100644 --- a/html/Role.html +++ b/html/Role.html @@ -161,7 +161,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Section.html b/html/Section.html index 67f7f05..2ad9bcb 100644 --- a/html/Section.html +++ b/html/Section.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/SessionsController.html b/html/SessionsController.html index 86ee90c..163a22b 100644 --- a/html/SessionsController.html +++ b/html/SessionsController.html @@ -173,7 +173,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -301,19 +301,20 @@
    # File app/controllers/sessions_controller.rb, line 4
    -def create
    -        existing_user = User.find_by_email(params[:user][:email])
    -
    -if !existing_user.nil? && existing_user.dmponline3 && (existing_user.password == "" || existing_user.password.nil?) && existing_user.confirmed_at.nil? then
    -                redirect_to :controller => :existing_users, :action => :index, :email => params[:user][:email]
    -        else
    -                #after authentication verify if session[:shibboleth] exists
    
    -    if !params[:shibboleth_data].nil? then
    -        existing_user.update_attributes(:shibboleth_id => session[:shibboleth_data][:uid])
    -    end
    -    super
    -    
    -        end
    +def create
    +        existing_user = User.find_by_email(params[:user][:email])
    +
    +if !existing_user.nil? && existing_user.dmponline3 && (existing_user.password == "" || existing_user.password.nil?) && existing_user.confirmed_at.nil? then
    +                redirect_to :controller => :existing_users, :action => :index, :email => params[:user][:email]
    +        else
    +                #after authentication verify if session[:shibboleth] exists
    +
    +    if !params[:shibboleth_data].nil? then
    +        existing_user.update_attributes(:shibboleth_id => session[:shibboleth_data][:uid])
    +    end
    +    super
    +    
    +        end
     end
    @@ -342,12 +343,12 @@
    # File app/controllers/sessions_controller.rb, line 19
    -    def destroy
    -    current_user.plan_sections.each do |lock|
    -        lock.delete
    -        
    -    end
    -    super
    +    def destroy
    +    current_user.plan_sections.each do |lock|
    +        lock.delete
    +        
    +    end
    +    super
     end
    diff --git a/html/Settings.html b/html/Settings.html index 73b839b..3cfcfa5 100644 --- a/html/Settings.html +++ b/html/Settings.html @@ -159,7 +159,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Settings/Dmptemplate.html b/html/Settings/Dmptemplate.html index 358d114..ed8991b 100644 --- a/html/Settings/Dmptemplate.html +++ b/html/Settings/Dmptemplate.html @@ -161,7 +161,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Settings/PlanList.html b/html/Settings/PlanList.html index 2b95366..d213468 100644 --- a/html/Settings/PlanList.html +++ b/html/Settings/PlanList.html @@ -161,7 +161,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Settings/PlansController.html b/html/Settings/PlansController.html index 326528c..25d458b 100644 --- a/html/Settings/PlansController.html +++ b/html/Settings/PlansController.html @@ -179,7 +179,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Settings/ProjectsController.html b/html/Settings/ProjectsController.html index 1b8498f..aa17b2f 100644 --- a/html/Settings/ProjectsController.html +++ b/html/Settings/ProjectsController.html @@ -177,7 +177,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -303,11 +303,11 @@
    # File app/controllers/settings/projects_controller.rb, line 7
    -def show
    -  respond_to do |format|
    -    format.html
    -    format.json { render json: settings_json }
    -  end
    +def show
    +  respond_to do |format|
    +    format.html
    +    format.json { render json: settings_json }
    +  end
     end
    @@ -336,17 +336,18 @@
    # File app/controllers/settings/projects_controller.rb, line 14
    -def update
    -  columns = (params[:columns] || {}).keys.map(&:intern)
    -
    -  if @settings.update_attributes(columns: columns)
    -    respond_to do |format|
    -      format.html { redirect_to(projects_path) }
    -      format.json { render json: settings_json }
    -    end
    -  else
    -    render(action: :show) # Expect #show to display errors etc
    
    -  end
    +def update
    +  columns = (params[:columns] || {}).keys.map(&:intern)
    +
    +  if @settings.update_attributes(columns: columns)
    +    respond_to do |format|
    +      format.html { redirect_to(projects_path) }
    +      format.json { render json: settings_json }
    +    end
    +  else
    +    render(action: :show) # Expect #show to display errors etc
    +
    +  end
     end
    @@ -381,11 +382,13 @@
    # File app/controllers/settings/projects_controller.rb, line 29
    -def get_settings
    -  @settings = current_user.settings(:plan_list)
    -  # :name column should always be present (displayed as a disabled checkbox)
    
    -  # so it's not necessary to include it in the list here
    
    -  @all_columns -= [:name]
    +def get_settings
    +  @settings = current_user.settings(:plan_list)
    +  # :name column should always be present (displayed as a disabled checkbox)
    +
    +  # so it's not necessary to include it in the list here
    +
    +  @all_columns -= [:name]
     end
    @@ -414,8 +417,8 @@
    # File app/controllers/settings/projects_controller.rb, line 36
    -def settings_json
    -  @settings_json ||= { selected_columns: @settings.columns, all_columns: @all_columns }.to_json
    +def settings_json
    +  @settings_json ||= { selected_columns: @settings.columns, all_columns: @all_columns }.to_json
     end
    diff --git a/html/Settings/SettingsController.html b/html/Settings/SettingsController.html index 5b699d3..6273362 100644 --- a/html/Settings/SettingsController.html +++ b/html/Settings/SettingsController.html @@ -161,7 +161,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/SplashLog.html b/html/SplashLog.html index fd75513..41ac7d7 100644 --- a/html/SplashLog.html +++ b/html/SplashLog.html @@ -161,7 +161,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/SplashLogsController.html b/html/SplashLogsController.html index 4f88d08..b00abb8 100644 --- a/html/SplashLogsController.html +++ b/html/SplashLogsController.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/StaticPagesController.html b/html/StaticPagesController.html index 72e20e2..65858ab 100644 --- a/html/StaticPagesController.html +++ b/html/StaticPagesController.html @@ -175,7 +175,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/SuggestedAnswer.html b/html/SuggestedAnswer.html index 20f6149..707f287 100644 --- a/html/SuggestedAnswer.html +++ b/html/SuggestedAnswer.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Theme.html b/html/Theme.html index 0e8ebee..5cb3a3a 100644 --- a/html/Theme.html +++ b/html/Theme.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/ThemesController.html b/html/ThemesController.html index a43b37c..425e06a 100644 --- a/html/ThemesController.html +++ b/html/ThemesController.html @@ -183,7 +183,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -309,18 +309,18 @@
    # File app/controllers/themes_controller.rb, line 42
    -def create
    -  @theme = Theme.new(params[:theme])
    -
    -  respond_to do |format|
    -    if @theme.save
    -      format.html { redirect_to @theme, notice: 'Theme was successfully created.' }
    -      format.json { render json: @theme, status: :created, location: @theme }
    -    else
    -      format.html { render action: "new" }
    -      format.json { render json: @theme.errors, status: :unprocessable_entity }
    -    end
    -  end
    +def create
    +  @theme = Theme.new(params[:theme])
    +
    +  respond_to do |format|
    +    if @theme.save
    +      format.html { redirect_to @theme, notice: 'Theme was successfully created.' }
    +      format.json { render json: @theme, status: :created, location: @theme }
    +    else
    +      format.html { render action: "new" }
    +      format.json { render json: @theme.errors, status: :unprocessable_entity }
    +    end
    +  end
     end
    @@ -349,14 +349,14 @@
    # File app/controllers/themes_controller.rb, line 74
    -def destroy
    -  @theme = Theme.find(params[:id])
    -  @theme.destroy
    -
    -  respond_to do |format|
    -    format.html { redirect_to themes_url }
    -    format.json { head :no_content }
    -  end
    +def destroy
    +  @theme = Theme.find(params[:id])
    +  @theme.destroy
    +
    +  respond_to do |format|
    +    format.html { redirect_to themes_url }
    +    format.json { head :no_content }
    +  end
     end
    @@ -385,8 +385,8 @@
    # File app/controllers/themes_controller.rb, line 36
    -def edit
    -  @theme = Theme.find(params[:id])
    +def edit
    +  @theme = Theme.find(params[:id])
     end
    @@ -415,13 +415,14 @@
    # File app/controllers/themes_controller.rb, line 4
    -def index
    -  @themes = Theme.all
    -
    -  respond_to do |format|
    -    format.html # index.html.erb
    
    -    format.json { render json: @themes }
    -  end
    +def index
    +  @themes = Theme.all
    +
    +  respond_to do |format|
    +    format.html # index.html.erb
    +
    +    format.json { render json: @themes }
    +  end
     end
    @@ -450,13 +451,14 @@
    # File app/controllers/themes_controller.rb, line 26
    -def new
    -  @theme = Theme.new
    -
    -  respond_to do |format|
    -    format.html # new.html.erb
    
    -    format.json { render json: @theme }
    -  end
    +def new
    +  @theme = Theme.new
    +
    +  respond_to do |format|
    +    format.html # new.html.erb
    +
    +    format.json { render json: @theme }
    +  end
     end
    @@ -485,13 +487,14 @@
    # File app/controllers/themes_controller.rb, line 15
    -def show
    -  @theme = Theme.find(params[:id])
    -
    -  respond_to do |format|
    -    format.html # show.html.erb
    
    -    format.json { render json: @theme }
    -  end
    +def show
    +  @theme = Theme.find(params[:id])
    +
    +  respond_to do |format|
    +    format.html # show.html.erb
    +
    +    format.json { render json: @theme }
    +  end
     end
    @@ -520,18 +523,18 @@
    # File app/controllers/themes_controller.rb, line 58
    -def update
    -  @theme = Theme.find(params[:id])
    -
    -  respond_to do |format|
    -    if @theme.update_attributes(params[:theme])
    -      format.html { redirect_to @theme, notice: 'Theme was successfully updated.' }
    -      format.json { head :no_content }
    -    else
    -      format.html { render action: "edit" }
    -      format.json { render json: @theme.errors, status: :unprocessable_entity }
    -    end
    -  end
    +def update
    +  @theme = Theme.find(params[:id])
    +
    +  respond_to do |format|
    +    if @theme.update_attributes(params[:theme])
    +      format.html { redirect_to @theme, notice: 'Theme was successfully updated.' }
    +      format.json { head :no_content }
    +    else
    +      format.html { render action: "edit" }
    +      format.json { render json: @theme.errors, status: :unprocessable_entity }
    +    end
    +  end
     end
    diff --git a/html/User.html b/html/User.html index 8e5c259..a2e0c45 100644 --- a/html/User.html +++ b/html/User.html @@ -189,7 +189,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/UserMailer.html b/html/UserMailer.html index f7a5a5e..9a51758 100644 --- a/html/UserMailer.html +++ b/html/UserMailer.html @@ -175,7 +175,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/UserOrgRole.html b/html/UserOrgRole.html index f88be25..6ec474a 100644 --- a/html/UserOrgRole.html +++ b/html/UserOrgRole.html @@ -161,7 +161,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/UserOrgRolesController.html b/html/UserOrgRolesController.html index 4bab524..6612d49 100644 --- a/html/UserOrgRolesController.html +++ b/html/UserOrgRolesController.html @@ -183,7 +183,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -309,18 +309,18 @@
    # File app/controllers/user_org_roles_controller.rb, line 42
    -def create
    -  @user_org_role = UserOrgRole.new(params[:user_org_role])
    -
    -  respond_to do |format|
    -    if @user_org_role.save
    -      format.html { redirect_to @user_org_role, notice: 'User org role was successfully created.' }
    -      format.json { render json: @user_org_role, status: :created, location: @user_org_role }
    -    else
    -      format.html { render action: "new" }
    -      format.json { render json: @user_org_role.errors, status: :unprocessable_entity }
    -    end
    -  end
    +def create
    +  @user_org_role = UserOrgRole.new(params[:user_org_role])
    +
    +  respond_to do |format|
    +    if @user_org_role.save
    +      format.html { redirect_to @user_org_role, notice: 'User org role was successfully created.' }
    +      format.json { render json: @user_org_role, status: :created, location: @user_org_role }
    +    else
    +      format.html { render action: "new" }
    +      format.json { render json: @user_org_role.errors, status: :unprocessable_entity }
    +    end
    +  end
     end
    @@ -349,14 +349,14 @@
    # File app/controllers/user_org_roles_controller.rb, line 74
    -def destroy
    -  @user_org_role = UserOrgRole.find(params[:id])
    -  @user_org_role.destroy
    -
    -  respond_to do |format|
    -    format.html { redirect_to user_org_roles_url }
    -    format.json { head :no_content }
    -  end
    +def destroy
    +  @user_org_role = UserOrgRole.find(params[:id])
    +  @user_org_role.destroy
    +
    +  respond_to do |format|
    +    format.html { redirect_to user_org_roles_url }
    +    format.json { head :no_content }
    +  end
     end
    @@ -385,8 +385,8 @@
    # File app/controllers/user_org_roles_controller.rb, line 36
    -def edit
    -  @user_org_role = UserOrgRole.find(params[:id])
    +def edit
    +  @user_org_role = UserOrgRole.find(params[:id])
     end
    @@ -415,13 +415,14 @@
    # File app/controllers/user_org_roles_controller.rb, line 4
    -def index
    -  @user_org_roles = UserOrgRole.all
    -
    -  respond_to do |format|
    -    format.html # index.html.erb
    
    -    format.json { render json: @user_org_roles }
    -  end
    +def index
    +  @user_org_roles = UserOrgRole.all
    +
    +  respond_to do |format|
    +    format.html # index.html.erb
    +
    +    format.json { render json: @user_org_roles }
    +  end
     end
    @@ -450,13 +451,14 @@
    # File app/controllers/user_org_roles_controller.rb, line 26
    -def new
    -  @user_org_role = UserOrgRole.new
    -
    -  respond_to do |format|
    -    format.html # new.html.erb
    
    -    format.json { render json: @user_org_role }
    -  end
    +def new
    +  @user_org_role = UserOrgRole.new
    +
    +  respond_to do |format|
    +    format.html # new.html.erb
    +
    +    format.json { render json: @user_org_role }
    +  end
     end
    @@ -485,13 +487,14 @@
    # File app/controllers/user_org_roles_controller.rb, line 15
    -def show
    -  @user_org_role = UserOrgRole.find(params[:id])
    -
    -  respond_to do |format|
    -    format.html # show.html.erb
    
    -    format.json { render json: @user_org_role }
    -  end
    +def show
    +  @user_org_role = UserOrgRole.find(params[:id])
    +
    +  respond_to do |format|
    +    format.html # show.html.erb
    +
    +    format.json { render json: @user_org_role }
    +  end
     end
    @@ -520,18 +523,18 @@
    # File app/controllers/user_org_roles_controller.rb, line 58
    -def update
    -  @user_org_role = UserOrgRole.find(params[:id])
    -
    -  respond_to do |format|
    -    if @user_org_role.update_attributes(params[:user_org_role])
    -      format.html { redirect_to @user_org_role, notice: 'User org role was successfully updated.' }
    -      format.json { head :no_content }
    -    else
    -      format.html { render action: "edit" }
    -      format.json { render json: @user_org_role.errors, status: :unprocessable_entity }
    -    end
    -  end
    +def update
    +  @user_org_role = UserOrgRole.find(params[:id])
    +
    +  respond_to do |format|
    +    if @user_org_role.update_attributes(params[:user_org_role])
    +      format.html { redirect_to @user_org_role, notice: 'User org role was successfully updated.' }
    +      format.json { head :no_content }
    +    else
    +      format.html { render action: "edit" }
    +      format.json { render json: @user_org_role.errors, status: :unprocessable_entity }
    +    end
    +  end
     end
    diff --git a/html/UserRoleType.html b/html/UserRoleType.html index 257e635..1808bff 100644 --- a/html/UserRoleType.html +++ b/html/UserRoleType.html @@ -161,7 +161,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/UserRoleTypesController.html b/html/UserRoleTypesController.html index c4e826f..7ee343f 100644 --- a/html/UserRoleTypesController.html +++ b/html/UserRoleTypesController.html @@ -183,7 +183,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -309,18 +309,18 @@
    # File app/controllers/user_role_types_controller.rb, line 42
    -def create
    -  @user_role_type = UserRoleType.new(params[:user_role_type])
    -
    -  respond_to do |format|
    -    if @user_role_type.save
    -      format.html { redirect_to @user_role_type, notice: 'User role type was successfully created.' }
    -      format.json { render json: @user_role_type, status: :created, location: @user_role_type }
    -    else
    -      format.html { render action: "new" }
    -      format.json { render json: @user_role_type.errors, status: :unprocessable_entity }
    -    end
    -  end
    +def create
    +  @user_role_type = UserRoleType.new(params[:user_role_type])
    +
    +  respond_to do |format|
    +    if @user_role_type.save
    +      format.html { redirect_to @user_role_type, notice: 'User role type was successfully created.' }
    +      format.json { render json: @user_role_type, status: :created, location: @user_role_type }
    +    else
    +      format.html { render action: "new" }
    +      format.json { render json: @user_role_type.errors, status: :unprocessable_entity }
    +    end
    +  end
     end
    @@ -349,14 +349,14 @@
    # File app/controllers/user_role_types_controller.rb, line 74
    -def destroy
    -  @user_role_type = UserRoleType.find(params[:id])
    -  @user_role_type.destroy
    -
    -  respond_to do |format|
    -    format.html { redirect_to user_role_types_url }
    -    format.json { head :no_content }
    -  end
    +def destroy
    +  @user_role_type = UserRoleType.find(params[:id])
    +  @user_role_type.destroy
    +
    +  respond_to do |format|
    +    format.html { redirect_to user_role_types_url }
    +    format.json { head :no_content }
    +  end
     end
    @@ -385,8 +385,8 @@
    # File app/controllers/user_role_types_controller.rb, line 36
    -def edit
    -  @user_role_type = UserRoleType.find(params[:id])
    +def edit
    +  @user_role_type = UserRoleType.find(params[:id])
     end
    @@ -415,13 +415,14 @@
    # File app/controllers/user_role_types_controller.rb, line 4
    -def index
    -  @user_role_types = UserRoleType.all
    -
    -  respond_to do |format|
    -    format.html # index.html.erb
    
    -    format.json { render json: @user_role_types }
    -  end
    +def index
    +  @user_role_types = UserRoleType.all
    +
    +  respond_to do |format|
    +    format.html # index.html.erb
    +
    +    format.json { render json: @user_role_types }
    +  end
     end
    @@ -450,13 +451,14 @@
    # File app/controllers/user_role_types_controller.rb, line 26
    -def new
    -  @user_role_type = UserRoleType.new
    -
    -  respond_to do |format|
    -    format.html # new.html.erb
    
    -    format.json { render json: @user_role_type }
    -  end
    +def new
    +  @user_role_type = UserRoleType.new
    +
    +  respond_to do |format|
    +    format.html # new.html.erb
    +
    +    format.json { render json: @user_role_type }
    +  end
     end
    @@ -485,13 +487,14 @@
    # File app/controllers/user_role_types_controller.rb, line 15
    -def show
    -  @user_role_type = UserRoleType.find(params[:id])
    -
    -  respond_to do |format|
    -    format.html # show.html.erb
    
    -    format.json { render json: @user_role_type }
    -  end
    +def show
    +  @user_role_type = UserRoleType.find(params[:id])
    +
    +  respond_to do |format|
    +    format.html # show.html.erb
    +
    +    format.json { render json: @user_role_type }
    +  end
     end
    @@ -520,18 +523,18 @@
    # File app/controllers/user_role_types_controller.rb, line 58
    -def update
    -  @user_role_type = UserRoleType.find(params[:id])
    -
    -  respond_to do |format|
    -    if @user_role_type.update_attributes(params[:user_role_type])
    -      format.html { redirect_to @user_role_type, notice: 'User role type was successfully updated.' }
    -      format.json { head :no_content }
    -    else
    -      format.html { render action: "edit" }
    -      format.json { render json: @user_role_type.errors, status: :unprocessable_entity }
    -    end
    -  end
    +def update
    +  @user_role_type = UserRoleType.find(params[:id])
    +
    +  respond_to do |format|
    +    if @user_role_type.update_attributes(params[:user_role_type])
    +      format.html { redirect_to @user_role_type, notice: 'User role type was successfully updated.' }
    +      format.json { head :no_content }
    +    else
    +      format.html { render action: "edit" }
    +      format.json { render json: @user_role_type.errors, status: :unprocessable_entity }
    +    end
    +  end
     end
    diff --git a/html/UserStatus.html b/html/UserStatus.html index f7ad248..ece7b89 100644 --- a/html/UserStatus.html +++ b/html/UserStatus.html @@ -161,7 +161,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/UserStatusesController.html b/html/UserStatusesController.html index 8156242..e74b843 100644 --- a/html/UserStatusesController.html +++ b/html/UserStatusesController.html @@ -183,7 +183,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -309,18 +309,18 @@
    # File app/controllers/user_statuses_controller.rb, line 42
    -def create
    -  @user_status = UserStatus.new(params[:user_status])
    -
    -  respond_to do |format|
    -    if @user_status.save
    -      format.html { redirect_to @user_status, notice: 'User status was successfully created.' }
    -      format.json { render json: @user_status, status: :created, location: @user_status }
    -    else
    -      format.html { render action: "new" }
    -      format.json { render json: @user_status.errors, status: :unprocessable_entity }
    -    end
    -  end
    +def create
    +  @user_status = UserStatus.new(params[:user_status])
    +
    +  respond_to do |format|
    +    if @user_status.save
    +      format.html { redirect_to @user_status, notice: 'User status was successfully created.' }
    +      format.json { render json: @user_status, status: :created, location: @user_status }
    +    else
    +      format.html { render action: "new" }
    +      format.json { render json: @user_status.errors, status: :unprocessable_entity }
    +    end
    +  end
     end
    @@ -349,14 +349,14 @@
    # File app/controllers/user_statuses_controller.rb, line 74
    -def destroy
    -  @user_status = UserStatus.find(params[:id])
    -  @user_status.destroy
    -
    -  respond_to do |format|
    -    format.html { redirect_to user_statuses_url }
    -    format.json { head :no_content }
    -  end
    +def destroy
    +  @user_status = UserStatus.find(params[:id])
    +  @user_status.destroy
    +
    +  respond_to do |format|
    +    format.html { redirect_to user_statuses_url }
    +    format.json { head :no_content }
    +  end
     end
    @@ -385,8 +385,8 @@
    # File app/controllers/user_statuses_controller.rb, line 36
    -def edit
    -  @user_status = UserStatus.find(params[:id])
    +def edit
    +  @user_status = UserStatus.find(params[:id])
     end
    @@ -415,13 +415,14 @@
    # File app/controllers/user_statuses_controller.rb, line 4
    -def index
    -  @user_statuses = UserStatus.all
    -
    -  respond_to do |format|
    -    format.html # index.html.erb
    
    -    format.json { render json: @user_statuses }
    -  end
    +def index
    +  @user_statuses = UserStatus.all
    +
    +  respond_to do |format|
    +    format.html # index.html.erb
    +
    +    format.json { render json: @user_statuses }
    +  end
     end
    @@ -450,13 +451,14 @@
    # File app/controllers/user_statuses_controller.rb, line 26
    -def new
    -  @user_status = UserStatus.new
    -
    -  respond_to do |format|
    -    format.html # new.html.erb
    
    -    format.json { render json: @user_status }
    -  end
    +def new
    +  @user_status = UserStatus.new
    +
    +  respond_to do |format|
    +    format.html # new.html.erb
    +
    +    format.json { render json: @user_status }
    +  end
     end
    @@ -485,13 +487,14 @@
    # File app/controllers/user_statuses_controller.rb, line 15
    -def show
    -  @user_status = UserStatus.find(params[:id])
    -
    -  respond_to do |format|
    -    format.html # show.html.erb
    
    -    format.json { render json: @user_status }
    -  end
    +def show
    +  @user_status = UserStatus.find(params[:id])
    +
    +  respond_to do |format|
    +    format.html # show.html.erb
    +
    +    format.json { render json: @user_status }
    +  end
     end
    @@ -520,18 +523,18 @@
    # File app/controllers/user_statuses_controller.rb, line 58
    -def update
    -  @user_status = UserStatus.find(params[:id])
    -
    -  respond_to do |format|
    -    if @user_status.update_attributes(params[:user_status])
    -      format.html { redirect_to @user_status, notice: 'User status was successfully updated.' }
    -      format.json { head :no_content }
    -    else
    -      format.html { render action: "edit" }
    -      format.json { render json: @user_status.errors, status: :unprocessable_entity }
    -    end
    -  end
    +def update
    +  @user_status = UserStatus.find(params[:id])
    +
    +  respond_to do |format|
    +    if @user_status.update_attributes(params[:user_status])
    +      format.html { redirect_to @user_status, notice: 'User status was successfully updated.' }
    +      format.json { head :no_content }
    +    else
    +      format.html { render action: "edit" }
    +      format.json { render json: @user_status.errors, status: :unprocessable_entity }
    +    end
    +  end
     end
    diff --git a/html/UserType.html b/html/UserType.html index 7056a5e..f37778b 100644 --- a/html/UserType.html +++ b/html/UserType.html @@ -161,7 +161,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/UserTypesController.html b/html/UserTypesController.html index 0b10307..7a53fd5 100644 --- a/html/UserTypesController.html +++ b/html/UserTypesController.html @@ -183,7 +183,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -309,18 +309,18 @@
    # File app/controllers/user_types_controller.rb, line 42
    -def create
    -  @user_type = UserType.new(params[:user_type])
    -
    -  respond_to do |format|
    -    if @user_type.save
    -      format.html { redirect_to @user_type, notice: 'User type was successfully created.' }
    -      format.json { render json: @user_type, status: :created, location: @user_type }
    -    else
    -      format.html { render action: "new" }
    -      format.json { render json: @user_type.errors, status: :unprocessable_entity }
    -    end
    -  end
    +def create
    +  @user_type = UserType.new(params[:user_type])
    +
    +  respond_to do |format|
    +    if @user_type.save
    +      format.html { redirect_to @user_type, notice: 'User type was successfully created.' }
    +      format.json { render json: @user_type, status: :created, location: @user_type }
    +    else
    +      format.html { render action: "new" }
    +      format.json { render json: @user_type.errors, status: :unprocessable_entity }
    +    end
    +  end
     end
    @@ -349,14 +349,14 @@
    # File app/controllers/user_types_controller.rb, line 74
    -def destroy
    -  @user_type = UserType.find(params[:id])
    -  @user_type.destroy
    -
    -  respond_to do |format|
    -    format.html { redirect_to user_types_url }
    -    format.json { head :no_content }
    -  end
    +def destroy
    +  @user_type = UserType.find(params[:id])
    +  @user_type.destroy
    +
    +  respond_to do |format|
    +    format.html { redirect_to user_types_url }
    +    format.json { head :no_content }
    +  end
     end
    @@ -385,8 +385,8 @@
    # File app/controllers/user_types_controller.rb, line 36
    -def edit
    -  @user_type = UserType.find(params[:id])
    +def edit
    +  @user_type = UserType.find(params[:id])
     end
    @@ -415,13 +415,14 @@
    # File app/controllers/user_types_controller.rb, line 4
    -def index
    -  @user_types = UserType.all
    -
    -  respond_to do |format|
    -    format.html # index.html.erb
    
    -    format.json { render json: @user_types }
    -  end
    +def index
    +  @user_types = UserType.all
    +
    +  respond_to do |format|
    +    format.html # index.html.erb
    +
    +    format.json { render json: @user_types }
    +  end
     end
    @@ -450,13 +451,14 @@
    # File app/controllers/user_types_controller.rb, line 26
    -def new
    -  @user_type = UserType.new
    -
    -  respond_to do |format|
    -    format.html # new.html.erb
    
    -    format.json { render json: @user_type }
    -  end
    +def new
    +  @user_type = UserType.new
    +
    +  respond_to do |format|
    +    format.html # new.html.erb
    +
    +    format.json { render json: @user_type }
    +  end
     end
    @@ -485,13 +487,14 @@
    # File app/controllers/user_types_controller.rb, line 15
    -def show
    -  @user_type = UserType.find(params[:id])
    -
    -  respond_to do |format|
    -    format.html # show.html.erb
    
    -    format.json { render json: @user_type }
    -  end
    +def show
    +  @user_type = UserType.find(params[:id])
    +
    +  respond_to do |format|
    +    format.html # show.html.erb
    +
    +    format.json { render json: @user_type }
    +  end
     end
    @@ -520,18 +523,18 @@
    # File app/controllers/user_types_controller.rb, line 58
    -def update
    -  @user_type = UserType.find(params[:id])
    -
    -  respond_to do |format|
    -    if @user_type.update_attributes(params[:user_type])
    -      format.html { redirect_to @user_type, notice: 'User type was successfully updated.' }
    -      format.json { head :no_content }
    -    else
    -      format.html { render action: "edit" }
    -      format.json { render json: @user_type.errors, status: :unprocessable_entity }
    -    end
    -  end
    +def update
    +  @user_type = UserType.find(params[:id])
    +
    +  respond_to do |format|
    +    if @user_type.update_attributes(params[:user_type])
    +      format.html { redirect_to @user_type, notice: 'User type was successfully updated.' }
    +      format.json { head :no_content }
    +    else
    +      format.html { render action: "edit" }
    +      format.json { render json: @user_type.errors, status: :unprocessable_entity }
    +    end
    +  end
     end
    diff --git a/html/Users.html b/html/Users.html index 2861177..f059ad1 100644 --- a/html/Users.html +++ b/html/Users.html @@ -154,7 +154,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/Users/OmniauthCallbacksController.html b/html/Users/OmniauthCallbacksController.html index edacd45..ee178a1 100644 --- a/html/Users/OmniauthCallbacksController.html +++ b/html/Users/OmniauthCallbacksController.html @@ -171,7 +171,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -297,55 +297,57 @@
    # File app/controllers/users/omniauth_callback_controller.rb, line 3
    -def shibboleth
    -  if user_signed_in? && current_user.shibboleth_id.present? && current_user.shibboleth_id.length > 0 then
    -    flash[:warning] = I18n.t('devise.failure.already_authenticated')
    -    redirect_to root_path
    -  else
    -    auth = request.env['omniauth.auth'] || {}
    -    eppn = auth['extra']['raw_info']['eppn']
    -    uid = nil
    -    if !eppn.blank? then
    -      uid = eppn
    -    elsif !auth['uid'].blank? then
    -      uid = auth['uid']
    -    elsif !auth['extra']['raw_info']['targeted-id'].blank? then
    -      uid = auth['extra']['raw_info']['targeted-id']
    -    end
    -
    -    if !uid.nil? && !uid.blank? then
    -                              s_user = User.where(shibboleth_id: uid).first
    -                              # Take out previous record if was not confirmed.
    
    -                              if !s_user.nil? && s_user.confirmed_at.nil? then
    -                                      sign_out s_user
    -                                      User.delete(s_user.id)
    -                                      s_user = nil
    -                              end
    -
    -                              # Stops Shibboleth ID being blocked if email incorrectly entered.
    
    -                              if !s_user.nil? && s_user.try(:persisted?) then
    -                                      flash[:notice] = I18n.t('devise.omniauth_callbacks.success', :kind => 'Shibboleth')
    -                                      sign_in s_user
    -                  redirect_to root_path
    -                              else
    -                                      if user_signed_in? then
    -                                              current_user.update_attribute('shibboleth_id', uid)
    -                                              user_id = current_user.id
    -                                              sign_out current_user
    -                                              session.delete(:shibboleth_data)
    -                                              s_user = User.find(user_id)
    -                                              sign_in s_user
    -                      redirect_to edit_user_registration_path
    -                                      else
    -                                              session[:shibboleth_data] = request.env['omniauth.auth']
    -                                              session[:shibboleth_data][:uid] = uid
    -                                              redirect_to new_user_registration_url(:nosplash => 'true')
    -                                      end
    -                              end
    -    else
    -      redirect_to root_path
    -    end
    -  end
    +def shibboleth
    +  if user_signed_in? && current_user.shibboleth_id.present? && current_user.shibboleth_id.length > 0 then
    +    flash[:warning] = I18n.t('devise.failure.already_authenticated')
    +    redirect_to root_path
    +  else
    +    auth = request.env['omniauth.auth'] || {}
    +    eppn = auth['extra']['raw_info']['eppn']
    +    uid = nil
    +    if !eppn.blank? then
    +      uid = eppn
    +    elsif !auth['uid'].blank? then
    +      uid = auth['uid']
    +    elsif !auth['extra']['raw_info']['targeted-id'].blank? then
    +      uid = auth['extra']['raw_info']['targeted-id']
    +    end
    +
    +    if !uid.nil? && !uid.blank? then
    +                              s_user = User.where(shibboleth_id: uid).first
    +                              # Take out previous record if was not confirmed.
    +
    +                              if !s_user.nil? && s_user.confirmed_at.nil? then
    +                                      sign_out s_user
    +                                      User.delete(s_user.id)
    +                                      s_user = nil
    +                              end
    +
    +                              # Stops Shibboleth ID being blocked if email incorrectly entered.
    +
    +                              if !s_user.nil? && s_user.try(:persisted?) then
    +                                      flash[:notice] = I18n.t('devise.omniauth_callbacks.success', :kind => 'Shibboleth')
    +                                      sign_in s_user
    +                  redirect_to root_path
    +                              else
    +                                      if user_signed_in? then
    +                                              current_user.update_attribute('shibboleth_id', uid)
    +                                              user_id = current_user.id
    +                                              sign_out current_user
    +                                              session.delete(:shibboleth_data)
    +                                              s_user = User.find(user_id)
    +                                              sign_in s_user
    +                      redirect_to edit_user_registration_path
    +                                      else
    +                                              session[:shibboleth_data] = request.env['omniauth.auth']
    +                                              session[:shibboleth_data][:uid] = uid
    +                                              redirect_to new_user_registration_url(:nosplash => 'true')
    +                                      end
    +                              end
    +    else
    +      redirect_to root_path
    +    end
    +  end
     end
    diff --git a/html/Users/OmniauthShibbolethRequestController.html b/html/Users/OmniauthShibbolethRequestController.html index c52058d..bd89987 100644 --- a/html/Users/OmniauthShibbolethRequestController.html +++ b/html/Users/OmniauthShibbolethRequestController.html @@ -173,7 +173,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -299,10 +299,12 @@
    # File app/controllers/users/omniauth_shibboleth_request_controller.rb, line 17
    -def associate
    -  # This action is protected - can only be reached if user is already logged in.
    
    -  # See before_filter
    
    -  redirect_to user_omniauth_callback_path(:shibboleth)
    +def associate
    +  # This action is protected - can only be reached if user is already logged in.
    +
    +  # See before_filter
    +
    +  redirect_to user_omniauth_callback_path(:shibboleth)
     end
    @@ -331,17 +333,17 @@
    # File app/controllers/users/omniauth_shibboleth_request_controller.rb, line 4
    -def redirect
    -      if !current_user.nil? && !current_user.organisation.nil?
    -      idp = params[:idp] || current_user.organisation.wayfless_entity
    -  else
    -      idp = params[:idp]
    -  end
    -  query_params = {target: user_omniauth_callback_path(:shibboleth)}
    -  unless idp.blank?
    -    query_params[:entityID] = idp
    -  end
    -  redirect_to "#{Rails.application.config.shibboleth_login}?#{query_params.to_query}", status: 302
    +def redirect
    +      if !current_user.nil? && !current_user.organisation.nil?
    +      idp = params[:idp] || current_user.organisation.wayfless_entity
    +  else
    +      idp = params[:idp]
    +  end
    +  query_params = {target: user_omniauth_callback_path(:shibboleth)}
    +  unless idp.blank?
    +    query_params[:entityID] = idp
    +  end
    +  redirect_to "#{Rails.application.config.shibboleth_login}?#{query_params.to_query}", status: 302
     end
    diff --git a/html/UsersController.html b/html/UsersController.html index 9205a51..6ac90b1 100644 --- a/html/UsersController.html +++ b/html/UsersController.html @@ -181,7 +181,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType @@ -307,18 +307,18 @@
    # File app/controllers/users_controller.rb, line 31
    -def create
    -  @user = User.new(params[:user])
    -
    -  respond_to do |format|
    -    if @user.save
    -      format.html { redirect_to @user, notice: 'User was successfully created.' }
    -      format.json { render json: @user, status: :created, location: @user }
    -    else
    -      format.html { render action: "new" }
    -      format.json { render json: @user.errors, status: :unprocessable_entity }
    -    end
    -  end
    +def create
    +  @user = User.new(params[:user])
    +
    +  respond_to do |format|
    +    if @user.save
    +      format.html { redirect_to @user, notice: 'User was successfully created.' }
    +      format.json { render json: @user, status: :created, location: @user }
    +    else
    +      format.html { render action: "new" }
    +      format.json { render json: @user.errors, status: :unprocessable_entity }
    +    end
    +  end
     end
    @@ -347,14 +347,14 @@
    # File app/controllers/users_controller.rb, line 66
    -def destroy
    -  @user = User.find(params[:id])
    -  @user.destroy
    -
    -  respond_to do |format|
    -    format.html { redirect_to users_url }
    -    format.json { head :no_content }
    -  end
    +def destroy
    +  @user = User.find(params[:id])
    +  @user.destroy
    +
    +  respond_to do |format|
    +    format.html { redirect_to users_url }
    +    format.json { head :no_content }
    +  end
     end
    @@ -383,8 +383,8 @@
    # File app/controllers/users_controller.rb, line 25
    -def edit
    -  @user = User.find(params[:id])
    +def edit
    +  @user = User.find(params[:id])
     end
    @@ -413,13 +413,14 @@
    # File app/controllers/users_controller.rb, line 15
    -def new
    -  @user = User.new
    -
    -  respond_to do |format|
    -    format.html # new.html.erb
    
    -    format.json { render json: @user }
    -  end
    +def new
    +  @user = User.new
    +
    +  respond_to do |format|
    +    format.html # new.html.erb
    +
    +    format.json { render json: @user }
    +  end
     end
    @@ -448,13 +449,14 @@
    # File app/controllers/users_controller.rb, line 4
    -def show
    -  @user = User.find(params[:id])
    -
    -  respond_to do |format|
    -    format.html # show.html.erb
    
    -    format.json { render json: @user }
    -  end
    +def show
    +  @user = User.find(params[:id])
    +
    +  respond_to do |format|
    +    format.html # show.html.erb
    +
    +    format.json { render json: @user }
    +  end
     end
    @@ -483,18 +485,18 @@
    # File app/controllers/users_controller.rb, line 47
    -def update
    -  @user = User.find(params[:id])
    -
    -  respond_to do |format|
    -    if @user.update_attributes(params[:user])
    -      format.html { redirect_to({:controller=> "projects", :action => "new"}, {:notice => 'Project was successfully created.'}) }
    -                              format.json { head :no_content }
    -    else
    -      format.html { render action: "edit" }
    -      format.json { render json: @user.errors, status: :unprocessable_entity }
    -    end
    -  end
    +def update
    +  @user = User.find(params[:id])
    +
    +  respond_to do |format|
    +    if @user.update_attributes(params[:user])
    +      format.html { redirect_to({:controller=> "projects", :action => "new"}, {:notice => 'Project was successfully created.'}) }
    +                              format.json { head :no_content }
    +    else
    +      format.html { render action: "edit" }
    +      format.json { render json: @user.errors, status: :unprocessable_entity }
    +    end
    +  end
     end
    diff --git a/html/Version.html b/html/Version.html index 75a633e..bfa9737 100644 --- a/html/Version.html +++ b/html/Version.html @@ -173,7 +173,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/index.html b/html/index.html index 3d7730a..d4524bb 100644 --- a/html/index.html +++ b/html/index.html @@ -137,7 +137,7 @@
  • OptionWarning -
  • Organisation +
  • Organisation
  • OrganisationType diff --git a/html/js/search_index.js b/html/js/search_index.js index c30a123..0998ea0 100644 --- a/html/js/search_index.js +++ b/html/js/search_index.js @@ -1 +1 @@ -var search_data = {"index":{"searchIndex":["ability","activeadmin","views","pages","base","answer","answerscontroller","applicationcontroller","applicationhelper","comment","commentscontroller","confirmationscontroller","contactscontroller","customfailure","dmponline4","application","dmptemplate","dmptemplatescontroller","existinguserscontroller","exportedplan","filetype","fileupload","guidance","guidancegroup","guidancegroupscontroller","guidancescontroller","homecontroller","object","option","optionwarning","organisation","organisationtype","organisationuserscontroller","organisationscontroller","passwordscontroller","phase","plan","plansection","planscontroller","planshelper","project","projectgroup","projectgroupscontroller","projectpartner","projectscontroller","question","questionformat","registrationscontroller","role","section","sessionscontroller","settings","dmptemplate","planlist","planscontroller","projectscontroller","settingscontroller","splashlog","splashlogscontroller","staticpagescontroller","suggestedanswer","theme","themescontroller","user","usermailer","userorgrole","userorgrolescontroller","userroletype","userroletypescontroller","userstatus","userstatusescontroller","usertype","usertypescontroller","users","omniauthcallbackscontroller","omniauthshibbolethrequestcontroller","userscontroller","version","about_us()","about_us()","access_level()","access_level=()","add_guidance_to_array()","add_user()","admin_addphase()","admin_cloneversion()","admin_create()","admin_create()","admin_create()","admin_createphase()","admin_createquestion()","admin_createsection()","admin_createsuggestedanswer()","admin_destroy()","admin_destroy()","admin_destroy()","admin_destroyphase()","admin_destroyquestion()","admin_destroysection()","admin_destroysuggestedanswer()","admin_destroyversion()","admin_details()","admin_edit()","admin_edit()","admin_edit()","admin_index()","admin_index()","admin_index()","admin_new()","admin_new()","admin_new()","admin_phase()","admin_previewphase()","admin_show()","admin_show()","admin_show()","admin_template()","admin_update()","admin_update()","admin_update()","admin_update()","admin_updatephase()","admin_updatequestion()","admin_updatesection()","admin_updatesuggestedanswer()","admin_updateversion()","administerable_by()","administerable_by()","after_confirmation_path_for()","after_resetting_password_path_for()","after_sign_in_error_path_for()","after_sign_in_path_for()","after_sign_up_error_path_for()","after_sign_up_path_for()","all_guidance_groups()","all_sections()","answer()","answer()","archive()","as_csv()","as_txt()","assign_administrator()","assign_creator()","assign_editor()","assign_reader()","associate()","authenticate_admin!()","build_footer()","by_organisation()","children()","contact_us()","create()","create()","create()","create()","create()","create()","create()","create()","create()","create()","create()","create()","create()","create()","create()","create_plans()","created_by()","current_organisation()","delete_recent_locks()","delete_recent_locks()","destroy()","destroy()","destroy()","destroy()","destroy()","destroy()","destroy()","destroy()","destroy()","destroy()","details()","devise_mapping()","display_name()","dmptemplate()","do_update()","edit()","edit()","edit()","edit()","edit()","edit()","edit()","edit()","edit()","editable_by()","editable_by()","email()","email=()","estimate_space_used()","export()","export()","filter()","funder()","funder()","funder_id()","funder_id=()","funder_name()","funder_name=()","funders_and_own_templates()","funders_templates()","get_guidance_group_templates?()","get_plan_list_columns()","get_settings()","get_settings()","get_suggested_answer()","global_sections()","grant_title()","guidance_for_question()","guidance_for_question()","guidance_groups_excluding()","has_customisations?()","has_published_versions?()","has_sections()","height_of_text()","in_group_belonging_to?()","index()","index()","index()","index()","index()","index()","index()","index()","index()","index()","institution()","institution_id()","institution_id=()","can_super_admin?()","can_org_admin?()","javascript()","last_edited()","latest_published_version()","latest_update()","latest_update()","latest_version()","link_to_add_object()","lock_all_sections()","lock_section()","lock_section()","locked()","locked()","name()","name()","needs_password?()","new()","new()","new()","new()","new()","new()","new()","new()","new()","org_type()","org_type()","organisation()","organisation=()","organisation_id()","organisation_id=()","orgs_of_type()","orgs_with_parent_of_type()","other_organisations()","own_institutional_templates()","owner()","parent()","permissions_change_notification()","plan()","plan_settings_indicator()","possible_guidance()","possible_templates()","principal_investigator()","project_access_removed_notification()","project_data_contact()","project_description()","project_identifier()","project_list_body()","project_list_head()","project_name()","projects_for_user()","published_templates()","question_themes?()","questions()","questions_for_section()","readable_by()","readable_by()","redirect()","redirect_url()","resource()","resource_name()","respond()","roadmap()","root()","sanitize_text()","scoped_collection()","section_answers()","section_answers()","sections()","sections()","settings()","settings_json()","settings_json()","share()","shared()","shared?()","sharing_notification()","shibboleth()","short_name()","show()","show()","show()","show()","show()","show()","show()","show()","show()","show()","status()","status()","store_location()","super_settings()","template_owner()","templates()","templates_org_type()","title()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","unit_id()","unit_id=()","unlock_all_sections()","unlock_all_sections()","unlock_section()","unlock_section()","update()","update()","update()","update()","update()","update()","update()","update()","update()","update()","update()","update()","update()","update_phases()","update_questions()","update_sections()","update_versions()","warning()","warning()","warning()","readme"],"longSearchIndex":["ability","activeadmin","activeadmin::views","activeadmin::views::pages","activeadmin::views::pages::base","answer","answerscontroller","applicationcontroller","applicationhelper","comment","commentscontroller","confirmationscontroller","contactscontroller","customfailure","dmponline4","dmponline4::application","dmptemplate","dmptemplatescontroller","existinguserscontroller","exportedplan","filetype","fileupload","guidance","guidancegroup","guidancegroupscontroller","guidancescontroller","homecontroller","object","option","optionwarning","organisation","organisationtype","organisationuserscontroller","organisationscontroller","passwordscontroller","phase","plan","plansection","planscontroller","planshelper","project","projectgroup","projectgroupscontroller","projectpartner","projectscontroller","question","questionformat","registrationscontroller","role","section","sessionscontroller","settings","settings::dmptemplate","settings::planlist","settings::planscontroller","settings::projectscontroller","settings::settingscontroller","splashlog","splashlogscontroller","staticpagescontroller","suggestedanswer","theme","themescontroller","user","usermailer","userorgrole","userorgrolescontroller","userroletype","userroletypescontroller","userstatus","userstatusescontroller","usertype","usertypescontroller","users","users::omniauthcallbackscontroller","users::omniauthshibbolethrequestcontroller","userscontroller","version","homecontroller#about_us()","staticpagescontroller#about_us()","projectgroup#access_level()","projectgroup#access_level=()","plan#add_guidance_to_array()","project#add_user()","dmptemplatescontroller#admin_addphase()","dmptemplatescontroller#admin_cloneversion()","dmptemplatescontroller#admin_create()","guidancegroupscontroller#admin_create()","guidancescontroller#admin_create()","dmptemplatescontroller#admin_createphase()","dmptemplatescontroller#admin_createquestion()","dmptemplatescontroller#admin_createsection()","dmptemplatescontroller#admin_createsuggestedanswer()","dmptemplatescontroller#admin_destroy()","guidancegroupscontroller#admin_destroy()","guidancescontroller#admin_destroy()","dmptemplatescontroller#admin_destroyphase()","dmptemplatescontroller#admin_destroyquestion()","dmptemplatescontroller#admin_destroysection()","dmptemplatescontroller#admin_destroysuggestedanswer()","dmptemplatescontroller#admin_destroyversion()","exportedplan#admin_details()","guidancegroupscontroller#admin_edit()","guidancescontroller#admin_edit()","organisationscontroller#admin_edit()","dmptemplatescontroller#admin_index()","guidancescontroller#admin_index()","organisationuserscontroller#admin_index()","dmptemplatescontroller#admin_new()","guidancegroupscontroller#admin_new()","guidancescontroller#admin_new()","dmptemplatescontroller#admin_phase()","dmptemplatescontroller#admin_previewphase()","guidancegroupscontroller#admin_show()","guidancescontroller#admin_show()","organisationscontroller#admin_show()","dmptemplatescontroller#admin_template()","dmptemplatescontroller#admin_update()","guidancegroupscontroller#admin_update()","guidancescontroller#admin_update()","organisationscontroller#admin_update()","dmptemplatescontroller#admin_updatephase()","dmptemplatescontroller#admin_updatequestion()","dmptemplatescontroller#admin_updatesection()","dmptemplatescontroller#admin_updatesuggestedanswer()","dmptemplatescontroller#admin_updateversion()","plan#administerable_by()","project#administerable_by()","confirmationscontroller#after_confirmation_path_for()","passwordscontroller#after_resetting_password_path_for()","applicationcontroller#after_sign_in_error_path_for()","applicationcontroller#after_sign_in_path_for()","applicationcontroller#after_sign_up_error_path_for()","applicationcontroller#after_sign_up_path_for()","organisation#all_guidance_groups()","organisation#all_sections()","plan#answer()","planscontroller#answer()","commentscontroller#archive()","exportedplan#as_csv()","exportedplan#as_txt()","project#assign_administrator()","project#assign_creator()","project#assign_editor()","project#assign_reader()","users::omniauthshibbolethrequestcontroller#associate()","applicationcontroller#authenticate_admin!()","activeadmin::views::pages::base#build_footer()","guidance::by_organisation()","organisationscontroller#children()","staticpagescontroller#contact_us()","answerscontroller#create()","commentscontroller#create()","contactscontroller#create()","organisationscontroller#create()","projectgroupscontroller#create()","projectscontroller#create()","registrationscontroller#create()","sessionscontroller#create()","splashlogscontroller#create()","themescontroller#create()","userorgrolescontroller#create()","userroletypescontroller#create()","userstatusescontroller#create()","usertypescontroller#create()","userscontroller#create()","project#create_plans()","project#created_by()","user#current_organisation()","plan#delete_recent_locks()","planscontroller#delete_recent_locks()","organisationscontroller#destroy()","projectgroupscontroller#destroy()","projectscontroller#destroy()","sessionscontroller#destroy()","themescontroller#destroy()","userorgrolescontroller#destroy()","userroletypescontroller#destroy()","userstatusescontroller#destroy()","usertypescontroller#destroy()","userscontroller#destroy()","plan#details()","applicationhelper#devise_mapping()","guidancegroup#display_name()","plan#dmptemplate()","registrationscontroller#do_update()","commentscontroller#edit()","planscontroller#edit()","projectscontroller#edit()","themescontroller#edit()","userorgrolescontroller#edit()","userroletypescontroller#edit()","userstatusescontroller#edit()","usertypescontroller#edit()","userscontroller#edit()","plan#editable_by()","project#editable_by()","projectgroup#email()","projectgroup#email=()","plan#estimate_space_used()","planscontroller#export()","projectscontroller#export()","user#filter()","exportedplan#funder()","project#funder()","project#funder_id()","project#funder_id=()","project#funder_name()","project#funder_name=()","dmptemplate::funders_and_own_templates()","dmptemplate::funders_templates()","guidance#get_guidance_group_templates?()","applicationcontroller#get_plan_list_columns()","settings::planscontroller#get_settings()","settings::projectscontroller#get_settings()","question#get_suggested_answer()","version#global_sections()","exportedplan#grant_title()","plan#guidance_for_question()","question#guidance_for_question()","guidancegroup::guidance_groups_excluding()","dmptemplate#has_customisations?()","dmptemplate#has_published_versions?()","phase#has_sections()","plan#height_of_text()","guidance#in_group_belonging_to?()","commentscontroller#index()","existinguserscontroller#index()","homecontroller#index()","organisationscontroller#index()","projectscontroller#index()","themescontroller#index()","userorgrolescontroller#index()","userroletypescontroller#index()","userstatusescontroller#index()","usertypescontroller#index()","exportedplan#institution()","project#institution_id()","project#institution_id=()","user#can_super_admin?()","user#can_org_admin?()","applicationhelper#javascript()","project#last_edited()","phase#latest_published_version()","plan#latest_update()","project#latest_update()","phase#latest_version()","applicationhelper#link_to_add_object()","plan#lock_all_sections()","plan#lock_section()","planscontroller#lock_section()","plan#locked()","planscontroller#locked()","project#name()","user#name()","registrationscontroller#needs_password?()","ability::new()","organisationscontroller#new()","projectscontroller#new()","themescontroller#new()","userorgrolescontroller#new()","userroletypescontroller#new()","userstatusescontroller#new()","usertypescontroller#new()","userscontroller#new()","dmptemplate#org_type()","user#org_type()","user#organisation()","user#organisation=()","user#organisation_id()","user#organisation_id=()","projectscontroller#orgs_of_type()","organisation::orgs_with_parent_of_type()","organisation::other_organisations()","dmptemplate::own_institutional_templates()","project#owner()","organisationscontroller#parent()","usermailer#permissions_change_notification()","settings::planscontroller#plan()","planshelper#plan_settings_indicator()","projectscontroller#possible_guidance()","projectscontroller#possible_templates()","exportedplan#principal_investigator()","usermailer#project_access_removed_notification()","exportedplan#project_data_contact()","exportedplan#project_description()","exportedplan#project_identifier()","planshelper#project_list_body()","planshelper#project_list_head()","exportedplan#project_name()","project::projects_for_user()","organisation#published_templates()","question#question_themes?()","exportedplan#questions()","exportedplan#questions_for_section()","plan#readable_by()","project#readable_by()","users::omniauthshibbolethrequestcontroller#redirect()","customfailure#redirect_url()","applicationhelper#resource()","applicationhelper#resource_name()","customfailure#respond()","staticpagescontroller#roadmap()","organisation#root()","exportedplan#sanitize_text()","object#scoped_collection()","plan#section_answers()","planscontroller#section_answers()","exportedplan#sections()","plan#sections()","plan#settings()","settings::planscontroller#settings_json()","settings::projectscontroller#settings_json()","projectscontroller#share()","project#shared()","project#shared?()","usermailer#sharing_notification()","users::omniauthcallbackscontroller#shibboleth()","organisation#short_name()","commentscontroller#show()","projectscontroller#show()","settings::planscontroller#show()","settings::projectscontroller#show()","themescontroller#show()","userorgrolescontroller#show()","userroletypescontroller#show()","userstatusescontroller#show()","usertypescontroller#show()","userscontroller#show()","plan#status()","planscontroller#status()","applicationcontroller#store_location()","plan#super_settings()","project#template_owner()","organisationscontroller#templates()","dmptemplate::templates_org_type()","plan#title()","comment#to_s()","dmptemplate#to_s()","guidancegroup#to_s()","option#to_s()","optionwarning#to_s()","organisation#to_s()","phase#to_s()","question#to_s()","questionformat#to_s()","section#to_s()","suggestedanswer#to_s()","theme#to_s()","version#to_s()","project#unit_id()","project#unit_id=()","plan#unlock_all_sections()","planscontroller#unlock_all_sections()","plan#unlock_section()","planscontroller#unlock_section()","commentscontroller#update()","planscontroller#update()","projectgroupscontroller#update()","projectscontroller#update()","registrationscontroller#update()","settings::planscontroller#update()","settings::projectscontroller#update()","themescontroller#update()","userorgrolescontroller#update()","userroletypescontroller#update()","userstatusescontroller#update()","usertypescontroller#update()","userscontroller#update()","guidancescontroller#update_phases()","guidancescontroller#update_questions()","guidancescontroller#update_sections()","guidancescontroller#update_versions()","organisation#warning()","plan#warning()","planscontroller#warning()",""],"info":[["Ability","","Ability.html","",""],["ActiveAdmin","","ActiveAdmin.html","",""],["ActiveAdmin::Views","","ActiveAdmin/Views.html","",""],["ActiveAdmin::Views::Pages","","ActiveAdmin/Views/Pages.html","",""],["ActiveAdmin::Views::Pages::Base","","ActiveAdmin/Views/Pages/Base.html","","

    lib/active_admin_views_pages_base.rb\n"],["Answer","","Answer.html","",""],["AnswersController","","AnswersController.html","",""],["ApplicationController","","ApplicationController.html","",""],["ApplicationHelper","","ApplicationHelper.html","",""],["Comment","","Comment.html","",""],["CommentsController","","CommentsController.html","",""],["ConfirmationsController","","ConfirmationsController.html","",""],["ContactsController","","ContactsController.html","",""],["CustomFailure","","CustomFailure.html","",""],["DMPonline4","","DMPonline4.html","",""],["DMPonline4::Application","","DMPonline4/Application.html","",""],["Dmptemplate","","Dmptemplate.html","",""],["DmptemplatesController","","DmptemplatesController.html","","

    Project: — DMPonline v4\n

    Description: — This controller is responsible for all the actions in the admin interface …\n"],["ExistingUsersController","","ExistingUsersController.html","",""],["ExportedPlan","","ExportedPlan.html","",""],["FileType","","FileType.html","",""],["FileUpload","","FileUpload.html","",""],["Guidance","","Guidance.html","","

    Project: — DMPonline v4\n

    Description: — This class keeps the information organisations enter to support users …\n"],["GuidanceGroup","","GuidanceGroup.html","",""],["GuidanceGroupsController","","GuidanceGroupsController.html","",""],["GuidancesController","","GuidancesController.html","",""],["HomeController","","HomeController.html","",""],["Object","","Object.html","",""],["Option","","Option.html","",""],["OptionWarning","","OptionWarning.html","",""],["Organisation","","Organisation.html","",""],["OrganisationType","","OrganisationType.html","",""],["OrganisationUsersController","","OrganisationUsersController.html","",""],["OrganisationsController","","OrganisationsController.html","",""],["PasswordsController","","PasswordsController.html","",""],["Phase","","Phase.html","","

    Project: — DMPonline v4\n

    Description: — This model describes informmation about the phase of a plan, it's …\n"],["Plan","","Plan.html","",""],["PlanSection","","PlanSection.html","",""],["PlansController","","PlansController.html","",""],["PlansHelper","","PlansHelper.html","",""],["Project","","Project.html","",""],["ProjectGroup","","ProjectGroup.html","",""],["ProjectGroupsController","","ProjectGroupsController.html","",""],["ProjectPartner","","ProjectPartner.html","",""],["ProjectsController","","ProjectsController.html","",""],["Question","","Question.html","",""],["QuestionFormat","","QuestionFormat.html","",""],["RegistrationsController","","RegistrationsController.html","","

    app/controllers/registrations_controller.rb\n"],["Role","","Role.html","",""],["Section","","Section.html","",""],["SessionsController","","SessionsController.html","","

    app/controllers/sessions_controller.rb\n"],["Settings","","Settings.html","",""],["Settings::Dmptemplate","","Settings/Dmptemplate.html","",""],["Settings::PlanList","","Settings/PlanList.html","",""],["Settings::PlansController","","Settings/PlansController.html","",""],["Settings::ProjectsController","","Settings/ProjectsController.html","",""],["Settings::SettingsController","","Settings/SettingsController.html","",""],["SplashLog","","SplashLog.html","",""],["SplashLogsController","","SplashLogsController.html","",""],["StaticPagesController","","StaticPagesController.html","",""],["SuggestedAnswer","","SuggestedAnswer.html","",""],["Theme","","Theme.html","",""],["ThemesController","","ThemesController.html","",""],["User","","User.html","",""],["UserMailer","","UserMailer.html","",""],["UserOrgRole","","UserOrgRole.html","",""],["UserOrgRolesController","","UserOrgRolesController.html","",""],["UserRoleType","","UserRoleType.html","",""],["UserRoleTypesController","","UserRoleTypesController.html","",""],["UserStatus","","UserStatus.html","",""],["UserStatusesController","","UserStatusesController.html","",""],["UserType","","UserType.html","",""],["UserTypesController","","UserTypesController.html","",""],["Users","","Users.html","",""],["Users::OmniauthCallbacksController","","Users/OmniauthCallbacksController.html","",""],["Users::OmniauthShibbolethRequestController","","Users/OmniauthShibbolethRequestController.html","",""],["UsersController","","UsersController.html","",""],["Version","","Version.html","",""],["about_us","HomeController","HomeController.html#method-i-about_us","()",""],["about_us","StaticPagesController","StaticPagesController.html#method-i-about_us","()",""],["access_level","ProjectGroup","ProjectGroup.html#method-i-access_level","()",""],["access_level=","ProjectGroup","ProjectGroup.html#method-i-access_level-3D","(new_access_level)",""],["add_guidance_to_array","Plan","Plan.html#method-i-add_guidance_to_array","(guidance_array, guidance_group, theme, guidance)",""],["add_user","Project","Project.html#method-i-add_user","(user_id, is_editor = false, is_administrator = false, is_creator = false)",""],["admin_addphase","DmptemplatesController","DmptemplatesController.html#method-i-admin_addphase","()","

    add a new phase to a template\n"],["admin_cloneversion","DmptemplatesController","DmptemplatesController.html#method-i-admin_cloneversion","()","

    clone a version of a template\n"],["admin_create","DmptemplatesController","DmptemplatesController.html#method-i-admin_create","()","

    POST /dmptemplates POST /dmptemplates.json\n"],["admin_create","GuidanceGroupsController","GuidanceGroupsController.html#method-i-admin_create","()","

    POST /guidance_groups POST /guidance_groups.json\n"],["admin_create","GuidancesController","GuidancesController.html#method-i-admin_create","()","

    POST /guidances POST /guidances.json\n"],["admin_createphase","DmptemplatesController","DmptemplatesController.html#method-i-admin_createphase","()","

    create a phase\n"],["admin_createquestion","DmptemplatesController","DmptemplatesController.html#method-i-admin_createquestion","()","

    create a question\n"],["admin_createsection","DmptemplatesController","DmptemplatesController.html#method-i-admin_createsection","()","

    create a section\n"],["admin_createsuggestedanswer","DmptemplatesController","DmptemplatesController.html#method-i-admin_createsuggestedanswer","()","

    SUGGESTED ANSWERS create suggested answers\n"],["admin_destroy","DmptemplatesController","DmptemplatesController.html#method-i-admin_destroy","()","

    DELETE /dmptemplates/1 DELETE /dmptemplates/1.json\n"],["admin_destroy","GuidanceGroupsController","GuidanceGroupsController.html#method-i-admin_destroy","()","

    DELETE /guidance_groups/1 DELETE /guidance_groups/1.json\n"],["admin_destroy","GuidancesController","GuidancesController.html#method-i-admin_destroy","()","

    DELETE /guidances/1 DELETE /guidances/1.json\n"],["admin_destroyphase","DmptemplatesController","DmptemplatesController.html#method-i-admin_destroyphase","()","

    delete a version, sections and questions\n"],["admin_destroyquestion","DmptemplatesController","DmptemplatesController.html#method-i-admin_destroyquestion","()","

    delete a version, sections and questions\n"],["admin_destroysection","DmptemplatesController","DmptemplatesController.html#method-i-admin_destroysection","()","

    delete a section and questions\n"],["admin_destroysuggestedanswer","DmptemplatesController","DmptemplatesController.html#method-i-admin_destroysuggestedanswer","()","

    delete a suggested answer\n"],["admin_destroyversion","DmptemplatesController","DmptemplatesController.html#method-i-admin_destroyversion","()","

    delete a version, sections and questions\n"],["admin_details","ExportedPlan","ExportedPlan.html#method-i-admin_details","()",""],["admin_edit","GuidanceGroupsController","GuidanceGroupsController.html#method-i-admin_edit","()","

    GET /guidance_groups/1/edit\n"],["admin_edit","GuidancesController","GuidancesController.html#method-i-admin_edit","()","

    GET /guidances/1/edit\n"],["admin_edit","OrganisationsController","OrganisationsController.html#method-i-admin_edit","()","

    GET /organisations/1/edit\n"],["admin_index","DmptemplatesController","DmptemplatesController.html#method-i-admin_index","()","

    GET /dmptemplates GET /dmptemplates.json\n"],["admin_index","GuidancesController","GuidancesController.html#method-i-admin_index","()","

    GET /guidances GET /guidances.json\n"],["admin_index","OrganisationUsersController","OrganisationUsersController.html#method-i-admin_index","()",""],["admin_new","DmptemplatesController","DmptemplatesController.html#method-i-admin_new","()","

    GET /dmptemplates/new GET /dmptemplates/new.json\n"],["admin_new","GuidanceGroupsController","GuidanceGroupsController.html#method-i-admin_new","()","

    GET add new guidance groups\n"],["admin_new","GuidancesController","GuidancesController.html#method-i-admin_new","()",""],["admin_phase","DmptemplatesController","DmptemplatesController.html#method-i-admin_phase","()","

    show and edit a phase of the template\n"],["admin_previewphase","DmptemplatesController","DmptemplatesController.html#method-i-admin_previewphase","()","

    preview a phase\n"],["admin_show","GuidanceGroupsController","GuidanceGroupsController.html#method-i-admin_show","()","

    GET /guidance_groups/1 GET /guidance_groups/1.json\n"],["admin_show","GuidancesController","GuidancesController.html#method-i-admin_show","()","

    GET /guidances/1 GET /guidances/1.json\n"],["admin_show","OrganisationsController","OrganisationsController.html#method-i-admin_show","()","

    GET /organisations/1 GET /organisations/1.json\n"],["admin_template","DmptemplatesController","DmptemplatesController.html#method-i-admin_template","()","

    GET /dmptemplates/1 GET /dmptemplates/1.json\n"],["admin_update","DmptemplatesController","DmptemplatesController.html#method-i-admin_update","()","

    PUT /dmptemplates/1 PUT /dmptemplates/1.json\n"],["admin_update","GuidanceGroupsController","GuidanceGroupsController.html#method-i-admin_update","()","

    PUT /guidance_groups/1 PUT /guidance_groups/1.json\n"],["admin_update","GuidancesController","GuidancesController.html#method-i-admin_update","()","

    PUT /guidances/1 PUT /guidances/1.json\n"],["admin_update","OrganisationsController","OrganisationsController.html#method-i-admin_update","()","

    PUT /organisations/1 PUT /organisations/1.json\n"],["admin_updatephase","DmptemplatesController","DmptemplatesController.html#method-i-admin_updatephase","()","

    update a phase of a template\n"],["admin_updatequestion","DmptemplatesController","DmptemplatesController.html#method-i-admin_updatequestion","()","

    update a question of a template\n"],["admin_updatesection","DmptemplatesController","DmptemplatesController.html#method-i-admin_updatesection","()","

    update a section of a template\n"],["admin_updatesuggestedanswer","DmptemplatesController","DmptemplatesController.html#method-i-admin_updatesuggestedanswer","()","

    update a suggested answer of a template\n"],["admin_updateversion","DmptemplatesController","DmptemplatesController.html#method-i-admin_updateversion","()","

    update a version of a template\n"],["administerable_by","Plan","Plan.html#method-i-administerable_by","(user_id)",""],["administerable_by","Project","Project.html#method-i-administerable_by","(user_id)",""],["after_confirmation_path_for","ConfirmationsController","ConfirmationsController.html#method-i-after_confirmation_path_for","(resource_name, resource)",""],["after_resetting_password_path_for","PasswordsController","PasswordsController.html#method-i-after_resetting_password_path_for","(resource)",""],["after_sign_in_error_path_for","ApplicationController","ApplicationController.html#method-i-after_sign_in_error_path_for","(resource)",""],["after_sign_in_path_for","ApplicationController","ApplicationController.html#method-i-after_sign_in_path_for","(resource)",""],["after_sign_up_error_path_for","ApplicationController","ApplicationController.html#method-i-after_sign_up_error_path_for","(resource)",""],["after_sign_up_path_for","ApplicationController","ApplicationController.html#method-i-after_sign_up_path_for","(resource)",""],["all_guidance_groups","Organisation","Organisation.html#method-i-all_guidance_groups","()",""],["all_sections","Organisation","Organisation.html#method-i-all_sections","(version_id)",""],["answer","Plan","Plan.html#method-i-answer","(qid, create_if_missing = true)",""],["answer","PlansController","PlansController.html#method-i-answer","()",""],["archive","CommentsController","CommentsController.html#method-i-archive","()","

    ARCHIVE /comments/1 ARCHIVE /comments/1.json\n"],["as_csv","ExportedPlan","ExportedPlan.html#method-i-as_csv","()","

    Export formats\n"],["as_txt","ExportedPlan","ExportedPlan.html#method-i-as_txt","()",""],["assign_administrator","Project","Project.html#method-i-assign_administrator","(user_id)",""],["assign_creator","Project","Project.html#method-i-assign_creator","(user_id)",""],["assign_editor","Project","Project.html#method-i-assign_editor","(user_id)",""],["assign_reader","Project","Project.html#method-i-assign_reader","(user_id)",""],["associate","Users::OmniauthShibbolethRequestController","Users/OmniauthShibbolethRequestController.html#method-i-associate","()",""],["authenticate_admin!","ApplicationController","ApplicationController.html#method-i-authenticate_admin-21","()",""],["build_footer","ActiveAdmin::Views::Pages::Base","ActiveAdmin/Views/Pages/Base.html#method-i-build_footer","()","

    Renders the content for the footer\n"],["by_organisation","Guidance","Guidance.html#method-c-by_organisation","(org_id)","

    all guidance that belong to an organisation\n"],["children","OrganisationsController","OrganisationsController.html#method-i-children","()",""],["contact_us","StaticPagesController","StaticPagesController.html#method-i-contact_us","()",""],["create","AnswersController","AnswersController.html#method-i-create","()","

    POST /answers POST /answers.json\n"],["create","CommentsController","CommentsController.html#method-i-create","()","

    POST /comments POST /comments.json\n"],["create","ContactsController","ContactsController.html#method-i-create","()",""],["create","OrganisationsController","OrganisationsController.html#method-i-create","()","

    POST /organisations POST /organisations.json\n"],["create","ProjectGroupsController","ProjectGroupsController.html#method-i-create","()",""],["create","ProjectsController","ProjectsController.html#method-i-create","()","

    POST /projects POST /projects.json\n"],["create","RegistrationsController","RegistrationsController.html#method-i-create","()","

    POST /resource\n"],["create","SessionsController","SessionsController.html#method-i-create","()",""],["create","SplashLogsController","SplashLogsController.html#method-i-create","()","

    POST /answers POST /answers.json\n"],["create","ThemesController","ThemesController.html#method-i-create","()","

    POST /themes POST /themes.json\n"],["create","UserOrgRolesController","UserOrgRolesController.html#method-i-create","()","

    POST /user_org_roles POST /user_org_roles.json\n"],["create","UserRoleTypesController","UserRoleTypesController.html#method-i-create","()","

    POST /user_role_types POST /user_role_types.json\n"],["create","UserStatusesController","UserStatusesController.html#method-i-create","()","

    POST /user_statuses POST /user_statuses.json\n"],["create","UserTypesController","UserTypesController.html#method-i-create","()","

    POST /user_types POST /user_types.json\n"],["create","UsersController","UsersController.html#method-i-create","()","

    POST /users POST /users.json\n"],["create_plans","Project","Project.html#method-i-create_plans","()",""],["created_by","Project","Project.html#method-i-created_by","(user_id)",""],["current_organisation","User","User.html#method-i-current_organisation","()",""],["delete_recent_locks","Plan","Plan.html#method-i-delete_recent_locks","(user_id)",""],["delete_recent_locks","PlansController","PlansController.html#method-i-delete_recent_locks","()",""],["destroy","OrganisationsController","OrganisationsController.html#method-i-destroy","()","

    DELETE /organisations/1 DELETE /organisations/1.json\n"],["destroy","ProjectGroupsController","ProjectGroupsController.html#method-i-destroy","()",""],["destroy","ProjectsController","ProjectsController.html#method-i-destroy","()","

    DELETE /projects/1 DELETE /projects/1.json\n"],["destroy","SessionsController","SessionsController.html#method-i-destroy","()",""],["destroy","ThemesController","ThemesController.html#method-i-destroy","()","

    DELETE /themes/1 DELETE /themes/1.json\n"],["destroy","UserOrgRolesController","UserOrgRolesController.html#method-i-destroy","()","

    DELETE /user_org_roles/1 DELETE /user_org_roles/1.json\n"],["destroy","UserRoleTypesController","UserRoleTypesController.html#method-i-destroy","()","

    DELETE /user_role_types/1 DELETE /user_role_types/1.json\n"],["destroy","UserStatusesController","UserStatusesController.html#method-i-destroy","()","

    DELETE /user_statuses/1 DELETE /user_statuses/1.json\n"],["destroy","UserTypesController","UserTypesController.html#method-i-destroy","()","

    DELETE /user_types/1 DELETE /user_types/1.json\n"],["destroy","UsersController","UsersController.html#method-i-destroy","()","

    DELETE /users/1 DELETE /users/1.json\n"],["details","Plan","Plan.html#method-i-details","()",""],["devise_mapping","ApplicationHelper","ApplicationHelper.html#method-i-devise_mapping","()",""],["display_name","GuidanceGroup","GuidanceGroup.html#method-i-display_name","()",""],["dmptemplate","Plan","Plan.html#method-i-dmptemplate","()",""],["do_update","RegistrationsController","RegistrationsController.html#method-i-do_update","(require_password = true, confirm = false)",""],["edit","CommentsController","CommentsController.html#method-i-edit","()","

    GET /comments/1/edit\n"],["edit","PlansController","PlansController.html#method-i-edit","()","

    GET /plans/1/edit\n"],["edit","ProjectsController","ProjectsController.html#method-i-edit","()","

    GET /projects/1/edit Should this be removed?\n"],["edit","ThemesController","ThemesController.html#method-i-edit","()","

    GET /themes/1/edit\n"],["edit","UserOrgRolesController","UserOrgRolesController.html#method-i-edit","()","

    GET /user_org_roles/1/edit\n"],["edit","UserRoleTypesController","UserRoleTypesController.html#method-i-edit","()","

    GET /user_role_types/1/edit\n"],["edit","UserStatusesController","UserStatusesController.html#method-i-edit","()","

    GET /user_statuses/1/edit\n"],["edit","UserTypesController","UserTypesController.html#method-i-edit","()","

    GET /user_types/1/edit\n"],["edit","UsersController","UsersController.html#method-i-edit","()","

    GET /users/1/edit\n"],["editable_by","Plan","Plan.html#method-i-editable_by","(user_id)",""],["editable_by","Project","Project.html#method-i-editable_by","(user_id)",""],["email","ProjectGroup","ProjectGroup.html#method-i-email","()",""],["email=","ProjectGroup","ProjectGroup.html#method-i-email-3D","(new_email)",""],["estimate_space_used","Plan","Plan.html#method-i-estimate_space_used","(used_height)","

    Based on the height of the text gathered so far and the available vertical\nspace of the pdf, estimate …\n"],["export","PlansController","PlansController.html#method-i-export","()",""],["export","ProjectsController","ProjectsController.html#method-i-export","()",""],["filter","User","User.html#method-i-filter","(query)",""],["funder","ExportedPlan","ExportedPlan.html#method-i-funder","()",""],["funder","Project","Project.html#method-i-funder","()",""],["funder_id","Project","Project.html#method-i-funder_id","()",""],["funder_id=","Project","Project.html#method-i-funder_id-3D","(new_funder_id)",""],["funder_name","Project","Project.html#method-i-funder_name","()",""],["funder_name=","Project","Project.html#method-i-funder_name-3D","(new_funder_name)",""],["funders_and_own_templates","Dmptemplate","Dmptemplate.html#method-c-funders_and_own_templates","(org_id)","

    returns an array with all funders and own institutional templates\n"],["funders_templates","Dmptemplate","Dmptemplate.html#method-c-funders_templates","()","

    returns all funders templates\n"],["get_guidance_group_templates?","Guidance","Guidance.html#method-i-get_guidance_group_templates-3F","(guidance_group)",""],["get_plan_list_columns","ApplicationController","ApplicationController.html#method-i-get_plan_list_columns","()",""],["get_settings","Settings::PlansController","Settings/PlansController.html#method-i-get_settings","()",""],["get_settings","Settings::ProjectsController","Settings/ProjectsController.html#method-i-get_settings","()",""],["get_suggested_answer","Question","Question.html#method-i-get_suggested_answer","(org_id)","

    get suggested answer belonging to the currents user for this question\n"],["global_sections","Version","Version.html#method-i-global_sections","()",""],["grant_title","ExportedPlan","ExportedPlan.html#method-i-grant_title","()",""],["guidance_for_question","Plan","Plan.html#method-i-guidance_for_question","(question)",""],["guidance_for_question","Question","Question.html#method-i-guidance_for_question","(question, org_admin)","

    guidance for question in the org admin\n"],["guidance_groups_excluding","GuidanceGroup","GuidanceGroup.html#method-c-guidance_groups_excluding","(excluded_orgs)",""],["has_customisations?","Dmptemplate","Dmptemplate.html#method-i-has_customisations-3F","(org_id, temp)","

    verify if a template has customisation by current user's org\n"],["has_published_versions?","Dmptemplate","Dmptemplate.html#method-i-has_published_versions-3F","()","

    verify if there are any publish version for the template\n"],["has_sections","Phase","Phase.html#method-i-has_sections","()","

    verify if a phase has a published version or a version with one or more\nsections\n"],["height_of_text","Plan","Plan.html#method-i-height_of_text","(text, font_size_inc = 0, vertical_margin = 0)","

    Take a guess at the vertical height (in mm) of the given text based on the\nfont-size and left/right margins …\n"],["in_group_belonging_to?","Guidance","Guidance.html#method-i-in_group_belonging_to-3F","(organisation_id)","

    verifies if one guidance belongs to a org\n"],["index","CommentsController","CommentsController.html#method-i-index","()","

    GET /comments GET /comments.json\n"],["index","ExistingUsersController","ExistingUsersController.html#method-i-index","()",""],["index","HomeController","HomeController.html#method-i-index","()",""],["index","OrganisationsController","OrganisationsController.html#method-i-index","()","

    GET /organisations GET /organisations.json\n"],["index","ProjectsController","ProjectsController.html#method-i-index","()","

    GET /projects GET /projects.json\n"],["index","ThemesController","ThemesController.html#method-i-index","()","

    GET /themes GET /themes.json\n"],["index","UserOrgRolesController","UserOrgRolesController.html#method-i-index","()","

    GET /user_org_roles GET /user_org_roles.json\n"],["index","UserRoleTypesController","UserRoleTypesController.html#method-i-index","()","

    GET /user_role_types GET /user_role_types.json\n"],["index","UserStatusesController","UserStatusesController.html#method-i-index","()","

    GET /user_statuses GET /user_statuses.json\n"],["index","UserTypesController","UserTypesController.html#method-i-index","()","

    GET /user_types GET /user_types.json\n"],["institution","ExportedPlan","ExportedPlan.html#method-i-institution","()",""],["institution_id","Project","Project.html#method-i-institution_id","()",""],["institution_id=","Project","Project.html#method-i-institution_id-3D","(new_institution_id)",""],["can_super_admin?","User","User.html#method-i-is_admin-3F","()",""],["can_org_admin?","User","User.html#method-i-is_org_admin-3F","()",""],["javascript","ApplicationHelper","ApplicationHelper.html#method-i-javascript","(*files)",""],["last_edited","Project","Project.html#method-i-last_edited","()",""],["latest_published_version","Phase","Phase.html#method-i-latest_published_version","()","

    Verify if this phase has any published versions\n"],["latest_update","Plan","Plan.html#method-i-latest_update","()",""],["latest_update","Project","Project.html#method-i-latest_update","()",""],["latest_version","Phase","Phase.html#method-i-latest_version","()",""],["link_to_add_object","ApplicationHelper","ApplicationHelper.html#method-i-link_to_add_object","(name, f, association, css_class, i)",""],["lock_all_sections","Plan","Plan.html#method-i-lock_all_sections","(user_id)",""],["lock_section","Plan","Plan.html#method-i-lock_section","(section_id, user_id, release_time = 60)",""],["lock_section","PlansController","PlansController.html#method-i-lock_section","()",""],["locked","Plan","Plan.html#method-i-locked","(section_id, user_id)",""],["locked","PlansController","PlansController.html#method-i-locked","()",""],["name","Project","Project.html#method-i-name","()","

    Getters to match 'My plans' columns\n"],["name","User","User.html#method-i-name","(use_email = true)",""],["needs_password?","RegistrationsController","RegistrationsController.html#method-i-needs_password-3F","(user, params)","

    check if we need password to update user data ie if password or email was\nchanged extend this as needed …\n"],["new","Ability","Ability.html#method-c-new","(user)",""],["new","OrganisationsController","OrganisationsController.html#method-i-new","()","

    GET /organisations/new GET /organisations/new.json\n"],["new","ProjectsController","ProjectsController.html#method-i-new","()","

    GET /projects/new GET /projects/new.json\n"],["new","ThemesController","ThemesController.html#method-i-new","()","

    GET /themes/new GET /themes/new.json\n"],["new","UserOrgRolesController","UserOrgRolesController.html#method-i-new","()","

    GET /user_org_roles/new GET /user_org_roles/new.json\n"],["new","UserRoleTypesController","UserRoleTypesController.html#method-i-new","()","

    GET /user_role_types/new GET /user_role_types/new.json\n"],["new","UserStatusesController","UserStatusesController.html#method-i-new","()","

    GET /user_statuses/new GET /user_statuses/new.json\n"],["new","UserTypesController","UserTypesController.html#method-i-new","()","

    GET /user_types/new GET /user_types/new.json\n"],["new","UsersController","UsersController.html#method-i-new","()","

    GET /users/new GET /users/new.json\n"],["org_type","Dmptemplate","Dmptemplate.html#method-i-org_type","()",""],["org_type","User","User.html#method-i-org_type","()",""],["organisation","User","User.html#method-i-organisation","()",""],["organisation=","User","User.html#method-i-organisation-3D","(new_organisation)",""],["organisation_id","User","User.html#method-i-organisation_id","()",""],["organisation_id=","User","User.html#method-i-organisation_id-3D","(new_organisation_id)",""],["orgs_of_type","ProjectsController","ProjectsController.html#method-i-orgs_of_type","(org_type_name, published_templates = false)",""],["orgs_with_parent_of_type","Organisation","Organisation.html#method-c-orgs_with_parent_of_type","(org_type)","

    retrieves info off a child org\n"],["other_organisations","Organisation","Organisation.html#method-c-other_organisations","()",""],["own_institutional_templates","Dmptemplate","Dmptemplate.html#method-c-own_institutional_templates","(org_id)","

    returns all institutional templates bellowing to the current user's org\n"],["owner","Project","Project.html#method-i-owner","()",""],["parent","OrganisationsController","OrganisationsController.html#method-i-parent","()",""],["permissions_change_notification","UserMailer","UserMailer.html#method-i-permissions_change_notification","(project_group)",""],["plan","Settings::PlansController","Settings/PlansController.html#method-i-plan","()",""],["plan_settings_indicator","PlansHelper","PlansHelper.html#method-i-plan_settings_indicator","(plan)","

    Shows whether the user has default, template-default or custom settings for\nthe given plan.\n"],["possible_guidance","ProjectsController","ProjectsController.html#method-i-possible_guidance","()",""],["possible_templates","ProjectsController","ProjectsController.html#method-i-possible_templates","()","

    GET /projects/possible_templates.json\n"],["principal_investigator","ExportedPlan","ExportedPlan.html#method-i-principal_investigator","()",""],["project_access_removed_notification","UserMailer","UserMailer.html#method-i-project_access_removed_notification","(user, project)",""],["project_data_contact","ExportedPlan","ExportedPlan.html#method-i-project_data_contact","()",""],["project_description","ExportedPlan","ExportedPlan.html#method-i-project_description","()",""],["project_identifier","ExportedPlan","ExportedPlan.html#method-i-project_identifier","()",""],["project_list_body","PlansHelper","PlansHelper.html#method-i-project_list_body","(column, project)",""],["project_list_head","PlansHelper","PlansHelper.html#method-i-project_list_head","(column)",""],["project_name","ExportedPlan","ExportedPlan.html#method-i-project_name","()","

    Getters to match Settings::Dmptemplate::VALID_ADMIN_FIELDS\n"],["projects_for_user","Project","Project.html#method-c-projects_for_user","(user_id)",""],["published_templates","Organisation","Organisation.html#method-i-published_templates","()",""],["question_themes?","Question","Question.html#method-i-question_themes-3F","()","

    def question_type?\n\n

    type_label = {}\nif self.is_text_field?\n  type_label = 'Text field'\nelsif self.multiple_choice? ...
    \n"],["questions","ExportedPlan","ExportedPlan.html#method-i-questions","()",""],["questions_for_section","ExportedPlan","ExportedPlan.html#method-i-questions_for_section","(section_id)",""],["readable_by","Plan","Plan.html#method-i-readable_by","(user_id)",""],["readable_by","Project","Project.html#method-i-readable_by","(user_id)",""],["redirect","Users::OmniauthShibbolethRequestController","Users/OmniauthShibbolethRequestController.html#method-i-redirect","()",""],["redirect_url","CustomFailure","CustomFailure.html#method-i-redirect_url","()",""],["resource","ApplicationHelper","ApplicationHelper.html#method-i-resource","()",""],["resource_name","ApplicationHelper","ApplicationHelper.html#method-i-resource_name","()",""],["respond","CustomFailure","CustomFailure.html#method-i-respond","()",""],["roadmap","StaticPagesController","StaticPagesController.html#method-i-roadmap","()",""],["root","Organisation","Organisation.html#method-i-root","()",""],["sanitize_text","ExportedPlan","ExportedPlan.html#method-i-sanitize_text","(text)",""],["scoped_collection","Object","Object.html#method-i-scoped_collection","()",""],["section_answers","Plan","Plan.html#method-i-section_answers","(section_id)",""],["section_answers","PlansController","PlansController.html#method-i-section_answers","()",""],["sections","ExportedPlan","ExportedPlan.html#method-i-sections","()","

    sections taken from fields settings\n"],["sections","Plan","Plan.html#method-i-sections","()",""],["settings","Plan","Plan.html#method-i-settings","(key)","

    Proxy through to the template settings (or defaults if this plan\ndoesn't have an associated template) …\n"],["settings_json","Settings::PlansController","Settings/PlansController.html#method-i-settings_json","()",""],["settings_json","Settings::ProjectsController","Settings/ProjectsController.html#method-i-settings_json","()",""],["share","ProjectsController","ProjectsController.html#method-i-share","()",""],["shared","Project","Project.html#method-i-shared","()",""],["shared?","Project","Project.html#method-i-shared-3F","()",""],["sharing_notification","UserMailer","UserMailer.html#method-i-sharing_notification","(project_group)",""],["shibboleth","Users::OmniauthCallbacksController","Users/OmniauthCallbacksController.html#method-i-shibboleth","()",""],["short_name","Organisation","Organisation.html#method-i-short_name","()",""],["show","CommentsController","CommentsController.html#method-i-show","()","

    GET /comments/1 GET /comments/1.json\n"],["show","ProjectsController","ProjectsController.html#method-i-show","()","

    GET /projects/1 GET /projects/1.json\n"],["show","Settings::PlansController","Settings/PlansController.html#method-i-show","()",""],["show","Settings::ProjectsController","Settings/ProjectsController.html#method-i-show","()",""],["show","ThemesController","ThemesController.html#method-i-show","()","

    GET /themes/1 GET /themes/1.json\n"],["show","UserOrgRolesController","UserOrgRolesController.html#method-i-show","()","

    GET /user_org_roles/1 GET /user_org_roles/1.json\n"],["show","UserRoleTypesController","UserRoleTypesController.html#method-i-show","()","

    GET /user_role_types/1 GET /user_role_types/1.json\n"],["show","UserStatusesController","UserStatusesController.html#method-i-show","()","

    GET /user_statuses/1 GET /user_statuses/1.json\n"],["show","UserTypesController","UserTypesController.html#method-i-show","()","

    GET /user_types/1 GET /user_types/1.json\n"],["show","UsersController","UsersController.html#method-i-show","()","

    GET /users/1 GET /users/1.json\n"],["status","Plan","Plan.html#method-i-status","()",""],["status","PlansController","PlansController.html#method-i-status","()","

    GET /status/1.json\n"],["store_location","ApplicationController","ApplicationController.html#method-i-store_location","()",""],["super_settings","Plan","Plan.html#method-i-super_settings","(key)",""],["template_owner","Project","Project.html#method-i-template_owner","()",""],["templates","OrganisationsController","OrganisationsController.html#method-i-templates","()",""],["templates_org_type","Dmptemplate","Dmptemplate.html#method-c-templates_org_type","(ot)",""],["title","Plan","Plan.html#method-i-title","()",""],["to_s","Comment","Comment.html#method-i-to_s","()",""],["to_s","Dmptemplate","Dmptemplate.html#method-i-to_s","()",""],["to_s","GuidanceGroup","GuidanceGroup.html#method-i-to_s","()",""],["to_s","Option","Option.html#method-i-to_s","()",""],["to_s","OptionWarning","OptionWarning.html#method-i-to_s","()",""],["to_s","Organisation","Organisation.html#method-i-to_s","()",""],["to_s","Phase","Phase.html#method-i-to_s","()",""],["to_s","Question","Question.html#method-i-to_s","()",""],["to_s","QuestionFormat","QuestionFormat.html#method-i-to_s","()",""],["to_s","Section","Section.html#method-i-to_s","()",""],["to_s","SuggestedAnswer","SuggestedAnswer.html#method-i-to_s","()",""],["to_s","Theme","Theme.html#method-i-to_s","()",""],["to_s","Version","Version.html#method-i-to_s","()",""],["unit_id","Project","Project.html#method-i-unit_id","()",""],["unit_id=","Project","Project.html#method-i-unit_id-3D","(new_unit_id)",""],["unlock_all_sections","Plan","Plan.html#method-i-unlock_all_sections","(user_id)",""],["unlock_all_sections","PlansController","PlansController.html#method-i-unlock_all_sections","()",""],["unlock_section","Plan","Plan.html#method-i-unlock_section","(section_id, user_id)",""],["unlock_section","PlansController","PlansController.html#method-i-unlock_section","()",""],["update","CommentsController","CommentsController.html#method-i-update","()","

    PUT /comments/1 PUT /comments/1.json\n"],["update","PlansController","PlansController.html#method-i-update","()","

    PUT /plans/1 PUT /plans/1.json\n"],["update","ProjectGroupsController","ProjectGroupsController.html#method-i-update","()",""],["update","ProjectsController","ProjectsController.html#method-i-update","()","

    PUT /projects/1 PUT /projects/1.json\n"],["update","RegistrationsController","RegistrationsController.html#method-i-update","()",""],["update","Settings::PlansController","Settings/PlansController.html#method-i-update","()",""],["update","Settings::ProjectsController","Settings/ProjectsController.html#method-i-update","()",""],["update","ThemesController","ThemesController.html#method-i-update","()","

    PUT /themes/1 PUT /themes/1.json\n"],["update","UserOrgRolesController","UserOrgRolesController.html#method-i-update","()","

    PUT /user_org_roles/1 PUT /user_org_roles/1.json\n"],["update","UserRoleTypesController","UserRoleTypesController.html#method-i-update","()","

    PUT /user_role_types/1 PUT /user_role_types/1.json\n"],["update","UserStatusesController","UserStatusesController.html#method-i-update","()","

    PUT /user_statuses/1 PUT /user_statuses/1.json\n"],["update","UserTypesController","UserTypesController.html#method-i-update","()","

    PUT /user_types/1 PUT /user_types/1.json\n"],["update","UsersController","UsersController.html#method-i-update","()","

    PUT /users/1 PUT /users/1.json\n"],["update_phases","GuidancesController","GuidancesController.html#method-i-update_phases","()","

    setup variables for use in the dynamic updating\n"],["update_questions","GuidancesController","GuidancesController.html#method-i-update_questions","()",""],["update_sections","GuidancesController","GuidancesController.html#method-i-update_sections","()",""],["update_versions","GuidancesController","GuidancesController.html#method-i-update_versions","()",""],["warning","Organisation","Organisation.html#method-i-warning","(option_id)",""],["warning","Plan","Plan.html#method-i-warning","(option_id)",""],["warning","PlansController","PlansController.html#method-i-warning","()",""],["README","","README_rdoc.html","","

    DMPonline v4\n

    DMPonline is the DCC's data management planning tool, available at\ndmponline.dcc.ac.uk …\n"]]}} \ No newline at end of file +var search_data = {"index":{"searchIndex":["ability","activeadmin","views","pages","base","answer","answerscontroller","applicationcontroller","applicationhelper","comment","commentscontroller","confirmationscontroller","contactscontroller","customfailure","dmponline4","application","dmptemplate","dmptemplatescontroller","existinguserscontroller","exportedplan","filetype","fileupload","guidance","guidancegroup","guidancegroupscontroller","guidancescontroller","homecontroller","object","option","optionwarning","organisation","organisationtype","organisationuserscontroller","organisationscontroller","passwordscontroller","phase","plan","plansection","planscontroller","planshelper","project","projectgroup","projectgroupscontroller","projectpartner","projectscontroller","question","questionformat","registrationscontroller","role","section","sessionscontroller","settings","dmptemplate","planlist","planscontroller","projectscontroller","settingscontroller","splashlog","splashlogscontroller","staticpagescontroller","suggestedanswer","theme","themescontroller","user","usermailer","userorgrole","userorgrolescontroller","userroletype","userroletypescontroller","userstatus","userstatusescontroller","usertype","usertypescontroller","users","omniauthcallbackscontroller","omniauthshibbolethrequestcontroller","userscontroller","version","about_us()","about_us()","access_level()","access_level=()","add_guidance_to_array()","add_user()","admin_addphase()","admin_cloneversion()","admin_create()","admin_create()","admin_create()","admin_createphase()","admin_createquestion()","admin_createsection()","admin_createsuggestedanswer()","admin_destroy()","admin_destroy()","admin_destroy()","admin_destroyphase()","admin_destroyquestion()","admin_destroysection()","admin_destroysuggestedanswer()","admin_destroyversion()","admin_details()","admin_edit()","admin_edit()","admin_edit()","admin_index()","admin_index()","admin_index()","admin_new()","admin_new()","admin_new()","admin_phase()","admin_previewphase()","admin_show()","admin_show()","admin_show()","admin_template()","admin_update()","admin_update()","admin_update()","admin_update()","admin_updatephase()","admin_updatequestion()","admin_updatesection()","admin_updatesuggestedanswer()","admin_updateversion()","administerable_by()","administerable_by()","after_confirmation_path_for()","after_resetting_password_path_for()","after_sign_in_error_path_for()","after_sign_in_path_for()","after_sign_up_error_path_for()","after_sign_up_path_for()","all_guidance_groups()","all_sections()","answer()","answer()","archive()","as_csv()","as_txt()","assign_administrator()","assign_creator()","assign_editor()","assign_reader()","associate()","authenticate_admin!()","build_footer()","by_organisation()","children()","contact_us()","create()","create()","create()","create()","create()","create()","create()","create()","create()","create()","create()","create()","create()","create()","create()","create_plans()","created_by()","current_organisation()","delete_recent_locks()","delete_recent_locks()","destroy()","destroy()","destroy()","destroy()","destroy()","destroy()","destroy()","destroy()","destroy()","destroy()","details()","devise_mapping()","display_name()","dmptemplate()","do_update()","edit()","edit()","edit()","edit()","edit()","edit()","edit()","edit()","edit()","editable_by()","editable_by()","email()","email=()","estimate_space_used()","export()","export()","filter()","funder()","funder()","funder_id()","funder_id=()","funder_name()","funder_name=()","funders_and_own_templates()","funders_templates()","get_guidance_group_templates?()","get_plan_list_columns()","get_settings()","get_settings()","get_suggested_answer()","global_sections()","grant_title()","guidance_for_question()","guidance_for_question()","guidance_groups_excluding()","has_customisations?()","has_published_versions?()","has_sections()","height_of_text()","in_group_belonging_to?()","index()","index()","index()","index()","index()","index()","index()","index()","index()","index()","institution()","institution_id()","institution_id=()","can_super_admin?()","can_org_admin?()","javascript()","last_edited()","latest_published_version()","latest_update()","latest_update()","latest_version()","link_to_add_object()","lock_all_sections()","lock_section()","lock_section()","locked()","locked()","name()","name()","needs_password?()","new()","new()","new()","new()","new()","new()","new()","new()","new()","org_type()","org_type()","organisation()","organisation=()","organisation_id()","organisation_id=()","orgs_of_type()","orgs_with_parent_of_type()","other_organisations()","own_institutional_templates()","owner()","parent()","permissions_change_notification()","plan()","plan_settings_indicator()","possible_guidance()","possible_templates()","principal_investigator()","project_access_removed_notification()","project_data_contact()","project_description()","project_identifier()","project_list_body()","project_list_head()","project_name()","projects_for_user()","published_templates()","question_themes?()","questions()","questions_for_section()","readable_by()","readable_by()","redirect()","redirect_url()","resource()","resource_name()","respond()","roadmap()","root()","sanitize_text()","scoped_collection()","section_answers()","section_answers()","sections()","sections()","settings()","settings_json()","settings_json()","share()","shared()","shared?()","sharing_notification()","shibboleth()","short_name()","show()","show()","show()","show()","show()","show()","show()","show()","show()","show()","status()","status()","store_location()","super_settings()","template_owner()","templates()","templates_org_type()","title()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","to_s()","unit_id()","unit_id=()","unlock_all_sections()","unlock_all_sections()","unlock_section()","unlock_section()","update()","update()","update()","update()","update()","update()","update()","update()","update()","update()","update()","update()","update()","update_phases()","update_questions()","update_sections()","update_versions()","warning()","warning()","warning()","readme"],"longSearchIndex":["ability","activeadmin","activeadmin::views","activeadmin::views::pages","activeadmin::views::pages::base","answer","answerscontroller","applicationcontroller","applicationhelper","comment","commentscontroller","confirmationscontroller","contactscontroller","customfailure","dmponline4","dmponline4::application","dmptemplate","dmptemplatescontroller","existinguserscontroller","exportedplan","filetype","fileupload","guidance","guidancegroup","guidancegroupscontroller","guidancescontroller","homecontroller","object","option","optionwarning","organisation","organisationtype","organisationuserscontroller","organisationscontroller","passwordscontroller","phase","plan","plansection","planscontroller","planshelper","project","projectgroup","projectgroupscontroller","projectpartner","projectscontroller","question","questionformat","registrationscontroller","role","section","sessionscontroller","settings","settings::dmptemplate","settings::planlist","settings::planscontroller","settings::projectscontroller","settings::settingscontroller","splashlog","splashlogscontroller","staticpagescontroller","suggestedanswer","theme","themescontroller","user","usermailer","userorgrole","userorgrolescontroller","userroletype","userroletypescontroller","userstatus","userstatusescontroller","usertype","usertypescontroller","users","users::omniauthcallbackscontroller","users::omniauthshibbolethrequestcontroller","userscontroller","version","homecontroller#about_us()","staticpagescontroller#about_us()","projectgroup#access_level()","projectgroup#access_level=()","plan#add_guidance_to_array()","project#add_user()","dmptemplatescontroller#admin_addphase()","dmptemplatescontroller#admin_cloneversion()","dmptemplatescontroller#admin_create()","guidancegroupscontroller#admin_create()","guidancescontroller#admin_create()","dmptemplatescontroller#admin_createphase()","dmptemplatescontroller#admin_createquestion()","dmptemplatescontroller#admin_createsection()","dmptemplatescontroller#admin_createsuggestedanswer()","dmptemplatescontroller#admin_destroy()","guidancegroupscontroller#admin_destroy()","guidancescontroller#admin_destroy()","dmptemplatescontroller#admin_destroyphase()","dmptemplatescontroller#admin_destroyquestion()","dmptemplatescontroller#admin_destroysection()","dmptemplatescontroller#admin_destroysuggestedanswer()","dmptemplatescontroller#admin_destroyversion()","exportedplan#admin_details()","guidancegroupscontroller#admin_edit()","guidancescontroller#admin_edit()","organisationscontroller#admin_edit()","dmptemplatescontroller#admin_index()","guidancescontroller#admin_index()","organisationuserscontroller#admin_index()","dmptemplatescontroller#admin_new()","guidancegroupscontroller#admin_new()","guidancescontroller#admin_new()","dmptemplatescontroller#admin_phase()","dmptemplatescontroller#admin_previewphase()","guidancegroupscontroller#admin_show()","guidancescontroller#admin_show()","organisationscontroller#admin_show()","dmptemplatescontroller#admin_template()","dmptemplatescontroller#admin_update()","guidancegroupscontroller#admin_update()","guidancescontroller#admin_update()","organisationscontroller#admin_update()","dmptemplatescontroller#admin_updatephase()","dmptemplatescontroller#admin_updatequestion()","dmptemplatescontroller#admin_updatesection()","dmptemplatescontroller#admin_updatesuggestedanswer()","dmptemplatescontroller#admin_updateversion()","plan#administerable_by()","project#administerable_by()","confirmationscontroller#after_confirmation_path_for()","passwordscontroller#after_resetting_password_path_for()","applicationcontroller#after_sign_in_error_path_for()","applicationcontroller#after_sign_in_path_for()","applicationcontroller#after_sign_up_error_path_for()","applicationcontroller#after_sign_up_path_for()","organisation#all_guidance_groups()","organisation#all_sections()","plan#answer()","planscontroller#answer()","commentscontroller#archive()","exportedplan#as_csv()","exportedplan#as_txt()","project#assign_administrator()","project#assign_creator()","project#assign_editor()","project#assign_reader()","users::omniauthshibbolethrequestcontroller#associate()","applicationcontroller#authenticate_admin!()","activeadmin::views::pages::base#build_footer()","guidance::by_organisation()","organisationscontroller#children()","staticpagescontroller#contact_us()","answerscontroller#create()","commentscontroller#create()","contactscontroller#create()","organisationscontroller#create()","projectgroupscontroller#create()","projectscontroller#create()","registrationscontroller#create()","sessionscontroller#create()","splashlogscontroller#create()","themescontroller#create()","userorgrolescontroller#create()","userroletypescontroller#create()","userstatusescontroller#create()","usertypescontroller#create()","userscontroller#create()","project#create_plans()","project#created_by()","user#current_organisation()","plan#delete_recent_locks()","planscontroller#delete_recent_locks()","organisationscontroller#destroy()","projectgroupscontroller#destroy()","projectscontroller#destroy()","sessionscontroller#destroy()","themescontroller#destroy()","userorgrolescontroller#destroy()","userroletypescontroller#destroy()","userstatusescontroller#destroy()","usertypescontroller#destroy()","userscontroller#destroy()","plan#details()","applicationhelper#devise_mapping()","guidancegroup#display_name()","plan#dmptemplate()","registrationscontroller#do_update()","commentscontroller#edit()","planscontroller#edit()","projectscontroller#edit()","themescontroller#edit()","userorgrolescontroller#edit()","userroletypescontroller#edit()","userstatusescontroller#edit()","usertypescontroller#edit()","userscontroller#edit()","plan#editable_by()","project#editable_by()","projectgroup#email()","projectgroup#email=()","plan#estimate_space_used()","planscontroller#export()","projectscontroller#export()","user#filter()","exportedplan#funder()","project#funder()","project#funder_id()","project#funder_id=()","project#funder_name()","project#funder_name=()","dmptemplate::funders_and_own_templates()","dmptemplate::funders_templates()","guidance#get_guidance_group_templates?()","applicationcontroller#get_plan_list_columns()","settings::planscontroller#get_settings()","settings::projectscontroller#get_settings()","question#get_suggested_answer()","version#global_sections()","exportedplan#grant_title()","plan#guidance_for_question()","question#guidance_for_question()","guidancegroup::guidance_groups_excluding()","dmptemplate#has_customisations?()","dmptemplate#has_published_versions?()","phase#has_sections()","plan#height_of_text()","guidance#in_group_belonging_to?()","commentscontroller#index()","existinguserscontroller#index()","homecontroller#index()","organisationscontroller#index()","projectscontroller#index()","themescontroller#index()","userorgrolescontroller#index()","userroletypescontroller#index()","userstatusescontroller#index()","usertypescontroller#index()","exportedplan#institution()","project#institution_id()","project#institution_id=()","user#can_super_admin?()","user#can_org_admin?()","applicationhelper#javascript()","project#last_edited()","phase#latest_published_version()","plan#latest_update()","project#latest_update()","phase#latest_version()","applicationhelper#link_to_add_object()","plan#lock_all_sections()","plan#lock_section()","planscontroller#lock_section()","plan#locked()","planscontroller#locked()","project#name()","user#name()","registrationscontroller#needs_password?()","ability::new()","organisationscontroller#new()","projectscontroller#new()","themescontroller#new()","userorgrolescontroller#new()","userroletypescontroller#new()","userstatusescontroller#new()","usertypescontroller#new()","userscontroller#new()","dmptemplate#org_type()","user#org_type()","user#organisation()","user#organisation=()","user#organisation_id()","user#organisation_id=()","projectscontroller#orgs_of_type()","organisation::orgs_with_parent_of_type()","organisation::other_organisations()","dmptemplate::own_institutional_templates()","project#owner()","organisationscontroller#parent()","usermailer#permissions_change_notification()","settings::planscontroller#plan()","planshelper#plan_settings_indicator()","projectscontroller#possible_guidance()","projectscontroller#possible_templates()","exportedplan#principal_investigator()","usermailer#project_access_removed_notification()","exportedplan#project_data_contact()","exportedplan#project_description()","exportedplan#project_identifier()","planshelper#project_list_body()","planshelper#project_list_head()","exportedplan#project_name()","project::projects_for_user()","organisation#published_templates()","question#question_themes?()","exportedplan#questions()","exportedplan#questions_for_section()","plan#readable_by()","project#readable_by()","users::omniauthshibbolethrequestcontroller#redirect()","customfailure#redirect_url()","applicationhelper#resource()","applicationhelper#resource_name()","customfailure#respond()","staticpagescontroller#roadmap()","organisation#root()","exportedplan#sanitize_text()","object#scoped_collection()","plan#section_answers()","planscontroller#section_answers()","exportedplan#sections()","plan#sections()","plan#settings()","settings::planscontroller#settings_json()","settings::projectscontroller#settings_json()","projectscontroller#share()","project#shared()","project#shared?()","usermailer#sharing_notification()","users::omniauthcallbackscontroller#shibboleth()","organisation#short_name()","commentscontroller#show()","projectscontroller#show()","settings::planscontroller#show()","settings::projectscontroller#show()","themescontroller#show()","userorgrolescontroller#show()","userroletypescontroller#show()","userstatusescontroller#show()","usertypescontroller#show()","userscontroller#show()","plan#status()","planscontroller#status()","applicationcontroller#store_location()","plan#super_settings()","project#template_owner()","organisationscontroller#templates()","dmptemplate::templates_org_type()","plan#title()","comment#to_s()","dmptemplate#to_s()","guidancegroup#to_s()","option#to_s()","optionwarning#to_s()","organisation#to_s()","phase#to_s()","question#to_s()","questionformat#to_s()","section#to_s()","suggestedanswer#to_s()","theme#to_s()","version#to_s()","project#unit_id()","project#unit_id=()","plan#unlock_all_sections()","planscontroller#unlock_all_sections()","plan#unlock_section()","planscontroller#unlock_section()","commentscontroller#update()","planscontroller#update()","projectgroupscontroller#update()","projectscontroller#update()","registrationscontroller#update()","settings::planscontroller#update()","settings::projectscontroller#update()","themescontroller#update()","userorgrolescontroller#update()","userroletypescontroller#update()","userstatusescontroller#update()","usertypescontroller#update()","userscontroller#update()","guidancescontroller#update_phases()","guidancescontroller#update_questions()","guidancescontroller#update_sections()","guidancescontroller#update_versions()","organisation#warning()","plan#warning()","planscontroller#warning()",""],"info":[["Ability","","Ability.html","",""],["ActiveAdmin","","ActiveAdmin.html","",""],["ActiveAdmin::Views","","ActiveAdmin/Views.html","",""],["ActiveAdmin::Views::Pages","","ActiveAdmin/Views/Pages.html","",""],["ActiveAdmin::Views::Pages::Base","","ActiveAdmin/Views/Pages/Base.html","","

    lib/active_admin_views_pages_base.rb\n"],["Answer","","Answer.html","",""],["AnswersController","","AnswersController.html","",""],["ApplicationController","","ApplicationController.html","",""],["ApplicationHelper","","ApplicationHelper.html","",""],["Comment","","Comment.html","",""],["CommentsController","","CommentsController.html","",""],["ConfirmationsController","","ConfirmationsController.html","",""],["ContactsController","","ContactsController.html","",""],["CustomFailure","","CustomFailure.html","",""],["DMPonline4","","DMPonline4.html","",""],["DMPonline4::Application","","DMPonline4/Application.html","",""],["Dmptemplate","","Dmptemplate.html","",""],["DmptemplatesController","","DmptemplatesController.html","","

    Project: — DMPonline v4\n

    Description: — This controller is responsible for all the actions in the admin interface …\n"],["ExistingUsersController","","ExistingUsersController.html","",""],["ExportedPlan","","ExportedPlan.html","",""],["FileType","","FileType.html","",""],["FileUpload","","FileUpload.html","",""],["Guidance","","Guidance.html","","

    Project: — DMPonline v4\n

    Description: — This class keeps the information organisations enter to support users …\n"],["GuidanceGroup","","GuidanceGroup.html","",""],["GuidanceGroupsController","","GuidanceGroupsController.html","",""],["GuidancesController","","GuidancesController.html","",""],["HomeController","","HomeController.html","",""],["Object","","Object.html","",""],["Option","","Option.html","",""],["OptionWarning","","OptionWarning.html","",""],["Organisation","","Org.html","",""],["OrganisationType","","OrganisationType.html","",""],["OrganisationUsersController","","OrganisationUsersController.html","",""],["OrganisationsController","","OrganisationsController.html","",""],["PasswordsController","","PasswordsController.html","",""],["Phase","","Phase.html","","

    Project: — DMPonline v4\n

    Description: — This model describes informmation about the phase of a plan, it's …\n"],["Plan","","Plan.html","",""],["PlanSection","","PlanSection.html","",""],["PlansController","","PlansController.html","",""],["PlansHelper","","PlansHelper.html","",""],["Project","","Project.html","",""],["ProjectGroup","","ProjectGroup.html","",""],["ProjectGroupsController","","ProjectGroupsController.html","",""],["ProjectPartner","","ProjectPartner.html","",""],["ProjectsController","","ProjectsController.html","",""],["Question","","Question.html","",""],["QuestionFormat","","QuestionFormat.html","",""],["RegistrationsController","","RegistrationsController.html","","

    app/controllers/registrations_controller.rb\n"],["Role","","Role.html","",""],["Section","","Section.html","",""],["SessionsController","","SessionsController.html","","

    app/controllers/sessions_controller.rb\n"],["Settings","","Settings.html","",""],["Settings::Dmptemplate","","Settings/Dmptemplate.html","",""],["Settings::PlanList","","Settings/PlanList.html","",""],["Settings::PlansController","","Settings/PlansController.html","",""],["Settings::ProjectsController","","Settings/ProjectsController.html","",""],["Settings::SettingsController","","Settings/SettingsController.html","",""],["SplashLog","","SplashLog.html","",""],["SplashLogsController","","SplashLogsController.html","",""],["StaticPagesController","","StaticPagesController.html","",""],["SuggestedAnswer","","SuggestedAnswer.html","",""],["Theme","","Theme.html","",""],["ThemesController","","ThemesController.html","",""],["User","","User.html","",""],["UserMailer","","UserMailer.html","",""],["UserOrgRole","","UserOrgRole.html","",""],["UserOrgRolesController","","UserOrgRolesController.html","",""],["UserRoleType","","UserRoleType.html","",""],["UserRoleTypesController","","UserRoleTypesController.html","",""],["UserStatus","","UserStatus.html","",""],["UserStatusesController","","UserStatusesController.html","",""],["UserType","","UserType.html","",""],["UserTypesController","","UserTypesController.html","",""],["Users","","Users.html","",""],["Users::OmniauthCallbacksController","","Users/OmniauthCallbacksController.html","",""],["Users::OmniauthShibbolethRequestController","","Users/OmniauthShibbolethRequestController.html","",""],["UsersController","","UsersController.html","",""],["Version","","Version.html","",""],["about_us","HomeController","HomeController.html#method-i-about_us","()",""],["about_us","StaticPagesController","StaticPagesController.html#method-i-about_us","()",""],["access_level","ProjectGroup","ProjectGroup.html#method-i-access_level","()",""],["access_level=","ProjectGroup","ProjectGroup.html#method-i-access_level-3D","(new_access_level)",""],["add_guidance_to_array","Plan","Plan.html#method-i-add_guidance_to_array","(guidance_array, guidance_group, theme, guidance)",""],["add_user","Project","Project.html#method-i-add_user","(user_id, is_editor = false, is_administrator = false, is_creator = false)",""],["admin_addphase","DmptemplatesController","DmptemplatesController.html#method-i-admin_addphase","()","

    add a new phase to a template\n"],["admin_cloneversion","DmptemplatesController","DmptemplatesController.html#method-i-admin_cloneversion","()","

    clone a version of a template\n"],["admin_create","DmptemplatesController","DmptemplatesController.html#method-i-admin_create","()","

    POST /dmptemplates POST /dmptemplates.json\n"],["admin_create","GuidanceGroupsController","GuidanceGroupsController.html#method-i-admin_create","()","

    POST /guidance_groups POST /guidance_groups.json\n"],["admin_create","GuidancesController","GuidancesController.html#method-i-admin_create","()","

    POST /guidances POST /guidances.json\n"],["admin_createphase","DmptemplatesController","DmptemplatesController.html#method-i-admin_createphase","()","

    create a phase\n"],["admin_createquestion","DmptemplatesController","DmptemplatesController.html#method-i-admin_createquestion","()","

    create a question\n"],["admin_createsection","DmptemplatesController","DmptemplatesController.html#method-i-admin_createsection","()","

    create a section\n"],["admin_createsuggestedanswer","DmptemplatesController","DmptemplatesController.html#method-i-admin_createsuggestedanswer","()","

    SUGGESTED ANSWERS create suggested answers\n"],["admin_destroy","DmptemplatesController","DmptemplatesController.html#method-i-admin_destroy","()","

    DELETE /dmptemplates/1 DELETE /dmptemplates/1.json\n"],["admin_destroy","GuidanceGroupsController","GuidanceGroupsController.html#method-i-admin_destroy","()","

    DELETE /guidance_groups/1 DELETE /guidance_groups/1.json\n"],["admin_destroy","GuidancesController","GuidancesController.html#method-i-admin_destroy","()","

    DELETE /guidances/1 DELETE /guidances/1.json\n"],["admin_destroyphase","DmptemplatesController","DmptemplatesController.html#method-i-admin_destroyphase","()","

    delete a version, sections and questions\n"],["admin_destroyquestion","DmptemplatesController","DmptemplatesController.html#method-i-admin_destroyquestion","()","

    delete a version, sections and questions\n"],["admin_destroysection","DmptemplatesController","DmptemplatesController.html#method-i-admin_destroysection","()","

    delete a section and questions\n"],["admin_destroysuggestedanswer","DmptemplatesController","DmptemplatesController.html#method-i-admin_destroysuggestedanswer","()","

    delete a suggested answer\n"],["admin_destroyversion","DmptemplatesController","DmptemplatesController.html#method-i-admin_destroyversion","()","

    delete a version, sections and questions\n"],["admin_details","ExportedPlan","ExportedPlan.html#method-i-admin_details","()",""],["admin_edit","GuidanceGroupsController","GuidanceGroupsController.html#method-i-admin_edit","()","

    GET /guidance_groups/1/edit\n"],["admin_edit","GuidancesController","GuidancesController.html#method-i-admin_edit","()","

    GET /guidances/1/edit\n"],["admin_edit","OrganisationsController","OrganisationsController.html#method-i-admin_edit","()","

    GET /organisations/1/edit\n"],["admin_index","DmptemplatesController","DmptemplatesController.html#method-i-admin_index","()","

    GET /dmptemplates GET /dmptemplates.json\n"],["admin_index","GuidancesController","GuidancesController.html#method-i-admin_index","()","

    GET /guidances GET /guidances.json\n"],["admin_index","OrganisationUsersController","OrganisationUsersController.html#method-i-admin_index","()",""],["admin_new","DmptemplatesController","DmptemplatesController.html#method-i-admin_new","()","

    GET /dmptemplates/new GET /dmptemplates/new.json\n"],["admin_new","GuidanceGroupsController","GuidanceGroupsController.html#method-i-admin_new","()","

    GET add new guidance groups\n"],["admin_new","GuidancesController","GuidancesController.html#method-i-admin_new","()",""],["admin_phase","DmptemplatesController","DmptemplatesController.html#method-i-admin_phase","()","

    show and edit a phase of the template\n"],["admin_previewphase","DmptemplatesController","DmptemplatesController.html#method-i-admin_previewphase","()","

    preview a phase\n"],["admin_show","GuidanceGroupsController","GuidanceGroupsController.html#method-i-admin_show","()","

    GET /guidance_groups/1 GET /guidance_groups/1.json\n"],["admin_show","GuidancesController","GuidancesController.html#method-i-admin_show","()","

    GET /guidances/1 GET /guidances/1.json\n"],["admin_show","OrganisationsController","OrganisationsController.html#method-i-admin_show","()","

    GET /organisations/1 GET /organisations/1.json\n"],["admin_template","DmptemplatesController","DmptemplatesController.html#method-i-admin_template","()","

    GET /dmptemplates/1 GET /dmptemplates/1.json\n"],["admin_update","DmptemplatesController","DmptemplatesController.html#method-i-admin_update","()","

    PUT /dmptemplates/1 PUT /dmptemplates/1.json\n"],["admin_update","GuidanceGroupsController","GuidanceGroupsController.html#method-i-admin_update","()","

    PUT /guidance_groups/1 PUT /guidance_groups/1.json\n"],["admin_update","GuidancesController","GuidancesController.html#method-i-admin_update","()","

    PUT /guidances/1 PUT /guidances/1.json\n"],["admin_update","OrganisationsController","OrganisationsController.html#method-i-admin_update","()","

    PUT /organisations/1 PUT /organisations/1.json\n"],["admin_updatephase","DmptemplatesController","DmptemplatesController.html#method-i-admin_updatephase","()","

    update a phase of a template\n"],["admin_updatequestion","DmptemplatesController","DmptemplatesController.html#method-i-admin_updatequestion","()","

    update a question of a template\n"],["admin_updatesection","DmptemplatesController","DmptemplatesController.html#method-i-admin_updatesection","()","

    update a section of a template\n"],["admin_updatesuggestedanswer","DmptemplatesController","DmptemplatesController.html#method-i-admin_updatesuggestedanswer","()","

    update a suggested answer of a template\n"],["admin_updateversion","DmptemplatesController","DmptemplatesController.html#method-i-admin_updateversion","()","

    update a version of a template\n"],["administerable_by","Plan","Plan.html#method-i-administerable_by","(user_id)",""],["administerable_by","Project","Project.html#method-i-administerable_by","(user_id)",""],["after_confirmation_path_for","ConfirmationsController","ConfirmationsController.html#method-i-after_confirmation_path_for","(resource_name, resource)",""],["after_resetting_password_path_for","PasswordsController","PasswordsController.html#method-i-after_resetting_password_path_for","(resource)",""],["after_sign_in_error_path_for","ApplicationController","ApplicationController.html#method-i-after_sign_in_error_path_for","(resource)",""],["after_sign_in_path_for","ApplicationController","ApplicationController.html#method-i-after_sign_in_path_for","(resource)",""],["after_sign_up_error_path_for","ApplicationController","ApplicationController.html#method-i-after_sign_up_error_path_for","(resource)",""],["after_sign_up_path_for","ApplicationController","ApplicationController.html#method-i-after_sign_up_path_for","(resource)",""],["all_guidance_groups","Organisation","Org.html#method-i-all_guidance_groups","()",""],["all_sections","Organisation","Org.html#method-i-all_sections","(version_id)",""],["answer","Plan","Plan.html#method-i-answer","(qid, create_if_missing = true)",""],["answer","PlansController","PlansController.html#method-i-answer","()",""],["archive","CommentsController","CommentsController.html#method-i-archive","()","

    ARCHIVE /comments/1 ARCHIVE /comments/1.json\n"],["as_csv","ExportedPlan","ExportedPlan.html#method-i-as_csv","()","

    Export formats\n"],["as_txt","ExportedPlan","ExportedPlan.html#method-i-as_txt","()",""],["assign_administrator","Project","Project.html#method-i-assign_administrator","(user_id)",""],["assign_creator","Project","Project.html#method-i-assign_creator","(user_id)",""],["assign_editor","Project","Project.html#method-i-assign_editor","(user_id)",""],["assign_reader","Project","Project.html#method-i-assign_reader","(user_id)",""],["associate","Users::OmniauthShibbolethRequestController","Users/OmniauthShibbolethRequestController.html#method-i-associate","()",""],["authenticate_admin!","ApplicationController","ApplicationController.html#method-i-authenticate_admin-21","()",""],["build_footer","ActiveAdmin::Views::Pages::Base","ActiveAdmin/Views/Pages/Base.html#method-i-build_footer","()","

    Renders the content for the footer\n"],["by_organisation","Guidance","Guidance.html#method-c-by_organisation","(org_id)","

    all guidance that belong to an organisation\n"],["children","OrganisationsController","OrganisationsController.html#method-i-children","()",""],["contact_us","StaticPagesController","StaticPagesController.html#method-i-contact_us","()",""],["create","AnswersController","AnswersController.html#method-i-create","()","

    POST /answers POST /answers.json\n"],["create","CommentsController","CommentsController.html#method-i-create","()","

    POST /comments POST /comments.json\n"],["create","ContactsController","ContactsController.html#method-i-create","()",""],["create","OrganisationsController","OrganisationsController.html#method-i-create","()","

    POST /organisations POST /organisations.json\n"],["create","ProjectGroupsController","ProjectGroupsController.html#method-i-create","()",""],["create","ProjectsController","ProjectsController.html#method-i-create","()","

    POST /projects POST /projects.json\n"],["create","RegistrationsController","RegistrationsController.html#method-i-create","()","

    POST /resource\n"],["create","SessionsController","SessionsController.html#method-i-create","()",""],["create","SplashLogsController","SplashLogsController.html#method-i-create","()","

    POST /answers POST /answers.json\n"],["create","ThemesController","ThemesController.html#method-i-create","()","

    POST /themes POST /themes.json\n"],["create","UserOrgRolesController","UserOrgRolesController.html#method-i-create","()","

    POST /user_org_roles POST /user_org_roles.json\n"],["create","UserRoleTypesController","UserRoleTypesController.html#method-i-create","()","

    POST /user_role_types POST /user_role_types.json\n"],["create","UserStatusesController","UserStatusesController.html#method-i-create","()","

    POST /user_statuses POST /user_statuses.json\n"],["create","UserTypesController","UserTypesController.html#method-i-create","()","

    POST /user_types POST /user_types.json\n"],["create","UsersController","UsersController.html#method-i-create","()","

    POST /users POST /users.json\n"],["create_plans","Project","Project.html#method-i-create_plans","()",""],["created_by","Project","Project.html#method-i-created_by","(user_id)",""],["current_organisation","User","User.html#method-i-current_organisation","()",""],["delete_recent_locks","Plan","Plan.html#method-i-delete_recent_locks","(user_id)",""],["delete_recent_locks","PlansController","PlansController.html#method-i-delete_recent_locks","()",""],["destroy","OrganisationsController","OrganisationsController.html#method-i-destroy","()","

    DELETE /organisations/1 DELETE /organisations/1.json\n"],["destroy","ProjectGroupsController","ProjectGroupsController.html#method-i-destroy","()",""],["destroy","ProjectsController","ProjectsController.html#method-i-destroy","()","

    DELETE /projects/1 DELETE /projects/1.json\n"],["destroy","SessionsController","SessionsController.html#method-i-destroy","()",""],["destroy","ThemesController","ThemesController.html#method-i-destroy","()","

    DELETE /themes/1 DELETE /themes/1.json\n"],["destroy","UserOrgRolesController","UserOrgRolesController.html#method-i-destroy","()","

    DELETE /user_org_roles/1 DELETE /user_org_roles/1.json\n"],["destroy","UserRoleTypesController","UserRoleTypesController.html#method-i-destroy","()","

    DELETE /user_role_types/1 DELETE /user_role_types/1.json\n"],["destroy","UserStatusesController","UserStatusesController.html#method-i-destroy","()","

    DELETE /user_statuses/1 DELETE /user_statuses/1.json\n"],["destroy","UserTypesController","UserTypesController.html#method-i-destroy","()","

    DELETE /user_types/1 DELETE /user_types/1.json\n"],["destroy","UsersController","UsersController.html#method-i-destroy","()","

    DELETE /users/1 DELETE /users/1.json\n"],["details","Plan","Plan.html#method-i-details","()",""],["devise_mapping","ApplicationHelper","ApplicationHelper.html#method-i-devise_mapping","()",""],["display_name","GuidanceGroup","GuidanceGroup.html#method-i-display_name","()",""],["dmptemplate","Plan","Plan.html#method-i-dmptemplate","()",""],["do_update","RegistrationsController","RegistrationsController.html#method-i-do_update","(require_password = true, confirm = false)",""],["edit","CommentsController","CommentsController.html#method-i-edit","()","

    GET /comments/1/edit\n"],["edit","PlansController","PlansController.html#method-i-edit","()","

    GET /plans/1/edit\n"],["edit","ProjectsController","ProjectsController.html#method-i-edit","()","

    GET /projects/1/edit Should this be removed?\n"],["edit","ThemesController","ThemesController.html#method-i-edit","()","

    GET /themes/1/edit\n"],["edit","UserOrgRolesController","UserOrgRolesController.html#method-i-edit","()","

    GET /user_org_roles/1/edit\n"],["edit","UserRoleTypesController","UserRoleTypesController.html#method-i-edit","()","

    GET /user_role_types/1/edit\n"],["edit","UserStatusesController","UserStatusesController.html#method-i-edit","()","

    GET /user_statuses/1/edit\n"],["edit","UserTypesController","UserTypesController.html#method-i-edit","()","

    GET /user_types/1/edit\n"],["edit","UsersController","UsersController.html#method-i-edit","()","

    GET /users/1/edit\n"],["editable_by","Plan","Plan.html#method-i-editable_by","(user_id)",""],["editable_by","Project","Project.html#method-i-editable_by","(user_id)",""],["email","ProjectGroup","ProjectGroup.html#method-i-email","()",""],["email=","ProjectGroup","ProjectGroup.html#method-i-email-3D","(new_email)",""],["estimate_space_used","Plan","Plan.html#method-i-estimate_space_used","(used_height)","

    Based on the height of the text gathered so far and the available vertical\nspace of the pdf, estimate …\n"],["export","PlansController","PlansController.html#method-i-export","()",""],["export","ProjectsController","ProjectsController.html#method-i-export","()",""],["filter","User","User.html#method-i-filter","(query)",""],["funder","ExportedPlan","ExportedPlan.html#method-i-funder","()",""],["funder","Project","Project.html#method-i-funder","()",""],["funder_id","Project","Project.html#method-i-funder_id","()",""],["funder_id=","Project","Project.html#method-i-funder_id-3D","(new_funder_id)",""],["funder_name","Project","Project.html#method-i-funder_name","()",""],["funder_name=","Project","Project.html#method-i-funder_name-3D","(new_funder_name)",""],["funders_and_own_templates","Dmptemplate","Dmptemplate.html#method-c-funders_and_own_templates","(org_id)","

    returns an array with all funders and own institutional templates\n"],["funders_templates","Dmptemplate","Dmptemplate.html#method-c-funders_templates","()","

    returns all funders templates\n"],["get_guidance_group_templates?","Guidance","Guidance.html#method-i-get_guidance_group_templates-3F","(guidance_group)",""],["get_plan_list_columns","ApplicationController","ApplicationController.html#method-i-get_plan_list_columns","()",""],["get_settings","Settings::PlansController","Settings/PlansController.html#method-i-get_settings","()",""],["get_settings","Settings::ProjectsController","Settings/ProjectsController.html#method-i-get_settings","()",""],["get_suggested_answer","Question","Question.html#method-i-get_suggested_answer","(org_id)","

    get suggested answer belonging to the currents user for this question\n"],["global_sections","Version","Version.html#method-i-global_sections","()",""],["grant_title","ExportedPlan","ExportedPlan.html#method-i-grant_title","()",""],["guidance_for_question","Plan","Plan.html#method-i-guidance_for_question","(question)",""],["guidance_for_question","Question","Question.html#method-i-guidance_for_question","(question, org_admin)","

    guidance for question in the org admin\n"],["guidance_groups_excluding","GuidanceGroup","GuidanceGroup.html#method-c-guidance_groups_excluding","(excluded_orgs)",""],["has_customisations?","Dmptemplate","Dmptemplate.html#method-i-has_customisations-3F","(org_id, temp)","

    verify if a template has customisation by current user's org\n"],["has_published_versions?","Dmptemplate","Dmptemplate.html#method-i-has_published_versions-3F","()","

    verify if there are any publish version for the template\n"],["has_sections","Phase","Phase.html#method-i-has_sections","()","

    verify if a phase has a published version or a version with one or more\nsections\n"],["height_of_text","Plan","Plan.html#method-i-height_of_text","(text, font_size_inc = 0, vertical_margin = 0)","

    Take a guess at the vertical height (in mm) of the given text based on the\nfont-size and left/right margins …\n"],["in_group_belonging_to?","Guidance","Guidance.html#method-i-in_group_belonging_to-3F","(organisation_id)","

    verifies if one guidance belongs to a org\n"],["index","CommentsController","CommentsController.html#method-i-index","()","

    GET /comments GET /comments.json\n"],["index","ExistingUsersController","ExistingUsersController.html#method-i-index","()",""],["index","HomeController","HomeController.html#method-i-index","()",""],["index","OrganisationsController","OrganisationsController.html#method-i-index","()","

    GET /organisations GET /organisations.json\n"],["index","ProjectsController","ProjectsController.html#method-i-index","()","

    GET /projects GET /projects.json\n"],["index","ThemesController","ThemesController.html#method-i-index","()","

    GET /themes GET /themes.json\n"],["index","UserOrgRolesController","UserOrgRolesController.html#method-i-index","()","

    GET /user_org_roles GET /user_org_roles.json\n"],["index","UserRoleTypesController","UserRoleTypesController.html#method-i-index","()","

    GET /user_role_types GET /user_role_types.json\n"],["index","UserStatusesController","UserStatusesController.html#method-i-index","()","

    GET /user_statuses GET /user_statuses.json\n"],["index","UserTypesController","UserTypesController.html#method-i-index","()","

    GET /user_types GET /user_types.json\n"],["institution","ExportedPlan","ExportedPlan.html#method-i-institution","()",""],["institution_id","Project","Project.html#method-i-institution_id","()",""],["institution_id=","Project","Project.html#method-i-institution_id-3D","(new_institution_id)",""],["can_super_admin?","User","User.html#method-i-is_admin-3F","()",""],["can_org_admin?","User","User.html#method-i-is_org_admin-3F","()",""],["javascript","ApplicationHelper","ApplicationHelper.html#method-i-javascript","(*files)",""],["last_edited","Project","Project.html#method-i-last_edited","()",""],["latest_published_version","Phase","Phase.html#method-i-latest_published_version","()","

    Verify if this phase has any published versions\n"],["latest_update","Plan","Plan.html#method-i-latest_update","()",""],["latest_update","Project","Project.html#method-i-latest_update","()",""],["latest_version","Phase","Phase.html#method-i-latest_version","()",""],["link_to_add_object","ApplicationHelper","ApplicationHelper.html#method-i-link_to_add_object","(name, f, association, css_class, i)",""],["lock_all_sections","Plan","Plan.html#method-i-lock_all_sections","(user_id)",""],["lock_section","Plan","Plan.html#method-i-lock_section","(section_id, user_id, release_time = 60)",""],["lock_section","PlansController","PlansController.html#method-i-lock_section","()",""],["locked","Plan","Plan.html#method-i-locked","(section_id, user_id)",""],["locked","PlansController","PlansController.html#method-i-locked","()",""],["name","Project","Project.html#method-i-name","()","

    Getters to match 'My plans' columns\n"],["name","User","User.html#method-i-name","(use_email = true)",""],["needs_password?","RegistrationsController","RegistrationsController.html#method-i-needs_password-3F","(user, params)","

    check if we need password to update user data ie if password or email was\nchanged extend this as needed …\n"],["new","Ability","Ability.html#method-c-new","(user)",""],["new","OrganisationsController","OrganisationsController.html#method-i-new","()","

    GET /organisations/new GET /organisations/new.json\n"],["new","ProjectsController","ProjectsController.html#method-i-new","()","

    GET /projects/new GET /projects/new.json\n"],["new","ThemesController","ThemesController.html#method-i-new","()","

    GET /themes/new GET /themes/new.json\n"],["new","UserOrgRolesController","UserOrgRolesController.html#method-i-new","()","

    GET /user_org_roles/new GET /user_org_roles/new.json\n"],["new","UserRoleTypesController","UserRoleTypesController.html#method-i-new","()","

    GET /user_role_types/new GET /user_role_types/new.json\n"],["new","UserStatusesController","UserStatusesController.html#method-i-new","()","

    GET /user_statuses/new GET /user_statuses/new.json\n"],["new","UserTypesController","UserTypesController.html#method-i-new","()","

    GET /user_types/new GET /user_types/new.json\n"],["new","UsersController","UsersController.html#method-i-new","()","

    GET /users/new GET /users/new.json\n"],["org_type","Dmptemplate","Dmptemplate.html#method-i-org_type","()",""],["org_type","User","User.html#method-i-org_type","()",""],["organisation","User","User.html#method-i-organisation","()",""],["organisation=","User","User.html#method-i-organisation-3D","(new_organisation)",""],["organisation_id","User","User.html#method-i-organisation_id","()",""],["organisation_id=","User","User.html#method-i-organisation_id-3D","(new_organisation_id)",""],["orgs_of_type","ProjectsController","ProjectsController.html#method-i-orgs_of_type","(org_type_name, published_templates = false)",""],["orgs_with_parent_of_type","Organisation","Org.html#method-c-orgs_with_parent_of_type","(org_type)","

    retrieves info off a child org\n"],["other_organisations","Organisation","Org.html#method-c-other_organisations","()",""],["own_institutional_templates","Dmptemplate","Dmptemplate.html#method-c-own_institutional_templates","(org_id)","

    returns all institutional templates bellowing to the current user's org\n"],["owner","Project","Project.html#method-i-owner","()",""],["parent","OrganisationsController","OrganisationsController.html#method-i-parent","()",""],["permissions_change_notification","UserMailer","UserMailer.html#method-i-permissions_change_notification","(project_group)",""],["plan","Settings::PlansController","Settings/PlansController.html#method-i-plan","()",""],["plan_settings_indicator","PlansHelper","PlansHelper.html#method-i-plan_settings_indicator","(plan)","

    Shows whether the user has default, template-default or custom settings for\nthe given plan.\n"],["possible_guidance","ProjectsController","ProjectsController.html#method-i-possible_guidance","()",""],["possible_templates","ProjectsController","ProjectsController.html#method-i-possible_templates","()","

    GET /projects/possible_templates.json\n"],["principal_investigator","ExportedPlan","ExportedPlan.html#method-i-principal_investigator","()",""],["project_access_removed_notification","UserMailer","UserMailer.html#method-i-project_access_removed_notification","(user, project)",""],["project_data_contact","ExportedPlan","ExportedPlan.html#method-i-project_data_contact","()",""],["project_description","ExportedPlan","ExportedPlan.html#method-i-project_description","()",""],["project_identifier","ExportedPlan","ExportedPlan.html#method-i-project_identifier","()",""],["project_list_body","PlansHelper","PlansHelper.html#method-i-project_list_body","(column, project)",""],["project_list_head","PlansHelper","PlansHelper.html#method-i-project_list_head","(column)",""],["project_name","ExportedPlan","ExportedPlan.html#method-i-project_name","()","

    Getters to match Settings::Dmptemplate::VALID_ADMIN_FIELDS\n"],["projects_for_user","Project","Project.html#method-c-projects_for_user","(user_id)",""],["published_templates","Organisation","Org.html#method-i-published_templates","()",""],["question_themes?","Question","Question.html#method-i-question_themes-3F","()","

    def question_type?\n\n

    type_label = {}\nif self.is_text_field?\n  type_label = 'Text field'\nelsif self.multiple_choice? ...
    \n"],["questions","ExportedPlan","ExportedPlan.html#method-i-questions","()",""],["questions_for_section","ExportedPlan","ExportedPlan.html#method-i-questions_for_section","(section_id)",""],["readable_by","Plan","Plan.html#method-i-readable_by","(user_id)",""],["readable_by","Project","Project.html#method-i-readable_by","(user_id)",""],["redirect","Users::OmniauthShibbolethRequestController","Users/OmniauthShibbolethRequestController.html#method-i-redirect","()",""],["redirect_url","CustomFailure","CustomFailure.html#method-i-redirect_url","()",""],["resource","ApplicationHelper","ApplicationHelper.html#method-i-resource","()",""],["resource_name","ApplicationHelper","ApplicationHelper.html#method-i-resource_name","()",""],["respond","CustomFailure","CustomFailure.html#method-i-respond","()",""],["roadmap","StaticPagesController","StaticPagesController.html#method-i-roadmap","()",""],["root","Organisation","Org.html#method-i-root","()",""],["sanitize_text","ExportedPlan","ExportedPlan.html#method-i-sanitize_text","(text)",""],["scoped_collection","Object","Object.html#method-i-scoped_collection","()",""],["section_answers","Plan","Plan.html#method-i-section_answers","(section_id)",""],["section_answers","PlansController","PlansController.html#method-i-section_answers","()",""],["sections","ExportedPlan","ExportedPlan.html#method-i-sections","()","

    sections taken from fields settings\n"],["sections","Plan","Plan.html#method-i-sections","()",""],["settings","Plan","Plan.html#method-i-settings","(key)","

    Proxy through to the template settings (or defaults if this plan\ndoesn't have an associated template) …\n"],["settings_json","Settings::PlansController","Settings/PlansController.html#method-i-settings_json","()",""],["settings_json","Settings::ProjectsController","Settings/ProjectsController.html#method-i-settings_json","()",""],["share","ProjectsController","ProjectsController.html#method-i-share","()",""],["shared","Project","Project.html#method-i-shared","()",""],["shared?","Project","Project.html#method-i-shared-3F","()",""],["sharing_notification","UserMailer","UserMailer.html#method-i-sharing_notification","(project_group)",""],["shibboleth","Users::OmniauthCallbacksController","Users/OmniauthCallbacksController.html#method-i-shibboleth","()",""],["short_name","Organisation","Org.html#method-i-short_name","()",""],["show","CommentsController","CommentsController.html#method-i-show","()","

    GET /comments/1 GET /comments/1.json\n"],["show","ProjectsController","ProjectsController.html#method-i-show","()","

    GET /projects/1 GET /projects/1.json\n"],["show","Settings::PlansController","Settings/PlansController.html#method-i-show","()",""],["show","Settings::ProjectsController","Settings/ProjectsController.html#method-i-show","()",""],["show","ThemesController","ThemesController.html#method-i-show","()","

    GET /themes/1 GET /themes/1.json\n"],["show","UserOrgRolesController","UserOrgRolesController.html#method-i-show","()","

    GET /user_org_roles/1 GET /user_org_roles/1.json\n"],["show","UserRoleTypesController","UserRoleTypesController.html#method-i-show","()","

    GET /user_role_types/1 GET /user_role_types/1.json\n"],["show","UserStatusesController","UserStatusesController.html#method-i-show","()","

    GET /user_statuses/1 GET /user_statuses/1.json\n"],["show","UserTypesController","UserTypesController.html#method-i-show","()","

    GET /user_types/1 GET /user_types/1.json\n"],["show","UsersController","UsersController.html#method-i-show","()","

    GET /users/1 GET /users/1.json\n"],["status","Plan","Plan.html#method-i-status","()",""],["status","PlansController","PlansController.html#method-i-status","()","

    GET /status/1.json\n"],["store_location","ApplicationController","ApplicationController.html#method-i-store_location","()",""],["super_settings","Plan","Plan.html#method-i-super_settings","(key)",""],["template_owner","Project","Project.html#method-i-template_owner","()",""],["templates","OrganisationsController","OrganisationsController.html#method-i-templates","()",""],["templates_org_type","Dmptemplate","Dmptemplate.html#method-c-templates_org_type","(ot)",""],["title","Plan","Plan.html#method-i-title","()",""],["to_s","Comment","Comment.html#method-i-to_s","()",""],["to_s","Dmptemplate","Dmptemplate.html#method-i-to_s","()",""],["to_s","GuidanceGroup","GuidanceGroup.html#method-i-to_s","()",""],["to_s","Option","Option.html#method-i-to_s","()",""],["to_s","OptionWarning","OptionWarning.html#method-i-to_s","()",""],["to_s","Organisation","Org.html#method-i-to_s","()",""],["to_s","Phase","Phase.html#method-i-to_s","()",""],["to_s","Question","Question.html#method-i-to_s","()",""],["to_s","QuestionFormat","QuestionFormat.html#method-i-to_s","()",""],["to_s","Section","Section.html#method-i-to_s","()",""],["to_s","SuggestedAnswer","SuggestedAnswer.html#method-i-to_s","()",""],["to_s","Theme","Theme.html#method-i-to_s","()",""],["to_s","Version","Version.html#method-i-to_s","()",""],["unit_id","Project","Project.html#method-i-unit_id","()",""],["unit_id=","Project","Project.html#method-i-unit_id-3D","(new_unit_id)",""],["unlock_all_sections","Plan","Plan.html#method-i-unlock_all_sections","(user_id)",""],["unlock_all_sections","PlansController","PlansController.html#method-i-unlock_all_sections","()",""],["unlock_section","Plan","Plan.html#method-i-unlock_section","(section_id, user_id)",""],["unlock_section","PlansController","PlansController.html#method-i-unlock_section","()",""],["update","CommentsController","CommentsController.html#method-i-update","()","

    PUT /comments/1 PUT /comments/1.json\n"],["update","PlansController","PlansController.html#method-i-update","()","

    PUT /plans/1 PUT /plans/1.json\n"],["update","ProjectGroupsController","ProjectGroupsController.html#method-i-update","()",""],["update","ProjectsController","ProjectsController.html#method-i-update","()","

    PUT /projects/1 PUT /projects/1.json\n"],["update","RegistrationsController","RegistrationsController.html#method-i-update","()",""],["update","Settings::PlansController","Settings/PlansController.html#method-i-update","()",""],["update","Settings::ProjectsController","Settings/ProjectsController.html#method-i-update","()",""],["update","ThemesController","ThemesController.html#method-i-update","()","

    PUT /themes/1 PUT /themes/1.json\n"],["update","UserOrgRolesController","UserOrgRolesController.html#method-i-update","()","

    PUT /user_org_roles/1 PUT /user_org_roles/1.json\n"],["update","UserRoleTypesController","UserRoleTypesController.html#method-i-update","()","

    PUT /user_role_types/1 PUT /user_role_types/1.json\n"],["update","UserStatusesController","UserStatusesController.html#method-i-update","()","

    PUT /user_statuses/1 PUT /user_statuses/1.json\n"],["update","UserTypesController","UserTypesController.html#method-i-update","()","

    PUT /user_types/1 PUT /user_types/1.json\n"],["update","UsersController","UsersController.html#method-i-update","()","

    PUT /users/1 PUT /users/1.json\n"],["update_phases","GuidancesController","GuidancesController.html#method-i-update_phases","()","

    setup variables for use in the dynamic updating\n"],["update_questions","GuidancesController","GuidancesController.html#method-i-update_questions","()",""],["update_sections","GuidancesController","GuidancesController.html#method-i-update_sections","()",""],["update_versions","GuidancesController","GuidancesController.html#method-i-update_versions","()",""],["warning","Organisation","Org.html#method-i-warning","(option_id)",""],["warning","Plan","Plan.html#method-i-warning","(option_id)",""],["warning","PlansController","PlansController.html#method-i-warning","()",""],["README","","README_rdoc.html","","

    DMPonline v4\n

    DMPonline is the DCC's data management planning tool, available at\ndmponline.dcc.ac.uk …\n"]]}} \ No newline at end of file diff --git a/html/table_of_contents.html b/html/table_of_contents.html index 8d505d3..f6e52e3 100644 --- a/html/table_of_contents.html +++ b/html/table_of_contents.html @@ -160,7 +160,7 @@ OptionWarning

  • - Organisation + Organisation
  • OrganisationType @@ -292,9 +292,9 @@
  • ::new — Ability -
  • ::orgs_with_parent_of_type — Organisation +
  • ::orgs_with_parent_of_type — Organisation -
  • ::other_organisations — Organisation +
  • ::other_organisations — Organisation
  • ::own_institutional_templates — Dmptemplate @@ -414,9 +414,9 @@
  • #after_sign_up_path_for — ApplicationController -
  • #all_guidance_groups — Organisation +
  • #all_guidance_groups — Organisation -
  • #all_sections — Organisation +
  • #all_sections — Organisation
  • #answer — PlansController @@ -710,7 +710,7 @@
  • #project_name — ExportedPlan -
  • #published_templates — Organisation +
  • #published_templates — Organisation
  • #question_themes? — Question @@ -734,7 +734,7 @@
  • #roadmap — StaticPagesController -
  • #root — Organisation +
  • #root — Organisation
  • #sanitize_text — ExportedPlan @@ -764,7 +764,7 @@
  • #shibboleth — Users::OmniauthCallbacksController -
  • #short_name — Organisation +
  • #short_name — Organisation
  • #show — UserTypesController @@ -804,7 +804,7 @@
  • #to_s — Section -
  • #to_s — Organisation +
  • #to_s — Organisation
  • #to_s — SuggestedAnswer @@ -874,7 +874,7 @@
  • #warning — Plan -
  • #warning — Organisation +
  • #warning — Organisation
  • #warning — PlansController diff --git a/test/fixtures/templates.yml b/test/fixtures/templates.yml new file mode 100644 index 0000000..937a0c0 --- /dev/null +++ b/test/fixtures/templates.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/functional/organisations_controller_test.rb b/test/functional/organisations_controller_test.rb index c43d4f4..9518993 100644 --- a/test/functional/organisations_controller_test.rb +++ b/test/functional/organisations_controller_test.rb @@ -18,7 +18,7 @@ end test "should create organisation" do - assert_difference('Organisation.count') do + assert_difference('Org.count') do post :create, organisation: { abbreviation: @organisation.abbreviation, banner_file_id: @organisation.banner_file_id, description: @organisation.description, domain: @organisation.domain, logo_file_id: @organisation.logo_file_id, name: @organisation.name, stylesheet_file_id: @organisation.stylesheet_file_id, target_url: @organisation.target_url, type_id: @organisation.type_id, wayfless_entite: @organisation.wayfless_entite } end @@ -41,7 +41,7 @@ end test "should destroy organisation" do - assert_difference('Organisation.count', -1) do + assert_difference('Org.count', -1) do delete :destroy, id: @organisation end diff --git a/test/models/template_test.rb b/test/models/template_test.rb new file mode 100644 index 0000000..a8346d6 --- /dev/null +++ b/test/models/template_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TemplateTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/dmptemplate_test.rb b/test/unit/dmptemplate_test.rb index 595d984..805540a 100644 --- a/test/unit/dmptemplate_test.rb +++ b/test/unit/dmptemplate_test.rb @@ -228,7 +228,7 @@ # ---------- own_institutional_templates ---------- test "own_institutional_templates returns all templates belonging to given org_id" do - Organisation.find_each do |org| + Org.find_each do |org| result_templates = Dmptemplate.own_institutional_templates(org.id) org.dmptemplates.each do |template| assert_includes(result_templates, template, "Template: #{template.title} not returned by own_institutional_templates") @@ -238,7 +238,7 @@ # ---------- funders_and_own_templates ---------- test "funders_and_own_templates returns all funder and own given org_id templates" do - Organisation.find_each do |org| + Org.find_each do |org| result_templates = Dmptemplate.funders_and_own_templates(org.id) org.dmptemplates.each do |template| assert_includes(result_templates, template, "Template #{template.title} not returned by funders and own templates") diff --git a/test/unit/guidance_group_test.rb b/test/unit/guidance_group_test.rb index 1b7e6c8..c5b4716 100644 --- a/test/unit/guidance_group_test.rb +++ b/test/unit/guidance_group_test.rb @@ -9,7 +9,7 @@ @org_type = OrganisationType.first - @organisations = Organisation.all + @organisations = Org.all end # ---------- can_view? ---------- diff --git a/test/unit/guidance_test.rb b/test/unit/guidance_test.rb index 9091309..8157e60 100644 --- a/test/unit/guidance_test.rb +++ b/test/unit/guidance_test.rb @@ -9,7 +9,7 @@ @org_type = OrganisationType.first - @organisations = Organisation.all + @organisations = Org.all end # ---------- can_view? ---------- @@ -168,7 +168,7 @@ # ---------- by_organisation ---------- test "by_organisation correctly returns all guidance belonging to a given org" do =begin - Organisation.all.each do |org| + Org.all.each do |org| org_guidance = Guidance.by_organisation(org) org.guidance_groups.each do |group| group.guidances.each do |guidance| diff --git a/test/unit/organisation_test.rb b/test/unit/organisation_test.rb index d4fca37..4ef761a 100644 --- a/test/unit/organisation_test.rb +++ b/test/unit/organisation_test.rb @@ -10,7 +10,7 @@ # ---------- required fields are required ------------ test "required fields should be required" do - org = Organisation.new + org = Org.new assert_not(org.valid?) org.name = 'ABCD' @@ -86,7 +86,7 @@ # --------------------------------------------------- test "can CRUD" do - org = Organisation.create(name: 'testing') + org = Org.create(name: 'testing') assert_not org.id.nil?, "was expecting to be able to create a new Organisation: #{org.errors.map{|f, m| f.to_s + ' ' + m}.join(', ')}" org.abbreviation = 'TEST' diff --git a/test/unit/organisation_type_test.rb b/test/unit/organisation_type_test.rb index 31cccdc..95f968a 100644 --- a/test/unit/organisation_type_test.rb +++ b/test/unit/organisation_type_test.rb @@ -22,7 +22,7 @@ # --------------------------------------------------- test "can manage has_many relationship with Organisations" do - organisation = Organisation.new(name: 'test') + organisation = Org.new(name: 'test') verify_has_many_relationship(@organisation_type, organisation, @organisation_type.organisations.count) end diff --git a/test/unit/token_permission_type_test.rb b/test/unit/token_permission_type_test.rb index 6a1585b..c09aa85 100644 --- a/test/unit/token_permission_type_test.rb +++ b/test/unit/token_permission_type_test.rb @@ -32,7 +32,7 @@ # --------------------------------------------------- test "can manage has_many relationship with OrgTokenPermissions" do - org = Organisation.new(name: 'Testing') + org = Org.new(name: 'Testing') verify_has_many_relationship(@tpt, org, @tpt.organisations.count) end