[rt-users] RT Time fields in days?

Kristian Davies kristian.davies at gmail.com
Wed Feb 4 05:46:02 EST 2009


Not my code, but in the interest of sharing:

local/html/Elements/SelectTimeUnits

%# END BPS TAGGED BLOCK }}}
% my $selected = 'minutes';
% $selected = 'hours' if $minutes > 60;
% $selected = 'days'  if $minutes > 480;
<select class="TimeUnits" id="<% $Name %>" name="<% $Name %>">
<option value="minutes" <% (($selected eq
'minutes')?'selected="selected"':'') %>><% loc('Minutes') %></option>
<option value="hours" <% (($selected eq
'hours')?'selected="selected"':'') %>><% loc('Hours') %></option>
<option value="days" <% (($selected eq
'days')?'selected="selected"':'') %>><% loc('Days') %></option>
</select>
<%INIT>
$Name .= '-TimeUnits' unless $Name =~ /-TimeUnits$/io;
</%INIT>
<%ARGS>
$Name => ''
$minutes => ''
</%ARGS>

Kristian



More information about the rt-users mailing list