mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
removes unnecessary function
This commit is contained in:
parent
576b8f8c48
commit
371e142bae
|
@ -528,7 +528,7 @@ class Helper
|
|||
* @since [v2.5]
|
||||
* @return array
|
||||
*/
|
||||
public static function categoryTypeList()
|
||||
public static function categoryTypeList($selection=null)
|
||||
{
|
||||
$category_types = [
|
||||
'' => '',
|
||||
|
@ -539,27 +539,12 @@ class Helper
|
|||
'license' => trans('general.license'),
|
||||
];
|
||||
|
||||
if($selection != null){
|
||||
return $category_types[$selection];
|
||||
}
|
||||
else
|
||||
return $category_types;
|
||||
}
|
||||
public static function categoryType($category_type){
|
||||
|
||||
switch ($category_type) {
|
||||
case ('accessory'):
|
||||
return trans('general.accessory');
|
||||
break;
|
||||
case ('consumable'):
|
||||
return trans('general.consumable');
|
||||
break;
|
||||
case ('component'):
|
||||
return trans('general.component');
|
||||
break;
|
||||
case ('asset'):
|
||||
return trans('general.asset');
|
||||
case ('license'):
|
||||
return trans('general.license');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of custom fields in an array to make a dropdown menu
|
||||
*
|
||||
|
|
|
@ -47,7 +47,7 @@ class CategoriesTransformer
|
|||
'id' => (int) $category->id,
|
||||
'name' => e($category->name),
|
||||
'image' => ($category->image) ? Storage::disk('public')->url('categories/'.e($category->image)) : null,
|
||||
'category_type' => Helper::categoryType($category->category_type),
|
||||
'category_type' => Helper::categoryTypeList($category->category_type),
|
||||
'has_eula' => ($category->getEula() ? true : false),
|
||||
'use_default_eula' => ($category->use_default_eula=='1' ? true : false),
|
||||
'eula' => ($category->getEula()),
|
||||
|
|
Loading…
Reference in a new issue