[Rt-devel] rt-remind
Ruslan Zakirov
ruslan.zakirov at gmail.com
Sat Aug 12 02:40:28 EDT 2006
I think this should work:
$tickets->FromSQL("...(Status = 'xxx' OR ...) AND (...)");
So you can build pseudo SQL string.
Also this should work in general case, but looks like many Limit*
methods doesn't pass throught ENTRYAGGREGATOR argument to Limit
method.
$tickets->LimitQueue(VALUE => $queue->Id);
$tickets->_OpenParen();
$tickets->LimitStatus(VALUE => 'new');
$tickets->LimitStatus(VALUE => 'open');
$tickets->_CloseParen();
$tickets->_OpenParen();
$tickets->LimitStarts(
OPERATOR => '<', VALUE => 'now +'.$plusdays.' day',
ENTRYAGGREGATOR => 'OR'
);
$tickets->LimitDue(
OPERATOR => '<', VALUE => 'now +'.$plusdays.' day',
ENTRYAGGREGATOR => 'OR'
);
$tickets->LimitPriority(
OPERATOR => '>', VALUE => $mpriority,
ENTRYAGGREGATOR => 'OR'
);
$tickets->_CloseParen();
On 8/11/06, Manuel Stächele <manuel at ilch.de> wrote:
> hi list,
>
> i have a question to the rt-remind modul but i think the question is
> realy general.
>
> it is possible to build a query like this:
>
> WHERE quenname = 'x'
> AND (
> status = 'new' OR status = 'open'
> )
> AND (
> starts < '2006-08-11' OR due < '2006-08-11' OR priority > 70
> )
>
> ----
>
> i test a lot but can't figure it out.
>
> my tests:
>
> my $tickets = new RT::Tickets($RT::SystemUser);
>
> $tickets->LimitQueue(VALUE => $queue->Id);
> $tickets->Limit(ENTRYAGGREGATOR => 'AND');
> $tickets->_OpenParen();
> $tickets->LimitStatus(VALUE => 'new');
> $tickets->Limit(ENTRYAGGREGATOR => 'OR');
> $tickets->LimitStatus(VALUE => 'open');
> $tickets->_CloseParen();
>
> $tickets->Limit(ENTRYAGGREGATOR => 'AND');
>
> $tickets->_OpenParen();
> $tickets->LimitStarts(OPERATOR => '<', VALUE => 'now +'.$plusdays.' day');
> $tickets->Limit(ENTRYAGGREGATOR => 'OR');
> $tickets->LimitDue(OPERATOR => '<', VALUE => 'now +'.$plusdays.' day');
> $tickets->Limit(ENTRYAGGREGATOR => 'OR');
> $tickets->LimitPriority(OPERATOR => '>', VALUE => $mpriority);
> $tickets->_CloseParen();
>
> $tickets->OrderBy(FIELD => 'Priority', ORDER => 'DESC');
>
> i thought OpenParen and CloseParen can group the terms and
> ENTRYAGGREGATOR can set the AND or the OR operator but do not relay
> work.
> in principle it work but the last three terms (starts, due, priority)
> are added with AND not with OR...
>
> someone have a solution?
>
> would be nice, thanks
>
> greetings manuel
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
>
--
Best regards, Ruslan.
More information about the Rt-devel
mailing list