Hide DynamicField when Empty
Moderator: crythias
Hide DynamicField when Empty
Hello All,
Like the Howto here : viewtopic.php?f=60&t=24116
My need is to hide all the DynamicField when the content is empty. (because of ACL do not manage visibility in 3.3.9)
So I will manage not to give content for DynamicField using ACL and then do not show automaticly them if not needed to use.
But :
- is there any documentation on all the javascript object /method anywhere so that I understand how to manipulate all this objects
because I suppose the content of a date or dropdown or textarea is not the same to manipule.
- or directly give me the method to get the content for text, textarea, checkbox , dropdown multiselect,date;datetime ?
- is there a possibility to get in the DTL in javascript the list of all the dynamicField existing in the page ?
Like the Howto here : viewtopic.php?f=60&t=24116
My need is to hide all the DynamicField when the content is empty. (because of ACL do not manage visibility in 3.3.9)
So I will manage not to give content for DynamicField using ACL and then do not show automaticly them if not needed to use.
But :
- is there any documentation on all the javascript object /method anywhere so that I understand how to manipulate all this objects
because I suppose the content of a date or dropdown or textarea is not the same to manipule.
- or directly give me the method to get the content for text, textarea, checkbox , dropdown multiselect,date;datetime ?
- is there a possibility to get in the DTL in javascript the list of all the dynamicField existing in the page ?
lab : otrs 5rc1 test : otrs 3.3.15 prod : cluster 3.3.15
-
- Znuny guru
- Posts: 5018
- Joined: 13 Mar 2011, 09:54
- Znuny Version: 6.0.x
- Real Name: Renée Bäcker
- Company: Perl-Services.de
- Contact:
Re: Hide DynamicField when Empty
viewtopic.php?f=60&t=8032&start=50#p82769
jquery is used for the JavaScript stuff. So you can see jquery.com for a reference of methods...
jquery is used for the JavaScript stuff. So you can see jquery.com for a reference of methods...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
-
- Moderator
- Posts: 10169
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Hide DynamicField when Empty
In a form, the content is generally empty, which is why it's asking to fill in content. On a page like TicketZoom, a field and its data will not show if it does not have content.vincent13 wrote:My need is to hide all the DynamicField when the content is empty.
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
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
Re: Hide DynamicField when Empty
it depend on the situation ..
not true for example for drop down, multiselect ...
or if you set a default value ...
not true for example for drop down, multiselect ...
or if you set a default value ...
Last edited by vincent13 on 06 Nov 2014, 20:31, edited 1 time in total.
lab : otrs 5rc1 test : otrs 3.3.15 prod : cluster 3.3.15
-
- Moderator
- Posts: 10169
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Hide DynamicField when Empty
I don't understand the request. It doesn't make sense to hide a field in a form because there's no data in the field. That's what a form is for. To fill the fields. If you don't want that field, don't provide that field at all.
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
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
Re: Hide DynamicField when Empty
Read carefully my first post
I want to be able to show or not, depending on ACL criteria, dynamicField.
As otrs is not able to do that , I'am trying to use the Howto visible topics to hide all my DynamicField if their data are drop by ACL criteria...
simple
I want to be able to show or not, depending on ACL criteria, dynamicField.
As otrs is not able to do that , I'am trying to use the Howto visible topics to hide all my DynamicField if their data are drop by ACL criteria...
simple
lab : otrs 5rc1 test : otrs 3.3.15 prod : cluster 3.3.15
-
- Moderator
- Posts: 10169
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Hide DynamicField when Empty
I would never have guessed you wanted to do that, no matter how many times I would have read your post. And, no.
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
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
Re: Hide DynamicField when Empty
There is a feture add on: https://www.otrs.com/feature-add-on/otrs-ticket-forms/ this includes HideShowDynamic Fields via ACL. But you have to be service customer of OTRS Grouo to get it
"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
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Re: Hide DynamicField when Empty
thanks jojo ,I know that xxx provide addon but it is not free.
my dynamicField is a dropbox
set an acl match properties any -> not possible Ticket DynamicField no values
set an acl match properties Ticket Service "toto" -> possible Ticket Dynamicfield all values
here is my code for :
if ( document.getElementById('DynamicField_Application').length > 0 ) {
$('#DynamicField_Application').parent().removeClass( 'Hidden' );
$('#DynamicField_Application').parent().addClass( 'Mandatory' );
$('#LabelDynamicField_Application').parent().removeClass( 'Hidden' );
$('#LabelDynamicField_Application').parent().addClass( 'Mandatory' );
} else {
$('#LabelDynamicField_Application').parent().addClass( 'Hidden' );
$('#LabelDynamicField_Application').parent().removeClass( 'Mandatory' );
$('#DynamicField_Application').parent().addClass( 'Hidden' );
$('#DynamicField_Application').parent().removeClass( 'Mandatory' );
....
<script type="text/javascript">//<![CDATA[
$('#ServiceID').bind('change', function (Event) {
Core.AJAX.FormUpdate($('#NewCustomerTicket'), 'AJAXUpdate', 'ServiceID', ['TypeID', 'Dest', 'PriorityID', 'SLAID', $Data{"DynamicFieldNamesStrg"}]);
nonetext();
});
//]]></script>
But there is not garanty the nonetext() function is run after the dynamicfield data update so sometimes it is ok, sometimes not ...
is there any way to run nonetext function only after a dynamicfield as been updated ?
or even better addclass or remove class on the server side during the ajax call
my dynamicField is a dropbox
set an acl match properties any -> not possible Ticket DynamicField no values
set an acl match properties Ticket Service "toto" -> possible Ticket Dynamicfield all values
here is my code for :
if ( document.getElementById('DynamicField_Application').length > 0 ) {
$('#DynamicField_Application').parent().removeClass( 'Hidden' );
$('#DynamicField_Application').parent().addClass( 'Mandatory' );
$('#LabelDynamicField_Application').parent().removeClass( 'Hidden' );
$('#LabelDynamicField_Application').parent().addClass( 'Mandatory' );
} else {
$('#LabelDynamicField_Application').parent().addClass( 'Hidden' );
$('#LabelDynamicField_Application').parent().removeClass( 'Mandatory' );
$('#DynamicField_Application').parent().addClass( 'Hidden' );
$('#DynamicField_Application').parent().removeClass( 'Mandatory' );
....
<script type="text/javascript">//<![CDATA[
$('#ServiceID').bind('change', function (Event) {
Core.AJAX.FormUpdate($('#NewCustomerTicket'), 'AJAXUpdate', 'ServiceID', ['TypeID', 'Dest', 'PriorityID', 'SLAID', $Data{"DynamicFieldNamesStrg"}]);
nonetext();
});
//]]></script>
But there is not garanty the nonetext() function is run after the dynamicfield data update so sometimes it is ok, sometimes not ...
is there any way to run nonetext function only after a dynamicfield as been updated ?
or even better addclass or remove class on the server side during the ajax call
lab : otrs 5rc1 test : otrs 3.3.15 prod : cluster 3.3.15
Re: Hide DynamicField when Empty
well why should everything be free? OTRS is open Source not Freeware
"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
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com