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

	{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;
	}

function confirmSubmit()
{
var agree=confirm(message);
if (agree)
	return true ;
else
	return false ;
}

function pushAlert(a_message) {
	alert(a_message);
}

function setMessage(new_message){
	message=new_message

}

{/literal}
</script>

<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 colspan="2"><a href="{$edit_project_fields_url}">{$STRING.configure_project_fields}</a>
{if isset($Backup)}
		  |
		  <a href="export.php?op=export&id={$project_id}">{$STRING.export_domain}</a> |
  		  <a href="import.php?op=show&id={$project_id}">{$STRING.import_domain}</a></TD>
{/if}
	</TR>	
	<tr>
<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">
		<td valign="top" width="360">
			{$STRING.domain_name} :
			<br>
			<input type="text" size="30" maxlength="30" name="project_name" value="{$project_name|stripslashes}">
		</td>
		<td valign="top" rowspan="2">
			<table border="0" cellpadding="2" cellspacing="2">
				<tr>	
		<td >
			<input type="checkbox" name="active" value="1" {if $active}checked{/if}>
			{$STRING.active} 
		</td>
		<td valign="top">
			<input type="checkbox" name="sequence" value="1" {if $sequence}checked{/if}>
			{$STRING.withSequence} 
		</td>
	</TR>	
	<tr>
		<td valign="top">
			<input type="checkbox" name="share_view_all" value="1" {if $share_view_all}checked{/if}>
			{$STRING.share_view_all} 
		</td>
		<td valign="top">
			<input type="checkbox" name="share_struct" value="1" {if $share_struct}checked{/if}>
			{$STRING.share_struct} 
		</td>
	</TR>	
	<tr>
		<td valign="top">
			<input type="checkbox" name="authorize_request" value="1" {if $authorize_request}checked{/if}>
			{$STRING.authorize_request} 
		</td>
		<td valign="top">
			<input type="checkbox" name="share_new" value="1" {if $share_new}checked{/if}>
			{$STRING.share_new} 
		</td>
	</TR>	
	<tr>
		<td valign="top">
			<input type="checkbox" name="share_edit_log" value="1" {if $share_edit_log}checked{/if}>
			{$STRING.share_edit_log} 
		</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td valign="top">
			{$STRING.description}:
			<br>
			<textarea name="project_desc" cols=40 rows=5 wrap=virtual>{$project_desc|stripslashes}</textarea>
		</td>
	</tr>
	<tr><td align="center" colspan="2"> <br>
	<input type='submit' name='submit' value="{$STRING.BUGDISPLAY.Submition}">
	<input type="BUTTON" name='cancel' value="{$STRING.cancel}" OnClick="window.location.href='{$smarty.server.PHP_SELF}?op=edit&id={$project_id}'">
	<br><br><br>
	</td></tr>
	</form>
	<tr>
		<td valign="top" colspan="2">
			<table border="0" cellpadding="2" cellspacing="2" >
				<tr>
					<td align="center">
 			{$STRING.user_invited} : <br>
{if isset($perm) and $perm->have_perm('AdminProject')}
 			<form action="{$smarty.server.PHP_SELF}" method="post"  onSubmit="return confirmSubmit()">
<input type="hidden" name="id" value="{$project_id}">
<input type="hidden" name="do" value="manage_invite">
 			<table border="0" width="100%">
 				<tr>
					<td align="center"> 
						<INPUT TYPE="Button" Value=" >  {$STRING.invite_sby}" OnClick="window.location.href='{$smarty.server.PHP_SELF}?op=mail&id={$project_id}'"><br>
						<INPUT TYPE="SUBMIT" name="Remove" Value="  <  " OnClick="setMessage('{$STRING.warning_down_invite}')"> <br>
					</td>
					<td>
			<select name="user_invite[]" size="10" multiple>
				{build_select project_id=$project_id box=user_invite selected=$extra_users }
      			</select>
			<br>
{/if}
					</td>
					<td>
{if isset($perm) and $perm->have_perm('Admin')}
						<INPUT TYPE="Submit" name="Upgrade" Value=" > " onclick="setMessage('{$STRING.warning_up_invite}')" > <br>
{/if}
					</td>
				</tr>
			</table>
			</form>
		</td>
					<td align="center">
 			{$STRING.user_requests} : <br>
{if isset($perm) and $perm->have_perm('AdminProject')}
 			<form action="{$smarty.server.PHP_SELF}" method="post"  onSubmit="return confirmSubmit()">
