Hi
I’m trying to create a drop down list when creating a new ticket. The value of the drop down list is supposed to be filled into a CF (this part I haven’t gotten to yet).
I’ve taken inspiration from the Ticket/Create.html and Elements/SelectOwner, but I can’t quite figure out the meaning of the Elements pages. I’m no perl expert - far from, but I’ve tried to put together a few lines in a new file Elements/SelectCustomer. But when I call it from the Create.html page, I just get a bunch of errors.
Any help on how I can proceed with this?
Thanks in advance.
Best regards
Tommy Abrahamsson
Errors:
Error during compilation of /var/www/rt3/Elements/SelectCustomer:
Useless use of push with no values at /var/www/rt3/Elements/SelectCustomer line 75.
Type of arg 1 to push must be array (not hash element) at /var/www/rt3/Elements/SelectCustomer line 75, near "})"
Global symbol “@assetcustomers” requires explicit package name at /var/www/rt3/Elements/SelectCustomer line 50.
SelectOwner:
%if ($DefaultValue) {
my $assetobj = RTx::AssetTracker::Assets->new($session{CurrentUser});
$assetobj->FromSQL(‘Type = “Customers” AND Status != “retired”’);
while (my $asset = $assetobj->Next)
{
push ($assetcustomers{$asset});
}
</%INIT>
<%ARGS>
$QueueObj => undef
$Name => undef
$Default => 0
$User => undef
$TicketObj => undef
$DefaultValue => 1
$DefaultLabel => “-”
$ValueAttribute => ‘id’
$cfqueues => undef
</%ARGS>