#!/usr/bin/perl -w use strict; use ARS; use CGI; ############################################### # First bit is pure perl code - set some vars # and make the Remedy request # ############################################### my $page=CGI->new(); my $user ="USERNAME"; my $pass ="USERNAME"; my $server ="servername"; my $ticket = $page->param("TicketNumber"); #get the passed ticket number my $schema ="HPD:HelpDesk"; #this is the schema to query my $ctrl=ars_Login( #login to the server $server, # . $user, # . $pass # . ) || die "Doh: $ars_errstr"; #or print the error my %tick_inf; (%tick_inf = ars_GetEntry($ctrl,$schema,$ticket)); #this function grabs the whole ticket ################################################## # Now - to create the page this is more or less # HTML ;-) # ################################################## print $page->header(); print $page->start_html( -title => "Work log" ); #table the results: print '
'; print '
'; print '
'; print ''; foreach (@{ $tick_inf{"240000008"} }){ #OUR work log is field number 240000008 on this schema print ''; print qq();; print qq(); print ''; } print ''; print '
$_->{user}$_->{"value"}
'; print '
'; print '
'; print '
'; print $page->end_html();