From 4ada5eaa947b8c9ef000f744d5c18b3c9df118cf Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 23 May 2017 14:31:14 -0700 Subject: [PATCH] Added targetType method --- app/Models/Actionlog.php | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/app/Models/Actionlog.php b/app/Models/Actionlog.php index 3aa0307eb8..764c64b7e8 100755 --- a/app/Models/Actionlog.php +++ b/app/Models/Actionlog.php @@ -60,6 +60,14 @@ class Actionlog extends SnipeModel 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() { 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() {