diff --git a/public/html/Ability.html b/public/html/Ability.html deleted file mode 100644 index d808822..0000000 --- a/public/html/Ability.html +++ /dev/null @@ -1,388 +0,0 @@ - - - - - - -class Ability - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Ability

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Class Methods

- - -
- -
- new(user) - click to toggle source -
- - -
- - - - - -
-
# 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
-
- 
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/ActiveAdmin.html b/public/html/ActiveAdmin.html deleted file mode 100644 index aeb8dc4..0000000 --- a/public/html/ActiveAdmin.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - -module ActiveAdmin - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

module ActiveAdmin

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/ActiveAdmin/Views.html b/public/html/ActiveAdmin/Views.html deleted file mode 100644 index 8b4e4fe..0000000 --- a/public/html/ActiveAdmin/Views.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - -module ActiveAdmin::Views - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

module ActiveAdmin::Views

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/ActiveAdmin/Views/Pages.html b/public/html/ActiveAdmin/Views/Pages.html deleted file mode 100644 index cc0eccd..0000000 --- a/public/html/ActiveAdmin/Views/Pages.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - -module ActiveAdmin::Views::Pages - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

module ActiveAdmin::Views::Pages

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/ActiveAdmin/Views/Pages/Base.html b/public/html/ActiveAdmin/Views/Pages/Base.html deleted file mode 100644 index 0920d9a..0000000 --- a/public/html/ActiveAdmin/Views/Pages/Base.html +++ /dev/null @@ -1,331 +0,0 @@ - - - - - - -class ActiveAdmin::Views::Pages::Base - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class ActiveAdmin::Views::Pages::Base

- -
- -

lib/active_admin_views_pages_base.rb

- -
- - - - -
- - - - - - - - - - -
-

Private Instance Methods

- - - - - -
- -
- -
- - - - diff --git a/public/html/AdminUser.html b/public/html/AdminUser.html deleted file mode 100644 index 25177a0..0000000 --- a/public/html/AdminUser.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -class AdminUser - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class AdminUser

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/Answer.html b/public/html/Answer.html deleted file mode 100644 index 0693ae3..0000000 --- a/public/html/Answer.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -class Answer - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Answer

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/AnswersController.html b/public/html/AnswersController.html deleted file mode 100644 index b017bbd..0000000 --- a/public/html/AnswersController.html +++ /dev/null @@ -1,360 +0,0 @@ - - - - - - -class AnswersController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class AnswersController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- create() - click to toggle source -
- - -
- -

POST /answers POST /answers.json

- - - -
-
# File app/controllers/answers_controller.rb, line 5
-def create
-        @answer = Answer.new(params[:answer])
-        if (user_signed_in?) && @answer.plan.editable_by(current_user.id) then
-                old_answer = @answer.plan.answer(@answer.question_id, false)
-                proceed = false
-                @answer.text = params["answer-text-#{@answer.question_id}".to_sym]
-                if (old_answer.nil? && @answer.text != "") || ((!old_answer.nil?) && (old_answer.text != @answer.text)) then
-                        proceed = true
-                end
-    
-                if (@answer.question.question_format.title == I18n.t("helpers.checkbox") || 
-        @answer.question.question_format.title == I18n.t("helpers.multi_select_box") ||
-        @answer.question.question_format.title == I18n.t("helpers.radio_buttons") || 
-        @answer.question.question_format.title == I18n.t("helpers.dropdown")) then
-                        if (old_answer.nil? && @answer.option_ids.count > 0) || ((!old_answer.nil?) && (old_answer.option_ids - @answer.option_ids).count != 0 && (@answer.option_ids - old_answer.option_ids).count != 0) then
-                                proceed = true
-                        end
-                end
-                if proceed
-                        respond_to do |format|
-                                if @answer.save
-                                        format.html { redirect_to :back, status: :found, notice: 'Answer was successfully recorded.' }
-                                        format.json { render json: @answer, status: :created, location: @answer }
-                                else
-                                        format.html { redirect_to :back, notice: 'There was an error saving the answer.' }
-                                        format.json { render json: @answer.errors, status: :unprocessable_entity }
-                                end
-                        end
-                else
-                        respond_to do |format|
-                                format.html { redirect_to :back, notice: 'No change in answer content - not saved.' }
-                                format.json { render json: @answer.errors, status: :unprocessable_entity }
-                        end
-                end
-        else
-                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-        end
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/ApplicationController.html b/public/html/ApplicationController.html deleted file mode 100644 index 4e977fd..0000000 --- a/public/html/ApplicationController.html +++ /dev/null @@ -1,529 +0,0 @@ - - - - - - -class ApplicationController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class ApplicationController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- after_sign_in_error_path_for(resource) - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/application_controller.rb, line 32
-def after_sign_in_error_path_for(resource)
-  session[:previous_url] || root_path
-end
-
- -
- - - - -
- - -
- -
- after_sign_in_path_for(resource) - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/application_controller.rb, line 24
-def after_sign_in_path_for(resource)
-  session[:previous_url] || root_path
-end
-
- -
- - - - -
- - -
- -
- after_sign_up_error_path_for(resource) - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/application_controller.rb, line 36
-def after_sign_up_error_path_for(resource)
-  session[:previous_url] || root_path
-end
-
- -
- - - - -
- - -
- -
- after_sign_up_path_for(resource) - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/application_controller.rb, line 28
-def after_sign_up_path_for(resource)
-  session[:previous_url] || root_path
-end
-
- -
- - - - -
- - -
- -
- authenticate_admin!() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/application_controller.rb, line 40
-def authenticate_admin!
-        redirect_to root_path unless user_signed_in? && current_user.can_super_admin?
-end
-
- -
- - - - -
- - -
- -
- get_plan_list_columns() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/application_controller.rb, line 44
-def get_plan_list_columns
-        if user_signed_in?
-                @selected_columns = current_user.settings(:plan_list).columns
-                @all_columns = Settings::PlanList::ALL_COLUMNS
-        end
-end
-
- -
- - - - -
- - -
- -
- store_location() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/application_controller.rb, line 13
-def store_location
- # store last url - this is needed for post-login redirect to whatever the user last visited.
-
-        if (request.fullpath != "/users/sign_in" && \
-                request.fullpath != "/users/sign_up" && \
-                request.fullpath != "/users/password" && \
-    request.fullpath != "/users/sign_up?nosplash=true" && \
-                !request.xhr?) # don't store ajax calls
-
-          session[:previous_url] = request.fullpath 
-        end
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/ApplicationHelper.html b/public/html/ApplicationHelper.html deleted file mode 100644 index c5ea91c..0000000 --- a/public/html/ApplicationHelper.html +++ /dev/null @@ -1,453 +0,0 @@ - - - - - - -module ApplicationHelper - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

module ApplicationHelper

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- devise_mapping() - click to toggle source -
- - -
- - - - - -
-
# File app/helpers/application_helper.rb, line 10
-def devise_mapping
-        @devise_mapping ||= Devise.mappings[:user]
-end
-
- -
- - - - -
- - -
- -
- javascript(*files) - click to toggle source -
- - -
- - - - - -
-
# File app/helpers/application_helper.rb, line 14
-def javascript(*files)
-  content_for(:head) { javascript_include_tag(*files) }
-end
-
- -
- - - - -
- - - - - -
- -
- resource() - click to toggle source -
- - -
- - - - - -
-
# File app/helpers/application_helper.rb, line 6
-def resource
-        @resource ||= User.new
-end
-
- -
- - - - -
- - -
- -
- resource_name() - click to toggle source -
- - -
- - - - - -
-
# File app/helpers/application_helper.rb, line 2
-def resource_name
-        :user
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/Comment.html b/public/html/Comment.html deleted file mode 100644 index 9f7cf6b..0000000 --- a/public/html/Comment.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - -class Comment - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Comment

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- to_s() - click to toggle source -
- - -
- - - - - -
-
# File app/models/comment.rb, line 11
-def to_s
-    "#{text}"
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/CommentsController.html b/public/html/CommentsController.html deleted file mode 100644 index 7c5267e..0000000 --- a/public/html/CommentsController.html +++ /dev/null @@ -1,538 +0,0 @@ - - - - - - -class CommentsController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class CommentsController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- archive() - click to toggle source -
- - -
- -

ARCHIVE /comments/1 ARCHIVE /comments/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- create() - click to toggle source -
- - -
- -

POST /comments POST /comments.json

- - - -
-
# 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    
-end
-
- -
- - - - -
- - -
- -
- edit() - click to toggle source -
- - -
- -

GET /comments/1/edit

- - - -
-
# File app/controllers/comments_controller.rb, line 26
-def edit
-  @comment = Comment.find(params[:id])
-end
-
- -
- - - - -
- - -
- -
- index() - click to toggle source -
- - -
- -

GET /comments GET /comments.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- show() - click to toggle source -
- - -
- -

GET /comments/1 GET /comments/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- update() - click to toggle source -
- - -
- -

PUT /comments/1 PUT /comments/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/ConfirmationsController.html b/public/html/ConfirmationsController.html deleted file mode 100644 index 11e2609..0000000 --- a/public/html/ConfirmationsController.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - -class ConfirmationsController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class ConfirmationsController

- -
- -
- - - - -
- - - - - - - - - - -
-

Protected Instance Methods

- - -
- -
- after_confirmation_path_for(resource_name, resource) - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/confirmations_controller.rb, line 5
-def after_confirmation_path_for(resource_name, resource)
-  root_path
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/ContactsController.html b/public/html/ContactsController.html deleted file mode 100644 index 5cbc8c6..0000000 --- a/public/html/ContactsController.html +++ /dev/null @@ -1,350 +0,0 @@ - - - - - - -class ContactsController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class ContactsController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- create() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/contacts_controller.rb, line 2
-def create
-        @contact = ContactUs::Contact.new(params[:contact_us_contact])
-        if (!user_signed_in?)
-                if verify_recaptcha(:message => "You have not added the validation words correctly") && @contact.save
-                        flash[:notice] = t('contact_us.notices.success')
-                        if user_signed_in? then
-                             redirect_to :controller => 'projects', :action => 'index'
-                     else
-                             redirect_to(root_path)
-                     end
-                else
-                     flash[:alert]  = t('contact_us.notices.error')
-                     render_new_page
-                end
-        else
-                if @contact.save
-                        flash[:notice] = t('contact_us.notices.success')
-                        if user_signed_in? then
-                             redirect_to :controller => 'projects', :action => 'index'
-                     else
-                             redirect_to(root_path)
-                     end
-                else
-                     flash[:alert] = t('contact_us.notices.error')
-                     render_new_page
-                end
-        end           
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/CustomFailure.html b/public/html/CustomFailure.html deleted file mode 100644 index 00e20d5..0000000 --- a/public/html/CustomFailure.html +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - -class CustomFailure - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class CustomFailure

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- redirect_url() - click to toggle source -
- - -
- - - - - -
-
# File lib/custom_failure.rb, line 2
-def redirect_url
-  root_path
-end
-
- -
- - - - -
- - -
- -
- respond() - click to toggle source -
- - -
- - - - - -
-
# File lib/custom_failure.rb, line 6
-def respond
-  if http_auth?
-    http_auth
-  else
-    redirect
-  end
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/DMPonline4.html b/public/html/DMPonline4.html deleted file mode 100644 index 299d664..0000000 --- a/public/html/DMPonline4.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - - -module DMPonline4 - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

module DMPonline4

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/DMPonline4/Application.html b/public/html/DMPonline4/Application.html deleted file mode 100644 index 35ca2cd..0000000 --- a/public/html/DMPonline4/Application.html +++ /dev/null @@ -1,280 +0,0 @@ - - - - - - -class DMPonline4::Application - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class DMPonline4::Application

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/Dmptemplate.html b/public/html/Dmptemplate.html deleted file mode 100644 index 3de2e67..0000000 --- a/public/html/Dmptemplate.html +++ /dev/null @@ -1,602 +0,0 @@ - - - - - - -class Dmptemplate - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Dmptemplate

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Class Methods

- - -
- -
- funders_and_own_templates(org_id) - click to toggle source -
- - -
- -

returns an array with all funders and own institutional templates

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- funders_templates() - click to toggle source -
- - -
- -

returns all funders templates

- - - -
-
# 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        
-    end
-
- -
- - - - -
- - -
- -
- own_institutional_templates(org_id) - click to toggle source -
- - -
- -

returns all institutional templates bellowing to the current user's org

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- templates_org_type(ot) - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
-

Public Instance Methods

- - -
- -
- has_customisations?(org_id, temp) - click to toggle source -
- - -
- -

verify if a template has customisation by current user's org

- - - -
-
# 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   
-end
-
- -
- - - - -
- - -
- -
- has_published_versions?() - click to toggle source -
- - -
- -

verify if there are any publish version for the template

- - - -
-
# 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 
-end
-
- -
- - - - -
- - -
- -
- org_type() - click to toggle source -
- - -
- - - - - -
-
# File app/models/dmptemplate.rb, line 82
-def org_type
-        org_type = organisation.organisation_type.name
-        return org_type
-end
-
- -
- - - - -
- - -
- -
- to_s() - click to toggle source -
- - -
- - - - - -
-
# File app/models/dmptemplate.rb, line 28
-def to_s
-  "#{title}"
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/DmptemplatesController.html b/public/html/DmptemplatesController.html deleted file mode 100644 index f4c7d37..0000000 --- a/public/html/DmptemplatesController.html +++ /dev/null @@ -1,1427 +0,0 @@ - - - - - - -class DmptemplatesController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class DmptemplatesController

- -
-
Project: -
-

DMPonline v4

-
Description: -
-

This controller is responsible for all the actions in the admin interface -under templates (e.g. phases, versions, sections, questions, suggested -answer) (index; show; create; edit; delete)

-
Copyright: -
-

Digital Curation Centre

-
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- admin_addphase() - click to toggle source -
- - -
- -

add a new phase to a template

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 187
-def admin_addphase
-        if user_signed_in? && current_user.can_org_admin? then
-                @dmptemplate = Dmptemplate.find(params[:id])
-                @phase = Phase.new
-                if @dmptemplate.phases.count == 0 then
-                        @phase.number = '1'
-                else
-                        @phase.number = @dmptemplate.phases.count + 1
-                end
-
-                respond_to do |format|
-      format.html
-    end
-        end
-end
-
- -
- - - - -
- - -
- -
- admin_cloneversion() - click to toggle source -
- - -
- -

clone a version of a template

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 293
-def admin_cloneversion
-        if user_signed_in? && current_user.can_org_admin? then
-@old_version = Version.find(params[:version_id])
-                @version = @old_version.amoeba_dup
-                @phase = @version.phase
-
-    respond_to do |format|
-      if @version.save
-        format.html { redirect_to admin_phase_dmptemplate_path(@phase, :version_id => @version.id, :edit => 'true'), notice: I18n.t('org_admin.templates.updated_message') }
-        format.json { head :no_content }
-      else
-        format.html { render action: "admin_phase" }
-        format.json { render json: @version.errors, status: :unprocessable_entity }
-      end
-    end
-        end
-end
-
- -
- - - - -
- - -
- -
- admin_create() - click to toggle source -
- - -
- -

POST /dmptemplates POST /dmptemplates.json

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 81
-def admin_create
-  if user_signed_in? && current_user.can_org_admin? then
-          @dmptemplate = Dmptemplate.new(params[:dmptemplate])
-          @dmptemplate.organisation_id = current_user.organisation.id
-          @dmptemplate.description = params['template-desc']
-
-          respond_to do |format|
-            if @dmptemplate.save
-              format.html { redirect_to admin_template_dmptemplate_path(@dmptemplate), notice: I18n.t('org_admin.templates.created_message') }
-              format.json { render json: @dmptemplate, status: :created, location: @dmptemplate }
-            else
-              format.html { render action: "admin_new" }
-              format.json { render json: @dmptemplate.errors, status: :unprocessable_entity }
-            end
-          end
-  else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-              end
-end
-
- -
- - - - -
- - -
- -
- admin_createphase() - click to toggle source -
- - -
- -

create a phase

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 204
-      def admin_createphase
-  if user_signed_in? && current_user.can_org_admin? then
-             @phase = Phase.new(params[:phase])
-          @phase.description = params["phase-desc"]
-          @version = @phase.versions.build
-          @version.title = "#{@phase.title} v.1"
-          @version.phase_id = @phase.id
-          @version.number = 1
-          @version.published = false
-
-          respond_to do |format|
-            if @phase.save
-              format.html { redirect_to admin_phase_dmptemplate_path(:id => @phase.id, :version_id => @version.id, :edit => 'true'), notice: I18n.t('org_admin.templates.created_message') }
-              format.json { head :no_content }
-            else
-              format.html { render action: "admin_phase" }
-              format.json { render json: @phase.errors, status: :unprocessable_entity }
-            end
-                      end
-              end
-end
-
- -
- - - - -
- - -
- -
- admin_createquestion() - click to toggle source -
- - -
- -

