diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index cd0cb362c..377aa76d6 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,3 +1,19 @@ +7.10.20 + - fixed: Do not call group methods on an undefined value. + - fixed #12178: random deletion of columns may happen when a schema is saved (Amir Plivatsky) + - fixed #12179: DataTable Field types get reset to "Text" in Edit Schema (Amir Plivatsky) + - added: FormField macro for rendering Form objects directly from templates + - fixed: Generic Tax driver does not like spaces around commas + - fixed: Date formatting with WebGUI::DateTime has extra spaces for single digit months and days. + - fixed #12165: Default date in Thingy doesn't work + - fixed #12188: Thingy broken after upgrade to 7.9.32-stable + - fixed #12184: Apache error in modperl.error.log (William McKee, Knowmad Technologies) + - fixed #12186: keywords template variable not working properly in Article + - fixed #12190: List type form plugins that do not override getOptions show no value when getValueAsHtml is called + - fixed #12135: Geo::Coder::Googlev3 needs common sense + - fixed #12183: Posts do not disqualify themselves when purged + - fixed #12189: installClass ignores preload.custom + 7.10.19 - fixed #12169: extras uploads symlink export - Added ability to pass caller assetId to RenderThingMacro diff --git a/docs/credits.txt b/docs/credits.txt index 0434df23a..e504aaa45 100644 --- a/docs/credits.txt +++ b/docs/credits.txt @@ -55,6 +55,7 @@ Contributing Developers..............C.J. Adams-Collier / Ernesto Hernández-Novich / itverx C.A. Stephen Opal / Plain Black Tavis Parker / Plain Black + Amir Plivatsky Daniel Quinlan Jukka Raimovaara / Mentalhouse Oy Alan Ritari / DonorWare diff --git a/docs/upgrades/upgrade_7.10.18-7.10.19.pl b/docs/upgrades/upgrade_7.10.18-7.10.19.pl index 77dd98cb7..c592aaa48 100644 --- a/docs/upgrades/upgrade_7.10.18-7.10.19.pl +++ b/docs/upgrades/upgrade_7.10.18-7.10.19.pl @@ -49,7 +49,7 @@ finish($session); # this line required # print "DONE!\n" unless $quiet; #} -#---------------------------------------------------------------------------- + # Fix calendar feed urls that had adminId attached to them until they blew up sub fixBrokenCalendarFeedUrls { my $session = shift; diff --git a/docs/upgrades/upgrade_7.10.19-7.10.20.pl b/docs/upgrades/upgrade_7.10.19-7.10.20.pl new file mode 100644 index 000000000..e079b4557 --- /dev/null +++ b/docs/upgrades/upgrade_7.10.19-7.10.20.pl @@ -0,0 +1,147 @@ +#!/usr/bin/env perl + +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +our ($webguiRoot); + +BEGIN { + $webguiRoot = "../.."; + unshift (@INC, $webguiRoot."/lib"); +} + +use strict; +use Getopt::Long; +use WebGUI::Session; +use WebGUI::Storage; +use WebGUI::Asset; + + +my $toVersion = '7.10.20'; +my $quiet; # this line required + +my $session = start(); # this line required + +addFormFieldMacroToConfig(); + +# upgrade functions go here +fixSpacesInTaxInfo ( $session ); + +sub addFormFieldMacroToConfig { + print "\tAdd FormField macro to config... " unless $quiet; + $session->config->addToHash( 'macros', FormField => 'FormField' ); + print "DONE!\n" unless $quiet; +} + +finish($session); # this line required + + +#---------------------------------------------------------------------------- +# Describe what our function does +#sub exampleFunction { +# my $session = shift; +# print "\tWe're doing some stuff here that you should know about... " unless $quiet; +# # and here's our code +# print "DONE!\n" unless $quiet; +#} + +#---------------------------------------------------------------------------- +# Fix calendar feed urls that had adminId attached to them until they blew up +sub fixSpacesInTaxInfo { + my $session = shift; + print "\tRemoving spaces around commas in generic tax rate information... " unless $quiet; + use WebGUI::Shop::TaxDriver::Generic; + my $taxer = WebGUI::Shop::TaxDriver::Generic->new($session); + my $taxIterator = $taxer->getItems; + while (my $taxInfo = $taxIterator->hashRef) { + my $taxId = $taxInfo->{taxId}; + $taxer->add($taxInfo); ##Automatically removes spaces now. + $taxer->delete({taxId => $taxId}); + } + print "DONE!\n" unless $quiet; +} + + +# -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- + +#---------------------------------------------------------------------------- +# Add a package to the import node +sub addPackage { + my $session = shift; + my $file = shift; + + print "\tUpgrading package $file\n" unless $quiet; + # Make a storage location for the package + my $storage = WebGUI::Storage->createTemp( $session ); + $storage->addFileFromFilesystem( $file ); + + # Import the package into the import node + my $package = eval { + my $node = WebGUI::Asset->getImportNode($session); + $node->importPackage( $storage, { + overwriteLatest => 1, + clearPackageFlag => 1, + setDefaultTemplate => 1, + } ); + }; + + if ($package eq 'corrupt') { + die "Corrupt package found in $file. Stopping upgrade.\n"; + } + if ($@ || !defined $package) { + die "Error during package import on $file: $@\nStopping upgrade\n."; + } + + return; +} + +#------------------------------------------------- +sub start { + my $configFile; + $|=1; #disable output buffering + GetOptions( + 'configFile=s'=>\$configFile, + 'quiet'=>\$quiet + ); + my $session = WebGUI::Session->open($webguiRoot,$configFile); + $session->user({userId=>3}); + my $versionTag = WebGUI::VersionTag->getWorking($session); + $versionTag->set({name=>"Upgrade to ".$toVersion}); + return $session; +} + +#------------------------------------------------- +sub finish { + my $session = shift; + updateTemplates($session); + my $versionTag = WebGUI::VersionTag->getWorking($session); + $versionTag->commit; + $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); + $session->close(); +} + +#------------------------------------------------- +sub updateTemplates { + my $session = shift; + return undef unless (-d "packages-".$toVersion); + print "\tUpdating packages.\n" unless ($quiet); + opendir(DIR,"packages-".$toVersion); + my @files = readdir(DIR); + closedir(DIR); + my $newFolder = undef; + foreach my $file (@files) { + next unless ($file =~ /\.wgpkg$/); + # Fix the filename to include a path + $file = "packages-" . $toVersion . "/" . $file; + addPackage( $session, $file ); + } +} + +#vim:ft=perl diff --git a/etc/WebGUI.conf.original b/etc/WebGUI.conf.original index c75019025..4cd59824c 100644 --- a/etc/WebGUI.conf.original +++ b/etc/WebGUI.conf.original @@ -847,6 +847,7 @@ "FetchMimeType" : "FetchMimeType", "FilePump" : "FilePump", "FileUrl" : "FileUrl", + "FormField" : "FormField", "GroupAdd" : "GroupAdd", "GroupDelete" : "GroupDelete", "GroupText" : "GroupText", diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index f700c37ad..30b824878 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -2395,6 +2395,7 @@ sub processTemplate { %{$self->get}, 'title' => $self->getTitle, 'menuTitle' => $self->getMenuTitle, + 'keywords' => $self->get('keywords'), %{$var}, ); return $template->process(\%vars); diff --git a/lib/WebGUI/Asset/Post.pm b/lib/WebGUI/Asset/Post.pm index 099e0f25b..e20460b2f 100644 --- a/lib/WebGUI/Asset/Post.pm +++ b/lib/WebGUI/Asset/Post.pm @@ -1516,12 +1516,16 @@ Extend the base method to handle cleaning up storage locations. override purge => sub { my $self = shift; - my $sth = $self->session->db->read("select storageId from Post where assetId=".$self->session->db->quote($self->getId)); - while (my ($storageId) = $sth->array) { - my $storage = WebGUI::Storage->get($self->session, $storageId); - $storage->delete if defined $storage; + my $purged = super(); + if ($purged) { + my $sth = $self->session->db->read("select storageId from Post where assetId=?",[$self->getId]); + while (my ($storageId) = $sth->array) { + my $storage = WebGUI::Storage->get($self->session, $storageId); + $storage->delete if defined $storage; + } + $sth->finish; + $self->disqualifyAsLastPost; } - $sth->finish; return super(); }; diff --git a/lib/WebGUI/Asset/Wobject/Thingy.pm b/lib/WebGUI/Asset/Wobject/Thingy.pm index ab045c1ec..42729c38c 100644 --- a/lib/WebGUI/Asset/Wobject/Thingy.pm +++ b/lib/WebGUI/Asset/Wobject/Thingy.pm @@ -1037,18 +1037,22 @@ sub getFieldValue { my $dateFormat = shift || "%z"; my $dateTimeFormat = shift; my $processedValue = $value; - my $dbh = $self->session->db->dbh; + my $session = $self->session; + my $dbh = $session->db->dbh; - if (lc $field->{fieldType} eq "date"){ - $processedValue = $self->session->datetime->epochToHuman($value,$dateFormat); + my $fieldType = lc $field->{fieldType}; + if ($fieldType eq "date"){ + my $dt = WebGUI::DateTime->new($session, $value); + $processedValue = $dt->webguiDate($dateFormat); } - elsif (lc $field->{fieldType} eq "datetime"){ - $processedValue = $self->session->datetime->epochToHuman($value,$dateTimeFormat); + elsif ($fieldType eq "datetime"){ + my $dt = WebGUI::DateTime->new($session, $value); + $processedValue = $dt->webguiDate($dateTimeFormat); } # TODO: The otherThing field type is probably also handled by getFormPlugin, so the elsif below can probably be # safely removed. However, this requires more testing than I can provide right now, so for now this stays the # way it was. - elsif ($field->{fieldType} =~ m/^otherThing/x) { + elsif ($field->{fieldType} =~ m/^otherthing/x) { my $otherThingId = $field->{fieldType}; $otherThingId =~ s/^otherThing_//x; my $tableName = 'Thingy_'.$otherThingId; diff --git a/lib/WebGUI/DateTime.pm b/lib/WebGUI/DateTime.pm index a4ae5d6a9..86753380b 100644 --- a/lib/WebGUI/DateTime.pm +++ b/lib/WebGUI/DateTime.pm @@ -491,7 +491,9 @@ sub session { Change a WebGUI format into a Strftime format. NOTE: %M in WebGUI's format has no equivalent in strftime format, so it will -be replaced with "_varmonth_". Do something with it. +be replaced with "{month}". Single digit hours are handled similarly. DateTime's +strftime will use {method} to call a method on the object to fill in that part of +the format. =cut @@ -514,13 +516,13 @@ sub webguiToStrftime { "c" => "B", "C" => "b", "d" => "d", - "D" => "e", + "D" => "{day}", "h" => "I", "H" => "l", "j" => "H", "J" => "k", "m" => "m", - "M" => "_varmonth_", + "M" => "{month}", "n" => "M", "t" => "Z", "O" => "z", @@ -587,12 +589,7 @@ sub webguiDate { my $format = $self->webguiToStrftime( shift || "%z %Z" ); - #--- %M my $datestr = $self->strftime($format); - my $temp = int($self->month); - $datestr =~ s/\%_varmonth_/$temp/g; - - #--- return return $datestr; } ####################################################################### diff --git a/lib/WebGUI/Form/AdSpace.pm b/lib/WebGUI/Form/AdSpace.pm index dfc6a45c2..472e0ae91 100644 --- a/lib/WebGUI/Form/AdSpace.pm +++ b/lib/WebGUI/Form/AdSpace.pm @@ -17,6 +17,7 @@ package WebGUI::Form::AdSpace; use strict; use base 'WebGUI::Form::SelectBox'; use WebGUI::International; +use WebGUI::AdSpace; =head1 NAME @@ -137,34 +138,19 @@ sub isDynamicCompatible { #------------------------------------------------------------------- -=head2 toHtml ( ) +=head2 new ( ) -Returns a group pull-down field. A group pull down provides a select list that provides name value pairs for all the groups in the WebGUI system. +Extend the base "new" to set options and the default value. =cut -sub toHtml { - my $self = shift; +sub new { + my $class = shift; + my $self = $class->SUPER::new(@_); my $options = { map { $_->getId => $_->get('name') } ( @{ WebGUI::AdSpace->getAdSpaces($self->session) } ) }; $self->set('defaultValue', ( keys %{$options} )[0] ); $self->set('options', $options ); - return $self->SUPER::toHtml(); -} - -#------------------------------------------------------------------- - -=head2 toHtmlAsHidden ( ) - -Creates a series of hidden fields representing the data in the list. - -=cut - -sub toHtmlAsHidden { - my $self = shift; - my $options = { map { $_->getId => $_->get('name') } ( @{ WebGUI::AdSpace->getAdSpaces($self->session) } ) }; - $self->set('defaultValue', ( keys %{$options} )[0] ); - $self->set('options', $options ); - return $self->SUPER::toHtmlAsHidden(); + return $self; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Form/ContentType.pm b/lib/WebGUI/Form/ContentType.pm index aaaa3d37b..677ac61c0 100644 --- a/lib/WebGUI/Form/ContentType.pm +++ b/lib/WebGUI/Form/ContentType.pm @@ -118,29 +118,33 @@ sub isDynamicCompatible { #------------------------------------------------------------------- -=head2 toHtml ( ) +=head2 new ( ) -Renders a select list form control. +Extend the base "new" to set options. =cut -sub toHtml { - my $self = shift; - my %types; - my $i18n = WebGUI::International->new($self->session); - foreach my $type (@{ $self->get('types') }) { - if ($type eq "text") { - $types{text} = $i18n->get(1010); - } elsif ($type eq "mixed") { - $types{mixed} = $i18n->get(1008); - } elsif ($type eq "code") { - $types{code} = $i18n->get(1011); - } elsif ($type eq "html") { - $types{html} = $i18n->get(1009); - } +sub new { + my $class = shift; + my $self = $class->SUPER::new(@_); + my %types; + my $i18n = WebGUI::International->new($self->session); + foreach my $type (@{ $self->get('types') }) { + if ($type eq "text") { + $types{text} = $i18n->get(1010); } - $self->set("options", \%types); - return $self->SUPER::toHtml(); + elsif ($type eq "mixed") { + $types{mixed} = $i18n->get(1008); + } + elsif ($type eq "code") { + $types{code} = $i18n->get(1011); + } + elsif ($type eq "html") { + $types{html} = $i18n->get(1009); + } + } + $self->set("options", \%types); + return $self; } 1; diff --git a/lib/WebGUI/Form/Country.pm b/lib/WebGUI/Form/Country.pm index a71f54aca..679b0222c 100644 --- a/lib/WebGUI/Form/Country.pm +++ b/lib/WebGUI/Form/Country.pm @@ -245,20 +245,20 @@ sub isDynamicCompatible { #------------------------------------------------------------------- -=head2 toHtml ( ) +=head2 new ( ) -Renders a country picker control. +Extend the base "new" to set options. =cut -sub toHtml { - my $self = shift; - +sub new { + my $class = shift; + my $self = $class->SUPER::new(@_); my %countries; tie %countries, 'Tie::IxHash'; %countries = map {$_ => $_} getCountries(); - $self->set("options", \%countries); - return $self->SUPER::toHtml(); + $self->set('options', \%countries); + return $self; } 1; diff --git a/lib/WebGUI/Form/DatabaseLink.pm b/lib/WebGUI/Form/DatabaseLink.pm index 1a4a841eb..57fb79550 100644 --- a/lib/WebGUI/Form/DatabaseLink.pm +++ b/lib/WebGUI/Form/DatabaseLink.pm @@ -145,16 +145,17 @@ sub isDynamicCompatible { #------------------------------------------------------------------- -=head2 toHtml ( ) +=head2 new ( ) -Renders a database connection picker control. +Extend the base "new" to set options. =cut -sub toHtml { - my $self = shift; +sub new { + my $class = shift; + my $self = $class->SUPER::new(@_); $self->set("options", WebGUI::DatabaseLink->getList($self->session)); - return $self->SUPER::toHtml(); + return $self; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Form/FilterContent.pm b/lib/WebGUI/Form/FilterContent.pm index c5e620b1c..7c80bb78f 100644 --- a/lib/WebGUI/Form/FilterContent.pm +++ b/lib/WebGUI/Form/FilterContent.pm @@ -144,26 +144,27 @@ sub isDynamicCompatible { #------------------------------------------------------------------- -=head2 toHtml ( ) +=head2 new ( ) -Returns a select list containing the content filter options. This is for use with WebGUI::HTML::filter(). +Extend the base "new" to set options. =cut -sub toHtml { - my $self = shift; +sub new { + my $class = shift; + my $self = $class->SUPER::new(@_); my $i18n = WebGUI::International->new($self->session); - my %filter; - tie %filter, 'Tie::IxHash'; - %filter = ( - 'none'=>$i18n->get(420), - 'macros'=>$i18n->get(891), - 'javascript'=>$i18n->get(526), - 'most'=>$i18n->get(421), - 'all'=>$i18n->get(419) - ); + my %filter; + tie %filter, 'Tie::IxHash'; + %filter = ( + 'none' => $i18n->get(420), + 'macros' => $i18n->get(891), + 'javascript' => $i18n->get(526), + 'most' => $i18n->get(421), + 'all' => $i18n->get(419), + ); $self->set("options", \%filter); - return $self->SUPER::toHtml(); + return $self; } 1; diff --git a/lib/WebGUI/Form/Group.pm b/lib/WebGUI/Form/Group.pm index c662cd722..e4eb48a55 100644 --- a/lib/WebGUI/Form/Group.pm +++ b/lib/WebGUI/Form/Group.pm @@ -186,34 +186,21 @@ sub isDynamicCompatible { #------------------------------------------------------------------- -=head2 toHtml ( ) +=head2 new ( ) -Returns a group pull-down field. A group pull down provides a select list that provides name value pairs for all the groups in the WebGUI system. +Extend the base "new" to set options. =cut -sub toHtml { - my $self = shift; +sub new { + my $class = shift; + my $self = $class->SUPER::new(@_); 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")); - return $self->SUPER::toHtml(); -} - -#------------------------------------------------------------------- - -=head2 toHtmlAsHidden ( ) - -Creates a series of hidden fields representing the data in the list. - -=cut - -sub toHtmlAsHidden { - my $self = shift; - $self->set("options", $self->session->db->buildHashRef("select groupId,groupName from groups")); - return $self->SUPER::toHtmlAsHidden(); + return $self; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Form/LdapLink.pm b/lib/WebGUI/Form/LdapLink.pm index 8adf4b531..553a8b586 100644 --- a/lib/WebGUI/Form/LdapLink.pm +++ b/lib/WebGUI/Form/LdapLink.pm @@ -152,30 +152,17 @@ sub isDynamicCompatible { #------------------------------------------------------------------- -=head2 toHtml ( ) +=head2 new ( ) -Renders a database connection picker control. +Extend the base "new" to set options. =cut -sub toHtml { - my $self = shift; +sub new { + my $class = shift; + my $self = $class->SUPER::new(@_); $self->set("options", WebGUI::LDAPLink->getList($self->session)); - return $self->SUPER::toHtml(); -} - -#------------------------------------------------------------------- - -=head2 toHtmlAsHidden ( ) - -Creates a series of hidden fields representing the data in the list. - -=cut - -sub toHtmlAsHidden { - my $self = shift; - $self->set("options", WebGUI::LDAPLink->getList($self->session)); - return $self->SUPER::toHtmlAsHidden(); + return $self; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Form/MatrixCompare.pm b/lib/WebGUI/Form/MatrixCompare.pm index 4ef4e4c5e..245d0716a 100644 --- a/lib/WebGUI/Form/MatrixCompare.pm +++ b/lib/WebGUI/Form/MatrixCompare.pm @@ -122,15 +122,7 @@ Shows either Yes or No. sub getValueAsHtml { my $self = shift; - my $i18n = WebGUI::International->new($self->session,'Form_MatrixCompare'); - my %options = ( - 0 => $i18n->get('no'), - 1 => $i18n->get('limited'), - 2 => $i18n->get('costs extra'), - 3 => $i18n->get('free add on'), - 4 => $i18n->get('yes'), - ); - return $options{$self->getOriginalValue}; + return $self->get('options')->{$self->getOriginalValue}; } #------------------------------------------------------------------- @@ -147,14 +139,15 @@ sub isDynamicCompatible { #------------------------------------------------------------------- -=head2 toHtml ( ) +=head2 new ( ) -Renders a fieldType selector. +Extend the base "new" to set options. =cut -sub toHtml { - my $self = shift; +sub new { + my $class = shift; + my $self = $class->SUPER::new(@_); my $i18n = WebGUI::International->new($self->session,'Form_MatrixCompare'); my %options; tie %options, "Tie::IxHash"; @@ -167,10 +160,7 @@ sub toHtml { ); $self->set('options', \%options); $self->set('defaultValue',0); - return $self->SUPER::toHtml(); + return $self; } - - 1; - diff --git a/lib/WebGUI/Form/MatrixFieldType.pm b/lib/WebGUI/Form/MatrixFieldType.pm index e7fa6361d..19717feaf 100644 --- a/lib/WebGUI/Form/MatrixFieldType.pm +++ b/lib/WebGUI/Form/MatrixFieldType.pm @@ -126,27 +126,25 @@ sub isDynamicCompatible { #------------------------------------------------------------------- -=head2 toHtml ( ) +=head2 new ( ) -Renders a fieldType selector. +Extend the base "new" to set options. =cut -sub toHtml { - my $self = shift; - my %options; - tie %options, "Tie::IxHash"; +sub new { + my $class = shift; + my $self = $class->SUPER::new(@_); + my %options; + tie %options, "Tie::IxHash"; %options = ( MatrixCompare => WebGUI::Pluggable::instanciate('WebGUI::Form::MatrixCompare', 'getName',[$self->session]), - SelectBox => WebGUI::Pluggable::instanciate('WebGUI::Form::SelectBox', 'getName',[$self->session]), - Combo => WebGUI::Pluggable::instanciate('WebGUI::Form::Combo', 'getName',[$self->session]), + SelectBox => WebGUI::Pluggable::instanciate('WebGUI::Form::SelectBox', 'getName',[$self->session]), + Combo => WebGUI::Pluggable::instanciate('WebGUI::Form::Combo', 'getName',[$self->session]), ); $self->set('options', \%options); $self->set('defaultValue','MatrixCompare'); - return $self->SUPER::toHtml(); + return $self; } - - 1; - diff --git a/lib/WebGUI/Form/MimeType.pm b/lib/WebGUI/Form/MimeType.pm index ae58397d4..7d47afc9b 100644 --- a/lib/WebGUI/Form/MimeType.pm +++ b/lib/WebGUI/Form/MimeType.pm @@ -38,6 +38,18 @@ The following methods are specifically available from this class. Check the supe #------------------------------------------------------------------- +=head2 areOptionsSettable ( ) + +Returns 0. + +=cut + +sub areOptionsSettable { + return 0; +} + +#------------------------------------------------------------------- + =head2 definition ( [ additionalTerms ] ) See the super class for additional details. @@ -92,24 +104,24 @@ sub isDynamicCompatible { #------------------------------------------------------------------- -=head2 toHtml ( ) +=head2 new ( ) -Renders a database connection picker control. +Extend the base "new" to set options. =cut -sub toHtml { - my $self = shift; - my $mimeTypes; - foreach ('text/html','text/css','text/javascript','text/plain','text/xml','application/xml') { - $mimeTypes->{$_}=$_; - } +sub new { + my $class = shift; + my $self = $class->SUPER::new(@_); + my $mimeTypes; + foreach ('text/html','text/css','text/javascript','text/plain','text/xml','application/xml') { + $mimeTypes->{$_}=$_; + } + ##Handle the combo box my $value = $self->getOriginalValue(); $mimeTypes->{$value} = $value; - $self->set("options", $mimeTypes); - return $self->SUPER::toHtml(); + $self->set("options", $mimeTypes); + return $self; } - 1; - diff --git a/lib/WebGUI/Form/TimeZone.pm b/lib/WebGUI/Form/TimeZone.pm index 2c98a315b..4a56619c3 100644 --- a/lib/WebGUI/Form/TimeZone.pm +++ b/lib/WebGUI/Form/TimeZone.pm @@ -110,24 +110,8 @@ sub new { my $defaultValue = $self->get('defaultValue'); $defaultValue =~ tr/ /_/; $self->set('defaultValue', $defaultValue); + $self->set("options", $self->session->datetime->getTimeZones()); return $self; } -#------------------------------------------------------------------- - -=head2 toHtml ( ) - -Renders a database connection picker control. - -=cut - -sub toHtml { - my $self = shift; - $self->set("options", $self->session->datetime->getTimeZones()); - return $self->SUPER::toHtml(); -} - - - 1; - diff --git a/lib/WebGUI/Form/Vendor.pm b/lib/WebGUI/Form/Vendor.pm index 367268cbe..e8d67d8dd 100644 --- a/lib/WebGUI/Form/Vendor.pm +++ b/lib/WebGUI/Form/Vendor.pm @@ -141,30 +141,17 @@ sub isDynamicCompatible { #------------------------------------------------------------------- -=head2 toHtml ( ) +=head2 new ( ) -Returns a group pull-down field. A group pull down provides a select list that provides name value pairs for all the vendors in the WebGUI system. +Extend the base "new" to set options. =cut -sub toHtml { - my $self = shift; +sub new { + my $class = shift; + my $self = $class->SUPER::new(@_); $self->set('options', WebGUI::Shop::Vendor->getVendors($self->session, {asHashRef=>1})); - return $self->SUPER::toHtml(); -} - -#------------------------------------------------------------------- - -=head2 toHtmlAsHidden ( ) - -Creates a series of hidden fields representing the data in the list. - -=cut - -sub toHtmlAsHidden { - my $self = shift; - $self->set("options", WebGUI::Shop::Vendor->getVendors($self->session, {asHashRef=>1})); - return $self->SUPER::toHtmlAsHidden(); + return $self; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Form/Workflow.pm b/lib/WebGUI/Form/Workflow.pm index 5c9f63707..d5b55a115 100644 --- a/lib/WebGUI/Form/Workflow.pm +++ b/lib/WebGUI/Form/Workflow.pm @@ -141,14 +141,15 @@ sub isDynamicCompatible { #------------------------------------------------------------------- -=head2 toHtml ( ) +=head2 new ( ) -Renders a template picker control. +Extend the base "new" to set options. =cut -sub toHtml { - my $self = shift; +sub new { + my $class = shift; + my $self = $class->SUPER::new(@_); my $workflowList = WebGUI::Workflow->getList($self->session, $self->get("type")); if ( $self->get("none") ) { @@ -157,7 +158,7 @@ sub toHtml { } $self->set("options", $workflowList); - return $self->SUPER::toHtml(); + return $self; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Macro/FormField.pm b/lib/WebGUI/Macro/FormField.pm new file mode 100644 index 000000000..1410ba29b --- /dev/null +++ b/lib/WebGUI/Macro/FormField.pm @@ -0,0 +1,64 @@ +package WebGUI::Macro::FormField; + +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2008 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +use strict; + +=head1 NAME + +Package WebGUI::Macro::FormField + +=head1 DESCRIPTION + +Renders an instance of a Form object. + +=head2 process( $session, $type, $field_name [, $default_value, @form_constructor_arguments ] ) + +C<$type> is one of the L subclasses in L. + +C<$field_name> is the name the field will be given in the HTML "name" attribute. + +C<$default_value> is the currently selected value to use for the form field if no GET/POST parameter or field of the +current asset of the same name has a value. + +A form posted form parameter of the same name as the C<$field_name>, if present, will be used instead of the default. +Failing that, an attribute of the current asset of the same name, if present, will be used instead of the default value. + +C<@form_constructor_arguments> get passed to the L subclass constructor. + +=cut + + +sub process { + my $session = shift; + my $type = shift; + my $name = shift; + my $default_value = shift || ''; + my @extras = @_; + + my $form_class = "WebGUI::Form::" . ucfirst $type; + + my $value = $session->form->get($name); + $value ||= $session->asset->get($name) if $session->asset; + $value ||= $default_value; + + my $control = eval { WebGUI::Pluggable::instanciate($form_class, 'new', [ $session, { name => $name, value => $value, @extras } ]) }; + if ($@) { + $session->log->warn("FormField Macro could not load class ``$form_class'': $@"); + return ''; + } + + return $control->toHtml; +} + +1; + + diff --git a/lib/WebGUI/Shop/TaxDriver/Generic.pm b/lib/WebGUI/Shop/TaxDriver/Generic.pm index ad26ec882..65d04a1d8 100644 --- a/lib/WebGUI/Shop/TaxDriver/Generic.pm +++ b/lib/WebGUI/Shop/TaxDriver/Generic.pm @@ -86,6 +86,10 @@ sub add { unless exists($params->{taxRate}) and defined $params->{taxRate}; $params->{taxId} = 'new'; + ##Remove spaces around commas, which will break tax lookups + foreach my $param (qw/country city state code/) { + $params->{$param} =~ s/\s*,\s*/,/g; + } my $id = $self->session->db->setRow('tax_generic_rates', 'taxId', $params); return $id; } @@ -213,6 +217,24 @@ sub getAllItems { #------------------------------------------------------------------- +=head2 getItem ( $taxId ) + +Returns all data for one tax item as a hash reference. + +=head3 $taxId + +The identifier for the row of tax data to return. + +=cut + +sub getItem { + my $self = shift; + my $result = $self->session->db->quickHashRef('select * from tax_generic_rates where taxId=?',[shift]); + return $result; +} + +#------------------------------------------------------------------- + =head2 getItems ( ) Returns a WebGUI::SQL::Result object for accessing all of the data in the tax table. This diff --git a/lib/WebGUI/User.pm b/lib/WebGUI/User.pm index 40facda82..72d633fdc 100644 --- a/lib/WebGUI/User.pm +++ b/lib/WebGUI/User.pm @@ -711,8 +711,9 @@ sub getGroupIdsRecursive { my $self = shift; my $groupingIds = $self->getGroups( "withoutExpired" ); my %groupIds = map { $_ => 1 } @{ $groupingIds }; - while ( my $groupingId = shift @{ $groupingIds } ) { + GROUPINGID: while ( my $groupingId = shift @{ $groupingIds } ) { my $group = WebGUI::Group->new( $self->session, $groupingId ); + next GROUPINGID unless $group; for my $groupGroupingId ( @{ $group->getGroupsFor } ) { if ( !$groupIds{ $groupGroupingId } ) { push @{ $groupingIds }, $groupGroupingId; diff --git a/lib/WebGUI/i18n/English/Asset_Thingy.pm b/lib/WebGUI/i18n/English/Asset_Thingy.pm index a60fc6bd4..bcd651ab8 100644 --- a/lib/WebGUI/i18n/English/Asset_Thingy.pm +++ b/lib/WebGUI/i18n/English/Asset_Thingy.pm @@ -456,8 +456,8 @@ ipAddress etc?|, 'default value description' => { message => q|Enter the default value (if any) for the field. If you have defined the possible values for -this field using a hash, then the default value has to be a key in that hash, and not a value. For Yes/No fields, enter "yes" to select "Yes" and "no" to select "No".|, - lastUpdated => 1223372150, +this field using a hash, then the default value has to be a key in that hash, and not a value. For Yes/No fields, enter "yes" to select "Yes" and "no" to select "No". For Date and Date/Time fields, enter an epoch date, or a date in YYYY-MM-DD HH:MM:SS, the ISO 9601 format with optional time|, + lastUpdated => 1309814047, }, 'default value subtext' => { diff --git a/sbin/installClass.pl b/sbin/installClass.pl index 8282bb622..4cb13d2a6 100755 --- a/sbin/installClass.pl +++ b/sbin/installClass.pl @@ -56,6 +56,15 @@ pod2usage("$0: Must specify a configFile") die "Config file '$configFile' does not exist!\n" if !-f WebGUI::Paths->configBase . '/' . $configFile; +foreach my $libDir ( readLines( "preload.custom" ) ) { + if ( !-d $libDir ) { + warn "WARNING: Not adding lib directory '$libDir' from preload.custom: Directory does not exist.\n"; + next; + } + unshift @INC, $libDir; +} + + # Open the session my $session = WebGUI::Session->open( $configFile ); $session->user( { userId => 3 } ); @@ -96,6 +105,24 @@ else { $session->var->end; $session->close; +#------------------------------------------------- +sub readLines { + my $file = shift; + my @lines; + if (open(my $fh, '<', $file)) { + while (my $line = <$fh>) { + $line =~ s/#.*//; + $line =~ s/^\s+//; + $line =~ s/\s+$//; + next if !$line; + push @lines, $line; + } + close $fh; + } + return @lines; +} + + __END__ =head1 NAME diff --git a/sbin/testEnvironment.pl b/sbin/testEnvironment.pl index 6d2117abd..766311920 100755 --- a/sbin/testEnvironment.pl +++ b/sbin/testEnvironment.pl @@ -177,6 +177,7 @@ checkModule('App::Cmd', '0.311' ); checkModule('Devel::StackTrace', '1.27' ); checkModule('Devel::StackTrace::WithLexicals', '0.03' ); checkModule('Data::ICal', '0.16' ); +checkModule('common::sense', '3.2' ); checkModule('Geo::Coder::Googlev3', '0.07' ); checkModule('IO::File::WithPath', ); diff --git a/share/create.sql b/share/create.sql index 58c64d35a..bd6527d88 100644 --- a/share/create.sql +++ b/share/create.sql @@ -2520,7 +2520,7 @@ ALTER TABLE `vendor` ENABLE KEYS; ALTER TABLE `wobject` DISABLE KEYS; INSERT INTO `wobject` VALUES (0,'This is the latest news from Plain Black and WebGUI pulled directly from the site every hour.','fK-HMSboA3uu0c1KYkYspA','stevestyle000000000003','PBtmpl0000000000000111',1124395696,'stevestyle000000000003'),(1,NULL,'PBasset000000000000002','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'7-0-style0000000000026','PBtmpl0000000000000060','',1147642499,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000001','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000014','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000015','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000016','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000017','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000018','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000019','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000020','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000021','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000002','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000006','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000007','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000008','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000009','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000010','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000011','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000012','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'PBnav00000000000000013','PBtmpl0000000000000060','PBtmpl0000000000000111',1124395696,'PBtmpl0000000000000060'),(0,NULL,'7-0-style0000000000070','PBtmpl0000000000000060','PBtmpl0000000000000060',1147642510,'PBtmpl0000000000000060'),(1,NULL,'7-0-style0000000000001','PBtmpl0000000000000060','',1147642492,'PBtmpl0000000000000060'),(1,NULL,'7-0-style0000000000031','PBtmpl0000000000000060','',1147642500,'PBtmpl0000000000000060'),(0,NULL,'7-0-style0000000000025','PBtmpl0000000000000060','',1147642498,'PBtmpl0000000000000060'),(1,NULL,'PBasset000000000000003','PBtmpl0000000000000060','PBtmpl0000000000000111',1147642437,'PBtmpl0000000000000060'),(1,NULL,'nbSrhXZQuxIjhWFaFPSuVA','PBtmpl0000000000000060','',1147642465,'PBtmpl0000000000000060'),(1,NULL,'N13SD1Fpqk00UgBt1Z8ivQ','PBtmpl0000000000000060','',1147642470,'PBtmpl0000000000000060'),(1,NULL,'-WM2dt0ZGpDasuL2wWocxg','PBtmpl0000000000000060','PBtmpl0000000000000111',1222803056,'PBtmpl0000000000000060'),(1,NULL,'3uuBf8cYuj1sew2OJXl9tg','PBtmpl0000000000000060','',1147642470,'PBtmpl0000000000000060'),(1,NULL,'cj2y4papTVGZRFdwTI-_fw','PBtmpl0000000000000060','',1147642475,'PBtmpl0000000000000060'),(1,NULL,'bBzO4CWjqU_ile3gf5Iypw','PBtmpl0000000000000060','',1147642475,'PBtmpl0000000000000060'),(1,NULL,'Da6KWn805L4B5e4HFgQRQA','PBtmpl0000000000000060','',1147642479,'PBtmpl0000000000000060'),(1,NULL,'bbiA9Zq5Gy2oCFBlILO3QA','PBtmpl0000000000000060','',1147642480,'PBtmpl0000000000000060'),(1,NULL,'Efe2W0UgrSRDltNJ87jlfg','PBtmpl0000000000000060','',1147642480,'PBtmpl0000000000000060'),(1,NULL,'9wKWdum0_8z-OhhquWLtSQ','PBtmpl0000000000000060','',1147642483,'PBtmpl0000000000000060'),(1,NULL,'CSN-ZON7Uwv8kxf3F1fh5Q','PBtmpl0000000000000060','',1147642484,'PBtmpl0000000000000060'),(1,NULL,'TCtybxdqmdwdvRn555zpCQ','PBtmpl0000000000000060','',1147642484,'PBtmpl0000000000000060'),(1,NULL,'pbproto000000000000002','PBtmpl0000000000000060','',1163019036,'PBtmpl0000000000000060'),(1,NULL,'tempspace0000000000000','PBtmpl0000000000000060','PBtmpl0000000000000060',1185754574,'PBtmpl0000000000000060'),(1,NULL,'Tsg7xmPYv782j6IVz7yHFg','PBtmpl0000000000000060','PBtmpl0000000000000111',1213244777,'PBtmpl0000000000000060'),(1,NULL,'TYo2Bwl7aafzTtdHlS-arQ','PBtmpl0000000000000060','PBtmpl0000000000000060',1211664878,'PBtmpl0000000000000060'),(1,NULL,'6tK47xsaIH-ELw0IBo0uRQ','PBtmpl0000000000000060','PBtmpl0000000000000111',1210777115,'PBtmpl0000000000000060'),(1,NULL,'gbnRhcWNk1iQe32LFEB5eQ','PBtmpl0000000000000060','PBtmpl0000000000000111',1212086102,'PBtmpl0000000000000060'),(1,NULL,'6D4Z-oruXPS6OlH_Kx8pBg','PBtmpl0000000000000060','PBtmpl0000000000000111',1209509389,'PBtmpl0000000000000060'),(1,NULL,'C5fPz-Wg85vkYRvCdl-Xqw','PBtmpl0000000000000060','PBtmpl0000000000000111',1212160830,'PBtmpl0000000000000060'),(1,NULL,'jnYdqDkUR8x7Pv2eGR1qTA','PBtmpl0000000000000060','PBtmpl0000000000000111',1216250666,'PBtmpl0000000000000060'),(1,NULL,'2OcUWHVsu_L1sDFzIMWYqw','PBtmpl0000000000000060','PBtmpl0000000000000111',1222803070,'PBtmpl0000000000000060'),(1,NULL,'zyWi26q9na-iiZqL4yedog','PBtmpl0000000000000060','PBtmpl0000000000000111',1222803114,'PBtmpl0000000000000060'),(1,NULL,'tBL7BWiQRZFed2Y-Zjo9tQ','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803200,'PBtmpl0000000000000060'),(1,NULL,'GdkQpvjRtJqtzOUbwIIQRA','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803205,'PBtmpl0000000000000060'),(1,NULL,'tnc5iYyynX2hfdEs9D3P8w','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803213,'PBtmpl0000000000000060'),(1,NULL,'vgXdBcFTqU7h4wBG1ewdBw','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803217,'PBtmpl0000000000000060'),(1,NULL,'hcFlqnXlsmC1ujN6Id0F0A','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803234,'PBtmpl0000000000000060'),(1,NULL,'eRJR52fvlaxfetv3DQkQYw','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803238,'PBtmpl0000000000000060'),(1,NULL,'5HIDHq5lAWHV5gpYGS0zLg','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803244,'PBtmpl0000000000000060'),(1,NULL,'rYEFwXXo0tkGhQTcbDibvg','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803249,'PBtmpl0000000000000060'),(1,NULL,'V3l5S5TtI7wMm1WpIMhvOA','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803253,'PBtmpl0000000000000060'),(1,NULL,'nqNbSUAhk9Vd1zda2SCz9A','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803258,'PBtmpl0000000000000060'),(1,NULL,'y8XkRdxIperLKkJ3bL5sSQ','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803264,'PBtmpl0000000000000060'),(1,NULL,'vTymIDYL2YqEh6PV50F7ew','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803302,'PBtmpl0000000000000060'),(1,NULL,'lo1ac3BsoJx3ijGQ3gR-bQ','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803309,'PBtmpl0000000000000060'),(1,NULL,'huASapWvFDzqwOSbcN-JFQ','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803313,'PBtmpl0000000000000060'),(1,NULL,'9A-mg2gwWmaYi9o_1C7ArQ','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803338,'PBtmpl0000000000000060'),(1,NULL,'yD1SMHelczihzjEmx6eXBA','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803342,'PBtmpl0000000000000060'),(1,NULL,'pV7GnZdpjR3XpZaSINIoeg','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803347,'PBtmpl0000000000000060'),(1,NULL,'71e17KeduiXgODLMlUxiow','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803352,'PBtmpl0000000000000060'),(1,NULL,'Ik9HHky10DIyFTKehUD1dw','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803478,'PBtmpl0000000000000060'),(1,NULL,'NywJYmGWe1f6EBXJnWg9Xg','PBtmpl0000000000000060','PBtmpl0000000000000111',1222803638,'PBtmpl0000000000000060'),(1,NULL,'AgyFhx3eXlfZXNp2MkrsiQ','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803665,'PBtmpl0000000000000060'),(1,NULL,'F7MAQ-cpuvQ1KuC7J4P5zQ','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803673,'PBtmpl0000000000000060'),(1,NULL,'BmLaN4rmAANkCglXUViEbg','PBtmpl0000000000000060','PBtmpl0000000000000060',1222803871,'PBtmpl0000000000000060'),(1,NULL,'X7DrzUcj8pOKFa_6k9D5iw','PBtmpl0000000000000060','PBtmpl0000000000000060',1222804045,'PBtmpl0000000000000060'),(1,NULL,'UL-ItI4L1Z6-WSuhuXVvsQ','stevestyle000000000003','PBtmpl0000000000000111',1225139673,'stevestyle000000000003'),(1,NULL,'7-0-style0000000000049','PBtmpl0000000000000060','PBtmpl0000000000000060',1224117144,'PBtmpl0000000000000060'),(0,NULL,'jVKLVakT_iA2010_oEuAwg','PBtmpl0000000000000060','PBtmpl0000000000000060',1224116526,'PBtmpl0000000000000060'),(1,'

 

