<div class="splitcontent">
<div class="splitcontentleft">
<fieldset>
	<legend><%= l(:label_general) %></legend>
		<p><%= check_box_tag('settings[wktime_closed_issue_ind]', 1, @settings['wktime_closed_issue_ind'].to_i == 1) %> <label><%= l(:chkbox_closed_issues) %></label>
		</p>				
		<p>
			<label><%= l(:label_wk_previous_template_week) %></label>
			<%=	select_tag('settings[wktime_previous_template_week]', options_for_select([["", ""], [1, 1],[2, 2],[3, 3],[4, 4],[5, 5]],
					:selected => @settings['wktime_previous_template_week'])) %>
		</p>
		<p>
			<%= check_box_tag('settings[wktime_allow_filter_issue]', 1, @settings['wktime_allow_filter_issue'].to_i == 1) %> <label><%= l(:label_wk_allow_filter_issue) %> </label>
		</p>
		<p>
		<%= check_box_tag('settings[wktime_allow_blank_issue]', 1, @settings['wktime_allow_blank_issue'].to_i == 1) %> <label><%= l(:label_wk_allow_blank_issue) %> </label>
		</p>
		<p>	
		<%= check_box_tag('settings[wktime_enter_comment_in_row]', 1, @settings['wktime_enter_comment_in_row'].to_i == 1) %> <label><%= l(:label_wk_enter_comment_in_row) %> </label>
		</p>
		<p>
		<%= check_box_tag('settings[wktime_use_detail_popup]', 1, @settings['wktime_use_detail_popup'].to_i == 1) %> <label><%= l(:label_wk_use_detail_popup) %> </label>
		</p>

		<p>
			<%= check_box_tag('settings[te_save_geo_location]', 1, @settings['te_save_geo_location'].to_i == 1) %>
			<label for="settings_te_save_geo_location"><%= l(:label_save_geo_location) %></label>
		</p>
</fieldset>
</div>

<div class="splitcontentright">
<fieldset>
	<legend><%= l(:label_wktime) %></legend>
	
	<p>
		<label><%= l(:label_wk_default_work_time) %></label><%= text_field_tag 'settings[wktime_default_work_time]', @settings['wktime_default_work_time'], :size => 3 %>
	</p>
	<p>
		<label><%= l(:label_wk_max_hour_day) %></label><%= text_field_tag 'settings[wktime_max_hour_day]', @settings['wktime_max_hour_day'], :size => 3, :onchange => "ValidateMinMaxHours(this.id, '#{l(:label_max_min_hours_day_msg)}');" %>
	</p>
	<p>
		<label><%= l(:label_wk_min_hour_day) %></label><%= text_field_tag 'settings[wktime_min_hour_day]', @settings['wktime_min_hour_day'], :size => 3, :onchange => "ValidateMinMaxHours(this.id, '#{l(:label_max_min_hours_day_msg)}');" %>
	</p>
	<p>
		<label><%= l(:label_wk_max_hour_week) %></label><%= text_field_tag 'settings[wktime_max_hour_week]', @settings['wktime_max_hour_week'], :size => 3, :onchange => "ValidateMinMaxHours(this.id, '#{l(:label_max_min_hours_day_msg)}');" %>
	</p>
	
	<p>
		<label><%= l(:label_wk_min_hour_week) %></label><%= text_field_tag 'settings[wktime_min_hour_week]', @settings['wktime_min_hour_week'], :size => 3, :onchange => "ValidateMinMaxHours(this.id, '#{l(:label_max_min_hours_day_msg)}');" %>
	</p>
	
	<%
		custom_fields = TimeEntryCustomField.order('name')
		unless custom_fields.blank?
			cfs = custom_fields.collect {|cf| [cf.name, cf.id] }
			cfs.unshift(["",0])
	%>

	 <p>
		<label><%= l(:label_wk_enter_cf_in_row) + "[1]" %> </label><%=h select_tag('settings[wktime_enter_cf_in_row1]', 
			options_for_select(cfs, :selected =>  @settings['wktime_enter_cf_in_row1']),
			:onchange => "updateCustFldDD(this,'settings_wktime_enter_cf_in_row2');") %>
	</p>
	 <p>	 
		<label><%= l(:label_wk_enter_cf_in_row) + "[2]" %> </label><%=h select_tag('settings[wktime_enter_cf_in_row2]', 
			options_for_select(cfs, :selected =>  @settings['wktime_enter_cf_in_row2']),
			:onchange => "updateCustFldDD(this,'settings_wktime_enter_cf_in_row1');")%>
	</p>
	<% end %>
	<%
		trackers = Array.new
		tracker = Tracker.order('name')
		unless tracker.blank?
			trackers = tracker.collect {|t| [t.name, t.id] }
		end
		trackers.unshift(["",0])
	%>
	<p>
		<label><%=l(:label_wk_filter_issue_tracker)%></label>
		<%=  select_tag('settings[wktime_issues_filter_tracker]',
				options_for_select(trackers, :selected => @settings['wktime_issues_filter_tracker'].blank? ? 0 : @settings['wktime_issues_filter_tracker']), :multiple=> true)%>
	</p>

</fieldset>
</div>

<div style="clear:both"></div>
<%custom_fields = TimeEntryCustomField.order('name')%>
<% if !custom_fields.blank? %>
<div style = "display:none">
	<%=h select_tag('template_custFldDD', options_for_select(cfs))%>
</div>
<% end %>
<%= render :partial => 'settings/tab_expense' %>
<div style="clear:both"></div>
<%= render :partial => 'settings/tab_approval' %>
</div>