How to change/shorten the minute dropdown list

Dont create your support topics here! No new topics with questions allowed!

Moderator: crythias

Forum rules
Dont create your support topics here! No new topics with questions allowed!
Post Reply
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

How to change/shorten the minute dropdown list

Post by crythias »

Personally, I find it a real pain to have 60 minutes worth of drop down. If you find it that way, too, here's the fastest way to fix it:
(OTRS 2.4.7)

Edit Kernel/Output/HTML/Layout.pm around line 3784:

Code: Select all

        # minute
        if ( $DateInputStyle eq 'Option' ) {
            my %Minute = ();
            $Minute{$m} = sprintf( "%02d", $m);
            for ( 0 .. 3 ) {
                my $Tmp = sprintf( "%02d", $_  * 15);
                $Minute{$_ * 15} = $Tmp;
            }
I changed "59" to "3" and add "* 15" after $_. Now the only listing minutes are "00, 15, 30, and 45"
Other options:
1, * 30 (00, 30)
5, * 10 (00, 10, ... 50)
11, * 5 (00, 05, 10, ... 55)

Edit: I cheated a bit. The current minute is added as an option to "fix" the pending offset, in addition to the other minute breaks you might have.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Mike_B
Moderator
Posts: 266
Joined: 12 Jan 2010, 18:16
Znuny Version: CVS HEAD

Re: How to change/shorten the minute dropdown list

Post by Mike_B »

Actually, I like this very much and I can see how it would be helpful, for instance when you need to set pending time.

In some other cases, you might want to have the freedom of choosing any exact time. To top it off, I can see how you can have a drop-down with some action that says "show all minutes" or so, so by default you only have 00, 15, 30, 45 but if you click this button you'll have the full 00...59 range.
huntingbears.nl - @michielbeijen on Twitter
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to change/shorten the minute dropdown list

Post by crythias »

Can you give me any case where you need granularity finer than 5 minutes that it matters? The code covers exact minute for pending times, as well as giving the increment of choice. eg: (0, 11, 15, 30, 45).

1 minute (or even 5) is a high level of precision for help desk support.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Post Reply