<script language="JavaScript">
<!--
	var me = '{$smarty.server.PHP_SELF}';
	{literal}
		
	function popupStatus(id) {
		window.open(me + '?op=edit&use_js=1&status_id='+id, 'ewin', 'dependent=yes,width=350,height=300,scrollbars=1');
	}
	{/literal}
// -->
</script>
<table border="0" width="100%">
	<tr>
		<td valign="top">
			<b>&nbsp;{$page_title}</b> - <a href="{$smarty.server.PHP_SELF}?op=edit&status_id=0" onClick="popupStatus(0); return false;">{$STRING.addnew} Status</a>
			<hr size="1">
			<table border="0" cellpadding="2" cellspacing="1" width="100%">
				<tr>
					<th class="{$headers.name.class}"><a href="{$headers.name.url}">Name</a></th>
					<th class="{$headers.description.class}"><a href="{$headers.description.url}">Description</a></th>
					<th class="{$headers.sortorder.class}"><a href="{$headers.sortorder.url}">Sort Order</a></th>
					<th>Delete</th>
				</tr>
				{section name=status loop=$statuses}
				<tr{if $smarty.section.status.iteration is even} class="alt"{/if}>
					<td><a href="{$smarty.server.PHP_SELF}?op=edit&status_id={$statuses[status].status_id}" onClick="popupStatus({$statuses[status].status_id}); return false;">{$statuses[status].status_name|stripslashes}</a></td>
					<td>&nbsp;{$statuses[status].status_desc}</td>
					<td align="center">{$statuses[status].sort_order}</td>
					<td align="center">
						{if not $statuses[status].bug_count}
						<a href="{$smarty.server.PHP_SELF}?op=del&status_id={$statuses[status].status_id}" onClick="return confirm('Are you sure you want to delete this status?')">Delete</a>
						{/if}
					</td>
				</tr>
				{/section}
				<tr>
					<td colspan="3" align="center">
						<br>
  					{$first} - {$last} of {$total}
						<br>
						{if $pages ne "1"}[ {$pages} ]{/if}
  					<br>
					</td>
				</tr>
			</table>
			<br>
			<div class="info">
				Statuses with a Sort Order = 0 will not be selectable by users
				<br>
				Only those Statuses that have no bugs referencing them can be deleted
			</div>
		</td>
	</tr>
</table>
