I thought that this code was already in the queue module.  I’m using 1.2.3, maybe it got removed from later versions.  Anyways, here’s the code you requested:

 

=item GetAllUserIDsByQueueID()

 

...

 

    ...

 

=cut

 

sub GetAllUserIDsByQueueID {

    my $Self = shift;

    my %Param = @_;

    # check needed stuff

    if (!$Param{QueueID}) {

        $Self->{LogObject}->Log(Priority => 'error', Message => "Need QueueID!");

        return;

    }

    # db quote

    foreach (keys %Param) {

        $Param{$_} = $Self->{DBObject}->Quote($Param{$_});

    }

    # fetch all queues

    my @UserIDs = ();

    $Self->{DBObject}->Prepare(

        SQL => "SELECT user_id FROM personal_queues ".

            " WHERE ".

            " queue_id = $Param{QueueID} ",

    );

    while (my @RowTmp = $Self->{DBObject}->FetchrowArray()) {

        push (@UserIDs, $RowTmp[0]);

    }

    return @UserIDs;

}

# --

 

Christopher J. Peterson

Compulit, Inc

(616)285-9590

cpeterso@compulit.com