Skip to content

Commit

Permalink
Added some more 2.3.8 fixes ...
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris DeRose committed May 29, 2011
1 parent 789e03a commit b5c23d7
Show file tree
Hide file tree
Showing 24 changed files with 50 additions and 52 deletions.
32 changes: 13 additions & 19 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
* 2.3.8 upgrade ?
* Remove the rhtml's and rjs's and use js.rjs and html.erb
* Go through the plugins - enable everything, and remove the plugs line
* Test the activity assignments on invoice create
* Test activity move
* Test the nested activities on the invoices controller

* Ok - you left off finishing up the activities controller
* Test activity 'move' on the invoices_with totals. Actually - why isn't it listed?
* Go through the plugins - enable everything, and remove the plugs line

* Put a beta version on mario. ... Don't forget to:
# NOTE: One way to 'fix' any problems with your invoice assignments is to:
# InvoicePayment.find(:all).each{|ip| ip.destroy}
# Payment.find(:all).each{|pmt| if pmt.amount > Money.new(0) then pmt.invoice_assignments = pmt.client.recommend_invoice_assignments_for(pmt.amount); pmt.save! end }
-=-=
* Double check that we're removing payment assignments on invoice unpublish..

Expand All @@ -25,34 +24,29 @@
* Payment:::is_allocated should probably be added to a view and then list controller...
* Code is there - but no view supports it...

* We should add an unpublished Open Invoices controller ...
* We should add an Draft Invoices controller and rename Invoices to 'All' Invoices...

