Esempio n. 1
0
        $soft->check($_POST["id"], DELETE);
        $soft->delete($_POST);
        Event::log($_POST["id"], "software", 4, "inventory", sprintf(__('%s deletes an item'), $_SESSION["glpiname"]));
        $soft->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
            $soft->check($_POST["id"], DELETE);
            $soft->restore($_POST);
            Event::log($_POST["id"], "software", 4, "inventory", sprintf(__('%s restores an item'), $_SESSION["glpiname"]));
            $soft->redirectToList();
        } else {
            if (isset($_POST["purge"])) {
                $soft->check($_POST["id"], PURGE);
                $soft->delete($_POST, 1);
                Event::log($_POST["id"], "software", 4, "inventory", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
                $soft->redirectToList();
            } else {
                if (isset($_POST["update"])) {
                    $soft->check($_POST["id"], UPDATE);
                    $soft->update($_POST);
                    Event::log($_POST["id"], "software", 4, "inventory", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
                    Html::back();
                } else {
                    Html::header(Software::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "assets", "software");
                    $soft->display(array('id' => $_GET["id"], 'withtemplate' => $_GET["withtemplate"]));
                    Html::footer();
                }
            }
        }
    }
}
Esempio n. 2
0
<?php

include 'domit/xml_domit_include.php';
$doc =& new DOMIT_Document();
$success = $doc->loadXML('content/test.xml');
$curated = $doc->documentElement;
$softwares = $curated->childNodes;
$softwareObjs = array();
foreach ($softwares as $software) {
    $s = new Software($software);
    $s->display();
}
class Software
{
    var $name;
    var $by;
    var $scroll;
    var $resize;
    var $width;
    var $height;
    var $image;
    var $description;
    var $location;
    var $links = array();
    function Software($xml)
    {
        $this->name = $xml->getAttribute('name');
        $this->by = $xml->getAttribute('by');
        $this->scroll = $xml->getAttribute('scroll');
        $this->width = $xml->getAttribute('width');
        $this->height = $xml->getAttribute('height');