erp_work_effort 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. data/GPL-3-LICENSE +674 -0
  2. data/README.rdoc +1 -0
  3. data/Rakefile +31 -0
  4. data/app/assets/javascripts/erp_work_effort/application.js +9 -0
  5. data/app/assets/stylesheets/erp_work_effort/application.css +7 -0
  6. data/app/controllers/erp_work_effort/application_controller.rb +4 -0
  7. data/app/helpers/erp_work_effort/application_helper.rb +4 -0
  8. data/app/models/cost.rb +3 -0
  9. data/app/models/extensions/party.rb +3 -0
  10. data/app/models/party_resource_availability.rb +5 -0
  11. data/app/models/party_resource_availability_type.rb +7 -0
  12. data/app/models/project_effort.rb +2 -0
  13. data/app/models/project_requirement.rb +2 -0
  14. data/app/models/support_effort.rb +2 -0
  15. data/app/models/support_requirement.rb +2 -0
  16. data/app/models/valid_work_assignment.rb +8 -0
  17. data/app/models/valid_work_assignment_attribute.rb +3 -0
  18. data/app/models/work_effort.rb +135 -0
  19. data/app/models/work_effort_assignment.rb +15 -0
  20. data/app/models/work_effort_status.rb +4 -0
  21. data/app/models/work_effort_status_type.rb +13 -0
  22. data/app/models/work_requirement.rb +76 -0
  23. data/app/models/work_requirement_work_effort_status_type.rb +4 -0
  24. data/app/views/layouts/erp_work_effort/application.html.erb +14 -0
  25. data/config/routes.rb +2 -0
  26. data/db/migrate/20100220000000_base_work_efforts.rb +208 -0
  27. data/lib/erp_work_effort.rb +5 -0
  28. data/lib/erp_work_effort/engine.rb +13 -0
  29. data/lib/erp_work_effort/extensions.rb +4 -0
  30. data/lib/erp_work_effort/extensions/active_record/acts_as_project_effort.rb +66 -0
  31. data/lib/erp_work_effort/extensions/active_record/acts_as_project_requirement.rb +64 -0
  32. data/lib/erp_work_effort/extensions/active_record/acts_as_support_effort.rb +61 -0
  33. data/lib/erp_work_effort/extensions/active_record/acts_as_support_requirement.rb +68 -0
  34. data/lib/erp_work_effort/version.rb +3 -0
  35. data/lib/tasks/erp_work_effort_tasks.rake +4 -0
  36. data/spec/dummy/Rakefile +7 -0
  37. data/spec/dummy/app/assets/javascripts/application.js +9 -0
  38. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  39. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  40. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  41. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  42. data/spec/dummy/config.ru +4 -0
  43. data/spec/dummy/config/application.rb +43 -0
  44. data/spec/dummy/config/boot.rb +10 -0
  45. data/spec/dummy/config/database.yml +8 -0
  46. data/spec/dummy/config/environment.rb +5 -0
  47. data/spec/dummy/config/environments/spec.rb +27 -0
  48. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  49. data/spec/dummy/config/initializers/inflections.rb +10 -0
  50. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  51. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  52. data/spec/dummy/config/initializers/session_store.rb +8 -0
  53. data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
  54. data/spec/dummy/config/locales/en.yml +5 -0
  55. data/spec/dummy/config/routes.rb +3 -0
  56. data/spec/dummy/public/404.html +26 -0
  57. data/spec/dummy/public/422.html +26 -0
  58. data/spec/dummy/public/500.html +26 -0
  59. data/spec/dummy/public/favicon.ico +0 -0
  60. data/spec/dummy/script/rails +6 -0
  61. data/spec/models/cost_spec.rb +11 -0
  62. data/spec/models/party_resource_availability_spec.rb +11 -0
  63. data/spec/models/party_resource_availability_type_spec.rb +11 -0
  64. data/spec/models/project_effort_spec.rb +11 -0
  65. data/spec/models/project_requirement_spec.rb +11 -0
  66. data/spec/models/support_effort_spec.rb +11 -0
  67. data/spec/models/support_requirement_spec.rb +11 -0
  68. data/spec/models/valid_work_assignment_attribute_spec.rb +11 -0
  69. data/spec/models/valid_work_assignment_spec.rb +11 -0
  70. data/spec/models/work_effort_assignment_spec.rb +13 -0
  71. data/spec/models/work_effort_spec.rb +11 -0
  72. data/spec/models/work_effort_status_spec.rb +11 -0
  73. data/spec/models/work_effort_status_type_spec.rb +11 -0
  74. data/spec/models/work_requirement_spec.rb +11 -0
  75. data/spec/models/work_requirement_work_effort_status_type._spec.rb +11 -0
  76. data/spec/spec_helper.rb +60 -0
  77. metadata +195 -0
