Merge pull request #17799 from grokability/#17798-adds-require-serial-to-importer

Fixed #17798 - added `require_serial` to model importer
This commit is contained in:
snipe
2025-09-03 15:32:42 +01:00
committed by GitHub
2 changed files with 6 additions and 0 deletions

View File

@@ -66,6 +66,7 @@ class AssetModelImporter extends ItemImporter
$this->item['fieldset'] = trim($this->findCsvMatch($row, 'fieldset'));
$this->item['depreciation'] = trim($this->findCsvMatch($row, 'depreciation'));
$this->item['requestable'] = trim(($this->fetchHumanBoolean($this->findCsvMatch($row, 'requestable'))) == 1) ? 1 : 0;
$this->item['require_serial'] = trim(($this->fetchHumanBoolean($this->findCsvMatch($row, 'require_serial'))) == 1) ? 1 : 0;
if (!empty($this->item['category'])) {
if ($category = $this->createOrFetchCategory($this->item['category'])) {

View File

@@ -412,6 +412,7 @@ class Importer extends Component
'model_number' => trans('general.model_no'),
'notes' => trans('general.item_notes', ['item' => trans('admin/hardware/form.model')]),
'requestable' => trans('admin/models/general.requestable'),
'require_serial' => trans('admin/hardware/general.require_serial'),
];
@@ -535,6 +536,10 @@ class Importer extends Component
'product key',
'key',
],
'require_serial' =>
[
'serial required',
],
'model_number' =>
[
'model',