create a question

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 386
-      def admin_createquestion
-  if user_signed_in? && current_user.can_org_admin? then
-             @question = Question.new(params[:question])
-          @question.guidance = params["new-question-guidance"]
-          @question.default_value = params["new-question-default-value"]
-
-
-          respond_to do |format|
-            if @question.save
-              format.html { redirect_to admin_phase_dmptemplate_path(:id => @question.section.version.phase_id, :version_id => @question.section.version_id, :section_id => @question.section_id, :question_id => @question.id, :edit => 'true'), notice: I18n.t('org_admin.templates.created_message') }
-              format.json { head :no_content }
-            else
-              format.html { render action: "admin_phase" }
-              format.json { render json: @question.errors, status: :unprocessable_entity }
-            end
-                      end
-              end
-end
-
- -
- - - - -
- - -
- -
- admin_createsection() - click to toggle source -
- - -
- -

create a section

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 328
-      def admin_createsection
-  if user_signed_in? && current_user.can_org_admin? then
-             @section = Section.new(params[:section])
-          @section.description = params["section-desc"]
-
-          respond_to do |format|
-            if @section.save
-              format.html { redirect_to admin_phase_dmptemplate_path(:id => @section.version.phase_id, :version_id => @section.version_id, :section_id => @section.id, :edit => 'true'), notice: I18n.t('org_admin.templates.created_message') }
-              format.json { head :no_content }
-            else
-              format.html { render action: "admin_phase" }
-              format.json { render json: @section.errors, status: :unprocessable_entity }
-            end
-                      end
-              end
-end
-
- -
- - - - -
- - -
- -
- admin_createsuggestedanswer() - click to toggle source -
- - -
- -

SUGGESTED ANSWERS create suggested answers

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 446
-   def admin_createsuggestedanswer
-   if user_signed_in? && current_user.can_org_admin? then
-           @suggested_answer = SuggestedAnswer.new(params[:suggested_answer])
-
-       respond_to do |format|
-         if @suggested_answer.save
-           format.html { redirect_to admin_phase_dmptemplate_path(:id => @suggested_answer.question.section.version.phase_id, :version_id => @suggested_answer.question.section.version_id, :section_id => @suggested_answer.question.section_id, :question_id => @suggested_answer.question.id, :edit => 'true'), notice: I18n.t('org_admin.templates.created_message') }
-           format.json { head :no_content }
-         else
-           format.html { render action: "admin_phase" }
-           format.json { render json: @suggested_answer.errors, status: :unprocessable_entity }
-         end
-           end
-    end
-end
-
- -
- - - - -
- - -
- -
- admin_destroy() - click to toggle source -
- - -
- -

DELETE /dmptemplates/1 DELETE /dmptemplates/1.json

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 105
-def admin_destroy
-      if user_signed_in? && current_user.can_org_admin? then
-             @dmptemplate = Dmptemplate.find(params[:id])
-          @dmptemplate.destroy
-
-          respond_to do |format|
-            format.html { redirect_to admin_index_dmptemplate_path }
-            format.json { head :no_content }
-          end
-             else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-              end
-      end
-
- -
- - - - -
- - -
- -
- admin_destroyphase() - click to toggle source -
- - -
- -

delete a version, sections and questions

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 246
-def admin_destroyphase
-if user_signed_in? && current_user.can_org_admin? then
-       @phase = Phase.find(params[:phase_id])
-       @dmptemplate = @phase.dmptemplate
-    @phase.destroy
-
-    respond_to do |format|
-      format.html { redirect_to admin_template_dmptemplate_path(@dmptemplate), notice: I18n.t('org_admin.templates.destroyed_message') }
-      format.json { head :no_content }
-    end
-       end
-end
-
- -
- - - - -
- - -
- -
- admin_destroyquestion() - click to toggle source -
- - -
- -

delete a version, sections and questions

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 428
-def admin_destroyquestion
-if user_signed_in? && current_user.can_org_admin? then
-       @question = Question.find(params[:question_id])
-       @section = @question.section
-                @version = @section.version
-       @phase = @version.phase
-    @question.destroy
-
-    respond_to do |format|
-      format.html { redirect_to admin_phase_dmptemplate_path(:id => @phase.id, :version_id => @version.id, :section_id => @section.id, :edit => 'true'), notice: I18n.t('org_admin.templates.destroyed_message') }
-      format.json { head :no_content }
-    end
-       end
-end
-
- -
- - - - -
- - -
- -
- admin_destroysection() - click to toggle source -
- - -
- -

delete a section and questions

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 368
-def admin_destroysection
-if user_signed_in? && current_user.can_org_admin? then
-       @section = Section.find(params[:section_id])
-       @version = @section.version
-       @phase = @version.phase
-    @section.destroy
-
-    respond_to do |format|
-      format.html { redirect_to admin_phase_dmptemplate_path(:id => @phase.id, :version_id => @version.id,  :edit => 'true' ), notice: I18n.t('org_admin.templates.destroyed_message') }
-      format.json { head :no_content }
-    end
-       end
-end
-
- -
- - - - -
- - -
- -
- admin_destroysuggestedanswer() - click to toggle source -
- - -
- -

delete a suggested answer

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 484
-def admin_destroysuggestedanswer
-if user_signed_in? && current_user.can_org_admin? then
-       @suggested_answer = SuggestedAnswer.find(params[:suggested_answer])
-       @question = @suggested_answer.question
-       @section = @question.section
-                @version = @section.version
-       @phase = @version.phase
-    @suggested_answer.destroy
-
-    respond_to do |format|
-      format.html { redirect_to admin_phase_dmptemplate_path(:id => @phase.id, :version_id => @version.id, :section_id => @section.id, :edit => 'true'), notice: I18n.t('org_admin.templates.destroyed_message') }
-      format.json { head :no_content }
-    end
-       end
-end
-
- -
- - - - -
- - -
- -
- admin_destroyversion() - click to toggle source -
- - -
- -

delete a version, sections and questions

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 312
-def admin_destroyversion
-if user_signed_in? && current_user.can_org_admin? then
-       @version = Version.find(params[:version_id])
-       @phase = @version.phase
-    @version.destroy
-
-    respond_to do |format|
-      format.html { redirect_to admin_phase_dmptemplate_path(@phase), notice: I18n.t('org_admin.templates.destroyed_message') }
-      format.json { head :no_content }
-    end
-       end
-end
-
- -
- - - - -
- - -
- -
- admin_index() - click to toggle source -
- - -
- -

GET /dmptemplates GET /dmptemplates.json

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 9
-def admin_index
-  if user_signed_in? && current_user.can_org_admin? then
-      #institutional templates
-
-          @dmptemplates_own = Dmptemplate.own_institutional_templates(current_user.organisation_id)
-
-          #funders templates
-
-          @dmptemplates_funders = Dmptemplate.funders_templates
-
-   respond_to do |format|
-            format.html # index.html.erb
-
-         end
-  else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-              end
-end
-
- -
- - - - -
- - -
- -
- admin_new() - click to toggle source -
- - -
- -

GET /dmptemplates/new GET /dmptemplates/new.json

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 66
-def admin_new
-  if user_signed_in? && current_user.can_org_admin? then
-          @dmptemplate = Dmptemplate.new
-
-          respond_to do |format|
-            format.html # new.html.erb
-
-            format.json { render json: @dmptemplate }
-          end
-  else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-              end
-end
-
- -
- - - - -
- - -
- -
- admin_phase() - click to toggle source -
- - -
- -

show and edit a phase of the template

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 124
-def admin_phase
-        if user_signed_in? && current_user.can_org_admin? then
-
-                @phase = Phase.find(params[:id])
-
-                if !params.has_key?(:version_id) then
-                        @edit = 'false'
-                        #check for the most recent published version, if none is available then return the most recent one
-
-                        versions = @phase.versions.where('published = ?', true).order('updated_at DESC')
-                        if versions.any?() then
-                                @version = versions.first
-                        else
-                                @version = @phase.versions.order('updated_at DESC').first
-                        end
-                        # When the version_id is passed as an argument
-
-                else
-                        @edit = params[:edit]
-                        @version = Version.find(params[:version_id])
-                end
-
-                #verify if there are any sections if not create one
-
-                @sections = @version.sections
-                if !@sections.any?() || @sections.count == 0 then
-                        @section = @version.sections.build
-                        @section.title = ''
-                        @section.version_id = params[:version_id]
-                        @section.number = 1
-                        @section.organisation_id = current_user.organisation.id
-                        @section.published = true
-                        @section.save
-                end
-
-                #verify if section_id has been passed, if so then open that section
-
-                if params.has_key?(:section_id) then
-                        @open = true
-                        @section_id = params[:section_id].to_i
-                end
-
-                if params.has_key?(:question_id) then
-                        @question_id = params[:question_id].to_i
-                end
-
-                respond_to do |format|
-                        format.html
-                end
-        end
-end
-
- -
- - - - -
- - -
- -
- admin_previewphase() - click to toggle source -
- - -
- -

preview a phase

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 173
-def admin_previewphase
-        if user_signed_in? && current_user.can_org_admin? then
-                
-                @version = Version.find(params[:id])
-                
-                        
-                respond_to do |format|
-                        format.html
-                end
-        end   
-end
-
- -
- - - - -
- - -
- -
- admin_template() - click to toggle source -
- - -
- -

GET /dmptemplates/1 GET /dmptemplates/1.json

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 27
-def admin_template
-  if user_signed_in? && current_user.can_org_admin? then
-          @dmptemplate = Dmptemplate.find(params[:id])
-
-          respond_to do |format|
-            format.html # show.html.erb
-
-            format.json { render json: @dmptemplate }
-          end
-  else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-              end
-end
-
- -
- - - - -
- - -
- -
- admin_update() - click to toggle source -
- - -
- -

PUT /dmptemplates/1 PUT /dmptemplates/1.json

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 44
-def admin_update
-      if user_signed_in? && current_user.can_org_admin? then
-              @dmptemplate = Dmptemplate.find(params[:id])
-              @dmptemplate.description = params["template-desc"]
-
-                respond_to do |format|
-            if @dmptemplate.update_attributes(params[:dmptemplate])
-              format.html { redirect_to admin_template_dmptemplate_path(params[:dmptemplate]), notice: I18n.t('org_admin.templates.updated_message') }
-              format.json { head :no_content }
-            else
-              format.html { render action: "edit" }
-              format.json { render json: @dmptemplate.errors, status: :unprocessable_entity }
-            end
-             end
-      else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-      end
-end
-
- -
- - - - -
- - -
- -
- admin_updatephase() - click to toggle source -
- - -
- -

update a phase of a template

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 228
-def admin_updatephase
-        if user_signed_in? && current_user.can_org_admin? then
-        @phase = Phase.find(params[:id])
-        @phase.description = params["phase-desc"]
-
-    respond_to do |format|
-      if @phase.update_attributes(params[:phase])
-        format.html { redirect_to admin_phase_dmptemplate_path(@phase), notice: I18n.t('org_admin.templates.updated_message') }
-        format.json { head :no_content }
-      else
-        format.html { render action: "admin_phase" }
-        format.json { render json: @phase.errors, status: :unprocessable_entity }
-      end
-    end
-        end
-end
-
- -
- - - - -
- - -
- -
- admin_updatequestion() - click to toggle source -
- - -
- -

update a question of a template

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 406
-def admin_updatequestion
-        if user_signed_in? && current_user.can_org_admin? then
-               @question = Question.find(params[:id])
-                        @question.guidance = params["question-guidance-#{params[:id]}"]
-                        @question.default_value = params["question-default-value-#{params[:id]}"]
-       @section = @question.section
-                        @version = @section.version
-                        @phase = @version.phase
-
-                        respond_to do |format|
-              if @question.update_attributes(params[:question])
-                format.html { redirect_to admin_phase_dmptemplate_path(:id => @phase.id, :version_id => @version.id, :section_id => @section.id, :question_id => @question.id, :edit => 'true'), notice: I18n.t('org_admin.templates.updated_message') }
-                format.json { head :no_content }
-              else
-                format.html { render action: "admin_phase" }
-                format.json { render json: @question.errors, status: :unprocessable_entity }
-              end
-            end
-                end
-        end
-
- -
- - - - -
- - -
- -
- admin_updatesection() - click to toggle source -
- - -
- -

update a section of a template

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 347
-def admin_updatesection
-        if user_signed_in? && current_user.can_org_admin? then
-               @section = Section.find(params[:id])
-               @section.description = params["section-desc-#{params[:id]}"]
-       @version = @section.version
-                        @phase = @version.phase
-
-                        respond_to do |format|
-              if @section.update_attributes(params[:section])
-                format.html { redirect_to admin_phase_dmptemplate_path(:id => @phase.id, :version_id => @version.id, :section_id => @section.id , :edit => 'true'), notice: I18n.t('org_admin.templates.updated_message') }
-                format.json { head :no_content }
-              else
-                format.html { render action: "admin_phase" }
-                format.json { render json: @section.errors, status: :unprocessable_entity }
-              end
-            end
-                end
-end
-
- -
- - - - -
- - -
- -
- admin_updatesuggestedanswer() - click to toggle source -
- - -
- -

update a suggested answer of a template

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 463
-def admin_updatesuggestedanswer
-        if user_signed_in? && current_user.can_org_admin? then
-               @suggested_answer = SuggestedAnswer.find(params[:id])
-    @question = @suggested_answer.question
-    @section = @question.section
-    @version = @section.version
-    @phase = @version.phase
-
-                        respond_to do |format|
-              if @suggested_answer.update_attributes(params[:suggested_answer])
-                format.html { redirect_to admin_phase_dmptemplate_path(:id => @phase.id, :version_id => @version.id, :section_id => @section.id, :question_id => @question.id, :edit => 'true'), notice: I18n.t('org_admin.templates.updated_message') }
-                format.json { head :no_content }
-              else
-                format.html { render action: "admin_phase" }
-                format.json { render json: @suggested_answer.errors, status: :unprocessable_entity }
-              end
-            end
-                end
-        end
-
- -
- - - - -
- - -
- -
- admin_updateversion() - click to toggle source -
- - -
- -

update a version of a template

- - - -
-
# File app/controllers/dmptemplates_controller.rb, line 262
-def admin_updateversion
-        if user_signed_in? && current_user.can_org_admin? then
-               @version = Version.find(params[:id])
-    @version.description = params["version-desc"]
-    @phase = @version.phase
-
-    if @version.published && !@phase.dmptemplate.published then
-        @phase.dmptemplate.published = true
-    end
-    
-    @all_versions = @phase.versions.where('published = ?', true)
-    @all_versions.each do |v|
-        if v.id != @version.id && v.published == true then
-            v.published = false
-            v.save
-        end
-    end
-
-            respond_to do |format|
-              if @version.update_attributes(params[:version])
-                format.html { redirect_to admin_phase_dmptemplate_path(@phase, :version_id =>  @version.id, :edit => 'false'), notice: I18n.t('org_admin.templates.updated_message') }
-                format.json { head :no_content }
-              else
-                format.html { render action: "admin_phase" }
-                format.json { render json: @version.errors, status: :unprocessable_entity }
-              end
-            end
-                end
-        end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/ExistingUsersController.html b/public/html/ExistingUsersController.html deleted file mode 100644 index a3baca4..0000000 --- a/public/html/ExistingUsersController.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - -class ExistingUsersController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class ExistingUsersController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- index() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/existing_users_controller.rb, line 2
-def index
-        @email = params[:email]
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/ExportedPlan.html b/public/html/ExportedPlan.html deleted file mode 100644 index e7911e1..0000000 --- a/public/html/ExportedPlan.html +++ /dev/null @@ -1,846 +0,0 @@ - - - - - - -class ExportedPlan - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class ExportedPlan

- -
- -
- - - - -
- - - - - - -
-

Constants

-
- -
VALID_FORMATS - -
- - -
-
- - - - - - -
-

Public Instance Methods

- - -
- -
- admin_details() - click to toggle source -
- - -
- - - - - -
-
# File app/models/exported_plan.rb, line 71
-def admin_details
-  @admin_details ||= self.settings(:export).fields[:admin]
-end
-
- -
- - - - -
- - -
- -
- as_csv() - click to toggle source -
- - -
- -

