diff --git a/front/agent.php b/front/agent.php deleted file mode 100644 index 229df7dc38e..00000000000 --- a/front/agent.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("agent", READ); - -Html::header(Agent::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "admin", "glpi\inventory\inventory", "agent"); - -Search::show('Agent'); - -Html::footer(); diff --git a/front/allassets.php b/front/allassets.php deleted file mode 100644 index 941b84a6234..00000000000 --- a/front/allassets.php +++ /dev/null @@ -1,48 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -/** - * Filename was previously states.php - * @since 0.84 - */ - -Session::checkCentralAccess(); - -Html::header(__('Global'), $_SERVER['PHP_SELF'], "assets", "allassets"); - -Search::show(AllAssets::getType()); - - -Html::footer(); diff --git a/front/appliance.php b/front/appliance.php deleted file mode 100644 index 279b4f6f3fe..00000000000 --- a/front/appliance.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight('appliance', READ); - -Html::header(Appliance::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "management", "appliance"); - -Search::show('Appliance'); - -Html::footer(); diff --git a/front/authldap.php b/front/authldap.php deleted file mode 100644 index 12d56b3a2b8..00000000000 --- a/front/authldap.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("config", READ); - -Html::header(AuthLDAP::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], 'config', 'auth', 'ldap'); - -Search::show('AuthLDAP'); - -Html::footer(); diff --git a/front/authmail.php b/front/authmail.php deleted file mode 100644 index ff2b3c65fbd..00000000000 --- a/front/authmail.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("config", UPDATE); - -Html::header(AuthMail::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "config", "auth", "imap"); - -Search::show('AuthMail'); - -Html::footer(); diff --git a/front/budget.php b/front/budget.php deleted file mode 100644 index 74656c6f594..00000000000 --- a/front/budget.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("budget", READ); - -Html::header(Budget::getTypeName(1), $_SERVER['PHP_SELF'], "management", "budget"); - -Search::show('Budget'); - -Html::footer(); diff --git a/front/cable.php b/front/cable.php deleted file mode 100644 index 8eb43bb4cef..00000000000 --- a/front/cable.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("cable_management", READ); - -Html::header(Cable::getTypeName(1), $_SERVER['PHP_SELF'], "assets", "cable"); - -Search::show('Cable'); - -Html::footer(); diff --git a/front/cartridgeitem.php b/front/cartridgeitem.php deleted file mode 100644 index 48a85c54086..00000000000 --- a/front/cartridgeitem.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRightsOr(Cartridge::$rightname, [READ, READ_ASSIGNED, READ_OWNED]); - -Html::header(Cartridge::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "assets", "cartridgeitem"); - -Search::show('CartridgeItem'); - -Html::footer(); diff --git a/front/certificate.php b/front/certificate.php deleted file mode 100644 index 0a3ad5b6d05..00000000000 --- a/front/certificate.php +++ /dev/null @@ -1,47 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("certificate", READ); - -Html::header( - Certificate::getTypeName(Session::getPluralNumber()), - $_SERVER['PHP_SELF'], - 'management', - 'certificate' -); - -Search::show('Certificate'); - -Html::footer(); diff --git a/front/change.php b/front/change.php deleted file mode 100644 index 9795c42b593..00000000000 --- a/front/change.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRightsOr('change', [Change::READALL, Change::READMY]); - -Html::header(Change::getTypeName(Session::getPluralNumber()), '', "helpdesk", "change"); - -Search::show('Change'); - -Html::footer(); diff --git a/front/cluster.php b/front/cluster.php deleted file mode 100644 index edc19830b4d..00000000000 --- a/front/cluster.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("cluster", READ); - -Html::header(Cluster::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "management", "cluster"); - -Search::show('Cluster'); - -Html::footer(); diff --git a/front/computer.php b/front/computer.php deleted file mode 100644 index 5951c8b6783..00000000000 --- a/front/computer.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRightsOr(Computer::$rightname, [READ, READ_ASSIGNED, READ_OWNED]); - -Html::header(Computer::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "assets", "computer"); - -Search::show('Computer'); - -Html::footer(); diff --git a/front/contact.php b/front/contact.php deleted file mode 100644 index 5592f757010..00000000000 --- a/front/contact.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("contact_enterprise", READ); - -Html::header(Contact::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "management", "contact"); - -Search::show('Contact'); - -Html::footer(); diff --git a/front/contract.php b/front/contract.php deleted file mode 100644 index 51220b90713..00000000000 --- a/front/contract.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("contract", READ); - -Html::header(Contract::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "management", "contract"); - -Search::show('Contract'); - -Html::footer(); diff --git a/front/crontask.php b/front/crontask.php deleted file mode 100644 index 1671b5dcf97..00000000000 --- a/front/crontask.php +++ /dev/null @@ -1,49 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -/** - * Search engine from cron tasks - */ - -/** @var array $CFG_GLPI */ -global $CFG_GLPI; - -Session::checkRight("config", UPDATE); - -Html::header(CronTask::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], 'config', 'crontask'); - -Search::show('CronTask'); - -Html::footer(); diff --git a/front/database.php b/front/database.php deleted file mode 100644 index dc9654161a9..00000000000 --- a/front/database.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight('database', READ); - -Html::header(Database::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "management", "database"); - -Search::show('Database'); - -Html::footer(); diff --git a/front/databaseinstance.php b/front/databaseinstance.php deleted file mode 100644 index a7a0f7378c9..00000000000 --- a/front/databaseinstance.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight('database', READ); - -Html::header(DatabaseInstance::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "management", "database", "databaseinstance"); - -Search::show('DatabaseInstance'); - -Html::footer(); diff --git a/front/datacenter.php b/front/datacenter.php deleted file mode 100644 index 83474e11746..00000000000 --- a/front/datacenter.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("datacenter", READ); - -Html::header(Datacenter::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "management", "datacenter"); - -Search::show('Datacenter'); - -Html::footer(); diff --git a/front/dcroom.php b/front/dcroom.php deleted file mode 100644 index 5e8b477afda..00000000000 --- a/front/dcroom.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("datacenter", READ); - -Html::header(DCRoom::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "management", "datacenter", "dcroom"); - -Search::show('DCRoom'); - -Html::footer(); diff --git a/front/defaultfilter.php b/front/defaultfilter.php deleted file mode 100644 index 87020df4b15..00000000000 --- a/front/defaultfilter.php +++ /dev/null @@ -1,48 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight(DefaultFilter::$rightname, READ); - -Html::header( - DefaultFilter::getTypeName(Session::getPluralNumber()), - $_SERVER['PHP_SELF'], - "config", - "commondropdown", - "DefaultFilter" -); - -Search::show('DefaultFilter'); - -Html::footer(); diff --git a/front/document.php b/front/document.php deleted file mode 100644 index 9654af8b1f1..00000000000 --- a/front/document.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("document", READ); - -Html::header(Document::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "management", "document"); - -Search::show('Document'); - -Html::footer(); diff --git a/front/domain.php b/front/domain.php deleted file mode 100644 index fedb0d19fcc..00000000000 --- a/front/domain.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("domain", READ); - -Html::header(Domain::getTypeName(1), $_SERVER['PHP_SELF'], "management", "domain"); - -Search::show('Domain'); - -Html::footer(); diff --git a/front/domainrecord.php b/front/domainrecord.php deleted file mode 100644 index 20a317cd098..00000000000 --- a/front/domainrecord.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkCentralAccess(); - -Html::header(Domain::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "management", "domain", "domainrecord"); - -Search::show('DomainRecord'); - -Html::footer(); diff --git a/front/enclosure.php b/front/enclosure.php deleted file mode 100644 index 582dc06c6cd..00000000000 --- a/front/enclosure.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("datacenter", READ); - -Html::header(Enclosure::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "assets", "enclosure"); - -Search::show('Enclosure'); - -Html::footer(); diff --git a/front/event.php b/front/event.php deleted file mode 100644 index ebd7ad37222..00000000000 --- a/front/event.php +++ /dev/null @@ -1,50 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -use Glpi\Event; - -Session::checkRight(Event::$rightname, READ); - -Html::header( - Event::getTypeName(Session::getPluralNumber()), - $_SERVER['PHP_SELF'], - "admin", - "glpi\system\log\logviewer", - "Glpi\\Event" -); - -Search::show(Event::class); - -Html::footer(); diff --git a/front/fieldunicity.php b/front/fieldunicity.php deleted file mode 100644 index a5c8f3fca84..00000000000 --- a/front/fieldunicity.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight('config', READ); - -Html::header(FieldUnicity::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "config", "fieldunicity"); - -Search::show('FieldUnicity'); - -Html::footer(); diff --git a/front/group.php b/front/group.php deleted file mode 100644 index 817798002ec..00000000000 --- a/front/group.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("group", READ); - -Html::header(Group::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "admin", "group"); - -Search::show('Group'); - -Html::footer(); diff --git a/front/line.php b/front/line.php deleted file mode 100644 index 407479e0954..00000000000 --- a/front/line.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("line", READ); - -Html::header(Line::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "management", "line"); - -Search::show('Line'); - -Html::footer(); diff --git a/front/link.php b/front/link.php deleted file mode 100644 index 03c65a7acb7..00000000000 --- a/front/link.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("link", READ); - -Html::header(Link::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "config", "link"); - -Search::show('Link'); - -Html::footer(); diff --git a/front/lockedfield.php b/front/lockedfield.php deleted file mode 100644 index e239c115818..00000000000 --- a/front/lockedfield.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("locked_field", CREATE); - -Html::header(Lockedfield::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "admin", "glpi\inventory\inventory", "lockedfield"); - -Search::show('Lockedfield'); - -Html::footer(); diff --git a/front/mailcollector.php b/front/mailcollector.php deleted file mode 100644 index d4daa677c61..00000000000 --- a/front/mailcollector.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRight("config", UPDATE); - -Html::header(MailCollector::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "config", "mailcollector"); - -$mailcollector = new MailCollector(); -Search::show('MailCollector'); -Html::footer(); diff --git a/front/monitor.php b/front/monitor.php deleted file mode 100644 index 479af247c38..00000000000 --- a/front/monitor.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRightsOr(Monitor::$rightname, [READ, READ_ASSIGNED, READ_OWNED]); - -Html::header(Monitor::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "assets", "monitor"); - -Search::show('Monitor'); - -Html::footer(); diff --git a/front/software.php b/front/software.php deleted file mode 100644 index 055da01d043..00000000000 --- a/front/software.php +++ /dev/null @@ -1,42 +0,0 @@ -. - * - * --------------------------------------------------------------------- - */ - -Session::checkRightsOr(Software::$rightname, [READ, READ_ASSIGNED, READ_OWNED]); - -Html::header(Software::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "assets", "software"); - -Search::show('Software'); - -Html::footer(); diff --git a/src/Agent.php b/src/Agent.php index 07d70f583de..549a8befc52 100644 --- a/src/Agent.php +++ b/src/Agent.php @@ -39,6 +39,7 @@ use Glpi\Application\View\TemplateRenderer; use Glpi\DBAL\QueryFunction; use Glpi\Inventory\Conf; +use Glpi\Inventory\Inventory; use Glpi\Plugin\Hooks; use GuzzleHttp\Client as Guzzle_Client; use GuzzleHttp\Psr7\Response; @@ -77,6 +78,11 @@ public static function getTypeName($nb = 0) return _n('Agent', 'Agents', $nb); } + public static function getSectorizedDetails(): array + { + return ["admin", Inventory::class, "agent"]; + } + public function rawSearchOptions() { diff --git a/src/AllAssets.php b/src/AllAssets.php index b80db9df9d3..745be93cca1 100644 --- a/src/AllAssets.php +++ b/src/AllAssets.php @@ -40,6 +40,20 @@ public static function canView(): bool return Session::getCurrentInterface() == "central"; } + public static function getHeaderParameters(): array + { + return [ + __('Global'), + '', + ...static::getSectorizedDetails(), + ]; + } + + public static function getSectorizedDetails(): array + { + return ['assets', 'allassets']; + } + public static function getTypeName($nb = 0) { return _n('Asset', 'Assets', $nb); diff --git a/src/Appliance.php b/src/Appliance.php index 2e3db8a959f..53346e1eead 100644 --- a/src/Appliance.php +++ b/src/Appliance.php @@ -67,6 +67,11 @@ public function getCloneRelations(): array ]; } + public static function getSectorizedDetails(): array + { + return ["management", "appliance"]; + } + public static function getTypeName($nb = 0) { return _n('Appliance', 'Appliances', $nb); diff --git a/src/AuthLDAP.php b/src/AuthLDAP.php index e06e1bd1fe8..52abb268938 100644 --- a/src/AuthLDAP.php +++ b/src/AuthLDAP.php @@ -183,6 +183,11 @@ public static function getTypeName($nb = 0) return _n('LDAP directory', 'LDAP directories', $nb); } + public static function getSectorizedDetails(): array + { + return ['config', 'auth', 'ldap']; + } + public static function canCreate(): bool { return static::canUpdate(); diff --git a/src/AuthMail.php b/src/AuthMail.php index bb869dc0d05..b68e5ac0b3d 100644 --- a/src/AuthMail.php +++ b/src/AuthMail.php @@ -48,6 +48,11 @@ public static function getTypeName($nb = 0) return _n('Mail server', 'Mail servers', $nb); } + public static function getSectorizedDetails(): array + { + return ['config", "auth", "imap']; + } + public function prepareInputForUpdate($input) { if (!empty($input['mail_server'])) { diff --git a/src/Budget.php b/src/Budget.php index d1e8c23558a..c7a6bc03069 100644 --- a/src/Budget.php +++ b/src/Budget.php @@ -65,6 +65,11 @@ public static function getTypeName($nb = 0) return _n('Budget', 'Budgets', $nb); } + public static function getSectorizedDetails(): array + { + return ["management", "budget"]; + } + public function defineTabs($options = []) { diff --git a/src/Cable.php b/src/Cable.php index 30ca6e576e3..7771fa8b873 100644 --- a/src/Cable.php +++ b/src/Cable.php @@ -53,6 +53,11 @@ public static function getTypeName($nb = 0) return _n('Cable', 'Cables', $nb); } + public static function getSectorizedDetails(): array + { + return ["assets", "cable"]; + } + public static function getFieldLabel() { return self::getTypeName(1); diff --git a/src/Cartridge.php b/src/Cartridge.php index 8556f24c556..06e2c02ba9d 100644 --- a/src/Cartridge.php +++ b/src/Cartridge.php @@ -97,6 +97,11 @@ public static function getTypeName($nb = 0) return _n('Cartridge', 'Cartridges', $nb); } + public static function getSectorizedDetails(): array + { + return ["assets", "cartridgeitem"]; + } + public function prepareInputForAdd($input) { $item = static::getItemFromArray(CartridgeItem::class, CartridgeItem::getForeignKeyField(), $input); diff --git a/src/Certificate.php b/src/Certificate.php index 29e05b313f6..6356c93497e 100644 --- a/src/Certificate.php +++ b/src/Certificate.php @@ -69,6 +69,11 @@ public static function getTypeName($nb = 0) return _n('Certificate', 'Certificates', $nb); } + public static function getSectorizedDetails(): array + { + return ["management", "certificate"]; + } + /** * Clean certificate items */ diff --git a/src/Change.php b/src/Change.php index 77647974e62..04712bec228 100644 --- a/src/Change.php +++ b/src/Change.php @@ -72,6 +72,10 @@ public static function getTypeName($nb = 0) return _n('Change', 'Changes', $nb); } + public static function getSectorizedDetails(): array + { + return ["helpdesk", "change"]; + } public function canSolve() { diff --git a/src/Cluster.php b/src/Cluster.php index 0a7d0095c3b..8d6b4242eaf 100644 --- a/src/Cluster.php +++ b/src/Cluster.php @@ -60,6 +60,11 @@ public static function getTypeName($nb = 0) return _n('Cluster', 'Clusters', $nb); } + public static function getSectorizedDetails(): array + { + return ["management", "cluster"]; + } + public function defineTabs($options = []) { $ong = []; diff --git a/src/Computer.php b/src/Computer.php index cbf88b86ef2..b705e847ac5 100644 --- a/src/Computer.php +++ b/src/Computer.php @@ -92,6 +92,10 @@ public static function getTypeName($nb = 0) return _n('Computer', 'Computers', $nb); } + public static function getSectorizedDetails(): array + { + return ["assets", "computer"]; + } public function useDeletedToLockIfDynamic() { diff --git a/src/Contact.php b/src/Contact.php index e313b062ba4..b85b758eda6 100644 --- a/src/Contact.php +++ b/src/Contact.php @@ -58,6 +58,11 @@ public static function getTypeName($nb = 0) return _n('Contact', 'Contacts', $nb); } + public static function getSectorizedDetails(): array + { + return ["management", "contact"]; + } + public function prepareInputForAdd($input) { $input = parent::prepareInputForAdd($input); diff --git a/src/Contract.php b/src/Contract.php index b545bcf52d2..9b130dad536 100644 --- a/src/Contract.php +++ b/src/Contract.php @@ -71,6 +71,11 @@ public static function getTypeName($nb = 0) return _n('Contract', 'Contracts', $nb); } + public static function getSectorizedDetails(): array + { + return ["management", "contract"]; + } + public function post_getEmpty() { if (isset($_SESSION['glpiactive_entity'])) { diff --git a/src/CronTask.php b/src/CronTask.php index e31f28dd4fe..825359408a2 100644 --- a/src/CronTask.php +++ b/src/CronTask.php @@ -88,6 +88,11 @@ public static function getTypeName($nb = 0) return _n('Automatic action', 'Automatic actions', $nb); } + public static function getSectorizedDetails(): array + { + return ['config', 'crontask']; + } + public function defineTabs($options = []) { $ong = []; diff --git a/src/DCRoom.php b/src/DCRoom.php index 791a9a7e6d4..583d36a97b9 100644 --- a/src/DCRoom.php +++ b/src/DCRoom.php @@ -52,6 +52,11 @@ public static function getTypeName($nb = 0) return _n('Server room', 'Server rooms', $nb); } + public static function getSectorizedDetails(): array + { + return ["management", "datacenter", "dcroom"]; + } + public function defineTabs($options = []) { $ong = []; diff --git a/src/Database.php b/src/Database.php index ac1b728579b..f9309ad0bc3 100644 --- a/src/Database.php +++ b/src/Database.php @@ -54,6 +54,11 @@ public static function getTypeName($nb = 0) return _n('Database', 'Databases', $nb); } + public static function getSectorizedDetails(): array + { + return ["management", "database"]; + } + public function defineTabs($options = []) { $ong = []; diff --git a/src/DatabaseInstance.php b/src/DatabaseInstance.php index 688a6456fbd..39fb7abfdd8 100644 --- a/src/DatabaseInstance.php +++ b/src/DatabaseInstance.php @@ -76,6 +76,11 @@ public static function getTypeName($nb = 0) return _n('Database instance', 'Database instances', $nb); } + public static function getSectorizedDetails(): array + { + return ["management", "database", "databaseinstance"]; + } + public function defineTabs($options = []) { $ong = []; diff --git a/src/Datacenter.php b/src/Datacenter.php index 93eeec3b384..be1e08e3880 100644 --- a/src/Datacenter.php +++ b/src/Datacenter.php @@ -52,6 +52,11 @@ public static function getTypeName($nb = 0) return _n('Data center', 'Data centers', $nb); } + public static function getSectorizedDetails(): array + { + return ["management", "datacenter"]; + } + public function prepareInputForAdd($input) { $input = parent::prepareInputForAdd($input); diff --git a/src/DefaultFilter.php b/src/DefaultFilter.php index 882269115fc..c8c6979a79c 100644 --- a/src/DefaultFilter.php +++ b/src/DefaultFilter.php @@ -67,6 +67,11 @@ public static function getTypeName($nb = 0) return _n('Default filter', 'Default filters', $nb); } + public static function getSectorizedDetails(): array + { + return ["config", "commondropdown", "DefaultFilter"]; + } + public static function getIcon() { return "ti ti-filter"; diff --git a/src/Document.php b/src/Document.php index 66aaf47557f..657675b1435 100644 --- a/src/Document.php +++ b/src/Document.php @@ -61,6 +61,11 @@ public static function getTypeName($nb = 0) return _n('Document', 'Documents', $nb); } + public static function getSectorizedDetails(): array + { + return ["management", "document"]; + } + /** * Check if given object can have Document * diff --git a/src/Domain.php b/src/Domain.php index 0c61be90584..e5d10955e7a 100644 --- a/src/Domain.php +++ b/src/Domain.php @@ -77,6 +77,11 @@ public static function getTypeName($nb = 0) return _n('Domain', 'Domains', $nb); } + public static function getSectorizedDetails(): array + { + return ["management", "domain"]; + } + public function cleanDBonPurge() { /** @var \DBmysql $DB */ diff --git a/src/DomainRecord.php b/src/DomainRecord.php index c5f17cd46a5..f98dcc799fa 100644 --- a/src/DomainRecord.php +++ b/src/DomainRecord.php @@ -56,6 +56,11 @@ public static function getTypeName($nb = 0) return _n('Domain record', 'Domains records', $nb); } + public static function getSectorizedDetails(): array + { + return ["management", "domain", "domainrecord"]; + } + public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { if ($item::class === Domain::class) { diff --git a/src/Enclosure.php b/src/Enclosure.php index c10f28047f1..83909701fe9 100644 --- a/src/Enclosure.php +++ b/src/Enclosure.php @@ -66,6 +66,11 @@ public static function getTypeName($nb = 0) return _n('Enclosure', 'Enclosures', $nb); } + public static function getSectorizedDetails(): array + { + return ["assets", "enclosure"]; + } + public function defineTabs($options = []) { $ong = []; diff --git a/src/FieldUnicity.php b/src/FieldUnicity.php index 81deb5dfbd4..3a05336dfdd 100644 --- a/src/FieldUnicity.php +++ b/src/FieldUnicity.php @@ -55,6 +55,11 @@ public static function getTypeName($nb = 0) return __('Fields unicity'); } + public static function getSectorizedDetails(): array + { + return ["config", "fieldunicity"]; + } + public static function canCreate(): bool { return static::canUpdate(); diff --git a/src/Glpi/Event.php b/src/Glpi/Event.php index fbbd9dd5b7c..7587fce2bc2 100644 --- a/src/Glpi/Event.php +++ b/src/Glpi/Event.php @@ -43,6 +43,7 @@ use Document; use Glpi\Application\View\TemplateRenderer; use Glpi\DBAL\QueryExpression; +use Glpi\System\Log\LogViewer; use Html; use Infocom; use ITILSolution; @@ -61,6 +62,11 @@ public static function getTypeName($nb = 0) return _n('Event log', 'Event logs', $nb); } + public static function getSectorizedDetails(): array + { + return ["admin", LogViewer::class, __CLASS__]; + } + public function prepareInputForAdd($input) { /** @var array $CFG_GLPI */ diff --git a/src/Group.php b/src/Group.php index b192ee6fac2..312eb4bf793 100644 --- a/src/Group.php +++ b/src/Group.php @@ -62,6 +62,11 @@ public static function getTypeName($nb = 0) return _n('Group', 'Groups', $nb); } + public static function getSectorizedDetails(): array + { + return ["admin", "group"]; + } + public static function getAdditionalMenuOptions() { if (Session::haveRight('user', User::UPDATEAUTHENT)) { diff --git a/src/Line.php b/src/Line.php index fcfa057c5de..210c70e52b5 100644 --- a/src/Line.php +++ b/src/Line.php @@ -58,6 +58,10 @@ public static function getTypeName($nb = 0) return _n('Line', 'Lines', $nb); } + public static function getSectorizedDetails(): array + { + return ["management", "line"]; + } /** * @see CommonDBTM::useDeletedToLockIfDynamic() diff --git a/src/Link.php b/src/Link.php index a8faca2e9b6..1b53b3c8534 100644 --- a/src/Link.php +++ b/src/Link.php @@ -58,6 +58,11 @@ public static function getTypeName($nb = 0) return _n('External link', 'External links', $nb); } + public static function getSectorizedDetails(): array + { + return ["config", "link"]; + } + /** * For plugins, add a tag to the links tags * diff --git a/src/Lockedfield.php b/src/Lockedfield.php index dcbfde8d534..0be551b413e 100644 --- a/src/Lockedfield.php +++ b/src/Lockedfield.php @@ -54,6 +54,11 @@ public static function getTypeName($nb = 0) return _n('Locked field', 'Locked fields', $nb); } + public static function getSectorizedDetails(): array + { + return ["admin", \Glpi\Inventory\Inventory::class, "lockedfield"]; + } + public static function canView(): bool { return self::canUpdate(); diff --git a/src/MailCollector.php b/src/MailCollector.php index 0b4463ef67b..47e7463fae4 100644 --- a/src/MailCollector.php +++ b/src/MailCollector.php @@ -107,6 +107,10 @@ public static function getTypeName($nb = 0) return _n('Receiver', 'Receivers', $nb); } + public static function getSectorizedDetails(): array + { + return ["config", "mailcollector"]; + } public static function canCreate(): bool { diff --git a/src/Monitor.php b/src/Monitor.php index ecaa6720be4..aee986d5c5f 100644 --- a/src/Monitor.php +++ b/src/Monitor.php @@ -81,6 +81,10 @@ public static function getTypeName($nb = 0) return _n('Monitor', 'Monitors', $nb); } + public static function getSectorizedDetails(): array + { + return ["assets", "monitor"]; + } /** * @see CommonDBTM::useDeletedToLockIfDynamic() diff --git a/src/Software.php b/src/Software.php index 8b244258472..3f990ec776e 100644 --- a/src/Software.php +++ b/src/Software.php @@ -72,6 +72,11 @@ public static function getTypeName($nb = 0) return _n('Software', 'Software', $nb); } + public static function getSectorizedDetails(): array + { + return ['assets', 'software']; + } + public static function getMenuShorcut() { return 's'; @@ -223,11 +228,6 @@ public function getEmpty() return true; } - public static function getSectorizedDetails(): array - { - return ['assets', 'software']; - } - public function getSpecificMassiveActions($checkitem = null) { $isadmin = static::canUpdate();