mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
Clesned up status label model for code quality
This commit is contained in:
parent
0788347990
commit
cb3b294baa
|
@ -49,9 +49,10 @@ class Statuslabel extends SnipeModel
|
||||||
return 'archived';
|
return 'archived';
|
||||||
} elseif (($this->pending == '0') && ($this->archived == '0') && ($this->deployable == '0')) {
|
} elseif (($this->pending == '0') && ($this->archived == '0') && ($this->deployable == '0')) {
|
||||||
return 'undeployable';
|
return 'undeployable';
|
||||||
} else {
|
|
||||||
return 'deployable';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 'deployable';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopePending()
|
public function scopePending()
|
||||||
|
@ -78,6 +79,11 @@ class Statuslabel extends SnipeModel
|
||||||
|
|
||||||
public static function getStatuslabelTypesForDB($type)
|
public static function getStatuslabelTypesForDB($type)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$statustype['pending'] = 0;
|
||||||
|
$statustype['deployable'] = 0;
|
||||||
|
$statustype['archived'] = 0;
|
||||||
|
|
||||||
if ($type == 'pending') {
|
if ($type == 'pending') {
|
||||||
$statustype['pending'] = 1;
|
$statustype['pending'] = 1;
|
||||||
$statustype['deployable'] = 0;
|
$statustype['deployable'] = 0;
|
||||||
|
@ -92,12 +98,6 @@ class Statuslabel extends SnipeModel
|
||||||
$statustype['pending'] = 0;
|
$statustype['pending'] = 0;
|
||||||
$statustype['deployable'] = 0;
|
$statustype['deployable'] = 0;
|
||||||
$statustype['archived'] = 1;
|
$statustype['archived'] = 1;
|
||||||
|
|
||||||
} else {
|
|
||||||
$statustype['pending'] = 0;
|
|
||||||
$statustype['deployable'] = 0;
|
|
||||||
$statustype['archived'] = 0;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $statustype;
|
return $statustype;
|
||||||
|
|
Loading…
Reference in a new issue