Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion front/appliance_item.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Exception\Http\BadRequestHttpException;
use Glpi\Exception\ItemLinkException;

Session::checkCentralAccess();

Expand All @@ -52,7 +53,12 @@
}
Html::redirect($url);
} elseif (isset($_POST['add'])) {
$iapp->check(-1, CREATE, $_POST);
try {
$iapp->check(-1, CREATE, $_POST);
} catch (ItemLinkException $e) {
Html::back();
}

$iapp->add($_POST);
Html::back();
} elseif (isset($_POST['purge'])) {
Expand Down
8 changes: 7 additions & 1 deletion front/cartridgeitem_printermodel.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,20 @@

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;
use Glpi\Exception\ItemLinkException;

/**
* @since 0.84
*/

$cipm = new CartridgeItem_PrinterModel();
if (isset($_POST["add"])) {
$cipm->check(-1, CREATE, $_POST);
try {
$cipm->check(-1, CREATE, $_POST);
} catch (ItemLinkException $e) {
Html::back();
}

if ($cipm->add($_POST)) {
Event::log(
$_POST["cartridgeitems_id"],
Expand Down
8 changes: 7 additions & 1 deletion front/certificate_item.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,19 @@

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;
use Glpi\Exception\ItemLinkException;

Session::checkCentralAccess();

$certif_item = new Certificate_Item();

if (isset($_POST["add"])) {
$certif_item->check(-1, CREATE, $_POST);
try {
$certif_item->check(-1, CREATE, $_POST);
} catch (ItemLinkException $e) {
Html::back();
}

if ($certif_item->add($_POST)) {
Event::log(
$_POST["certificates_id"],
Expand Down
7 changes: 6 additions & 1 deletion front/contact_supplier.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;
use Glpi\Exception\ItemLinkException;

/**
* @since 0.84
Expand All @@ -45,7 +46,11 @@
Session::checkCentralAccess();
$contactsupplier = new Contact_Supplier();
if (isset($_POST["add"])) {
$contactsupplier->check(-1, CREATE, $_POST);
try {
$contactsupplier->check(-1, CREATE, $_POST);
} catch (ItemLinkException $e) {
Html::back();
}

if (
isset($_POST["contacts_id"]) && ($_POST["contacts_id"] > 0)
Expand Down
8 changes: 8 additions & 0 deletions front/domain.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@
Html::back();
} elseif (isset($_POST["additem"])) {
if (!empty($_POST['itemtype']) && $_POST['items_id'] > 0) {
if (!$_POST['domains_id']) {
$message = sprintf(
__('Mandatory fields are not filled. Please correct: %s'),
_n('Domain', 'Domains', 1)
);
Session::addMessageAfterRedirect(htmlescape($message), false, ERROR);
Html::back();
}
$ditem->check(-1, UPDATE, $_POST);
$ditem->addItem($_POST);
}
Expand Down
6 changes: 6 additions & 0 deletions front/item_line.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Exception\Http\BadRequestHttpException;
use Glpi\Exception\ItemLinkException;

Session::checkCentralAccess();

Expand All @@ -52,6 +53,11 @@
}
Html::redirect($url);
} elseif (isset($_POST['add'])) {
try {
$item_line->check(-1, CREATE, $_POST);
} catch (ItemLinkException $e) {
Html::back();
}
$item_line->check(-1, CREATE, $_POST);
$item_line->add($_POST);
if (isset($_POST['_from']) && $_POST['_from'] === 'item') {
Expand Down
7 changes: 6 additions & 1 deletion front/item_project.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;
use Glpi\Exception\ItemLinkException;

/**
* @since 0.85
Expand All @@ -45,7 +46,11 @@
$item = new Item_Project();

if (isset($_POST["add"])) {
$item->check(-1, CREATE, $_POST);
try {
$item->check(-1, CREATE, $_POST);
} catch (ItemLinkException $e) {
Html::back();
}

if ($item->add($_POST)) {
Event::log(
Expand Down
9 changes: 8 additions & 1 deletion front/item_softwarelicense.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;
use Glpi\Exception\ItemLinkException;

Session::checkRight("software", UPDATE);

Expand All @@ -62,7 +63,13 @@
}

if (isset($_POST["add"])) {
if ($_POST['softwarelicenses_id'] > 0) {
try {
$isl->check(-1, CREATE, $_POST);
} catch (ItemLinkException $e) {
Html::back();
}

if (isset($_POST['softwarelicenses_id']) && $_POST['softwarelicenses_id'] > 0) {
if ($isl->add($_POST)) {
Event::log(
$_POST['softwarelicenses_id'],
Expand Down