ACL and dynamicfield - ticket creation

Moderator: crythias

Locked
Rotyn
Znuny newbie
Posts: 68
Joined: 21 Aug 2012, 17:11
Znuny Version: 3.3.5
Real Name: Rudy

ACL and dynamicfield - ticket creation

Post by Rotyn »

Looking for hours on the same piece of code....but I guess there's something i am missing

Having 2 dynamicfields (Dropdown) with the corresponding choices:

"category"
  • CardBody
  • CardPerso
  • PassportPerso
  • BookAssembly
  • TestingEquipment
  • ...
"machines"
  • CMI
  • CML
  • CMT
  • ID54
  • SCP5600
  • PPT700
  • PST500
  • ...
With "category" the customer will choose the machine group. With "machines" the customer must get more specific and provide the excat type of machine.

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'],
}
}
};
And here's an extraction fromr (i.e.) customerticketmessage.pm:

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 -->
Who can help me?

DANKE

Rudy
Testing & Productive: OTRS::ITSM 3.3.5 on CentOS 6.5 and MySQL
Packages: All included
Locked