Add LIKE and NOT LIKE to filter options

This is useful for filtering notes.
EG filtering detected objects from zmeventnofification;
WHERE notes LIKE %detect%
WHERE notes NOT LIKE %car%
This commit is contained in:
externo6 2019-09-28 13:03:16 +01:00
parent 8940ca420c
commit 7479d3f1f1
3 changed files with 6 additions and 0 deletions

View File

@ -1275,6 +1275,8 @@ function parseFilter(&$filter, $saveToSession=false, $querySep='&') {
case '>' : case '>' :
case '<' : case '<' :
case '<=' : case '<=' :
case 'LIKE' :
case 'NOT LIKE':
$filter['sql'] .= ' '.$term['op'].' '. $value; $filter['sql'] .= ' '.$term['op'].' '. $value;
break; break;
case '=~' : case '=~' :

View File

@ -579,6 +579,8 @@ $SLANG = array(
'OpNotMatches' => 'does not match', 'OpNotMatches' => 'does not match',
'OpIs' => 'is', 'OpIs' => 'is',
'OpIsNot' => 'is not', 'OpIsNot' => 'is not',
'OpLike' => 'like',
'OpNotLike' => 'not like',
'OptionalEncoderParam' => 'Optional Encoder Parameters', 'OptionalEncoderParam' => 'Optional Encoder Parameters',
'OptionHelp' => 'Option Help', 'OptionHelp' => 'Option Help',
'OptionRestartWarning' => 'These changes may not come into effect fully\nwhile the system is running. When you have\nfinished making your changes please ensure that\nyou restart ZoneMinder.', 'OptionRestartWarning' => 'These changes may not come into effect fully\nwhile the system is running. When you have\nfinished making your changes please ensure that\nyou restart ZoneMinder.',

View File

@ -115,6 +115,8 @@ $opTypes = array(
'![]' => translate('OpNotIn'), '![]' => translate('OpNotIn'),
'IS' => translate('OpIs'), 'IS' => translate('OpIs'),
'IS NOT' => translate('OpIsNot'), 'IS NOT' => translate('OpIsNot'),
'LIKE' => translate('OpLike'),
'NOT LIKE' => translate('OpNotLike'),
); );
$archiveTypes = array( $archiveTypes = array(