Exemplo n.º 1
0
 public static function show($ID, $from_followup)
 {
     global $LANG, $CFG_GLPI, $DB, $content;
     if (!Session::haveRight("followup", TicketFollowup::SEEPUBLIC)) {
         return false;
     }
     $is_private = 0;
     $requesttypes_id = "1";
     $content = "";
     if (isset($_SESSION["helpdeskSaved"]["content"])) {
         $content = cleanPostForTextArea($_SESSION["helpdeskSaved"]["content"]);
     }
     if (isset($_SESSION["helpdeskSaved"]["requesttypes_id"])) {
         $requesttypes_id = stripslashes($_SESSION["helpdeskSaved"]["requesttypes_id"]);
     }
     if (isset($_SESSION["helpdeskSaved"]["is_private"])) {
         $is_private = stripslashes($_SESSION["helpdeskSaved"]["is_private"]);
     }
     unset($_SESSION["helpdeskSaved"]);
     //}
     if (isset($_REQUEST['new'])) {
         echo "<div style='text-align:center; margin-top:20px;'> <b> " . $LANG['plugin_mobile']['common'][13] . " </b></div>";
     }
     echo "<form method='post' name='followupform' action=" . $CFG_GLPI["root_doc"] . "/plugins/mobile/front/followup.php?id=" . $_REQUEST['id'] . "&new=1 >";
     echo "<table>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>&nbsp;</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['joblist'][6] . "&nbsp;:</td>";
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td class='right' colspan='2'><textarea name='content' cols='78' rows='14' >{$content}</textarea>";
     echo "</td></tr>";
     echo "<input type='hidden' name='_from_followup' value='{$from_followup}'>";
     echo "<input type='hidden' name='requesttypes_id' value='1'";
     echo "<input type='hidden' name='is_private' value='0'";
     echo "<input type='hidden' name='new' value='1'";
     echo "<tr class='tab_bg_2'>";
     echo "<td colspan='1' class='center'>";
     echo "<input type='submit' value=\"" . $LANG['plugin_mobile']['common'][7] . "\" class='submit' onClick=\"'history.go(-1)'\">";
     echo "</td></tr>";
     echo "</table>";
     Html::closeForm();
     if (Session::haveRight("followup", TicketFollowup::SEEPUBLIC)) {
         global $key, $new;
         $new = $_REQUEST['new'];
         if (isset($new) && $_POST['content'] != "") {
             $id = $_REQUEST['id'];
             $content = $_POST['content'];
             $query = "INSERT INTO glpi_ticketfollowups (tickets_id, date, users_id, content, is_private, requesttypes_id) \nVALUES (" . $id . ", NOW(), " . $ID . ", '" . $content . "', '" . $is_private . "', '" . $requesttypes_id . "') \n";
             $result = $DB->query($query);
         } elseif (isset($new) && $_POST['content'] == "") {
             echo $LANG['plugin_mobile']['common'][8];
         }
     }
 }
Exemplo n.º 2
0
/**
 * Print the helpdesk
 *
 * @param $ID int : ID of the user who want to display the Helpdesk
 * @param $from_helpdesk int : is display from the helpdesk.php ?
 *
 * @return nothing (print the helpdesk)
 **/
