You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2024-03-06 18:26:44

bruno.chrisostomo
Member
Registered: 2024-03-05
Posts: 2

search filter

Hello, I'm trying to add a search filter for tickets where in the follow-up there will be a phrase that starts with #NONCOMPLIANT or #COMPLIANT. So I'm adding the filter like this:

php

$followup_condition = [          1 => '#NONCOMPLIANT', // Maps 1 to "NONCOMPLIANT" 0 => '#COMPLIANT', // Maps 0 to "COMPLIANT"       ];        $opt['700003'] = [          'table'              => ITILFollowup::getTable(),          'field'              => 'content',          'name'               => __g4t('ACCORDING TO'),          'datatype'           => 'bool',          'right'              => [             1 => '#NONCOMPLIANT', // Maps 1 to "NONCOMPLIANT" 0 => '#COMPLIANT', // Maps 0 to "COMPLIANT"          ],          'massiveaction'      => false,          'joinparams'         => [             'jointype'           => 'itemtype_item',             'condition'          => 'AND NEWTABLE.`content` = \'' . $followup_condition . '\''          ]       ];

However, it doesn't work, leaving the query incorrectly formed with an AND at the end that breaks it, as in the example below:

sql

LEFT JOIN `glpi_itilfollowups` AS `glpi_itilfollowups_4328b855126e8759c86e755314504bb3` ON (`glpi_tickets

Offline

Board footer

Powered by FluxBB