@@ -0,0 +1,5 @@
1
+ require "erp_work_effort/extensions"
2
+ require "erp_work_effort/engine"
3
+
4
+ module ErpWorkEffort
5
+ end
@@ -0,0 +1,13 @@
1
+ module ErpWorkEffort
2
+ class Engine < Rails::Engine
3
+ isolate_namespace ErpWorkEffort
4
+
5
+ ActiveSupport.on_load(:active_record) do
6
+ include ErpWorkEffort::Extensions::ActiveRecord::ActsAsProjectEffort
7
+ include ErpWorkEffort::Extensions::ActiveRecord::ActsAsProjectRequirement
8
+ include ErpWorkEffort::Extensions::ActiveRecord::ActsAsSupportEffort
9
+ include ErpWorkEffort::Extensions::ActiveRecord::ActsAsSupportRequirement
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,4 @@
1
+ require 'erp_work_effort/extensions/active_record/acts_as_project_effort'
2
+ require 'erp_work_effort/extensions/active_record/acts_as_project_requirement'
3
+ require 'erp_work_effort/extensions/active_record/acts_as_support_effort'
4
+ require 'erp_work_effort/extensions/active_record/acts_as_support_requirement'
@@ -0,0 +1,66 @@
1
+ module ErpWorkEffort
2
+ module Extensions
3
+ module ActiveRecord
4
+ module ActsAsProjectEffort
5
+
6
+ def self.included(base)
7
+ base.extend(ClassMethods)
8
+ end
9
+
10
+ module ClassMethods
11
+ def acts_as_project_effort
12
+ extend ActsAsProjectEffort::SingletonMethods
13
+ include ActsAsProjectEffort::InstanceMethods
14
+
15
+ after_initialize :new_project_effort
16
+ after_update :save_project_effort
17
+ after_save :save_project_effort
18
+ after_destroy :destroy_project_effort
19
+
20
+ has_one :project_effort, :as => :work_effort_record
21
+
22
+ [
23
+ :description,
24
+ :description=,
25
+ :facility,
26
+ :facility=,
27
+ :work_effort_assignment,
28
+ :work_effort_statuses,
29
+ :projected_cost,
30
+ :projected_cost=,
31
+ :projected_completion_time,
32
+ :projected_completion_time=,
33
+ :actual_cost,
34
+ :start,
35
+ :started?,
36
+ :completed?,
37
+ :send_to_status
38
+ ].each do |m| delegate m, :to => :project_effort end
39
+
40
+ end
41
+ end
42
+
43
+ module SingletonMethods
44
+ end
45
+
46
+ module InstanceMethods
47
+ def save_project_effort
48
+ self.project_effort.save
49
+ end
50
+
51
+ def destroy_project_effort
52
+ self.project_effort.destroy
53
+ end
54
+
55
+ def new_project_effort
56
+ if (self.project_effort.nil?)
57
+ project_effort = ProjectEffort.new
58
+ self.project_effort = project_effort
59
+ project_effort.work_effort_record = self
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,64 @@
1
+ module ErpWorkEffort
2
+ module Extensions
3
+ module ActiveRecord
4
+ module ActsAsProjectRequirement
5
+
6
+ def self.included(base)
7
+ base.extend(ClassMethods)
8
+ end
9
+
10
+ module ClassMethods
11
+ def acts_as_project_requirement
12
+ extend ActsAsProjectRequirement::SingletonMethods
13
+ include ActsAsProjectRequirement::InstanceMethods
14
+
15
+ after_initialize :new_project_requirement
16
+ after_update :save_project_requirement
17
+ after_save :save_project_requirement
18
+ after_destroy :destroy_project_requirement
19
+
20
+ has_one :project_requirement, :as => :work_requirement_record
21
+
22
+ [
23
+ :description,
24
+ :description=,
25
+ :facility,
26
+ :facility=,
27
+ :valid_work_assignments,
28
+ :work_requirement_work_effort_status_types,
29
+ :work_effort_status_types,
30
+ :projected_cost=,
31
+ :projected_cost,
32
+ :projected_completion_time,
33
+ :projected_completion_time=,
34
+ :add_status_type,
35
+ :add_status_type=
36
+ ].each do |m| delegate m, :to => :project_requirement end
37
+
38
+ end
39
+ end
40
+
41
+ module SingletonMethods
42
+ end
43
+
44
+ module InstanceMethods
45
+ def save_project_requirement
46
+ self.project_requirement.save
47
+ end
48
+
49
+ def destroy_project_requirement
50
+ self.project_requirement.destroy
51
+ end
52
+
53
+ def new_project_requirement
54
+ if (self.project_requirement.nil?)
55
+ project_requirement = ProjectRequirement.new
56
+ self.project_requirement = project_requirement
57
+ project_requirement.work_requirement_record = self
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,61 @@
1
+ module ErpWorkEffort
2
+ module Extensions
3
+ module ActiveRecord
4
+ module ActsAsSupportEffort
5
+
6
+ def self.included(base)
7
+ base.extend(ClassMethods)
8
+ end
9
+
10
+ module ClassMethods
11
+ def acts_as_support_effort
12
+ extend ActsAsSupportEffort::SingletonMethods
13
+ include ActsAsSupportEffort::InstanceMethods
14
+
15
+ after_initialize :new_support_effort
16
+ after_update :save_support_effort
17
+ after_save :save_support_effort
18
+ after_destroy :destroy_support_effort
19
+
20
+ has_one :support_effort, :as => :work_effort_record
21
+
22
+ [
23
+ :facility,
24
+ :facility=,
25
+ :work_effort_assignment,
26
+ :work_effort_statuses,
27
+ :projected_cost,
28
+ :actual_cost
29
+ ].each do |m| delegate m, :to => :support_effort end
30
+
31
+ end
32
+ end
33
+
34
+ module SingletonMethods
35
+ end
36
+
37
+ module InstanceMethods
38
+ def method_missing(name, *args)
39
+ self.support_effort.respond_to?(name) ? self.support_effort.send(name, *args) : super
40
+ end
41
+
42
+ def save_support_effort
43
+ self.support_effort.save
44
+ end
45
+
46
+ def destroy_support_effort
47
+ self.support_effort.destroy
48
+ end
49
+
50
+ def new_support_effort
51
+ if (self.support_effort.nil?)
52
+ support_effort = SupportEffort.new
53
+ self.support_effort = support_effort
54
+ support_effort.work_effort_record = self
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,68 @@
1
+ module ErpWorkEffort
2
+ module Extensions
3
+ module ActiveRecord
4
+ module ActsAsSupportRequirement
5
+
6
+ def self.included(base)
7
+ base.extend(ClassMethods)
8
+ end
9
+
10
+ module ClassMethods
11
+ def acts_as_support_requirement
12
+ extend ActsAsSupportRequirement::SingletonMethods
13
+ include ActsAsSupportRequirement::InstanceMethods
14
+
15
+ after_initialize :new_support_requirement
16
+ after_update :save_support_requirement
17
+ after_save :save_support_requirement
18
+ after_destroy :destroy_support_requirement
19
+
20
+ has_one :support_requirement, :as => :work_requirement_record
21
+
22
+ [
23
+ :description,
24
+ :description=,
25
+ :facility,
26
+ :facility=,
27
+ :valid_work_assignments,
28
+ :work_requirement_work_effort_status_types,
29
+ :work_effort_status_types,
30
+ :projected_cost=,
31
+ :projected_cost,
32
+ :projected_completion_time,
33
+ :projected_completion_time=,
34
+ :add_status_type,
35
+ :add_status_type=
36
+ ].each do |m| delegate m, :to => :support_requirement end
37
+
38
+ end
39
+ end
40
+
41
+ module SingletonMethods
42
+ end
43
+
44
+ module InstanceMethods
45
+ def method_missing(name, *args)
46
+ self.support_requirement.respond_to?(name) ? self.support_requirement.send(name, *args) : super
47
+ end
48
+
49
+ def save_support_requirement
50
+ self.support_requirement.save
51
+ end
52
+
53
+ def destroy_support_requirement
54
+ self.support_requirement.destroy
55
+ end
56
+
57
+ def new_support_requirement
58
+ if (self.support_requirement.nil?)
59
+ support_requirement = SupportEffort.new
60
+ self.support_requirement = support_requirement
61
+ support_requirement.work_requirement_record = self
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,3 @@
1
+ module ErpWorkEffort
2
+ VERSION = "3.0.0"
3
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :erp_work_effort do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,9 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require jquery
8
+ //= require jquery_ujs
9
+ //= require_tree .
@@ -0,0 +1,7 @@
1
+ /*
2
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
5
+ *= require_self
6
+ *= require_tree .
7
+ */
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,43 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require
6
+ require 'erp_tech_svcs'
7
+ require "erp_work_effort"
8
+
9
+ module Dummy
10
+ class Application < Rails::Application
11
+ # Settings in config/environments/* take precedence over those specified here.
12
+ # Application configuration should go into files in config/initializers
13
+ # -- all .rb files in that directory are automatically loaded.
14
+
15
+ # Custom directories with classes and modules you want to be autoloadable.
16
+ # config.autoload_paths += %W(#{config.root}/extras)
17
+
18
+ # Only load the plugins named here, in the order given (default is alphabetical).
19
+ # :all can be used as a placeholder for all plugins not explicitly named.
20
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
21
+
22
+ # Activate observers that should always be running.
23
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
24
+
25
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
26
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
27
+ # config.time_zone = 'Central Time (US & Canada)'
28
+
29
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
30
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
31
+ # config.i18n.default_locale = :de
32
+
33
+ # Configure the default encoding used in templates for Ruby 1.9.
34
+ config.encoding = "utf-8"
35
+
36
+ # Configure sensitive parameters which will be filtered from the log file.
37
+ config.filter_parameters += [:password]
38
+
39
+ # Enable the asset pipeline
40
+ config.assets.enabled = true
41
+ end
42
+ end
43
+
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,8 @@
1
+ # Warning: The database defined as "test" will be erased and
2
+ # re-generated from your development database when you run "rake".
3
+ # Do not set this db to the same as development or production.
4
+ spec:
5
+ adapter: sqlite3
6
+ database: db/spec.sqlite3
7
+ pool: 5
8
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,27 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Do not compress assets
26
+ config.assets.compress = false
27
+ end