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"] = ""; } $cartype = new CartridgeItem(); if (isset($_POST["add"])) { $cartype->check(-1, 'w', $_POST); if ($newID = $cartype->add($_POST)) { Event::log($newID, "cartridges", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][20] . " " . $_POST["name"] . "."); } glpi_header($_SERVER['HTTP_REFERER']); } else { if (isset($_POST["delete"])) { $cartype->check($_POST["id"], 'w'); if ($cartype->delete($_POST)) { Event::log($_POST["id"], "cartridges", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][22]); } $cartype->redirectToList(); } else { if (isset($_POST["restore"])) { $cartype->check($_POST["id"], 'w'); if ($cartype->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("cartridge", READ); if (!isset($_GET["id"])) { $_GET["id"] = ""; } $cartype = new CartridgeItem(); if (isset($_POST["add"])) { $cartype->check(-1, CREATE, $_POST); if ($newID = $cartype->add($_POST)) { Event::log($newID, "cartridgeitems", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); if ($_SESSION['glpibackcreated']) { Html::redirect($cartype->getFormURL() . "?id=" . $newID); } } Html::back(); } else { if (isset($_POST["delete"])) { $cartype->check($_POST["id"], DELETE); if ($cartype->delete($_POST)) { Event::log($_POST["id"], "cartridgeitems", 4, "inventory", sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); } $cartype->redirectToList(); } else {
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("cartridge", "r"); $cart = new Cartridge(); $cartype = new CartridgeItem(); if (isset($_POST["add"])) { $cartype->check($_POST["cartridgeitems_id"], 'w'); for ($i = 0; $i < $_POST["to_add"]; $i++) { unset($cart->fields["id"]); $cart->add($_POST); } Event::log($_POST["cartridgeitems_id"], "cartridges", 4, "inventory", sprintf(__('%s adds cartridges'), $_SESSION["glpiname"])); Html::back(); } else { if (isset($_POST["delete"])) { $cartype->check($_POST["cartridgeitems_id"], 'w'); if ($cart->delete($_POST)) { Event::log($_POST["cartridgeitems_id"], "cartridges", 4, "inventory", sprintf(__('%s deletes a cartridge'), $_SESSION["glpiname"])); } Html::back(); } else { if (isset($_POST["install"])) {
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("cartridge", "r"); if (!isset($_GET["id"])) { $_GET["id"] = ""; } $cartype = new CartridgeItem(); if (isset($_POST["add"])) { $cartype->check(-1, 'w', $_POST); if ($newID = $cartype->add($_POST)) { Event::log($newID, "cartridges", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"])); } Html::back(); } else { if (isset($_POST["delete"])) { $cartype->check($_POST["id"], 'd'); if ($cartype->delete($_POST)) { Event::log($_POST["id"], "cartridges", 4, "inventory", sprintf(__('%s deletes an item'), $_SESSION["glpiname"])); } $cartype->redirectToList(); } else { if (isset($_POST["restore"])) { $cartype->check($_POST["id"], 'd'); if ($cartype->restore($_POST)) {
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("cartridge", READ); $cart = new Cartridge(); $cartype = new CartridgeItem(); if (isset($_POST["add"])) { $cartype->check($_POST["cartridgeitems_id"], CREATE); for ($i = 0; $i < $_POST["to_add"]; $i++) { unset($cart->fields["id"]); $cart->add($_POST); } Event::log($_POST["cartridgeitems_id"], "cartridgeitems", 4, "inventory", sprintf(__('%s adds cartridges'), $_SESSION["glpiname"])); Html::back(); } else { if (isset($_POST["purge"])) { $cartype->check($_POST["cartridgeitems_id"], PURGE); if ($cart->delete($_POST, 1)) { Event::log($_POST["cartridgeitems_id"], "cartridgeitems", 4, "inventory", sprintf(__('%s purges a cartridge'), $_SESSION["glpiname"])); } Html::back(); } else { if (isset($_POST["install"])) {
$_GET["tID"] = ""; } if (!isset($_GET["cID"])) { $_GET["cID"] = ""; } $cart = new Cartridge(); $cartype = new CartridgeItem(); if (isset($_POST["update_pages"]) || isset($_POST["update_pages_x"])) { $cart->check($_POST["cID"], 'w'); if ($cart->updatePages($_POST['pages'])) { Event::log(0, "cartridges", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][94]); } glpi_header($_SERVER['HTTP_REFERER']); } else { if (isset($_POST["add_several"])) { $cartype->check($_POST["tID"], 'w'); for ($i = 0; $i < $_POST["to_add"]; $i++) { unset($cart->fields["id"]); $cart->add($_POST); } Event::log($_POST["tID"], "cartridges", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][88] . ": " . $_POST["to_add"]); glpi_header($_SERVER['HTTP_REFERER']); } else { if (isset($_GET["delete"])) { $cartype->check($_GET["tID"], 'w'); checkRight("cartridge", "w"); if ($cart->delete($_GET)) { Event::log($_GET["tID"], "cartridges", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][90]); } glpi_header($_SERVER['HTTP_REFERER']); } else {