','QpmlAiYZz6VsKBM-_0wXaw','stevestyle000000000003','PBtmpl0000000000000111',1224616691,'stevestyle000000000003'),(1,NULL,'HPDOcsj4gBme8D4svHodBw','PBtmpl0000000000000060','PBtmpl0000000000000111',1225404573,'PBtmpl0000000000000060'),(1,NULL,'IZkrow_zwvbf4FCH-taVTQ','PBtmpl0000000000000060','PBtmpl0000000000000111',1226011853,'PBtmpl0000000000000060'),(1,NULL,'K0YjxqOqr7RupSo6sIdcAg','PBtmpl0000000000000060','PBtmpl0000000000000111',1227074310,'PBtmpl0000000000000060'),(1,NULL,'_ilRXNR3s8F2vGJ_k9ePcg','PBtmpl0000000000000060','PBtmpl0000000000000111',1226643205,'PBtmpl0000000000000060'),(1,NULL,'qaVcU0FFzzraMX_bzELqzw','PBtmpl0000000000000060','PBtmpl0000000000000111',1227074362,'PBtmpl0000000000000060'),(1,NULL,'QHn6T9rU7KsnS3Y70KCNTg','PBtmpl0000000000000060','PBtmpl0000000000000111',1233173545,'PBtmpl0000000000000060'),(1,NULL,'HW-sPoDDZR8wBZ0YgFgPtg','PBtmpl0000000000000060','PBtmpl0000000000000111',1227634350,'PBtmpl0000000000000060'),(1,NULL,'AOjPG2NHgfL9Cq6dDJ7mew','PBtmpl0000000000000060','PBtmpl0000000000000111',1236960881,'PBtmpl0000000000000060'),(1,NULL,'jmlI9IK-lV8n2WMYmmPhAA','PBtmpl0000000000000060','PBtmpl0000000000000111',1238106173,'PBtmpl0000000000000060'),(1,NULL,'6uvSLY-ak_w4p_wS8q33cA','PBtmpl0000000000000060','PBtmpl0000000000000111',1239213092,'PBtmpl0000000000000060'),(1,NULL,'GaBAW-2iVhLMJaZQzVLE5A','stevestyle000000000003','PBtmpl0000000000000111',1240103565,'stevestyle000000000003'),(1,'

