Is it possible to set freetext required for only one queue?

English! place to talk about development, programming and coding
Post Reply
tomekliw
Znuny newbie
Posts: 32
Joined: 02 Dec 2010, 11:17
Znuny Version: 3
Location: Poland

Is it possible to set freetext required for only one queue?

Post by tomekliw »

Hello,

Maybe someone know solution to my problem? I have some queues and some freetext fields but what is required in one queue is not required in second one, is it possible to set freetext field as required field only to specific queue?

thanks in advance,
TJL
OTRS 3.1.10 on CentOS and MySql. Auth for customers and agents via both Active Directory and local database.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Is it possible to set freetext required for only one que

Post by crythias »

Not possible. Items in SysConfig are global. What do you want to ask for one queue?
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
tomekliw
Znuny newbie
Posts: 32
Joined: 02 Dec 2010, 11:17
Znuny Version: 3
Location: Poland

Re: Is it possible to set freetext required for only one que

Post by tomekliw »

Maybe I will explain on my example. I have queues for developers, helpdesk, infrastructure and business units.

Each of teams want to have his own freetext which has to be required and do not want to be pushed by filling other teams freetext. Developers want to have freetext with their apps, business wants to have freetext with project, helpdesk - type of equipment, etc.
Each of teams wants their fields as required in AgentTicketClose because of statistics and every of teams do not want to fill other freetexts of other teams becouse... I don't know why.
OTRS 3.1.10 on CentOS and MySql. Auth for customers and agents via both Active Directory and local database.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Is it possible to set freetext required for only one que

Post by crythias »

A while ago I submitted this: http://forums.otrs.org/viewtopic.php?f=62&t=5157#p23375

Here's the update for 3.0 (put at the end of Customer Ticket Message):

Code: Select all

    switch ($('#Dest').val() ) {
    case  "3\|\|Junk":
      document.compose.RichText.value = "This is junk<br/>and line 2";
    break;
    default:
      document.compose.RichText.value = "";
    document.compose.RichText.value = $('#Dest').val(); // this is a sample text so you know what's being sent. use it for debug, not for production.
    }
// the following two lines are the existing last two lines of CustomerTicketMessage.dtl
</script>
<!-- dtl:js_on_document_complete -->
But, let's see if we can make a freetextfield show up only on certain queues...

I have sneaky way of doing it. Let's say CSS actually works...

Code: Select all

<script type="text/javascript">
    Core.Customer.InitFocus();
    switch ($('#Dest').val() ) {
    case  "3\|\|Junk": // need to slash escape the pipes
      document.compose.RichText.value = "This is junk<br/>and line 2"; // only if you want to change the body. destroys user input if queue changes
      document.getElementById('TicketFreeText1').style.display = 'block';
      document.getElementById('LabelTicketFreeText1').style.display = 'block';
    break;
    default:
      document.compose.RichText.value = $('#Dest').val(); //remove this. debug only
      document.getElementById('TicketFreeText1').style.display = 'none';
      document.getElementById('LabelTicketFreeText1').style.display = 'none';
    }
</script>
NOTE: if the free text fields are REQUIRED, there's additional work to be done, but this is a fun workaround.

EDIT: I'm going to provide more information: http://forums.otrs.org/viewtopic.php?f= ... 758#p31758
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
tomekliw
Znuny newbie
Posts: 32
Joined: 02 Dec 2010, 11:17
Znuny Version: 3
Location: Poland

Re: Is it possible to set freetext required for only one que

Post by tomekliw »

Great,

That's what I need. Thanks.

Can You give me some advice, what I have to do with required fields without modyfing customerticketmessage.pm but only dtl?
OTRS 3.1.10 on CentOS and MySql. Auth for customers and agents via both Active Directory and local database.
tomekliw
Znuny newbie
Posts: 32
Joined: 02 Dec 2010, 11:17
Znuny Version: 3
Location: Poland

Re: Is it possible to set freetext required for only one que

Post by tomekliw »

I've found solution. Free text must not be mandatory in sysconfig an code looks like that:

Code: Select all

	switch ($('#Dest').val() ) { 
		case  "6\|\|some queue":
			document.getElementById('TicketFreeText1').style.display = 'block';
			document.getElementById('LabelTicketFreeText1').style.display = 'block';
			document.getElementById('LabelTicketFreeText1').className = 'Mandatory';
			document.getElementById('TicketFreeText1').className = 'TicketFreeText  Validate_RequiredDropdown ServerError';
		break;
		default:
			document.getElementById('TicketFreeText1').style.display = 'none';
			document.getElementById('LabelTicketFreeText1').style.display = 'none';		
    }
OTRS 3.1.10 on CentOS and MySql. Auth for customers and agents via both Active Directory and local database.
tomekliw
Znuny newbie
Posts: 32
Joined: 02 Dec 2010, 11:17
Znuny Version: 3
Location: Poland

Re: Is it possible to set freetext required for only one que

Post by tomekliw »

And how to do the same in AgentTicketPhone.dtl?
OTRS 3.1.10 on CentOS and MySql. Auth for customers and agents via both Active Directory and local database.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Is it possible to set freetext required for only one que

Post by crythias »

tomekliw wrote:And how to do the same in AgentTicketPhone.dtl?
You should be able to do almost exactly the same thing. Did you try it and it not work?
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
tomekliw
Znuny newbie
Posts: 32
Joined: 02 Dec 2010, 11:17
Znuny Version: 3
Location: Poland

Re: Is it possible to set freetext required for only one que

Post by tomekliw »

Do not work at all
OTRS 3.1.10 on CentOS and MySql. Auth for customers and agents via both Active Directory and local database.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Is it possible to set freetext required for only one que

Post by crythias »

You're right about that. I don't know what to say right now, but if my hack applies, it appears to be outside of that file at the moment.
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
StefanoBoccanera
Znuny newbie
Posts: 76
Joined: 23 Feb 2011, 15:43
Znuny Version: 3.1.5
Real Name: Stefano Boccanera
Company: I.Conseils (self-employee)
Location: Rome (Italy)

Re: Is it possible to set freetext required for only one que

Post by StefanoBoccanera »

Hi

I successfully modified the CustomerTicketMessage.dtl and AgentPhoneTicket.dtl, to show different TicketFreeText baesd on Ticket Type.
Since a couple of weeks I'll trying to manage some mandatory TicketFreeText into the CustomerTicketMessage.dtl .

First of all I configured this freetext as manadatory, but the selective showing doesn't work and I can't add the ticket because there is some 'not showed' mandatory freetext.

Second I tried to modify CustomerTicketMessage.dtl to define explictly all freetext, to use the onchange html event, checking the fields one by one, but in this case
the new dtl didn't show the freetext at all and I caugth an error ' TicketFreeText2 is null', following the dtl code used:

Code: Select all

<!-- dtl:block:TicketFreeText2 -->
                  <label class="Mandatory" for="TicketFreeTextField2">
                   <b style="color:red">$Data{"TicketFreeKeyField2"}</b>
                  </label>
                    <div class="Field">
                        $Data{"TicketFreeTextField2"}
                     </div>
                     <div class="Clear"></div>
<!-- dtl:block:TicketFreeText2 -->

At last I tried to write a function to validate, on form submit, the mandatory ticketfreetext based on the ticket type selected.
I used the the html event onsubmit on form attributes, but the linked function was not activated .......

help me please .....

best regards

stefano

attached the last modified CustomerTicketMessage.dtl .
Stefano Boccanera

OTRS : 3.1.5
ITSM : 3.1
S.O : RH
RDBMS : Postgres
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Is it possible to set freetext required for only one que

Post by jojo »

moved to Devel Sub Forum
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
StefanoBoccanera
Znuny newbie
Posts: 76
Joined: 23 Feb 2011, 15:43
Znuny Version: 3.1.5
Real Name: Stefano Boccanera
Company: I.Conseils (self-employee)
Location: Rome (Italy)

Re: Is it possible to set freetext required for only one que

Post by StefanoBoccanera »

jojo wrote:moved to Devel Sub Forum
Thanks jojo

stefano
Stefano Boccanera

OTRS : 3.1.5
ITSM : 3.1
S.O : RH
RDBMS : Postgres
Post Reply