Display Services per Queue - via Ticket ACL / Perl question

Moderator: crythias

Locked
shostakovich
Znuny advanced
Posts: 146
Joined: 11 Apr 2011, 08:11
Znuny Version: 3.2.5

Display Services per Queue - via Ticket ACL / Perl question

Post by shostakovich »

Hi,

this may be a bit of a Perl question and I'd need more Perl knowledge, maybe you have a hint or an idea, if this would be possible at all.

I managed to filter the service list depending on the chosen Queue. Basically, this needs some code in the Config.pm. What's simply happening in the following code is:

IF a Queue-Name starts with "Office" THEN only show Services starting with "Office".

Code: Select all

    $Self->{TicketAcl}->{'ACL-Name-1'} = {
        # match properties
        Properties => {
            Queue => {
                Name => ['[RegExp]^Office'],
            },
       },
        # return possible options (white list)
        Possible => {
            # possible ticket options (white list)
            Ticket => {
                Service  => ['[RegExp]^Office'],
            },
        },
    };
Now instead of adding the code block for every Queue I have, I want to have it more universal and somewhat have a loop over all Queue names (1st level Queue hierarchy) - so let's say the Queue name is $qn, then filter the Service list by $qn. Ideas?

TIA
Michael
Locked