You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
599 B
PHTML
24 lines
599 B
PHTML
7 years ago
|
<?php
|
||
|
/**
|
||
|
* Created by PhpStorm.
|
||
|
* User: cokoch
|
||
|
* Date: 2/9/2017
|
||
|
* Time: 12:28 PM
|
||
|
*/
|
||
|
|
||
|
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;
|
||
|
}
|
||
|
|
||
|
return count($customField['category']) === 0 ||
|
||
|
in_array($categoryId, $customField['category']);
|
||
|
}
|
||
|
}
|