From 7a58ae93316a14ac8ec23ec8f6b7f40b841d6392 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 13 Jul 2013 22:32:27 +0200 Subject: [PATCH] Add the time specification to the customer_form view; update it If time specifications are enabled for a customer this is considered to be a global setting for invoices related to this customer. Note that it will note change any of the existing voices, it will only affect newly created ones! --- stoptime.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/stoptime.rb b/stoptime.rb index c10847c..6f02fcb 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -851,6 +851,7 @@ module StopTime::Controllers attrs.each do |attr| @customer[attr] = @input[attr] end + @customer.time_specification = @input.has_key? "time_specification" @customer.save if @customer.invalid? @errors = @customer.errors @@ -1819,6 +1820,12 @@ module StopTime::Views _form_input_with_label("Phone number", "phone", :tel) _form_input_with_label("Financial contact", "financial_contact", :text) _form_input_with_label("Default hourly rate", "hourly_rate", :text) + div.control_group do + label.control_label "Time specifications?" + div.controls do + _form_input_checkbox("time_specification") + end + end div.form_actions do button.btn.btn_primary @button.capitalize, :type => "submit", :name => @button, :value => @button.capitalize