function printHelpDesk($ID, $from_helpdesk)
{
    global $DB, $CFG_GLPI, $LANG;
    if (!haveRight("create_ticket", "1")) {
        return false;
    }
    if (haveRight('validate_ticket', 1)) {
        $opt = array();
        $opt['reset'] = 'reset';
        $opt['field'][0] = 55;
        // validation status
        $opt['searchtype'][0] = 'equals';
        $opt['contains'][0] = 'waiting';
        $opt['link'][0] = 'AND';
        $opt['field'][1] = 59;
        // validation aprobator
        $opt['searchtype'][1] = 'equals';
        $opt['contains'][1] = getLoginUserID();
        $opt['link'][1] = 'AND';
        $url_validate = $CFG_GLPI["root_doc"] . "/front/ticket.php?" . append_params($opt, '&amp;');
        if (TicketValidation::getNumberTicketsToValidate(getLoginUserID()) > 0) {
            echo "<a href='{$url_validate}' title=\"" . $LANG['validation'][15] . "\"\n                alt=\"" . $LANG['validation'][15] . "\">" . $LANG['validation'][33] . "</a><br><br>";
        }
    }
    $query = "SELECT `email`, `realname`, `firstname`, `name`\n             FROM `glpi_users`\n             WHERE `id` = '{$ID}'";
    $result = $DB->query($query);
    $email = $DB->result($result, 0, "email");
    // Get saved data from a back system
    $use_email_notification = 1;
    if ($email == "") {
        $use_email_notification = 0;
    }
    $itemtype = 0;
    $items_id = "";
    $content = "";
    $title = "";
    $ticketcategories_id = 0;
    $urgency = 3;
    $type = 0;
    if (isset($_SESSION["helpdeskSaved"]['_users_id_requester_notif']) && isset($_SESSION["helpdeskSaved"]['_users_id_requester_notif']['use_notification'])) {
        $use_email_notification = stripslashes($_SESSION["helpdeskSaved"]['_users_id_requester_notif']['use_notification']);
    }
    if (isset($_SESSION["helpdeskSaved"]["email"])) {
        $email = stripslashes($_SESSION["helpdeskSaved"]["user_email"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["itemtype"])) {
        $itemtype = stripslashes($_SESSION["helpdeskSaved"]["itemtype"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["items_id"])) {
        $items_id = stripslashes($_SESSION["helpdeskSaved"]["items_id"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["content"])) {
        $content = cleanPostForTextArea($_SESSION["helpdeskSaved"]["content"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["name"])) {
        $title = stripslashes($_SESSION["helpdeskSaved"]["name"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["ticketcategories_id"])) {
        $ticketcategories_id = stripslashes($_SESSION["helpdeskSaved"]["ticketcategories_id"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["type"])) {
        $type = stripslashes($_SESSION["helpdeskSaved"]["type"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["urgency"])) {
        $urgency = stripslashes($_SESSION["helpdeskSaved"]["urgency"]);
    }
    unset($_SESSION["helpdeskSaved"]);
    echo "<form method='post' name='helpdeskform' action='" . $CFG_GLPI["root_doc"] . "/front/tracking.injector.php' enctype='multipart/form-data'>";
    echo "<input type='hidden' name='_from_helpdesk' value='{$from_helpdesk}'>";
    echo "<input type='hidden' name='requesttypes_id' value='" . RequestType::getDefault('helpdesk') . "'>";
    if ($CFG_GLPI['urgency_mask'] == 1 << 3) {
        // Dont show dropdown if only 1 value enabled
        echo "<input type='hidden' name='urgency' value='3'>";
    }
    echo "<input type='hidden' name='entities_id' value='" . $_SESSION["glpiactive_entity"] . "'>";
    echo "<div class='center'><table class='tab_cadre'>";
    echo "<tr><th colspan='2'>" . $LANG['job'][11] . "&nbsp;:&nbsp;";
    if (isMultiEntitiesMode()) {
        echo "&nbsp;(" . Dropdown::getDropdownName("glpi_entities", $_SESSION["glpiactive_entity"]) . ")";
    }
    echo "</th></tr>";
    if ($CFG_GLPI['urgency_mask'] != 1 << 3) {
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . $LANG['joblist'][29] . "&nbsp;:&nbsp;</td>";
        echo "<td>";
        Ticket::dropdownUrgency("urgency", $urgency);
        echo "</td></tr>";
    }
    if (NotificationTargetTicket::isAuthorMailingActivatedForHelpdesk()) {
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . $LANG['help'][8] . "&nbsp;:&nbsp;</td>";
        echo "<td>";
        $_REQUEST['value'] = getLoginUserID();
        $_REQUEST['field'] = '_users_id_requester_notif';
        $_REQUEST['use_notification'] = $use_email_notification;
        include GLPI_ROOT . "/ajax/uemailUpdate.php";
        echo "</td></tr>";
    }
    if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"] != 0) {
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . $LANG['help'][24] . "&nbsp;:&nbsp;</td>";
        echo "<td>";
        Ticket::dropdownMyDevices(getLoginUserID(), $_SESSION["glpiactive_entity"]);
        Ticket::dropdownAllDevices("itemtype", $itemtype, $items_id, 0, $_SESSION["glpiactive_entity"]);
        echo "</td></tr>";
    }
    echo "<tr class='tab_bg_1'>";
    echo "<td>" . $LANG['common'][17] . "&nbsp;:&nbsp;</td><td>";
    Ticket::dropdownType('type', $type);
    echo "</td></tr>";
    echo "<tr class='tab_bg_1'>";
    echo "<td>" . $LANG['common'][36] . "&nbsp;:&nbsp;</td><td>";
    Dropdown::show('TicketCategory', array('value' => $ticketcategories_id, 'condition' => '`is_helpdeskvisible`=1'));
    echo "</td></tr>";
    echo "<tr class='tab_bg_1'>";
    echo "<td>" . $LANG['common'][57] . "&nbsp;:&nbsp;</td>";
    echo "<td><input type='text' maxlength='250' size='50' name='name' value='{$title}'></td></tr>";
    echo "<tr class='tab_bg_1'>";
    echo "<td colspan='2'><textarea name='content' cols='78' rows='14'>{$content}</textarea>";
    echo "</td></tr>";
    echo "<tr class='tab_bg_1'>";
    echo "<td>" . $LANG['document'][2] . " (" . Document::getMaxUploadSize() . ")&nbsp;:&nbsp;";
    echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/aide.png' class='pointer' alt='" . $LANG['central'][7] . "' onclick=\"window.open('" . $CFG_GLPI["root_doc"] . "/front/documenttype.list.php','Help','scrollbars=1,resizable=1,width=1000,height=800')\">";
    echo "</td>";
    echo "<td><input type='file' name='filename' value='' size='25'></td></tr>";
    echo "<tr class='tab_bg_1'>";
    echo "<td colspan='2' class='center'>";
    echo "<input type='submit' value=\"" . $LANG['help'][14] . "\" class='submit'>";
    echo "</td></tr>";
    echo "</table></div></form>";
}
Exemplo n.º 3
0
    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])) {
                $values[$name] = $_SESSION["helpdeskSaved"]["{$name}"];
            }
        }
    }
    // Clean text fields
    $values['name'] = stripslashes($values['name']);
    $values['content'] = cleanPostForTextArea($values['content']);
    if (isset($_SESSION["helpdeskSaved"])) {
        unset($_SESSION["helpdeskSaved"]);
    }
    if ($values['type'] <= 0) {
        $values['type'] = EntityData::getUsedConfig('tickettype', $values['entities_id']);
    }
    $track->showForm(0, $values);
}
if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
    helpFooter();
} else {
    commonFooter();
}
Exemplo n.º 4
0
GLPI 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.

