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.
|
|
|
<?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['Categories']) === 0 ||
|
|
|
|
in_array($categoryId, $customField['Categories']);
|
|
|
|
}
|
|
|
|
}
|