Change the "Modify Ticket" options on blue bar


#1

To all,

I want to add a couple options to the blue bar where it displays "open 

comments reply resolve". Where would I find that code and any
related elements? thanks in advance.

Kenn
LBNL


#2

At 08:16 PM 5/15/2008, Kenneth Crocker wrote:

To all,

    I want to add a couple options to the blue bar where it 

displays “open
comments reply resolve”. Where would I find that code and any
related elements? thanks in advance.

Kenn
LBNL

Kenn,

These links are defined in html/Ticket/Elements/Tabs. You may be able
to add what you want through a default callback for this element (the
links are stored in a hash called %$actions) or you can definitely
add links directly to the Tabs element itself. Here’s our example, in
the Tabs file itself:

 if ($Ticket->IsOwner($session{CurrentUser})) {
     $actions->{'Bb'} = {path => 

“Ticket/Display.html?Action=Untake&id=” . $Ticket->id,
title => loc(‘Release’) };
}

This gives a link that allows a user to release (or “untake”) a
ticket that they own. The ‘Bb’ identifier places the link between
links ‘B’ and ‘C’ (‘Take’ and ‘Steal’ respectively).

Steve


#3

At 04:04 PM 5/27/2008, you wrote:

Stephen,

    Thanks for the code example. I used it as the basis for the 

code I wanted to add. The “Tabs” layout now shows what I want, but
when I click any of the new options, nothing happens. This is what
my new code looks like:

if ($args) {
$tabs->{“i”} = { path => “Search/Results.html$args”,
title => loc(‘Show Results’),
};
if ($current_tab =~ “Search/Results.html”) {
$current_tab = “Search/Results.html$args”;
};
}

