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

A better ticket list!

135678

Comments

  • Hey ismannen, I have the instructions posted here: http://www.msrltech.com/support/dev/index.php/Ticket_Status_Mod.  1.8.1 works the same way and the 1.8.0 instructions work for it.  I still have to look at the ticket queue but I have checked everything else.
  • @rowland25 

    thank you. i am folowing you on wour wiki. the work you do is so good. 

    :-)
  • I updated the Ticket Queue View section.  If you want to add new columns to the ticket queue, take a look here:
  • @rowlandan25

    Thank you gonna check it out after work today. 
  • @rowlandan25

    i must have missed something ... my ticket staus field is getting blank. 




  • forogto to say, i can se the statuses in the tickets so its there. 
  • So I realize that I am a moron and did not actually post the instructions for the status mod.  I will get those up after I get done with work!
  • and i am an moroon to as i can only follow instructions ..... 


    no realy ... its realy cool ...
  • ismannen,


    Let me know how it works (I think I grabbed all of my changes).  If it doesn't work let me know and I will fix them.

    Thanks!

    Andy
  • i made a new try today. i removed everything i had done. 

    after i now do first step it brakes(not sure if i spelled this one correct)  every thing.

    i am now uploading all the files again to make a new try now. 

    i give you a haeds up in 20 min or something after i have tried step 1 again. 
  • ok that was me... first step i now ok for me again :-)

  • its works fine before this step here. but after this it font show any ticket any more. 
    This part here is breaks it for me. 


    Ticket Status (Custom Mod)

    The ticket status mod is a little more in-depth to get the status to view on the queue. For this one, we need to add a bit of PHP to grab information that we have saved in the CONFIG table (the field that holds the status), then we need to update the $qselect and the $qfrom statements.

    I recommend finding the statements that look like this:

    $qselect ='SELECT ticket.ticket_id,lock_id,`number`,ticket.dept_id,ticket.staff_id,ticket.team_id '
        .' ,user.name'
        .' ,email.address as email, dept_name '
             .' ,ticket.status,ticket.source,isoverdue,isanswered,ticket.created ';
    
    $qfrom=' FROM '.TICKET_TABLE.' ticket '.
           ' LEFT JOIN '.USER_TABLE.' user ON user.id = ticket.user_id'.
           ' LEFT JOIN '.USER_EMAIL_TABLE.' email ON user.id = email.user_id'.
           ' LEFT JOIN '.DEPT_TABLE.' dept ON ticket.dept_id=dept.dept_id ';
    

    And replace them with these statements:

    $qstatus = 'SELECT value FROM '.CONFIG_TABLE.' WHERE namespace="module" AND `key`="status_field"';
    $res = db_query($qstatus);
    list($val)=db_fetch_row($res);
    
    $qselect ='SELECT ticket.ticket_id,lock_id,ticketID,ticket.dept_id,ticket.staff_id,ticket.team_id '
            .' ,user.name'
            .' ,email.address as email, dept_name '
            .' ,ticket.status,ticket.source,isoverdue,isanswered,ticket.created '
            .' ,IFNULL(at.value, "No Status") as modstatus';
    
    $qfrom= ' FROM '.TICKET_TABLE.' ticket'.
            ' LEFT JOIN '.USER_TABLE.' user ON user.id = ticket.user_id'.
            ' LEFT JOIN '.USER_EMAIL_TABLE.' email ON user.id = email.user_id'.
            ' LEFT JOIN '.DEPT_TABLE.' dept ON ticket.dept_id=dept.dept_id '.
            ' LEFT JOIN '.FORM_ENTRY_TABLE.' et ON et.object_id=ticket.ticket_id AND et.object_type="T"'.
            ' LEFT JOIN '.FORM_ANSWER_TABLE.' at ON at.entry_id=et.id AND at.field_id='.$val;
    

    Notice, I did a couple of things here. First, I told the system to look and see if at.value (the status) was null, and if it was, instead save "No Status". This will display in your ticket view for any ticket created pre-implementation of this mod. Second, on the LEFT JOINs, I included the ENTRY_TABLE, but only for those rows with the object_type of T (those entries are the only ones that hold custom field data), and for the ANSWER_TABLE I told it to grab only those with fields that equal my stored value (which was grabbed by the first couple lines of this addition). This way, I grab the ticket status, but if one does not exist, I still display something.

    Finally, we have to modify that <td></td> in the row data. In between this element, add the following code:

      <?php echo $row['modstatus'];?>
    

    This should make it look like this:

      <td><?php echo $row['modstatus'];?></td>


    here you can see what i have done in the file









  • here is the file beofre we do the last part. it looks good here. but with blank fields. 

  • andi  got DB error 


    [SELECT ticket.ticket_id,lock_id,ticketID,ticket.dept_id,ticket.staff_id,ticket.team_id  ,user.name ,email.address as email, dept_name  ,ticket.status,ticket.source,isoverdue,isanswered,ticket.created  ,IFNULL(at.value, "No Status") as modstatus ,IF(ticket.duedate IS NULL,IF(sla.id IS NULL, NULL, DAT

    Unknown column 'ticketID' in 'field list'<br />
    <br />
    ---- Backtrace ----<br />
    #0 (root)/include/mysqli.php(157): osTicket->logDBError('DB Error #1054', '[SELECT ticket....')<br />
    #1 (root)/include/staff/tickets.inc.php(261): db_query('SELECT ticket.t...')<br />
    #2 (root)/scp/tickets.php(643): require_once('/home/icebaby/w...')<br />
    #3 (root)/scp/index.php(17): require('/home/icebaby/w...')<br />
    #4 {main}
  • Hey ismannen,

    I am assuming with that error you are running 1.8.1.  Take a look at this update I had added:

    I ran into that issue when I was testing as well.  In 1.8.1 they removed ticketID from the ticket table.  All you need to do is remove ticketID from your list and you are good to go.
  • I hope I made it more clear in my instructions the difference between the 1.8.1 and 1.8.0 $qselect statements (it is the only thing that breaks between the two versions).
  • @rowlandan25

    i con not figure this out. 

    when i do this 

    $qselect ='SELECT ticket.ticket_id,lock_id,`number`,ticket.dept_id,ticket.staff_id,ticket.team_id '
        .' ,user.name'
        .' ,email.address as email, dept_name '
             .' ,ticket.status,ticket.source,isoverdue,isanswered,ticket.created, topic.topic ';
    
    
    $qfrom=' FROM '.TICKET_TABLE.' ticket '.
           ' LEFT JOIN '.USER_TABLE.' user ON user.id = ticket.user_id'.
           ' LEFT JOIN '.USER_EMAIL_TABLE.' email ON user.id = email.user_id'.
           ' LEFT JOIN '.DEPT_TABLE.' dept ON ticket.dept_id=dept.dept_id ';
    

    And replace them with these statements:

    $qstatus = 'SELECT value FROM '.CONFIG_TABLE.' WHERE namespace="module" AND `key`="status_field"';
    $res = db_query($qstatus);
    list($val)=db_fetch_row($res);
    
    <pre>
    $qselect ='SELECT ticket.ticket_id,lock_id,`number`,ticket.dept_id,ticket.staff_id,ticket.team_id '
        .' ,user.name'
        .' ,email.address as email, dept_name '
             .' ,ticket.status,ticket.source,isoverdue,isanswered,ticket.created, topic.topic '
            .' ,IFNULL(at.value, "No Status") as modstatus';
    
    $qfrom=' FROM '.TICKET_TABLE.' ticket '.
           ' LEFT JOIN '.USER_TABLE.' user ON user.id = ticket.user_id'.
           ' LEFT JOIN '.USER_EMAIL_TABLE.' email ON user.id = email.user_id'.
           ' LEFT JOIN '.DEPT_TABLE.' dept ON ticket.dept_id=dept.dept_id '.
            ' LEFT JOIN '.FORM_ENTRY_TABLE.' et ON et.object_id=ticket.ticket_id AND et.object_type="T"'.
            ' LEFT JOIN '.FORM_ANSWER_TABLE.' at ON at.entry_id=et.id AND at.field_id='.$val;
    here i just copy and paste you code over the old code. Then everythings brakes. 

  • I might see the issue.  I have a rogue <pre> statement in the code (under list($val)=db_fetch_row($res)).  Remove that <pre> statement and see if it fixes it.

    If it does not, could you include any database errors you are getting and attach a copy of your Web Server error logs?

  • @rowlandan25

    and there it worked. !!

    i am litle bit scared to ask this. the color mod you gonna do that part later ? 
  • and if anyone whant this mod fast ... here is the files you need finish!
    there is no other mod in this files.

  • I'll be working on the color mod next.  I wanted to add a little bit more functionality to it (change both the background and foreground colors) so that more color options can be used - as well as a couple different options for displaying.
  • Hey everyone,

    I found a small bug on my production site and got it fixed.  What I noticed was if you have a help topic that has another form, the sql statement I modified would get two results (one for each form), and wouldn't necessarily grab the right one for the status.  I updated this to ensure it was looking at the form that held the status (looking at the form_id and field_id).

    I updated the instructions and also put this in the change log: http://www.msrltech.com/support/dev/index.php/Modify_Ticket_Queue_View#Change_Log
  • Hey Everyone, great news!  I think it is done.  I have updated the Ticket Status mod and it includes three parts now, the ticket status, the ticket queue view (so you can see the status in your ticket queue) and the status color mod (so you can change your status's colors).  I have posted instructions here: http://www.msrltech.com/support/dev/index.php/Ticket_Status_Mod_v1.2 on how to install the mod.  Right now the instructions only include if you are just going to copy and paste the files onto your server (which the final files are provided!), but I am hoping by noon (about an hour and a half from now) I will have the instructions done in case you have other mods already installed.

    If you do throw this mod on your server, even if you had one of the previous renditions of the mod, you will have to run through the install real quickly.  I looked into the OSTicket $cfg variable and found how awesome it truly and so I had to make a couple of changes to include it (and make the mod even better). 

    I hope you guys enjoy it and by all means, let me know if you find any bugs or have any other requests/comments.

    Andy
  • @rowlandan25

    thank you for the good mod.  it was very easy to deploy!

    the colors are working greate..... :-)

    i can`t figure out the the shape thingi. it says oval i active but still i get full colored square.



    mod1.jpg
    1928 x 1048 - 270K
    mod2.jpg
    1928 x 1048 - 313K
    mod3.jpg
    1928 x 1048 - 402K
  • @ismannen

    Do any of the other shapes work?  They should all have the border around them.  usually when i ran into this issue there was a problem with the CSS (and it got rid of most of it).  If the other shapes don't work, you mind getting the page source so I can look how the inline CSS is?

    Thanks!

    Andy
  • @rowlandan25

    no i cant get any of the shapes to work 

    what file you need ? 
  • If you right click on the page when you are looking at the ticket view, go down to "View Page Source".  Copy that into a text file for me and shoot me an email or post it here.  I just want to see what's going on with the source.
  • Actually, I was able to replicate it copying down the files from the server.  There is an error in the code that I posted.  Let me look at it and find the issue.  I will let you know when I have it fixed!
  • @ismannen

    Go to your include/staff/tickets.inc.php file and find this line:

    <td align="center" style="vertical-align:middle;"><div id='status' style='background-color:<?php echo $row['bgcolor'];?>; color:<?php echo $row['f....

    In the <div>, change id='status' to class='status'

    I made this change and it fixed the issue.  I originally used the id for the css but changed it to a class so that I could do the pre-save color update on the admin side.

    Thanks for finding this!

    Andy
Sign In or Register to comment.