Help Desk Software & Beyond
August 22, 2017, 01:45:16 AM *
Welcome, Guest. Please login or register.
To post messages you need to register. We apologize for inconvenience, but this is to prevent spam.
Registration is instant (no email verification) and we do not ask for any personal information.

Login with username, password and session length
News: Welcome to Help Desk Software forum!
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: [MOD] 'Ticket Status HOLD' (TTX v 3.0 and down)  (Read 51254 times)
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« on: September 22, 2007, 06:29:24 PM »

Based on a request in another thread...

https://forum.unitedwebcoders.com/index.php/topic,352.msg1548.html#msg1548

here are the modifications to make it all happen...

As usual, you might have to add some labels to your dictionary file, dict.csv.

Also, this was originally installed in version 2.21 and then applied to 2.24 without a problem.  It could work in any version containing code similar to below.


1.  In TTXCommon.pm, at the top.  Comment out (#) blue lines to the original stuff for your reference and add the new red stuff.  These names can be whatever you want, just don't change the three letter codes unless you know what you're doing.

Quote
my %id2name = (
#  PND => 'Pending',
#  OPN => 'Open',
#  WFR => 'Responded',
#  '(OPN|WFR)' => 'Active',
#  '(PND|OPN|WFR)' => 'Not solved',
#  '(OPN|PND)' => 'Hot',
#  CLS => 'Solved'

  PND => 'New',
  OPN => 'Pending',
  WFR => 'In Progress',
  '(PND|OPN|WFR)' => 'Active',
  '(PND|OPN|WFR|HLD)' => 'Open',
  CLS => 'Closed',
  HLD => 'HOLD'

);

2.  In TTXDesk.pm, in the helpdesk section.  Find/remove blue and add red.  These must match how they are defined in step 1 above.  The order is how they're listed in the menu.

Quote
foreach my $status ('(OPN|PND)', 'PND', 'OPN', 'WFR', '(OPN|WFR)', 'CLS', '(PND|OPN|WFR)') {
foreach my $status ('PND', 'OPN', 'WFR', '(PND|OPN|WFR)', 'HLD', 'CLS', '(PND|OPN|WFR|HLD)') {

3.  In TTXTicket.pm, in the ticket section.  Find blue lines (do NOT remove) and ADD red.  In this general section, you can find everything to tweak your ticket status radio buttons.

Quote
if ($t->{status} ne 'CLS') {
    $data->{NEWSTATUS} .= "<input type=radio name=newstatus value=CLS";
    if ($query->param('newstatus') eq 'CLS') { $data->{NEWSTATUS} .= ' checked'; }
    $data->{NEWSTATUS} .= '> [%Closed%]<br>'."\n";
  }

# Added a HOLD option for all users
    if ($t->{status} ne 'CLS' && $t->{status} ne 'HLD') {
    $data->{NEWSTATUS} .= "<input type=radio name=newstatus value=HLD";
    if ($query->param('newstatus') eq 'HLD') { $data->{NEWSTATUS} .= ' checked'; }
    $data->{NEWSTATUS} .= "> Hold<br>\n";
    }
# Added a Remove HOLD option for operators only
    if (($t->{status} ne 'CLS' && $t->{status} eq 'HLD') && $isoper) {
    $data->{NEWSTATUS} .= "<input type=radio name=newstatus value=WFR";
    if ($query->param('newstatus') eq 'WFR') { $data->{NEWSTATUS} .= ' checked'; }
    $data->{NEWSTATUS} .= "> Remove Hold<br>\n";
    }
# end

4.  In TTXDesk.pm, in the helpdesk section.  Find blue lines (do NOT remove) and ADD red.  In this general section, you can find everything to tweak the buttons which appear under the list of tickets in the help desk.  These changes add buttons to add/remove hold status from the list view.  With minor changes, you could create macros to get the button labels from the dictionary file just like the button label in the blue line below.

Quote
$data->{TICKETLIST} .= "<td align=left><input type=submit name=close value=\"".'[%Close selected%]'."\" ".
                             "onclick=\"return confirm('".'[%This will close selected tickets. Please confirm.%]'."')\");\" class=sm>\n";

# added Hold button to ticket list                             
      $data->{TICKETLIST} .= "&nbsp;<input type=submit name=hold value=\"Place HOLD\" class=sm>\n";
 
# added Remove Hold button to ticket list                             
      $data->{TICKETLIST} .= "&nbsp;<input type=submit name=rhold value=\"Remove HOLD\" class=sm>\n";
# end

5.  In TTXGrpCmd.pm, in the "do" section.  Find blue lines (do NOT remove) and ADD red.  This part actually changes the status when you use the buttons from step 4.

Quote
      } elsif ($query->param('close') ne undef) {
        my $t = $tickets->ticket($tid);
        next if $t eq undef;
        if ($t->{status} ne 'CLS') {
          if ($t->{oper} eq undef) {
            $t->{oper} = $userid;
          }
          $t->{status} = 'CLS';
          $t->{updated} = time();
          $t->{closed} = $t->{updated};
          TTXCommon::logit("CLOSE|$userid|".$t->{id});
          $update = 1;
        }

# added Place Hold to ticket list buttons
      } elsif ($query->param('hold') ne undef) {
        my $t = $tickets->ticket($tid);
        next if $t eq undef;
        if ($t->{status} ne 'HLD') {
          $t->{status} = 'HLD';
          $update = 1;
        }
# added Remove Hold to ticket list buttons
      } elsif ($query->param('rhold') ne undef) {
        my $t = $tickets->ticket($tid);
        next if $t eq undef;
        if ($t->{status} eq 'HLD') {
          $t->{status} = 'WFR';
          $update = 1;
        }
# end

... and here...

Quote
$query->param(-name => 'tid', -value => '');
  $query->param(-name => 'del', -value => '');
  $query->param(-name => 'close', -value => '');
  $query->param(-name => 'assign', -value => '');

# added Place Hold to ticket list buttons
  $query->param(-name => 'hold', -value => '');

Nothing to edit in the HTML templates.


That's it.

Good luck and let me know how you like it.
« Last Edit: February 14, 2009, 09:12:37 PM by Sparky » Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Sam
Jr. Member
**

Karma: 4
Posts: 92


View Profile
« Reply #1 on: September 22, 2007, 06:38:22 PM »

Thank you!!

I will test this on my system as some point in the future and let you know.  I have the MySQL version, so I don't know if that is going to cause any complications.
Logged
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #2 on: September 22, 2007, 07:08:40 PM »

I have the MySQL version, so I don't know if that is going to cause any complications.

I don't believe so.

None of the edited sections contains code which depends on the database version.  They seem to call subroutines which handle that separately.

Code was merely added which was very similar to what was already there.  Additional "else if" statements added to a list, changes to various conditions already in place, label & wording changes, etc.
« Last Edit: September 22, 2007, 07:14:19 PM by sparky672 » Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Sam
Jr. Member
**

Karma: 4
Posts: 92


View Profile
« Reply #3 on: October 17, 2007, 10:16:21 AM »

Hi,

I have implemented this on my system - really cool mod!

I just thought I'd point out the next section:

Quote
# Added a Remove HOLD option for admin only
    if (($t->{status} ne 'CLS' && $t->{status} eq 'HLD') && $isoper) {

as it was slightly confusing for me.  The "for admin only" does not mean the admin user, but rather any operator.  This only prevents "customers" from taking a ticket off hold.

Regards,

Sam
Logged
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #4 on: October 17, 2007, 10:23:31 AM »

Hi,

I have implemented this on my system - really cool mod!

I just thought I'd point out the next section:

Quote
# Added a Remove HOLD option for admin only
    if (($t->{status} ne 'CLS' && $t->{status} eq 'HLD') && $isoper) {

as it was slightly confusing for me.  The "for admin only" does not mean the admin user, but rather any operator.  This only prevents "customers" from taking a ticket off hold.

Regards,

Sam

Thank-you!  Glad to hear you like it.

You are correct.  My sloppy comments applied to my situation where admin = operator.
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
neva
Newbie
*

Karma: 0
Posts: 30


View Profile
« Reply #5 on: October 18, 2007, 05:11:22 AM »

Hi all,

Do youo know if it's change something with the reports ?
Logged
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #6 on: October 18, 2007, 11:18:59 AM »

Hi all,

Do youo know if it's change something with the reports ?

It still functions if that's what you mean?

The reports look at status, so depending on what specifically you're concerned about, the reports module can be easily adjusted...

In TTXReports.pm

line 229:  It matches the old status list, Hot -(OPN|PND), Pending -PND, Open -OPN, Responded -WFR, Active -(OPN|WFR), Solved -CLS, & Not Solved -(PND|OPN|WFR) so you could just change these three letter codes to match your new status list.  SAME as step #2 in the first post of this thread.

Quote
foreach my $status ('(OPN|PND)', 'PND', 'OPN', 'WFR', '(OPN|WFR)', 'CLS', '(PND|OPN|WFR)') {

line 529:  Status "CLS|WFR" is how the module defines the Operator Performance Report.  That's "Solved" - CLS & "Responded" - WFR.  Edit it to change how you'd define your "Operator Performance" Report.

Quote
my $cond = {col => 'status', expr => '^(CLS|WFR)$'};

line 944:  Status "PND|OPN" is how the module defines the Aging Report.  (PND|OPN) is the combo code for the "Hot" status.  Edit it to change how you'd define your "Aging" Report.

Quote
my $cond = { 'col' => 'status', 'expr' => '^(PND|OPN)$' };


Everything else in the reports module just looks at Solved (CLS) tickets.

Thank-you for pointing this out.
« Last Edit: October 18, 2007, 11:35:27 AM by sparky672 » Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
neva
Newbie
*

Karma: 0
Posts: 30


View Profile
« Reply #7 on: October 19, 2007, 02:28:31 AM »

Thank you sparky,

I was looking for a solution to store the time spent on a particulary status. Like a report saying how many times is spent for a status.

Exemple:
Ticket XXX
Hold:  5 hours
Open: 10 sec
Active: 12 hours:
Total: 17hours10sec.

I'm working on this...
« Last Edit: October 19, 2007, 02:33:35 AM by neva » Logged
Robert E. Singer
Newbie
*

Karma: 0
Posts: 3


View Profile
« Reply #8 on: October 30, 2007, 12:56:17 PM »

hi -

i'd like to extend or redefine the ticket statuses commensurate with our organization's needs:

new - ticket has just been created
accepted - owner has received and accepted the ticket
cancelled - ticket has been cancelled
duplicate - ticket is a duplicate and has been cancelled
hold - ticket is on hold, pending completion of other task(s)
more info - ticket is on hold, pending receipt of additional information
in process - ticket resolution is underway
monitor - need to monitor for future occurrences.  no other work can be done until issue is better characterized
pending - work on ticket is done but installation of the fix or visibility to customer is pending
done - ticket has been completed

there is some overlap between some statuses and some may be skipped, e.g. "new" to "in process", skipping "accepted."  "accepted" would be an acknowlegement of receipt of the ticket, but work hasn't necessarily begun.

i have read the previous items in this thread and made some of the modifications.  but the ttx code doesn't have much inline documentation.  can you provide some overview information about the program structure, functions, etc. so i can make modifications in the appropriate places?

i am familiar (but a bit rusty) with perl, cgi, html, javascript & mysql.
« Last Edit: October 30, 2007, 01:05:23 PM by Robert E. Singer » Logged

thx -

bob singer
elite home technology
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #9 on: October 30, 2007, 01:19:35 PM »

can you provide some overview information about the program structure, functions, etc. so i can make modifications in the appropriate places?

That's a very broad question.  I'd be happy to help where I can but more specific questions would be necessary.

This might get you started though:

Recently I did something similar for somebody where they got a whole list of new status's on the ticket page and the operators could choose any.

Here is just a piece of it.  You'd have to define and create the new status's or this is all meaningless...

This is in the TTXTicket.pm in the section where the NEWSTATUS macro is executed.

Quote
if (($t->{status} ne 'CLS') && $isoper) {
     foreach my $status ('OPN', 'MPC', 'MAP', 'FAP', 'SAP', 'TAP', 'WFR', 'QTE', 'SLD', 'CLS') {
        if ($t->{status} ne $status) {
        $data->{NEWSTATUS} .= "<input type=radio name=newstatus class=stats value=".$status.'> '.TTXCommon::status($status).'<br>'."\n";
        }
     }
  }
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Robert E. Singer
Newbie
*

Karma: 0
Posts: 3


View Profile
« Reply #10 on: October 30, 2007, 01:54:03 PM »

sorry for being overly broad.

i implemented steps #1 & #2 in the recipe below, mindful of the caveat about changing the 3-letter codes.

then i searched through the source files looking for references to PND, OPN, WFR & CLS so i can make appropriate changes.  in my scheme, some are eliminated and the meaning changes for others.  when i find references, i cant quite discern how they are being used, so i can do the right thing.

for example, when i searched for PND, i found the following references:

TTXCommon.pm:  PND => 'Pending',
TTXCommon.pm:  '(PND|OPN|WFR)' => 'Not solved',
TTXCommon.pm:  '(OPN|PND)' => 'Hot',

TTXDesk.pm:  foreach my $status ('(OPN|PND)', 'PND', 'OPN', 'WFR', '(OPN|WFR)', 'CLS', '(PND|OPN|WFR)') {
TTXDesk.pm:    my %colormatrix = (PND => 'green', WFR => 'blue', OPN => 'orange', CLS => 'red', LATE => 'red');
TTXDesk.pm:           (($t->{status} eq 'PND' && ($now - $t->{open} > 24*60*60) && !$cfg->get('ignorepending') ) ||
TTXDesk.pm:             $t->{status} ne 'PND' && $t->{'c'.$cfg->get('claimtime')} > 23)) {

TTXFileTickets.pm:  $tik->{status} = 'PND';

TTXGrpCmd.pm:          $t->{status} = 'OPN' if $cfg->get('transferopens') || $t->{status} eq 'PND';

TTXMySQLTickets.pm:  $tik->{status} = 'PND';
TTXMySQLTickets.pm:                  "WHERE (STATUS='OPN' OR STATUS='PND') ".
TTXMySQLTickets.pm:    $sql =~ s/STATUS REGEXP '\^\(OPN\|PND\)\$'/(STATUS='OPN' OR STATUS='PND')/;

TTXReports.pm:  foreach my $status ('(OPN|PND)', 'PND', 'OPN', 'WFR', '(OPN|WFR)', 'CLS', '(PND|OPN|WFR)') {
TTXReports.pm:  my $cond = { 'col' => 'status', 'expr' => '^(PND|OPN)$' };

TTXTicket.pm:      if ($t->{status} eq 'PND' && $isoper) {
TTXTicket.pm:  if ($isoper && $t->{status} ne 'PND') {
TTXTicket.pm:      if ($t->{status} eq 'PND') {

since i'm redefining what pending means, the actions around the pending status should also change.  but since i can't discern the context of a particular piece of code, i can't make appropriate modifications.

did this explanation help?
Logged

thx -

bob singer
elite home technology
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #11 on: October 30, 2007, 02:10:54 PM »

In my status modifications I totally left alone the underlying TTX scheme.  To try to change a 3-letter code into some other 3-letter code is pointless... users don't see these codes.   Just change the label- NOT the underlying function.

PND => 'Pending' (brand new ticket)
OPN => 'Open' (claimed ticket without an operator response)
WFR => 'Responded' (waiting for the customer to respond)
CLS => 'Solved' (closed ticket)

Just leave those codes alone and only change the labels to give more meaning to your operation.

Then you can more easily do three additional things.

1.  Create as many additional 3 letter codes as you like.  This gives users the ability to choose from these status's and gives operators the ability to filter by these status's

2.  Combine 3-letter codes into "pseudo-status's" for ticket filtering purposes.  Example- (PND|OPN|WFR) could be called "active" which is any ticket without a closed (CLS) status.

3.  Optionally add some new programming that does new tricks with the status codes like display radio buttons to toggle any status.  Or give your customer a button to place a ticket on hold.
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #12 on: October 30, 2007, 02:24:34 PM »

sorry for being overly broad.

i implemented steps #1 & #2 in the recipe below, mindful of the caveat about changing the 3-letter codes.

If you mean steps 1 & 2 in my mod.... then just replace step 3 with the code I posted before...

Quote
if (($t->{status} ne 'CLS') && $isoper) {
     foreach my $status ('OPN', 'MPC', 'MAP', 'FAP', 'SAP', 'TAP', 'WFR', 'QTE', 'SLD', 'CLS') {
        if ($t->{status} ne $status) {
        $data->{NEWSTATUS} .= "<input type=radio name=newstatus class=stats value=".$status.'> '.TTXCommon::status($status).'<br>'."\n";
        }
     }
  }

In red would match any valid status code you'd want for a corresponding radio button on the ticket page.  It's written to skip a button for the current status of the ticket.

With some comments...

Quote
## IF ticket status is NOT closed and user is an operator
if (($t->{status} ne 'CLS') && $isoper) {
## Loop through all status's listed here.
     foreach my $status ('OPN', 'MPC', 'MAP', 'FAP', 'SAP', 'TAP', 'WFR', 'QTE', 'SLD', 'CLS') {
## IF the status is NOT the status of the ticket
        if ($t->{status} ne $status) {
## Write a radio button to toggle to that status
  ## TTXCommon changes status code into proper label for button

        $data->{NEWSTATUS} .= "<input type=radio name=newstatus class=stats value=".$status.'> '.TTXCommon::status($status).'<br>'."\n";
        }
     }
  }
« Last Edit: October 30, 2007, 02:35:26 PM by sparky672 » Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #13 on: October 30, 2007, 02:31:14 PM »

since i'm redefining what pending means, the actions around the pending status should also change.

No.  For simplicity leave PND alone.

Just change what PND is called.  PND just means it's a new ticket.

Then for this...

"pending - work on ticket is done but installation of the fix or visibility to customer is pending"

... create a new status with a new 3 letter code (PEN) that you can toggle by implementing what I've been talking about.
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #14 on: October 30, 2007, 02:33:20 PM »

TTXTicket.pm:      if ($t->{status} eq 'PND' && $isoper) {
TTXTicket.pm:  if ($isoper && $t->{status} ne 'PND') {
TTXTicket.pm:      if ($t->{status} eq 'PND') {

... but since i can't discern the context of a particular piece of code, i can't make appropriate modifications.

You do realize that you also left out everything that gives the pieces of code you quoted any context whatsoever?   Wink
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC3 | SMF © 2001-2006, Lewis Media Valid XHTML 1.0! Valid CSS!
Page created in 0.038 seconds with 20 queries.