if ( $can{‘ModifyTicket’} ) {
if ( $Ticket->Status ne ‘resolved’ ) {
$actions->{‘G’} = {
path =>
“Ticket/Update.html?Action=Comment&DefaultStatus=resolved&id=” . $id,
title => loc(‘Resolve’) };
}

the following code was added for LBNL

make sure the check for status is in descending order

if  ($Ticket->Status eq 'pending qa')
    {
     $actions->{'Fg'} =
         { path => 

“Ticket/Display.html?Action=DefaultStatus=(‘qa approvd’)&id=” . $id,
title => loc(‘Approve QA’),
};
}

Hi Ken,

Just from a quick look at the code, it looks like you’re on the right
track. I don’t think you need the parentheses or quotes around the
status values - something like:

path => “Ticket/Display.html?Action=DefaultStatus=qa approvd&id=” . $id

As this is going to form a URL, you may need to escape those spaces,
but I’m not sure:

path => “Ticket/Display.html?Action=DefaultStatus=qa%20approvd&id=” . $id

You’ll have to play with the options and see if they work. I’m ccing
the list in case someone else has an idea about this.

Good luck,
Steve


#4

Stephan,

Thanks, and good idea. This additional piece of code you gave me will 

allow me to simplify the use of our new ticket status values. That
alone, will make the use of our Approval/Prioritization & QA workflow
processes much easier. And after all, that IS the whole point here.
Thanks again.

Kenn
LBNLOn 5/28/2008 6:45 AM, Stephen Turner wrote:

At 04:04 PM 5/27/2008, you wrote:

Stephen,

    Thanks for the code example. I used it as the basis for the 

code I wanted to add. The “Tabs” layout now shows what I want, but
when I click any of the new options, nothing happens. This is what my
new code looks like:

if ($args) {
$tabs->{“i”} = { path => “Search/Results.html$args”,
title => loc(‘Show Results’),
};
if ($current_tab =~ “Search/Results.html”) {
$current_tab = “Search/Results.html$args”;
};
}

if ( $can{‘ModifyTicket’} ) {
if ( $Ticket->Status ne ‘resolved’ ) {
$actions->{‘G’} = {
path =>
“Ticket/Update.html?Action=Comment&DefaultStatus=resolved&id=” . $id,
title => loc(‘Resolve’) };
}

the following code was added for LBNL

make sure the check for status is in descending order

if  ($Ticket->Status eq 'pending qa')
    {
     $actions->{'Fg'} =
         { path => "Ticket/Display.html?Action=DefaultStatus=('qa 

approvd’)&id=" . $id,
title => loc(‘Approve QA’),
};
}

Hi Ken,

Just from a quick look at the code, it looks like you’re on the right
track. I don’t think you need the parentheses or quotes around the
status values - something like:

path => “Ticket/Display.html?Action=DefaultStatus=qa approvd&id=” . $id

As this is going to form a URL, you may need to escape those spaces, but
I’m not sure:

path => “Ticket/Display.html?Action=DefaultStatus=qa%20approvd&id=” . $id

You’ll have to play with the options and see if they work. I’m ccing the
list in case someone else has an idea about this.

Good luck,
Steve


#5

Stephen,

Toward the bottom of the code in file "Tabs" the following code exists:

if ( (defined $actions->{A} || defined $actions->{B} || defined
$actions->{C})
&& (defined $actions->{E} || defined $actions->{F} || defined
$actions->{G}) ) {

 if    (defined $actions->{C}) { $actions->{C}->{separator} = 1 }
 elsif (defined $actions->{B}) { $actions->{B}->{separator} = 1 }
 elsif (defined $actions->{A}) { $actions->{A}->{separator} = 1 }

}

What does it do? I can't grok it. Thanks.

Kenn
LBNLOn 5/28/2008 6:45 AM, Stephen Turner wrote:

At 04:04 PM 5/27/2008, you wrote:

Stephen,

    Thanks for the code example. I used it as the basis for the 

code I wanted to add. The “Tabs” layout now shows what I want, but
when I click any of the new options, nothing happens. This is what my
new code looks like:

if ($args) {
$tabs->{“i”} = { path => “Search/Results.html$args”,
title => loc(‘Show Results’),
};
if ($current_tab =~ “Search/Results.html”) {
$current_tab = “Search/Results.html$args”;
};
}

if ( $can{‘ModifyTicket’} ) {
if ( $Ticket->Status ne ‘resolved’ ) {
$actions->{‘G’} = {
path =>
“Ticket/Update.html?Action=Comment&DefaultStatus=resolved&id=” . $id,
title => loc(‘Resolve’) };
}

the following code was added for LBNL

make sure the check for status is in descending order

if  ($Ticket->Status eq 'pending qa')
    {
     $actions->{'Fg'} =
         { path => "Ticket/Display.html?Action=DefaultStatus=('qa 

approvd’)&id=" . $id,
title => loc(‘Approve QA’),
};
}

Hi Ken,

Just from a quick look at the code, it looks like you’re on the right
track. I don’t think you need the parentheses or quotes around the
status values - something like:

path => “Ticket/Display.html?Action=DefaultStatus=qa approvd&id=” . $id

As this is going to form a URL, you may need to escape those spaces, but
I’m not sure:

path => “Ticket/Display.html?Action=DefaultStatus=qa%20approvd&id=” . $id

You’ll have to play with the options and see if they work. I’m ccing the
list in case someone else has an idea about this.

Good luck,
Steve


#6

At 03:49 PM 5/29/2008, Kenneth Crocker wrote:

Stephen,

    Toward the bottom of the code in file 

“Tabs” the following code exists:

if ( (defined $actions->{A} || defined $actions->{B} || defined $actions->{C})
&& (defined $actions->{E} || defined
$actions->{F} || defined $actions->{G}) ) {

if    (defined $actions->{C}) { $actions->{C}->{separator} = 1 }
elsif (defined $actions->{B}) { $actions->{B}->{separator} = 1 }
elsif (defined $actions->{A}) { $actions->{A}->{separator} = 1 }

}

    What does it do? I can't grok it. Thanks.

Kenn
LBNL

Kenn,

It’s controlling the separators (they appear as
dots on my screen) between the various ticket options, e.g.

Open · Take ··· Comment · Reply · Resolve

Steve


#7

Stephen,

I got it. It works great! I made different and more substantial changes 

to restrict what options will show based on current status. This will
drop the number of ‘clicks’ from 3 to 1 for these new statuses. My users
will be very happy about this. Thanks.

Kenn
LBNLOn 5/29/2008 12:53 PM, Stephen Turner wrote:

At 03:49 PM 5/29/2008, Kenneth Crocker wrote:

Stephen,

    Toward the bottom of the code in file "Tabs" the following 

code exists:

if ( (defined $actions->{A} || defined $actions->{B} || defined
$actions->{C})
&& (defined $actions->{E} || defined $actions->{F} || defined
$actions->{G}) ) {

if    (defined $actions->{C}) { $actions->{C}->{separator} = 1 }
elsif (defined $actions->{B}) { $actions->{B}->{separator} = 1 }
elsif (defined $actions->{A}) { $actions->{A}->{separator} = 1 }

}

    What does it do? I can't grok it. Thanks.

Kenn
LBNL

Kenn,

It’s controlling the separators (they appear as dots on my screen)
between the various ticket options, e.g.

Open � Take ��� Comment � Reply � Resolve

Steve