Templates for the Friend Manager

','lo1rpxn3t8YPyKGers5eQg','PBtmpl0000000000000060','PBtmpl0000000000000111',1238625621,'PBtmpl0000000000000060'),(1,NULL,'aNNC62qLAS6TB-0_MCYjsw','PBtmpl0000000000000060','PBtmpl0000000000000060',1246969327,'PBtmpl0000000000000060'),(1,NULL,'BFfNj5wA9bDw8H3cnr8pTw','PBtmpl0000000000000060','PBtmpl0000000000000060',1247046273,'PBtmpl0000000000000060'),(1,NULL,'f_tn9FfoSfKWX43F83v_3w','PBtmpl0000000000000060','PBtmpl0000000000000060',1247053009,'PBtmpl0000000000000060'),(1,NULL,'oGfxez5sksyB_PcaAsEm_Q','PBtmpl0000000000000060','PBtmpl0000000000000060',1247053097,'PBtmpl0000000000000060'),(1,NULL,'tPagC0AQErZXjLFZQ6OI1g','PBtmpl0000000000000060','PBtmpl0000000000000060',1246966459,'PBtmpl0000000000000060'),(1,NULL,'GYaFxnMu9UsEG8oanwB6TA','PBtmpl0000000000000060','PBtmpl0000000000000060',1246965871,'PBtmpl0000000000000060'),(1,NULL,'VZK3CRgiMb8r4dBjUmCTgQ','PBtmpl0000000000000060','PBtmpl0000000000000060',1247046242,'PBtmpl0000000000000060'),(1,NULL,'tXwf1zaOXTvsqPn6yu-GSw','PBtmpl0000000000000060','PBtmpl0000000000000060',1246965607,'PBtmpl0000000000000060'),(1,NULL,'5bnNzteN7w3NnK9mF4XiCg','PBtmpl0000000000000060','PBtmpl0000000000000060',1250243000,'PBtmpl0000000000000060'),(1,NULL,'RSAMkc6WQmfRE3TOr1_3Mw','PBtmpl0000000000000060','PBtmpl0000000000000111',1250243000,'PBtmpl0000000000000060'),(1,NULL,'fowHfgOkJtAxdst7rugTog','PBtmpl0000000000000060','PBtmpl0000000000000111',1252595993,'PBtmpl0000000000000060'),(1,NULL,'TvOZs8U1kRXLtwtmyW75pg','PBtmpl0000000000000060','PBtmpl0000000000000060',1256092368,'PBtmpl0000000000000060'),(1,NULL,'4qh0kIsFUdd4Ox-Iu1JZgg','PBtmpl0000000000000060','PBtmpl0000000000000111',1257311886,'PBtmpl0000000000000060'),(1,'

 