* Is there a bug saving invoice comments on unpublished invoices? ... (maybe its just when you're choosing no?)

* I'd like to see a payment identifier listed in the payments list ... (check no/cc#)

* We should put tax before cost in the activities with prices controller...

* WHen Assigning employees to labr_rates - the form stays open between updates and shouldnt...



--- Put a beta version on mario? ... Do this then:
# NOTE: One way to 'fix' any problems with your invoice assignments is to:
# InvoicePayment.find(:all).each{|ip| ip.destroy}
# Payment.find(:all).each{|pmt| if pmt.amount > Money.new(0) then pmt.invoice_assignments = pmt.client.recommend_invoice_assignments_for(pmt.amount); pmt.save! end }
--- Put a beta version on mario? ...

* Translate the time into the local zone for the user, probably each user/client should have a zone associtation in their account.
* Its already stored in UTC everywhere...
* We need to factor this into invoices too, I think

---
* Slimtimer-less time entry
* http://dhtmlx.com/docs/products/dhtmlxScheduler/index.shtml

* Use polymorphic relationship for sub activities
* I really don't like the way we're uing dont_validate_type_associations. ..

* Rails 3.x?
---
* Slimtimer-less time entry
* http://dhtmlx.com/docs/products/dhtmlxScheduler/index.shtml

* reocurring payments module with rake task
* DDC / GI / Ashbritt / Manny Kadre bills

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/activities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def self.activities_scaffold_init
config.columns.instance_eval do

# Column selective inclusion, based on activity_type:
alias :add_without_activities :add
alias :add_without_activities :add unless self.respond_to? :add_without_activities

def extend_activity_column(col)
def col.for_activity_type?(type); (for_activities.length == 0 or for_activities.include? type) ? true : false; end
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/admin/activities_with_prices_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Admin::ActivitiesWithPricesController < Admin::ActivitiesController
config.label = "Invoice Activity"

config.columns << [:cost, :tax]
config.list.columns = [:activity, :cost, :tax, :occurred_on]
config.list.columns = [:activity, :tax, :cost, :occurred_on]

config.action_links.add :move_to_invoice, :type => :record, :label => 'Move...', :crud_type => :update, :action => 'move_to_invoice'

Expand Down Expand Up @@ -56,9 +56,9 @@ def move_to_invoice
@errors_during_move << $!
end

render :action => 'move_to_invoice.rjs'
render :action => 'move_to_invoice.js.rjs'
else
render :action => 'move_to_invoice.rhtml', :layout => false
render :action => 'move_to_invoice.html.erb', :layout => false
end
end

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/authentication_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def login
rescue
@flash_error = $!
ensure
render :action => "#{@button_press}.rjs"
render :action => @button_press
end
end
end
Expand Down Expand Up @@ -108,7 +108,7 @@ def reset_password_via_token
rescue
@flash_error = $!
ensure
render :action => "reset_password_via_token.rjs"
render :action => :reset_password_via_token
end
end
end
Expand Down
24 changes: 14 additions & 10 deletions app/helpers/admin/activities_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
module Admin::ActivitiesHelper
include ::Admin::ActivityTaxFieldHelper
include ExtensibleObjectHelper

alias :activity_apply_tax_form_column :apply_tax_form_column
alias :activity_tax_form_column :tax_form_column


def active_scaffold_observe_field(col_name, observation)
# This is slightly hackish - but it should work
Expand Down Expand Up @@ -40,11 +44,11 @@ def column_class(column, column_value)
"#{column.name}-column"
end

def cost_column(record)
def activity_cost_column(record)
h_money record.cost
end

def tax_column(record)
def activity_tax_column(record)
h_money record.tax
end

Expand All @@ -61,13 +65,13 @@ def override_form_field(column)

# Generic helpers:

def activity_cost_form_column(record, input_name)
text_field_tag input_name, money_for_input(@record.cost), options_for_column('cost').merge({:size => 10 })
def activity_cost_form_column(record, options)
text_field_tag options[:name], money_for_input(@record.cost), options_for_column('cost').merge({:size => 10 })
end

def activity_client_id_form_column(record, input_name)
def activity_client_id_form_column(record, options)
select_tag(
input_name,
options[:name],
options_for_select(
# NOTE: We don't do a find_active here, but see the conditions...
[ ['(Unknown)', nil] ]+Client.find(
Expand All @@ -82,16 +86,16 @@ def activity_client_id_form_column(record, input_name)
)
end

def activity_label_form_column(record, input_name)
def activity_label_form_column(record, options)
label_value = (@record.respond_to?(@record.activity_type)) ? @record.send("#{@record.activity_type}").label : nil

text_field_tag input_name, label_value, options_for_column('label').merge({:size => 30 })
text_field_tag options[:name], label_value, options_for_column('label').merge({:size => 30 })
end

def activity_comments_form_column(record, input_name)
def activity_comments_form_column(record, options)
comments_value = (@record.respond_to?(@record.activity_type)) ? @record.send("#{@record.activity_type}").comments : nil

text_area_tag input_name, comments_value, options_for_column('comments').merge({:cols => 72, :rows => 20})
text_area_tag options[:name], comments_value, options_for_column('comments').merge({:cols => 72, :rows => 20})
end

def submit_tag(*args)
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/admin/activities_helper/labor_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def activity_duration_form_column(record, input_name)
end

def activity_comments_form_column(record, input_name)
text_area_tag input_name, @record.labor.comments, options_for_column('comments').merge({:cols => 72, :rows => 20})
text_area_tag input_name, @record.sub_activity.comments, options_for_column('comments').merge({:cols => 72, :rows => 20})
end

end
2 changes: 1 addition & 1 deletion app/helpers/admin/activities_helper/proposal_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Admin::ActivitiesHelper

def proposed_on_form_column(record, input_name)
def activity_proposed_on_form_column(record, options)
# Super-ghetto hack
@proposal = record.proposal

Expand Down
4 changes: 2 additions & 2 deletions app/helpers/admin/activities_with_prices_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Admin::ActivitiesWithPricesHelper

def render_action_link(link, url_options)
return super(link, url_options) unless link.action == 'move_to_invoice'
def render_action_link(link, url_options, record)
return super(link, url_options, record) unless link.action == 'move_to_invoice'

url_for_dialog = url_for(
:controller => url_options[:controller],
Expand Down
2 changes: 1 addition & 1 deletion app/models/activity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def authorized_for?(options)
return true unless options.try(:[],:action)

case options[:action].to_s
when /^(update|delete)$/
when /^(edit|delete)$/
(is_published?) ? false : true
else
true
Expand Down
2 changes: 1 addition & 1 deletion app/models/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def amount( force_reload = false )
alias :grand_total :amount

def name
'"%s" Invoice on %s' % [ (client) ? client.company_name : '(Unknown Client)', issued_on.strftime("%m/%d/%Y %I:%M %p") ]
'%s Invoice on %s' % [ (client) ? client.company_name : '(Unknown Client)', issued_on.strftime("%m/%d/%Y %I:%M %p") ]
end

def long_name
Expand Down
4 changes: 2 additions & 2 deletions app/models/notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def from_address(tmpl)
def generate_view_parts(view_name, tmpl)
part( :content_type => "multipart/alternative" ) do |p|
[
{ :content_type => "text/plain", :body => render_message("#{view_name.to_s}.plain.rhtml", tmpl) },
{ :content_type => "text/html", :body => render_message("#{view_name.to_s}.html.rhtml", tmpl.merge({:part_container => p})) }
{ :content_type => "text/plain", :body => render_message("#{view_name.to_s}.plain.erb", tmpl) },
{ :content_type => "text/html", :body => render_message("#{view_name.to_s}.html.erb", tmpl.merge({:part_container => p})) }
].each { |parms| p.part parms.merge( { :charset => "UTF-8", :transfer_encoding => "7bit"} ) }
end
end
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions app/views/notifier/invoice_available.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<%= render :partial => 'email_header.html' %>
<p>Your newest is available, and is attached to this email.</p>

<p><%=@payment_notice%></p>
<%= render :partial => 'email_footer.html' %>
5 changes: 0 additions & 5 deletions app/views/notifier/invoice_available.html.rhtml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Your newest is available, and is attached to this email.

<%=@payment_notice%>
<%= render :partial => 'email_footer.plain.rhtml' %>
<%= render :partial => 'email_footer.plain' %>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= render :partial => 'email_header.html.rhtml' %>
<%= render :partial => 'email_header.html' %>
<p>Hello <%=@credential_name%>,</p>
<p>Recently, someone (hopefully you) requested that your password be reset on <%=h @company_name%>'s website.
Expand All @@ -12,4 +12,4 @@ Please forward this email to <a href="mailto:<%=@site_admin_email%>"><%=@site_ad
information you may have.</p>

<p>Feel free to contact us at any time for further help on resetting your password.</p>
<%= render :partial => 'email_footer.html.rhtml' %>
<%= render :partial => 'email_footer.html' %>
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Recently, someone (hopefully you) requested that your password be reset on <%=h
If this request was not initiated by you, then perhaps someone is up to no good, with your account on this system. Please forward this email to <%=@site_admin_email%> with any additional information you may have.

Feel free to contact us at any time for further help on resetting your password.
<%= render :partial => 'email_footer.plain.rhtml' %>
<%= render :partial => 'email_footer.plain' %>

0 comments on commit b5c23d7

Please sign in to comment.