<script type="text/javascript"> 
	lblInvCompName = "<%=l(:field_name) %>";
	lblInvCompVal = "<%=l(:field_value) %>";
</script>
<fieldset>
	<legend><%= l(:label_crm) %></legend>
	<p>
		<%= check_box_tag('settings[crm_save_geo_location]', 1, @settings['crm_save_geo_location'].to_i == 1) %>
		<label for="settings_crm_save_geo_location"><%= l(:label_save_geo_location) %> </label>
	</p>
	<fieldset>
		<legend><%= l(:label_sales_quote) %></legend>	
		<p>
				<label><%= l(:label_sales_quote_no_prefix) %></label><%= text_field_tag 'settings[wktime_sales_quote_no_prefix]', @settings['wktime_sales_quote_no_prefix'], size: 13 %> 
		</p>
		<p>
			<%= check_box_tag('settings[wktime_sales_quote_closed_issues]', 1, @settings['wktime_sales_quote_closed_issues'].to_i == 1) %> <label><%= l(:chkbox_sales_quote_closed_issues) %> </label>
		</p>
	
		<p>
		<%
			invComps = []
			if(@settings['wktime_sq_components'].blank?)
				invComps = ''
			else
				@settings['wktime_sq_components'].each do |element|
				  listboxArr = element.split('|')
				  invCompName = listboxArr[0].blank? ? "" : listboxArr[0]
				  invCompVal = listboxArr[1].blank? ? "" : listboxArr[1]
				  optionText = invCompName + ' : ' + invCompVal
				  invComps << [optionText,element]
				end
			end
		%>
			<label><%= l(:label_sales_quote_components) %></label>
				<%=  select_tag('settings[wktime_sq_components]',
					options_for_select(invComps, :selected => 'settings[wktime_sq_components]'), :multiple=> true, :style => "min-width:140px; height:100px;")%>	

			</p>			
			<p>
				<%= link_to l(:button_add), "javascript:showInvCompDialog('Add', 'settings_wktime_sq_components');", :class => "button"%>  |
				<%= link_to l(:button_edit), "javascript:showInvCompDialog('Edit', 'settings_wktime_sq_components');", :class => "button"%>  |
				<%= link_to l(:button_delete), "javascript:removeSelectedValue('settings_wktime_sq_components');", :class => "button" %>
			</p>
		
		
	</fieldset>
  </fieldset>
	
	<div id="invcomp-dlg" title="<%= l(:label_component) %>">
		<table>
			<tr>
				<th align="left"><label><%= l(:field_name) %></label></th>
				<td><%= text_area_tag 'inv_copm_name','', :size => "23*10", :width => "150px" %> 
			</tr>
			<tr>
				<th align="left"><label><%= l(:field_value) %></label></th>
				<td><%= text_area_tag 'inv_copm_value','', :size => "23*10", :width => "150px" %> 
			</tr>
			<tr>
				<%= hidden_field_tag :hdnAction, "" %>
			</tr>
		</table>
	</div>