<script type="text/JavaScript">
<!--
	{literal}
	// check that a date is written correctly
	checkDate_regexp = {/literal}{$internal_date_format_js}{literal}
	function checkDate(input) {
		result_array = checkDate_regexp.exec(input.value);
		if ((result_array != null) && (result_array[0] == input.value)) {
			return true;
		} else {
			alert('{/literal}{$ERROR.invalid_date|addslashes}{literal}');
			return false;
		}
	} // end of checkDate(input)
	
	// open a popup at the center of the screen
	function centeredPopup(url, width, height, options) {
		var top=(screen.height - height) / 2;
		var left=(screen.width - width) / 2;
		window.open(url,"","top="+top+",left="+left+",width="+width+",height="+height+","+options);
	}

//config for server
var server = "PointToYourPHPScriptWhichUsesPearXML_RPC_andhas some methods defined "
var target_object;
function sendXMLRPC(url, method, value) {
     //branch for native object
     type = method;
     if (window.XMLHttpRequest) {
         req = new XMLHttpRequest();
         req.onreadystatechange = processReqChange;

         req.open("POST", url, true);
         req.setRequestHeader("Content-Type", "text/xml");
         req.send('<?xml version="1.0"?>\n'+
'<methodCall>\n'+
'<methodName>'+ method + '</methodName>\n'+
'<params>\n'+
'<param>\n'+
'<value>\n'+
'<string>' + value + '</string>\n'+
'</value>\n'+
'</param>\n'+
'</params>\n'+
'</methodCall>\n');
     }
}

function processReqChange() {
     // only if req shows "loaded"
     if (req.readyState == 4) {
         // only if "OK"
         if (req.status == 200) {
         //hand off to delegate function
	 	update(type);
          } else {
             alert("There was a problem retrieving the XML data:\n" +
                 req.statusText);
          }
     }
}



	
	{/literal}
//-->
</script>
	<br>
<form method="post" action="bug.php" name="main" onSubmit="">
<input type="hidden" name="op" value="updtlst" />
<input type="hidden" name="last_modified_date" value="ever">
<!--<table class="section" width="100%"> <tr align="center"><td align="center"> -->
<div class="mainFrame" align="center">
<div class="section">
	{$STRING.field_edition}  				
</div>
	<table border="0" cellspacing="0" cellpadding="0" width="91%">
		{if $error.status}
		<tr>
			<td class="error" colspan=4>
				{$error.status}
			</td>
		</tr>
		{/if}
				<DIV class="cell" >
					<!-- POPUP of field properties-->
					<font size="1">
						<a 
							onClick="javascript:centeredPopup('{$smarty.server.PHP_SELF|dirname}/popup_field_properties.php?op=show&fid={$v.field_conf_id}', {$popup_field_properties_width}, {$popup_field_properties_height}, 'resizable=yes')"
						>
							<img class="helper" src="{$template_path}/images/smalltxt.gif" alt="?" >
						</a>
					</font>
					<B>
					{$v.title} :
					{if $mpfile->sp_cache.$k->highlight_url}
					</A>
					{/if}
					</B>
	
					{if $v.field_type_title == $string && $mpfile->sp_cache.$k->maxlen == '0' }
					<br>
					{else}
					{/if}
					{if $field_name == 'assigned_to'}
						{build_dynamic_input 
							field_conf=$v 
							file_id=$file.bug_id.value
							name='_no_name'							
							mpfile=$mpfile
							read_only=1				
						}
					<!-- the project id is handled like a normal field
					{literal}					
					{elseif ($k == 'project_id')}
						{build_dynamic_input 
							field_conf=$v 
							file_id=$file.bug_id.value
							name='_no_name'
							value=$project_id
							mpfile=$mpfile
							read_only=1
						}
					{/literal}
					-->
					{else}
						{if $smarty.session.uid} {* if logged *}
							{if !empty($mpfile->sp_cache.$k->read_only)}
								{assign var=RO value=$mpfile->sp_cache.$k->read_only}
							{else}
								{if !empty($mpfile->sp_cache.$k->label)}
									{assign var=RO value=$mpfile->sp_cache.$k->label}
								{else}
									{assign var=RO value=0}
								{/if}
							{/if}
						{else}
							{assign var=RO value=1}
						{/if}
						{build_dynamic_input 
							flg_wkfw=$flg_wkfw
							field_conf=$v 
							file_id=$file.bug_id.value
							name=$v.field_name
							value=$treated_value
							mpfile=$mpfile
							read_only=$RO
						}
					{/if}
					</DIV>
				</TD>
				<TD>
				&nbsp;&nbsp;&nbsp;
				</TD>
		<TR>
			<TD colspan="4"> 
				<DIV class="label">
					{$STRING.BUGDISPLAY.Rest}
				</DIV>
				<DIV class="endlabel">
					&nbsp;
				</DIV>
			</TD>
		</TR>
		<tr valign="center">
		{if $smarty.session.uid}  {* if logged *}
		<td valign="center" rowspan="5">
			<table>
				<tr>
					<td valign="center">
					</td>
				</tr>
			</table>
			</td>
			<TD rowspan="5">
				&nbsp;&nbsp;&nbsp;
			</TD>
		{/if}
			<td>
				{$STRING.BUGDISPLAY.addcc} :	
				<input type="text" name="add_cc" {if isset($add_cc)}value={$add_cc|stripslashes}{/if}>
			</td>
		</tr>
		<tr >
		{if count($contact_list)}
			<td valign="top">
			</td>
		{/if}
		</tr>
		<tr>
			<td valign="top">
			{if !empty($error.add_dep)}
				<div class="error">
					{$error.add_dep}
				</div>
			{/if}
				{$STRING.BUGDISPLAY.bugdependency} :
				{$bug_dependencies} 
			</td>
		</tr>
		<tr>
			<td>
				{$STRING.BUGDISPLAY.adddependency} : 
				<input type="text" name="add_dependency" size="5" {if isset($add_dependency)} value="{$add_dependency}" {/if}> 
			</td>
		</tr>
		<tr>
			<td>
				{$STRING.BUGDISPLAY.removedependency} :
				<input type="text" name="del_dependency" size="5" {if isset($del_dependency)} value="{$del_dependency}" {/if}> 
			</td>			
		</tr>
</table>
</div>	<!-- </td></tr></table> -->

{if $no_comments==1}
{else}
<div class="mainFrame">
<div class="section">
{$STRING.BUGDISPLAY.comments} :
</div>
<table border="0" cellpadding="2" cellspacing="0" >
	<tr>
		<td valign="top">
			{if $smarty.session.uid}  {* if logged *}
				{$STRING.BUGDISPLAY.additionalcomments} :
				<br><br>
				<textarea name="comments" rows="16" cols="100" wrap="virtual">{if isset($previous_comment)}{$previous_comment|stripslashes}{/if}</textarea>
				<br><br>
			{else}
				<b>{$STRING.logintomodify}</b>
			{/if}
		</td>
	</tr>
</table>
</div>
{/if}
<div class="mainFrame">
<div class="section">
	{$STRING.BUGDISPLAY.Submition}
</div>
{if $smarty.session.uid}  {* if logged *}
	<div class="submit">
	
		<input type="checkbox" name="suppress_email" value="1" {if isset($suppress_email) && !empty($suppress_email)} checked {/if}>
		{$STRING.BUGDISPLAY.suppressemail}
		<br>
		<br>
		<input type="submit" value={$STRING.BUGFORM.Submit}>
	</div>
{else}
	<b>{$STRING.logintomodify}</b>
{/if}
</div>
</form>
