<script language="JavaScript">
<!--
	var me = '{$smarty.server.PHP_SELF}';
	var projectId = '{$project_id}';
	var nameString = '{$STRING.givename}';
	var descString = '{$STRING.givedesc}';

	{literal}
	function checkForm(frm) {
		if (frm.project_name.value == '') {
			alert(nameString);
			frm.project_name.focus();
			return false;
		}
		if (frm.project_desc.value == '') {
			alert(descString);
			frm.project_desc.focus();
			return false;
		}
		return true;
	}

	function popupComponent(id) {
		window.open(me + '?op=edit_component&project_id='+projectId+'&use_js=1&id='+id, 'ewin', 'dependent=yes,width=450,height=300,scrollbars=1');
		return false;
	}

	function popupVersion(id) {
		window.open(me + '?op=edit_version&project_id='+projectId+'&use_js=1&id='+id, 'ewin', 'dependent=yes,width=250,height=150,scrollbars=1');
		return false;
	}
	{/literal}
// -->
</script>

<form action="{$smarty.server.PHP_SELF}" method="post" onSubmit="return checkForm(this)">
<input type="hidden" name="id" value="{$project_id}">
<input type="hidden" name="do" value="project">
<table border="0" cellpadding="2" cellspacing="2" width="100%">
	{if $error}
  	<tr>
			<td colspan="2" class="error">{$error}</td>
  	</tr>
	{/if}
	<TR><!-- Edit the project fields -->
		<TD><a href="{$edit_project_fields_url}">{$STRING.configure_project_fields}</a></TD>
	</TR>	
	<tr>
		<td valign="top" width="360">
			Name:
			<br>
			<input type="text" size="30" maxlength="30" name="project_name" value="{$project_name|stripslashes}">
		</td>
		<td valign="top" rowspan="3">
			These developers can administer this domain:
{if isset($perm) and $perm->have_perm('AdminProject')}
                        <br>
                        <select name="useradmin[]" size="10" multiple>
				{build_select project_id=$project_id box=manager selected=$project_admins }
		        </select>
{else}
			<br>
				{section name=admin loop=$project_admins}
				{$project_developers[admin]}<br />
				{/section}
{/if}
		</td>
	</tr>
	<tr>
		<td valign="top">
			Description:
			<br>
			<textarea name="project_desc" cols=40 rows=5 wrap=virtual>{$project_desc|stripslashes}</textarea>
		</td>
	</tr>
	<tr>
		<td valign="top">
			Active:
			<br>
			<input type="checkbox" name="active" value="1" {if $active}checked{/if}>
		</td>
				</tr>
				<tr>
		<td valign="top">
			Sequence:
			<br>
			<input type="checkbox" name="sequence" value="1" {if $sequence}checked{/if}>
		</td>
	</tr>
	<tr>
		<td>
			the following groups can see this domain:
			<br>
			<select name="usergroup[]" size="10" multiple>
      	{build_select box=group selected=$project_groups project=1}
      </select>
	       </td>
		<td>
			the following users requested an access to this domain, select the ones who are authorized :
			<br>
			<select name="user_request[]" size="10" multiple>
				{build_select project_id=$project_id box=user_request selected=$extra_users }
      			</select>
	       </td>
	</tr>
</table>
<input type='submit' name='submit' value='Submit'>
</form>
<br>

