Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.11.1 available

The official documentation can be found on http://wiki.ocsinventory-ng.org. Read it before asking your question.

How can I add 'View Columns' and make them stay as default?

I am running OCS Inventory 2.0.5 on Red Hat 5. The problem that I would like to resole is to have added columns stay permanently.

For example, whenever I do a "Software with various criteria" and lets say I choose parameter "Software Name" and do a search that is [LIKE] Firefox. When I hit the search key I get a list of all my machines that have Firefox installed, but in order to see what Version of the Software is installed, I have to add the column "Softwares: Version". While this may sound like a miniscule problem, I seem to find myself longing for default added columns in many areas of OCS and having to constantly re-add the columns in order to see what I want to see.

Is there a solution for this? Perhaps a code change in the OCS files or maybe there is an option I am missing on the Web Interface.

Thank you in advance for any help

in OCS Inventory NG server for Unix by (120 points)

2 Answers

0 votes
Hi! I've got the same question. I would like to edit the default columns / add columns persistently. Any way this is possible?
by (530 points)
0 votes

For the default view of all computers, the file to change is ms_all_computers.php, lines list_fields2 = and default_fields2 =, adding e.g. 

    $l->g(65) => "h.model",

to list_fields2 and including in default_fields2:
$l->g(65) => $l->g(65)
And for administrative columns, adding in list_fields2 something like these (label 1620 is not used for ocs):
    $l->g(1620) => "fields_36",
and adding the respective labels in en_GB.txt and in es_ES.txt, for example.
For multi search I found that the lines to change are public $defaultFields = in Search.php, like this:
    public $defaultFields = [
        "hardware.ID", (default)
        "hardware.DEVICEID", (default)
        "hardware.NAME", (default)
        "hardware.WORKGROUP", (default)
        "hardware.OSNAME", (default)
        "softwares.NAME", (added)
        "softwares.VERSION", (added)
        "monitors.CAPTION", (added)
by (4.6k points)
Powered by Question2Answer