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

[MOD] Age of Tickets (Minutes, Hours, or Days)

2

Comments

  • Dutchie,

    Looks like you were missing a portion from the qfrom:

    ' LEFT JOIN '.STAFF_TABLE.' staff ON ticket.staff_id=staff.staff_id';


    This was present from webpragmatists "Assigned To" MOD.

    I have added it to my code on the first page now so if you just try the mod again now with the updated code you should be good to go.

    Anyone else that was getting staff.firstname (or lastname) running RC5 should be good to go if you implement the code again now that its been updated.

    Sorry for the confusion.
  • is their a working version for RC4 not 5?
  • Nope, sorry. I've never worked with RC4 as I came on the scene right as RC5 was released.
  • I just had to upgrade from RC5 to RC6 in order for this mod to work straight from this thread. So far, so good. Thank you! :D
  • help making the mod

    Good morning Scottro,

    I would really like to add this modification, having the colour coded age of the calls, along with call assignee would be brilliant.

    I tried following your instructions, but failed. I am a noob to all things php & apache, so suspect I am doing something stupid.

    You offered to make the changes to another forum member, and have attached the copy of my tickets.inc.php to this message (though it is a fresh install with no other mods) in hope that you might spare the time it would take you to mod this file & post it back.

    Many thanks,
    John.
    tickets.inc.zip
    6K
  • Good to go

    I just took your file and put it on my test server then added the mod and the color and it should be good to go.
    MODDED_tickets.inc.php.zip
    7K
  • That has got the call age in colour working, which is brilliant.

    It doesn't have the 'assigned to' column, but looking at the code (with my feeble mind) it looks like it should.

    Ideally I would like the 'assigned to' column to replace the department column (it hasn't much point in a school).

    Attached is a screenshot of how it currently looks.

    Many thanks,
    John.
    1.jpg
    957 x 487 - 55K
  • I too would love to see the assigned to column added I have tried on my own with no luck any way you can share this as well?

    Great mod btw!

    Thanks-
    Khris
    John Oak;10567 said:
    That has got the call age in colour working, which is brilliant.

    It doesn't have the 'assigned to' column, but looking at the code (with my feeble mind) it looks like it should.

    Ideally I would like the 'assigned to' column to replace the department column (it hasn't much point in a school).

    Attached is a screenshot of how it currently looks.

    Many thanks,
    John.
  • Cool,

    I'll take a look at it tomorrow and come up with something for you guys when I have some time.
  • I have actually got it working all except for the closed ticket issue. It looks like the update statment sets the staff_id=0 when it should leave it alone...however if you take that part out of the update statement then the ticket still stays on your my ticket tab. I am wondering my way through the code now trying to figure out how to fix that but if you know please let me know...

    Thanks again-
    khris
    scottro;10691 said:
    Cool,

    I'll take a look at it tomorrow and come up with something for you guys when I have some time.
  • gottoast;10722 said:
    I have actually got it working all except for the closed ticket issue. It looks like the update statment sets the staff_id=0 when it should leave it alone...however if you take that part out of the update statement then the ticket still stays on your my ticket tab. I am wondering my way through the code now trying to figure out how to fix that but if you know please let me know...

    Thanks again-
    khris
    What does your original case 'assigned' look like in include/staff/tickets.inc.php

    I believe the following is the code for showing which tickets are assigne to that person:
        case 'assigned':
    //$status='Open'; //
    $staffId=$thisuser->getId();
    break;


    If you have something different then I would change it to this. Otherwise let me know and I'll keep digging.
  • It was requested of me that I combine the "Assigned To" MOD along with my own MOD "Age of Tickets". As I'm tired of updating multiple places for both of these MODs I have set them up over at my own site. Please see the following article and request assistance there.

    http://tinyurl.com/age-assigned

    Thank you,
    Scott
  • gottoast;10722 said:
    I have actually got it working all except for the closed ticket issue. It looks like the update statment sets the staff_id=0 when it should leave it alone...however if you take that part out of the update statement then the ticket still stays on your my ticket tab. I am wondering my way through the code now trying to figure out how to fix that but if you know please let me know...

    Thanks again-
    khris
    Khris,

    I have found the solution for it and include it in my page (see above link). You can also look at the article simply for "Assigned To" (also on my page) for a little less lengthy article as it doesn't include all the Age of Tickets information. In either case the last several paragraphs all guide you through fixing this.
  • I have updated the color coding to be varied on when the ticket was entered AND on the priority.


    <td class=\"nohover\" align=\"center\" style=\"background-color:
    <?
    $priority =$row['priority_urgency'];
    $colorlow=\"#33FF66\";
    $colormed=\"#FFFF66\";
    $colorhigh=\"#FF745A\";
    $diff=$row['timeopen'];
    If ($priority == 1) { // Emergency
    if ($diff <= 60){ // 1 hour or less
    print ($colorlow);
    }
    elseif ($diff > 60 && $diff < 240){ // 1 to 4 hours
    print ($colormed);
    }
    elseif ($diff >= 240){ // more than 4 hours
    print ($colorhigh) ;
    }
    }
    If ($priority == 2) { // High
    if ($diff <= 720){ // 12 hours or less
    print ($colorlow);
    }
    elseif ($diff > 720 && $diff < 1440){ // 12 to 24 hours
    print ($colormed);
    }
    elseif ($diff >= 1440){ // 1 day or more
    print ($colorhigh) ;
    }
    }
    If ($priority == 3) { // Normal
    if ($diff <= 1440){ // 1 day or less
    print ($colorlow);
    }
    elseif ($diff > 1440 && $diff < 5760){ // 1 to 4 days
    print ($colormed);
    }
    elseif ($diff >= 5760){ // 4 days or more
    print ($colorhigh) ;
    }
    }
    If ($priority == 4) { //Low
    if ($diff <= 10080){ // 7 day or less
    print ($colorlow);
    }
    elseif ($diff > 10080 && $diff < 20160){ // 7 to 14 days
    print ($colormed);
    }
    elseif ($diff >= 20160){ // 14 days or more
    print ($colorhigh) ;
    }
    }
    ?>\"
    >
  • question

    nimda79,
    What file does this need to be applied in and where? I'm running 1.6ST. From the date of your post I assume you are as well? Thanks!

    Kevin
  • Modified base install files (for both 1.6ST & 1.6RC5) have been added to the "Age of Tickets & Assigned To" MOD page on my website at the following link:

    http://sudobash.net/hacks-a-mods/osticket/71-qassigned-toq-and-qage-of-ticketsq.html

    The Age of Tickets MOD is the non-Color version.
  • Files and code for this MOD have been updated on my site in the following locations:

    http://sudobash.net/hacks-a-mods/osticket/51-age-of-tickets.html

    http://sudobash.net/hacks-a-mods/osticket/71-qassigned-toq-and-qage-of-ticketsq.html

    Major change is that the Age no longer quits out at "> 35 days". This will also show the correct full days since the ticket was opened on the Closed tab instead of the age of the ticket when it was closed.
  • I have some tickets which the age is superior than 35 days (yes, efficiency...).

    But if the age is superior to 35 days, OsTicket only shows "35 days". Even if the ticket is open for 134 days.

    Is someone already has this problem ?

    Thanks a lot !

    (and thanks for your mod ;-) )
  • mal1n;18265 said:
    I have some tickets which the age is superior than 35 days (yes, efficiency...).

    But if the age is superior to 35 days, OsTicket only shows "35 days". Even if the ticket is open for 134 days.

    Is someone already has this problem ?

    Thanks a lot !

    (and thanks for your mod ;-) )
    Are you using the latest code from here:
    http://osticket.com/forums/showpost.php?p=16602&postcount=48

    That fixed the issue of the 35 days.
  • Oops. No.

    Apologize.

    You can beat me to death.

    Thanks a lot (really !).
  • scottro;18271 said:
    This will also show the correct full days since the ticket was opened on the Closed tab instead of the age of the ticket when it was closed.
    Okay, thanks for the lastest code.

    But I've a question again :

    If I want the age of the ticket when it was closed ? :D
  • mal1n;18289 said:
    Okay, thanks for the lastest code.

    But I've a question again :

    If I want the age of the ticket when it was closed ? :D
    You want that in the tooltip instead of the message/response? Or you want that in the "Age" column of the list or?
  • I want it in the in the "Age" column of the list.

    Like in the first version of your code, in the beginning of this topic.
  • Reset age of ticket

    Thanks for the great mod.

    Question.

    Is there a way to reset the age of ticket when a staff member replies to the ticket?

    Example Currently on my system:
    I have a ticket that's 5 days old.
    I reply to the ticket.
    Ticket still shows that it's 5 days old.

    So the issue when we have 50+ tickets, an i reply to a ticket, i have no idea if it's been replied due to the ticket age not replying.

    Thanks for any help :)
  • alenz;18598 said:
    Thanks for the great mod.

    Question.

    Is there a way to reset the age of ticket when a staff member replies to the ticket?

    Example Currently on my system:
    I have a ticket that's 5 days old.
    I reply to the ticket.
    Ticket still shows that it's 5 days old.

    So the issue when we have 50+ tickets, an i reply to a ticket, i have no idea if it's been replied due to the ticket age not replying.

    Thanks for any help :)
    It would take some coding but you could set it to where if there is a reply or message time then it could base it off of that instead of the original creation date. That way it would compare "now" to "last response" or "last message". But last response and last message are two different things so you would also need to compare to see which is newer and then compare now to that one. ...so like I said...it'd take some coding ;) But it would certainly be possible.
  • Problem with age

    Hi,

    I have a following problem when in staff panel all the age are displayed wrongly, one was created yesterday and it showed 7 hours not 1 day as it should have and another it showed 0 min. and it should have showed 2 hours. I'm using the following date format d/m/Y H:i in admin settings.

    * Found the answer from your web site, they were closed tickets that was the reason.
  • Hi

    Can anyone help! I am unsure as to where this particular code is inserted or what it replaces if anything. Can you advise please.

    Many thanks.



    <?
    $diff =$row['timeopen'];
    $min = "min";
    $mins = "mins";
    $hours = "hours";
    $hour = "hour";
    $day = "day";
    $days = "days";
    if ( $diff <= 1 ){
    print ($diff . " " . $min);
    }elseif ( $diff > 1 && $diff <= 59 ){
    print ($diff . " " . $mins);
    }elseif ( $diff >= 60 && $diff <= 119 ){
    $diff = round($diff / 60);
    print (1 . " " . $hour);
    }elseif ( $diff >= 120 && $diff <= 1439 ){
    $diff = round($diff / 60);
    print ($diff . " " . $hours);
    }elseif ( $diff >= 1440 && $diff <= 2879 ){
    print (1 . " " . $day);
    }elseif ( $diff >= 2880 ){
    $diff = round($diff / 1440);
    print ($diff . " " . $days);
    }else {};
    ?>
  • yogiman.uk;21349 said:
    Hi

    Can anyone help! I am unsure as to where this particular code is inserted or what it replaces if anything. Can you advise please.

    Many thanks.



    <?
    $diff =$row['timeopen'];
    $min = "min";
    $mins = "mins";
    $hours = "hours";
    $hour = "hour";
    $day = "day";
    $days = "days";
    if ( $diff <= 1 ){
    print ($diff . " " . $min);
    }elseif ( $diff > 1 && $diff <= 59 ){
    print ($diff . " " . $mins);
    }elseif ( $diff >= 60 && $diff <= 119 ){
    $diff = round($diff / 60);
    print (1 . " " . $hour);
    }elseif ( $diff >= 120 && $diff <= 1439 ){
    $diff = round($diff / 60);
    print ($diff . " " . $hours);
    }elseif ( $diff >= 1440 && $diff <= 2879 ){
    print (1 . " " . $day);
    }elseif ( $diff >= 2880 ){
    $diff = round($diff / 1440);
    print ($diff . " " . $days);
    }else {};
    ?>
    <td align=\"center\" nowrap><?=Format::db_date($row['created'])?></td>


    Gets replaced by the above.
  • Great mod!

    Thanks OP, excellent mod. Drives home priorities very well.
  • is that any possible that i can store the timeopen inside my database (ticket_table) ?

    pls help..
Sign In or Register to comment.