<div style="position:relative;left:10px;width:1000px;">
<h2>Ticket</h2>

{if $form_data->ticket_messages}
<div class="regular box">
{foreach from=$form_data->ticket_messages item=ticket_message}
<b>
{if $ticket_message->create_type == 1}
|<--
{/if}
{if $ticket_message->create_type == 2}
|-->
{/if}
</b>
{$ticket_message->create_time} - {$ticket_message->m_from} -
{if $ticket_message->message_number == $form_data->selected_message_number}
<span style="font-weight:bold;">{$ticket_message->subject}</span>
{else} 
<a href="./index.php?admin_modul=admin_cs_ticket_editor&id={$form_data->id}&message_number={$ticket_message->message_number}">{$ticket_message->subject}</a>
{/if}
<br>
{/foreach}
</div>
{/if}


<div id="adminLeftFloater">
	<div title="Nachricht" id="stammdaten">
		
		{if $form_data->response}
		<form class="edit" method="POST">
			<input type="hidden" name="modul" value="admin_standard_message_editor" />
			<input type="hidden" id="id" name="id" value="{$form_data->id}" />
				
				<div class="edit_element_3_5">
					<label>From</label>
					<input id="customerCreationFirstname" name="form_field[m_from]" value="{$form_data->email_from}" type="text" readonly />
				</div>		
				<div class="edit_endline"></div>			
				<div class="edit_element_3_5">
					<label>To</label>
					<input id="customerCreationFirstname" name="form_field[m_to]" value="{$form_data->selected_message->m_from}" type="text" />
				</div>		
				<div class="edit_endline"></div>
				
<!--  				<div class="edit_element_3_5">
					<label>Neuer Status</label>
					<select name="form_field[state_id]">
						<option value="2">in Bearbeitung</option>
						<option value="3">geschlossen</option>
					</select>
				</div>		
				<div class="edit_endline"></div>	-->		
							
				<div class="edit_title">Nachricht:</div>
				<div class="edit_element_1_1">
					<label>Betreff</label>
					<input id="customerCreationFirstname" name="form_field[subject]" value="Re: {$form_data->selected_message->subject}" type="text" />
				</div>					
				<div class="edit_endline"></div>
				<div class="edit_element_1_1" style="height:400px;">
					<label>Textnachricht</label>
					<textarea name="form_field[message]" class="content_box_textbox" ></textarea>
				</div>					
				<div class="edit_endline"></div>
			<input style="position:relative;left:185px;width: 200px;" type="submit" name="submit" id="submit" value="Benachrichtigung senden" />
		</form>
		{else if !$form_data->id}
		<form class="edit" method="POST">
			<input type="hidden" name="modul" value="admin_standard_message_editor" />
				
				<div class="edit_element_3_5">
					<label>From</label>
					<input id="customerCreationFirstname" name="form_field[m_from]" value="{$form_data->email_from}" type="text" readonly />
				</div>		
				<div class="edit_endline"></div>			
				<div class="edit_element_3_5">
					<label>To</label>
					{if $form_data->customer}
					<input type="hidden" value="{$form_data->customer->id}" name="form_field[customer_id]" />
					{$form_data->customer->firstname} {$form_data->customer->surname} &lt;{$form_data->customer->email}&gt;
					{else}
					<select name="form_field[customer_id]">
						<option value="0">-</option>
					  {foreach from=$form_data->customers item=customer}
					  <option value="{$customer->id}">{$customer->firstname} {$customer->surname} &lt;{$customer->email}&gt;</option>
					  {/foreach}
					</select>
					{/if}
				</div>		
				<div class="edit_endline"></div>
				
				<div class="edit_element_3_5">
					<label>Neuer Status</label>
					<select name="form_field[state_id]">
						<option value="2">in Bearbeitung</option>
						<option value="3">geschlossen</option>
					</select>
				</div>		
				<div class="edit_endline"></div>			
							
				<div class="edit_title">Nachricht:</div>
				<div class="edit_element_1_1">
					<label>Betreff</label>
					<input id="customerCreationFirstname" name="form_field[subject]" value="" type="text" />
				</div>					
				<div class="edit_endline"></div>
				<div class="edit_element_1_1" style="height:400px;">
					<label>Textnachricht</label>
					<textarea name="form_field[message]" class="content_box_textbox" ></textarea>
				</div>					
				<div class="edit_endline"></div>
			<input style="position:relative;left:185px;width: 200px;" type="submit" name="submit" id="submit" value="Benachrichtigung senden" />
		</form>
		{else}
			<div class="edit_icon_bar" style="left:380px;">
				{if $form_data->id}
				<a href="./index.php?admin_modul=admin_cs_ticket_editor&id={$form_data->id}&message_number={$form_data->selected_message_number}&mod=response"><img class="edit_icon" src="{$THEME_DIR}/media/images/new_item2.png" title="antworten" /></a>
				{/if}
			</div>
		
			<span style="font-weight:bold;">Von:</span> {$form_data->ticket_messages[$form_data->selected_message_number]->m_from}<br />
			<span style="font-weight:bold;">An:</span> {$form_data->ticket_messages[$form_data->selected_message_number]->m_to}<br />
			<span style="font-weight:bold;">Betreff:</span> {$form_data->ticket_messages[$form_data->selected_message_number]->subject}<br />
			<br />
			<span style="font-weight:bold;">Nachricht:</span><br />
			<div style="position:relative;height:auto;background:#eeeeee;padding:10px;">
			{$form_data->ticket_messages[$form_data->selected_message_number]->message}<br>
			</div>
			{if $form_data->ticket_messages[$form_data->selected_message_number]->attachments}
			Anh&auml;nge:<br />
			{foreach from=$form_data->ticket_messages[$form_data->selected_message_number]->attachments item=file}
			<a href="./index.php?admin_modul=admin_cs_ticket_editor&id={$form_data->id}&file_id={$file->id}&mod=file_load">{$file->file_name}</a><br />
			{/foreach}
			{/if}
		{/if}
	</div>
</div>

{if $form_data->id}
<div id="adminRightFloater">
    <div title="Ticket" id="ticket">
		<b>Nummer:</b>  
		{$form_data->number}
		<br>
		<b>Status:</b>  
		{if $form_data->state_id == 1}
		neu
		{/if}
		{if $form_data->state_id == 2}
		in Bearbeitung
		{/if}
		{if $form_data->state_id == 3}
		geschlossen
		{/if}
		<br>
		<b>Kunde:</b><br>
		{if $form_data->customer->company}{$form_data->customer->company}<br>{/if}
		{$form_data->customer->firstname} {$form_data->customer->surname}
	</div>		
</div>
{/if}
</div>
<script src="{$info->base_url}/themes/admin/media/js/admin_standard_message_editor.js"></script>



{if $info_message}<div class="info_message message">{$info_message}</div>{/if}
{if $warning_message}<div class="warning_message message">{$warning_message}</div>{/if}
{if $error_message}<div class="error_message message">{$error_message}</div>{/if}