Export formats

- - - -
-
# File app/models/exported_plan.rb, line 77
-def as_csv
-  CSV.generate do |csv|
-    csv << ["Section","Question","Answer","Selected option(s)","Answered by","Answered at"]
-    self.sections.each do |section|
-      self.questions_for_section(section).each do |question|
-        answer = self.plan.answer(question.id)
-        options_string = answer.options.collect {|o| o.text}.join('; ')
-
-        csv << [section.title, question.text, sanitize_text(answer.text), options_string, answer.try(:user).try(:name), answer.created_at]
-      end
-    end
-  end
-end
-
- -
- - - - -
- - -
- -
- as_txt() - click to toggle source -
- - -
- - - - - -
-
# File app/models/exported_plan.rb, line 91
-def as_txt
-  output = "#{self.plan.project.title}\n\n#{self.plan.version.phase.title}\n"
-
-  self.sections.each do |section|
-    output += "\n#{section.title}\n"
-
-    self.questions_for_section(section).each do |question|
-      output += "\n#{question.text}\n"
-      answer = self.plan.answer(question.id, false)
-
-      if answer.nil? || answer.text.nil? then
-        output += "Question not answered.\n"
-      else
-        output += answer.options.collect {|o| o.text}.join("\n")
-        if question.option_comment_display == true then
-          output += "\n#{sanitize_text(answer.text)}\n"
-        else
-          output += "\n"
-        end  
-      end
-    end
-  end
-
-  output
-end
-
- -
- - - - -
- - -
- -
- funder() - click to toggle source -
- - -
- - - - - -
-
# File app/models/exported_plan.rb, line 46
-def funder
-  org = self.plan.project.dmptemplate.try(:organisation)
-  org.name if org.present? && org.organisation_type.try(:name) == I18n.t('helpers.org_type.funder')
-end
-
- -
- - - - -
- - -
- -
- grant_title() - click to toggle source -
- - -
- - - - - -
-
# File app/models/exported_plan.rb, line 30
-def grant_title
-  self.plan.project.grant_number
-end
-
- -
- - - - -
- - -
- -
- institution() - click to toggle source -
- - -
- - - - - -
-
# File app/models/exported_plan.rb, line 51
-def institution
-  plan.project.organisation.try(:name)
-end
-
- -
- - - - -
- - -
- -
- principal_investigator() - click to toggle source -
- - -
- - - - - -
-
# File app/models/exported_plan.rb, line 34
-def principal_investigator
-  self.plan.project.principal_investigator
-end
-
- -
- - - - -
- - -
- -
- project_data_contact() - click to toggle source -
- - -
- - - - - -
-
# File app/models/exported_plan.rb, line 38
-def project_data_contact
-  self.plan.project.data_contact
-end
-
- -
- - - - -
- - -
- -
- project_description() - click to toggle source -
- - -
- - - - - -
-
# File app/models/exported_plan.rb, line 42
-def project_description
-  self.plan.project.description
-end
-
- -
- - - - -
- - -
- -
- project_identifier() - click to toggle source -
- - -
- - - - - -
-
# File app/models/exported_plan.rb, line 26
-def project_identifier
-  self.plan.project.identifier
-end
-
- -
- - - - -
- - -
- -
- project_name() - click to toggle source -
- - -
- -

Getters to match Settings::Dmptemplate::VALID_ADMIN_FIELDS

