<div id="selReportBugs">
	{include file='../general/box.tpl' opt='data_top'}
  	<h2>{$LANG.reportbugs_page_title}</h2>
	{if $myobj->isShowPageBlock('block_bugs_list')}
	<div>
		{if $myobj->getFormField('order') eq 'open'}
			<a href="{$all}" class="clsReplyAll" >{$LANG.replybugs_all}</a>
			<a href="{$open}" class="clsReplyOpen clsBold" >{$LANG.replybugs_open}</a>
			<a href="{$close}" class="clsReplyClosed" >{$LANG.replybugs_close}</a>
		{elseif $myobj->getFormField('order') eq 'all'}
			<a href="{$all}" class="clsReplyAll clsBold" >{$LANG.replybugs_all}</a>
			<a href="{$open}" class="clsReplyOpen" >{$LANG.replybugs_open}</a>
			<a href="{$close}" class="clsReplyClosed" >{$LANG.replybugs_close}</a>
		{elseif $myobj->getFormField('order') eq 'close'}
			<a href="{$all}" class="clsReplyAll" >{$LANG.replybugs_all}</a>
			<a href="{$open}" class="clsReplyOpen" >{$LANG.replybugs_open}</a>
			<a href="{$close}" class="clsReplyClosed clsBold" >{$LANG.replybugs_close}</a>
		{else}
			<a href="{$all}" class="clsReplyAll" >{$LANG.replybugs_all}</a>
			<a href="{$open}" class="clsReplyOpen clsBold" >{$LANG.replybugs_open}</a>
			<a href="{$close}" class="clsReplyClosed" >{$LANG.replybugs_close}</a>
		{/if}
	</div>
	{/if}
   	<div class="clsCommonInsideContent">
  		{include file='../general/information.tpl'}

  		{ if $myobj->isShowPageBlock('block_reportbugs')}

  		<form name="form_reportbugs_show" id="form_reportbugs_show" method="post" action="{$myobj->getCurrentUrl(true)}">
        <!-- clsFormSection - starts here -->
    		<table class="clsFormTbl">
	      	<tr class="clsFormRow">
		        <td class="{$myobj->getCSSFormLabelCellClass('subject')}">
		          <label for="subject">{$LANG.reportbugs_subject}{$myobj->displayCompulsoryIcon()}</label>{$myobj->ShowHelpTip('reportbugs_subject', 'subject')}
		        </td>
		        <td class="{$myobj->getCSSFormFieldCellClass('subject')}">
		          <select name="subject" id="subject" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('subject')}">
				  {$myobj->generalPopulateArray($CFG.lists_array.bug_category, $myobj->getFormField('subject'))}
				  </select>
				  {$myobj->getFormFieldElementErrorTip('subject')}
		        </td>
    		</tr>
      		<tr class="clsFormRow">
		        <td class="{$myobj->getCSSFormLabelCellClass('message')}">
		          <label for="message">{$LANG.reportbugs_message}{$myobj->displayCompulsoryIcon()}</label> {$myobj->ShowHelpTip('reportbugs_message', 'message')}
		        </td>
		        <td class="{$myobj->getCSSFormFieldCellClass('message')}">
		          <textarea name="message" id="message" tabindex="{smartyTabIndex}" rows="4" cols="45" onFocus="updatelength(this);" onKeyUp="updatelength(this);" maxlength="{$CFG.admin.bug_max_size}">{$myobj->getFormField('message')}</textarea>{$myobj->getFormFieldElementErrorTip('message')}
				  <div id="ss" class="clsZeroColour"><span> {$LANG.header_remainig} :</span> <span class="clsCharacterLimit">{literal}<script language="javascript" type="text/javascript">var c = bug_max_size - document.getElementById('message').value.length;document.write(c);</script>{/literal}</span></div>

			   </td>
       		</tr>
      		<tr class="clsFormRow">
		        <td class=" {$myobj->getCSSFormFieldCellClass('default')}">&nbsp;</td>
				<td class=" {$myobj->getCSSFormFieldCellClass('default')}">

		          <input type="submit" class="clsSubmitButton" name="submit_reportbugs" id="submit" value="{$LANG.reportbugs_submit}" tabindex="{smartyTabIndex}" />

		        </td>
      		</tr>
    	</table>
    	<!-- clsFormSection - ends here -->
  		</form>
  		{literal}
			 <script type="text/javascript">
				needLiveValidation('subject',Array('Presence'));
				needLiveValidation('message',Array('Presence'));
			</script>
		 {/literal}
  		{/if}

  		{if $myobj->isShowPageBlock('block_bugs_list')}

			<form name="selListStaticForm" id="selListStaticForm" method="post" action="{$myobj->getCurrentUrl(false)}">
				{if $CFG.admin.navigation.top}
					{include file='../general/pagination.tpl'}
				{/if}
				<!-- clsDataDisplaySection - starts here -->
				<table class="clsDataRow {$myobj->getCSSRowClass()}">
					<tr>
						{if $myobj->getFormField('order') neq 'close'}
						<th>&nbsp;<input type="checkbox" class="clsCheckRadio" id="checkall" onclick="selectAll(this.form)" name="checkall" tabindex="{smartyTabIndex}" /></th>
						{/if}
						<th><span class="clsBold">{$LANG.common_subject}</span></th>
						<th><span class="clsBold">{$LANG.bug_details}</span> </th>

					</tr>

					{foreach key=pblkey item=pblvalue from=$myobj->block_sel_page_list.populateBugsList}

						<tr>
							{if $myobj->getFormField('order') neq 'close'}
							 <td class="clsBugReportSubject"><input type="checkbox" class="clsCheckRadio" name="bug_ids[]" tabindex="{smartyTabIndex}" value="{$pblvalue.bug_id}" onClick="disableHeading('selListStaticForm');" /></td>
							{/if}
							<td><p class="clsBugReportSubject">{$pblvalue.record.bug_subject}</p></td>
							<td>
								<p><span class="clsBold">{$LANG.common_date_added}</span>&nbsp;:&nbsp;{$pblvalue.record.date_added|date_format}
