mirror of
https://github.com/rickbarrette/redmine_qbo_lineitems.git
synced 2026-10-04 01:20:43 -04:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0d6b08a3d | ||
|
|
9a9efcbaf9 |
No files matched your search
@@ -45,11 +45,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
|
<% if User.current.allowed_to?(:add_line_items, nil, global: true) %>
|
||||||
<button type="button"
|
<button type="button"
|
||||||
class="icon icon-add"
|
class="icon icon-add"
|
||||||
data-nested-form-add>
|
data-nested-form-add>
|
||||||
<%= l(:button_add) %>
|
<%= l(:button_add) %>
|
||||||
</button>
|
</button>
|
||||||
|
<% end %>
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
0.00
|
0.00
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<% if User.current.allowed_to?(:delete_line_items, nil, global: true) %>
|
||||||
<% unless readonly %>
|
<% unless readonly %>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
<button type="button"
|
<button type="button"
|
||||||
@@ -44,4 +45,5 @@
|
|||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -14,7 +14,7 @@ Redmine::Plugin.register :redmine_qbo_lineitems do
|
|||||||
name 'Redmine QBO Line Items plugin'
|
name 'Redmine QBO Line Items plugin'
|
||||||
author 'Rick Barrette'
|
author 'Rick Barrette'
|
||||||
description 'A plugin for Redmine to extend the capabilitys of the Redmine QuickBooks Online plugin to attach billable line items to an isuue'
|
description 'A plugin for Redmine to extend the capabilitys of the Redmine QuickBooks Online plugin to attach billable line items to an isuue'
|
||||||
version '2026.4.2'
|
version '2026.9.0'
|
||||||
url 'https://github.com/rickbarrette/redmine_qbo_lineitems'
|
url 'https://github.com/rickbarrette/redmine_qbo_lineitems'
|
||||||
author_url 'https://barrettefabrication.com'
|
author_url 'https://barrettefabrication.com'
|
||||||
requires_redmine version_or_higher: '6.1.0'
|
requires_redmine version_or_higher: '6.1.0'
|
||||||
@@ -29,14 +29,12 @@ Redmine::Plugin.register :redmine_qbo_lineitems do
|
|||||||
|
|
||||||
# Add safe attributes for core models
|
# Add safe attributes for core models
|
||||||
Issue.safe_attributes :line_items_attributes
|
Issue.safe_attributes :line_items_attributes
|
||||||
end
|
|
||||||
|
|
||||||
# Administration menu extension
|
# Global Permissions
|
||||||
Redmine::MenuManager.map :admin_menu do |menu|
|
permission :view_line_items, { line_items: [:index, :show] }, global: true
|
||||||
menu.push :redmine_qbo_lineitems, { controller: 'items', action: 'index' },
|
permission :add_line_items, { line_items: [:new, :create] }, global: true
|
||||||
icon: 'list',
|
permission :edit_line_items, { line_items: [:edit, :update] }, global: true
|
||||||
caption: :label_items,
|
permission :delete_line_items, { line_items: [:destroy] }, global: true
|
||||||
html: { class: 'icon icon-list' }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
RedmineQboLineItems.setup
|
RedmineQboLineItems.setup
|
||||||
@@ -24,18 +24,18 @@ module LineItems
|
|||||||
])
|
])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Add the line items form to the issue edit page
|
||||||
def view_issues_edit_notes_bottom(context = {})
|
def view_issues_edit_notes_bottom(context = {})
|
||||||
return if context[:issue].closed?
|
return if context[:issue].closed?
|
||||||
context[:controller].send(:render_to_string, {
|
return unless User.current.allowed_to?(:edit_line_items, nil, global: true)
|
||||||
partial: 'line_items/issue_form',
|
context[:controller].send(:render_to_string, { partial: 'line_items/issue_form', locals: { f: context[:form] } })
|
||||||
locals: {
|
|
||||||
f: context[:form]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
render_on :view_issues_show_description_bottom , partial: 'line_items/issue_line_items'
|
# Add the line items to the issue view page
|
||||||
|
def view_issues_show_description_bottom (context = {})
|
||||||
|
return unless User.current.allowed_to?(:view_line_items, nil, global: true)
|
||||||
|
context[:controller].send(:render_to_string, { partial: 'line_items/issue_line_items', locals: { issue: context[:issue] } })
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -12,10 +12,18 @@ module RedmineQboLineItems
|
|||||||
|
|
||||||
def self.setup
|
def self.setup
|
||||||
unless Issue.ancestors.include?(LineItems::Patches::IssuePatch)
|
unless Issue.ancestors.include?(LineItems::Patches::IssuePatch)
|
||||||
|
# Patches
|
||||||
Issue.prepend LineItems::Patches::IssuePatch
|
Issue.prepend LineItems::Patches::IssuePatch
|
||||||
|
|
||||||
|
# Hooks
|
||||||
LineItems::Hooks::IssuesSaveHookListener
|
LineItems::Hooks::IssuesSaveHookListener
|
||||||
LineItems::Hooks::QboHookListener
|
LineItems::Hooks::QboHookListener
|
||||||
LineItems::Hooks::ViewHookListener
|
LineItems::Hooks::ViewHookListener
|
||||||
|
|
||||||
|
# Administration menu extension
|
||||||
|
Redmine::MenuManager.map :admin_menu do |menu|
|
||||||
|
menu.push :redmine_qbo_lineitems, { controller: 'items', action: 'index' }, icon: 'list', caption: :label_items, html: { class: 'icon icon-list' }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in new issue
Block a user