2017-02-09 12:57:28 -05:00
|
|
|
<?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;
|
|
|
|
}
|
|
|
|
|
2017-02-13 22:34:15 -05:00
|
|
|
return count($customField['Categories']) === 0 ||
|
|
|
|
in_array($categoryId, $customField['Categories']);
|
2017-02-09 12:57:28 -05:00
|
|
|
}
|
|
|
|
}
|