You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has come up a few times in various ways (#3286, #3914, #8385, #9013). To summarize, folks would like to be able to dynamically prefix the asset tags for the auto-incrementer. Some folks want to use {category-abbreviation}-TheNextNumber, others want to use {location-abbreviation}-TheNextNumber.
The challenge here is that with tags being dynamic this way, we won't be able to know what that next number should be. Right now, the next auto-increment value is stored on the settings table, since any new asset will increment that number. We have an observer that increments that value when a new asset is created:
$logAction->item_type = Asset::class; // can we instead say $logAction->item = $asset ?
$logAction->item_id = $asset->id;
$logAction->created_at = date('Y-m-d H:i:s');
$logAction->user_id = Auth::id();
if($asset->imported) {
$logAction->setActionSource('importer');
}
$logAction->logaction('create');
}
While I very much like the idea of setting patterns for labels and auto-incrementing, I don't know how we'd do that exactly, since a dynamic prefix means we need to store different increments for each type of prefix. Adding a prefix (and corresponding counter)for every imaginable combination of location/category/model/etc isn't realistic, and if the admin decides to change that asset tag scheme, knowing how to rectify that without screwing up their asset tags seems kind of impossible.
Additionally, some folks may want certain types of assets to skip auto-incrementing, which makes this even hairier.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This has come up a few times in various ways (#3286, #3914, #8385, #9013). To summarize, folks would like to be able to dynamically prefix the asset tags for the auto-incrementer. Some folks want to use
{category-abbreviation}-TheNextNumber
, others want to use{location-abbreviation}-TheNextNumber
.The challenge here is that with tags being dynamic this way, we won't be able to know what that next number should be. Right now, the next auto-increment value is stored on the settings table, since any new asset will increment that number. We have an observer that increments that value when a new asset is created:
snipe-it/app/Observers/AssetObserver.php
Lines 71 to 116 in 7f38ca2
While I very much like the idea of setting patterns for labels and auto-incrementing, I don't know how we'd do that exactly, since a dynamic prefix means we need to store different increments for each type of prefix. Adding a prefix (and corresponding counter)for every imaginable combination of location/category/model/etc isn't realistic, and if the admin decides to change that asset tag scheme, knowing how to rectify that without screwing up their asset tags seems kind of impossible.
Additionally, some folks may want certain types of assets to skip auto-incrementing, which makes this even hairier.
This also relates to [SC-23994], [SC-18809] and [SC-15054] internally.
Beta Was this translation helpful? Give feedback.
All reactions