2017-02-09 12:57:28 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace BusinessLogic\Tickets\CustomFields;
|
|
|
|
|
|
|
|
|
|
|
|
class CustomFieldValidator {
|
|
|
|
static function isCustomFieldInCategory($customFieldId, $categoryId, $staff, $heskSettings) {
|
|
|
|
$customField = $heskSettings['custom_fields']["custom{$customFieldId}"];
|
|
|
|
|
|
|
|
if (!$customField['use'] ||
|
|
|
|
(!$staff && $customField['use'] === 2)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-02-14 22:03:46 -05:00
|
|
|
return count($customField['category']) === 0 ||
|
|
|
|
in_array($categoryId, $customField['category']);
|
2017-02-09 12:57:28 -05:00
|
|
|
}
|
|
|
|
}
|