<?/*
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
  ## $dd - standard drop-down functions
  ## $ticket - ticket object populated with current ticket
  ## $person - person object populated with ticket creator person_id ($ticket->Get ('user_person_id'))
  ## $display - object used to display access based content, Value is it's primary method. The encapsulating script will set whether or not the content is visible already.
?>
            <table border="0" cellspacing="0" cellpadding="3">
            <tbody>
            <tr>
              <td align="right" class="textsm" nowrap="nowrap">Status:</td>
              <td align="left" class="textsm" nowrap="nowrap"><?php
  $tmp = $dd->status ($ticket->Get ('status'));
  echo $display->Value ('<select name="status" class="textsm">'.$tmp.'</select>', $tmp);
?></td>
            </tr>
            <tr>
              <td align="right" class="textsm" nowrap="nowrap">Support<br />Owner: </td>
              <td align="left" class="textsm" nowrap="nowrap"><?php
  $tmp = $dd->support_person ($ticket->Get ('support_person_id'), $person);
  echo $display->Value ('<select name="support_person_id" onchange="submit_page ();" class="textsm">'.$tmp.'</select>', $tmp);
?></td>
            </tr>
            <tr>
              <td align="right" class="textsm" nowrap="nowrap">Escalated to: </td>
              <td align="left" class="textsm" nowrap="nowrap"><?php
  $tmp = $dd->escalated_person ($ticket->Get ('escalated_to_person_id'), $person);
  echo $display->Value ('<select name="escalated_to_person_id" class="textsm">'.$tmp.'</select>', $tmp);
?></td>
            </tr>
            <tr>
              <td align="right" class="textsm" nowrap="nowrap">Problem: </td>
              <td align="left" class="textsm" nowrap="nowrap"><?php
  $tmp = $dd->problem_types_ondisplay ($ticket->Get ('problem_id'));
  echo $display->Value ('<select name="problem_id" class="textsm">'.$tmp.'</select>', $tmp);
?></td>
            </tr>
            <tr>
              <td nowrap="nowrap" align="right" class="textsm">Last Name: </td>
              <td nowrap="nowrap" align="left" class="textsm"><?php
  $tmp = htmlentities($person->Get ('last_name'));
  echo $display->Value ('<input value="'.$tmp.'" name="last_name" class="textsm" />', $tmp);
?></td>
            </tr>
            <tr>
              <td nowrap="nowrap" align="right" class="textsm">First Name: </td>
              <td nowrap="nowrap" align="left" class="textsm"><?php
  $tmp = htmlentities($person->Get ('first_name'));
  echo $display->Value ('<input value="'.$tmp.'" name="first_name" class="textsm" />', $tmp);
?></td>
            </tr>
            <tr>
              <td align="right" class="textsm" nowrap="nowrap">Company: </td>
              <td align="left" class="textsm" nowrap="nowrap"><?php
  $tmp = htmlentities($person->Get ('company'));
  echo $display->Value ('<input value="'.$tmp.'" name="company" class="textsm" />', $tmp);
?></td>
            </tr>
            <tr>
              <td align="right" class="textsm" nowrap="nowrap">Phone: </td>
              <td align="left" class="textsm" nowrap="nowrap"><?php
  $tmp = htmlentities($person->Get ('work_phone'));
  echo $display->Value ('<input value="'.$tmp.'" name="work_phone" class="textsm" />', $tmp);
?></td>
            </tr>
            <tr>
              <td align="right" class="textsm" nowrap="nowrap">Email: </td>
              <td align="left" class="textsm" nowrap="nowrap"><?php
  $tmp = htmlentities($person->Get ('email'));
  echo $display->Value ('<input value="'.$tmp.'" name="email" class="textsm" />', $tmp);
?></td>
            </tr>

            <tr>
              <td nowrap="nowrap" align="right" class="textsm">Subject: </td>
              <td align="left" class="textsm" nowrap="nowrap">

              <?php
  $tmp = htmlentities($ticket->Get ('subject'));
  echo $display->Value ('<input value="'.$tmp.'" name="subject" class="textsm" />', $tmp);
?></td>
            </tr>
            <tr>
              <td align="right" class="textsm" nowrap="nowrap">Add. Info 1: </td>
              <td align="left" class="textsm" nowrap="nowrap"><?php
  $tmp = htmlentities($ticket->Get ('info1'));
  echo $display->Value ('<input value="'.$tmp.'" name="info1" class="textsm" />', $tmp);
?></td>
            </tr>
            <tr>
              <td align="right" class="textsm" nowrap="nowrap">Add. Info 2: </td>
              <td align="left" class="textsm" nowrap="nowrap"><?php
  $tmp = htmlentities($ticket->Get ('info2'));
  echo $display->Value ('<input value="'.$tmp.'" name="info2" class="textsm" />', $tmp);
?></td>
            </tr>
            <tr>
              <td align="right" class="textsm" nowrap="nowrap">Performance<br />Issue:</td>
              <td align="left" class="textsm" nowrap="nowrap"><?php
  $tmp = $dd->yes_no ($ticket->Get ('use_help'));
  echo $display->Value ('<select name="use_help" class="textsm">'.$tmp.'</select>', $tmp);
?></td>
            </tr>
            <tr>
              <td align="right" class="textsm" nowrap="nowrap">Email Blast:</td>
              <td align="left" class="textsm" nowrap="nowrap"><?php
  $tmp = $dd->yes_no ($ticket->Get ('mass_queue'));
  echo $display->Value ('<select name="mass_queue" class="textsm">'.$tmp.'</select>', $tmp);
?></td>
            </tr>
<?php
  if ($display->Editable ()) {
    require_once 'template.php';
    $temp = new Template ();
    $temp_list = $temp->List_All ('', '');

    if (count($temp_list) > 0) {
      $temp_dd = $dd->Multi_Array_Drop_Down ($temp_list);
?>
            <tr>
              <td align="right" class="textsm" nowrap="nowrap">Reply<br />Template: </td>
              <td align="left" class="textsm" nowrap="nowrap"> <select name="template_id" class="textsm"><option value=""></option><?php echo $temp_dd; ?></select></td>
            </tr>
<?php
    }
  }

  if ($display->Editable () and (count($crm_list) > 0)) {
?>
            <tr>
              <td align="right" class="textsm" nowrap="nowrap">Move<br />To RMS: </td>
              <td align="left" class="textsm" nowrap="nowrap"> <select name="move_to_crm_id" class="textsm"><option value="" selected="selected">--Choose--</option><?php echo $crm_dd; ?></select></td>
            </tr>
<?php
  }

  $history = $ticket->Owner_History ($ticket_id);

  if (count($history) > 0) {
    print '
            <tr>
              <th align="center" class="textsm" nowrap="nowrap" colspan="2">Ticket History</th>
            </tr>
';
    foreach ($history as $h) {
      print <<<EOF
            <tr>
              <td align="left" class="textsm" nowrap="nowrap" colspan="2">$h[from_crm_name] => $h[to_crm_name] ($h[created_on])</td>
            </tr>
EOF;
    }
  }
?>
            </tbody>
            </table>
