Dynamic Field available only to a specific CustomerID

Moderator: crythias

Locked
mmanara
Znuny newbie
Posts: 14
Joined: 09 Mar 2013, 16:39
Znuny Version: OTRS 6.0.23
Real Name: Massimo Manara
Company: Aglea s.r.l.

Dynamic Field available only to a specific CustomerID

Post by mmanara »

Hi All,

not sure if this is possibile. We are on OTRS 3.2.0.beta3.

We are trying to setup this scenario. Several Customer Ids are using our OTRS system (there's only one Queue and the Type/Services are in common between all customers). We want allow only for certain CustomerID (into CustomerTicketMessage - CustomerTicketMessage.dtl) the visibility of a specific Dynamic Field (named Project). In this way a customer can create a ticket and insert (during the first phase of ticket creation) the project (as an attribute) to it.

Following this post: viewtopic.php?f=60&t=8032 (How To show freetext for specific Queues for Customers) I've

1) Created into OTRS Admin the project Dynaminc field (ProgettoARI)
2) Enabled into "Ticket -> Frontend::Customer::Ticket::ViewNew"
3) Edited the "CustomerTicketMessage.dtl" by inserting this code:

<!-- dtl:js_on_document_complete -->
<script type="text/javascript">
Core.Customer.InitFocus();

//START by MM
switch ($CustomerID.val() ) { //If the customer ID is named ARI
case "ARI": // need to slash escape the pipes
document.getElementById('DynamicField_ProgettoARI').style.display = 'block';
document.getElementById('LabelDynamicField_ProgettoARI').style.display = 'block';
document.getElementById('LabelDynamicField_ProgettoARI').className = 'Validate_Required';
break;
default:
document.getElementById('DynamicField_ProgettoARI').style.display = 'none';
document.getElementById('LabelDynamicField_ProgettoARI').style.display = 'none';
}
//END by MM
</script>
<!-- dtl:js_on_document_complete -->


Is possibile use CustomerID variable to setup this scenario? Or is possibile using only the queue (#Dest)?

Many Thanks.

Massimo
OTRS 3.2.0.beta3
Locked