Hello list, I attached a patch to be able to associate core and thread information to a CPU.
As discussed during the SolutionsLinux meeting, the core information is used by the pricing policy of some proprietary database. This information can also be used various different way. This information is already collected by FusionInventory but ignored so far. The patch add two new fields in /front/deviceprocessor.form.php and a new Search entry called "Nbr of processor core". I tried by best to provide a correct patch and I hope everything is ok with it. Best regards, -- Gonéri Le Bouder
Index: locales/fr_FR.php =================================================================== --- locales/fr_FR.php (révision 15405) +++ locales/fr_FR.php (copie de travail) @@ -403,6 +403,9 @@ $LANG['computers'][65] = "Liste des machines hôtes"; $LANG['computers'][66] = "Liste des machines virtuelles"; +$LANG['computers'][70] = "Nombre de cÅur(s)"; +$LANG['computers'][71] = "Nombre de thread(s) par coeur"; +$LANG['computers'][72] = "Nbre de cÅur(s) du processeur"; $LANG['connect'][0] = "Connexion(s) directe(s)"; $LANG['connect'][1] = "Non connecté."; Index: locales/en_GB.php =================================================================== --- locales/en_GB.php (révision 15405) +++ locales/en_GB.php (copie de travail) @@ -349,6 +349,10 @@ $LANG['computers'][65]="List of host machines"; $LANG['computers'][66]="List of virtual machines"; +$LANG['computers'][70] = "Number of core"; +$LANG['computers'][71] = "Nombre de thread"; +$LANG['computers'][72] = "Nbr of processor core"; + $LANG['connect'][0]="Direct Connections"; $LANG['connect'][1]="Not connected."; $LANG['connect'][2]="Direct connections"; Index: install/mysql/glpi-0.83-empty.sql =================================================================== --- install/mysql/glpi-0.83-empty.sql (révision 15405) +++ install/mysql/glpi-0.83-empty.sql (copie de travail) @@ -1406,6 +1406,8 @@ `comment` text COLLATE utf8_unicode_ci, `manufacturers_id` int(11) NOT NULL DEFAULT '0', `specif_default` int(11) NOT NULL, + `core` int(11), + `thread` int(11), PRIMARY KEY (`id`), KEY `designation` (`designation`), KEY `manufacturers_id` (`manufacturers_id`) Index: install/update_0801_083.php =================================================================== --- install/update_0801_083.php (révision 15405) +++ install/update_0801_083.php (copie de travail) @@ -1064,6 +1064,11 @@ // New index for count on tab $migration->addKey('glpi_ruleactions', array('field', 'value'), '', 'INDEX', 50); + // CPU core/thread + $migration->addField("glpi_deviceprocessors", "core", "integer"); + $migration->addField("glpi_deviceprocessors", "thread", "integer"); + + // ************ Keep it at the end ************** $migration->displayMessage($LANG['update'][142] . ' - glpi_displaypreferences'); Index: inc/deviceprocessor.class.php =================================================================== --- inc/deviceprocessor.class.php (révision 15405) +++ inc/deviceprocessor.class.php (copie de travail) @@ -58,7 +58,14 @@ array('name' => 'frequence', 'label' => $LANG['device_ram'][1], 'type' => 'text', - 'unit' => $LANG['setup'][35]))); + 'unit' => $LANG['setup'][35]), + array('name' => 'core', + 'label' => $LANG['computers'][70], + 'type' => 'text'), + array('name' => 'thread', + 'label' => $LANG['computers'][71], + 'type' => 'text'))); + } Index: inc/computer.class.php =================================================================== --- inc/computer.class.php (révision 15405) +++ inc/computer.class.php (copie de travail) @@ -905,6 +905,17 @@ $tab[36]['massiveaction'] = false; $tab[36]['joinparams'] = array('jointype' => 'child'); + $tab[37]['table'] = 'glpi_deviceprocessors'; + $tab[37]['field'] = 'core'; + $tab[37]['name'] = $LANG['computers'][72]; + $tab[37]['forcegroupby'] = true; + $tab[37]['usehaving'] = true; + $tab[37]['datatype'] = 'number'; + $tab[37]['massiveaction'] = false; + $tab[37]['joinparams'] = array('beforejoin' + => array('table' => 'glpi_computers_deviceprocessors', + 'joinparams' => array('jointype' => 'child'))); + $tab[10]['table'] = 'glpi_devicememories'; $tab[10]['field'] = 'designation'; $tab[10]['name'] = $LANG['computers'][23];
_______________________________________________ Glpi-dev mailing list Glpi-dev@gna.org https://mail.gna.org/listinfo/glpi-dev