mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Added targetType method
This commit is contained in:
parent
5499735f3a
commit
4ada5eaa94
|
@ -60,6 +60,14 @@ class Actionlog extends SnipeModel
|
||||||
return camel_case(class_basename($this->item_type));
|
return camel_case(class_basename($this->item_type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function targetType()
|
||||||
|
{
|
||||||
|
if ($this->target_type == User::class) {
|
||||||
|
return "user";
|
||||||
|
}
|
||||||
|
return camel_case(class_basename($this->target_type));
|
||||||
|
}
|
||||||
|
|
||||||
public function parseItemRoute()
|
public function parseItemRoute()
|
||||||
{
|
{
|
||||||
if ($this->itemType() == "asset") {
|
if ($this->itemType() == "asset") {
|
||||||
|
@ -80,24 +88,7 @@ class Actionlog extends SnipeModel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function parseItemIcon()
|
|
||||||
{
|
|
||||||
if ($this->itemType() == "asset") {
|
|
||||||
$itemicon = 'fa fa-barcode';
|
|
||||||
} elseif ($this->itemType() == "accessory") {
|
|
||||||
$itemicon = 'fa fa-keyboard-o';
|
|
||||||
} elseif ($this->itemType()=="consumable") {
|
|
||||||
$itemicon = 'fa fa-tint';
|
|
||||||
} elseif ($this->itemType()=="license") {
|
|
||||||
$itemicon = 'fa fa-floppy-o';
|
|
||||||
} elseif ($this->itemType()=="component") {
|
|
||||||
$itemicon = 'fa fa-hdd-o';
|
|
||||||
} else {
|
|
||||||
$itemicon = 'fa fa-paperclip';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $itemicon;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function uploads()
|
public function uploads()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue