EMS import/export, Form::*::getValueFromPost(alt_values), and tests
This commit is contained in:
parent
0a7e06edca
commit
c09b2cae1b
46 changed files with 1728 additions and 299 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -96,15 +96,19 @@ sub generateIdParameter {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Retrieves a value from a form GET or POST and returns it. If the value comes back as undef, this method will return undef.
|
||||
|
||||
=head3 value
|
||||
|
||||
An optional value to process, instead of POST input.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my $formValue = $self->session->form->param($self->get("name"));
|
||||
my $formValue = @_ ? shift : $self->session->form->param($self->get("name"));
|
||||
if (defined $formValue) {
|
||||
return $formValue;
|
||||
} else {
|
||||
|
|
@ -122,10 +126,10 @@ Renders and input tag of type checkbox.
|
|||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
my $value = $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($self->get("value"))));
|
||||
my $checkedText = ' checked="checked"' if ($self->get("checked"));
|
||||
my $idText = ' id="'.$self->get('id').'" ' if ($self->get('id'));
|
||||
return '<input type="checkbox" name="'.$self->get("name").'" value="'.$value.'"'.$idText.$checkedText.' '.$self->get("extras").' />';
|
||||
my $value = $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($self->get("value")))) || '';
|
||||
my $checkedText = $self->get("checked") ? ' checked="checked"' : '';
|
||||
my $idText = $self->get('id') ? ' id="'.$self->get('id').'" ' : '';
|
||||
return '<input type="checkbox" name="'.($self->get("name")||'').'" value="'.$value.'"'.$idText.$checkedText.' '.($self->get("extras")||'').' />';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -70,9 +70,9 @@ Returns a class name which has been taint checked.
|
|||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my $value = $self->session->form->param($self->get("name"));
|
||||
my $value = @_ ? shift : $self->session->form->param($self->get("name"));
|
||||
$value =~ s/[^\w:]//g;
|
||||
return $value;
|
||||
return $value;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -84,9 +84,9 @@ Renders a class name field.
|
|||
=cut
|
||||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
my $self = shift;
|
||||
$self->session->style->setScript($self->session->url->extras('inputCheck.js'),{ type=>'text/javascript' });
|
||||
$self->set("extras", $self->get('extras') . ' onkeyup="doInputCheck(document.getElementById(\''.$self->get("id").'\'),\'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890:_\')" ');
|
||||
$self->set("extras", $self->get('extras') . ' onkeyup="doInputCheck(document.getElementById(\''.$self->get("id").'\'),\'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890:_\')" ');
|
||||
return $self->SUPER::toHtml;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,17 +62,21 @@ sub definition {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Returns a hex color like "#000000". Returns undef if the return value is not a valid color.
|
||||
|
||||
=head2 value
|
||||
|
||||
An optional value to use instead of POST input.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my $color = $self->session->form->param($self->get("name"));
|
||||
return undef unless $color =~ /\#\w{6}/;
|
||||
return $color;
|
||||
my $color = @_ ? shift : $self->session->form->param($self->get("name"));
|
||||
return undef unless $color =~ /\#\w{6}/;
|
||||
return $color;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -78,22 +78,30 @@ sub definition {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Returns an array or a carriage return ("\n") separated scalar depending
|
||||
upon whether you're returning the values into an array or a scalar. If
|
||||
any data is in the Text form, it is returned before a selected value from
|
||||
the list.
|
||||
|
||||
=head3 value
|
||||
|
||||
Optional values to process, instead of POST input.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
if ($self->session->form->param($self->get("name")."_new")) {
|
||||
|
||||
if (@_) {
|
||||
return $self->SUPER::getValueFromPost(@_);
|
||||
}
|
||||
elsif ($self->session->form->param($self->get("name")."_new")) {
|
||||
my $formValue = $self->session->form->param($self->get("name")."_new");
|
||||
$formValue =~ tr/\r\n//d;
|
||||
return $formValue;
|
||||
}
|
||||
}
|
||||
return $self->SUPER::getValueFromPost;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -412,15 +412,27 @@ sub fixTags {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Retrieves a value from a form GET or POST and returns it. If the value comes back as undef, this method will return the defaultValue instead.
|
||||
|
||||
=head3 value
|
||||
|
||||
An optional value to process, instead of POST input.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my $formValue = $self->session->form->param($self->get("name")) if ($self->session->request);
|
||||
my $formValue;
|
||||
|
||||
if (@_) {
|
||||
$formValue = shift;
|
||||
}
|
||||
elsif ($self->session->request) {
|
||||
$formValue = $self->session->form->param($self->get("name"));
|
||||
}
|
||||
|
||||
if (defined $formValue) {
|
||||
return $formValue;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -133,11 +133,15 @@ sub displayValue {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Returns a validated form post result. If the result does not pass validation,
|
||||
it returns undef instead.
|
||||
|
||||
=head3 value
|
||||
|
||||
An optional value to process, instead of POST input. This should be in the 'YY(YY)?-MM-DD' form.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
|
|
@ -147,11 +151,11 @@ sub getValueFromPost {
|
|||
|| $self->get("defaultValue") =~ m/^\d+$/
|
||||
|| !$self->get("value")
|
||||
|| $self->get("value") =~ m/^\d+$/) {
|
||||
return $self->session->datetime->setToEpoch($self->session->form->param($self->get("name")));
|
||||
return $self->session->datetime->setToEpoch(@_ ? shift : $self->session->form->param($self->get("name")));
|
||||
} else {
|
||||
# MySQL format
|
||||
# YY(YY)?-MM-DD
|
||||
my $value = $self->session->form->param($self->get("name"));
|
||||
my $value = @_ ? shift : $self->session->form->param($self->get("name"));
|
||||
|
||||
# NOTE: Cannot fix time zone since we don't have a complete date/time
|
||||
|
||||
|
|
|
|||
|
|
@ -105,10 +105,14 @@ sub definition {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Returns a validated form post result. If the result does not pass validation, it returns undef instead.
|
||||
|
||||
=head3 value
|
||||
|
||||
An optional value to process, instead of POST input. This should be in the 'YY(YY)?-MM-DD HH:MM:SS' form.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
|
|
@ -119,11 +123,11 @@ sub getValueFromPost {
|
|||
|| !$self->get("value")
|
||||
|| $self->get("value") =~ m/^\d+$/) {
|
||||
# Epoch format
|
||||
return $self->session->datetime->setToEpoch($self->session->form->param($self->get("name")));
|
||||
return $self->session->datetime->setToEpoch(@_ ? shift : $self->session->form->param($self->get("name")));
|
||||
} else {
|
||||
# MySQL format
|
||||
# YY(YY)?-MM-DD HH:MM:SS
|
||||
my $value = $self->session->form->param($self->get("name"));
|
||||
my $value = @_ ? shift : $self->session->form->param($self->get("name"));
|
||||
$self->session->errorHandler->warn("Date value: $value");
|
||||
|
||||
# Verify format
|
||||
|
|
|
|||
|
|
@ -70,15 +70,19 @@ sub definition {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Returns a validated email address. If the result does not pass validation, it returns undef instead.
|
||||
|
||||
=head3 value
|
||||
|
||||
An optional value to process instead of POST input.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my $value = $self->session->form->param($self->get("name"));
|
||||
my $value = @_ ? shift : $self->session->form->param($self->get("name"));
|
||||
if ($value =~ /^([0-9a-zA-Z]([-.+\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$/i) {
|
||||
return $value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,19 +94,23 @@ sub definition {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Returns the integer from the form post, or returns 0.0 if the post result is invalid.
|
||||
|
||||
=head3 value
|
||||
|
||||
An optional value to process, instead of POST input.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my $value = $self->session->form->param($self->get("name"));
|
||||
my $value = @_ ? shift : $self->session->form->param($self->get("name"));
|
||||
if ($value =~ /^-?[\d\.]+$/ and $value =~ /\d/) {
|
||||
return $value;
|
||||
}
|
||||
return 0.0;
|
||||
return $value;
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -110,8 +110,8 @@ Returns a group pull-down field. A group pull down provides a select list that p
|
|||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
my $where;
|
||||
if ($self->get('excludeGroups')->[0] ne "") {
|
||||
my $where = '';
|
||||
if (($self->get('excludeGroups')->[0]||'') ne "") {
|
||||
$where = "and groupId not in (".$self->session->db->quoteAndJoin($self->get("excludeGroups")).")";
|
||||
}
|
||||
$self->set('options', $self->session->db->buildHashRef("select groupId,groupName from groups where showInForms=1 $where order by groupName"));
|
||||
|
|
|
|||
|
|
@ -104,15 +104,19 @@ sub definition {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Returns the value of this form field after stipping unwanted tags like <body>.
|
||||
|
||||
=head3 value
|
||||
|
||||
An optional value to process, instead of POST input.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
return WebGUI::HTML::cleanSegment($self->SUPER::getValueFromPost());
|
||||
return WebGUI::HTML::cleanSegment($self->SUPER::getValueFromPost(@_));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ sub getValueFromPost {
|
|||
id => 'view-'.$self->get('id'),
|
||||
};
|
||||
|
||||
return WebGUI::Form::hexadecimal->new($self->session, $properties)->getValueFromPost;
|
||||
return WebGUI::Form::Hexadecimal->new($self->session, $properties)->getValueFromPost;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -101,9 +101,9 @@ sub getValueFromPost {
|
|||
my $self = shift;
|
||||
my $value = $self->session->form->param($self->get("name"));
|
||||
if ($value =~ /^[0-9a-f]+$/i) {
|
||||
return $value;
|
||||
}
|
||||
return 0;
|
||||
return $value;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -103,9 +103,9 @@ Renders an input tag of type hidden.
|
|||
|
||||
sub toHtmlAsHidden {
|
||||
my $self = shift;
|
||||
my $value = $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($self->get("value"))));
|
||||
my $idText = ' id="'.$self->get('id').'" ' if ($self->get('id'));
|
||||
return '<input type="hidden" name="'.$self->get("name").'" value="'.$value.'" '.$self->get("extras").$idText.' />'."\n";
|
||||
my $value = $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($self->get("value")))) || '';
|
||||
my $idText = $self->get('id') ? ' id="'.$self->get('id').'" ' : '';
|
||||
return '<input type="hidden" name="'.($self->get("name")||'').'" value="'.$value.'" '.($self->get("extras")||'').$idText.' />'."\n";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -130,14 +130,19 @@ sub getOnChangeSlider {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Retrieves a value from a form GET or POST and returns it. If the value comes back as undef, this method will return the defaultValue instead. Strip newlines/carriage returns from the value.
|
||||
|
||||
=head2 value
|
||||
|
||||
A value to process instead of POST input.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my @args = @_;
|
||||
|
||||
my $properties = {
|
||||
name => $self->get('name'),
|
||||
|
|
@ -146,7 +151,7 @@ sub getValueFromPost {
|
|||
id => 'view-'.$self->get('id'),
|
||||
};
|
||||
|
||||
return WebGUI::Form::Integer->new($self->session, $properties)->getValueFromPost;
|
||||
return WebGUI::Form::Integer->new($self->session, $properties)->getValueFromPost(@args);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -94,19 +94,23 @@ sub definition {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Returns the integer from the form post, or returns 0 if the post result is invalid.
|
||||
|
||||
=head3 value
|
||||
|
||||
An optional value to process, instead of POST input.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my $value = $self->session->form->param($self->get("name"));
|
||||
my $value = @_ ? shift : $self->session->form->param($self->get("name"));
|
||||
if ($value =~ /^-?\d+$/) {
|
||||
return $value;
|
||||
}
|
||||
return 0;
|
||||
return $value;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -85,14 +85,24 @@ sub definition {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ num_and_units ] )
|
||||
|
||||
Returns either the interval that was posted (in seconds) or if nothing comes back it returns 0.
|
||||
|
||||
=head3 num_and_units
|
||||
|
||||
The number and units for this interval, to use instead of POST input, which is the default. ("3 days", for example.) Valid units are (case-insensitive): seconds, minutes, hours, days, weeks, months, years.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
|
||||
if (@_) {
|
||||
my @args = split /\s+/, shift;
|
||||
return $self->session->datetime->intervalToSeconds(@args);
|
||||
}
|
||||
|
||||
return $self->session->datetime->intervalToSeconds($self->session->form->param($self->get("name")."_interval"),$self->session->form->param($self->get("name")."_units")) || 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -194,16 +194,20 @@ sub displayValue {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Returns an array or a carriage return ("\n") separated scalar depending upon whether you're returning the values into an array or a scalar.
|
||||
|
||||
=head3 value
|
||||
|
||||
Optional values to process, instead of POST input.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my @data = $self->session->form->param($self->get("name"));
|
||||
return wantarray ? @data : join("\n",@data);
|
||||
my @data = @_ ? @_ : $self->session->form->param($self->get("name"));
|
||||
return wantarray ? @data : join("\n",@data);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -70,19 +70,23 @@ sub definition {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Returns a string filtered to allow only digits, spaces, and these special characters: + - ( ) or it will return undef it the number doesn't validate to those.
|
||||
|
||||
=head3 value
|
||||
|
||||
An input value to use instead of POST input.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my $value = $self->session->form->param($self->get("name"));
|
||||
if ($value =~ /^[x\d \.\-\+\(\)]+$/ and $value =~ /\d/) {
|
||||
return $value;
|
||||
}
|
||||
return undef;
|
||||
my $value = @_ ? shift : $self->session->form->param($self->get("name"));
|
||||
if ($value =~ /^[x\d \.\-\+\(\)]+$/ and $value =~ /\d/) {
|
||||
return $value;
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -98,10 +98,10 @@ Renders and input tag of type radio.
|
|||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
my $value = $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($self->get("value"))));
|
||||
my $checkedText = ' checked="checked"' if ($self->get("checked"));
|
||||
my $idText = ' id="'.$self->get('id').'" ' if ($self->get('id'));
|
||||
return '<input type="radio" name="'.$self->get("name").'" value="'.$value.'"'.$idText.$checkedText.' '.$self->get("extras").' />';
|
||||
my $value = $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($self->get("value")))) || '';
|
||||
my $checkedText = $self->get("checked") ? ' checked="checked"' : '';
|
||||
my $idText = $self->get('id') ? ' id="'.$self->get('id').'" ' : '';
|
||||
return '<input type="radio" name="'.$self->get("name").'" value="'.$value.'"'.$idText.$checkedText.' '.($self->get("extras")||'').' />';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -93,15 +93,20 @@ sub definition {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Retrieves a value from a form GET or POST and returns it. If the value comes back as undef, this method will return the defaultValue instead. Note, this is exactly the same method as used by Control since SelectBoxes only support a single value.
|
||||
|
||||
=head3 value
|
||||
|
||||
Optional values to process (read "return"), instead of POST input.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my $formValue = $self->session->form->param($self->get("name"));
|
||||
|
||||
my $formValue = @_ ? shift : $self->session->form->param($self->get("name"));
|
||||
if (defined $formValue) {
|
||||
return $formValue;
|
||||
} else {
|
||||
|
|
@ -119,7 +124,7 @@ Renders a select list form control.
|
|||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
my $output = '<select name="'.$self->get("name").'" size="'.$self->get("size").'" id="'.$self->get('id').'" '.$self->get("extras").'>';
|
||||
my $output = '<select name="'.($self->get("name")||'').'" size="'.($self->get("size")||'').'" id="'.($self->get('id')||'').'" '.($self->get("extras")||'').'>';
|
||||
my %options;
|
||||
tie %options, 'Tie::IxHash';
|
||||
%options = $self->orderedHash;
|
||||
|
|
|
|||
|
|
@ -95,8 +95,8 @@ Renders a select list form control.
|
|||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
my $multiple = ' multiple="multiple"' if ($self->get("multiple"));
|
||||
my $output = '<select name="'.$self->get("name").'" size="'.$self->get("size").'" id="'.$self->get('id').'" '.$self->get("extras").$multiple.'>';
|
||||
my $multiple = $self->get("multiple") ? ' multiple="multiple"' : '';
|
||||
my $output = '<select name="'.($self->get("name")||'').'" size="'.($self->get("size")||'').'" id="'.($self->get('id')||'').'" '.($self->get("extras")||'').$multiple.'>';
|
||||
my %options;
|
||||
tie %options, 'Tie::IxHash';
|
||||
%options = $self->orderedHash;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ package WebGUI::Form::SelectSlider;
|
|||
|
||||
use strict;
|
||||
use base 'WebGUI::Form::Slider';
|
||||
use WebGUI::Form::SelectList;
|
||||
use WebGUI::International;
|
||||
|
||||
=head1 NAME
|
||||
|
|
@ -177,16 +178,21 @@ sub getSliderValue {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Retrieves a value from a form GET or POST and returns it. If the value comes
|
||||
back as undef, this method will return the defaultValue instead. Strip
|
||||
newlines/carriage returns from the value.
|
||||
|
||||
=head2 value
|
||||
|
||||
A value to process instead of POST input.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my @args = @_;
|
||||
|
||||
my $properties = {
|
||||
-name => $self->get('name'),
|
||||
|
|
@ -196,7 +202,7 @@ sub getValueFromPost {
|
|||
-size => 1,
|
||||
};
|
||||
|
||||
return WebGUI::Form::selectList->new($self->session, $properties)->getValueFromPost;
|
||||
return WebGUI::Form::SelectList->new($self->session, $properties)->getValueFromPost(@args);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -84,15 +84,26 @@ sub definition {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Retrieves a value from a form GET or POST and returns it. If the value comes back as undef, this method will return the defaultValue instead. Strip newlines/carriage returns from the value.
|
||||
|
||||
=head3 value
|
||||
|
||||
An optional value to process, instead of POST input.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my $formValue = $self->session->form->param($self->get("name")) if ($self->session->request);
|
||||
my $formValue;
|
||||
|
||||
if (@_) {
|
||||
$formValue = shift;
|
||||
}
|
||||
elsif ($self->session->request) {
|
||||
$formValue = $self->session->form->param($self->get("name"));
|
||||
}
|
||||
if (defined $formValue) {
|
||||
$formValue =~ tr/\r\n//d;
|
||||
return $formValue;
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ sub definition {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
If the defaultValue is a MySQL time, the value returned by this form element
|
||||
will be a MySQL time. Note: Will not be adjusted for the user's time zone.
|
||||
|
|
@ -107,10 +107,31 @@ will be a MySQL time. Note: Will not be adjusted for the user's time zone.
|
|||
Otherwise, the value returned by this form element will be a number of seconds,
|
||||
adjusted for the user's time zone..
|
||||
|
||||
=head3 value
|
||||
|
||||
An optional value to process, instead of POST input. This should be in the form of an integer of seconds, 'HH:MM', or 'HH:MM:SS'.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
|
||||
if (@_) {
|
||||
my $value = shift;
|
||||
if (!$self->get("defaultValue")
|
||||
|| $self->get("defaultValue") =~ m/^\d+$/
|
||||
|| !$value
|
||||
|| $value =~ m/^\d+$/) {
|
||||
return $self->session->datetime->timeToSeconds($value)-($self->session->user->profileField("timeOffset")*3600);
|
||||
}
|
||||
elsif ($value =~ /^\d{2}\D\d{2}(\D\d{2})?$/) {
|
||||
return $value
|
||||
}
|
||||
else {
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
# This should probably be rewritten as a cascading ternary
|
||||
if (!$self->get("defaultValue")
|
||||
|| $self->get("defaultValue") =~ m/^\d+$/
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ Parses the posted value and tries to make corrections if necessary.
|
|||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my $value = $self->session->form->param($self->get("name"));
|
||||
my $value = @_ ? shift : $self->session->form->param($self->get("name"));
|
||||
$value =~ tr/\r\n//d;
|
||||
if ($value =~ /mailto:/) {
|
||||
return $value;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ sub definition {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 yesNo ( )
|
||||
|
||||
Returns either a 1 or 0 representing yes, no.
|
||||
|
||||
|
|
@ -97,6 +97,32 @@ sub yesNo {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
If value is present, we will process it, otherwise the superclass will handle the request.
|
||||
|
||||
=head3 value
|
||||
|
||||
An optional value to process, instead of POST input. This should be in the form 1, 0, 'Y' or 'N'. 1 or 0 is returned.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my $formValue;
|
||||
|
||||
if (@_) {
|
||||
my $value = shift;
|
||||
return '' unless length $value; # empty import value?
|
||||
return ($value =~ /^y/i || $value eq '1') ? 1 : 0;
|
||||
}
|
||||
else {
|
||||
return $self->SUPER::getValueFromPost;
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 toHtml ( )
|
||||
|
||||
Renders a yes/no question field.
|
||||
|
|
|
|||
|
|
@ -77,20 +77,24 @@ sub definition {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
|
||||
Returns a validated form post result. If the result does not pass validation, it returns undef instead.
|
||||
|
||||
=head3 value
|
||||
|
||||
An optional value to use instead of POST input.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my $value = $self->session->form->param($self->get("name"));
|
||||
my $value = @_ ? shift : $self->session->form->param($self->get("name"));
|
||||
$value =~ tr/\r\n//d;
|
||||
if ($value =~ /^[A-Z\d\s\-]+$/) {
|
||||
return $value;
|
||||
}
|
||||
return undef;
|
||||
return $value;
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -102,7 +106,7 @@ Renders a zip code field.
|
|||
=cut
|
||||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
my $self = shift;
|
||||
$self->session->style->setScript($self->session->url->extras('inputCheck.js'),{ type=>'text/javascript' });
|
||||
$self->set("extras", $self->get('extras') . ' onkeyup="doInputCheck(document.getElementById(\''.$self->get("id").'\'),\'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ- \')"');
|
||||
return $self->SUPER::toHtml;
|
||||
|
|
|
|||
|
|
@ -156,6 +156,105 @@ our $HELP = {
|
|||
],
|
||||
},
|
||||
|
||||
'import events' => {
|
||||
source => 'sub www_importEvents',
|
||||
title => 'import events help title',
|
||||
body => 'import events help body',
|
||||
fields => [
|
||||
{
|
||||
title => 'choose a file to import',
|
||||
description => 'import hoverhelp file',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
{
|
||||
title => 'what about duplicates',
|
||||
description => 'import hoverhelp dups',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
{
|
||||
title => 'ignore first line',
|
||||
description => 'import hoverhelp first line',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
{
|
||||
title => 'import file contains field title',
|
||||
description => 'import file contains field description',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
{
|
||||
title => 'import field is duplicate key title',
|
||||
description => 'import field is duplicate key description',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
{
|
||||
title => 'status',
|
||||
description => 'approve event description',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
{
|
||||
title => 'add/edit event title',
|
||||
description => 'add/edit event title description',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
{
|
||||
title => 'add/edit event description',
|
||||
description => 'add/edit event description description',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
{
|
||||
title => 'add/edit event image',
|
||||
description => 'add/edit event image description',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
{
|
||||
title => 'price',
|
||||
description => 'add/edit event price description',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
{
|
||||
title => 'add/edit event template',
|
||||
description => 'add/edit event template description',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
{
|
||||
title => 'weight',
|
||||
description => 'weight description',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
{
|
||||
title => 'sku',
|
||||
description => 'sku description',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
{
|
||||
title => 'sku template',
|
||||
description => 'sku template description',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
{
|
||||
title => 'add/edit event start date',
|
||||
description => 'add/edit event start date description',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
{
|
||||
title => 'add/edit event end date',
|
||||
description => 'add/edit event end date description',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
{
|
||||
title => 'add/edit event maximum attendees',
|
||||
description => 'add/edit event maximum attendees description',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
],
|
||||
related => [
|
||||
{
|
||||
tag => 'event management system add/edit',
|
||||
namespace => 'Asset_EventManagementSystem',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'edit event metadata field' => {
|
||||
source => 'sub www_editEventMetaDataField',
|
||||
title => 'add/edit event metadata field',
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ use strict;
|
|||
use Tie::IxHash;
|
||||
use WebGUI::SQL::ResultSet;
|
||||
use WebGUI::Utility;
|
||||
use Text::CSV_XS;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -527,7 +528,7 @@ sub quickArray {
|
|||
|
||||
=head2 quickCSV ( sql, params )
|
||||
|
||||
Executes a query and returns a comma delimited text blob with column headers.
|
||||
Executes a query and returns a comma delimited text blob with column headers. Returns undef on failure.
|
||||
|
||||
=head3 sql
|
||||
|
||||
|
|
@ -543,16 +544,23 @@ sub quickCSV {
|
|||
my $self = shift;
|
||||
my $sql = shift;
|
||||
my $params = shift;
|
||||
my ($sth, $output, @data);
|
||||
$sth = $self->prepare($sql);
|
||||
my ($sth, $output, @data);
|
||||
|
||||
my $csv = Text::CSV_XS->new({ eol => "\n" });
|
||||
|
||||
$sth = $self->prepare($sql);
|
||||
$sth->execute($params);
|
||||
$output = join(",",$sth->getColumnNames)."\n";
|
||||
while (@data = $sth->array) {
|
||||
makeArrayCommaSafe(\@data);
|
||||
$output .= join(",",@data)."\n";
|
||||
}
|
||||
$sth->finish;
|
||||
return $output;
|
||||
|
||||
return unless $csv->combine($sth->getColumnNames);
|
||||
$output = $csv->string();
|
||||
|
||||
while (@data = $sth->array) {
|
||||
return unless $csv->combine(@data);
|
||||
$output .= $csv->string();
|
||||
}
|
||||
|
||||
$sth->finish;
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -664,7 +664,7 @@ An integer which represents the amount of time for the interval.
|
|||
|
||||
=head3 units
|
||||
|
||||
A string which represents the units of the interval. The string must be 'years', 'months', 'weeks', 'days', 'hours', 'minutes', or 'seconds'.
|
||||
A string which represents the units of the interval. The string must be (case-insensitive) 'years', 'months', 'weeks', 'days', 'hours', 'minutes', or 'seconds'.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -672,25 +672,25 @@ sub intervalToSeconds {
|
|||
my $self = shift;
|
||||
my $interval = shift;
|
||||
my $units = shift;
|
||||
if ($units eq "years") {
|
||||
if (lc $units eq "years") {
|
||||
return ($interval*31536000);
|
||||
}
|
||||
elsif ($units eq "months") {
|
||||
elsif (lc $units eq "months") {
|
||||
return ($interval*2592000);
|
||||
}
|
||||
elsif ($units eq "weeks") {
|
||||
elsif (lc $units eq "weeks") {
|
||||
return ($interval*604800);
|
||||
}
|
||||
elsif ($units eq "days") {
|
||||
elsif (lc $units eq "days") {
|
||||
return ($interval*86400);
|
||||
}
|
||||
elsif ($units eq "hours") {
|
||||
elsif (lc $units eq "hours") {
|
||||
return ($interval*3600);
|
||||
}
|
||||
elsif ($units eq "minutes") {
|
||||
elsif (lc $units eq "minutes") {
|
||||
return ($interval*60);
|
||||
}
|
||||
else {
|
||||
else { # seconds
|
||||
return $interval;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ Deconstructor.
|
|||
=cut
|
||||
|
||||
sub DESTROY {
|
||||
my $self = shift;
|
||||
undef $self;
|
||||
my $self = shift;
|
||||
undef $self;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -80,9 +80,9 @@ Returns the user's real IP address. Normally this is REMOTE_ADDR, but if they go
|
|||
|
||||
sub getIp {
|
||||
my $self = shift;
|
||||
if ($self->get("HTTP_X_FORWARDED_FOR") =~ m/(\d+\.\d+\.\d+\.\d+)/) {
|
||||
return $1;
|
||||
}
|
||||
if ($self->get("HTTP_X_FORWARDED_FOR") =~ m/(\d+\.\d+\.\d+\.\d+)/) {
|
||||
return $1;
|
||||
}
|
||||
return $self->get("REMOTE_ADDR");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ package WebGUI::Session::Form;
|
|||
|
||||
use strict qw(vars subs);
|
||||
use WebGUI::HTML;
|
||||
use base 'WebGUI::FormValidator';
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -23,7 +24,7 @@ Package WebGUI::Session::Form
|
|||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This is a convenience package to the individual form controls. It allows you to get the form post results back without having to load each form control seperately, instantiate an object, and call methods.
|
||||
This is a subclass of WebGUI::FormValidator. It processes POST input.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
|
@ -41,79 +42,49 @@ This is a convenience package to the individual form controls. It allows you to
|
|||
|
||||
=head1 METHODS
|
||||
|
||||
These functions are available from this package:
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 AUTOLOAD ( )
|
||||
=head2 AUTOLOAD ( params )
|
||||
|
||||
Dynamically creates functions on the fly for all the different form control types.
|
||||
This just passes control to WebGUI::FormValidator::AUTOLOAD.
|
||||
|
||||
=head3 params
|
||||
|
||||
Either an href of parameters or the fieldName in question.
|
||||
|
||||
=cut
|
||||
|
||||
sub AUTOLOAD {
|
||||
our $AUTOLOAD;
|
||||
my $self = shift;
|
||||
my $name = ucfirst((split /::/, $AUTOLOAD)[-1]);
|
||||
my $params = shift;
|
||||
$params = {name=>$params} if ref ($params) ne "HASH";
|
||||
my $cmd = "use WebGUI::Form::".$name;
|
||||
eval ($cmd);
|
||||
if ($@) {
|
||||
$self->session->errorHandler->error("Couldn't compile form control: ".$name.". Root cause: ".$@);
|
||||
return undef;
|
||||
}
|
||||
my $class = "WebGUI::Form::".$name;
|
||||
return $class->new($self->session, $params)->getValueFromPost;
|
||||
my @args = @_;
|
||||
our $AUTOLOAD;
|
||||
my $method = "SUPER::".(split /::/, $AUTOLOAD)[-1];
|
||||
return $self->$method(@args);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 DESTROY ( )
|
||||
=head2 paramsHashRef ( )
|
||||
|
||||
Deconstructor.
|
||||
Gets a hash ref of all the params passed in to this class, and their values. This should not be confused with the param() method.
|
||||
|
||||
=cut
|
||||
|
||||
sub DESTROY {
|
||||
my $self = shift;
|
||||
undef $self;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 get ( )
|
||||
|
||||
An alias for process()
|
||||
|
||||
=cut
|
||||
|
||||
sub get {
|
||||
sub paramsHashRef {
|
||||
my $self = shift;
|
||||
return $self->process(@_);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 new ( session )
|
||||
|
||||
Constructor.
|
||||
|
||||
=head3 session
|
||||
|
||||
A reference to the current session.
|
||||
|
||||
=cut
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
bless {_session=>$session}, $class;
|
||||
unless ($self->{_paramsHashRef}) {
|
||||
my %hash;
|
||||
tie %hash, "Tie::IxHash";
|
||||
foreach ($self->param) {
|
||||
my @arr = $self->process($_);
|
||||
$hash{$_} = (scalar(@arr) > 1)?\@arr:$arr[0];
|
||||
}
|
||||
$self->{_paramsHashRef} = \%hash;
|
||||
}
|
||||
return $self->{_paramsHashRef};
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -157,29 +128,6 @@ sub param {
|
|||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 paramsHashRef ( )
|
||||
|
||||
Gets a hash ref of all the params passed in to this class, and their values. This should not be confused with the param() method.
|
||||
|
||||
=cut
|
||||
|
||||
sub paramsHashRef {
|
||||
my $self = shift;
|
||||
unless ($self->{_paramsHashRef}) {
|
||||
my %hash;
|
||||
tie %hash, "Tie::IxHash";
|
||||
foreach ($self->param) {
|
||||
my @arr = $self->process($_);
|
||||
$hash{$_} = (scalar(@arr) > 1)?\@arr:$arr[0];
|
||||
}
|
||||
$self->{_paramsHashRef} = \%hash;
|
||||
}
|
||||
return $self->{_paramsHashRef};
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 process ( name, type [ , default, params ] )
|
||||
|
|
@ -206,39 +154,16 @@ A full set of form params just as you'd pass into any of the form controls when
|
|||
|
||||
sub process {
|
||||
my ($self, $name, $type, $default, $params) = @_;
|
||||
|
||||
$type = ucfirst($type);
|
||||
return $self->param($name) if ($type eq "");
|
||||
$params->{name} = $name;
|
||||
if (wantarray) {
|
||||
my @values = $self->$type($params);
|
||||
if (scalar(@values) < 1 && ref $default eq "ARRAY") {
|
||||
return @{$default};
|
||||
} else {
|
||||
return @values;
|
||||
}
|
||||
} else {
|
||||
my $value = $self->$type($params);
|
||||
unless (defined $value) {
|
||||
return $default;
|
||||
}
|
||||
if ($value =~ /^[\s]+$/) {
|
||||
return undef;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 session ( )
|
||||
|
||||
Returns a reference to the current session.
|
||||
|
||||
=cut
|
||||
|
||||
sub session {
|
||||
my $self = shift;
|
||||
return $self->{_session};
|
||||
return $self->SUPER::process({
|
||||
name => $name,
|
||||
type => $type,
|
||||
default => $default,
|
||||
params => $params,
|
||||
});
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -193,15 +193,15 @@ our $I18N = { ##hashref of hashes
|
|||
lastUpdated => 1138312761,
|
||||
},
|
||||
|
||||
'add/edit useSalesTax' => {
|
||||
message => q|Use Sales Tax?|,
|
||||
lastUpdated => 1160109884,
|
||||
},
|
||||
'add/edit useSalesTax' => {
|
||||
message => q|Use Sales Tax?|,
|
||||
lastUpdated => 1160109884,
|
||||
},
|
||||
|
||||
'add/edit useSalesTax description' => {
|
||||
message => q|Should this event have sales tax applied to it?|,
|
||||
lastUpdated => 1160109886,
|
||||
},
|
||||
'add/edit useSalesTax description' => {
|
||||
message => q|Should this event have sales tax applied to it?|,
|
||||
lastUpdated => 1160109886,
|
||||
},
|
||||
|
||||
'add/edit event maximum attendees' => {
|
||||
message => q|Maximum Attendees|,
|
||||
|
|
@ -383,6 +383,168 @@ our $I18N = { ##hashref of hashes
|
|||
lastUpdated => 1147146318,
|
||||
},
|
||||
|
||||
'check required fields' => {
|
||||
message => q|You did not include these required fields: |,
|
||||
lastUpdated => 0,
|
||||
context => q|Require that the user include all required fields in their import|,
|
||||
},
|
||||
|
||||
'import blank line' => {
|
||||
message => q|Record %d was blank (skipped).|,
|
||||
lastUpdated => 0,
|
||||
context => q|Report which lines were blank.|,
|
||||
},
|
||||
|
||||
'import other line' => {
|
||||
message => q|Record %d was %s.|,
|
||||
lastUpdated => 0,
|
||||
context => q|Report which lines were skipped or overwritten.|,
|
||||
},
|
||||
|
||||
'import record parse error' => {
|
||||
message => q|There was an error processing record %d: '%s'|,
|
||||
lastUpdated => 0,
|
||||
context => q|Couldn't parse a line of the import file|,
|
||||
},
|
||||
|
||||
'no import took place' => {
|
||||
message => q|No records were imported. There were errors in the input:|,
|
||||
lastUpdated => 0,
|
||||
context => q|Let the user know that we didn't partially import their bad data|,
|
||||
},
|
||||
|
||||
'export error' => {
|
||||
message => q|There was an error in the export procedure.|,
|
||||
lastUpdated => 0,
|
||||
context => q|generic export error|,
|
||||
},
|
||||
|
||||
'import form header' => {
|
||||
message => q|Using this form you can import data directly into this EMS. Be sure that your fields are specified in the order shown below.|,
|
||||
lastUpdated => 0,
|
||||
context => q|header to the import form...|,
|
||||
},
|
||||
|
||||
'import need dup key' => {
|
||||
message => q|You must check at least one duplicate key checkbox.|,
|
||||
lastUpdated => 0,
|
||||
context => q|When importing, we need at least one field to tell record apart|,
|
||||
},
|
||||
|
||||
'import invalid status' => {
|
||||
message => q|Record %d has an invalid Status value (%s). Valid values are: Approved, Cancelled, Denied, Pending.|,
|
||||
lastUpdated => 0,
|
||||
context => q|There are only a few valid valued for the event status (approved) field|,
|
||||
},
|
||||
|
||||
'import invalid prereq' => {
|
||||
message => q|Record %d has an invalid Prerequisite Set Name value (%s). You need to create the relevant Prerequisite Sets prior to import.|,
|
||||
lastUpdated => 0,
|
||||
context => q|The prereq import field is a EMS_prereqs.name; we need it to store the id in EMS_products.prerequisiteId|,
|
||||
},
|
||||
|
||||
'import invalid template' => {
|
||||
message => q|Record %d has an invalid Event Template Name value (%s). You need to create the relevant Event Template prior to import.|,
|
||||
lastUpdated => 0,
|
||||
context => q|The templateId import field is an assetData.title; we need it to store the assetId in EMS_products.templateId|,
|
||||
},
|
||||
|
||||
'import missing required' => {
|
||||
message => q|Record %d did not have %s, a required field, filled.|,
|
||||
lastUpdated => 0,
|
||||
context => q|Import records need to have required fields filled|,
|
||||
},
|
||||
|
||||
'field count mismatch' => {
|
||||
message => q|Record %d has %d fields, not %d as indicated by the checkboxes you clicked.|,
|
||||
lastUpdated => 0,
|
||||
context => q|Import records need to have the right number of fields|,
|
||||
},
|
||||
|
||||
'import ok' => {
|
||||
message => q|All %d records were successfully processed. %d created, %d blank lines, %d duplicates %s.|,
|
||||
lastUpdated => 0,
|
||||
context => q|Let the user know that the importing of events was successful|,
|
||||
},
|
||||
|
||||
'skipped' => {
|
||||
message => q|skipped|,
|
||||
lastUpdated => 0,
|
||||
context => q|What did we do with duplicates (skipped/overwritten)?|,
|
||||
},
|
||||
|
||||
'overwritten' => {
|
||||
message => q|overwritten|,
|
||||
lastUpdated => 0,
|
||||
context => q|What did we do with duplicates (skipped/overwritten)?|,
|
||||
},
|
||||
|
||||
'import events help title' => {
|
||||
message => q|Import Events|,
|
||||
lastUpdated => 0,
|
||||
context => q|Help for importing events from CSV files.|,
|
||||
},
|
||||
|
||||
'import events help body' => {
|
||||
message => q|This is the body of the import events help page.|,
|
||||
lastUpdated => 0,
|
||||
context => q|Help for importing events from CSV files.|,
|
||||
},
|
||||
|
||||
'meta hover help' => {
|
||||
message => q|This is a custom field. Please ask your administrator for guidance.|,
|
||||
lastUpdated => 0,
|
||||
context => q|What's this meta field for?|,
|
||||
},
|
||||
|
||||
'import hoverhelp file' => {
|
||||
message => q|Upload a comma-seperated values (CSV) file for importing events. (Spreadsheet applications can output this format.) The fields must be comma-delimited, with double-quotes (") around field values which contain commas. Embedded double quotes are escaped with another double-quote (""). Your file will be checked for field count and required fields before any import takes place. If errors are found, then you are notified of the errors and no import takes place. This checking does not include checking whether or not LDAP, database links, or templates are valid. The format of special fields is as it is for exporting, so if you have a question as to how to format a given field for importing, look at how that information is exported and format your data accordingly. List fields with multiple values should be joined in the same CSV field by a semi-colon (;).|,
|
||||
lastUpdated => 0,
|
||||
context => q|What's the file field for?|,
|
||||
},
|
||||
|
||||
'import hoverhelp dups' => {
|
||||
message => q|The system will use whatever fields you specify under 'Field Is Duplicate Key' as the fields to use to identify duplicate event records. When a duplicate is found, this pulldown will determine what we do with the duplicate event record - either skip the incoming record or overwrite the old record with the new one. Note that all fields in overwritten records are overwritten, regardless of whether they're present in the incoming record or not.|,
|
||||
lastUpdated => 0,
|
||||
context => q|What's the duplicates field for?|,
|
||||
},
|
||||
|
||||
'import hoverhelp first line' => {
|
||||
message => q|If the first line of your import file contains field names instead of an event record, check yes. Otherwise, check no.|,
|
||||
lastUpdated => 0,
|
||||
context => q|What's the first line field for?|,
|
||||
},
|
||||
|
||||
'import file contains field title' => {
|
||||
message => q|File Contains Field|,
|
||||
lastUpdated => 0,
|
||||
context => q|What's "file contains field" mean?|,
|
||||
},
|
||||
|
||||
'import file contains field description' => {
|
||||
message => q|Check the checkboxes next to the fields which are included in your imput file. Please note that the fields must be in the order shown, and all required fields must be checked and filled in order for the import to proceed.|,
|
||||
lastUpdated => 0,
|
||||
context => q|What's "file contains field" mean?|,
|
||||
},
|
||||
|
||||
'import field is duplicate key title' => {
|
||||
message => q|Field Is Duplicate Key|,
|
||||
lastUpdated => 0,
|
||||
context => q|What's "field is dup key" mean?|,
|
||||
},
|
||||
|
||||
'import field is duplicate key description' => {
|
||||
message => q|In order to handle duplicate event records intelligently, the system needs to be able to identify a record as a duplicate. By checking these checkboxes, you're letting the system know what fields it needs to consider when trying to find an already-existing record for the event record being imported. For example, if you check Event Title and Event Start Date as the only fields which are duplicate keys, then if the incoming Event Title and Event Start Date match those of an existing event record, then the incoming record will be considered a duplicate of the already existing record. In that case, the system will either skip the incoming record, or overwrite the existing record.|,
|
||||
lastUpdated => 0,
|
||||
context => q|What's "field is dup key" mean?|,
|
||||
},
|
||||
|
||||
'null field error recnum' => {
|
||||
message => q|The %s field cannot be blank (record %d).|,
|
||||
lastUpdated => 1179563424,
|
||||
context => q|When a required field is empty/blank, then this message is used in sprintf to tell the user which field it is and that it cannot be blank - it also shows the relevant import file record number|,
|
||||
},
|
||||
|
||||
'null field error' => {
|
||||
message => q|The %s field cannot be blank.|,
|
||||
lastUpdated => 1138908251,
|
||||
|
|
@ -489,6 +651,11 @@ in the system.</p>
|
|||
lastUpdated => 1149828404,
|
||||
},
|
||||
|
||||
'short title' => {
|
||||
message => q|Title|,
|
||||
lastUpdated => 1149828404,
|
||||
},
|
||||
|
||||
'title.url' => {
|
||||
message => q|A URL to display a list of events that contain this event|,
|
||||
lastUpdated => 1165513731,
|
||||
|
|
@ -981,7 +1148,7 @@ for this event.</p>
|
|||
'you' => {
|
||||
message => q|you|,
|
||||
lastUpdated => 1145396293,
|
||||
context => q|Third person pronoun|,
|
||||
context => q|Second person pronoun|,
|
||||
},
|
||||
|
||||
'create a badge for myself' => {
|
||||
|
|
@ -1064,7 +1231,7 @@ for this event.</p>
|
|||
'filter' => {
|
||||
message => q|Filter|,
|
||||
lastUpdated => 1145402683,
|
||||
context => q|Button in search form to limit displayed events based on user criteria|,
|
||||
context => q|Button in search form to limit displayed eveed events based on user criteria|,
|
||||
},
|
||||
|
||||
'managePrereqsMessage' => {
|
||||
|
|
@ -1206,22 +1373,42 @@ for this event.</p>
|
|||
context => q|The label for the sku template field in the edit event screen.|
|
||||
},
|
||||
|
||||
'sku template description' => {
|
||||
message => q|This field defines how the SKU for each
|
||||
'sku template description' => {
|
||||
message => q|This field defines how the SKU for each
|
||||
product variant will be composed. The syntax is the same as that of
|
||||
normal templates.|,
|
||||
lastUpdated => 1146170930,
|
||||
},
|
||||
lastUpdated => 1146170930,
|
||||
},
|
||||
|
||||
'error' => {
|
||||
message => q|Error:|,
|
||||
lastUpdated => 1146170930,
|
||||
},
|
||||
'error no colon' => {
|
||||
message => q|Error|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'manage prerequisite sets' => {
|
||||
message => q|Manage Prerequisite Sets|,
|
||||
lastUpdated => 1147050475,
|
||||
},
|
||||
'error' => {
|
||||
message => q|Error:|,
|
||||
lastUpdated => 1146170930,
|
||||
},
|
||||
|
||||
'manage prerequisite sets' => {
|
||||
message => q|Manage Prerequisite Sets|,
|
||||
lastUpdated => 1147050475,
|
||||
},
|
||||
|
||||
'export events' => {
|
||||
message => q|Export Events|,
|
||||
lastUpdated => 1179341015,
|
||||
},
|
||||
|
||||
'import events' => {
|
||||
message => q|Import Events|,
|
||||
lastUpdated => 1179341015,
|
||||
},
|
||||
|
||||
'enter import file' => {
|
||||
message => q|Please enter a file to import|,
|
||||
lastUpdated => 1179341015,
|
||||
},
|
||||
|
||||
'edit prerequisite set' => {
|
||||
message => q|Edit Prerequisite Set|,
|
||||
|
|
@ -1530,6 +1717,42 @@ added to the user's cart and would be discounted if the Attend All Sessions even
|
|||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'choose a file to import' => {
|
||||
message => q|Choose a file to import|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'what about duplicates' => {
|
||||
message => q|What about duplicates?|,
|
||||
lastUpdated => 0,
|
||||
context => q|Import EMS data form|,
|
||||
},
|
||||
|
||||
'ignore first line' => {
|
||||
message => q|Ignore first line?|,
|
||||
lastUpdated => 0,
|
||||
context => q|Import EMS data form|,
|
||||
},
|
||||
|
||||
'yes' => {
|
||||
message => q|yes|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'no' => {
|
||||
message => q|no|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'skip' => {
|
||||
message => q|Skip|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'overwrite' => {
|
||||
message => q|Overwrite|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue