merge() public method

Merge softwares with current
public merge ( $item ) : boolean
$item array of software ID to be merged
return boolean about success
Esempio n. 1
0
            $soft->redirectToList();
        } else {
            if (isset($_REQUEST["purge"])) {
                $soft->check($_REQUEST["id"], 'd');
                $soft->delete($_REQUEST, 1);
                Event::log($_REQUEST["id"], "software", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][24]);
                $soft->redirectToList();
            } else {
                if (isset($_POST["update"])) {
                    $soft->check($_POST["id"], 'w');
                    $soft->update($_POST);
                    Event::log($_POST["id"], "software", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][21]);
                    glpi_header($_SERVER['HTTP_REFERER']);
                } else {
                    if (isset($_POST["mergesoftware"])) {
                        popHeader($LANG['Menu'][4]);
                        if (isset($_POST["id"]) && isset($_POST["item"]) && is_array($_POST["item"]) && count($_POST["item"])) {
                            $soft->check($_POST["id"], 'w');
                            $soft->merge($_POST["item"]);
                        }
                        glpi_header($_SERVER['HTTP_REFERER']);
                    } else {
                        commonHeader($LANG['Menu'][4], $_SERVER['PHP_SELF'], "inventory", "software");
                        $soft->showForm($_GET["id"], array('withtemplate' => $_GET["withtemplate"]));
                        commonFooter();
                    }
                }
            }
        }
    }
}