Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Can Grace Period for SLA be set in minutes instead of hours?

We have a need to mark tickets overdue if they have exceeded a certain number of minutes, five minutes, rather than hours. Is there a way of doing that? 

Comments

  • There is no way to do that in the ui currently.

    You could probably achieve this by altering the core source files, but I have no idea where you would want to even start to do that.
  • Thanks ntozier. I kind of figured that would be the case and I was hoping someone might be able to point me in the right direction in the code. 
  • You could probably edit the timeDropdown function in include/class.misc.php.

    Around line 141 (1.10RC2),


        function timeDropdown($hr=null, $min =null,$name='time') {
            global $cfg;

            $hr =is_null($hr)?0:$hr;
            $min =is_null($min)?0:$min;

            //normalize;
            if($hr>=24)
                $hr=$hr%24;
            elseif($hr<0)
                $hr=0;

    // bof robbie
            if($min>=55)
                $min=55;
            elseif($min>=50)
                $min=50;
            elseif($min>=45)
                $min=45;
            elseif($min>=40)
                $min=40;
            elseif($min>=35)
                $min=35;
            elseif($min>=30)
                $min=30;
            elseif($min>=25)
                $min=25;
            elseif($min>=20)
                $min=20;
            elseif($min>=15)
                $min=15;
            elseif($min>=10)
                $min=10;
            elseif($min>=5)
                $min=5;
            else
                $min=0;
    // eof robbie

            ob_start();
            echo sprintf('<select name="%s" id="%s" style="display:inline-block;width:auto">',$name,$name);
            echo '<option value="" selected>'.__('Time').'</option>';
            for($i=23; $i>=0; $i--) {
                for($minute=55; $minute>=0; $minute-=5) {   // robbie
                    $sel=($hr==$i && $min==$minute)?'selected="selected"':'';
                    $_minute=str_pad($minute, 2, '0',STR_PAD_LEFT);
                    $_hour=str_pad($i, 2, '0',STR_PAD_LEFT);
                    $disp = Format::time($i*3600 + $minute*60 + 1, false, false, 'UTC');
                    echo sprintf('<option value="%s:%s" %s>%s</option>',$_hour,$_minute,$sel,$disp);
                }
            }
            echo '</select>';
            $output = ob_get_contents();
            ob_end_clean();

            return $output;
        }

  • Sory, do you solved this case ?

    If yes, how do you do ?

    Thanks
  • Unfortunately the person who posted hasn't been active for over a year. Let's hope someone answers your own thread that you opened @Sherq123. I am guessing your grace period to minutes was for SLA? 
Sign In or Register to comment.