mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-02-13 09:13:58 -05:00
Compare commits
4 Commits
b030f85b74
...
c8f115ae02
| Author | SHA1 | Date | |
|---|---|---|---|
| c8f115ae02 | |||
| d59e52b111 | |||
| 2c3548d1ac | |||
| d80007bc84 |
@@ -1,11 +0,0 @@
|
||||
$(function() {
|
||||
$("input#issue_customer_id").on("change", function() {
|
||||
|
||||
$.ajax({
|
||||
url: "/filter_estimates_by_customer",
|
||||
type: "GET",
|
||||
data: { selected_customer: $("input#issue_customer_id").val() }
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
@@ -43,7 +43,7 @@ module RedmineQbo
|
||||
|
||||
# Create billable time entries
|
||||
def bill_time
|
||||
logger.debug "QBO: Billing time for issue ##{id} - #{subject}"
|
||||
logger.debug "QBO: Billing time for issue ##{id}"
|
||||
return unless status.is_closed?
|
||||
return if assigned_to.nil?
|
||||
return unless Qbo.first
|
||||
@@ -110,11 +110,21 @@ module RedmineQbo
|
||||
CustomerToken.get_token self
|
||||
end
|
||||
|
||||
# Titleize the subject before save
|
||||
# Titleize the subject before save , but keep words containing numbers mixed with letters capitalized
|
||||
def titlize_subject
|
||||
self.subject = self.subject.titleize
|
||||
logger.debug "QBO: Titlizing subject for issue ##{self.id}"
|
||||
self.subject = self.subject.split(/\s+/).map do |word|
|
||||
# If word is NOT purely alphanumeric (contains special chars),
|
||||
# or is all upper/lower, we can handle it.
|
||||
# excluding alphanumeric strings with mixed case and numbers (e.g., "ID555ABC") from being altered.
|
||||
if word =~ /[A-Z]/ && word =~ /[0-9]/
|
||||
word
|
||||
else
|
||||
word.downcase
|
||||
word.capitalize
|
||||
end
|
||||
end.join(' ')
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# Add module to Issue
|
||||
|
||||
Reference in New Issue
Block a user