<?/*
Copyright (C) 2003 Media Net Link, Inc. Danville, CA 94526 USA

This file is part of AthenaRMS.

AthenaRMS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

AthenaRMS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/?>
<?php
  require_once 'web_root.php';

  global $REMOTE_USER;
  $pid = $REMOTE_USER;

  global $VALIGN;
  if ($VALIGN != 'top') {
    $VALIGN = 'bottom';
    $target = 'target="_blank"';
    $do_js = 1;
  } else {
    $target = '';
    $do_js = 0;
  }

  $is_admin = '';
  $are_my_open_tickets = '';

  require_once 'person.php';
  $persono = new Person ();

  ## maybe make Is_Type accept an array to reduce to 1 query from 2?
  if ($persono->Is_Type($REMOTE_USER,'Support Admin') or $persono->Is_Super_Admin()) {
    $is_admin = "
<td class=\"navlnk\" align=\"center\" valign=\"middle\"><a class=\"navlnk\" href=\"$web_root/admin/\">admin</a></td><td class=\"navlnk\" align=\"center\" valign=\"middle\"><img src=\"$web_root/img/console-spacer.gif\" width=\"2\" height=\"23\" border=\"0\" hspace=\"7\" alt=\"\" /></td>
";
  }

  if ($_SESSION['MY_OPEN_COUNT']) {
    $are_my_open_tickets = "
<td nowrap=\"nowrap\" class=\"navlnkred\" align=\"center\" valign=\"middle\"><a class=\"navlnkred\" href=\"$web_root/support/search/search.php?status[]=Open&amp;status[]=ReOpen&amp;support_person_id[]=$pid\">my open</a></td>
<td nowrap=\"nowrap\" class=\"navlnk\" align=\"center\" valign=\"middle\">&nbsp;<a href=\"$web_root/support/search/search.php?status[]=Open&amp;status[]=ReOpen&amp;support_person_id[]=$pid&save_option=list\"><img src=\"$web_root/img/bug-listview-sm.gif\" alt=\"list view\" width=\"8\" height=\"9\" border=\"0\" /></a></td>
<td class=\"navlnk\" align=\"center\" valign=\"middle\"><img src=\"$web_root/img/console-spacer.gif\" width=\"2\" height=\"23\" border=\"0\" hspace=\"7\" alt=\"\" /></td>
";
  }
?>

<!-- begin support nav -->

<?php if ($RUSER_REC['CRM_NAME']) { ?>

<table width="100%" border="0" height="23" cellpadding="0" cellspacing="0">
<tr>
<td nowrap="nowrap" align="center" class="textsm" valign="middle"><img src="<?= $web_root ?>/img/cldot.gif" width="5" height="1" alt="" /><b class="supnavrmsttyl"><?php echo $RUSER_REC['CRM_NAME']; ?></b>
<img src="<?= $web_root ?>/img/cldot.gif" width="5" height="1" alt="" /></td>
  <td align="center" class="textsm" valign="middle">

<table cellpadding="0" cellspacing="0"><tr valign="middle">
<td class="navlnk" align="center" valign="middle"><img src="<?= $web_root ?>/img/console-spacer.gif" width="2" height="23" border="0" hspace="7" alt="" /></td>
<td class="navlnk" align="center" valign="middle"><a class="navlnk" href="<?= $web_root ?>/">home</a></td>
<td class="navlnk" align="center" valign="middle"><img src="<?= $web_root ?>/img/console-spacer.gif" width="2" height="23" border="0" hspace="7" alt="" /></td>
<td class="navlnk" align="center" valign="middle"><a href="<?= $web_root ?>/support/search/search_form" class="navlnk">search</a></td>
<td class="navlnk" align="center" valign="middle"><img src="<?= $web_root ?>/img/console-spacer.gif" width="2" height="23" border="0" hspace="7" alt="" /></td>
<td class="navlnk" align="center" valign="middle"><a href="<?= $web_root ?>/support/search/my_queries" class="navlnk">queries</a></td>
<td class="navlnk" align="center" valign="middle"><img src="<?= $web_root ?>/img/console-spacer.gif" width="2" height="23" border="0" hspace="7" alt="" /></td>
<td class="navlnk" align="center" valign="middle"><a href="<?= $web_root ?>/support/reports/" class="navlnk">reports</a></td>
<td class="navlnk" align="center" valign="middle"><img src="<?= $web_root ?>/img/console-spacer.gif" width="2" height="23" border="0" hspace="7" alt="" /></td>
<?php echo $is_admin; ?>
<td nowrap="nowrap" class="navlnk" align="center" valign="middle"><a href="<?= $web_root ?>/support/email/blaster" class="navlnk">email blast</a></td>
<td class="navlnk" align="center" valign="middle"><img src="<?= $web_root ?>/img/console-spacer.gif" width="2" height="23" border="0" hspace="7" alt="" /></td>
<?php echo $are_my_open_tickets; ?>
<td nowrap="nowrap" class="navlnk" align="center" valign="middle"><a class="navlnk" href="<?= $web_root ?>/support/search/search.php?status[]=Open&amp;status[]=ReOpen">all open</a></td>
<td nowrap="nowrap" class="navlnk" align="center" valign="middle">&nbsp;<a href="<?= $web_root ?>/support/search/search.php?status[]=Open&amp;status[]=ReOpen&save_option=list"><img src="<?= $web_root ?>/img/bug-listview-sm.gif" alt="list view" width="8" height="9" border="0" /></a></td>
<td class="navlnk" align="center" valign="middle"><img src="<?= $web_root ?>/img/console-spacer.gif" width="2" height="23" border="0" hspace="7" alt="" /></td>

</tr></table>

  </td>
  <td width="75" align="center" class="textsm" valign="middle">


<table border="0" cellpadding="1" cellspacing="0">

<tr><form action="<?= $web_root ?>/support/ticket/edit_ticket" method="get" <?php echo $target; ?>>
  <td>
<input type="text" size="7" name="ticket_id" class="nav"
<?php
if ($do_js) { ?>
 value="ticket id"
 onfocus="if(this.value=='ticket id') {this.value='';}"
 onblur="if(this.value=='') {this.value='ticket id';}"
<?php } ?>
/>
  </td>
  <td>
<input class="navarrow" type="image" width="16" height="16" src="<?= $web_root ?>/img/btn-go.gif" alt="" border="0" />
  </td></form></tr>

</table>


    </td>
</tr>

</table>

<?php } ?>

<!-- end support nav -->