</p>
								<p><span class="clsBold">{$LANG.post_by}</span>&nbsp;:&nbsp;{$pblvalue.record.reply_from}</p>
								<p><span class="clsBold">{$LANG.common_status}</span>&nbsp;:&nbsp;{$pblvalue.record.status}</p>
								<p>{$pblvalue.record.bug_content}</p>
								{if $pblvalue.populateBugReplyList}
								<!--<p id="hideblock{$pblvalue.record.bug_id}" onclick="showHideBlock('showHide{$pblvalue.record.bug_id}', 'hideblock{$pblvalue.record.bug_id}');">Hide</p>-->
								<div id="showHide{$pblvalue.record.bug_id}" style="display:block;">
								<p><div class="clsBubInfoTitle clsNoBorder" id="{$pblvalue.replySpanIDId}">
								{if $pblvalue.populateBugReplyList}
								<div>
									{foreach key=pbrlkey item=pbrlvalue from=$pblvalue.populateBugReplyList}
									{ if $pbrlvalue.record.reply_from eq $CFG.site.name}
											<div class="clsBugReply">
										{else}
											<div class="clsBugReply" style="background-color:#CCCCCC;">
										{/if}
											<p><span class="clsBold">{$LANG.common_date_added}</span> : {$pbrlvalue.record.date_added|date_format}</p>
											<p><span class="clsBold">{$LANG.post_by}</span>&nbsp;{$pbrlvalue.record.reply_from}</p>
											<p><span class="clsBold">{$LANG.common_status}</span>&nbsp;{$pbrlvalue.record.status}</p>
											<p>{$pbrlvalue.record.bug_content}</p>
											</div>

									{/foreach}
								</div>
								{/if}
								</div></p>

								{/if}
								{if $pblvalue.populateBugReplyList && $pblvalue.record.status neq 'Closed'}
								<p><a href="{$pblvalue.replybugs_open.url}" onclick="c=hideOtherText('{$pblvalue.replySpanIDId}');if (c == 0) ajaxUpdateDiv('{$pblvalue.replybugs_open.url}', 'ajax_page=true&showOptionToReply=1&bug_id={$pblvalue.record.bug_id}&parent_id={$pblvalue.record.parent_id}', 'msg{$pblvalue.replySpanIDId}'); return false;">{$LANG.replybugs_reply}</a></p>
								{/if}
								<div id="msg{$pblvalue.replySpanIDId}">
								</div>
								<!--</div>-->
							</td>
						</tr>



					{/foreach}
					{if $myobj->getFormField('order') neq 'close'}
					 <tr>

					<td colspan="3"  class="clsButtonAlignment {$myobj->getCSSFormFieldCellClass('submit')}">
						<input type="hidden" value="{$LANG.bug_close}" name="action" id="action" />
					   <input type="button" class="clsSubmitButton" name="todo" id="todo" onclick="getMultiCheckBoxValue('selListStaticForm', 'checkall', '{$LANG.select_a_bug}');if(multiCheckValue!='')getAction()" value="{$LANG.bug_close}" tabindex="{smartyTabIndex}" />
					</td>

				  </tr>
				  {/if}
				</table>
				<!-- clsDataDisplaySection - ends here -->
				{$myobj->populateHidden($myobj->block_sel_page_list.hidden_arr)}
				{if $CFG.admin.navigation.bottom}
					{include file='../general/pagination.tpl'}
				{/if}
			</form>
		{/if}
		<div id="selMsgConfirm" class="clsPopupConfirmation" style="display:none;position:absolute;">
    	  <p id="msgConfirmText"></p>
		  <form name="msgConfirmform" id="msgConfirmform" method="post" action="{$myobj->getCUrrentUrl()}" autocomplete="off">
			<table class="clsCommonTable" summary="{$LANG.reportbugs_tbl_summary}">
			  <tr>
				<td>
				<input type="submit" class="clsSubmitButton" name="yes" id="yes" value="{$LANG.common_yes_option}" tabindex="{smartyTabIndex}" />
					&nbsp;
					<input type="button" class="clsCancelButton" name="no" id="no" value="{$LANG.common_no_option}" tabindex="{smartyTabIndex}" onClick="return hideAllBlocks('selListStaticForm')" />
					<input type="hidden" name="act" id="act" />
					<input type="hidden" name="bug_ids" id="bug_ids" />
					<input type="hidden" name="action" id="action" />
					{$myobj->populateHidden($myobj->list_records_confirm_arr)}
				</td>
			  </tr>
			</table>
		  </form>
  </div>
  	</div>
  	{include file='../general/box.tpl' opt='data_bottom'}
</div>
{literal}
<script defer="defer" language="javascript" type="text/javascript">
	function hideOtherText(value)
		{


		      var divEls = document.getElementsByTagName("textarea");
			  if (divEls.length >0)
			  		{
						alert_manual('Please cancel the previous opened textbox to proceed');
					}
			  else
			  	return 0;


		}
	function chkMessage(message,form)
			{
				var comm = document.getElementById(message).value
				if(comm=='' || comm == null)
					{
						alert_manual("Enter Proper messsage");
					}
				else
					return 0;

			}
	function showHideBlock(value, block)
			{

				if(document.getElementById(value).style.display == 'none' )
					{
						document.getElementById(value).style.display = 'block';
						document.getElementById(block).innerHTML = 'Hide';
					}
				else if (document.getElementById(value).style.display == 'block' )
					{
						document.getElementById(value).style.display = 'none';
						document.getElementById(block).innerHTML = 'Show';
					}
			}
</script>
{/literal}