- - - -
-
# File app/models/exported_plan.rb, line 20
-def project_name
-  name = self.plan.project.title
-  name += " - #{self.plan.title}" if self.plan.project.dmptemplate.phases.count > 1
-  name
-end
-
- -
- - - - -
- - -
- -
- questions_for_section(section_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/exported_plan.rb, line 67
-def questions_for_section(section_id)
-  questions.where(section_id: section_id)
-end
-
- -
- - - - -
- - -
- -
- sections() - click to toggle source -
- - -
- -

sections taken from fields settings

- - - -
-
# File app/models/exported_plan.rb, line 56
-def sections
-  sections = self.plan.sections
-
-  return [] if questions.empty?
-
-  section_ids = questions.pluck(:section_id).uniq
-  sections = sections.select {|section| section_ids.member?(section.id) }
-
-  sections.sort_by(&:number)
-end
-
- -
- - - - -
- - -
- -
-

Private Instance Methods

- - -
- -
- questions() - click to toggle source -
- - -
- - - - - -
-
# File app/models/exported_plan.rb, line 119
-def questions
-  @questions ||= begin
-    question_settings = self.settings(:export).fields[:questions]
-
-    return [] if question_settings.is_a?(Array) && question_settings.empty?
-
-    questions = if question_settings.present? && question_settings != :all
-      Question.where(id: question_settings)
-    else
-      Question.where(section_id: self.plan.sections.collect {|s| s.id })
-    end
-
-    questions.order(:number)
-  end
-end
-
- -
- - - - -
- - -
- -
- sanitize_text(text) - click to toggle source -
- - -
- - - - - -
-
# File app/models/exported_plan.rb, line 135
-def sanitize_text(text)
-  if (!text.nil?) then ActionView::Base.full_sanitizer.sanitize(text.gsub(/&nbsp;/,"")) end
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/FileType.html b/public/html/FileType.html deleted file mode 100644 index 749a3b5..0000000 --- a/public/html/FileType.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -class FileType - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class FileType

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/FileUpload.html b/public/html/FileUpload.html deleted file mode 100644 index a91679c..0000000 --- a/public/html/FileUpload.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -class FileUpload - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class FileUpload

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/Guidance.html b/public/html/Guidance.html deleted file mode 100644 index f65c3d8..0000000 --- a/public/html/Guidance.html +++ /dev/null @@ -1,426 +0,0 @@ - - - - - - -class Guidance - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Guidance

- -
-
Project: -
-

DMPonline v4

-
Description: -
-

This class keeps the information organisations enter to support users when -answering questions. It always belongs to a guidance group class and it -can be linked directly to a question or through one or more themes

-
Created: -
-

07/07/2014

-
Copyright: -
-

Digital Curation Centre

-
- -
- - - - -
- - - - - - - - - - -
-

Public Class Methods

- - -
- -
- by_organisation(org_id) - click to toggle source -
- - -
- -

all guidance that belong to an organisation

- - - -
-
# File app/models/guidance.rb, line 40
-def self.by_organisation(org_id)
-        all_guidance = Guidance.all
-        org_guidance = Array.new
-    
-        all_guidance.each do |guidance|
-           if guidance.in_group_belonging_to?(org_id) then
-                        org_guidance << guidance
-           end
-        end
-        
-        return org_guidance
-        
-end
-
- -
- - - - -
- - -
- -
-

Public Instance Methods

- - -
- -
- get_guidance_group_templates?(guidance_group) - click to toggle source -
- - -
- - - - - -
-
# File app/models/guidance.rb, line 55
-def get_guidance_group_templates? (guidance_group)
-                templates = guidancegroups.where("guidance_group_id (?)", guidance_group.id).template 
-                return templates
-        end
-
- -
- - - - -
- - -
- -
- in_group_belonging_to?(organisation_id) - click to toggle source -
- - -
- -

verifies if one guidance belongs to a org

- - - -
-
# File app/models/guidance.rb, line 29
-def in_group_belonging_to?(organisation_id)
-        guidance_groups.each do |guidance_group|
-                if guidance_group.organisation_id == organisation_id then
-                        return true
-                end
-        end
-        return false
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/GuidanceGroup.html b/public/html/GuidanceGroup.html deleted file mode 100644 index 0907393..0000000 --- a/public/html/GuidanceGroup.html +++ /dev/null @@ -1,404 +0,0 @@ - - - - - - -class GuidanceGroup - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class GuidanceGroup

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Class Methods

- - -
- -
- guidance_groups_excluding(excluded_orgs) - click to toggle source -
- - -
- - - - - -
-
# File app/models/guidance_group.rb, line 28
-def self.guidance_groups_excluding(excluded_orgs)
-        excluded_org_ids = Array.new
-        excluded_orgs.each do |org|
-                excluded_org_ids << org.id
-        end
-        return_orgs =  GuidanceGroup.where("organisation_id NOT IN (?)", excluded_org_ids)
-        return return_orgs
-end
-
- -
- - - - -
- - -
- -
-

Public Instance Methods

- - -
- -
- display_name() - click to toggle source -
- - -
- - - - - -
-
# File app/models/guidance_group.rb, line 20
-def display_name
-        if organisation.guidance_groups.count > 1
-                return "#{organisation.name}: #{name}"
-        else
-                return organisation.name
-        end
-end
-
- -
- - - - -
- - -
- -
- to_s() - click to toggle source -
- - -
- - - - - -
-
# File app/models/guidance_group.rb, line 16
-def to_s
-        "#{display_name}"
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/GuidanceGroupsController.html b/public/html/GuidanceGroupsController.html deleted file mode 100644 index 7283e1a..0000000 --- a/public/html/GuidanceGroupsController.html +++ /dev/null @@ -1,547 +0,0 @@ - - - - - - -class GuidanceGroupsController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class GuidanceGroupsController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- admin_create() - click to toggle source -
- - -
- -

POST /guidance_groups POST /guidance_groups.json

- - - -
-
# File app/controllers/guidance_groups_controller.rb, line 34
-def admin_create
-  if user_signed_in? && current_user.can_org_admin? then
-          @guidance_group = GuidanceGroup.new(params[:guidance_group])
-          @guidance_group.organisation_id = current_user.organisation_id
-      
-          respond_to do |format|
-            if @guidance_group.save
-              format.html { redirect_to admin_index_guidance_path, notice: I18n.t('org_admin.guidance_group.created_message') }
-              format.json { render json: @guidance_group, status: :created, location: @guidance_group }
-            else
-              format.html { render action: "new" }
-              format.json { render json: @guidance_group.errors, status: :unprocessable_entity }
-            end
-          end
-  else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-              end 
-end
-
- -
- - - - -
- - -
- -
- admin_destroy() - click to toggle source -
- - -
- -

DELETE /guidance_groups/1 DELETE /guidance_groups/1.json

- - - -
-
# File app/controllers/guidance_groups_controller.rb, line 87
-def admin_destroy
-      if user_signed_in? && current_user.can_org_admin? then
-             @guidance_group = GuidanceGroup.find(params[:id])
-          @guidance_group.destroy
-      
-          respond_to do |format|
-            format.html { redirect_to admin_index_guidance_path, notice: I18n.t('org_admin.guidance_group.destroyed_message') }
-            format.json { head :no_content }
-          end
-             else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-              end 
-      
-      end
-
- -
- - - - -
- - -
- -
- admin_edit() - click to toggle source -
- - -
- -

GET /guidance_groups/1/edit

- - - -
-
# File app/controllers/guidance_groups_controller.rb, line 55
-def admin_edit
-      if user_signed_in? && current_user.can_org_admin? then
-    @guidance_group = GuidanceGroup.find(params[:id])
-  else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-              end 
-end
-
- -
- - - - -
- - -
- -
- admin_new() - click to toggle source -
- - -
- -

GET add new guidance groups

- - - -
-
# File app/controllers/guidance_groups_controller.rb, line 21
-    def admin_new
-if user_signed_in? && current_user.can_org_admin? then
-        @guidance_group = GuidanceGroup.new
-           
-        respond_to do |format|
-          format.html # new.html.erb
-
-          format.json { render json: @guidance }
-        end
-    end
-    end
-
- -
- - - - -
- - -
- -
- admin_show() - click to toggle source -
- - -
- -

GET /guidance_groups/1 GET /guidance_groups/1.json

- - - -
-
# File app/controllers/guidance_groups_controller.rb, line 6
-def admin_show
-  if user_signed_in? && current_user.can_org_admin? then
-          @guidance_group = GuidanceGroup.find(params[:id])
-      
-          respond_to do |format|
-            format.html 
-            format.json { render json: @guidance_group }
-          end
-  else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-              end 
-end
-
- -
- - - - -
- - -
- -
- admin_update() - click to toggle source -
- - -
- -

PUT /guidance_groups/1 PUT /guidance_groups/1.json

- - - -
-
# File app/controllers/guidance_groups_controller.rb, line 65
-def admin_update
-              if user_signed_in? && current_user.can_org_admin? then
-              @guidance_group = GuidanceGroup.find(params[:id])
-          @guidance_group.organisation_id = current_user.organisation_id
-
-          respond_to do |format|
-            if @guidance_group.update_attributes(params[:guidance_group])
-              format.html { redirect_to admin_index_guidance_path(params[:guidance_group]), notice: I18n.t('org_admin.guidance_group.updated_message') }
-              format.json { head :no_content }
-            else
-              format.html { render action: "edit" }
-              format.json { render json: @guidance_group.errors, status: :unprocessable_entity }
-            end
-          end
-  else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-              end 
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/GuidancesController.html b/public/html/GuidancesController.html deleted file mode 100644 index 7e036ea..0000000 --- a/public/html/GuidancesController.html +++ /dev/null @@ -1,810 +0,0 @@ - - - - - - -class GuidancesController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class GuidancesController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- admin_create() - click to toggle source -
- - -
- -

POST /guidances POST /guidances.json

- - - -
-
# File app/controllers/guidances_controller.rb, line 155
-def admin_create
-  if user_signed_in? && current_user.can_org_admin? then
-          @guidance = Guidance.new(params[:guidance])
-          @guidance.text = params["guidance-text"]
-          @guidance.question_id = params["question_id"]
-
-          respond_to do |format|
-            if @guidance.save
-              format.html { redirect_to admin_show_guidance_path(@guidance), notice: I18n.t('org_admin.guidance.created_message') }
-              format.json { render json: @guidance, status: :created, location: @guidance }
-            else
-              format.html { render action: "new" }
-              format.json { render json: @guidance.errors, status: :unprocessable_entity }
-            end
-          end
-  else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-              end
-end
-
- -
- - - - -
- - -
- -
- admin_destroy() - click to toggle source -
- - -
- -

DELETE /guidances/1 DELETE /guidances/1.json

- - - -
-
# File app/controllers/guidances_controller.rb, line 202
-def admin_destroy
-      if user_signed_in? && current_user.can_org_admin? then
-             @guidance = Guidance.find(params[:id])
-          @guidance.destroy
-
-          respond_to do |format|
-            format.html { redirect_to admin_index_guidance_path }
-            format.json { head :no_content }
-          end
-             else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-              end
-
-      end
-
- -
- - - - -
- - -
- -
- admin_edit() - click to toggle source -
- - -
- -

GET /guidances/1/edit

- - - -
-
# File app/controllers/guidances_controller.rb, line 112
-def admin_edit
-      if user_signed_in? && current_user.can_org_admin? then
-    @guidance = Guidance.find(params[:id])
-    @dmptemplates = Dmptemplate.funders_and_own_templates(current_user.organisation_id)
-                      @phases = nil
-                      @dmptemplates.each do |template|
-                              if @phases.nil? then
-                                      @phases = template.phases.find(:all,:order => 'number ASC')
-                              else
-                                      @phases = @phases + template.phases.find(:all,:order => 'number ASC')
-                              end
-                      end
-                      @versions = nil
-                      @phases.each do |phase|
-                              if @versions.nil? then
-                                      @versions = phase.versions.find(:all,:order => 'title ASC')
-                              else
-                                      @versions = @versions + phase.versions.find(:all,:order => 'title ASC')
-                              end
-                      end
-                      @sections = nil
-                      @versions.each do |version|
-                              if @sections.nil? then
-                                      @sections = version.sections.find(:all,:order => 'number ASC')
-                              else
-                                      @sections = @sections + version.sections.find(:all,:order => 'number ASC')
-                              end
-                      end
-                      @questions = nil
-                      @sections.each do |section|
-                              if @questions.nil? then
-                                      @questions = section.questions.find(:all,:order => 'number ASC')
-                              else
-                                      @questions = @questions + section.questions.find(:all,:order => 'number ASC')
-                              end
-                      end
-  else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-              end
-end
-
- -
- - - - -
- - -
- -
- admin_index() - click to toggle source -
- - -
- -

GET /guidances GET /guidances.json

- - - -
-
# File app/controllers/guidances_controller.rb, line 5
-def admin_index
-  if user_signed_in? && current_user.can_org_admin? then
-          @guidances = Guidance.by_organisation(current_user.organisation_id)
-          @guidance_groups = GuidanceGroup.where('organisation_id = ?', current_user.organisation_id )
-
-
-          respond_to do |format|
-            format.html # index.html.erb
-
-            format.json { render json: @guidances }
-          end
-  else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-              end
-end
-
- -
- - - - -
- - -
- -
- admin_new() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/guidances_controller.rb, line 33
-def admin_new
-  if user_signed_in? && current_user.can_org_admin? then
-          @guidance = Guidance.new
-                      @dmptemplates = Dmptemplate.funders_and_own_templates(current_user.organisation_id)
-                      @phases = nil
-                      @dmptemplates.each do |template|
-                              if @phases.nil? then
-                                      @phases = template.phases.find(:all,:order => 'number ASC')
-                              else
-                                      @phases = @phases + template.phases.find(:all,:order => 'number ASC')
-                              end
-                      end
-                      @versions = nil
-                      @phases.each do |phase|
-                              if @versions.nil? then
-                                      @versions = phase.versions.find(:all,:order => 'title ASC')
-                              else
-                                      @versions = @versions + phase.versions.find(:all,:order => 'title ASC')
-                              end
-                      end
-                      @sections = nil
-                      @versions.each do |version|
-                              if @sections.nil? then
-                                      @sections = version.sections.find(:all,:order => 'number ASC')
-                              else
-                                      @sections = @sections + version.sections.find(:all,:order => 'number ASC')
-                              end
-                      end
-                      @questions = nil
-                      @sections.each do |section|
-                              if @questions.nil? then
-                                      @questions = section.questions.find(:all,:order => 'number ASC')
-                              else
-                                      @questions = @questions + section.questions.find(:all,:order => 'number ASC')
-                              end
-                      end
-          respond_to do |format|
-            format.html
-          end
-      end
-      end
-
- -
- - - - -
- - -
- -
- admin_show() - click to toggle source -
- - -
- -

GET /guidances/1 GET /guidances/1.json

- - - -
-
# File app/controllers/guidances_controller.rb, line 22
-def admin_show
-  if user_signed_in? && current_user.can_org_admin? then
-          @guidance = Guidance.find(params[:id])
-
-          respond_to do |format|
-            format.html # show.html.erb
-
-            format.json { render json: @guidance }
-          end
- end
-end
-
- -
- - - - -
- - -
- -
- admin_update() - click to toggle source -
- - -
- -

PUT /guidances/1 PUT /guidances/1.json

- - - -
-
# File app/controllers/guidances_controller.rb, line 177
-def admin_update
-              if user_signed_in? && current_user.can_org_admin? then
-              @guidance = Guidance.find(params[:id])
-
-                      @guidance.text = params["guidance-text"]
-
-                      @guidance.question_id = params["question_id"]
-
-          respond_to do |format|
-            if @guidance.update_attributes(params[:guidance])
-              format.html { redirect_to admin_show_guidance_path(params[:guidance]), notice: I18n.t('org_admin.guidance.updated_message') }
-              format.json { head :no_content }
-            else
-              format.html { render action: "edit" }
-              format.json { render json: @guidance.errors, status: :unprocessable_entity }
-            end
-          end
-  else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-              end
-end
-
- -
- - - - -
- - -
- -
- update_phases() - click to toggle source -
- - -
- -

setup variables for use in the dynamic updating

- - - -
-
# File app/controllers/guidances_controller.rb, line 76
-      def update_phases
-  # updates phases, versions, sections and questions based on template selected
-
-  dmptemplate = Dmptemplate.find(params[:dmptemplate_id])
-  # map to title and id for use in our options_for_select
-
-  @phases = dmptemplate.phases.map{|a| [a.title, a.id]}.insert(0, "Select a phase")
-  @versions = dmptemplate.versions.map{|s| [s.title, s.id]}.insert(0, "Select a version")
-  @sections = dmptemplate.sections.map{|s| [s.title, s.id]}.insert(0, "Select a section")
-  @questions = dmptemplate.questions.map{|s| [s.text, s.id]}.insert(0, "Select a question")
-
-end
-
- -
- - - - -
- - -
- -
- update_questions() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/guidances_controller.rb, line 104
-def update_questions
-  # updates songs based on artist selected
-
-  section = Section.find(params[:section_id])
-  @questions = section.questions.map{|s| [s.text, s.id]}.insert(0, "Select a question")
-end
-
- -
- - - - -
- - -
- -
- update_sections() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/guidances_controller.rb, line 96
-def update_sections
-  # updates sections and questions based on version selected
-
-  version = Version.find(params[:version_id])
-  # map to name and id for use in our options_for_select
-
-  @sections = version.sections.map{|s| [s.title, s.id]}.insert(0, "Select a section")
-  @questions = version.questions.map{|s| [s.text, s.id]}.insert(0, "Select a question")
-end
-
- -
- - - - -
- - -
- -
- update_versions() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/guidances_controller.rb, line 87
-def update_versions
-   # updates versions, sections and questions based on phase selected
-
-   phase = Phase.find(params[:phase_id])
-   # map to name and id for use in our options_for_select
-
-   @versions = phase.versions.map{|s| [s.title, s.id]}.insert(0, "Select a version")
-   @sections = phase.sections.map{|s| [s.title, s.id]}.insert(0, "Select a section")
-   @questions = phase.questions.map{|s| [s.text, s.id]}.insert(0, "Select a question")
- end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/HomeController.html b/public/html/HomeController.html deleted file mode 100644 index dcc676f..0000000 --- a/public/html/HomeController.html +++ /dev/null @@ -1,363 +0,0 @@ - - - - - - -class HomeController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class HomeController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- about_us() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/home_controller.rb, line 13
-def about_us
-end
-
- -
- - - - -
- - -
- -
- index() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/home_controller.rb, line 2
-def index
-      if user_signed_in?
-              name = current_user.name(false)
-              if name.nil? || name == "" then
-                      redirect_to edit_user_registration_path
-              else
-                      redirect_to projects_url
-              end
-      end
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/Object.html b/public/html/Object.html deleted file mode 100644 index e231136..0000000 --- a/public/html/Object.html +++ /dev/null @@ -1,326 +0,0 @@ - - - - - - -class Object - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Object

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- scoped_collection() - click to toggle source -
- - -
- - - - - -
-
# File app/admin/user.rb, line 118
-def scoped_collection
-  resource_class.includes(:organisations) # prevents N+1 queries to your database
-
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/Option.html b/public/html/Option.html deleted file mode 100644 index 1798432..0000000 --- a/public/html/Option.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - -class Option - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Option

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- to_s() - click to toggle source -
- - -
- - - - - -
-
# File app/models/option.rb, line 12
-def to_s
-        "#{text}"
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/OptionWarning.html b/public/html/OptionWarning.html deleted file mode 100644 index 921cfe8..0000000 --- a/public/html/OptionWarning.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - -class OptionWarning - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class OptionWarning

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- to_s() - click to toggle source -
- - -
- - - - - -
-
# File app/models/option_warning.rb, line 9
-def to_s
-        "#{text}"
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/Organisation.html b/public/html/Organisation.html deleted file mode 100644 index d71187f..0000000 --- a/public/html/Organisation.html +++ /dev/null @@ -1,626 +0,0 @@ - - - - - - -class Organisation - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Organisation

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Class Methods

- - -
- -
- orgs_with_parent_of_type(org_type) - click to toggle source -
- - -
- -

retrieves info off a child org

- - - -
-
# File app/models/organisation.rb, line 35
-def self.orgs_with_parent_of_type(org_type)
-        parents = OrganisationType.find_by_name(org_type).organisations
-        children = Array.new
-        parents.each do |parent|
-              children += parent.children
-        end
-        return children
-end
-
- -
- - - - -
- - -
- -
- other_organisations() - click to toggle source -
- - -
- - - - - -
-
# File app/models/organisation.rb, line 45
-def self.other_organisations
-        org_types = [I18n.t('helpers.org_type.organisation')]
-        organisations_list = []
-        org_types.each do |ot|
-                new_org_obejct = OrganisationType.find_by_name(ot)
-
-                org_with_guidance = GuidanceGroup.joins(new_org_obejct.organisations)
-
-                organisations_list = organisations_list + org_with_guidance
-        end
-        return organisations_list
-end
-
- -
- - - - -
- - -
- -
-

Public Instance Methods

- - -
- -
- all_guidance_groups() - click to toggle source -
- - -
- - - - - -
-
# File app/models/organisation.rb, line 70
-def all_guidance_groups
-        ggs = guidance_groups
-        children.each do |c|
-                ggs = ggs + c.all_guidance_groups
-        end
-        return ggs
-end
-
- -
- - - - -
- - -
- -
- all_sections(version_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/organisation.rb, line 58
-def all_sections(version_id)
-        if parent.nil?
-                secs = sections.where("version_id = ?", version_id)
-                if secs.nil? then
-                        secs = Array.new
-                end
-                return secs
-        else
-                return sections.find_all_by_version_id(version_id) + parent.all_sections(version_id)
-        end
-end
-
- -
- - - - -
- - -
- -
- published_templates() - click to toggle source -
- - -
- - - - - -
-
# File app/models/organisation.rb, line 95
-def published_templates
-        return dmptemplates.find_all_by_published(1)
-end
-
- -
- - - - -
- - -
- -
- root() - click to toggle source -
- - -
- - - - - -
-
# File app/models/organisation.rb, line 78
-def root
-        if parent.nil?
-                return self
-        else
-                return parent.root
-        end
-end
-
- -
- - - - -
- - -
- -
- short_name() - click to toggle source -
- - -
- - - - - -
-
# File app/models/organisation.rb, line 26
-def short_name
-        if abbreviation.nil? then
-                return name
-        else
-                return abbreviation
-        end
-end
-
- -
- - - - -
- - -
- -
- to_s() - click to toggle source -
- - -
- - - - - -
-
# File app/models/organisation.rb, line 22
-def to_s
-        name
-end
-
- -
- - - - -
- - -
- -
- warning(option_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/organisation.rb, line 86
-def warning(option_id)
-        warning = option_warnings.find_by_option_id(option_id)
-        if warning.nil? && !parent.nil? then
-                return parent.warning(option_id)
-        else
-                return warning
-        end
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/OrganisationType.html b/public/html/OrganisationType.html deleted file mode 100644 index 1448f7c..0000000 --- a/public/html/OrganisationType.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -class OrganisationType - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class OrganisationType

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/OrganisationUsersController.html b/public/html/OrganisationUsersController.html deleted file mode 100644 index cd53ddb..0000000 --- a/public/html/OrganisationUsersController.html +++ /dev/null @@ -1,334 +0,0 @@ - - - - - - -class OrganisationUsersController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class OrganisationUsersController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- admin_index() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/organisation_users_controller.rb, line 3
-def admin_index
-        if user_signed_in? && current_user.can_org_admin? then
-                
-                respond_to do |format|
-                        format.html # index.html.erb
-
-                        format.json { render json: @organisation_users }
-                end
-        else
-                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-        end 
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/OrganisationsController.html b/public/html/OrganisationsController.html deleted file mode 100644 index 91d1f12..0000000 --- a/public/html/OrganisationsController.html +++ /dev/null @@ -1,707 +0,0 @@ - - - - - - -class OrganisationsController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class OrganisationsController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- admin_edit() - click to toggle source -
- - -
- -

GET /organisations/1/edit

- - - -
-
# File app/controllers/organisations_controller.rb, line 58
-def admin_edit
-      if user_signed_in? && current_user.can_org_admin? then
-      @organisation = Organisation.find(params[:id])
-  
-  else
-              render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-      end 
-end
-
- -
- - - - -
- - -
- -
- admin_show() - click to toggle source -
- - -
- -

GET /organisations/1 GET /organisations/1.json

- - - -
-
# File app/controllers/organisations_controller.rb, line 43
-def admin_show
-      if user_signed_in? && current_user.can_org_admin? then
-          @organisation = Organisation.find(params[:id])
-      
-          respond_to do |format|
-            format.html # show.html.erb
-
-            format.json { render json: @organisation }
-          end
-  else
-                      render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-              end 
-              
-end
-
- -
- - - - -
- - -
- -
- admin_update() - click to toggle source -
- - -
- -

PUT /organisations/1 PUT /organisations/1.json

- - - -
-
# File app/controllers/organisations_controller.rb, line 70
-def admin_update
-  if user_signed_in? && current_user.can_org_admin? then
-      @organisation = Organisation.find(params[:id])
-      @organisation.banner_text = params["org_banner_text"]
-              
-              
-          respond_to do |format|
-            if @organisation.update_attributes(params[:organisation])
-              format.html { redirect_to admin_show_organisation_path(params[:id]), notice: I18n.t("admin.org_updated_message")  }
-              format.json { head :no_content }
-            else
-              format.html { render action: "edit" }
-              format.json { render json: @organisation.errors, status: :unprocessable_entity }
-            end
-          end
-      else
-        render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-  end         
-end
-
- -
- - - - -
- - -
- -
- children() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/organisations_controller.rb, line 108
-        def children
-                @organisation = Organisation.find(params[:id])
-                #if user_signed_in? then
-
-                children = {}
-                @organisation.children.each do |child|
-                        children[child.id] = child.name
-                end
-                respond_to do |format|
-                        format.json { render json: children.to_json }
-                end
-#               else
-
-#                       render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-
-#               end
-
-        end
-
- -
- - - - -
- - -
- -
- create() - click to toggle source -
- - -
- -

POST /organisations POST /organisations.json

- - - -
-
# File app/controllers/organisations_controller.rb, line 26
-def create
-  @organisation = Organisation.new(params[:organisation])
-
-  respond_to do |format|
-    if @organisation.save
-      format.html { redirect_to @organisation, notice: I18n.t("admin.org_created_message") }
-      format.json { render json: @organisation, status: :created, location: @organisation }
-    else
-      format.html { render action: "new" }
-      format.json { render json: @organisation.errors, status: :unprocessable_entity }
-    end
-  end
-end
-
- -
- - - - -
- - -
- -
- destroy() - click to toggle source -
- - -
- -

DELETE /organisations/1 DELETE /organisations/1.json

- - - -
-
# File app/controllers/organisations_controller.rb, line 92
-def destroy
-  @organisation = Organisation.find(params[:id])
-  @organisation.destroy
-
-  respond_to do |format|
-    format.html { redirect_to organisations_url }
-    format.json { head :no_content }
-  end
-end
-
- -
- - - - -
- - -
- -
- index() - click to toggle source -
- - -
- -

GET /organisations GET /organisations.json

- - - -
-
# File app/controllers/organisations_controller.rb, line 4
-def index
-  @organisations = Organisation.all
-
-  respond_to do |format|
-    format.html # index.html.erb
-
-    format.json { render json: @organisations }
-  end
-end
-
- -
- - - - -
- - -
- -
- new() - click to toggle source -
- - -
- -

GET /organisations/new GET /organisations/new.json

- - - -
-
# File app/controllers/organisations_controller.rb, line 15
-def new
-  @organisation = Organisation.new
-
-  respond_to do |format|
-    format.html # new.html.erb
-
-    format.json { render json: @organisation }
-  end
-end
-
- -
- - - - -
- - -
- -
- parent() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/organisations_controller.rb, line 102
-def parent
-      @organisation = Organisation.find(params[:id])
-      parent_org = @organisation.find_by {|o| o.parent_id }
-      return parent_org
-end
-
- -
- - - - -
- - -
- -
- templates() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/organisations_controller.rb, line 123
-        def templates
-                @organisation = Organisation.find(params[:id])
-                #if user_signed_in? then
-
-                templates = {}
-                @organisation.dmptemplates.each do |template|
-                        if template.is_published? then
-                                templates[template.id] = template.title
-                        end
-                end
-                respond_to do |format|
-                        format.json { render json: templates.to_json }
-                end
-#               else
-
-#                       render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-
-#               end
-
-        end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/Page.html b/public/html/Page.html deleted file mode 100644 index a4a8cea..0000000 --- a/public/html/Page.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -class Page - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Page

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/PagesController.html b/public/html/PagesController.html deleted file mode 100644 index b067c7c..0000000 --- a/public/html/PagesController.html +++ /dev/null @@ -1,561 +0,0 @@ - - - - - - -class PagesController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class PagesController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- create() - click to toggle source -
- - -
- -

POST /pages POST /pages.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- destroy() - click to toggle source -
- - -
- -

DELETE /pages/1 DELETE /pages/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- edit() - click to toggle source -
- - -
- -

GET /pages/1/edit

- - - -
-
# File app/controllers/pages_controller.rb, line 36
-def edit
-  @page = Page.find(params[:id])
-end
-
- -
- - - - -
- - -
- -
- index() - click to toggle source -
- - -
- -

GET /pages GET /pages.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- new() - click to toggle source -
- - -
- -

GET /pages/new GET /pages/new.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- show() - click to toggle source -
- - -
- -

GET /pages/1 GET /pages/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- update() - click to toggle source -
- - -
- -

PUT /pages/1 PUT /pages/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/PasswordsController.html b/public/html/PasswordsController.html deleted file mode 100644 index 3364f85..0000000 --- a/public/html/PasswordsController.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - -class PasswordsController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class PasswordsController

- -
- -
- - - - -
- - - - - - - - - - -
-

Protected Instance Methods

- - -
- -
- after_resetting_password_path_for(resource) - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/passwords_controller.rb, line 5
-    def after_resetting_password_path_for(resource)
-    root_path
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/Phase.html b/public/html/Phase.html deleted file mode 100644 index c5491a9..0000000 --- a/public/html/Phase.html +++ /dev/null @@ -1,457 +0,0 @@ - - - - - - -class Phase - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Phase

- -
-
Project: -
-

DMPonline v4

-
Description: -
-

This model describes informmation about the phase of a plan, it's -title, order of display and which template it belongs to.

-
Created: -
-

03/09/2014

-
Copyright: -
-

Digital Curation Centre

-
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- has_sections() - click to toggle source -
- - -
- -

verify if a phase has a published version or a version with one or more -sections

- - - -
-
# File app/models/phase.rb, line 44
-def has_sections
-        versions = self.versions.where('published = ?', true).order('updated_at DESC')
-        if versions.any? then
-                version = versions.first
-                if !version.sections.empty? then
-                        has_section = true
-                else
-                        has_section = false
-                end  
-        else
-                version = self.versions.order('updated_at DESC').first 
-                if !version.sections.empty? then
-                        has_section = true
-                else
-                        has_section = false
-                end  
-        end
-        return has_section
-end
-
- -
- - - - -
- - -
- -
- latest_published_version() - click to toggle source -
- - -
- -

Verify if this phase has any published versions

- - - -
-
# File app/models/phase.rb, line 34
-def latest_published_version
-        versions.order("number DESC").each do |version|
-                if version.published then
-                        return version
-                end
-        end
-        return nil
-end
-
- -
- - - - -
- - -
- -
- latest_version() - click to toggle source -
- - -
- - - - - -
-
# File app/models/phase.rb, line 29
-def latest_version
-        return versions.order("number DESC").last
-end
-
- -
- - - - -
- - -
- -
- to_s() - click to toggle source -
- - -
- - - - - -
-
# File app/models/phase.rb, line 25
-def to_s
-        "#{title}"
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/Plan.html b/public/html/Plan.html deleted file mode 100644 index 9f0b894..0000000 --- a/public/html/Plan.html +++ /dev/null @@ -1,1393 +0,0 @@ - - - - - - -class Plan - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Plan

- -
- -
- - - - -
- - - - - - -
-

Constants

-
- -
A4_PAGE_HEIGHT - -
- - -
A4_PAGE_WIDTH - -
- - -
FONT_HEIGHT_CONVERSION_FACTOR - -
- - -
FONT_WIDTH_HEIGHT_RATIO - -
- - -
ROUNDING - -
- - -
-
- - - - - - -
-

Public Instance Methods

- - -
- -
- add_guidance_to_array(guidance_array, guidance_group, theme, guidance) - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- administerable_by(user_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/plan.rb, line 168
-def administerable_by(user_id)
-        return project.readable_by(user_id)
-end
-
- -
- - - - -
- - -
- -
- answer(qid, create_if_missing = true) - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- delete_recent_locks(user_id) - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- details() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- dmptemplate() - click to toggle source -
- - -
- - - - - -
-
# File app/models/plan.rb, line 36
-def dmptemplate
-        self.project.try(:dmptemplate) || Dmptemplate.new
-end
-
- -
- - - - -
- - -
- -
- editable_by(user_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/plan.rb, line 156
-def editable_by(user_id)
-        return project.editable_by(user_id)
-end
-
- -
- - - - -
- - -
- -
- guidance_for_question(question) - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- latest_update() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- lock_all_sections(user_id) - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- lock_section(section_id, user_id, release_time = 60) - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- locked(section_id, user_id) - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- readable_by(user_id) - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- section_answers(section_id) - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- sections() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- settings(key) - click to toggle source -
- - -
- -

Proxy through to the template settings (or defaults if this plan -doesn't have an associated template) if there are no settings stored -for this plan. `key` is required by rails-settings, so it's required -here, too.

- - - -
-
# 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)
-end
-
- -
- - -
- Also aliased as: super_settings -
- - - -
- - -
- -
- status() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- super_settings(key) - click to toggle source -
- - -
- - - - - -
- - - - -
- Alias for: settings -
- -
- - -
- -
- title() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- unlock_all_sections(user_id) - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- unlock_section(section_id, user_id) - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- warning(option_id) - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
-

Private Instance Methods

- - -
- -
- estimate_space_used(used_height) - click to toggle source -
- - -
- -

Based on the height of the text gathered so far and the available vertical -space of the pdf, estimate a percentage of how much space has been used. -This is highly dependent on the layout in the pdf. A more accurate approach -would be to render the pdf and check how much space had been used, but that -could be very slow. NOTE: This is only an estimate, rounded up to the -nearest 5%; it is intended for guidance when editing plan data, not to be -100% accurate.

- - - -
-
# 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
-
-end
-
- -
- - - - -
- - -
- -
- height_of_text(text, font_size_inc = 0, vertical_margin = 0) - click to toggle source -
- - -
- -

Take a guess at the vertical height (in mm) of the given text based on the -font-size and left/right margins stored in the plan's settings. This -assumes a fixed-width for each glyph, which is obviously incorrect for the -font-face choices available; the idea is that they'll hopefully average -out to that in the long-run. Allows for hinting different font sizes -(offset from base via font_size_inc) and vertical margins (i.e. for heading -text)

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/PlanSection.html b/public/html/PlanSection.html deleted file mode 100644 index 563df5e..0000000 --- a/public/html/PlanSection.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -class PlanSection - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class PlanSection

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/PlansController.html b/public/html/PlansController.html deleted file mode 100644 index 6992368..0000000 --- a/public/html/PlansController.html +++ /dev/null @@ -1,833 +0,0 @@ - - - - - - -class PlansController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class PlansController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- answer() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- delete_recent_locks() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- edit() - click to toggle source -
- - -
- -

GET /plans/1/edit

- - - -
-
# 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
-    end
-
- -
- - - - -
- - -
- -
- export() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- lock_section() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- locked() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- section_answers() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- status() - click to toggle source -
- - -
- -

GET /status/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- unlock_all_sections() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- unlock_section() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- update() - click to toggle source -
- - -
- -

PUT /plans/1 PUT /plans/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- warning() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/PlansHelper.html b/public/html/PlansHelper.html deleted file mode 100644 index 6373cd5..0000000 --- a/public/html/PlansHelper.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - - - -module PlansHelper - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

module PlansHelper

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- plan_settings_indicator(plan) - click to toggle source -
- - -
- -

Shows whether the user has default, template-default or custom settings for -the given plan.

- - - -
-
# File app/helpers/plans_helper.rb, line 45
-def plan_settings_indicator(plan)
-  plan_settings     = plan.super_settings(:export)
-  template_settings = plan.project.dmptemplate.try(:settings, :export)
-
-  key = if plan_settings.try(:value?)
-    plan_settings.formatting == template_settings.formatting ? 'template_formatting' : 'custom_formatting'
-  elsif template_settings.try(:value?)
-    'template_formatting'
-  else
-    'default_formatting'
-  end
-
-  content_tag(:small, t("helpers.settings.plans.#{key}"))
-end
-
- -
- - - - -
- - -
- -
- project_list_body(column, project) - click to toggle source -
- - -
- - - - - -
-
# File app/helpers/plans_helper.rb, line 13
-def project_list_body(column, project)
-  klass, content = case column
-    when :name
-      [ 'dmp_td_big', link_to(project.title, project_path(project), class: 'dmp_table_link') ]
-    when :owner
-      user = project.owner
-      text = if user.nil?
-        'Unknown'
-      elsif user == current_user
-        t('helpers.me')
-      else
-        user.name
-      end
-
-      [ 'tmp_td_small', text ]
-    when :shared
-      shared_num = project.project_groups.count - 1
-      text = shared_num > 0 ? (t('helpers.yes') + " (with #{shared_num} people) ") : t('helpers.no')
-      [ 'dmp_td_small', text ]
-    when :last_edited
-      [ 'dmp_td_small', l(project.latest_update.to_date, formats: :short) ]
-    when :description
-      [ 'dmp_td_medium', (project.try(column) || 'Unknown') ]
-    else
-      [ 'dmp_td_small', (project.try(column) || 'Unknown') ]
-  end
-
-  content_tag(:td, content, class: klass)
-end
-
- -
- - - - -
- - -
- -
- project_list_head(column) - click to toggle source -
- - -
- - - - - -
-
# File app/helpers/plans_helper.rb, line 3
-def project_list_head(column)
-  klass = case column
-    when :name  then :dmp_th_big
-    when :description then :dmp_th_big
-    else :dmp_th_small
-  end
-
-  content_tag(:th, t("helpers.project.columns.#{column}"), class: klass)
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/Project.html b/public/html/Project.html deleted file mode 100644 index ca0dd35..0000000 --- a/public/html/Project.html +++ /dev/null @@ -1,1262 +0,0 @@ - - - - - - -class Project - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Project

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Class Methods

- - -
- -
- projects_for_user(user_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 142
-def self.projects_for_user(user_id)
-        projects = Array.new
-        groups = ProjectGroup.where("user_id = ?", user_id)
-        unless groups.nil? then
-                groups.each do |group|
-                        unless group.project.nil? then
-                                projects << group.project
-                        end
-                end
-        end
-        return projects
-end
-
- -
- - - - -
- - -
- -
-

Public Instance Methods

- - -
- -
- administerable_by(user_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 115
-def administerable_by(user_id)
-        user = project_groups.find_by_user_id(user_id)
-        if (! user.nil?) && user.project_administrator then
-                return true
-        else
-                return false
-        end
-end
-
- -
- - - - -
- - -
- -
- assign_administrator(user_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 111
-def assign_administrator(user_id)
-        add_user(user_id, true, true)
-end
-
- -
- - - - -
- - -
- -
- assign_creator(user_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 99
-def assign_creator(user_id)
-        add_user(user_id, true, true, true)
-end
-
- -
- - - - -
- - -
- -
- assign_editor(user_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 103
-def assign_editor(user_id)
-        add_user(user_id, true)
-end
-
- -
- - - - -
- - -
- -
- assign_reader(user_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 107
-def assign_reader(user_id)
-        add_user(user_id)
-end
-
- -
- - - - -
- - -
- -
- created_by(user_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 155
-def created_by(user_id)
-        user = project_groups.find_by_user_id(user_id)
-        if (! user.nil?) && user.project_creator then
-                return true
-        else
-                return false
-        end
-end
-
- -
- - - - -
- - -
- -
- editable_by(user_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 124
-def editable_by(user_id)
-        user = project_groups.find_by_user_id(user_id)
-        if (! user.nil?) && user.project_editor then
-                return true
-        else
-                return false
-        end
-end
-
- -
- - - - -
- - -
- -
- funder() - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 39
-def funder
-        if dmptemplate.nil? then
-                return nil
-        end
-        template_org = dmptemplate.organisation
-        if template_org.organisation_type.name == I18n.t('helpers.org_type.funder').downcase
-                return template_org
-        else
-                return nil
-        end
-end
-
- -
- - - - -
- - -
- -
- funder_id() - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 27
-def funder_id
-        if dmptemplate.nil? then
-                return nil
-        end
-        template_org = dmptemplate.organisation
-        if template_org.organisation_type.name == I18n.t('helpers.org_type.funder').downcase
-                return template_org.id
-        else
-                return nil
-        end
-end
-
- -
- - - - -
- - -
- -
- funder_id=(new_funder_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 18
-def funder_id=(new_funder_id)
-        if new_funder_id != "" then
-                new_funder = Organisation.find(new_funder_id);
-                if new_funder.dmptemplates.count == 1 then
-                        dmptemplate = new_funder.dmptemplates.first
-                end
-        end
-end
-
- -
- - - - -
- - -
- -
- funder_name() - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 51
-def funder_name
-        if self.funder.nil?
-                return read_attribute(:funder_name)
-        else
-                return self.funder.name
-        end
-end
-
- -
- - - - -
- - -
- -
- funder_name=(new_funder_name) - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 59
-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))
-        if existing_org.nil?
-                existing_org = Organisation.where(org_table[:abbreviation].matches(new_funder_name))
-        end
-        unless existing_org.empty?
-                self.funder_id=existing_org.id
-        end
-end
-
- -
- - - - -
- - -
- -
- institution_id() - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 77
-def institution_id
-        if organisation.nil?
-                return nil
-        else
-                return organisation.root.id
-        end
-end
-
- -
- - - - -
- - -
- -
- institution_id=(new_institution_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 71
-def institution_id=(new_institution_id)
-        if organisation.nil? then
-                self.organisation_id = new_institution_id
-        end
-end
-
- -
- - - - -
- - -
- -
- last_edited() - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 183
-def last_edited
-        self.latest_update.to_date
-end
-
- -
- - - - -
- - -
- -
- latest_update() - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 164
-def latest_update
-        latest_update = updated_at
-        plans.each do |plan|
-                if plan.latest_update > latest_update then
-                        latest_update = plan.latest_update
-                end
-        end
-        return latest_update
-end
-
- -
- - - - -
- - -
- -
- name() - click to toggle source -
- - -
- -

Getters to match 'My plans' columns

- - - -
-
# File app/models/project.rb, line 175
-def name
-        self.title
-end
-
- -
- - - - -
- - -
- -
- owner() - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 179
-def owner
-        self.project_groups.find_by_project_creator(true).try(:user)
-end
-
- -
- - - - -
- - -
- -
- readable_by(user_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 133
-def readable_by(user_id)
-        user = project_groups.find_by_user_id(user_id)
-        if (! user.nil?) then
-                return true
-        else
-                return false
-        end
-end
-
- -
- - - - -
- - -
- -
- shared() - click to toggle source -
- - -
- - - - - -
- - - - -
- Alias for: shared? -
- -
- - -
- -
- shared?() - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 187
-def shared?
-        self.project_groups.count > 1
-end
-
- -
- - -
- Also aliased as: shared -
- - - -
- - -
- -
- template_owner() - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 193
-def template_owner
-        self.dmptemplate.try(:organisation).try(:abbreviation)
-end
-
- -
- - - - -
- - -
- -
- unit_id() - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 91
-def unit_id
-        if organisation.nil? || organisation.parent_id.nil?
-                return nil
-        else
-                return organisation_id
-        end
-end
-
- -
- - - - -
- - -
- -
- unit_id=(new_unit_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 85
-def unit_id=(new_unit_id)
-        unless new_unit_id.nil? ||new_unit_id == ""
-                self.organisation_id = new_unit_id
-        end
-end
-
- -
- - - - -
- - -
- -
-

Private Instance Methods

- - -
- -
- add_user(user_id, is_editor = false, is_administrator = false, is_creator = false) - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 199
-def add_user(user_id, is_editor = false, is_administrator = false, is_creator = false)
-        group = ProjectGroup.new
-        group.user_id = user_id
-        group.project_creator = is_creator
-        group.project_editor = is_editor
-        group.project_administrator = is_administrator
-        project_groups << group
-end
-
- -
- - - - -
- - -
- -
- create_plans() - click to toggle source -
- - -
- - - - - -
-
# File app/models/project.rb, line 208
-def create_plans
-        dmptemplate.phases.each do |phase|
-                latest_published_version = phase.latest_published_version
-                unless latest_published_version.nil?
-                        new_plan = Plan.new
-                        new_plan.version = latest_published_version
-                        plans << new_plan
-                end
-        end
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/ProjectGroup.html b/public/html/ProjectGroup.html deleted file mode 100644 index 70c5421..0000000 --- a/public/html/ProjectGroup.html +++ /dev/null @@ -1,441 +0,0 @@ - - - - - - -class ProjectGroup - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class ProjectGroup

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- access_level() - click to toggle source -
- - -
- - - - - -
-
# File app/models/project_group.rb, line 21
-def access_level
-        if project_administrator then
-                return 3
-        elsif project_editor then
-                return 2
-        else
-                return 1
-        end
-end
-
- -
- - - - -
- - -
- -
- access_level=(new_access_level) - click to toggle source -
- - -
- - - - - -
-
# File app/models/project_group.rb, line 31
-def access_level=(new_access_level)
-        new_access_level = new_access_level.to_i
-        if new_access_level >= 3 then
-                project_administrator = true
-        else
-                project_administrator = false
-        end
-        if new_access_level >= 2 then
-                project_editor = true
-        else
-                project_editor = false
-        end
-end
-
- -
- - - - -
- - -
- -
- email() - click to toggle source -
- - -
- - - - - -
-
# File app/models/project_group.rb, line 9
-def email
-        unless user.nil? 
-                return user.email
-        end
-end
-
- -
- - - - -
- - -
- -
- email=(new_email) - click to toggle source -
- - -
- - - - - -
-
# File app/models/project_group.rb, line 15
-def email=(new_email)
-        unless User.find_by_email(email).nil? then
-                user = User.find_by_email(email)
-        end
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/ProjectGroupsController.html b/public/html/ProjectGroupsController.html deleted file mode 100644 index 96cea38..0000000 --- a/public/html/ProjectGroupsController.html +++ /dev/null @@ -1,473 +0,0 @@ - - - - - - -class ProjectGroupsController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class ProjectGroupsController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- create() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/project_groups_controller.rb, line 3
-def create
-        @project_group = ProjectGroup.new(params[:project_group])
-        access_level = params[:project_group][:access_level].to_i
-        if access_level >= 3 then
-                @project_group.project_administrator = true
-        end
-        if access_level >= 2 then
-                @project_group.project_editor = true
-        end
-        if (user_signed_in?) && @project_group.project.administerable_by(current_user.id) then
-                respond_to do |format|
-                        if params[:project_group][:email].present? && params[:project_group][:email].length > 0 then
-                                message = 'User added to project'
-                                if @project_group.save
-                                        if @project_group.user.nil? then
-                                                if User.find_by_email(params[:project_group][:email]).nil? then
-                                                        User.invite!(:email => params[:project_group][:email])
-                                                        message = 'Invitation issued successfully.'
-                                                        @project_group.user = User.find_by_email(params[:project_group][:email])
-                                                        @project_group.save
-                                                else
-                                                        @project_group.user = User.find_by_email(params[:project_group][:email])
-                                                        @project_group.save
-                                                        UserMailer.sharing_notification(@project_group).deliver
-                                                        logger.debug("Email sent from here?")
-                                                end
-                                        else
-                                                UserMailer.sharing_notification(@project_group).deliver
-                                                logger.debug("Email sent from there?")
-                                        end
-                                        flash[:notice] = message
-                                        format.html { redirect_to :controller => 'projects', :action => 'share', :id => @project_group.project.slug }
-                                        format.json { render json: @project_group, status: :created, location: @project_group }
-                                else
-                                        format.html { render action: "new" }
-                                        format.json { render json: @project_group.errors, status: :unprocessable_entity }
-                                end
-                        else
-                                flash[:notice] = "Please enter an email address"
-                                format.html { redirect_to :controller => 'projects', :action => 'share', :id => @project_group.project.slug }
-                                format.json { render json: @project_group, status: :created, location: @project_group }
-                        end
-                end                  
-        else
-                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-        end
-        
-end
-
- -
- - - - -
- - -
- -
- destroy() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/project_groups_controller.rb, line 82
-def destroy
-        @project_group = ProjectGroup.find(params[:id])
-        if (user_signed_in?) && @project_group.project.administerable_by(current_user.id) then
-                user = @project_group.user
-                project = @project_group.project
-                @project_group.destroy
-                respond_to do |format|
-                        flash[:notice] = 'Access removed'
-                        UserMailer.project_access_removed_notification(user, project).deliver
-                        format.html { redirect_to :controller => 'projects', :action => 'share', :id => @project_group.project.slug }
-                        format.json { head :no_content }
-                end
-        else
-                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-        end
-end
-
- -
- - - - -
- - -
- -
- update() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/project_groups_controller.rb, line 52
-def update
-@project_group = ProjectGroup.find(params[:id])
-access_level = params[:project_group][:access_level].to_i
-        if access_level >= 3 then
-                @project_group.project_administrator = true
-        else
-                @project_group.project_administrator = false
-        end
-        if access_level >= 2 then
-                @project_group.project_editor = true
-        else
-                @project_group.project_editor = false
-        end
-if (user_signed_in?) && @project_group.project.administerable_by(current_user.id) then
-                respond_to do |format|
-                        if @project_group.update_attributes(params[:project_group])
-                                flash[:notice] = 'Sharing details successfully updated.'
-                                UserMailer.permissions_change_notification(@project_group).deliver
-                                format.html { redirect_to :controller => 'projects', :action => 'share', :id => @project_group.project.slug }
-                                format.json { head :no_content }
-                        else
-                                format.html { render action: "edit" }
-                                format.json { render json: @project_group.errors, status: :unprocessable_entity }
-                         end
-                end
-else
-                render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)
-        end
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/ProjectPartner.html b/public/html/ProjectPartner.html deleted file mode 100644 index 07f619b..0000000 --- a/public/html/ProjectPartner.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -class ProjectPartner - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class ProjectPartner

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/Question.html b/public/html/Question.html deleted file mode 100644 index a45775f..0000000 --- a/public/html/Question.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - - - -class Question - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Question

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- get_suggested_answer(org_id) - click to toggle source -
- - -
- -

get suggested answer belonging to the currents user for this question

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- guidance_for_question(question, org_admin) - click to toggle source -
- - -
- -

guidance for question in the org admin

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- question_themes?() - click to toggle source -
- - -
- -

def question_type?

- -
type_label = {}
-if self.is_text_field?
-  type_label = 'Text field'
-elsif self.multiple_choice?
-        type_label = 'Multiple choice'
-else
-        type_label = 'Text area'
-end
-return type_label
- -

end

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- to_s() - click to toggle source -
- - -
- - - - - -
-
# File app/models/question.rb, line 29
-    def to_s
-    "#{text}"
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/QuestionFormat.html b/public/html/QuestionFormat.html deleted file mode 100644 index 7d098d1..0000000 --- a/public/html/QuestionFormat.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - -class QuestionFormat - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class QuestionFormat

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- to_s() - click to toggle source -
- - -
- - - - - -
-
# File app/models/question_format.rb, line 7
- def to_s
-  "#{title}"
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/README_rdoc.html b/public/html/README_rdoc.html deleted file mode 100644 index 1100184..0000000 --- a/public/html/README_rdoc.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - -README - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
- -

DMPonline v4

- -

DMPonline is the DCC's data management planning tool, available at dmponline.dcc.ac.uk

- -

Development of the DMPonline by the Digital Curation Centre has been funded -by JISC. JISC inspires UK colleges and universities in the innovative use -of digital technologies, helping to maintain the UK's position as a -global leader in education. www.jisc.ac.uk

- -

This is just the application code, the accompanying question data available -at dmponline.dcc.ac.uk is not -included.

- -

The tool has four main functions

-
  1. -

    To help create and maintain different versions of Data Management Plans;

    -
  2. -

    To provide useful guidance on data management issues and how to meet -research funders' requirements;

    -
  3. -

    To export attractive and useful plans in a variety of formats;

    -
  4. -

    To allow collaborative work when creating Data Management Plans.

    -
- -

Documentation & Support

- - -

Bugs & Feature Requests

- - -

Prerequisites

- -

DMPonline is a Ruby on Rails application and you will need to have Ruby -2.0.0p247 or greater installed on your server and a MySQL server v5.0 or -greater.

- -

Further details on how to install Ruby on Rails applications are available -from the Ruby on Rails site, rubyonrails.org

- -

You may also find the following resources handy:

- - - - -

Copyright © 2013 Digital Curation Centre, University of Edinburgh.

- -

This program is free software: you can redistribute it and/or modify it -under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or (at your -option) any later version.

- -

This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License -for more details.

- -

You should have received a copy of the GNU Affero General Public License -along with this program. If not, see www.gnu.org/licenses.

- -
- - - - - diff --git a/public/html/RegistrationsController.html b/public/html/RegistrationsController.html deleted file mode 100644 index c12611d..0000000 --- a/public/html/RegistrationsController.html +++ /dev/null @@ -1,506 +0,0 @@ - - - - - - -class RegistrationsController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class RegistrationsController

- -
- -

app/controllers/registrations_controller.rb

- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- create() - click to toggle source -
- - -
- -

POST /resource

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- update() - click to toggle source -
- - -
- - - - - -
-
# 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
- end
-
- -
- - - - -
- - -
- -
-

Private Instance Methods

- - -
- -
- do_update(require_password = true, confirm = false) - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- needs_password?(user, params) - click to toggle source -
- - -
- -

check if we need password to update user data ie if password or email was -changed extend this as needed

- - - -
-
# File app/controllers/registrations_controller.rb, line 54
-def needs_password?(user, params)
-  user.email != params[:user][:email] ||
-    params[:user][:password].present?
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/Role.html b/public/html/Role.html deleted file mode 100644 index 02d87ea..0000000 --- a/public/html/Role.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -class Role - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Role

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/Section.html b/public/html/Section.html deleted file mode 100644 index 2ad9bcb..0000000 --- a/public/html/Section.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - -class Section - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Section

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- to_s() - click to toggle source -
- - -
- - - - - -
-
# File app/models/section.rb, line 15
-def to_s
-  "#{title}"
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/SessionsController.html b/public/html/SessionsController.html deleted file mode 100644 index 163a22b..0000000 --- a/public/html/SessionsController.html +++ /dev/null @@ -1,375 +0,0 @@ - - - - - - -class SessionsController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class SessionsController

- -
- -

app/controllers/sessions_controller.rb

- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- create() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- destroy() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/sessions_controller.rb, line 19
-    def destroy
-    current_user.plan_sections.each do |lock|
-        lock.delete
-        
-    end
-    super
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/Settings.html b/public/html/Settings.html deleted file mode 100644 index 3cfcfa5..0000000 --- a/public/html/Settings.html +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - -module Settings - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

module Settings

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/Settings/Dmptemplate.html b/public/html/Settings/Dmptemplate.html deleted file mode 100644 index ed8991b..0000000 --- a/public/html/Settings/Dmptemplate.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - -class Settings::Dmptemplate - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Settings::Dmptemplate

- -
- -
- - - - -
- - - - - - -
-

Constants

-
- -
DEFAULT_SETTINGS - -
- - -
VALID_ADMIN_FIELDS - -
- - -
VALID_FONT_FACES - -
- - -
VALID_FONT_SIZE_RANGE - -
- - -
VALID_MARGIN_RANGE - -
- - -
-
- - - - - - -
- -
- - - - diff --git a/public/html/Settings/PlanList.html b/public/html/Settings/PlanList.html deleted file mode 100644 index d213468..0000000 --- a/public/html/Settings/PlanList.html +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - -class Settings::PlanList - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Settings::PlanList

- -
- -
- - - - -
- - - - - - -
-

Constants

-
- -
ALL_COLUMNS - -
- - -
DEFAULT_COLUMNS - -

TODO: can these be taken from somewhere else rather than hard-coded here?

- - -
-
- - - - - - -
- -
- - - - diff --git a/public/html/Settings/PlansController.html b/public/html/Settings/PlansController.html deleted file mode 100644 index 25d458b..0000000 --- a/public/html/Settings/PlansController.html +++ /dev/null @@ -1,486 +0,0 @@ - - - - - - -class Settings::PlansController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Settings::PlansController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- show() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/settings/plans_controller.rb, line 6
-def show
-  respond_to do |format|
-    format.html
-    format.partial
-    format.json { render json: settings_json }
-  end
-end
-
- -
- - - - -
- - -
- -
- update() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/settings/plans_controller.rb, line 14
-def update
-
-  export_params = params[:export].try(:deep_symbolize_keys)
-
-  settings = plan.super_settings(:export).tap do |s|
-    if params[:commit] == 'Reset'
-      s.formatting = nil
-      s.fields = nil
-    else
-      s.formatting = export_params[:formatting]
-      s.fields = export_params[:fields]
-      s.title  = export_params[:title]
-    end
-  end
-
-  if settings.save
-    respond_to do |format|
-      format.html { redirect_to(export_project_path(plan.project)) }
-      format.json { render json: settings_json }
-    end
-  else
-    settings.formatting = nil
-    @export_settings = settings
-    render(action: :show)
-  end
-end
-
- -
- - - - -
- - -
- -
-

Private Instance Methods

- - -
- -
- get_settings() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/settings/plans_controller.rb, line 43
-def get_settings
-  @export_settings = plan.settings(:export)
-end
-
- -
- - - - -
- - -
- -
- plan() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/settings/plans_controller.rb, line 51
-def plan
-  @plan ||= Plan.find(params[:id])
-end
-
- -
- - - - -
- - -
- -
- settings_json() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/settings/plans_controller.rb, line 47
-def settings_json
-  @settings_json ||= { export: @export_settings }.to_json
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/Settings/ProjectsController.html b/public/html/Settings/ProjectsController.html deleted file mode 100644 index aa17b2f..0000000 --- a/public/html/Settings/ProjectsController.html +++ /dev/null @@ -1,445 +0,0 @@ - - - - - - -class Settings::ProjectsController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Settings::ProjectsController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- show() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/settings/projects_controller.rb, line 7
-def show
-  respond_to do |format|
-    format.html
-    format.json { render json: settings_json }
-  end
-end
-
- -
- - - - -
- - -
- -
- update() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
-

Private Instance Methods

- - -
- -
- get_settings() - click to toggle source -
- - -
- - - - - -
-
# 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]
-end
-
- -
- - - - -
- - -
- -
- settings_json() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/settings/projects_controller.rb, line 36
-def settings_json
-  @settings_json ||= { selected_columns: @settings.columns, all_columns: @all_columns }.to_json
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/Settings/SettingsController.html b/public/html/Settings/SettingsController.html deleted file mode 100644 index 6273362..0000000 --- a/public/html/Settings/SettingsController.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -class Settings::SettingsController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Settings::SettingsController

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/SplashLog.html b/public/html/SplashLog.html deleted file mode 100644 index 41ac7d7..0000000 --- a/public/html/SplashLog.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -class SplashLog - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class SplashLog

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/SplashLogsController.html b/public/html/SplashLogsController.html deleted file mode 100644 index b00abb8..0000000 --- a/public/html/SplashLogsController.html +++ /dev/null @@ -1,337 +0,0 @@ - - - - - - -class SplashLogsController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class SplashLogsController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- create() - click to toggle source -
- - -
- -

POST /answers POST /answers.json

- - - -
-
# File app/controllers/splash_logs_controller.rb, line 5
-def create
-        @splash_log = SplashLog.new()
-        @splash_log.destination = params[:destination]
-        respond_to do |format|
-                if @splash_log.save
-                        cookies[:dmp_splash_seen] = {
-                                value: 'splash_dialog_seen',
-                                expires: 3.hours.from_now,
-                        }
-                        format.html { redirect_to params[:destination] }
-                else
-                        format.html { redirect_to home_url }
-                end
-        end
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/StaticPagesController.html b/public/html/StaticPagesController.html deleted file mode 100644 index 65858ab..0000000 --- a/public/html/StaticPagesController.html +++ /dev/null @@ -1,392 +0,0 @@ - - - - - - -class StaticPagesController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class StaticPagesController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- about_us() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/static_pages_controller.rb, line 3
-def about_us
-    dcc_news_feed_url = "http://www.dcc.ac.uk/news/dmponline-0/feed"
-      @dcc_news_feed = Feedzirra::Feed.fetch_and_parse(dcc_news_feed_url)
-      respond_to do |format|
-          format.rss { redirect_to dcc_news_feed_url }
-          format.html
-      end
-end
-
- -
- - - - -
- - -
- -
- contact_us() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/static_pages_controller.rb, line 12
-def contact_us
-end
-
- -
- - - - -
- - -
- -
- roadmap() - click to toggle source -
- - -
- - - - - -
-
# File app/controllers/static_pages_controller.rb, line 15
-def roadmap
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/SuggestedAnswer.html b/public/html/SuggestedAnswer.html deleted file mode 100644 index 707f287..0000000 --- a/public/html/SuggestedAnswer.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - -class SuggestedAnswer - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class SuggestedAnswer

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- to_s() - click to toggle source -
- - -
- - - - - -
-
# File app/models/suggested_answer.rb, line 11
-      def to_s
-  "#{text}"
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/Theme.html b/public/html/Theme.html deleted file mode 100644 index 5cb3a3a..0000000 --- a/public/html/Theme.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - -class Theme - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Theme

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- to_s() - click to toggle source -
- - -
- - - - - -
-
# File app/models/theme.rb, line 15
-def to_s
-      title
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/ThemesController.html b/public/html/ThemesController.html deleted file mode 100644 index 425e06a..0000000 --- a/public/html/ThemesController.html +++ /dev/null @@ -1,561 +0,0 @@ - - - - - - -class ThemesController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class ThemesController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- create() - click to toggle source -
- - -
- -

POST /themes POST /themes.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- destroy() - click to toggle source -
- - -
- -

DELETE /themes/1 DELETE /themes/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- edit() - click to toggle source -
- - -
- -

GET /themes/1/edit

- - - -
-
# File app/controllers/themes_controller.rb, line 36
-def edit
-  @theme = Theme.find(params[:id])
-end
-
- -
- - - - -
- - -
- -
- index() - click to toggle source -
- - -
- -

GET /themes GET /themes.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- new() - click to toggle source -
- - -
- -

GET /themes/new GET /themes/new.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- show() - click to toggle source -
- - -
- -

GET /themes/1 GET /themes/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- update() - click to toggle source -
- - -
- -

PUT /themes/1 PUT /themes/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/User.html b/public/html/User.html deleted file mode 100644 index a2e0c45..0000000 --- a/public/html/User.html +++ /dev/null @@ -1,661 +0,0 @@ - - - - - - -class User - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class User

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- current_organisation() - click to toggle source -
- - -
- - - - - -
-
# File app/models/user.rb, line 98
-def current_organisation
-        if self.organisations.count > 0 then
-                return self.organisations.last
-        else
-                return nil
-        end
-end
-
- -
- - - - -
- - -
- -
- filter(query) - click to toggle source -
- - -
- - - - - -
-
# File app/models/user.rb, line 19
-def filter(query)
-  return self unless query.present?
-
-  t = self.arel_table
-  q = "%#{query}%"
-
-  conditions = t[:title].matches(q)
-
-  columns = %(
-    grant_number identifier description principal_investigator data_contact
-  )
-
-  columns.each {|col| conditions = conditions.or(t[col].matches(q)) }
-
-  self.where(conditions)
-end
-
- -
- - - - -
- - -
- -
- can_super_admin?() - click to toggle source -
- - -
- - - - - -
-
# File app/models/user.rb, line 110
-def can_super_admin?
-        admin = roles.find_by_name("admin")
-        return !admin.nil?
-end
-
- -
- - - - -
- - -
- -
- can_org_admin?() - click to toggle source -
- - -
- - - - - -
-
# File app/models/user.rb, line 115
-def can_org_admin?
-        org_admin = roles.find_by_name("org_admin")
-        return !org_admin.nil?
-end
-
- -
- - - - -
- - -
- -
- name(use_email = true) - click to toggle source -
- - -
- - - - - -
-
# File app/models/user.rb, line 54
-def name(use_email = true)
-        if ((firstname.nil? && surname.nil?) || (firstname.strip == "" && surname.strip == "")) && use_email then
-                return email
-        else
-                name = "#{firstname} #{surname}"
-                return name.strip
-        end
-end
-
- -
- - - - -
- - -
- -
- org_type() - click to toggle source -
- - -
- - - - - -
-
# File app/models/user.rb, line 120
-def org_type
-    org_type = organisation.organisation_type.name
-            return org_type
-end
-
- -
- - - - -
- - -
- -
- organisation() - click to toggle source -
- - -
- - - - - -
-
# File app/models/user.rb, line 90
-def organisation
-        if self.organisations.count > 0 then
-                return self.organisations.first
-        else
-                return nil
-        end
-end
-
- -
- - - - -
- - -
- -
- organisation=(new_organisation) - click to toggle source -
- - -
- - - - - -
-
# File app/models/user.rb, line 106
-def organisation=(new_organisation)
-        organisation_id = organisation.id
-end
-
- -
- - - - -
- - -
- -
- organisation_id() - click to toggle source -
- - -
- - - - - -
-
# File app/models/user.rb, line 82
-def organisation_id
-        if self.organisations.count > 0 then
-                return self.organisations.first.id
-        else
-                return nil
-        end
-end
-
- -
- - - - -
- - -
- -
- organisation_id=(new_organisation_id) - click to toggle source -
- - -
- - - - - -
-
# File app/models/user.rb, line 63
-    def organisation_id=(new_organisation_id)
-if !self.user_org_roles.pluck(:organisation_id).include?(new_organisation_id.to_i) then
-            if self.user_org_roles.count != 1 then
-                    new_user_org_role = UserOrgRole.new
-                    new_user_org_role.organisation_id = new_organisation_id
-                    new_user_org_role.user_role_type = UserRoleType.find_by_name("user");
-                    self.user_org_roles << new_user_org_role
-            else
-                    user_org_role = self.user_org_roles.first
-                    user_org_role.organisation_id = new_organisation_id
-        user_org_role.save
-                    org_admin_role = roles.find_by_name("org_admin")
-                    unless org_admin_role.nil? then
-                            roles.delete(org_admin_role)
-                    end
-            end
-end
-    end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/UserMailer.html b/public/html/UserMailer.html deleted file mode 100644 index 9a51758..0000000 --- a/public/html/UserMailer.html +++ /dev/null @@ -1,393 +0,0 @@ - - - - - - -class UserMailer - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class UserMailer

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- permissions_change_notification(project_group) - click to toggle source -
- - -
- - - - - -
-
# File app/mailers/user_mailer.rb, line 9
-def permissions_change_notification(project_group)
-        @project_group = project_group
-        mail(to: @project_group.user.email, subject: "DMP permissions changed")
-end
-
- -
- - - - -
- - -
- -
- project_access_removed_notification(user, project) - click to toggle source -
- - -
- - - - - -
-
# File app/mailers/user_mailer.rb, line 14
-def project_access_removed_notification(user, project)
-        @user = user
-        @project = project
-        mail(to: @user.email, subject: "DMP access removed")
-end
-
- -
- - - - -
- - -
- -
- sharing_notification(project_group) - click to toggle source -
- - -
- - - - - -
-
# File app/mailers/user_mailer.rb, line 4
-def sharing_notification(project_group)
-        @project_group = project_group
-        mail(to: @project_group.user.email, subject: "You have been given access to a Data Management Plan")
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/UserOrgRole.html b/public/html/UserOrgRole.html deleted file mode 100644 index 6ec474a..0000000 --- a/public/html/UserOrgRole.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -class UserOrgRole - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class UserOrgRole

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/UserOrgRolesController.html b/public/html/UserOrgRolesController.html deleted file mode 100644 index 6612d49..0000000 --- a/public/html/UserOrgRolesController.html +++ /dev/null @@ -1,561 +0,0 @@ - - - - - - -class UserOrgRolesController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class UserOrgRolesController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- create() - click to toggle source -
- - -
- -

POST /user_org_roles POST /user_org_roles.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- destroy() - click to toggle source -
- - -
- -

DELETE /user_org_roles/1 DELETE /user_org_roles/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- edit() - click to toggle source -
- - -
- -

GET /user_org_roles/1/edit

- - - -
-
# File app/controllers/user_org_roles_controller.rb, line 36
-def edit
-  @user_org_role = UserOrgRole.find(params[:id])
-end
-
- -
- - - - -
- - -
- -
- index() - click to toggle source -
- - -
- -

GET /user_org_roles GET /user_org_roles.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- new() - click to toggle source -
- - -
- -

GET /user_org_roles/new GET /user_org_roles/new.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- show() - click to toggle source -
- - -
- -

GET /user_org_roles/1 GET /user_org_roles/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- update() - click to toggle source -
- - -
- -

PUT /user_org_roles/1 PUT /user_org_roles/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/UserRoleType.html b/public/html/UserRoleType.html deleted file mode 100644 index 1808bff..0000000 --- a/public/html/UserRoleType.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -class UserRoleType - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class UserRoleType

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/UserRoleTypesController.html b/public/html/UserRoleTypesController.html deleted file mode 100644 index 7ee343f..0000000 --- a/public/html/UserRoleTypesController.html +++ /dev/null @@ -1,561 +0,0 @@ - - - - - - -class UserRoleTypesController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class UserRoleTypesController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- create() - click to toggle source -
- - -
- -

POST /user_role_types POST /user_role_types.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- destroy() - click to toggle source -
- - -
- -

DELETE /user_role_types/1 DELETE /user_role_types/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- edit() - click to toggle source -
- - -
- -

GET /user_role_types/1/edit

- - - -
-
# File app/controllers/user_role_types_controller.rb, line 36
-def edit
-  @user_role_type = UserRoleType.find(params[:id])
-end
-
- -
- - - - -
- - -
- -
- index() - click to toggle source -
- - -
- -

GET /user_role_types GET /user_role_types.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- new() - click to toggle source -
- - -
- -

GET /user_role_types/new GET /user_role_types/new.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- show() - click to toggle source -
- - -
- -

GET /user_role_types/1 GET /user_role_types/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- update() - click to toggle source -
- - -
- -

PUT /user_role_types/1 PUT /user_role_types/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/UserStatus.html b/public/html/UserStatus.html deleted file mode 100644 index ece7b89..0000000 --- a/public/html/UserStatus.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -class UserStatus - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class UserStatus

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/UserStatusesController.html b/public/html/UserStatusesController.html deleted file mode 100644 index e74b843..0000000 --- a/public/html/UserStatusesController.html +++ /dev/null @@ -1,561 +0,0 @@ - - - - - - -class UserStatusesController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class UserStatusesController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- create() - click to toggle source -
- - -
- -

POST /user_statuses POST /user_statuses.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- destroy() - click to toggle source -
- - -
- -

DELETE /user_statuses/1 DELETE /user_statuses/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- edit() - click to toggle source -
- - -
- -

GET /user_statuses/1/edit

- - - -
-
# File app/controllers/user_statuses_controller.rb, line 36
-def edit
-  @user_status = UserStatus.find(params[:id])
-end
-
- -
- - - - -
- - -
- -
- index() - click to toggle source -
- - -
- -

GET /user_statuses GET /user_statuses.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- new() - click to toggle source -
- - -
- -

GET /user_statuses/new GET /user_statuses/new.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- show() - click to toggle source -
- - -
- -

GET /user_statuses/1 GET /user_statuses/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- update() - click to toggle source -
- - -
- -

PUT /user_statuses/1 PUT /user_statuses/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/UserType.html b/public/html/UserType.html deleted file mode 100644 index f37778b..0000000 --- a/public/html/UserType.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -class UserType - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class UserType

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/UserTypesController.html b/public/html/UserTypesController.html deleted file mode 100644 index 7a53fd5..0000000 --- a/public/html/UserTypesController.html +++ /dev/null @@ -1,561 +0,0 @@ - - - - - - -class UserTypesController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class UserTypesController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- create() - click to toggle source -
- - -
- -

POST /user_types POST /user_types.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- destroy() - click to toggle source -
- - -
- -

DELETE /user_types/1 DELETE /user_types/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- edit() - click to toggle source -
- - -
- -

GET /user_types/1/edit

- - - -
-
# File app/controllers/user_types_controller.rb, line 36
-def edit
-  @user_type = UserType.find(params[:id])
-end
-
- -
- - - - -
- - -
- -
- index() - click to toggle source -
- - -
- -

GET /user_types GET /user_types.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- new() - click to toggle source -
- - -
- -

GET /user_types/new GET /user_types/new.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- show() - click to toggle source -
- - -
- -

GET /user_types/1 GET /user_types/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- update() - click to toggle source -
- - -
- -

PUT /user_types/1 PUT /user_types/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/Users.html b/public/html/Users.html deleted file mode 100644 index f059ad1..0000000 --- a/public/html/Users.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - -module Users - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

module Users

- -
- -
- - - - -
- - - - - - - - - - -
- -
- - - - diff --git a/public/html/Users/OmniauthCallbacksController.html b/public/html/Users/OmniauthCallbacksController.html deleted file mode 100644 index ee178a1..0000000 --- a/public/html/Users/OmniauthCallbacksController.html +++ /dev/null @@ -1,374 +0,0 @@ - - - - - - -class Users::OmniauthCallbacksController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Users::OmniauthCallbacksController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- shibboleth() - click to toggle source -
- - -
- - - - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/UsersController.html b/public/html/UsersController.html deleted file mode 100644 index 6ac90b1..0000000 --- a/public/html/UsersController.html +++ /dev/null @@ -1,523 +0,0 @@ - - - - - - -class UsersController - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class UsersController

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- create() - click to toggle source -
- - -
- -

POST /users POST /users.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- destroy() - click to toggle source -
- - -
- -

DELETE /users/1 DELETE /users/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- edit() - click to toggle source -
- - -
- -

GET /users/1/edit

- - - -
-
# File app/controllers/users_controller.rb, line 25
-def edit
-  @user = User.find(params[:id])
-end
-
- -
- - - - -
- - -
- -
- new() - click to toggle source -
- - -
- -

GET /users/new GET /users/new.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- show() - click to toggle source -
- - -
- -

GET /users/1 GET /users/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- update() - click to toggle source -
- - -
- -

PUT /users/1 PUT /users/1.json

- - - -
-
# 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
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/Version.html b/public/html/Version.html deleted file mode 100644 index bfa9737..0000000 --- a/public/html/Version.html +++ /dev/null @@ -1,357 +0,0 @@ - - - - - - -class Version - DMPonline4 Documentation - - - - - - - - - - - - - - - - -
-

class Version

- -
- -
- - - - -
- - - - - - - - - - -
-

Public Instance Methods

- - -
- -
- global_sections() - click to toggle source -
- - -
- - - - - -
-
# File app/models/version.rb, line 22
-def global_sections
-      sections.find_all_by_organisation_id(phase.dmptemplate.organisation_id)
-end
-
- -
- - - - -
- - -
- -
- to_s() - click to toggle source -
- - -
- - - - - -
-
# File app/models/version.rb, line 16
-def to_s
-      "#{title}"
-end
-
- -
- - - - -
- - -
- -
- -
- - - - diff --git a/public/html/created.rid b/public/html/created.rid deleted file mode 100644 index 7b8cddd..0000000 --- a/public/html/created.rid +++ /dev/null @@ -1,114 +0,0 @@ -Mon, 09 Nov 2015 14:55:18 +0000 -README.rdoc Tue, 28 Jul 2015 13:51:53 +0100 -app/admin/dashboard.rb Wed, 18 Mar 2015 14:45:56 +0000 -app/admin/dmptemplate.rb Wed, 18 Mar 2015 11:10:34 +0000 -app/admin/guidance.rb Fri, 02 Oct 2015 10:07:14 +0100 -app/admin/guidance_group.rb Mon, 09 Nov 2015 14:30:03 +0000 -app/admin/option.rb Fri, 02 Oct 2015 10:09:28 +0100 -app/admin/organisation.rb Fri, 02 Oct 2015 10:09:28 +0100 -app/admin/organisation_type.rb Fri, 02 Oct 2015 10:09:28 +0100 -app/admin/phase.rb Fri, 02 Oct 2015 10:09:28 +0100 -app/admin/project.rb Fri, 02 Oct 2015 10:09:28 +0100 -app/admin/project_group.rb Wed, 11 Mar 2015 16:23:43 +0000 -app/admin/question.rb Fri, 02 Oct 2015 10:09:28 +0100 -app/admin/question_format.rb Fri, 02 Oct 2015 10:09:28 +0100 -app/admin/role.rb Fri, 02 Oct 2015 10:09:28 +0100 -app/admin/section.rb Fri, 02 Oct 2015 10:09:28 +0100 -app/admin/suggested_answer.rb Wed, 11 Mar 2015 16:23:43 +0000 -app/admin/theme.rb Fri, 02 Oct 2015 10:09:28 +0100 -app/admin/user.rb Wed, 28 Oct 2015 11:08:46 +0000 -app/admin/user_org_role.rb Fri, 02 Oct 2015 10:09:28 +0100 -app/admin/user_role_type.rb Fri, 02 Oct 2015 10:09:28 +0100 -app/admin/user_status.rb Fri, 02 Oct 2015 10:09:28 +0100 -app/admin/user_type.rb Fri, 02 Oct 2015 10:09:28 +0100 -app/admin/version.rb Fri, 02 Oct 2015 10:09:28 +0100 -app/controllers/answers_controller.rb Thu, 16 Apr 2015 10:05:23 +0100 -app/controllers/application_controller.rb Fri, 09 Oct 2015 16:05:22 +0100 -app/controllers/comments_controller.rb Tue, 19 May 2015 16:11:58 +0100 -app/controllers/confirmations_controller.rb Wed, 09 Oct 2013 11:00:51 +0100 -app/controllers/contacts_controller.rb Mon, 27 Jul 2015 16:51:02 +0100 -app/controllers/dmptemplates_controller.rb Mon, 10 Aug 2015 12:44:35 +0100 -app/controllers/existing_users_controller.rb Tue, 26 Nov 2013 17:15:46 +0000 -app/controllers/guidance_groups_controller.rb Sun, 09 Aug 2015 14:54:18 +0100 -app/controllers/guidances_controller.rb Sun, 05 Jul 2015 22:48:47 +0100 -app/controllers/home_controller.rb Thu, 26 Sep 2013 17:04:25 +0100 -app/controllers/organisation_users_controller.rb Mon, 27 Jan 2014 15:09:50 +0000 -app/controllers/organisations_controller.rb Sun, 09 Aug 2015 14:52:46 +0100 -app/controllers/passwords_controller.rb Wed, 09 Oct 2013 11:00:51 +0100 -app/controllers/plans_controller.rb Mon, 26 Oct 2015 18:34:42 +0000 -app/controllers/project_groups_controller.rb Mon, 09 Dec 2013 10:57:33 +0000 -app/controllers/projects_controller.rb Sun, 05 Jul 2015 19:32:06 +0100 -app/controllers/registrations_controller.rb Wed, 23 Jul 2014 11:56:43 +0100 -app/controllers/sessions_controller.rb Mon, 24 Aug 2015 13:24:15 +0100 -app/controllers/settings.rb Fri, 02 Oct 2015 12:12:20 +0100 -app/controllers/settings/plans_controller.rb Wed, 09 Jul 2014 16:26:32 +0100 -app/controllers/settings/projects_controller.rb Mon, 07 Jul 2014 11:30:19 +0100 -app/controllers/splash_logs_controller.rb Wed, 27 Nov 2013 15:15:11 +0000 -app/controllers/static_pages_controller.rb Thu, 21 May 2015 16:13:16 +0100 -app/controllers/themes_controller.rb Tue, 24 Sep 2013 15:31:14 +0100 -app/controllers/user_org_roles_controller.rb Tue, 24 Sep 2013 15:31:14 +0100 -app/controllers/user_role_types_controller.rb Tue, 24 Sep 2013 15:31:14 +0100 -app/controllers/user_statuses_controller.rb Tue, 24 Sep 2013 15:31:14 +0100 -app/controllers/user_types_controller.rb Tue, 24 Sep 2013 15:31:14 +0100 -app/controllers/users/omniauth_callback_controller.rb Mon, 27 Jul 2015 12:31:00 +0100 -app/controllers/users/omniauth_shibboleth_request_controller.rb Tue, 15 Apr 2014 13:55:12 +0100 -app/controllers/users_controller.rb Tue, 12 May 2015 18:45:56 +0100 -app/helpers/application_helper.rb Mon, 10 Aug 2015 02:17:40 +0100 -app/helpers/plans_helper.rb Mon, 07 Jul 2014 11:30:19 +0100 -app/mailers/user_mailer.rb Tue, 26 Nov 2013 14:18:11 +0000 -app/models/ability.rb Tue, 06 Oct 2015 19:51:17 +0100 -app/models/answer.rb Tue, 06 Oct 2015 19:49:57 +0100 -app/models/comment.rb Tue, 06 Oct 2015 19:49:53 +0100 -app/models/dmptemplate.rb Tue, 06 Oct 2015 19:49:56 +0100 -app/models/exported_plan.rb Wed, 21 Oct 2015 14:41:40 +0100 -app/models/file_type.rb Tue, 06 Oct 2015 19:51:17 +0100 -app/models/file_upload.rb Tue, 06 Oct 2015 19:51:18 +0100 -app/models/guidance.rb Tue, 06 Oct 2015 19:49:51 +0100 -app/models/guidance_group.rb Tue, 06 Oct 2015 19:49:52 +0100 -app/models/option.rb Tue, 06 Oct 2015 19:49:56 +0100 -app/models/option_warning.rb Tue, 06 Oct 2015 19:49:57 +0100 -app/models/organisation.rb Tue, 06 Oct 2015 19:49:55 +0100 -app/models/organisation_type.rb Tue, 06 Oct 2015 19:51:18 +0100 -app/models/phase.rb Tue, 06 Oct 2015 19:49:51 +0100 -app/models/plan.rb Tue, 06 Oct 2015 19:49:56 +0100 -app/models/plan_section.rb Tue, 06 Oct 2015 19:51:19 +0100 -app/models/project.rb Tue, 06 Oct 2015 19:49:52 +0100 -app/models/project_group.rb Tue, 06 Oct 2015 19:51:19 +0100 -app/models/project_partner.rb Tue, 06 Oct 2015 19:51:16 +0100 -app/models/question.rb Tue, 06 Oct 2015 19:49:55 +0100 -app/models/question_format.rb Tue, 06 Oct 2015 19:51:20 +0100 -app/models/role.rb Tue, 06 Oct 2015 19:49:53 +0100 -app/models/section.rb Tue, 06 Oct 2015 19:51:20 +0100 -app/models/settings/dmptemplate.rb Tue, 06 Oct 2015 19:51:24 +0100 -app/models/settings/plan_list.rb Tue, 06 Oct 2015 19:51:25 +0100 -app/models/splash_log.rb Tue, 06 Oct 2015 19:51:20 +0100 -app/models/suggested_answer.rb Tue, 06 Oct 2015 19:51:21 +0100 -app/models/theme.rb Tue, 06 Oct 2015 19:51:21 +0100 -app/models/user.rb Tue, 06 Oct 2015 19:49:54 +0100 -app/models/user_org_role.rb Tue, 06 Oct 2015 19:51:22 +0100 -app/models/user_role_type.rb Tue, 06 Oct 2015 19:51:22 +0100 -app/models/user_status.rb Tue, 06 Oct 2015 19:51:23 +0100 -app/models/user_type.rb Tue, 06 Oct 2015 19:51:23 +0100 -app/models/version.rb Tue, 06 Oct 2015 19:51:24 +0100 -lib/active_admin_views_pages_base.rb Wed, 20 Nov 2013 16:27:04 +0000 -lib/custom_failure.rb Tue, 24 Sep 2013 15:31:14 +0100 -config/application.rb Tue, 06 Oct 2015 15:02:51 +0100 -config/boot.rb Tue, 24 Sep 2013 15:31:14 +0100 -config/environment.rb Tue, 24 Sep 2013 15:31:14 +0100 -config/environments/development.rb Mon, 14 Jul 2014 15:43:22 +0100 -config/environments/production.rb Mon, 14 Jul 2014 15:43:22 +0100 -config/environments/test.rb Tue, 28 Jan 2014 12:43:49 +0000 -config/initializers/active_admin.rb Mon, 12 Oct 2015 16:20:30 +0100 -config/initializers/backtrace_silencers.rb Tue, 24 Sep 2013 15:31:14 +0100 -config/initializers/contact_us.rb Mon, 14 Jul 2014 15:43:22 +0100 -config/initializers/devise.rb Fri, 02 Oct 2015 10:16:28 +0100 -config/initializers/formtastic.rb Tue, 24 Sep 2013 15:31:14 +0100 -config/initializers/inflections.rb Tue, 24 Sep 2013 15:31:14 +0100 -config/initializers/locale.rb Tue, 24 Sep 2013 15:31:14 +0100 -config/initializers/mime_types.rb Mon, 14 Jul 2014 15:43:22 +0100 -config/initializers/omniauth.rb Mon, 07 Jul 2014 11:30:12 +0100 -config/initializers/recaptcha.rb Wed, 16 Jul 2014 16:29:56 +0100 -config/initializers/secret_token.rb Mon, 14 Jul 2014 15:43:22 +0100 -config/initializers/session_store.rb Tue, 24 Sep 2013 15:31:14 +0100 -config/initializers/wrap_parameters.rb Tue, 24 Sep 2013 15:31:14 +0100 -config/routes.rb Thu, 21 May 2015 15:42:52 +0100 diff --git a/public/html/images/add.png b/public/html/images/add.png deleted file mode 100644 index 6332fef..0000000 --- a/public/html/images/add.png +++ /dev/null Binary files differ diff --git a/public/html/images/brick.png b/public/html/images/brick.png deleted file mode 100644 index 7851cf3..0000000 --- a/public/html/images/brick.png +++ /dev/null Binary files differ diff --git a/public/html/images/brick_link.png b/public/html/images/brick_link.png deleted file mode 100644 index 9ebf013..0000000 --- a/public/html/images/brick_link.png +++ /dev/null Binary files differ diff --git a/public/html/images/bug.png b/public/html/images/bug.png deleted file mode 100644 index 2d5fb90..0000000 --- a/public/html/images/bug.png +++ /dev/null Binary files differ diff --git a/public/html/images/bullet_black.png b/public/html/images/bullet_black.png deleted file mode 100644 index 5761970..0000000 --- a/public/html/images/bullet_black.png +++ /dev/null Binary files differ diff --git a/public/html/images/bullet_toggle_minus.png b/public/html/images/bullet_toggle_minus.png deleted file mode 100644 index b47ce55..0000000 --- a/public/html/images/bullet_toggle_minus.png +++ /dev/null Binary files differ diff --git a/public/html/images/bullet_toggle_plus.png b/public/html/images/bullet_toggle_plus.png deleted file mode 100644 index 9ab4a89..0000000 --- a/public/html/images/bullet_toggle_plus.png +++ /dev/null Binary files differ diff --git a/public/html/images/date.png b/public/html/images/date.png deleted file mode 100644 index 783c833..0000000 --- a/public/html/images/date.png +++ /dev/null Binary files differ diff --git a/public/html/images/delete.png b/public/html/images/delete.png deleted file mode 100644 index 08f2493..0000000 --- a/public/html/images/delete.png +++ /dev/null Binary files differ diff --git a/public/html/images/find.png b/public/html/images/find.png deleted file mode 100644 index 1547479..0000000 --- a/public/html/images/find.png +++ /dev/null Binary files differ diff --git a/public/html/images/loadingAnimation.gif b/public/html/images/loadingAnimation.gif deleted file mode 100644 index 82290f4..0000000 --- a/public/html/images/loadingAnimation.gif +++ /dev/null Binary files differ diff --git a/public/html/images/macFFBgHack.png b/public/html/images/macFFBgHack.png deleted file mode 100644 index c6473b3..0000000 --- a/public/html/images/macFFBgHack.png +++ /dev/null Binary files differ diff --git a/public/html/images/package.png b/public/html/images/package.png deleted file mode 100644 index da3c2a2..0000000 --- a/public/html/images/package.png +++ /dev/null Binary files differ diff --git a/public/html/images/page_green.png b/public/html/images/page_green.png deleted file mode 100644 index de8e003..0000000 --- a/public/html/images/page_green.png +++ /dev/null Binary files differ diff --git a/public/html/images/page_white_text.png b/public/html/images/page_white_text.png deleted file mode 100644 index 813f712..0000000 --- a/public/html/images/page_white_text.png +++ /dev/null Binary files differ diff --git a/public/html/images/page_white_width.png b/public/html/images/page_white_width.png deleted file mode 100644 index 1eb8809..0000000 --- a/public/html/images/page_white_width.png +++ /dev/null Binary files differ diff --git a/public/html/images/plugin.png b/public/html/images/plugin.png deleted file mode 100644 index 6187b15..0000000 --- a/public/html/images/plugin.png +++ /dev/null Binary files differ diff --git a/public/html/images/ruby.png b/public/html/images/ruby.png deleted file mode 100644 index f763a16..0000000 --- a/public/html/images/ruby.png +++ /dev/null Binary files differ diff --git a/public/html/images/tag_blue.png b/public/html/images/tag_blue.png deleted file mode 100644 index 3f02b5f..0000000 --- a/public/html/images/tag_blue.png +++ /dev/null Binary files differ diff --git a/public/html/images/tag_green.png b/public/html/images/tag_green.png deleted file mode 100644 index 83ec984..0000000 --- a/public/html/images/tag_green.png +++ /dev/null Binary files differ diff --git a/public/html/images/transparent.png b/public/html/images/transparent.png deleted file mode 100644 index d665e17..0000000 --- a/public/html/images/transparent.png +++ /dev/null Binary files differ diff --git a/public/html/images/wrench.png b/public/html/images/wrench.png deleted file mode 100644 index 5c8213f..0000000 --- a/public/html/images/wrench.png +++ /dev/null Binary files differ diff --git a/public/html/images/wrench_orange.png b/public/html/images/wrench_orange.png deleted file mode 100644 index 565a933..0000000 --- a/public/html/images/wrench_orange.png +++ /dev/null Binary files differ diff --git a/public/html/images/zoom.png b/public/html/images/zoom.png deleted file mode 100644 index 908612e..0000000 --- a/public/html/images/zoom.png +++ /dev/null Binary files differ diff --git a/public/html/index.html b/public/html/index.html deleted file mode 100644 index d4524bb..0000000 --- a/public/html/index.html +++ /dev/null @@ -1,310 +0,0 @@ - - - - - - -DMPonline4 Documentation - - - - - - - - - - - - - - - - -
- -

DMPonline v4

- -

DMPonline is the DCC's data management planning tool, available at dmponline.dcc.ac.uk

- -

Development of the DMPonline by the Digital Curation Centre has been funded -by JISC. JISC inspires UK colleges and universities in the innovative use -of digital technologies, helping to maintain the UK's position as a -global leader in education. www.jisc.ac.uk

- -

This is just the application code, the accompanying question data available -at dmponline.dcc.ac.uk is not -included.

- -

The tool has four main functions

-
  1. -

    To help create and maintain different versions of Data Management Plans;

    -
  2. -

    To provide useful guidance on data management issues and how to meet -research funders' requirements;

    -
  3. -

    To export attractive and useful plans in a variety of formats;

    -
  4. -

    To allow collaborative work when creating Data Management Plans.

    -
- -

Documentation & Support

- - -

Bugs & Feature Requests

- - -

Prerequisites

- -

DMPonline is a Ruby on Rails application and you will need to have Ruby -2.0.0p247 or greater installed on your server and a MySQL server v5.0 or -greater.

- -

Further details on how to install Ruby on Rails applications are available -from the Ruby on Rails site, rubyonrails.org

- -

You may also find the following resources handy:

- - - - -

Copyright © 2013 Digital Curation Centre, University of Edinburgh.

- -

This program is free software: you can redistribute it and/or modify it -under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or (at your -option) any later version.

- -

This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License -for more details.

- -

You should have received a copy of the GNU Affero General Public License -along with this program. If not, see www.gnu.org/licenses.

- -
- - - - diff --git a/public/html/js/darkfish.js b/public/html/js/darkfish.js deleted file mode 100644 index 92d8280..0000000 --- a/public/html/js/darkfish.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * - * Darkfish Page Functions - * $Id: darkfish.js 53 2009-01-07 02:52:03Z deveiant $ - * - * Author: Michael Granger - * - */ - -/* Provide console simulation for firebug-less environments */ -if (!("console" in window) || !("firebug" in console)) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", - "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; - - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -}; - - -/** - * Unwrap the first element that matches the given @expr@ from the targets and return them. - */ -$.fn.unwrap = function( expr ) { - return this.each( function() { - $(this).parents( expr ).eq( 0 ).after( this ).remove(); - }); -}; - - -function showSource( e ) { - var target = e.target; - var codeSections = $(target). - parents('.method-detail'). - find('.method-source-code'); - - $(target). - parents('.method-detail'). - find('.method-source-code'). - slideToggle(); -}; - -function hookSourceViews() { - $('.method-heading').click( showSource ); -}; - -function toggleDebuggingSection() { - $('.debugging-section').slideToggle(); -}; - -function hookDebuggingToggle() { - $('#debugging-toggle img').click( toggleDebuggingSection ); -}; - -function hookTableOfContentsToggle() { - $('.indexpage li .toc-toggle').each( function() { - $(this).click( function() { - $(this).toggleClass('open'); - }); - - var section = $(this).next(); - - $(this).click( function() { - section.slideToggle(); - }); - }); -} - -function hookSearch() { - var input = $('#search-field').eq(0); - var result = $('#search-results').eq(0); - $(result).show(); - - var search_section = $('#search-section').get(0); - $(search_section).show(); - - var search = new Search(search_data, input, result); - - search.renderItem = function(result) { - var li = document.createElement('li'); - var html = ''; - - // TODO add relative path to - - - - - - - - - - -

Table of Contents - DMPonline4 Documentation

- -

Pages

- - -

Classes/Modules

- - -

Methods

- - - - -