showForm() public method

public showForm ( $ID, $options = [] )
コード例 #1
0
ファイル: ticket.form.php プロジェクト: gaforeror/glpi
                            }
                        }
                    }
                }
            }
        }
    }
}
if (isset($_GET["id"]) && $_GET["id"] > 0) {
    if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
        Html::helpHeader(Ticket::getTypeName(2), '', $_SESSION["glpiname"]);
    } else {
        Html::header(Ticket::getTypeName(2), '', "maintain", "ticket");
    }
    $available_options = array('load_kb_sol');
    $options = array();
    foreach ($available_options as $key) {
        if (isset($_GET[$key])) {
            $options[$key] = $_GET[$key];
        }
    }
    $track->showForm($_GET["id"], $options);
} else {
    Html::header(__('New ticket'), '', "maintain", "ticket");
    $track->showForm(0);
}
if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
    Html::helpFooter();
} else {
    Html::footer();
}
コード例 #2
0
 /**
  * Print preview for Ticket template
  *
  * @since version 0.83
  *
  * @param $tt TicketTemplate object
  *
  * @return Nothing (call to classes members)
  **/
 static function showCentralPreview(TicketTemplate $tt)
 {
     if (!$tt->getID()) {
         return false;
     }
     if ($tt->getFromDBWithDatas($tt->getID())) {
         $ticket = new Ticket();
         $ticket->showForm(0, array('template_preview' => $tt->getID()));
     }
 }
コード例 #3
0
    }
}
if (isset($_GET["id"]) && $_GET["id"] > 0) {
    if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
        helpHeader($LANG['Menu'][5], '', $_SESSION["glpiname"]);
    } else {
        commonHeader($LANG['Menu'][5], '', "maintain", "ticket");
    }
    $available_options = array('load_kb_sol');
    $options = array();
    foreach ($available_options as $key) {
        if (isset($_GET[$key])) {
            $options[$key] = $_GET[$key];
        }
    }
    $track->showForm($_GET["id"], $options);
} else {
    commonHeader($LANG['job'][13], '', "maintain", "ticket");
    $users_id_requester = getLoginUserID();
    // No default requester if own ticket right = tech and update_ticket right to update requester
    if (haveRight('own_ticket', 1) && haveRight('update_ticket', 1)) {
        $users_id_requester = 0;
    }
    // Set default value...
    $values = array('_users_id_requester' => $users_id_requester, '_users_id_requester_notif' => array('use_notification' => 1), '_groups_id_requester' => 0, '_users_id_assign' => 0, '_users_id_assign_notif' => array('use_notification' => 1), '_groups_id_assign' => 0, '_users_id_observer' => 0, '_users_id_observer_notif' => array('use_notification' => 1), '_groups_id_observer' => 0, 'suppliers_id_assign' => 0, 'name' => '', 'content' => '', 'ticketcategories_id' => 0, 'urgency' => 3, 'impact' => 3, 'priority' => Ticket::computePriority(3, 3), 'requesttypes_id' => $_SESSION["glpidefault_requesttypes_id"], 'hour' => 0, 'minute' => 0, 'date' => $_SESSION["glpi_currenttime"], 'entities_id' => $_SESSION["glpiactive_entity"], 'status' => 'new', 'followup' => array(), 'itemtype' => '', 'items_id' => 0, 'plan' => array(), 'global_validation' => 'none', 'due_date' => '', 'slas_id' => 0, '_add_validation' => 0, 'type' => -1);
    // Restore saved value or override with page parameter
    foreach ($values as $name => $value) {
        if (isset($_REQUEST[$name])) {
            $values[$name] = $_REQUEST[$name];
        } else {
            if (isset($_SESSION["helpdeskSaved"][$name])) {