Hi All,

By trying to fix a Bug I fall in the same trap as reporters for bugs 7047 and 6975 also fall, lets take a look into GenericAgent filter section for any time related field (e.g. Pending Time):
Ticket pending time reached "Last" 01 days(s), this is the default setting and if you just see this (and for my poor English knowledge) this means that the pending time was expired in the last 1 day from NOW, in other words 1 day ago.

But wait... there is another option
Ticket pending time reached "Before" 01 days(s)….hmm this sounds creasy looks that they are the same: the pending time was expired one day before NOW, in other words 1 day ago.


As a developer I normally don't use this features neither for GenericAgent nor TicketSearch, but I'm sure that there are a lot of experienced consulters and users that does and that understand exactly what "Last" means, but was not my case, so I dig into the SQL statement and I found that the SQL query for "Last" has the following line:
AND st.until_time >= 1348876961  (from the context I got this statement it means that until_time is equal or greater from 1 day after NOW)


WOW so "Last" means After…. well that makes sense if you have the 2 options "Before" and "After" that are opposite, so why do we have the options "Before" and "Last" since in most cases they are not opposite?

Do anyone knows any context where "Last" means something in future?

Now look at the ticket search screen, other example ticket crete:
Ticket Create Time (before/after): "Last" 01 days(s)… same problem but here we have a bit of light in the label
if ( $GetParam{ $Type . 'TimePointStart' } eq 'Before' ) {
    $GetParam{ $Type . 'TimeOlderMinutes' } = $Time;
}
else {
    $GetParam{ $Type . 'TimeNewerMinutes' } = $Time;
}

Only word "Before" is used and is used correctly…. that is nice and good.

So finally my proposal is to Change the word "Last" to "After" at least in otrs 3.2 but I would like to change it also for 3.1 and maybe for 3.0 (the impart in the code logic is 0, since the value is not used explicitly, only "Before", so the change is only at frontend output parts)

I think this problem exists since otrs 2.4 and maybe before.

This is the root cause of the bugs 7047 and 6975 and maybe others.

What do you think?
((enjoy))

Carlos Rodríguez