(at your option) any later version.

 Typology 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 Typology. If not, see <http://www.gnu.org/licenses/>.
 --------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
$typo = new PluginTypologyTypology();
$criteria = new PluginTypologyTypologyCriteria();
if (isset($_POST["update"])) {
    $criteria->check($_POST["id"], 'w');
    $criteria->update($_POST);
    Html::back();
} else {
    if (isset($_POST["add"])) {
        $criteria->check(-1, 'w', $_POST);
        $newID = $criteria->add($_POST);
        Html::redirect($CFG_GLPI["root_doc"] . "/plugins/typology/front/typologycriteria.form.php?id={$newID}");
    } else {
        if (isset($_POST["delete"])) {
            /*if (isset($_POST["item"]) && count($_POST["item"])) {
                  foreach ($_POST["item"] as $key => $val) {
                     if ($val == 1) {
                        if ($criteria->can($key, 'w')) {
                           $criteria->delete(array('id' => $key));
                        }