Item_Ticket::addMessageOnAddAction PHP Method

addMessageOnAddAction() public method

Add a message on add action
    function addMessageOnAddAction()
    {
        global $CFG_GLPI;
        $addMessAfterRedirect = false;
        if (isset($this->input['_add'])) {
            $addMessAfterRedirect = true;
        }
        if (isset($this->input['_no_message']) || !$this->auto_message_on_action) {
            $addMessAfterRedirect = false;
        }
        if ($addMessAfterRedirect) {
            $item = getItemForItemtype($this->fields['itemtype']);
            $item->getFromDB($this->fields['items_id']);
            $link = $item->getFormURL();
            if (!isset($link)) {
                return;
            }
            if (($name = $item->getName()) == NOT_AVAILABLE) {
                //TRANS: %1$s is the itemtype, %2$d is the id of the item
                $item->fields['name'] = sprintf(__('%1$s - ID %2$d'), $item->getTypeName(1), $item->fields['id']);
            }
            $display = isset($this->input['_no_message_link']) ? $item->getNameID() : $item->getLink();
            // Do not display quotes
            //TRANS : %s is the description of the added item
            Session::addMessageAfterRedirect(sprintf(__('%1$s: %2$s'), __('Item successfully added'), stripslashes($display)));
        }
    }