<input type="hidden" name="id" value="{$project_id}">
<input type="hidden" name="do" value="manage_request">
 			<table border="0" width="100%">
 				<tr>
					<td align="center"> 
{if isset($perm) and $perm->have_perm('Admin')}
						<INPUT TYPE="Submit" name="Remove" Value=" < " onclick="setMessage('{$STRING.warning_down_request}')" > <br>
{else}
						<INPUT TYPE="Button" name="Submit" Value=" < {$STRING.submit_invited} > " onclick="pushAlert('{$STRING.alert_manage_request}')" > <br>
{/if}					</td>
					<td>
			<select name="user_request[]" size="10" multiple>
				{build_select project_id=$project_id box=user_request selected=$extra_users }
      			</select>
			<br>
{/if}
					</td>
					<td>
						<INPUT TYPE="SUBMIT" name="Submit" Value="   >  " onclick="setMessage('{$STRING.warning_up_request}')"> 
					</td>
				</tr>
			</table>
			</form>
		</td>
					<td align="center">
 			{$STRING.user_with_view} : <br>
{if isset($perm) and $perm->have_perm('AdminProject')}
 			<form action="{$smarty.server.PHP_SELF}" method="post"  onSubmit="return confirmSubmit()">
<input type="hidden" name="id" value="{$project_id}">
<input type="hidden" name="do" value="manage_view">
 			<table border="0" width="100%">
 				<tr>
					<td align="center">
						<INPUT type="SUBMIT" name="Remove" Value="   <  " onclick="setMessage('{$STRING.warning_down_view}')" ><br>
					</td>
					<td>
			<select name="user_view[]" size="10" multiple>
				{build_select project_id=$project_id box=user_view selected=$extra_users }
      			</select>
			<br>
{/if}
					</td>
					<td>
						<INPUT TYPE="SUBMIT" name="Submit" Value="   >  " onclick="setMessage('{$STRING.warning_up_view}')"> <br>
					</td>
				</tr>
			</table>
			</form>
		</td>
					<td align="center">
 			{$STRING.user_with_edit} : <br>
{if isset($perm) and $perm->have_perm('AdminProject')}
 			<form action="{$smarty.server.PHP_SELF}" method="post"  onSubmit="return confirmSubmit()">
<input type="hidden" name="id" value="{$project_id}">
<input type="hidden" name="do" value="manage_edit">
 			<table border="0" width="100%">
 				<tr>
					<td align="center">
						<INPUT type="SUBMIT" name="Remove" Value="   <  " onclick="setMessage('{$STRING.warning_down_edit}')"><br>
					</td>
					<td>
			<select name="user_edit[]" size="10" multiple>
				{build_select project_id=$project_id box=user_edit selected=$extra_users }
      			</select>
			<br>
{/if}
					</td>
					<td>
						<INPUT TYPE="SUBMIT" name="Submit" Value="   >  " onclick="setMessage('{$STRING.warning_up_edit}')"> <br>
					</td>
				</tr>
			</table>
			</form>
		</td>
		<td align="center">
 			{$STRING.user_with_admin} : <br>
{if isset($perm) and $perm->have_perm('AdminProject')}
 			<form action="{$smarty.server.PHP_SELF}" method="post" onSubmit="return confirmSubmit()">
<input type="hidden" name="id" value="{$project_id}">
<input type="hidden" name="do" value="manage_admin">
 			<table border="0" width="100%" >
 				<tr>
					<td align="center">
						<INPUT type="SUBMIT" name="Remove" Value="   <  " onclick="setMessage('{$STRING.warning_down_admin}')"><br>
					</td>
					<td>
                       <select name="user_admin[]" size="10" multiple="true"  >
				{build_select project_id=$project_id box=manager selected=$extra_users }
		        </select>
			<br>
{else}
					<br>
				{section name=admin loop=$project_admins}
				{$project_developers[admin]}<br />
				{/section}
{/if}
					</td>
				</tr>
			</table>
			</form>
		</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>
				</tr> -->
			</table>
		</td>
	</tr>		
</table>
<br>
