Dependência entre DynamicField.

Post Reply
eterjack
Znuny newbie
Posts: 55
Joined: 21 Sep 2012, 01:45
Znuny Version: 3.1.10

Dependência entre DynamicField.

Post by eterjack »

Pessoal, estou precisando de ajudar para resolver uns problemas de ACL com dependência.

Estou precisando montar um catalogo de servico, utilizando dynamicField. da seguinte forma:

categoria1, categoria2, servico

categoria1:
1.1.Acesso
1.2.InfraEstrutura
1.3.Hardware
1.4.Software

categoria2:
1.1.1.Domain
1.1.2.Directory
1.1.3.Wifi
1.2.1.Network
1.2.2.Server
1.2.3.Switch
1.2.4.Access Point

Service:
1.1.1.1.Autentication
1.1.1.2.Security
1.1.1.3.Service
1.1.2.1.Autentication
1.1.2.2.Security
1.1.2.3.Service

ACL que estou utilizando.

Utilizando essa ACL, são listados todos os valores do field categoria2, e não apenas que comecam com 1.1.1

$Self->{TicketAcl}->{'ACL-CAT1-CAT2-1.1'} = {
# match properties
# note we don't have Ticket => { because there's no ticket yet
Properties => {
DynamicField => {
DynamicField_categoria1 => ['[RegExp]^1.1'],
}
},
# return possible options
Possible => {
# possible ticket options
Ticket => {
DynamicField_categoria2 => ['[RegExp]^1.1.1'],
},
},
};

------------------------

Se eu substituir a expressão regular DynamicField_categoria1 => ['[RegExp]^1.1'] por DynamicField_categoria1 => ['[RegExp]^1']
Alguem sabe me informar o motivo disso, já que pelo que entende a regex está correta.

Adicionei também as informações abaixo no .dtl para sempre que tiver mudança nos fieldDynamic dar um reload nos mesmo.

In AgentTicketPhone.dtl add this lines:

<!-- dtl:block:DynamicField_categoria1 -->
<div class="Row Row_DynamicField_$QData{"Name"}">
$Data{"Label"}
<div class="Field">
$Data{"Field"}
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
$('#categoria1').bind('change', function (Event) {
Core.AJAX.FormUpdate($('#NewPhoneTicket'), 'AJAXUpdate', 'categoria1', [ 'TypeID', 'Dest', 'NewUserID', 'NextStateID', 'PriorityID', 'ServiceID', 'SLAID', 'SignKeyID', 'CryptKeyID', $Data{"DynamicFieldNamesStrg"}, 'To', 'Cc', 'Bcc']);
});
//]]></script>
<!--dtl:js_on_document_complete-->
</div>
<div class="Clear"></div>
</div>
<!-- dtl:block:DynamicField_categoria1 -->
<!-- dtl:block:DynamicField_categoria2 -->
<div class="Row Row_DynamicField_$QData{"Name"}">
$Data{"Label"}
<div class="Field">
$Data{"Field"}
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
$('#categoria2').bind('change', function (Event) {
Core.AJAX.FormUpdate($('#NewPhoneTicket'), 'AJAXUpdate', 'categoria2', [ 'TypeID', 'Dest', 'NewUserID', 'NextStateID', 'PriorityID', 'ServiceID', 'SLAID', 'SignKeyID', 'CryptKeyID', $Data{"DynamicFieldNamesStrg"}, 'To', 'Cc', 'Bcc']);
});
//]]></script>
<!--dtl:js_on_document_complete-->
</div>
<div class="Clear"></div>
</div>
<!-- dtl:block:DynamicField_categoria2 -->
Jairovisks
Znuny newbie
Posts: 12
Joined: 12 Sep 2012, 17:47
Znuny Version: 3.1.5
Real Name: Jairo Rodrigues

Re: Dependência entre DynamicField.

Post by Jairovisks »

eterjack, creio que o problema seja extamente a regex, pois o "." (ponto) é um metacaractere de regex no perl (e no shell tb... :) ).

Tente "escapar" o ponto com a barra invertida "\", creio que irá funcionar.

Ficando algo do tipo: DynamicField_categoria1 => ['[RegExp]^1\.1']



att,

Jairo Rodrigues
eterjack
Znuny newbie
Posts: 55
Joined: 21 Sep 2012, 01:45
Znuny Version: 3.1.10

Re: Dependência entre DynamicField.

Post by eterjack »

Ja tentei, não funciona..
Post Reply