','-K8Hj45mbelljN9-0CXZxg','PBtmpl0000000000000060','PBtmpl0000000000000060',1257311887,'PBtmpl0000000000000060'),(1,NULL,'P_4uog81vSUK4KxuW_4GUA','PBtmpl0000000000000060','PBtmpl0000000000000111',1258524916,'PBtmpl0000000000000060'),(0,NULL,'t87D1138NhPHhA23-hozBA','PBtmpl0000000000000060','PBtmpl0000000000000060',1273032716,'PBtmpl0000000000000060'),(0,NULL,'QtBumey5ffc-xffRp1-7Aw','PBtmpl0000000000000060','PBtmpl0000000000000060',1273032716,'PBtmpl0000000000000060'),(1,NULL,'x_hiUi1XZloBvV47Obnu8Q','OiJNwP1gAlcva8_yOtL4gA','PBtmpl0000000000000111',1273032718,'PBtmpl0000000000000060'),(0,NULL,'UUwEL6hLEPdrnkZnKRzFYQ','OiJNwP1gAlcva8_yOtL4gA','PBtmpl0000000000000111',1273032718,'PBtmpl0000000000000060'),(1,NULL,'Q4uX_C557arTp6D_jwB1jQ','PBtmpl0000000000000060','PBtmpl0000000000000060',1273032720,'PBtmpl0000000000000060'),(1,NULL,'GNOAsX98vCsl0JRwfwL-gg','PBtmpl0000000000000060','PBtmpl0000000000000060',1277868921,'PBtmpl0000000000000060'),(1,NULL,'_iHetEvMQUOoxS-T2CM0sQ','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1273172789,'stevestyle000000000003'),(0,'

\nCongratulations on successfully installing the WebGUI Content Engine®. If you used the Site Starter to select a set of default pages, you will see those pages in the site navigation. You will also notice that a number of additional pages appear, such as this page. These are default pages added for your convenience to help you get started with WebGUI and find the resources you need. Feel free to remove these extra pages whenever you are ready.

\n

To get started managing content, download the PDF document below. This document provides a basic introduction to the WebGUI user interface. 

\n

WebGUI Basics (PDF)

\n

Once you have read this document, you may want to head over to the Documentation section where you can find more WebGUI resources.

','bX5rYxb6tZ9docY6sUhBlw','Qk24uXao2yowR6zxbVJ0xA','stevestyle000000000003',1278013772,'stevestyle000000000003'),(1,'

Plain Black® created the WebGUI Content Engine® and is here to answer \nyour questions and provide you with services to make sure your WebGUI \nimplementation is entirely successful. We bend over backwards to make \nsure you\'re a success. Contact us today to \nsee how we can help you.

','8Bb8gu-me2mhL3ljFyiWLg','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1271359194,'stevestyle000000000003'),(1,'

Plain Black provides support packages to fit any budget or need. Start out with online support which costs only $500 per year, or work with Plain Black to build a custom support package tailored to your specific needs. No matter what level of support you purchase, you will get personalized and friendly service in a timely manner.

','ix1p0AbwKAz8QWB-T-HHfg','Qk24uXao2yowR6zxbVJ0xA','stevestyle000000000003',1271359087,'stevestyle000000000003'),(1,'

Plain Black\'s professionally trained WebGUI experts can handle the task\nof hosting your web site, intranet, or extranet. Let us deal with upgrades, security, and server management so you focus on building your WebGUI site, which is where your time and expertise should be spent. And when you sign up with hosting, online support is included!

','iCYOjohB9SKvAPr6bXElKA','Qk24uXao2yowR6zxbVJ0xA','stevestyle000000000003',1271445525,'stevestyle000000000003'),(1,'

WebGUI\'s robust API allows for easy customization. Plain Black\'s team of developers can create any features you need for your site. We\'ve built hundreds of custom applications for people. From simple macros, to custom single sign on systems, to applications that will manage your entire company, our team will leverage the power of WebGUI to your advantage.

','4Yfz9hqBqM8OYMGuQK8oLw','Qk24uXao2yowR6zxbVJ0xA','stevestyle000000000003',1271352537,'stevestyle000000000003'),(1,'

Branding and visual appeal are powerful marketing tools. Don\'t let your site become a wallflower. Plain Black\'s professional design team can create a custom design to make your site stand out. Our team is fast, easy to work with, and can even migrate your existing content into your new WebGUI site.

','Wl8WZ43g2rK5AYr9o4zY7w','Qk24uXao2yowR6zxbVJ0xA','stevestyle000000000003',1271445539,'stevestyle000000000003'),(1,'

Let our team of professional translators bring your site to new customers by translating your content into additional languages. Our translation services are never machine automated. They\'re always done by professional translators that have years of experience reading, writing, and speaking many languages.

','LBuiKzg2mWwmOPS9AgV3bg','Qk24uXao2yowR6zxbVJ0xA','stevestyle000000000003',1271348789,'stevestyle000000000003'),(1,'

Now that you have a brilliant WebGUI site, you need to get people to visit it. We can help there too. Our marketing specialists can work with you to develop and execute the right combination of search engine placement, advertising buys, and affilliate programs to ensure your site gets the traffic it needs.

','jTNggl7AoVSUc_ZzrvuCmw','Qk24uXao2yowR6zxbVJ0xA','stevestyle000000000003',1271348789,'stevestyle000000000003'),(1,'

With any large system, having the right documentation to get you started is mandatory. The good news is that WebGUI has abundant documentation.

','mTOiwwk3q4k9g5-XykXhPA','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1271349647,'stevestyle000000000003'),(1,'

The WebGUI project community is a diverse and talented group. If you \nwould like to contribute back to the project there are many ways to \nbecome involved.

','2TqQc4OISddWCZmRY1_m8A','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1271357565,'stevestyle000000000003'),(1,'

You can find members of the community on the #webgui chat channel on the Freenode IRC network. If you\'re not \nfamiliar with IRC, it\'s essentially like a chat room. A few things you\'ll need to know:

\n
    \n
\n
    \n
  • You need an IRC client program. There are many available that \ncan be downloaded free of charge.
  • \n
  • The IRC network we use is Freenode
  • \n
  • Our channel is #webgui.
  • \n
  • Channel operators have an @ next to their name. All channel operators in #webgui are Plain Black employees.
  • \n
  • Someone with a + next to their name is a recognized contributor in the WebGUI community. People who have been recognized as one of the People Behind WebGUI are often given this designation.
  • \n
\n
    \n\n\n
\n

If you\'re looking for a mentor, recognized contributors are a good place\n to start.

','k2Qj03FrAOXYra8kDJYYXw','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1271357513,'PBtmpl0000000000000060'),(1,'

An annual event, this is the one time a year when WebGUI users and Plain\n Black\'s staff come together to do all things WebGUI.  This is by far \nthe best way to get involved with the community as nothing can replace \nface to face interaction and mentoring. The conference is usually held \nin the fall of each year and more information on attending can be found \non the WebGUI Users \nConference website as details become available.

','ksSfkZdsr0uC62NwIk6hFQ','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1271356973,'PBtmpl0000000000000060'),(1,'

WebGUI \nForums are available for WebGUI related\n discussion and community support. Bounce around ideas, discuss \nimportant issues, and ask community members for help and advice. WebGUI \nForums are broken up into:

\n','nWxS5jnA3o3DgPEwBeR7yQ','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1271357239,'PBtmpl0000000000000060'),(0,NULL,'x3OFY6OJh_qsXkZfPwug4A','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1271348790,'stevestyle000000000003'),(0,NULL,'pJd5TLAjfWMVXD6sCRLwUg','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1271348790,'stevestyle000000000003'),(0,'

The WebGUI Content Engine® is a powerful, easy to use web application framework and content management system. WebGUI contains dozens of built-in features, and allows for full customization through its rich API. It\'s easy enough for the average business user to use, but powerful enough for any large enterprise.

\n

WebGUI serves thousands of small and large businesses, schools, universities, governments, associations, churches, projects and communities throughout the world. For examples of who is using WebGUI, visit the WebGUI Sightings page. Shouldn\'t your site be on this list?

\n

If you\'re new to WebGUI, visit the Getting Started section. Once you feel comfortable, explore some of the professional services available for your new WebGUI site. No matter what level you\'re at, tell your friends about WebGUI.

','OhdaFLE7sXOzo_SIP2ZUgA','Qk24uXao2yowR6zxbVJ0xA','stevestyle000000000003',1271445348,'stevestyle000000000003'),(1,'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

Rich User Interface

\n
\n

Powerful API

\n
\n

WebGUI has a rich user experience that allows users to place their \ncontent\nthrough a drag-n-drop interface; helps users pick dates, colors, and\nmore; and has a highly customizable rich editor to allow users to \nquickly and easily format\ncontent.

\n
\n

WebGUI allows developers to quickly plug-in new functionality to\nget the most from a site. In addition, WebGUI\'s standardized plug-in\npoints maintain the upgrade path even with customizations.

\n
\n

Short Friendly URLs

\n
\n

Internationalization

\n
\n

Never worry about ugly numeric \nID\'s or other things in URL\'s that\nmake it hard for search engines and people to use a site.

\n
\n

Users can work in an interface in their native language, and content can\n be published in as many languages as necessary.

\n
\n

Personalization

\n
\n

Easy To Install

\n
\n

Users see their own view of the site through dynamically\ngenerated navigation and content. In addition, content can be displayed \nbased upon users\' viewing habits.

\n
\n

With the use of the WebGUI Runtime Environment (Unix, Mac OS X, Linux, \nBSD) and VMWare Appliance (Windows) setup takes minutes rather than\nhours.

\n
','IWFxZDyGhQ3-SLZhELa3qw','Qk24uXao2yowR6zxbVJ0xA','stevestyle000000000003',1277737686,'stevestyle000000000003'),(1,NULL,'LdiozcIUciWuvt3Z-na5Ww','PBtmpl0000000000000060','PBtmpl0000000000000060',1281501162,'PBtmpl0000000000000060'),(1,NULL,'Vch1Ww7G_JpBhOhXX07RDg','PBtmpl0000000000000060','PBtmpl0000000000000111',1281501163,'PBtmpl0000000000000060'),(1,NULL,'AssetReportFolder00001','PBtmpl0000000000000060','PBtmpl0000000000000060',1281501163,'PBtmpl0000000000000060'),(1,'

You don\'t have to be a developer to become a project contributor. Examples of how you can contribute include:\n

\n
    \n
  • Translators - Visit i18n.webgui.org\n and either help translate a few items in an existing language, or \ncreate a new translation.

  • \n
  • Graphic Designers - Create WebGUI style themes, icons, or fix UI\n bugs. You can contribute your items to WebGUI\'s Addons and Plugins area for others to download and use.

  • \n
  • Usability Experts - Help make WebGUI more accessable and \neasier to use by submitting RFEs. Even better, submit an RFE that\'s ready to implement by including the code!

  • \n
  • Doc Writers - Write documents in WebGUI\'s wiki, help\n out on the boards, improve WebGUI\'s built in documentation.

  • \n
  • Testers - Validate WebGUI\'s features against its \ndocumentation, search for errors, and report bugs.

  • \n
  • Test writers - If you have some Perl abilities, you can help \ndevelop unit tests to make sure the WebGUI API is behaving as \ndocumented.

  • \n
  • Developers - Write a new feature for WebGUI like a macro, \nasset, wobject, auth module or workflow activity and contribute it to \nthe Addons and Plugins. If you\'re interested in developing for WebGUI, be sure to check out the Development Best Practices wiki article.

  • \n
  • Bug Fixers - Cruise the bug list and submit patches to \ncorrect the problem.

  • \n
  • Core Developers - Becoming a core developer is a privilege. To earn it, you have to demonstrate through bug fixes and/or \ncontributions that you can make sound programming decisions without the \nneed for someone to scrutinize everything you check in. WebGUI is a \nvery large and complex application so getting to this level can take \nsome time. Core developers are developers with commit privileges to the\n subversion repository.

  • \n
  • Advocate - Spread the word about WebGUI, tell people about \nhow you use it and how it\'s helped you.Encourage people to try it out.

  • \n
  • Marketing and Promotion - If you have a talent for marketing,\n advertising, or promotion you can be a super advocate! Have a marketing\n idea? Contact tavis AT plainblack DOT com.  Make a WebGUI banner or \nprint ad and contribute it!  Maybe you have a design for a cool \nwallpaper or t-shirt, anything to get the word out.
  • \n
','l0guT3vTR3B8cL6vtP-g3A','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1285124369,'PBtmpl0000000000000060'),(1,NULL,'N7uMnnicbyTEulcuRi1sSg','PBtmpl0000000000000060','PBtmpl0000000000000111',1283900195,'PBtmpl0000000000000060'),(1,'

 

','gI_TxK-5S4DNuv42wpImmw','PBtmpl0000000000000060','PBtmpl0000000000000111',1285124155,'PBtmpl0000000000000060'),(1,NULL,'kaPRSaf8UKiskiGEgJgLAw','PBtmpl0000000000000060','PBtmpl0000000000000111',1285124155,'2p9ygcqH_Z11qOUvQ1uBvw'),(1,NULL,'RrV4aAPnn4dM0ZcU3OXnlw','PBtmpl0000000000000060','PBtmpl0000000000000060',1286336607,'PBtmpl0000000000000060'),(0,'

\nTo begin managing content, you should log in and click the Turn Admin On! link. The default username is \"admin\" and the default password is \"123qwe\", but you probably customized both of those when you visited this site for the very first time.\n

\n

\nNow that you\'re logged in, we recommend that you add a new user for yourself with admin privileges just in case you forget the login information for your primary admin account. Don\'t worry if you lock yourself out, you can always contact Plain Black® support to get instructions to get back in.\n

\n

NOTE: If you appear to get logged out while moving between pages, this is most likely your browser displaying a cached version of the page. Click on your browser\'s refresh button to correct the problem.

\n

 

\n

\nFor more information about services related to WebGUI click here.\n

\n

\nEnjoy your new WebGUI site!\n

','NK8bqlwVRILJknqeCDPBHg','Qk24uXao2yowR6zxbVJ0xA','stevestyle000000000003',1285796040,'stevestyle000000000003'),(1,'

Plain Black has created a line of commercial books which total over 1500 pages of detailed documentation about WebGUI. Both black and white and full color editions of these books are available. Visit the book store today to stock your WebGUI library. Other than hands on training, there is no better way to hone your WebGUI skills. No matter what your need, Plain Black has created a book that\'s right for you and is creating new books each year.

\n

In the fall of 2010, Plain Black announced that these books will be converted into free wikis. You can now access all WebGUI user guides for free on the WebGUI User Guides page on www.webgui.org.

\n

*These books are available for WebGUI version 7.7 and earlier. For later documentation, see the free resources available on the WebGUI project website.

','diZvW4bSgZWwyyGP3qXi1g','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1285610019,'stevestyle000000000003'),(1,NULL,'68sKwDgf9cGH58-NZcU4lg','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1286336676,'stevestyle000000000003'),(0,NULL,'Am1J-meNBmhqFfEIWy6Gag','OiJNwP1gAlcva8_yOtL4gA','PBtmpl0000000000000111',1287545014,'PBtmpl0000000000000060'),(1,NULL,'1z9J1O08n_7gVVlBwSRBJQ','PBtmpl0000000000000060','PBtmpl0000000000000111',1287545014,'PBtmpl0000000000000060'),(1,NULL,'xSmREZO3GNzK3M5PaueOOQ','PBtmpl0000000000000060','PBtmpl0000000000000060',1287545014,'PBtmpl0000000000000060'),(1,NULL,'0bx-xoL8TSXXubFuqKAoVQ','PBtmpl0000000000000060','PBtmpl0000000000000060',1287545014,'PBtmpl0000000000000060'),(1,NULL,'taX2UYkFF21ALpFZY2rhMw','PBtmpl0000000000000060','PBtmpl0000000000000060',1287545014,'PBtmpl0000000000000060'),(1,NULL,'K0q_N885Httqev1VCqUWxg','PBtmpl0000000000000060','PBtmpl0000000000000060',1287545014,'PBtmpl0000000000000060'),(1,NULL,'fq1ZkYhH24R5tb96kuT10Q','PBtmpl0000000000000060','PBtmpl0000000000000060',1287545014,'PBtmpl0000000000000060'),(1,NULL,'oHk7fAFhEEkB7dHzi0QOQA','PBtmpl0000000000000060','PBtmpl0000000000000060',1287545014,'PBtmpl0000000000000060'),(1,NULL,'9M-lrlPQWeeNWfvnDnK_Xg','PBtmpl0000000000000060','PBtmpl0000000000000060',1287545014,'PBtmpl0000000000000060'),(1,NULL,'_gBYAdTcbkiyamnqi2Xskg','PBtmpl0000000000000060','PBtmpl0000000000000060',1287545014,'PBtmpl0000000000000060'),(1,NULL,'0iMMbGN3BevuCBHjjLiQNA','PBtmpl0000000000000060','PBtmpl0000000000000111',1287545015,'PBtmpl0000000000000060'),(1,NULL,'6A4yIjWwJfIE0Ep-I0jutg','PBtmpl0000000000000060','PBtmpl0000000000000111',1287545015,'PBtmpl0000000000000060'),(1,'

Folder for holding Workflow Activity templates.

','_cD6DLM_Fs5IlrLeWUjrjg','PBtmpl0000000000000060','PBtmpl0000000000000111',1287545015,'PBtmpl0000000000000060'),(1,NULL,'f2EktltCvwQpl_3-B1yR7g','PBtmpl0000000000000060','PBtmpl0000000000000111',1288748251,'PBtmpl0000000000000060'),(1,NULL,'aNmgn0cd6tldmC1FpW4KbA','PBtmpl0000000000000060','PBtmpl0000000000000060',1289967962,'PBtmpl0000000000000060'),(1,NULL,'jEz8iTGNWEt2I05IhVV19Q','PBtmpl0000000000000060','PBtmpl0000000000000060',1289967963,'PBtmpl0000000000000060'),(1,NULL,'S1A9iAwKcQQ6P20uTqw-Ew','PBtmpl0000000000000060','PBtmpl0000000000000060',1300763664,'PBtmpl0000000000000060'),(1,'

There are hundreds of pages of free documentation available for WebGUI, provided by both Plain Black and the community at large. The following list is by no means comprehensive, but it should get you started in the right direction.

\n

 

\n
    \n
  • Primer - A downloadable PDF that shows you the basics of publishing content in WebGUI.
  • \n
  • WebGUI User Guides: all commercial user guides previously published by Plain Black are in the process of being converted into wikis. You can find these wikis on the WebGUI User Guides page of www.webgui.org. This is an ongoing process; until all books have been converted, remaining books are being made available as free PDF downloads.
  • \n
  • Wiki - Hundreds of pages of WebGUI community contributed content featuring a variety of tutorials.
  • \n
  • Worldwide - A collection of WebGUI related web sites from all over the world that have documentation and other resources for WebGUI.
  • \n
  • API Docs - The documentation of all of the WebGUI source code.
  • \n
  • Template Help - The documentation of all of WebGUI\'s template variables.
  • \n
','j_1qEqM6iLfQLiR6VKy0aA','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1299872071,'stevestyle000000000003'),(1,'

Templates and images for the \"Underground\" style from StyleShout.com

','CQp-RFA2pMh5lFSggPPPYg','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1301973995,'PBtmpl0000000000000060'),(1,NULL,'_Mi_NTd3x8UB96LWezWHnw','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1301973995,'PBtmpl0000000000000060'),(1,NULL,'g3JH1PRq6m6Bj_PnGpcrSQ','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1301973996,'PBtmpl0000000000000060'),(1,'

This folder holds prototype WebGUI assets with the correct templates pre-selected.

','G0hl4VilbFKipToyxKqFrg','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1301973997,'PBtmpl0000000000000060'),(1,NULL,'GWU2qZqe6yEuAKG-5HtBdg','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1301973997,'PBtmpl0000000000000060'),(1,NULL,'AsfpsOpsGzZCb9m7MyxPuw','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1301973997,'PBtmpl0000000000000060'),(1,NULL,'jmqLxnoWb6p92Cr12lf1hw','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1301973997,'PBtmpl0000000000000060'),(1,NULL,'8E2UOnj_XPEghTj7nfVM0g','Qk24uXao2yowR6zxbVJ0xA','PBtmpl0000000000000111',1301973997,'PBtmpl0000000000000060'),(1,NULL,'1qFjOEiILIwr1xB5_ebppQ','PBtmpl0000000000000060','PBtmpl0000000000000060',1301973998,'PBtmpl0000000000000060'),(1,NULL,'xD76UfQ_JnSgTLBNvytcpQ','PBtmpl0000000000000060','PBtmpl0000000000000111',1301973998,'PBtmpl0000000000000060'),(0,NULL,'h0bOzz7WvdaVZXsjpwtkww','KKt0VB_eoQxw9xEsHsAhag','PBtmpl0000000000000111',1301973998,'PBtmpl0000000000000060'),(1,NULL,'qFOfW1sKyOTnGNcP6BXbwg','6D98D8TIuhExiSoo2U1eqw','PBtmpl0000000000000111',1301973999,'PBtmpl0000000000000060'),(1,NULL,'G5DgNizuG3jXkjPp6UaGrA','PBtmpl0000000000000060','PBtmpl0000000000000060',1301973999,'PBtmpl0000000000000060'),(1,NULL,'brxm_faNdZX5tRo3p50g3g','PBtmpl0000000000000060','PBtmpl0000000000000111',1304392055,'PBtmpl0000000000000060'),(1,NULL,'n-Vr_wgxOkwiHGt1nJto9w','OiJNwP1gAlcva8_yOtL4gA','PBtmpl0000000000000111',1309236774,'PBtmpl0000000000000060'); ALTER TABLE `wobject` ENABLE KEYS; -INSERT INTO webguiVersion (webguiVersion,versionType,dateApplied) VALUES ('7.10.19','Initial Install',UNIX_TIMESTAMP()); +INSERT INTO webguiVersion (webguiVersion,versionType,dateApplied) VALUES ('7.10.20','Initial Install',UNIX_TIMESTAMP()); SET CHARACTER_SET_CLIENT = @OLD_CHARACTER_SET_CLIENT; SET CHARACTER_SET_RESULTS = @OLD_CHARACTER_SET_RESULTS; SET CHARACTER_SET_CONNECTION = @OLD_CHARACTER_SET_CONNECTION; diff --git a/share/upgrades/7.10.19-8.0.0/addAssetEditTemplate.pl b/share/upgrades/7.10.20-8.0.0/addAssetEditTemplate.pl similarity index 100% rename from share/upgrades/7.10.19-8.0.0/addAssetEditTemplate.pl rename to share/upgrades/7.10.20-8.0.0/addAssetEditTemplate.pl diff --git a/share/upgrades/7.10.19-8.0.0/addI18nMacroAlias.pl b/share/upgrades/7.10.20-8.0.0/addI18nMacroAlias.pl similarity index 100% rename from share/upgrades/7.10.19-8.0.0/addI18nMacroAlias.pl rename to share/upgrades/7.10.20-8.0.0/addI18nMacroAlias.pl diff --git a/share/upgrades/7.10.19-8.0.0/addMaintenancePageToConfig.pl b/share/upgrades/7.10.20-8.0.0/addMaintenancePageToConfig.pl similarity index 100% rename from share/upgrades/7.10.19-8.0.0/addMaintenancePageToConfig.pl rename to share/upgrades/7.10.20-8.0.0/addMaintenancePageToConfig.pl diff --git a/share/upgrades/7.10.19-8.0.0/addNewAdminConsole.pl b/share/upgrades/7.10.20-8.0.0/addNewAdminConsole.pl similarity index 100% rename from share/upgrades/7.10.19-8.0.0/addNewAdminConsole.pl rename to share/upgrades/7.10.20-8.0.0/addNewAdminConsole.pl diff --git a/share/upgrades/7.10.19-8.0.0/addTemplateToolkit.pl b/share/upgrades/7.10.20-8.0.0/addTemplateToolkit.pl similarity index 100% rename from share/upgrades/7.10.19-8.0.0/addTemplateToolkit.pl rename to share/upgrades/7.10.20-8.0.0/addTemplateToolkit.pl diff --git a/share/upgrades/7.10.19-8.0.0/admin_console.wgpkg b/share/upgrades/7.10.20-8.0.0/admin_console.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/admin_console.wgpkg rename to share/upgrades/7.10.20-8.0.0/admin_console.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/admin_progress_bar.wgpkg b/share/upgrades/7.10.20-8.0.0/admin_progress_bar.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/admin_progress_bar.wgpkg rename to share/upgrades/7.10.20-8.0.0/admin_progress_bar.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/default_page.wgpkg b/share/upgrades/7.10.20-8.0.0/default_page.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/default_page.wgpkg rename to share/upgrades/7.10.20-8.0.0/default_page.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/documentation_free-documentation.wgpkg b/share/upgrades/7.10.20-8.0.0/documentation_free-documentation.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/documentation_free-documentation.wgpkg rename to share/upgrades/7.10.20-8.0.0/documentation_free-documentation.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/facebook_auth.sql b/share/upgrades/7.10.20-8.0.0/facebook_auth.sql similarity index 100% rename from share/upgrades/7.10.19-8.0.0/facebook_auth.sql rename to share/upgrades/7.10.20-8.0.0/facebook_auth.sql diff --git a/share/upgrades/7.10.19-8.0.0/migrateToNewCache.pl b/share/upgrades/7.10.20-8.0.0/migrateToNewCache.pl similarity index 100% rename from share/upgrades/7.10.19-8.0.0/migrateToNewCache.pl rename to share/upgrades/7.10.20-8.0.0/migrateToNewCache.pl diff --git a/share/upgrades/7.10.19-8.0.0/moveFileLocations.pl b/share/upgrades/7.10.20-8.0.0/moveFileLocations.pl similarity index 100% rename from share/upgrades/7.10.19-8.0.0/moveFileLocations.pl rename to share/upgrades/7.10.20-8.0.0/moveFileLocations.pl diff --git a/share/upgrades/7.10.19-8.0.0/moveMaintenance.pl b/share/upgrades/7.10.20-8.0.0/moveMaintenance.pl similarity index 100% rename from share/upgrades/7.10.19-8.0.0/moveMaintenance.pl rename to share/upgrades/7.10.20-8.0.0/moveMaintenance.pl diff --git a/share/upgrades/7.10.19-8.0.0/moveRequiredProfileFields.pl b/share/upgrades/7.10.20-8.0.0/moveRequiredProfileFields.pl similarity index 100% rename from share/upgrades/7.10.19-8.0.0/moveRequiredProfileFields.pl rename to share/upgrades/7.10.20-8.0.0/moveRequiredProfileFields.pl diff --git a/share/upgrades/7.10.19-8.0.0/one_over_three.wgpkg b/share/upgrades/7.10.20-8.0.0/one_over_three.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/one_over_three.wgpkg rename to share/upgrades/7.10.20-8.0.0/one_over_three.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/one_over_two.wgpkg b/share/upgrades/7.10.20-8.0.0/one_over_two.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/one_over_two.wgpkg rename to share/upgrades/7.10.20-8.0.0/one_over_two.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/pbtmplblankstyle000001.wgpkg b/share/upgrades/7.10.20-8.0.0/pbtmplblankstyle000001.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/pbtmplblankstyle000001.wgpkg rename to share/upgrades/7.10.20-8.0.0/pbtmplblankstyle000001.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/plainblacknews.wgpkg b/share/upgrades/7.10.20-8.0.0/plainblacknews.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/plainblacknews.wgpkg rename to share/upgrades/7.10.20-8.0.0/plainblacknews.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/removeAdminBar.pl b/share/upgrades/7.10.20-8.0.0/removeAdminBar.pl similarity index 100% rename from share/upgrades/7.10.19-8.0.0/removeAdminBar.pl rename to share/upgrades/7.10.20-8.0.0/removeAdminBar.pl diff --git a/share/upgrades/7.10.19-8.0.0/removeFilePile.pl b/share/upgrades/7.10.20-8.0.0/removeFilePile.pl similarity index 100% rename from share/upgrades/7.10.19-8.0.0/removeFilePile.pl rename to share/upgrades/7.10.20-8.0.0/removeFilePile.pl diff --git a/share/upgrades/7.10.19-8.0.0/removeMobileUserAgents.pl b/share/upgrades/7.10.20-8.0.0/removeMobileUserAgents.pl similarity index 100% rename from share/upgrades/7.10.19-8.0.0/removeMobileUserAgents.pl rename to share/upgrades/7.10.20-8.0.0/removeMobileUserAgents.pl diff --git a/share/upgrades/7.10.19-8.0.0/removeURLHandlers.pl b/share/upgrades/7.10.20-8.0.0/removeURLHandlers.pl similarity index 100% rename from share/upgrades/7.10.19-8.0.0/removeURLHandlers.pl rename to share/upgrades/7.10.20-8.0.0/removeURLHandlers.pl diff --git a/share/upgrades/7.10.19-8.0.0/right_column.wgpkg b/share/upgrades/7.10.20-8.0.0/right_column.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/right_column.wgpkg rename to share/upgrades/7.10.20-8.0.0/right_column.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/root_import_adminconsole_admin-interface.wgpkg b/share/upgrades/7.10.20-8.0.0/root_import_adminconsole_admin-interface.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/root_import_adminconsole_admin-interface.wgpkg rename to share/upgrades/7.10.20-8.0.0/root_import_adminconsole_admin-interface.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/root_import_adminconsole_edit-asset.wgpkg b/share/upgrades/7.10.20-8.0.0/root_import_adminconsole_edit-asset.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/root_import_adminconsole_edit-asset.wgpkg rename to share/upgrades/7.10.20-8.0.0/root_import_adminconsole_edit-asset.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/root_import_default-asset-subscription.wgpkg b/share/upgrades/7.10.20-8.0.0/root_import_default-asset-subscription.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/root_import_default-asset-subscription.wgpkg rename to share/upgrades/7.10.20-8.0.0/root_import_default-asset-subscription.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/root_import_default-facebook-choose-username.wgpkg b/share/upgrades/7.10.20-8.0.0/root_import_default-facebook-choose-username.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/root_import_default-facebook-choose-username.wgpkg rename to share/upgrades/7.10.20-8.0.0/root_import_default-facebook-choose-username.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/root_import_richedit.wgpkg b/share/upgrades/7.10.20-8.0.0/root_import_richedit.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/root_import_richedit.wgpkg rename to share/upgrades/7.10.20-8.0.0/root_import_richedit.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/side_by_side.wgpkg b/share/upgrades/7.10.20-8.0.0/side_by_side.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/side_by_side.wgpkg rename to share/upgrades/7.10.20-8.0.0/side_by_side.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/style-underground.wgpkg b/share/upgrades/7.10.20-8.0.0/style-underground.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/style-underground.wgpkg rename to share/upgrades/7.10.20-8.0.0/style-underground.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/three-columns.wgpkg b/share/upgrades/7.10.20-8.0.0/three-columns.wgpkg similarity index 100% rename from share/upgrades/7.10.19-8.0.0/three-columns.wgpkg rename to share/upgrades/7.10.20-8.0.0/three-columns.wgpkg diff --git a/share/upgrades/7.10.19-8.0.0/zzz_renameAccountMacroTemplateVariables.pl b/share/upgrades/7.10.20-8.0.0/zzz_renameAccountMacroTemplateVariables.pl similarity index 100% rename from share/upgrades/7.10.19-8.0.0/zzz_renameAccountMacroTemplateVariables.pl rename to share/upgrades/7.10.20-8.0.0/zzz_renameAccountMacroTemplateVariables.pl diff --git a/share/upgrades/7.10.19-8.0.0/zzz_renameAdminToggleMacroTemplateVariables.pl b/share/upgrades/7.10.20-8.0.0/zzz_renameAdminToggleMacroTemplateVariables.pl similarity index 100% rename from share/upgrades/7.10.19-8.0.0/zzz_renameAdminToggleMacroTemplateVariables.pl rename to share/upgrades/7.10.20-8.0.0/zzz_renameAdminToggleMacroTemplateVariables.pl diff --git a/share/upgrades/7.10.19-8.0.0/zzz_renameFormBuilderTemplateVars.pl b/share/upgrades/7.10.20-8.0.0/zzz_renameFormBuilderTemplateVars.pl similarity index 100% rename from share/upgrades/7.10.19-8.0.0/zzz_renameFormBuilderTemplateVars.pl rename to share/upgrades/7.10.20-8.0.0/zzz_renameFormBuilderTemplateVars.pl diff --git a/t/Asset/Post/purging.t b/t/Asset/Post/purging.t new file mode 100644 index 000000000..9e62c7b84 --- /dev/null +++ b/t/Asset/Post/purging.t @@ -0,0 +1,107 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +## Test that archiving a post works, and checking side effects like updating +## lastPost information in the Thread, and CS. + +use FindBin; +use strict; +use lib "$FindBin::Bin/../../lib"; +use WebGUI::Test; +use WebGUI::Session; +use Test::More tests => 7; # increment this value for each test you create +use WebGUI::Asset::Wobject::Collaboration; +use WebGUI::Asset::Post; +use WebGUI::Asset::Post::Thread; + +my $session = WebGUI::Test->session; + +# Do our work in the import node +my $node = WebGUI::Asset->getImportNode($session); + +# Grab a named version tag +my $versionTag = WebGUI::VersionTag->getWorking($session); +$versionTag->set({name=>"Collab setup"}); + +# Need to create a Collaboration system in which the post lives. +my @addArgs = ( undef, undef, { skipAutoCommitWorkflows => 1, skipNotification => 1 } ); + +my $collab = $node->addChild({className => 'WebGUI::Asset::Wobject::Collaboration'}, @addArgs); + +# finally, add posts and threads to the collaboration system + +my $first_thread = $collab->addChild( + { className => 'WebGUI::Asset::Post::Thread', }, + undef, + WebGUI::Test->webguiBirthday, + { skipAutoCommitWorkflows => 1, skipNotification => 1 } +); + +my $second_thread = $collab->addChild( + { className => 'WebGUI::Asset::Post::Thread', }, + undef, + WebGUI::Test->webguiBirthday, + { skipAutoCommitWorkflows => 1, skipNotification => 1 } +); + +##Thread 1, Post 1 => t1p1 +my $t1p1 = $first_thread->addChild( + { className => 'WebGUI::Asset::Post', }, + undef, + WebGUI::Test->webguiBirthday, + { skipAutoCommitWorkflows => 1, skipNotification => 1 } +); + +my $t1p2 = $first_thread->addChild( + { className => 'WebGUI::Asset::Post', }, + undef, + WebGUI::Test->webguiBirthday + 1, + { skipAutoCommitWorkflows => 1, skipNotification => 1 } +); + +my $past = time()-15; + +my $t2p1 = $second_thread->addChild( + { className => 'WebGUI::Asset::Post', }, + undef, + $past, + { skipAutoCommitWorkflows => 1, skipNotification => 1 } +); + +my $t2p2 = $second_thread->addChild( + { className => 'WebGUI::Asset::Post', }, + undef, + undef, + { skipAutoCommitWorkflows => 1, skipNotification => 1 } +); + +$versionTag->commit(); +WebGUI::Test->addToCleanup($versionTag); + +foreach my $asset ($collab, $t1p1, $t1p2, $t2p1, $t2p2, $first_thread, $second_thread, ) { + $asset = $asset->cloneFromDb; +} + +is $collab->getChildCount, 2, 'collab has correct number of children'; + +is $collab->get('lastPostId'), $t2p2->getId, 'lastPostId set in collab'; +is $collab->get('lastPostDate'), $t2p2->get('creationDate'), 'lastPostDate, too'; + +$t2p2->purge; + +$second_thread = $second_thread->cloneFromDb; +is $second_thread->get('lastPostId'), $t2p1->getId, '.. updated lastPostId in the thread'; +is $second_thread->get('lastPostDate'), $t2p1->get('creationDate'), '... lastPostDate, too'; + +$collab = $collab->cloneFromDb; +is $collab->get('lastPostId'), $t2p1->getId, '.. updated lastPostId in the CS'; +is $collab->get('lastPostDate'), $t2p1->get('creationDate'), '... lastPostDate, too'; + +#vim:ft=perl diff --git a/t/Asset/Wobject/EventManagementSystem.t b/t/Asset/Wobject/EventManagementSystem.t index 55bc7ac0d..2eda068fd 100644 --- a/t/Asset/Wobject/EventManagementSystem.t +++ b/t/Asset/Wobject/EventManagementSystem.t @@ -334,6 +334,7 @@ is($printRemainingTicketsTemplateId, "hreA_bgxiTX-EzWCSZCZJw", 'Default print re 'uiLevel' => ignore(), 'tickets_loop' => \@ticketArray, controls => ignore(), + keywords => ignore(), }, "www_printRemainingTickets: template variables valid" ); diff --git a/t/Asset/Wobject/Thingy/getFieldValue.t b/t/Asset/Wobject/Thingy/getFieldValue.t new file mode 100644 index 000000000..e26b9ea82 --- /dev/null +++ b/t/Asset/Wobject/Thingy/getFieldValue.t @@ -0,0 +1,84 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +use FindBin; +use strict; +use lib "$FindBin::Bin/../../../lib"; + +##The goal of this test is to test editThingDataSave, particularly those things not tested in Thingy.t + +use WebGUI::Test; +use WebGUI::Session; +use Test::More tests => 2; # increment this value for each test you create +use Test::Deep; +use JSON; +use WebGUI::Asset::Wobject::Thingy; +use WebGUI::Search; +use WebGUI::Search::Index; +use Data::Dumper; + +my $session = WebGUI::Test->session; + +# Do our work in the import node +my $node = WebGUI::Asset->getImportNode($session); + +my $versionTag = WebGUI::VersionTag->getWorking($session); +$versionTag->set({name=>"Thingy Test"}); +WebGUI::Test->addToCleanup($versionTag); +my $thingy = $node->addChild({ + className => 'WebGUI::Asset::Wobject::Thingy', + groupIdView => 7, + url => 'some_thing', +}); +$versionTag->commit; +$thingy = $thingy->cloneFromDb; + +# Test indexThing, without needing a real thing +my $groupIdEdit = $thingy->get("groupIdEdit"); +my %thingProperties = ( + thingId => "THING_RECORD", + label => 'Label', + editScreenTitle => 'Edit', + editInstructions => 'instruction_edit', + groupIdAdd => $groupIdEdit, + groupIdEdit => $groupIdEdit, + saveButtonLabel => 'save', + afterSave => 'searchThisThing', + editTemplateId => "ThingyTmpl000000000003", + groupIdView => '2', + viewTemplateId => "ThingyTmpl000000000002", + defaultView => 'searchThing', + searchScreenTitle => 'Search', + searchDescription => 'description_search', + groupIdSearch => $groupIdEdit, + groupIdExport => $groupIdEdit, + groupIdImport => $groupIdEdit, + searchTemplateId => "ThingyTmpl000000000004", + thingsPerPage => 25, +); +my $thingId = $thingy->addThing(\%thingProperties); +%thingProperties = %{ $thingy->getThing($thingId) }; + +my $field1Id = $thingy->addField({ + thingId => $thingId, + fieldId => "new", + label => "dated", + dateCreated => time(), + fieldType => "Date", + defaultValue => '2011-07-04', + status => "editable", + display => 1, +}, 0); + +my $field1 = $thingy->getFields($thingId)->hashRef; + +note 'getFieldValue'; +is $thingy->getFieldValue(WebGUI::Test->webguiBirthday, $field1), '8/16/2001', 'with epoch as default'; +is $thingy->getFieldValue('2011-07-04', $field1), '7/4/2011', 'with mysql date as default'; diff --git a/t/Asset/processTemplate.t b/t/Asset/processTemplate.t new file mode 100644 index 000000000..1ddc9200f --- /dev/null +++ b/t/Asset/processTemplate.t @@ -0,0 +1,51 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +use FindBin; +use strict; +use lib "$FindBin::Bin/../lib"; + +use WebGUI::Test; +use WebGUI::Test::MockAsset; +use WebGUI::Session; +use WebGUI::Asset; + +use Test::More; +use Test::Deep; +use Clone qw/clone/; + +plan tests => 1; + +my $session = WebGUI::Test->session; + +my $rootAsset = WebGUI::Asset->getRoot($session); + +my $versionTag = WebGUI::VersionTag->getWorking($session); +WebGUI::Test->addToCleanup($versionTag); +my $snippet = $rootAsset->addChild({keywords => 'one,two,three,four', className=>'WebGUI::Asset::Snippet'}); +$versionTag->commit; +$snippet = $snippet->cloneFromDb; + +##Override the user function style template so we can examine its output easily + #1234567890123456789012# +my $templateId = 'USER_STYLE_OVERRIDE___'; +my $templateMock = WebGUI::Test::MockAsset->new('WebGUI::Asset::Template'); +$templateMock->mock_id($templateId); +my $templateVars; +$templateMock->mock('process', sub { $templateVars = clone($_[1]); } ); + +{ + $snippet->processTemplate({}, $templateId); + use WebGUI::Keyword; + my $keywords = WebGUI::Keyword::string2list($templateVars->{keywords}); + cmp_bag($keywords, [qw/one two three four/], 'Keywords are available when running processTemplate'); +} + + diff --git a/t/DateTime.t b/t/DateTime.t index 098d69e43..47da55f7e 100644 --- a/t/DateTime.t +++ b/t/DateTime.t @@ -24,7 +24,7 @@ my $session = WebGUI::Test->session; # put your tests here -plan tests => 30; +plan tests => 32; my $timeZoneUser = addUser($session); @@ -96,11 +96,15 @@ is( $nowDt->webguiToStrftime('%y-%m-%d'), '%Y-%m-%d', 'webgui to strftime conver $timeZoneUser->update({ 'dateFormat' => '%y-%M-%D' }); $timeZoneUser->update({ 'timeFormat' => '%H:%n %p' }); -is( $nowDt->webguiToStrftime, '%Y-%_varmonth_-%e %l:%M %P', 'default datetime string' ); +is( $nowDt->webguiToStrftime, '%Y-%{month}-%{day} %l:%M %P', 'default datetime string' ); +my $single_digit = WebGUI::DateTime->new($session, '2011-07-04 15:00:00'); +is $single_digit->webguiDate("%z"), '2011-7-4', 'single digit month and day check'; +is $single_digit->webguiDate("%z"), $session->datetime->epochToHuman($single_digit->epoch, '%z'), 'webguiDate, an exact match to session->datetime'; sub addUser { my $session = shift; + my $user = WebGUI::User->new($session, "new"); ##From my research, this particular time zone does NOT follow daylight savings, diff --git a/t/Form/Workflow.t b/t/Form/Workflow.t index 7f64ea68f..f61a5b17f 100644 --- a/t/Form/Workflow.t +++ b/t/Form/Workflow.t @@ -50,8 +50,6 @@ my $html = join "\n", $plugin->toHtml; $footer; -diag $html; - my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); ##Test Form Generation diff --git a/t/Macro/FormField.t b/t/Macro/FormField.t new file mode 100644 index 000000000..f10beea3b --- /dev/null +++ b/t/Macro/FormField.t @@ -0,0 +1,111 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2011 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +use FindBin; +use strict; +use lib "$FindBin::Bin/../lib"; + +use WebGUI::Test; +use WebGUI::Session; +use HTML::TokeParser; +use HTML::Form; +use Tie::IxHash; +use WebGUI::Form_Checking; +use WebGUI::Macro::FormField; + +use Test::More; # increment this value for each test you create +use Test::Deep; + +use Data::Dumper; + +my $session = WebGUI::Test->session; + +# taken from t/Form/SelectList.t + +my $testBlock = [ + { + key => 'List1', + testValue => [qw/a/], + expected => 'a', + comment => 'single element array, scalar', + dataType => 'SCALAR' + }, + { + key => 'List2', + testValue => [qw/a/], + expected => 'EQUAL', + comment => 'single element array, array', + dataType => 'ARRAY' + }, + { + key => 'List3', + testValue => [qw/a b c/], + expected => "a\nb\nc", + comment => 'multi element array, scalar', + dataType => 'SCALAR' + }, + { + key => 'List4', + testValue => [qw/a b c/], + expected => 'EQUAL', + comment => 'multi element array, array', + dataType => 'ARRAY' + }, +]; + +my $formType = 'SelectList'; + +my $output; +$output = WebGUI::Macro::FormField::process( + $session, 'SelectList', 'ListMultiple', [ qw(a c e), ''], # args to macro + # args to particular Form subclass + options => { a=>'aa', b=>'bb', c=>'cc', d=>'dd', e=>'ee', ''=>'Empty' }, + value => [ qw(a c e), ''], + sortByValue => 1, +); + +#my $numTests = 11 + scalar @{ $testBlock } + 1; +my $numTests = 8; + +plan tests => $numTests; + +my ($header, $footer) = (WebGUI::Form::formHeader($session), WebGUI::Form::formFooter($session)); + +my $html = join "\n", $header, $output, $footer; + +my @forms = HTML::Form->parse($html, 'http://www.webgui.org'); + +##Test Form Generation + +is(scalar @forms, 1, '1 form was parsed'); + +my $form = $forms[0]; +my @inputs = $form->inputs; +is(scalar @inputs, 8, 'The form has 8 inputs'); + +#Basic tests + +my @options = $form->find_input('ListMultiple'); + +is( scalar(grep {$_->type ne 'option'} @options), 0, 'All inputs are of type option'); + +is( scalar(grep {$_->{multiple} ne 'multiple'} @options), 0, 'All inputs have multiple'); + +my @names = map { $_->name } @options; +cmp_deeply( [@names], bag(('ListMultiple')x6), 'correct number of names and names'); + +cmp_set([ $form->param('ListMultiple') ], [qw(a c e), ''], 'preselected values in order'); + +my @values = map { $_->possible_values } @options; +cmp_bag([ @values ], [qw(a b c d e), '', (undef)x6], 'list of all options'); + +my @value_names = map { $_->value_names } @options; +cmp_bag([ @value_names ], [qw(aa bb cc dd ee Empty), ('off')x6], 'list of all displayed value names'); + diff --git a/t/Shop/TaxDriver/Generic.t b/t/Shop/TaxDriver/Generic.t index 071f1f380..72ad79118 100644 --- a/t/Shop/TaxDriver/Generic.t +++ b/t/Shop/TaxDriver/Generic.t @@ -36,9 +36,6 @@ $session->user({userId => 3}); my $addExceptions = getAddExceptions($session); -my $tests = 80 + 2*scalar(@{$addExceptions}); -plan tests => $tests; - WebGUI::Test->addToCleanup(SQL => 'delete from tax_generic_rates'); #---------------------------------------------------------------------------- @@ -145,6 +142,30 @@ my $dupId = $taxer->add($taxData); $taxIterator = $taxer->getItems; is($taxIterator->rows, 3, 'add permits adding duplicate information.'); +my $spaceId = $taxer->add({ + country => 'USA, United States , United States Of America ,U.S.A', + state => 'Wisconsin, WI', + city => 'MADCITY, madcity, Madison , WebGUIVille', + code => '77575, 54703 , 97424', + taxRate => '7.77', +}); + +my $no_spaces = $taxer->getItem($spaceId); +cmp_deeply ( + $no_spaces, + { + country => 'USA,United States,United States Of America,U.S.A', + state => 'Wisconsin,WI', + city => 'MADCITY,madcity,Madison,WebGUIVille', + taxRate => '7.77', + taxId => $spaceId, + code => '77575,54703,97424', + }, + 'Spaces removed from content when adding' +); + +$taxer->delete({taxId => $spaceId}); + ##Madison zip codes: ##53701-53709 ##city rate: 0.5% @@ -680,4 +701,6 @@ sub getAddExceptions { }, ]; } + +done_testing; #vim:ft=perl diff --git a/www/extras/yui-webgui/build/form/datatable.js b/www/extras/yui-webgui/build/form/datatable.js index d9f89b854..6d753f9ef 100644 --- a/www/extras/yui-webgui/build/form/datatable.js +++ b/www/extras/yui-webgui/build/form/datatable.js @@ -1,4 +1,5 @@ +/*global WebGUI*/ // Initialize namespace if (typeof WebGUI == "undefined") { var WebGUI = {}; @@ -49,7 +50,7 @@ WebGUI.Form.DataTable data = {}; var columns = this.dataTable.getColumnSet().getDefinitions(); for ( var i = 0; i < columns.length; i++ ) { - data[ columns[ i ].key ] = columns[i].formatter == "date" ? new Date : ""; + data[ columns[ i ].key ] = columns[i].formatter == "date" ? new Date() : ""; } } this.dataTable.addRow( data ); @@ -85,7 +86,7 @@ WebGUI.Form.DataTable // Get the columns var cols = this.dataTable.getColumnSet().getDefinitions(); - for ( var i = 0; i < cols.length; i++ ) { + for ( i = 0; i < cols.length; i++ ) { data.columns[ i ] = cols[i]; delete data.columns[ i ].editor; delete data.columns[ i ].editorOptions; @@ -459,10 +460,12 @@ WebGUI.Form.DataTable format.name = "format_" + i; for ( var x = 0; x < availableFormats.length; x++ ) { + var selected = cols[i].formatter == availableFormats[x].value; var opt = new Option( availableFormats[x].label, availableFormats[x].value, - cols[i].formatter == availableFormats[x].value + selected, + selected ); format.appendChild( opt ); } @@ -606,7 +609,7 @@ WebGUI.Form.DataTable var oldKey = data[ "oldKey_" + i ]; var newKey = data[ "newKey_" + i ]; var format = data[ "format_" + i ][0]; - var col = this.dataTable.getColumn( oldKey ); + col = this.dataTable.getColumn( oldKey ); // Don't allow adding multiple columns with same key if ( oldKey != newKey && this.dataTable.getColumn( newKey ) ) { @@ -618,9 +621,9 @@ WebGUI.Form.DataTable // If the key has changed, update the row data if ( col && col.key != newKey ) { var rows = this.dataTable.getRecordSet().getRecords(); - for ( var i = 0; i < rows.length; i++ ) { - rows[ i ].setData( newKey, rows[ i ].getData( oldKey ) ); - rows[ i ].setData( oldKey, undefined ); + for ( var r = 0; r < rows.length; r++ ) { + rows[ r ].setData( newKey, rows[ r ].getData( oldKey ) ); + rows[ r ].setData( oldKey, undefined ); } } @@ -655,7 +658,7 @@ WebGUI.Form.DataTable var numRecords = allRecords.length; for (j=0; j < numRecords; j++) { if (format == "date") { - allRecords[j].setData(newKey, new Date); + allRecords[j].setData(newKey, new Date()); } else { allRecords[j].setData(newKey, ''); }