Different Ticket Information

Moderator: crythias

Locked
stevo300
Znuny newbie
Posts: 10
Joined: 01 May 2013, 12:55
Znuny Version: 3.2.6
Real Name: Steve

Different Ticket Information

Post by stevo300 »

Hello,

Is it possible to have different ticket templates for different teams.

ie.

One team needs to know a b c d

Another needs r s t u

a third needs l m n o

instead of having one ticket setup that has a b c d l m n o r s t u on it,

can I set it up that there are 3 templates and the person creating the ticket selects the correct template?

Thanks
OTRS 3.2.6
Windows Server 2012
MYSQL
stevo300
Znuny newbie
Posts: 10
Joined: 01 May 2013, 12:55
Znuny Version: 3.2.6
Real Name: Steve

Re: Different Ticket Information

Post by stevo300 »

OK,

I think I am getting somewhere with this, in that I now realise it is a case of creating a ticket with everything on and automatically hiding what I don't want to see.

to that end I have been trying to adapt a combination of the following:

viewtopic.php?f=60&t=8032
http://jeffeske.com/blog/showhide-dynam ... n-queue-2/

To test I have created a new dynamic field called supplier:
and added to the Type ID script block

Code: Select all

<script type="text/javascript">//<![CDATA[
    $('#TypeID').bind('change', function (Event) {
        Core.AJAX.FormUpdate($('#NewPhoneTicket'), 'AJAXUpdate', 'TypeID', ['Dest', 'NewUserID', 'NewResponsibleID', 'NextStateID', 'PriorityID', 'ServiceID', 'SLAID', 'SignKeyID', 'CryptKeyID', $Data{"DynamicFieldNamesStrg"}, 'To', 'Cc', 'Bcc']);
		
	
		var supplier = document.getElementsByClassName("Row.Row_DynamicFieldField_Supplier");
		switch ($("#TypeID").val() ) {
			case "9":
				alert("Fre");
				elemBlock(supplier);
				break;
			case "10":
				elemBlock(supplier);
				break;
			default:
				alert($("#TypeID").val());
				elemNone(supplier);
		}
		
		function elemBlock(elems){
			for (var i=0;i<elems.length;i+=1){
				elems[i].style.display = 'block';
			}
		}
		function elemNone(elems){
			for (var i=0;i<elems.length;i+=1){
				elems[i].style.display = 'none';
			}
		}


   });
	
	
//]]></script>
The problem is nothing happens, apart from the alerts that I put in to test....

This is in Kernel\Output\HTML\Standard\AgentTicketPhone.dtl

if anyone can shed some light I would very much appreciate it.

Thanks
OTRS 3.2.6
Windows Server 2012
MYSQL
stevo300
Znuny newbie
Posts: 10
Joined: 01 May 2013, 12:55
Znuny Version: 3.2.6
Real Name: Steve

Re: Different Ticket Information

Post by stevo300 »

I have found the answer:

Code: Select all


var supplierLabel = document.getElementsByClassName("Row_DynamicField_Supplier"); //setting the variable for the row containing my new dynamic field
	
	if ($('#TypeID').val() == "") { // if no type is set (i.e. a new ticket)
		elemNone(supplierLabel); //hide the row
	}
	
       //Functions to hide and show the elements

	function elemBlock(elems){
		for (var i=0;i<elems.length;i+=1){
			elems[i].style.display = 'block';
		}
	}
	function elemNone(elems){
		for (var i=0;i<elems.length;i+=1){
			elems[i].style.display = 'none';
		}
	}
	
	
    $('#TypeID').bind('change', function (Event) {
        Core.AJAX.FormUpdate($('#NewPhoneTicket'), 'AJAXUpdate', 'TypeID', ['Dest', 'NewUserID', 'NewResponsibleID', 'NextStateID', 'PriorityID', 'ServiceID', 'SLAID', 'SignKeyID', 'CryptKeyID', $Data{"DynamicFieldNamesStrg"}, 'To', 'Cc', 'Bcc']);
		
	
		
		
		switch ($("#TypeID").val() ) {
			case "9":
				elemBlock(supplierLabel);
				break;
			case "10":
				elemBlock(supplierLabel);
				break;
			default:
				elemNone(supplierLabel);
		}
		
		


   });
OTRS 3.2.6
Windows Server 2012
MYSQL
Locked