showFormHelpdesk() public method

Print the helpdesk form
public showFormHelpdesk ( $ID, $ticket_template = false ) : nothing
$ID integer ID of the user who want to display the Helpdesk
$ticket_template boolean ticket template for preview : false if not used for preview (false by default)
return nothing (print the helpdesk)
Ejemplo n.º 1
0
 static function showFormHelpdesk($ID, $ticket_template = false)
 {
     $ticketdisplay = "";
     ob_start();
     $ticket = new Ticket();
     $ticket->showFormHelpdesk($ID, $ticket_template);
     $ticketdisplay = ob_get_contents();
     ob_end_clean();
     $ticketdisplay = str_replace("/front/tracking.injector.php", "/plugins/surveyticket/front/displaysurvey.form.php", $ticketdisplay);
     $split = explode("<td><textarea name='content' cols='80' rows='14'></textarea>", $ticketdisplay);
     echo $split[0];
     if (isset($split[1])) {
         echo "<td height='120'>";
         //         $psSurvey = new PluginSurveyticketSurvey();
         //         $psSurvey->startSurvey();
         echo $split[1];
     }
 }
Ejemplo n.º 2
0
        Html::redirect($CFG_GLPI['root_doc'] . "/front/ticket.php");
    } else {
        if (Session::haveRight('reservation', ReservationItem::RESERVEANITEM)) {
            Html::redirect($CFG_GLPI['root_doc'] . "/front/reservationitem.php");
        } else {
            if (Session::haveRight('knowbase', KnowbaseItem::READFAQ)) {
                Html::redirect($CFG_GLPI['root_doc'] . "/front/helpdesk.faq.php");
            }
        }
    }
}
Session::checkHelpdeskAccess();
if (isset($_GET['create_ticket'])) {
    Html::helpHeader(__('New ticket'), $_SERVER['PHP_SELF'], $_SESSION["glpiname"]);
    $ticket = new Ticket();
    $ticket->showFormHelpdesk(Session::getLoginUserID());
} else {
    Html::helpHeader(__('Home'), $_SERVER['PHP_SELF'], $_SESSION["glpiname"]);
    echo "<table class='tab_cadre_postonly'><tr class='noHover'>";
    echo "<td class='top' width='50%'><br>";
    echo "<table class='central'>";
    if (Session::haveRight('ticket', CREATE)) {
        echo "<tr class='noHover'><td class='top'>";
        Ticket::showCentralCount(true);
        echo "</td></tr>";
        echo "<tr class='noHover'><td class='top'>";
        Ticket::showCentralList(0, "survey", false);
        echo "</td></tr>";
    }
    if (Session::haveRight("reminder_public", READ)) {
        echo "<tr class='noHover'><td class='top'>";
Ejemplo n.º 3
0
 /**
  * Print preview for Ticket template
  *
  * @param $tt TicketTemplate object
  *
  * @return Nothing (call to classes members)
  **/
 static function showHelpdeskPreview(TicketTemplate $tt)
 {
     if (!$tt->getID()) {
         return false;
     }
     if ($tt->getFromDBWithDatas($tt->getID())) {
         $ticket = new Ticket();
         $ticket->showFormHelpdesk(Session::getLoginUserID(), $tt->getID());
     }
 }
    }
}
if (!isset($_POST["itemtype"]) || empty($_POST["items_id"]) && $_POST["itemtype"] != 0) {
    $_POST["itemtype"] = '';
    $_POST["items_id"] = 0;
}
if (isset($_POST['add'])) {
    if ($newID = $track->add($_POST)) {
        if (isset($_POST["_type"]) && $_POST["_type"] == "Helpdesk") {
            echo "<div class='center spaced'>" . __('Your ticket has been registered, its treatment is in progress.');
            Html::displayBackLink();
            echo "</div>";
        } else {
            echo "<div class='center b spaced'>";
            echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/ok.png' alt='" . __s('OK') . "'>";
            Session::addMessageAfterRedirect(__('Thank you for using our automatic helpdesk system.'));
            Html::displayMessageAfterRedirect();
            echo "</div>";
        }
    } else {
        echo "<div class='center'>";
        echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/warning.png' alt='" . __s('Warning') . "'><br>";
        Html::displayMessageAfterRedirect();
        echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php?create_ticket=1'>" . __('Back') . "</a></div>";
    }
    Html::nullFooter();
} else {
    // reload display form
    $track->showFormHelpdesk(Session::getLoginUserID());
    Html::helpFooter();
}