ACL to make available certain TicketFreeText based on queue

Moderator: crythias

Locked
qwerty
Znuny newbie
Posts: 6
Joined: 14 Sep 2011, 19:20
Znuny Version: 3.0.10

ACL to make available certain TicketFreeText based on queue

Post by qwerty »

I posted this in the mail list, but I'm posting it here too, just in case someone who know the answer happens to be here.

Does anybody know the proper ACL syntax to be able to completely enable/disable TicketFreeText based on Queues? I've tried different ways and their not achieving what I need. Here's what I'm trying to achieve:

I have two customers that must supply different additional info with new tickets, with the only common additional info being contact phone number.

The examples provided in the OTRS FAQ only change what options are available in the TicketFreeKey drop-down. So, for instance, the following ACL would simply remove "Other" from the TicketFreeKey2 selection, but would not remove TicketFreeKey2 entirely, and commenting out TicketFreeText2 => ['Other'] and specifying only TicketFreeKey2 => ['Choices'] has no effect:

$Self->{TicketAcl}->{'ACL-Name-Test'} = {

# match properties
Properties => {
# current ticket match properties
Ticket => {
Queue => ['ABCCompany'],
},
Frontend => {
Action => ['CustomerTicketMessage'],
},
},

# return possible options (black list)
PossibleNot => {
Ticket => {
TicketFreeKey2 => ['Choices'],
TicketFreeText2 => ['Other'],
},
},
};


The other alternative I tried, which also does not work, is the following ACL. That "$Self->" entry under "Possible" acts globally and does not obey the matching criteria and executes regardless of any ACL criteria:

$Self->{TicketAcl}->{'ACL-Name-Test'} = {

# match properties
Properties => {
# current ticket match properties
Ticket => {
Queue => ['ABCCompany'],
},
Frontend => {
Action => ['CustomerTicketMessage'],
},
},

# return possible options (white list)
Possible => {
$Self->{'Ticket::Frontend::CustomerTicketMessage'}->{'TicketFreeText'} = {
'1' => '1',
'10' => '0',
'11' => '0',
'12' => '0',
'13' => '0',
'14' => '0',
'15' => '0',
'16' => '0',
'2' => 0,
'3' => '0',
'4' => '0',
'5' => '0',
'6' => '0',
'7' => '0',
'8' => '0',
'9' => '0',
},
},
};


Someone on the Forums posted an example for hiding TicketFreeText using CSS; however, that is limited, as I need it to operate on queues; therefore I need an ACL I can place in Kernel/Config.pm.

Any pointers would be greatly appreciated.

Thanks
qwerty
Znuny newbie
Posts: 6
Joined: 14 Sep 2011, 19:20
Znuny Version: 3.0.10

Re: ACL to make available certain TicketFreeText based on qu

Post by qwerty »

Anyone?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: ACL to make available certain TicketFreeText based on qu

Post by crythias »

OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
qwerty
Znuny newbie
Posts: 6
Joined: 14 Sep 2011, 19:20
Znuny Version: 3.0.10

Re: ACL to make available certain TicketFreeText based on qu

Post by qwerty »

Hi crythias,

I already saw that, which is why I stated that the CSS solution is not the appropriate solution for what I need.

Thanks
jakezp
Znuny newbie
Posts: 22
Joined: 10 Sep 2011, 09:39
Znuny Version: 3

Re: ACL to make available certain TicketFreeText based on qu

Post by jakezp »

Hi qwerty

I currently show / hide various things based on state and queues (and I am sure any other variable with some changes) for agents using CSS.

You can easily show / hide what you need based on Queues

Have a look at this: http://forums.otrs.org/viewtopic.php?f=62&t=11461

I don't have access to my server at the moment, but look at the link so long and I will post examples a bit later today.

You will need to make some changes, as I am doing it for agents and you are looking at doing it for customers.
Jakez
--------------
OTRS 3.0.9
ITSM 3.0.4
qwerty
Znuny newbie
Posts: 6
Joined: 14 Sep 2011, 19:20
Znuny Version: 3.0.10

Re: ACL to make available certain TicketFreeText based on qu

Post by qwerty »

Hmm... OK. Thank you, jakezp, I'll have a look at the thread you linked to, and try and implement this weekend, when I have more time.

Thank you crythias and jakezp, for answering my query.
jakezp
Znuny newbie
Posts: 22
Joined: 10 Sep 2011, 09:39
Znuny Version: 3

Re: ACL to make available certain TicketFreeText based on qu

Post by jakezp »

Hi again qwerty,

Ok here is how I do it...

I know there is a better way to define how / which selections I want to make, but I have not had time to neaten it up and this works for now.

