Exemplo n.º 1
0
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, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkRight("consumable", READ);
$con = new Consumable();
$constype = new ConsumableItem();
if (isset($_POST["add_several"])) {
    $constype->check($_POST["consumableitems_id"], UPDATE);
    for ($i = 0; $i < $_POST["to_add"]; $i++) {
        unset($con->fields["id"]);
        $con->add($_POST);
    }
    Event::log($_POST["consumableitems_id"], "consumableitems", 4, "inventory", sprintf(__('%s adds consumables'), $_SESSION["glpiname"]));
    Html::back();
} else {
    Html::back();
}
Exemplo n.º 2
0
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, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkRight("consumable", "r");
$con = new Consumable();
$constype = new ConsumableItem();
if (isset($_POST["add_several"])) {
    $constype->check($_POST["consumableitems_id"], 'w');
    for ($i = 0; $i < $_POST["to_add"]; $i++) {
        unset($con->fields["id"]);
        $con->add($_POST);
    }
    Event::log($_POST["consumableitems_id"], "consumables", 4, "inventory", sprintf(__('%s adds consumables'), $_SESSION["glpiname"]));
    Html::back();
} else {
    Html::back();
}
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:
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
$constype = new ConsumableItem();
if (isset($_POST["add"])) {
    $constype->check(-1, 'w', $_POST);
    if ($newID = $constype->add($_POST)) {
        Event::log($newID, "consumables", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][20] . " " . $_POST["name"] . ".");
    }
    glpi_header($_SERVER['HTTP_REFERER']);
} else {
    if (isset($_POST["delete"])) {
        $constype->check($_POST["id"], 'w');
        if ($constype->delete($_POST)) {
            Event::log($_POST["id"], "consumables", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][22]);
        }
        $constype->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
            $constype->check($_POST["id"], 'w');
            if ($constype->restore($_POST)) {
You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkRight("consumable", READ);
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
$constype = new ConsumableItem();
if (isset($_POST["add"])) {
    $constype->check(-1, CREATE, $_POST);
    if ($newID = $constype->add($_POST)) {
        Event::log($newID, "consumableitems", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"]));
        if ($_SESSION['glpibackcreated']) {
            Html::redirect($constype->getFormURL() . "?id=" . $newID);
        }
    }
    Html::back();
} else {
    if (isset($_POST["delete"])) {
        $constype->check($_POST["id"], DELETE);
        if ($constype->delete($_POST)) {
            Event::log($_POST["id"], "consumableitems", 4, "inventory", sprintf(__('%s deletes an item'), $_SESSION["glpiname"]));
        }
        $constype->redirectToList();
    } else {
Exemplo n.º 5
0
// ----------------------------------------------------------------------
// Original Author of file: Julien Dombre
// Purpose of file:
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
if (!isset($_GET["tID"])) {
    $_GET["tID"] = "";
}
if (!isset($_GET["cID"])) {
    $_GET["cID"] = "";
}
$con = new Consumable();
$constype = new ConsumableItem();
if (isset($_POST["add_several"])) {
    $constype->check($_POST["tID"], 'w');
    for ($i = 0; $i < $_POST["to_add"]; $i++) {
        unset($con->fields["id"]);
        $con->add($_POST);
    }
    Event::log($_POST["tID"], "consumables", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][89] . ": " . $_POST["to_add"]);
    glpi_header($_SERVER['HTTP_REFERER']);
} else {
    if (isset($_GET["delete"])) {
        $constype->check($_GET["tID"], 'w');
        if ($con->delete($_GET)) {
            Event::log($_GET["tID"], "consumables", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][91]);
        }
        glpi_header($_SERVER['HTTP_REFERER']);
    } else {
        if (isset($_POST["give"])) {