Bonjour, patch pour afficher dans une fiche ordinateur, si les composants et logiciels sont de inventaire automatiques ou pas
Cordialement, -- David DURIEUX Tel : +33 (0)4.82.53.30.53 Mail : d.duri...@siprossii.com Site Web : http://www.siprossii.com/ SIPROSSII Les LafĂ´rets 69430 Beaujeu FRANCE
Index: inc/computer_softwareversion.class.php =================================================================== --- inc/computer_softwareversion.class.php (revision 20357) +++ inc/computer_softwareversion.class.php (working copy) @@ -668,6 +668,7 @@ $query = "SELECT `glpi_softwares`.`softwarecategories_id`, `glpi_softwares`.`name` AS softname, `glpi_computers_softwareversions`.`id`, + `glpi_computers_softwareversions`.`is_dynamic`, `glpi_states`.`name` AS state, `glpi_softwareversions`.`id` AS verid, `glpi_softwareversions`.`softwares_id`, @@ -905,8 +906,11 @@ echo "</th>"; } echo "<th>" . __('Name') . "</th><th>" . __('Status') . "</th>"; - echo "<th>" .__('Version')."</th><th>" . __('License') . "</th></tr>\n"; - + echo "<th>" .__('Version')."</th><th>" . __('License') . "</th>"; + if (Plugin::haveImport()) { + echo "<th>".__('Automatic inventory')."</th>"; + } + echo "</tr>\n"; return $cat; } @@ -985,7 +989,16 @@ echo " "; } - echo "</td></tr>\n"; + echo "</td>"; + + echo "</td>"; + if ($data['is_dynamic']) { + echo "<td>"; + _e('Yes'); + echo "</td>"; + } + + echo "</tr>\n"; return $licids; } Index: inc/item_devices.class.php =================================================================== --- inc/item_devices.class.php (revision 20357) +++ inc/item_devices.class.php (working copy) @@ -171,7 +171,12 @@ $common_column = $table->addHeader('common', __('Type of component')); $specific_column = $table->addHeader('specificities', __('Specificities')); $specific_column->setHTMLClass('center'); - + + $dynamic_column = ''; + if (Plugin::haveImport()) { + $dynamic_column = $table->addHeader('is_dynamic', __('Automatic inventory')); + } + if ($canedit) { $content = "<input type='submit' class='submit' name='delete' value='". _sx('button', 'Delete permanently')."'>"; @@ -185,7 +190,8 @@ foreach (self::getDeviceTypes() as $link_type) { $devtypes [] = $link_type::getDeviceType(); $link_type::getTableGroup($item, $table, $table_options, $delete_all_column, - $common_column, $specific_column, $delete_column); + $common_column, $specific_column, $delete_column, + $dynamic_column); } if ($canedit) { @@ -221,11 +227,12 @@ HTMLTableSuperHeader $delete_all_column, HTMLTableSuperHeader $common_column, HTMLTableSuperHeader $specific_column, - HTMLTableSuperHeader $delete_column) { + HTMLTableSuperHeader $delete_column, + $dynamic_column) { global $DB; $device_type = static::getDeviceType(); - + $table_group = $table->createGroup($device_type, ''); //TRANS : %1$s is the type of the device @@ -244,7 +251,12 @@ $specific_column, $spec_column); $specificity_columns[$field] = $spec_column; } - + + if (Plugin::haveImport()) { + $dynamics_column = $table_group->addHeader('one', ' ', + $dynamic_column, $spec_column); + } + if ($options['canedit']) { $delete_one = $table_group->addHeader('one', ' ', $delete_column, $spec_column); } @@ -287,7 +299,15 @@ } $spec_cell = $current_row->addCell($specificity_columns[$field], $content, $spec_cell); } - + + if (Plugin::haveImport()) { + $val = ''; + if ($link['is_dynamic']) { + $val = __('Yes'); + } + $current_row->addCell($dynamics_column, $val, $spec_cell); + } + if ($options['canedit']) { $cell_value = "<input type='checkbox' name='remove_" . $device_type . "_" . $link['id'] . "' value='1'>";
_______________________________________________ Glpi-dev mailing list Glpi-dev@gna.org https://mail.gna.org/listinfo/glpi-dev