package Ledmonds::Form::Callout;
sub new
{
my $class = shift;
return bless {}, $class;
}
#-------------------------------------------------------------------------------------------------# setTSData - sets hidden fields with all the ENV vars from teamsite GUI
# this is only for use by callouts
#-------------------------------------------------------------------------------------------------
sub setTSData
{
my ($className) = shift;
my ($cgi) = @_;
my ($thisKey, $thisValue);
my $bKeyFound = 0;
my $IW_HOME = TeamSite::Config::iwgethome();
my @CALLOUT_FIELDS = ("session",
"editfile_session",
"iw_action",
"iw_callback_var",
"iw_dcrvpath",
"iw_dcr_path",
"iw_dcr_type",
"iw_dcr_vpath",
"iw_field_type",
"iw_form_name",
"iw_item_description",
"iw_item_name",
"iw_item_value",
"iw_object_name",
"iw_taskid",
"iw_tdt",
"iw_wfaction",
"task_id",
"user_name",
"user_role",);
foreach $thisKey (sort keys %{$cgi->{form}})
{
#look for the ts key and set flag if it is the current key
foreach my $tsField (@CALLOUT_FIELDS)
{
$tsField = lc($tsField);
my $tmpKey = lc($thisKey);
$bKeyFound = 1 if ($tsField eq $tmpKey);
last if ($bKeyFound);
}
# if the key is found then
if ($bKeyFound)
{
$bKeyFound = 0;
} else {
next;
}
if (!ref $cgi->{form}{$thisKey})
{
$thisValue = $cgi->escape_html_data($cgi->{form}{$thisKey});
print " \n";
}
else
{
foreach my $refItem (@{$cgi->{form}{$thisKey}})
{
$thisValue = TeamSite::CGI_lite->escape_html_data($refItem);
print " \n";
}
}
}
}
1;