Commit 050b61b4 authored by Johan Cwiklinski's avatar Johan Cwiklinski Committed by Johan Cwiklinski

Prefix som search options; closes #2681

parent b0990b86
......@@ -189,6 +189,11 @@ class Budget extends CommonDropdown{
function rawSearchOptions() {
$tab = [];
$tab[] = [
'id' => 'common',
'name' => __('Characteristics')
];
$tab[] = [
'id' => '1',
'table' => $this->getTable(),
......
......@@ -68,6 +68,11 @@ class Certificate extends CommonDBTM {
$tab = [];
$tab[] = [
'id' => 'common',
'name' => __('Characteristics')
];
$tab[] = [
'id' => '1',
'table' => $this->getTable(),
......
......@@ -640,17 +640,18 @@ abstract class CommonITILTask extends CommonDBTM {
static function rawSearchOptionsToAdd($itemtype = null) {
$task = new static();
$tab = [];
$name = _n('Task', 'Tasks', Session::getPluralNumber());
$tab[] = [
'id' => 'task',
'name' => _n('Task', 'Tasks', Session::getPluralNumber())
'name' => $name
];
$tab[] = [
'id' => '26',
'table' => static::getTable(),
'field' => 'content',
'name' => __('Description'),
'name' => $name . ' - ' . __('Description'),
'datatype' => 'text',
'forcegroupby' => true,
'splititems' => true,
......@@ -664,7 +665,7 @@ abstract class CommonITILTask extends CommonDBTM {
'id' => '28',
'table' => static::getTable(),
'field' => 'id',
'name' => _x('quantity', 'Number of tasks'),
'name' => $name . ' - ' . _x('quantity', 'Number of tasks'),
'forcegroupby' => true,
'usehaving' => true,
'datatype' => 'count',
......@@ -679,7 +680,7 @@ abstract class CommonITILTask extends CommonDBTM {
'table' => 'glpi_taskcategories',
'field' => 'name',
'datatype' => 'dropdown',
'name' => __('Task category'),
'name' => $name . ' - ' . __('Category'),
'forcegroupby' => true,
'splititems' => true,
'massiveaction' => false,
......@@ -699,7 +700,7 @@ abstract class CommonITILTask extends CommonDBTM {
'id' => '92',
'table' => static::getTable(),
'field' => 'is_private',
'name' => __('Private task'),
'name' => $name . ' - ' . __('Private task'),
'datatype' => 'bool',
'forcegroupby' => true,
'splititems' => true,
......@@ -714,7 +715,7 @@ abstract class CommonITILTask extends CommonDBTM {
'id' => '94',
'table' => 'glpi_users',
'field' => 'name',
'name' => __('Writer'),
'name' => $name . ' - ' . __('Writer'),
'datatype' => 'itemlink',
'right' => 'all',
'forcegroupby' => true,
......@@ -734,7 +735,7 @@ abstract class CommonITILTask extends CommonDBTM {
'table' => 'glpi_users',
'field' => 'name',
'linkfield' => 'users_id_tech',
'name' => __('Technician in charge of the task'),
'name' => $name . ' - ' . __('Technician in charge'),
'datatype' => 'itemlink',
'right' => 'own_ticket',
'forcegroupby' => true,
......@@ -754,7 +755,7 @@ abstract class CommonITILTask extends CommonDBTM {
'table' => 'glpi_groups',
'field' => 'completename',
'linkfield' => 'groups_id_tech',
'name' => __('Group in charge of the task'),
'name' => $name . ' - ' . __('Group in charge'),
'datatype' => 'itemlink',
'condition' => 'is_task',
'forcegroupby' => true,
......@@ -773,7 +774,7 @@ abstract class CommonITILTask extends CommonDBTM {
'id' => '96',
'table' => static::getTable(),
'field' => 'actiontime',
'name' => __('Duration'),
'name' => $name . ' - ' . __('Duration'),
'datatype' => 'timestamp',
'massiveaction' => false,
'forcegroupby' => true,
......@@ -786,7 +787,7 @@ abstract class CommonITILTask extends CommonDBTM {
'id' => '97',
'table' => static::getTable(),
'field' => 'date',
'name' => __('Date'),
'name' => $name . ' - ' . __('Date'),
'datatype' => 'datetime',
'massiveaction' => false,
'forcegroupby' => true,
......@@ -799,7 +800,7 @@ abstract class CommonITILTask extends CommonDBTM {
'id' => '33',
'table' => static::getTable(),
'field' => 'state',
'name' => __('Status'),
'name' => $name . ' - ' . __('Status'),
'datatype' => 'specific',
'searchtype' => 'equals',
'searchequalsonfield' => true,
......@@ -814,7 +815,7 @@ abstract class CommonITILTask extends CommonDBTM {
'id' => '173',
'table' => static::getTable(),
'field' => 'begin',
'name' => __('Begin date'),
'name' => $name . ' - ' . __('Begin date'),
'datatype' => 'datetime',
'massiveaction' => false,
'forcegroupby' => true,
......@@ -827,7 +828,7 @@ abstract class CommonITILTask extends CommonDBTM {
'id' => '174',
'table' => static::getTable(),
'field' => 'end',
'name' => __('End date'),
'name' => $name . ' - ' . __('End date'),
'datatype' => 'datetime',
'massiveaction' => false,
'forcegroupby' => true,
......@@ -841,7 +842,7 @@ abstract class CommonITILTask extends CommonDBTM {
'table' => TaskTemplate::getTable(),
'field' => 'name',
'linkfield' => 'tasktemplates_id',
'name' => __('Task template'),
'name' => $name . ' - ' . __('Task template'),
'datatype' => 'dropdown',
'massiveaction' => false,
'joinparams' => [
......
This diff is collapsed.
......@@ -117,17 +117,18 @@ class ComputerAntivirus extends CommonDBChild {
static public function rawSearchOptionsToAdd() {
$tab = [];
$name = _n('Antivirus', 'Antiviruses', Session::getPluralNumber());
$tab[] = [
'id' => 'antivirus',
'name' => _n('Antivirus', 'Antiviruses', Session::getPluralNumber())
'name' => $name
];
$tab[] = [
'id' => '167',
'table' => 'glpi_computerantiviruses',
'field' => 'name',
'name' => __('Antivirus'),
'name' => $name . ' - ' . __('Name'),
'forcegroupby' => true,
'massiveaction' => false,
'datatype' => 'dropdown',
......@@ -140,7 +141,7 @@ class ComputerAntivirus extends CommonDBChild {
'id' => '168',
'table' => 'glpi_computerantiviruses',
'field' => 'antivirus_version',
'name' => __('Antivirus version'),
'name' => $name . ' - ' . __('Version'),
'forcegroupby' => true,
'massiveaction' => false,
'datatype' => 'text',
......@@ -154,7 +155,7 @@ class ComputerAntivirus extends CommonDBChild {
'table' => 'glpi_computerantiviruses',
'field' => 'is_active',
'linkfield' => '',
'name' => __('Active'),
'name' => $name . ' - ' . __('Active'),
'datatype' => 'bool',
'joinparams' => [
'jointype' => 'child'
......@@ -169,7 +170,7 @@ class ComputerAntivirus extends CommonDBChild {
'table' => 'glpi_computerantiviruses',
'field' => 'is_uptodate',
'linkfield' => '',
'name' => __('Is up to date'),
'name' => $name . ' - ' . __('Is up to date'),
'datatype' => 'bool',
'joinparams' => [
'jointype' => 'child'
......@@ -183,7 +184,7 @@ class ComputerAntivirus extends CommonDBChild {
'id' => '171',
'table' => 'glpi_computerantiviruses',
'field' => 'signature_version',
'name' => __('Signature database version'),
'name' => $name . ' - ' . __('Signature database version'),
'forcegroupby' => true,
'massiveaction' => false,
'datatype' => 'text',
......@@ -196,7 +197,7 @@ class ComputerAntivirus extends CommonDBChild {
'id' => '172',
'table' => 'glpi_computerantiviruses',
'field' => 'date_expiration',
'name' => __('Expiration date'),
'name' => $name . ' - ' . __('Expiration date'),
'forcegroupby' => true,
'massiveaction' => false,
'datatype' => 'date',
......
......@@ -418,7 +418,7 @@ class Item_OperatingSystem extends CommonDBRelation {
'id' => '45',
'table' => 'glpi_operatingsystems',
'field' => 'name',
'name' => __('Name'),
'name' => __('Operating System') . ' - ' . __('Name'),
'datatype' => 'dropdown',
'massiveaction' => false,
'joinparams' => [
......@@ -436,7 +436,7 @@ class Item_OperatingSystem extends CommonDBRelation {
'id' => '46',
'table' => 'glpi_operatingsystemversions',
'field' => 'name',
'name' => __('Version'),
'name' => __('Operating System') . ' - ' . __('Version'),
'datatype' => 'dropdown',
'massiveaction' => false,
'joinparams' => [
......@@ -454,7 +454,7 @@ class Item_OperatingSystem extends CommonDBRelation {
'id' => '41',
'table' => 'glpi_operatingsystemservicepacks',
'field' => 'name',
'name' => __('Service pack'),
'name' => __('Operating System') . ' - ' . __('Service pack'),
'datatype' => 'dropdown',
'massiveaction' => false,
'joinparams' => [
......@@ -472,7 +472,7 @@ class Item_OperatingSystem extends CommonDBRelation {
'id' => '43',
'table' => 'glpi_items_operatingsystems',
'field' => 'license_number',
'name' => __('Serial number'),
'name' => __('Operating System') . ' - ' . __('Serial number'),
'datatype' => 'string',
'massiveaction' => false,
'joinparams' => [
......@@ -485,7 +485,7 @@ class Item_OperatingSystem extends CommonDBRelation {
'id' => '44',
'table' => 'glpi_items_operatingsystems',
'field' => 'license_id',
'name' => __('Product ID'),
'name' => __('Operating System') . ' - ' . __('Product ID'),
'datatype' => 'string',
'massiveaction' => false,
'joinparams' => [
......@@ -498,7 +498,7 @@ class Item_OperatingSystem extends CommonDBRelation {
'id' => '61',
'table' => 'glpi_operatingsystemarchitectures',
'field' => 'name',
'name' => __('Architecture'),
'name' => __('Operating System') . ' - ' . __('Architecture'),
'datatype' => 'dropdown',
'massiveaction' => false,
'joinparams' => [
......@@ -516,7 +516,7 @@ class Item_OperatingSystem extends CommonDBRelation {
'id' => '64',
'table' => 'glpi_operatingsystemkernels',
'field' => 'name',
'name' => _n('Kernel', 'Kernels', 1),
'name' => __('Operating System') . ' - ' . _n('Kernel', 'Kernels', 1),
'datatype' => 'dropdown',
'massiveaction' => false,
'joinparams' => [
......@@ -539,7 +539,7 @@ class Item_OperatingSystem extends CommonDBRelation {
'id' => '48',
'table' => 'glpi_operatingsystemkernelversions',
'field' => 'name',
'name' => _n('Kernel version', 'Kernel versions', 1),
'name' => __('Operating System') . ' - ' . _n('Kernel version', 'Kernel versions', 1),
'datatype' => 'dropdown',
'massiveaction' => false,
'joinparams' => [
......@@ -557,7 +557,7 @@ class Item_OperatingSystem extends CommonDBRelation {
'id' => '63',
'table' => 'glpi_operatingsystemeditions',
'field' => 'name',
'name' => __('Edition'),
'name' => __('Operating System') . ' - ' . __('Edition'),
'datatype' => 'dropdown',
'massiveaction' => false,
'joinparams' => [
......
......@@ -180,17 +180,18 @@ class Notepad extends CommonDBChild {
static public function rawSearchOptionsToAdd() {
$tab = [];
$name = _n('Note', 'Notes', Session::getPluralNumber());
$tab[] = [
'id' => 'notepad',
'name' => _n('Note', 'Notes', Session::getPluralNumber())
'name' => $name
];
$tab[] = [
'id' => '200',
'table' => 'glpi_notepads',
'field' => 'content',
'name' => _n('Note', 'Notes', Session::getPluralNumber()),
'name' => $name,
'datatype' => 'text',
'joinparams' => [
'jointype' => 'itemtype_item'
......@@ -204,7 +205,7 @@ class Notepad extends CommonDBChild {
'id' => '201',
'table' => 'glpi_notepads',
'field' => 'date',
'name' => __('Creation date'),
'name' => $name . ' - ' . __('Creation date'),
'datatype' => 'datetime',
'joinparams' => [
'jointype' => 'itemtype_item'
......@@ -217,7 +218,7 @@ class Notepad extends CommonDBChild {
'id' => '202',
'table' => 'glpi_users',
'field' => 'name',
'name' => __('Writer'),
'name' => $name . ' - ' . __('Writer'),
'datatype' => 'dropdown',
'forcegroupby' => true,
'massiveaction' => false,
......@@ -235,7 +236,7 @@ class Notepad extends CommonDBChild {
'id' => '203',
'table' => 'glpi_notepads',
'field' => 'date_mod',
'name' => __('Last update'),
'name' => $name . ' - ' . __('Last update'),
'datatype' => 'datetime',
'joinparams' => [
'jointype' => 'itemtype_item'
......@@ -249,7 +250,7 @@ class Notepad extends CommonDBChild {
'table' => 'glpi_users',
'field' => 'name',
'linkfield' => 'users_id_lastupdater',
'name' => __('Last updater'),
'name' => $name . ' - ' . __('Last updater'),
'datatype' => 'dropdown',
'forcegroupby' => true,
'massiveaction' => false,
......
......@@ -620,16 +620,17 @@ class Software extends CommonDBTM {
'massiveaction' => false
];
$name = _n('Version', 'Versions', Session::getPluralNumber());
$tab[] = [
'id' => 'versions',
'name' => _n('Version', 'Versions', Session::getPluralNumber())
'name' => $name
];
$tab[] = [
'id' => '5',
'table' => 'glpi_softwareversions',
'field' => 'name',
'name' => __('Version name'),
'name' => $name . ' - ' . __('Name'),
'forcegroupby' => true,
'massiveaction' => false,
'displaywith' => ['softwares_id'],
......@@ -643,7 +644,7 @@ class Software extends CommonDBTM {
'id' => '31',
'table' => 'glpi_states',
'field' => 'completename',
'name' => __('Status'),
'name' => $name . ' - ' . __('Status'),
'datatype' => 'dropdown',
'forcegroupby' => true,
'massiveaction' => false,
......@@ -661,7 +662,7 @@ class Software extends CommonDBTM {
'id' => '170',
'table' => 'glpi_softwareversions',
'field' => 'comment',
'name' => __('Version comments'),
'name' => $name . ' - ' . __('Comments'),
'forcegroupby' => true,
'datatype' => 'text',
'massiveaction' => false,
......@@ -675,7 +676,7 @@ class Software extends CommonDBTM {
'table' => 'glpi_operatingsystems',
'field' => 'name',
'datatype' => 'dropdown',
'name' => __('Operating system'),
'name' => $name . ' - ' . __('Operating system'),
'forcegroupby' => true,
'joinparams' => [
'beforejoin' => [
......
......@@ -691,6 +691,7 @@ class SoftwareLicense extends CommonTreeDropdown {
static public function rawSearchOptionsToAdd() {
$tab = [];
$name = _n('License', 'Licenses', Session::getPluralNumber());
if (!self::canView()) {
return $tab;
......@@ -704,14 +705,14 @@ class SoftwareLicense extends CommonTreeDropdown {
$tab[] = [
'id' => 'license',
'name' => _n('License', 'Licenses', Session::getPluralNumber())
'name' => $name
];
$tab[] = [
'id' => '160',
'table' => 'glpi_softwarelicenses',
'field' => 'name',
'name' => __('License name'),
'name' => $name . ' - ' . __('Name'),
'datatype' => 'dropdown',
'forcegroupby' => true,
'massiveaction' => false,
......@@ -723,7 +724,7 @@ class SoftwareLicense extends CommonTreeDropdown {
'table' => 'glpi_softwarelicenses',
'field' => 'serial',
'datatype' => 'string',
'name' => __('License serial number'),
'name' => $name . ' - ' . __('Serial number'),
'forcegroupby' => true,
'massiveaction' => false,
'joinparams' => $licjoinexpire
......@@ -734,7 +735,7 @@ class SoftwareLicense extends CommonTreeDropdown {
'table' => 'glpi_softwarelicenses',
'field' => 'otherserial',
'datatype' => 'string',
'name' => __('License inventory number'),
'name' => $name . ' - ' . __('Inventory number'),
'forcegroupby' => true,
'massiveaction' => false,
'joinparams' => $licjoinexpire
......@@ -744,7 +745,7 @@ class SoftwareLicense extends CommonTreeDropdown {
'id' => '163',
'table' => 'glpi_softwarelicenses',
'field' => 'number',
'name' => __('Number of licenses'),
'name' => $name . ' - ' . __('Number of licenses'),
'forcegroupby' => true,
'usehaving' => true,
'datatype' => 'number',
......@@ -757,7 +758,7 @@ class SoftwareLicense extends CommonTreeDropdown {
'table' => 'glpi_softwarelicensetypes',
'field' => 'name',
'datatype' => 'dropdown',
'name' => __('License types'),
'name' => $name . ' - ' . __('Type'),
'forcegroupby' => true,
'massiveaction' => false,
'joinparams' => [
......@@ -772,7 +773,7 @@ class SoftwareLicense extends CommonTreeDropdown {
'id' => '165',
'table' => 'glpi_softwarelicenses',
'field' => 'comment',
'name' => __('License comments'),
'name' => $name . ' - ' . __('Comments'),
'forcegroupby' => true,
'datatype' => 'text',
'massiveaction' => false,
......@@ -783,7 +784,7 @@ class SoftwareLicense extends CommonTreeDropdown {
'id' => '166',
'table' => 'glpi_softwarelicenses',
'field' => 'expire',
'name' => __('Expiration'),
'name' => $name . ' - ' . __('Expiration'),
'forcegroupby' => true,
'datatype' => 'date',
'emptylabel' => 'Never expire',
......@@ -795,7 +796,7 @@ class SoftwareLicense extends CommonTreeDropdown {
'id' => '167',
'table' => 'glpi_softwarelicenses',
'field' => 'is_valid',
'name' => __('Valid'),
'name' => $name . ' - ' . __('Valid'),
'forcegroupby' => true,
'datatype' => 'bool',
'massiveaction' => false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment