Skip to content
Open
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased ##

### Fixed

- Fix restrict mode
- Fix warnings and errors in logs

## [2.6.2] - 2026-05-12

###
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../PluginsMakefile.mk
44 changes: 0 additions & 44 deletions front/category.form.php

This file was deleted.

44 changes: 0 additions & 44 deletions front/category.php

This file was deleted.

2 changes: 0 additions & 2 deletions front/group_level.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@

use Glpi\Exception\Http\BadRequestHttpException;

include(__DIR__ . '/../../../inc/includes.php');

Session::checkCentralAccess();

$level = new PluginItilcategorygroupsGroup_Level();
Expand Down
2 changes: 1 addition & 1 deletion hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function plugin_itilcategorygroups_getAddSearchOptions($itemtype)

function plugin_itilcategorygroups_giveItem($type, $ID, $data, $num)
{
$searchopt = &Search::getOptions($type);
$searchopt = Search::getOptions($type);
$table = $searchopt[$ID]['table'];
$field = $searchopt[$ID]['field'];
$value = $data['raw']['ITEM_' . $num];
Expand Down
52 changes: 19 additions & 33 deletions inc/category.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,7 @@
use Glpi\DBAL\QueryFunction;

use function Safe\json_decode;

/**
* -------------------------------------------------------------------------
* ItilCategoryGroups plugin for GLPI
* -------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of ItilCategoryGroups.
*
* ItilCategoryGroups is free software; you can redistribute it and/or modify
* 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.
*
* ItilCategoryGroups 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 ItilCategoryGroups. If not, see <http://www.gnu.org/licenses/>.
* -------------------------------------------------------------------------
* @copyright Copyright (C) 2012-2022 by ItilCategoryGroups plugin team.
* @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/pluginsGLPI/itilcategorygroups
* -------------------------------------------------------------------------
*/
use function Safe\preg_replace;

class PluginItilcategorygroupsCategory extends CommonDropdown
{
Expand All @@ -81,6 +54,14 @@ public static function getTypeName($nb = 0)
return __s('Link ItilCategory - Groups', 'itilcategorygroups');
}

/**
* @return array{0: string, 1: string, 2: string}
*/
public static function getSectorizedDetails(): array
{
return ['admin', 'pluginitilcategorygroupsmenu', 'model'];
}

public static function canCreate(): bool
{
return static::canUpdate();
Expand Down Expand Up @@ -302,7 +283,7 @@ public static function filterActors(array $params = []): array
// Selects the level min that will be displayed
if ($level == 0) {
$criteria = [
'SELECT' => ['MIN' => 'level'],
'SELECT' => ['MIN' => 'level as level'],
'FROM' => $table,
'WHERE' => [
'itilcategories_id' => $itilcategories_id,
Expand Down Expand Up @@ -429,10 +410,15 @@ public static function getGroupsForCategory($itilcategories_id, $params = [])
],
],
],
'WHERE' => [
'cat.itilcategories_id' => $itilcategories_id,
'cat.is_active' => 1,
] + $entity_restrict,
'WHERE' => array_merge(
[
'cat.itilcategories_id' => $itilcategories_id,
'cat.is_active' => 1,
],
$entity_restrict,
// extra caller-provided filtering (ticket type, level restriction, already assigned groups)
[new QueryExpression(preg_replace('/^\s*AND\s+/i', '', $options['condition']))],
),
'GROUPBY' => 'cat.id',
];

Expand Down
28 changes: 0 additions & 28 deletions inc/group_level.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,6 @@

use Glpi\Application\View\TemplateRenderer;

/**
* -------------------------------------------------------------------------
* ItilCategoryGroups plugin for GLPI
* -------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of ItilCategoryGroups.
*
* ItilCategoryGroups is free software; you can redistribute it and/or modify
* 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.
*
* ItilCategoryGroups 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 ItilCategoryGroups. If not, see <http://www.gnu.org/licenses/>.
* -------------------------------------------------------------------------
* @copyright Copyright (C) 2012-2022 by ItilCategoryGroups plugin team.
* @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/pluginsGLPI/itilcategorygroups
* -------------------------------------------------------------------------
*/

class PluginItilcategorygroupsGroup_Level extends CommonDBChild
{
// From CommonDBChild
Expand Down