  [% META title = 'Admin &raquo; Edit Lab Section' -%]

    [% # PROCESS dumper.tt dump = section %]
    [% # PROCESS dumper.tt dump = lab_section_specimen_types %]
    [% # PROCESS dumper.tt dump = specimen_types %]


  [% PROCESS admin/lab_test_nav.tt page = 'lab_section' %]

  [% lab_sections_dfv_js %]

	<h2 align="center">Edit Lab Section</h2>

    [% IF dfv_errors %]
        <p class="error">[% c.cfg('msg').dfv_errors %]</p>
    [% END %]

    <p>[% site.html.back_button %]</p>

    <form method="post" action="[% app_url %]/admin/lab_section/update/[% section.id %]"
        [% lab_sections_onsubmit %] name="lab_section" id="lab_section">

    <table class="indent">
        <tr>
			<td class="label">Description:</td>
            <td>
                <input type="text" name="section_name" size="30" value="[%
                section.section_name | html %]" />
				[% error_section_name %]
			</td>
		</tr>
		<tr>
			<td class="label">Results summary:</td>
			<td>
				<select name="has_result_summary">
				[% FOREACH option IN ['yes', 'no'] %]
                     <option value="[% option %]" [% 'selected' IF option ==
                             section.has_result_summary %]>
                        [% option %]
                    </option>
			    [% END %]
				</select>
				[% error_has_result_summary %]
			</td>
		</tr>
		<tr>
			<td class="label">Section notes:</td>
			<td>
				<select name="has_section_notes">
				[% FOREACH option IN ['yes', 'no'] %]
                     <option value="[% option %]" [% 'selected' IF option ==
                             section.has_section_notes %]>
                        [% option %]
                    </option>
			    [% END %]
				</select>
				[% error_has_section_notes %]
			</td>
		</tr>
		<tr>
			<td class="label">Block sign out:</td>
			<td>
				<select name="has_test_sign_out">
				[% FOREACH option IN ['yes', 'no'] %]
                     <option value="[% option %]" [% 'selected' IF option ==
                             section.has_test_sign_out %]>
                        [% option %]
                    </option>
			    [% END %]
				</select>
				[% error_has_test_sign_out %]
			</td>
		</tr>
		<tr>
			<td class="label">Results import:</td>
			<td>
				<select name="has_results_import">
				[% FOREACH option IN ['no', 'yes'] # default to no %]
                    <option value="[% option %]" [% 'selected' IF option ==
                            section.has_results_import %]>
                       [% option %]
                   </option>
				[% END %]
				</select>
				[% error_has_results_import %]
			</td>
		</tr>
		<tr>
			<td class="label">Remote system:</td>
				<td class="content">
				<select name="has_foreign_id">
				[% FOREACH option IN ['yes', 'no'] %]
					<option value="[% option %]"
						[% 'selected' IF option == section.has_foreign_id %]>
					  [% option %]
					</option>
				[% END %]
				</select>
				[% error_has_foreign_id %]
			</td>
		</tr>
		<tr>
			<td class="label">Auto-expand:</td>
			<td class="content">
				<select name="auto_expand">
				[% FOREACH option IN ['no', 'yes'] %]
					<option value="[% option %]"
						[% 'selected' IF option == section.auto_expand %]>
					  [% option %]
					</option>
				[% END %]
				</select>
				[% error_auto_expand %]
			</td>
		</tr>
        [% IF c.cfg('settings').have_label_printer %]
		  <tr>
			<td class="label">Print labels:</td>
				<td class="content">
				<select name="has_labels">
				[% FOREACH option IN ['yes', 'no'] %]
					<option value="[% option %]"
						[% 'selected' IF option == section.has_labels %]>
					[% option %]
					</option>
				[% END %]
				</select>
				[% error_has_labels %]
			</td>
		  </tr>
        [% END %]
		<tr>
			<td class="label" style="vertical-align: top">
                Default sample<br />types:
            </td>
    		<td class="content">
                [% FOREACH type IN specimen_types; # PROCESS dumper.tt dump = type %]
                <div id="id">
                    <input type="checkbox" name="sample_type_id" value="[% type.id %]"
                        [% 'checked' IF lab_section_specimen_types.item(type.id) %] />
                    [% type.specimen_type %]
                </div>
                [% END %]
                [% error_sample_type_id %]
	    	</td>
		</tr>
		<tr>
			<td class="label">Active:</td>
			<td>
				<select name="is_active">
				[% FOREACH option IN ['yes', 'no'] %]
                     <option value="[% option %]" [% 'selected' IF option ==
                             section.is_active %]>
                        [% option %]
                    </option>
			    [% END %]
				</select>
				[% error_is_active %]
			</td>
		</tr>
		<tr>
            <td colspan="2" align="center">
                [% site.html.submit %]
            </td>
        </tr>
    </table>

    </form>
