mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-01 11:04:47 +02:00
* Delete ticket priorities. * Fix style in autocomplete component. * Fix style in tag selector component. * Fix style in ticket query filters. * Fix style in ticket viewer. * Delete commented lines.
20 lines
472 B
PHP
20 lines
472 B
PHP
<?php
|
|
|
|
namespace CustomValidations;
|
|
|
|
use Respect\Validation\Rules\AbstractRule;
|
|
|
|
class ValidOrderBy extends AbstractRule {
|
|
public function validate($orderBy) {
|
|
if(is_object(json_decode($orderBy))){
|
|
$values =["closed","owner_id","unread_staff","date"];
|
|
|
|
$object = json_decode($orderBy);
|
|
|
|
if(($object->asc !== 1 && $object->asc !== 0) || !in_array($object->value, $values)) return false;
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|