GLPI 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 GLPI; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--------------------------------------------------------------------------
*/
// ----------------------------------------------------------------------
// Original Author of file: Julien Dombre
// Purpose of file:
// ----------------------------------------------------------------------
$AJAX_INCLUDE = 1;
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
header("Content-Type: text/html; charset=UTF-8");
header_nocache();
checkLoginUser();
if (isset($_POST['name'])) {
    echo "<textarea " . (isset($_POST['rows']) ? " rows='" . $_POST['rows'] . "' " : "") . " " . (isset($_POST['cols']) ? " cols='" . $_POST['cols'] . "' " : "") . "  name='" . $_POST['name'] . "'>";
    echo cleanPostForTextArea(rawurldecode($_POST["data"]));
    echo "</textarea>";
}
Exemplo n.º 5
0
    public static function show($ID, $from_helpdesk)
    {
        global $LANG, $CFG_GLPI, $DB;
        //$logged = $_SESSION['glpiID'];
        if (!isset($_REQUEST['session'])) {
            $IDO = Session::getLoginUserID();
        } else {
            $IDO = $_REQUEST['session'];
        }
        $logged = $ID;
        /*
        echo $logged."logged2 ";
        echo Session::getLoginUserID()."session ";
        */
        if (isset($_REQUEST['id'])) {
            $ID = $_REQUEST['id'];
            $_SESSION["glpiID"] = $_REQUEST['id'];
            $query = "SELECT `profiles_id` AS id\nFROM `glpi_profiles_users`\nWHERE `users_id` = " . $IDO . "\nORDER BY `glpi_profiles_users`.`profiles_id` DESC";
            $result = $DB->query($query);
            $cont = $DB->numrows($result);
            $profile = $DB->fetch_assoc($result);
        } else {
            $ID = $_SESSION['glpiID'];
            $_SESSION['glpiID'] = $_SESSION['glpiID'];
            $query = "SELECT `profiles_id` AS id\nFROM `glpi_profiles_users`\nWHERE `users_id` = " . $IDO . "\nORDER BY `glpi_profiles_users`.`profiles_id` DESC";
            $result = $DB->query($query);
            $cont = $DB->numrows($result);
            $profile = $DB->fetch_assoc($result);
        }
        /*		
        echo $ID."id ";
        echo $_SESSION['glpiID']."glpiid ";
        echo $_SESSION['logged']."logged ";
        echo $logged."logged2 ";
        */
        if (!Session::haveRight("ticket", CREATE)) {
            return false;
        }
        if (Session::haveRight('validate_ticket', 1)) {
            //	      if (Session::haveRightsOr('ticketvalidation', array(TicketValidation::VALIDATEREQUEST, TicketValidation::VALIDATEINCIDENT))) {
            $opt = array();
            $opt['reset'] = 'reset';
            $opt['field'][0] = 55;
            // validation status
            $opt['searchtype'][0] = 'equals';
            $opt['contains'][0] = 'waiting';
            $opt['link'][0] = 'AND';
            $opt['field'][1] = 59;
            // validation aprobator
            $opt['searchtype'][1] = 'equals';
            $opt['contains'][1] = Session::getLoginUserID();
            //$opt['contains'][1]   = $ID;
            $opt['link'][1] = 'AND';
            $url_validate = $CFG_GLPI["root_doc"] . "/front/ticket.php?" . Toolbox::append_params($opt, '&amp;');
            if (TicketValidation::getNumberTicketsToValidate(Session::getLoginUserID()) > 0) {
                //if (TicketValidation::getNumberTicketsToValidate( $ID >0) {
                echo "<a href='{$url_validate}' title=\"" . $LANG['validation'][15] . "\"\n                      alt=\"" . $LANG['validation'][15] . "\">" . $LANG['validation'][33] . "</a><br><br>";
            }
        }
        // Stevenes Donato
        //email user
        $query = "SELECT  gu.id, ge.email, gu.`firstname`, gu.`realname`, gu.`name`\n                 FROM `glpi_users` gu, glpi_useremails ge\n                 WHERE gu.`id` = '{$ID}'\n\t\t\t\t\t  AND ge.users_id = gu.id ";
        $result = $DB->query($query);
        $email = $DB->result($result, 0, "email");
        $user_name = $DB->result($result, 0, "firstname") . " ";
        $user_sname = $DB->result($result, 0, "realname");
        //categories
        $query_cat = "SELECT id, completename\n\t\t\t\t\t\t\tFROM `glpi_itilcategories` \n\t\t\t\t\t\t\tWHERE `is_helpdeskvisible` = 1";
        $result_cat = $DB->query($query_cat);
        $itilcategories_id = $DB->fetch_assoc($result_cat);
        $sql_user = "******";
        $result_user = $DB->query($sql_user);
        $user = $DB->fetch_assoc($result_user);
        // Get saved data from a back system
        $use_email_notification = 1;
        if ($email == "") {
            $use_email_notification = 0;
        }
        $itemtype = 0;
        $items_id = "";
        $content = "";
        $title = "";
        //$itilcategories_id = 0;
        $urgency = 3;
        if (isset($_SESSION["helpdeskSaved"]["use_email_notification"])) {
            $use_email_notification = stripslashes($_SESSION["helpdeskSaved"]["use_email_notification"]);
        }
        if (isset($_SESSION["helpdeskSaved"]["email"])) {
            $email = stripslashes($_SESSION["helpdeskSaved"]["user_email"]);
        }
        if (isset($_SESSION["helpdeskSaved"]["itemtype"])) {
            $itemtype = stripslashes($_SESSION["helpdeskSaved"]["itemtype"]);
        }
        if (isset($_SESSION["helpdeskSaved"]["items_id"])) {
            $items_id = stripslashes($_SESSION["helpdeskSaved"]["items_id"]);
        }
        if (isset($_SESSION["helpdeskSaved"]["content"])) {
            $content = cleanPostForTextArea($_SESSION["helpdeskSaved"]["content"]);
        }
        if (isset($_SESSION["helpdeskSaved"]["name"])) {
            $title = stripslashes($_SESSION["helpdeskSaved"]["name"]);
        }
        if (isset($_SESSION["helpdeskSaved"]["itilcategories_id"])) {
            //$itilcategories_id = stripslashes($_SESSION["helpdeskSaved"]["itilcategories_id"]);
            $itilcategories_id = $_SESSION["helpdeskSaved"]["itilcategories_id"];
        }
        if (isset($_SESSION["helpdeskSaved"]["urgency"])) {
            $urgency = stripslashes($_SESSION["helpdeskSaved"]["urgency"]);
        }
        unset($_SESSION["helpdeskSaved"]);
        echo "<form method='post' name=\"helpdeskform\" action=\"" . $CFG_GLPI["root_doc"] . "/plugins/mobile/front/tracking.injector.php?ido=" . $IDO . "\" enctype=\"multipart/form-data\">";
        echo "<input type='hidden' name='_from_helpdesk' value='{$from_helpdesk}'>";
        if ($CFG_GLPI['urgency_mask'] == 1 << 3) {
            // Dont show dropdown if only 1 value enabled
            echo "<input type='hidden' name='urgency' value='3'>";
        }
        echo "<input type='hidden' name='entities_id' value='" . $_SESSION["glpiactive_entity"] . "'>";
        echo "<div class='force_left input_right'><table class='tab_cadre'>";
        echo "<tr><th colspan='1'>" . $LANG['job'][11] . "&nbsp;: </th></tr>";
        echo "<tr><th colspan='1'>";
        if (Session::isMultiEntitiesMode()) {
            echo "&nbsp;(" . Dropdown::getDropdownName("glpi_entities", $_SESSION["glpiactive_entity"]) . ")";
        }
        echo "</th></tr>";
        //Requerente
        if ($cont != "1" && $profile != "1") {
            echo "<tr class='tab_bg_1'>";
            echo "<td>" . $LANG['job'][4] . "&nbsp;: </td></tr>";
            echo "<tr class='tab_bg_1'>";
            echo "<td >";
            // Dropdown::show('ITILCategories', array('value' => $user,'condition'=>'is_deleted=0'));
            //Dropdown::showFromArray("user_id", $user);
            echo "\n\n<script>\nfunction getComboA(sel) {\n    var id = sel.options[sel.selectedIndex].value; \n    //var name = sel.options[sel.selectedIndex].id;\n    //document.getElementById('user').innerHTML = id;\n    window.location.assign('" . $CFG_GLPI['root_doc'] . "/plugins/mobile/front/helpdesk.php?id='+id+'&session=" . $IDO . "');    \n}\n</script> ";
            echo "<select id='sel_user' onchange='getComboA(this)'>";
            echo '<option value=" "> -- Selecione -- </option>';
            while ($user = $DB->fetch_array($result_user)) {
                echo "<option value=" . $user['id'] . " id= \"" . $user['name'] . " " . $user['sname'] . " \">" . $user['name'] . " " . $user['sname'] . "</option>";
            }
            echo "</select>";
            echo "</td></tr>";
            echo "<tr class='tab_bg_1'>";
            echo "<td>" . $LANG['job'][4] . "&nbsp;: </td></tr>";
            echo "<tr class='center tab_bg_1'>";
            echo "<td >" . $user_name . $user_sname . "</td></tr>";
            echo "<input type='hidden' name='logged' value='" . $logged . "'>";
        }
        if ($CFG_GLPI['urgency_mask'] != 1 << 3) {
            echo "<tr class='tab_bg_1'>";
            echo "<td>" . $LANG['joblist'][29] . "&nbsp;: </td></tr>";
            echo "<tr class='tab_bg_1'>";
            echo "<td>";
            //Ticket::dropdownUrgency("urgency",$urgency);
            Ticket::dropdownUrgency(array('value' => $values["urgency"]));
            echo "</td></tr>";
        }
        if (NotificationTargetTicket::isAuthorMailingActivatedForHelpdesk()) {
            echo "<tr class='tab_bg_1'>";
            echo "<td>" . $LANG['help'][8] . "&nbsp;:</td></tr>";
            echo "<tr class='tab_bg_1'>";
            echo "<td >";
            Dropdown::showYesNo('use_email_notification', $use_email_notification);
            echo "</td></tr>";
            echo "<tr class='tab_bg_1'>";
            echo "<td>" . $LANG['plugin_mobile']["email"] . "&nbsp;:</td></tr>";
            echo "<tr class='tab_bg_1'>";
            echo "<td ><input type='text' id='user_email' name='user_email' value=\"{$email}\" size='40' onchange=\"use_email_notification.value='1'\">";
            echo "</td></tr>";
        }
        if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"] != 0) {
            echo "<tr class='tab_bg_1'>";
            echo "<td>" . $LANG['help'][24] . "&nbsp;: </td></tr>";
            echo "<tr class='tab_bg_1'>";
            echo "<td >";
            Item_Ticket::dropdownMyDevices(Session::getLoginUserID(), $_SESSION["glpiactive_entity"]);
            //Ticket::dropdownMyDevices($ID,$_SESSION["glpiactive_entity"]);
            echo "</td></tr>";
        }
        //Stevenes Donato
        echo "<tr class='tab_bg_1'>";
        echo "<td class='force_left'>" . $LANG['common'][36] . "&nbsp;:</td></tr>";
        echo "<tr class='tab_bg_1'><td>";
        //Dropdown::show('TicketCategory', array('value' => $itilcategories_id,'condition'=>'`is_helpdeskvisible`=1'));
        //Dropdown::show('ITILCategory', array('value' => $itilcategories_id,'condition'=>'`is_helpdeskvisible`=1'));
        //Dropdown::getDropdownName("glpi_itilcategories", $this->fields["itilcategories_id"]);
        //Dropdown::showFromArray("completename", $itilcategories_id);
        echo "<script>\n\t\tfunction getCat(sel) {\n\t\t    //var x = document.getElementById('sel_cat').value;\n\t\t    var cat = sel.options[sel.selectedIndex].value; \n\t\t    //document.getElementById('demo').innerHTML = 'Categoria: ' + cat;\n\t\t    //document.getElementById('demo').innerHTML = '<input type=\\'text\\' name=\\'itilcategories_id\\' value=\\' +cat+ \\'/>';\n\t\t    document.getElementById('categoria').value = cat;\t\t   \n\t\t}\n\t\t</script>";
        echo "<select id='sel_cat' onchange='getCat(this)'>";
        echo '<option value=" "> -- ' . $LANG['dropdown'][35] . '-- </option>';
        while ($cat = $DB->fetch_array($result_cat)) {
            echo "<option value=" . $cat['id'] . " id= \"" . $cat['completename'] . " \">" . $cat['completename'] . " </option>";
        }
        echo "</select>" . "\n";
        echo "</td></tr>";
        echo "<tr><td>";
        //echo '<label for="itilcategories_id" id="demo"></label>';
        //echo "<span id='demo'></span>";
        echo "<input id='categoria' type='hidden' name='itilcategories_id' value='' />";
        echo "</td></tr>";
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . $LANG['common'][57] . "&nbsp;:</td></tr>";
        echo "<tr class='tab_bg_1'>";
        echo "<td ><input type='text' maxlength='250' size='50' name='name' value=\"{$title}\" required ></td></tr>";
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . $LANG['joblist'][6] . "&nbsp;:</td></tr>";
        echo "<tr class='tab_bg_1'>";
        echo "<td  colspan='1'><textarea name='content' cols='78' rows='14' required >{$content}</textarea>";
        echo "</td></tr>";
        echo "<tr class='tab_bg_1'><td>" . $LANG['document'][2] . " (" . Document::getMaxUploadSize() . ")&nbsp;:";
        /*
         * we hide the picture (aide.png) to prevent the form openning in other window,
         * outside the mobile plugin layout.
               echo "<img src=\"".$CFG_GLPI["root_doc"]."/pics/aide.png\" class='pointer' alt=\"".
                      $LANG['central'][7]."\" onclick=\"window.open('".$CFG_GLPI["root_doc"].
                      "/front/documenttype.list.php','Help','scrollbars=1,resizable=1,width=1000,height=800')\">";
        */
        echo "<input type='hidden' name='ido' value='" . $IDO . "'>";
        ?>

<script>
function getID() {
    var ido = document.getElementById('ido').value; 
    document.getElementById('session').innerHTML = "$_SESSION['logged']="+ido;
    //window.location.assign('".$CFG_GLPI['root_doc']."/plugins/mobile/front/helpdesk.php?id='+id+'&session=".$IDO."');    
}
</script>
<div id="session" style="display:none;"></div>

<?php 
        echo "</td></tr>";
        echo "<tr class='tab_bg_1'>";
        echo "<td><input type='file' class='ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c' name='filename' value=\"\" size='25'></td></tr>";
        echo "<tr class='tab_bg_1'>";
        echo "<td colspan='1' class='center'>";
        echo "<input type='submit' value=\"" . $LANG['help'][14] . "\" class='submit' >";
        echo "</td></tr>";
        echo "</table></div>";
        //</form>";
        Html::closeForm();
    }