CommonDBTM::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) {
            $link = $this->getFormURL();
            if (!isset($link)) {
                return;
            }
            if (($name = $this->getName()) == NOT_AVAILABLE) {
                //TRANS: %1$s is the itemtype, %2$d is the id of the item
                $this->fields['name'] = sprintf(__('%1$s - ID %2$d'), $this->getTypeName(1), $this->fields['id']);
            }
            $display = isset($this->input['_no_message_link']) ? $this->getNameID() : $this->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)));
        }
    }
CommonDBTM