[Arsperl-users] <No Subject>
Brought to you by:
jeffmurphy
|
From: Steve M. <ste...@ch...> - 2008-09-25 23:16:30
|
I'm still trying to get attachments working.
What does this mean:
[ERROR] 'size' key does not map to scalar value. (ARERR #80025)
It happens as a result of this code:
my $ctrl; my $schema = "HelpDesk-Data and Channel Management";
my %fldtab;
if(($name && $email && $phone && $code && $reqcat && $reqtyp && $desc) || $reqid) {
$ctrl = ars_Login("suncoast", "dcm-web", "dcmweb");
if(!$ctrl) { $err="Cannot login to remedy server - $ars_errstr"; }
else {
%fldtab = ars_GetFieldTable($ctrl, $schema);
if(!%fldtab) { $err="Cannot get field table from remedy - $ars_errstr"; }
}
}
if(!$err && $name && $email && $phone && $code && $reqcat && $reqtyp && $desc) {
my @fields = ();
push(@fields, 7, 0);
push(@fields, 8, 'Submitted via web, please supply a proper description');
push(@fields, 536870931, $code);
push(@fields, 536871062, $name);
push(@fields, 536871065, $phone);
push(@fields, 536871067, $email);
push(@fields, 536871089, $desc);
push(@fields, 100000014, $reqcat);
push(@fields, 100000039, $reqtyp);
my @fieldids = (950000008,950000009,950000010,950001021);
my $k;
for $k($cgi->param) {
if(substr($k,0,6) eq 'attach') {
my $u=$cgi->upload($k);
my $v=$cgi->param($k);
$v=~m/^.*(\\|\/)(.*)/; # strip the remote path and keep the filename
$v=$2;
my @s=stat($v);
my %f=(file => $u, name => $v, size => $s[7]);
push(@fields, shift(@fieldids), \%f);
}
}
$submittedreqid = ars_CreateEntry($ctrl, $schema, @fields);
if(!$submittedreqid) { $err="Cannot create remedy ticket - $ars_errstr"; }
}
|