ACL und DynamicField - Akualisieren bei Ticketerstellen

Hilfe zu Znuny Problemen aller Art
Locked
Rotyn
Znuny newbie
Posts: 68
Joined: 21 Aug 2012, 17:11
Znuny Version: 3.3.5
Real Name: Rudy

ACL und DynamicField - Akualisieren bei Ticketerstellen

Post by Rotyn »

Ich starre seite Stunden auf den Code und probiere dies und das.....aber es aendert nichts. Was verpasse ich?

Ich habe 2 DynamicFields (DropDown) mit der entsprechenden Auswahl:
"category"
  • CardBody
  • CardPerso
  • PassportPerso
  • BookAssembly
  • TestingEquipment
  • ...
"machines"
  • CMI
  • CML
  • CMT
  • ID54
  • SCP5600
  • PPT700
  • PST500
  • ...
Unter "category" soll der Kunde die Maschinengruppe auswaehlen. Unter "machines" soll er dann spezifisch werden und den genauen Maschinentyp angeben.

Dazu muss natuerlich das Feld "machines" entsprechend nur die zur Maschinengruppe zugehoerigen Eintraege anzeigen. Diese Eingrenzung mache ich, da das Feld "machines" ansonsten ueber 100 Eintraege enthaelt --> nicht kundenfreundlich

Meine ACL hat jedoch keinen Einfluss auf das Feld "machines". Egal was ich mache. Zu Testzwecken habe ich die ACL erweitert und schraenke das erste Feld "category" ein, da funktioniert es. Aber die Abhaengigkeit des zweiten Feldes vom ersten? Fehlanzeige!

Hier meine 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'],
}
}
};
Und hier mein Auszug aus der (z.b.) 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 -->
Kann mir jemand auf die Spruenge helfen?

DANKE

Rudy
Testing & Productive: OTRS::ITSM 3.3.5 on CentOS 6.5 and MySQL
Packages: All included
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: ACL und DynamicField - Akualisieren bei Ticketerstellen

Post by crythias »

$('#category').bind('change', function (Event) {
Wenn Sie nach Bindung mit einem Feld, müssen Sie sich vergewissern, dass der id ist in den HTML.
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
Rotyn
Znuny newbie
Posts: 68
Joined: 21 Aug 2012, 17:11
Znuny Version: 3.3.5
Real Name: Rudy

Re: ACL und DynamicField - Akualisieren bei Ticketerstellen

Post by Rotyn »

I don't get it, sorry (you must know I am a pretty newbie to this). My code looks now like this:

My CustomerTicketMessage.dtl (extraction):

Code: Select all

# 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 id=”category” 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 id=”machines” class="Row Row_DynamicField_$QData{"Name"}">
                    $Data{"Label"}
                    <div class="Field">
                        $Data{"Field"}
                    </div>
                    <div class="Clear"></div>
                </div>
<!-- dtl:block:DynamicField_machines -->
And my ACL currently:

Code: Select all

##+ MB MOD for euipment ACL

$Self->{TicketAcl}->{'300-Show main category-ACL'} = {
Properties => {
Frontend => {
                Action => ['AgentTicketPhone', 'AgentTicketEmail','CustomerTicketMessage'],,
}
},
Possible => {
Ticket => {
DynamicField_category => ['CardBody','CardPerso','TestingEquipment','BookletAssembly','PassportPerso','Border Crossing','INCAPE','Other'],
}
}
};



$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 => ['Perso'],
},
},
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'],
}
}
};

##- MB MOD for euipment ACL
Still the second field (machines) isn't depending from the first field (category). The second field does contain always all choices.....whatever the first field contains

I have no clue

Rudy
Testing & Productive: OTRS::ITSM 3.3.5 on CentOS 6.5 and MySQL
Packages: All included
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: ACL und DynamicField - Akualisieren bei Ticketerstellen

Post by crythias »

Da dies immer noch die deutschen Forum, werde ich noch tun, dass Google Translate Sache.

Die Bindung ist für das Eingabefeld, wie es die Sache, "ändern" werden wird. Ihre beste Wette ist, um die HTML-und copy / paste, dass Eingabefeld zurück machen in die dtl.
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
Rotyn
Znuny newbie
Posts: 68
Joined: 21 Aug 2012, 17:11
Znuny Version: 3.3.5
Real Name: Rudy

Re: ACL und DynamicField - Akualisieren bei Ticketerstellen

Post by Rotyn »

Soweit verstanden (so far understood):

Code: Select all

<div class="Row Row_DynamicField_category">
                   <label id="LabelDynamicField_category" for="DynamicField_category">
        EQ group:
</label>

                    <div class="Field">
                        <select name="DynamicField_category" id="DynamicField_category" class="DynamicFieldText" size="1">
  <option value="">-</option>
  <option value="3">BookletAssembly</option>
  <option value="6">Border Crossing</option>
  <option value="1">CardBody</option>
  <option value="2" selected="selected">CardPerso</option>
  <option value="7">INCAPE</option>
  <option value="8">Other</option>
  <option value="4">PassportPerso</option>
  <option value="5">TestingEquipment</option>
</select>

                    </div>
                    <div class="Clear"></div>
                </div>
                <div class="Row Row_DynamicField_machines">
                   <label id="LabelDynamicField_machines" for="DynamicField_machines">
        EQ type:
</label>

                    <div class="Field">
                        <select name="DynamicField_machines" id="DynamicField_machines" class="DynamicFieldText" size="1">
  <option value="">-</option>
  <option value="1">CMI</option>
  <option value="2">CML</option>
  <option value="3">CMT</option>
  <option value="6">ID54</option>
  <option value="4">PPT700</option>
  <option value="5">PST500</option>
  <option value="7">SCP5600</option>
</select>

                    </div>
Bedeutet: meine Eltern-Feld ID ist "Dynamicfield_category" ( Means my parent field's id is "Dynamicfield_category")

Die angepasste CustomerTicketMessage.dtl (my changed my CustomerTicketMessage.dtl wow it's like this) :

Code: Select all

# 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 id=”category” 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[
$('#DynamicField_category').bind('change', function (Event) {
Core.AJAX.FormUpdate($('#CustomerTicketMessage'), 'AJAXUpdate', 'DynamicField_category', [ 'TypeID', 'Dest', 'NewUserID','NewResponsibleID', 'NextStateID', 'ServiceID', 'SLAID', 'SignKeyID', 'CryptKeyID', $Data{"DynamicFieldNamesStrg"}, 'To', 'Cc', 'Bcc']);
});
//]]></script>
<!--dtl:js_on_document_complete-->                
                
                
                
<!-- dtl:block:DynamicField_category -->



<!-- dtl:block:DynamicField_machines -->
                <div id=”machines” class="Row Row_DynamicField_$QData{"Name"}">
                    $Data{"Label"}
                    <div class="Field">
                        $Data{"Field"}
                    </div>
                    <div class="Clear"></div>
                </div>
<!-- dtl:block:DynamicField_machines -->
Meine Aenderungen im Vergleich zu deinem Bespiel (my changes compared to your given code):
  • the "id" for the JS to "#DynamicField_category"
  • I changed "Core.AJAX.FormUpdate($('#NewPhoneTicket')" for "Core.AJAX.FormUpdate($('#CustomerTicketMessage')"
  • I changed the "DynamicField_dummy" variable to "DynamicField_catagory"

Immer noch ein Schlag ins Wasser (Still doesn't work) :(
Testing & Productive: OTRS::ITSM 3.3.5 on CentOS 6.5 and MySQL
Packages: All included
Locked