mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 08:54:23 -05:00
Fixed Project releationships and database migration
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
class UpdateProjects < ActiveRecord::Migration
|
class UpdateProjects < ActiveRecord::Migration
|
||||||
def change
|
def change
|
||||||
add_reference :projects, :customers, index: true
|
add_reference :projects, :customer, index: true
|
||||||
add_reference :projects, :vehicles, index: true
|
add_reference :projects, :vehicle, index: true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
3
init.rb
3
init.rb
@@ -20,6 +20,7 @@ Redmine::Plugin.register :redmine_qbo do
|
|||||||
|
|
||||||
# Patches to the Redmine core. Will not work in development mode
|
# Patches to the Redmine core. Will not work in development mode
|
||||||
require_dependency 'issue_patch'
|
require_dependency 'issue_patch'
|
||||||
|
require_dependency 'project_patch'
|
||||||
require_dependency 'user_patch'
|
require_dependency 'user_patch'
|
||||||
require_dependency 'query_patch'
|
require_dependency 'query_patch'
|
||||||
require_dependency 'time_entry_query_patch'
|
require_dependency 'time_entry_query_patch'
|
||||||
@@ -29,7 +30,7 @@ Redmine::Plugin.register :redmine_qbo do
|
|||||||
name 'Redmine Quickbooks Online plugin'
|
name 'Redmine Quickbooks Online plugin'
|
||||||
author 'Rick Barrette'
|
author 'Rick Barrette'
|
||||||
description 'This is a plugin for Redmine to intergrate with Quickbooks Online to allow for seamless intergration CRM and invoicing of completed issues'
|
description 'This is a plugin for Redmine to intergrate with Quickbooks Online to allow for seamless intergration CRM and invoicing of completed issues'
|
||||||
version '0.5.0'
|
version '0.6.0'
|
||||||
url 'https://github.com/rickbarrette/redmine_qbo'
|
url 'https://github.com/rickbarrette/redmine_qbo'
|
||||||
author_url 'http://rickbarrette.org'
|
author_url 'http://rickbarrette.org'
|
||||||
settings :default => {'empty' => true}, :partial => 'qbo/settings'
|
settings :default => {'empty' => true}, :partial => 'qbo/settings'
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ module ProjectPatch
|
|||||||
unloadable # Send unloadable so it will not be unloaded in development
|
unloadable # Send unloadable so it will not be unloaded in development
|
||||||
belongs_to :customer, primary_key: :id
|
belongs_to :customer, primary_key: :id
|
||||||
belongs_to :vehicle, primary_key: :id
|
belongs_to :vehicle, primary_key: :id
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
module ClassMethods
|
module ClassMethods
|
||||||
@@ -35,5 +36,5 @@ module InstanceMethods
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Add module to Issue
|
# Add module to Project
|
||||||
Project.send(:include, ProjectPatch)
|
Project.send(:include, ProjectPatch)
|
||||||
|
|||||||
@@ -10,15 +10,7 @@
|
|||||||
|
|
||||||
class ProjectsFormHookListener < Redmine::Hook::ViewListener
|
class ProjectsFormHookListener < Redmine::Hook::ViewListener
|
||||||
|
|
||||||
# Load the javascript
|
# Edit Project Form
|
||||||
def view_layouts_base_html_head(context = {})
|
|
||||||
js = javascript_include_tag 'application', :plugin => 'redmine_qbo'
|
|
||||||
js += javascript_include_tag 'autocomplete-rails', :plugin => 'redmine_qbo'
|
|
||||||
return js
|
|
||||||
end
|
|
||||||
|
|
||||||
# Edit Issue Form
|
|
||||||
# Show a dropdown for quickbooks contacts
|
|
||||||
def view_projects_form(context={})
|
def view_projects_form(context={})
|
||||||
f = context[:form]
|
f = context[:form]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user