I added the following to the bottom of otrs/Kernel/Output/HTML/Standard/AgentTicketActionCommon.dtl:

Code: Select all

#Layers
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    Core.Agent.TicketAction.Init();
//---- Above is existing code - below new

function nonetext() {
      document.getElementById('TicketFreeText1').style.display = 'none';
      document.getElementById('LabelTicketFreeText1').style.display = 'none';
      document.getElementById('TicketFreeText3').style.display = 'none';
      document.getElementById('LabelTicketFreeText3').style.display = 'none';
}
switch ($('#Dest').val() ) { //this is where the queue is relevant (Dest = Queue)
    case "11": // StateID
#      document.compose.RichText.value = "First state"; //Debug
      nonetext();
      document.getElementById('TicketFreeText3').style.display = 'block';
      document.getElementById('LabelTicketFreeText3').style.display = 'block';
    break;
    case "14": // StateID
#      document.compose.RichText.value = "Second state"; //Debug
      nonetext();
      document.getElementById('TicketFreeText1').style.display = 'block';
      document.getElementById('LabelTicketFreeText1').style.display = 'block';
    break;
   default:
#      document.compose.RichText.value = $('#Dest').val(); // Debug - Print current state
      nonetext();
}
function nonetext2() {
      document.getElementById('pending_date_label').style.display = 'none';
      document.getElementById('pending_date').style.display = 'none';
}
switch ($('#Dest2').val() ) { //this is where the queue is relevant (Dest = Queue)
    case "17": // Queue selection
#      document.compose.RichText.value = "Correct queue"; //Debug
      nonetext2();
      document.getElementById('pending_label').style.display = 'block';
      document.getElementById('pending_date_label').style.display = 'block';
   break;
   default:
#      document.compose.RichText.value = $('#Dest2').val(); //Debug - Print QueueID
       nonetext2();
}
//----- end code - below is existing
//]]></script>
<!--dtl:js_on_document_complete-->
I wanted to hide the Pending Time Selection unless it is a specific queue.

So additional thins I had to do in the same file:

Code: Select all


<!-- dtl:block:StatePending -->
                <label id="pending_date_label">$Text{"Pending date"}:</label>
                <div id="pending_date" class="Field">
                    $Data{"DateString"}
                    <div id="DayServerError" class="TooltipErrorMessage"><p>$Text{"Date invalid!"}</p></div>
                    <div id="HourServerError" class="TooltipErrorMessage"><p>$Text{"Date invalid!"}</p></div>
                </div>
                <div class="Clear"></div>
<!-- dtl:block:StatePending -->
I basically added the id's above... In 'label' I added 'pending_date_label' and div id I added 'pending_date'.

Now, this is the part that's not so neat (and I know there is a better way to define this... but here goes...

In /otrs/Kernel/Output/HTML/Standard/AgentTicketNote.dtl, I added:

Code: Select all

<input id="Dest" type="hidden" value="$Data{"StateID"}" />
<input id="Dest2" type="hidden" value="$Data{"QueueID"}" />
It was added to AgentTicketNote.dtl as I only wanted these actions to apply when the agents add a new note...

I hope it helps you in using CSS to hide the stuff based on the Queue
Jakez
--------------
OTRS 3.0.9
ITSM 3.0.4
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: ACL to make available certain TicketFreeText based on qu

Post by crythias »

qwerty wrote:Hi crythias,

I already saw that, which is why I stated that the CSS solution is not the appropriate solution for what I need.

Thanks
I don't know why it's not the appropriate situation, though. Can you explain further?

You said, "I need it to be based upon queues" and the CSS is TicketFreeText based upon queues.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
qwerty
Znuny newbie
Posts: 6
Joined: 14 Sep 2011, 19:20
Znuny Version: 3.0.10

Re: ACL to make available certain TicketFreeText based on qu

Post by qwerty »

Thank you very much, jakezp, for your explanation. That should really help me out when I work on it this weekend.
qwerty
Znuny newbie
Posts: 6
Joined: 14 Sep 2011, 19:20
Znuny Version: 3.0.10

Re: ACL to make available certain TicketFreeText based on qu

Post by qwerty »

crythias wrote:I don't know why it's not the appropriate situation, though. Can you explain further?
I don't remember exactly what was stated about the difficulty with using CSS, and I can't find the page where I read the statement. Nonetheless, I will be giving the various CSS suggestions a try. Thanks.
Baustin
Znuny newbie
Posts: 38
Joined: 01 Jun 2011, 10:40
Znuny Version: 3.0
Real Name: Barry

Re: ACL to make available certain TicketFreeText based on qu

Post by Baustin »

Is this possible to do for agents as opposed to customers
OTRS 3.0.7 installed on Linux. Agents access it, customers emails us.
Locked