Having 2 dynamicfields (Dropdown) with the corresponding choices:
"category"
- CardBody
- CardPerso
- PassportPerso
- BookAssembly
- TestingEquipment
- ...
- CMI
- CML
- CMT
- ID54
- SCP5600
- PPT700
- PST500
- ...
Accordingly I have to display in the field "machines" only the corresponding choices. Needed, cuy otherwise the field "machines" would display more than a hundred choises --> not customer friendly.
My ACL however does not have any influence on the field "machines". For testing I added some code to influence the field "category", and it's working. But the dependency of the second field from the first field? Not at all!
Here's my ACL:
Code: Select all
$Self->{TicketAcl}->{'300-Show main category-ACL'} = {
Properties => {
Frontend => {
Action => ['AgentTicketPhone', 'AgentTicketEmail','CustomerTicketMessage'],,
}
},
Possible => {
Ticket => {
DynamicField_category => ['CardBody','CardPerso','TestingEquipment'],
}
}
};
$Self->{TicketAcl}->{'310-Show selection for card body-ACL'} = {
Properties => {
Frontend => {
Action => ['AgentTicketPhone', 'AgentTicketEmail','CustomerTicketMessage'],,
},
DynamicField => {
DynamicField_category => ['CardBody'],
},
},
Possible => {
Ticket => {
DynamicField_machines => ['CMI','CMT'],
}
}
};
$Self->{TicketAcl}->{'320-show selection for card perso-ACL'} = {
Properties => {
Frontend => {
Action => ['AgentTicketPhone', 'AgentTicketEmail','CustomerTicketMessage'],,
},
DynamicField => {
DynamicField_category => ['CardPerso'],
},
},
Possible => {
Ticket => {
DynamicField_machines => ['ID54','SCP5600'],
}
}
};
$Self->{TicketAcl}->{'330-Show selection for testing-ACL'} = {
Properties => {
Frontend => {
Action => ['AgentTicketPhone', 'AgentTicketEmail','CustomerTicketMessage'],,
},
DynamicField => {
DynamicField_category => ['TestingEquipment'],
},
},
Possible => {
Ticket => {
DynamicField_machines => ['PPT700','PST500'],
}
}
};
Code: Select all
<!-- dtl:block:DynamicField -->
<div class="Row Row_DynamicField_$QData{"Name"}">
$Data{"Label"}
<div class="Field">
$Data{"Field"}
</div>
<div class="Clear"></div>
</div>
<!-- dtl:block:DynamicField -->
# example of how to use fixed dynamic field blocks for customizations
# Note: Field1 and Field2 are the names of the fields and had to be replaced with the actual
# field names
<!-- dtl:block:DynamicField_category -->
<div class="Row Row_DynamicField_$QData{"Name"}">
$Data{"Label"}:
<div class="Field">
$Data{"Field"}
</div>
<div class="Clear"></div>
</div>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
$('#category').bind('change', function (Event) {
// make sure the ticket is not yet created on queue change
$('input#Expand').val(1);
Core.Form.Validate.DisableValidation($(this).closest('form'));
$(this).closest('form').submit();
});
//]]></script>
<!--dtl:js_on_document_complete-->
<!-- dtl:block:DynamicField_category -->
<!-- dtl:block:DynamicField_machines -->
<div class="Row Row_DynamicField_$QData{"Name"}">
$Data{"Label"}
<div class="Field">
$Data{"Field"}
</div>
<div class="Clear"></div>
</div>
<!-- dtl:block:DynamicField_machines -->
DANKE
Rudy