  [% META title = 'Admin &raquo; Edit Error Code' -%]

<!-- BEGIN admin/config/errorcodes/edit.tt -->
  [% # PROCESS dumper.tt dump = errs %]

    [% error_codes_dfv_js %]

	[% PROCESS admin/misc_nav.tt page = 'error-codes' %]

  <h2 align="center">Edit Error Code Details</h2>

    [% IF dfv_errors %]
    <dl>
        <dt class="error">[% c.cfg('msg').dfv_errors %]</dt>
        [% IF error_error_code %]
            <dd>Error code [% error_error_code %]</dd>[% END %]
        [% IF error_description %]
            <dd>Description [% error_description %]</dd>[% END %]
        [% IF error_is_unique %]
            <dd>Unique [% error_is_unique %]</dd>[% END %]
        [% IF error_active %]
            <dd>Active [% error_active %]</dd>[% END %]
    </dl>
    [% END %]

    <form method="post" action="[% app_url %]/config/error-codes/update/[% data.id %]" [% error_codes_onsubmit %]
        name="error_code" id="error_code">

    <table>
        <tr>
            <th [% IF error_code %]class="error"[% END %]>Error Code</th>
            <th [% IF error_description %]class="error"[% END %]>Description</th>
			<th [% IF error_is_unique %]class="error"[% END %]>Unique</th>
			<th [% IF error_active %]class="error"[% END %]>Active</th>
        </tr>
       <tr>
            <td>
                <input type="text" name="code" size="5" id="code"
					[% IF c.cfg('use_cgi_ajax') %]
						onChange="do_ajax(['code'], ['bad_code']); return true;"
					[% END %] value="[% data.code | upper %]" />
				[% error_code %]
				<span class="ajax_error"><em id="bad_code"></em></span>
             </td>
            <td>
                <input type="text" name="description" size="40" value="[% data.description %]" />
             </td>
			<td>
				<select name="is_unique">
				[% FOREACH option IN ['yes', 'no'] %]
                     <option value="[% option %]" [% 'selected' IF option == data.is_unique %]>
                        [% option %]
                    </option>
			    [% END %]
				</select>
			</td>
			<td>
				<select name="active">
				[% FOREACH option IN ['yes', 'no'] %]
                     <option value="[% option %]" [% 'selected' IF option == data.active %]>
                        [% option %]
                    </option>
			    [% END %]
				</select>
			</td>
             <td>
                [% site.html.submit %]
            </td>
        </tr>
    </table>

    </form>

    <p>[% site.html.back_button %]</p>
<!-- END admin/config/errorcodes/edit.tt -->
