Merge with HEAD, 10472

This commit is contained in:
Colin Kuskie 2009-04-24 17:12:17 +00:00
commit 19f703dc9b
102 changed files with 5700 additions and 2269 deletions

View file

@ -1,4 +1,15 @@
7.7.5
7.7.4
- rfe: Extend DateTime for Week-Nrs (#9151)
- fixed: 7.6 upgrade left some default content marked as packages
- fixed #9816: Syndicated content asset fails on feeds including a UTF8 BOM
- fixed: Spam in the wiki (#10050)
- fixed: Apply button applies but reloads old content in editor (#9827)
- fixed: maintenance tasks in parallel (#9921)
- fixed: Schedular Fields Too Short (#9889)
- fixed: Can't invite friends (#10112)
- Added missing POD docs for WebGUI::Account
- fixed #9989: thing-search template won't include data-save params in the url for pagination
- fixed #10122: fixed date object to not change the value in 'toHtml' function.
- fixed #9764: drag drop now uses the handle for 'pickup' rather than the whole object.
@ -8,7 +19,27 @@
- fixed #10141: Matrix 2.0 - Search does not check matching products
- fixed #10077: after matrix sort can't return to alphanumeric sort
- fixed #10138: Matrix 2.0 Links in Product Listing are broken
- fixed #10163: User List - alphabet search field broken
- fixed #9039: Synopsis not output as a meta field
- fixed #9939: checkout error with any payment method
- Survey editor now keeps survey objects in a scrollable panel to keep buttons always in view.
- fixed #10198: Cannot drag assets to new positions on page
- fixed #10190: Matrix 2.0 - Strange characters in "Show Ratings" box
- fixed #10143: Matrix 2.0 - Product maintainer accounts changed during upgrade
- rfe: #10002: User Manager, view User's Profile (perlDreamer Consulting)
- rfe: #10073: Account system to be able to return XML/JSON (perlDreamer Consulting)
- Replaced the tax system with a pluggable one. Included are a Generic plugin
(which works the same as the old system) and a plugin for EU merchants ( Martin Kamerbeek / Oqapi )
- fixed #10213: RssFeed aspect now checks canView and gives HTTP Basic Auth box to login
- added Survey Number type. Text number entry that uses slider restrictions as constraints (server and client side). You can also use the arrow keys
to increment or decrement the number enter. If slider constraints are blank, no rules applied.
- added: ThingyRecord allows you to sell records in a Thingy (like a classified ad)
- fixed: #10109: Matrix 2.0 - Updates to product listing by maintainer account require admin approval
- fixed #10146: Thingy duplicate errors
- Added Survey back button
- fixed #10158: Matrix 2.0 - Screenshots rendering poorly
- administer.js now has a much improved handling of the slider algorithm, plus some refactored code. Users will not notice anything.
- Survey slider answer updates, now update all the answers for max,min,step settings since only the first answers values are used anyways.
7.7.3
- fixed #10094: double explanation in thread help
- rfe #9612: Carousel Wobject (was Widget Wobject) (SDH Consulting Group)

File diff suppressed because one or more lines are too long

View file

@ -7,6 +7,11 @@ upgrading from one version to the next, or even between multiple
versions. Be sure to heed the warnings contained herein as they will
save you many hours of grief.
7.7.4
--------------------------------------------------------------------
* WebGUI now requires XML::FeedPP version 0.40 or greater.
7.7.2
--------------------------------------------------------------------
* WebGUI now requires Clone version 0.31 or greater.

File diff suppressed because one or more lines are too long

View file

@ -22,7 +22,6 @@ use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
use WebGUI::Utility;
use JSON;
my $toVersion = '7.7.4';
@ -33,23 +32,76 @@ my $session = start(); # this line required
# upgrade functions go here
updateSurveyQuestionTypes($session);
# Story Manager
installStoryManagerTables($session);
sm_upgradeConfigFiles($session);
sm_updateDailyWorkflow($session);
extendSchedulerFields($session);
allMaintenanceSingleton($session);
unsetPackageFlags($session);
installThingyRecord( $session );
installPluggableTax( $session );
addMatrixMaxScreenshotWidthHeight($session);
addSurveyBackButtonColumn( $session );
finish($session); # this line required
#----------------------------------------------------------------------------
sub addMatrixMaxScreenshotWidthHeight {
my $session = shift;
print "\tAdding maximum screenshot width and height property to the Matrix." unless $quiet;
$session->db->write("alter table Matrix add maxScreenshotWidth int(11), add maxScreenshotHeight int(11);");
$session->db->write("update Matrix set maxScreenshotWidth = 800, maxScreenshotHeight = 600;");
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# 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;
#}
sub unsetPackageFlags {
my $session = shift;
print "\tTurning off package flag on default assets...\n" unless $quiet;
my @assetIds = qw(
PBtmpl0000000000000004 PBtmpl0000000000000010
TEId5V-jEvUULsZA0wuRuA _9_eiaPgxzF_x_upt6-PNQ
LdiozcIUciWuvt3Z-na5Ww PBtmpl0000000000000011
PBtmpl0000000000000063 PBtmpl0000000000000062
1oBRscNIcFOI-pETrCOspA wAc4azJViVTpo-2NYOXWvg
AjhlNO3wZvN5k4i4qioWcg GRUNFctldUgop-qRLuo_DA
ThingyTmpl000000000004 UserListTmpl0000000001
UserListTmpl0000000002 UserListTmpl0000000003
WikiPageTmpl0000000001 QHn6T9rU7KsnS3Y70KCNTg
THQhn1C-ooj-TLlEP7aIJQ ThingyTmpl000000000003
stevestyle000000000003 UL-ItI4L1Z6-WSuhuXVvsQ
QpmlAiYZz6VsKBM-_0wXaw
);
for my $assetId (@assetIds) {
my $asset = WebGUI::Asset->new($session, $assetId);
if (!$asset) {
warn "\tUnable to instantiate default asset $assetId.\n";
next;
}
$asset->update({isPackage => 0});
}
print "\tDone.\n" unless $quiet;
}
#----------------------------------------------------------------------------
sub allMaintenanceSingleton {
my $session = shift;
print "\tMaking all maintenance workflows singletons." unless $quiet;
$session->db->write("update Workflow set mode='singleton' where workflowId in ('pbworkflow000000000001','pbworkflow000000000002','pbworkflow000000000004','AuthLDAPworkflow000001')");
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
sub extendSchedulerFields {
my $session = shift;
print "\tExtending scheduler fields" unless $quiet;
my $db = $session->db;
$db->write("alter table WorkflowSchedule change minuteOfHour minuteOfHour char(255) not null default '0'");
$db->write("alter table WorkflowSchedule change hourOfDay hourOfDay char(255) not null default '*'");
$db->write("alter table WorkflowSchedule change dayOfMonth dayOfMonth char(255) not null default '*'");
$db->write("alter table WorkflowSchedule change monthOfYear monthOfYear char(255) not null default '*'");
$db->write("alter table WorkflowSchedule change dayOfWeek dayOfWeek char(255) not null default '*'");
print "DONE!\n" unless $quiet;
}
sub updateSurveyQuestionTypes{
my $session = shift;
my $refs = $session->db->buildArrayRefOfHashRefs("SELECT * FROM Survey_questionTypes");
@ -76,7 +128,17 @@ sub _loadValues{
for my $value(@$values){
my $answer = _getAnswer();
$answer->{text} = $value->[0];
$answer->{recordedAnswer} = $value->[1];
if($answer->{text} eq 'No'){
$answer->{recordedAnswer} = 0;
}elsif($answer->{text} eq 'Yes'){
$answer->{recordedAnswer} = 1;
}elsif($answer->{text} eq 'True'){
$answer->{recordedAnswer} = 1;
}elsif($answer->{text} eq 'False'){
$answer->{recordedAnswer} = 0;
}else{
$answer->{recordedAnswer} = $value->[1];
}
$answer->{verbatim} = $value->[2];
push @$answers,$answer;
}
@ -105,104 +167,108 @@ sub _getAnswer{
return $answer;
}
sub installStoryManagerTables {
my ($session) = @_;
print "\tAdding Story Manager tables... " unless $quiet;
my $db = $session->db;
$db->write(<<EOSTORY);
CREATE TABLE Story (
assetId CHAR(22) BINARY NOT NULL,
revisionDate BIGINT NOT NULL,
headline CHAR(255),
subtitle CHAR(255),
byline CHAR(255),
location CHAR(255),
highlights TEXT,
story MEDIUMTEXT,
photo LONGTEXT,
PRIMARY KEY ( assetId, revisionDate )
)
EOSTORY
#----------------------------------------------------------------------------
sub installPluggableTax {
my $session = shift;
my $db = $session->db;
print "\tInstall tables for pluggable tax system..." unless $quiet;
$db->write(<<EOARCHIVE);
CREATE TABLE StoryArchive (
assetId CHAR(22) BINARY NOT NULL,
revisionDate BIGINT NOT NULL,
storiesPerPage INTEGER,
groupToPost CHAR(22) BINARY,
templateId CHAR(22) BINARY,
storyTemplateId CHAR(22) BINARY,
editStoryTemplateId CHAR(22) BINARY,
keywordListTemplateId CHAR(22) BINARY,
archiveAfter INT(11),
richEditorId CHAR(22) BINARY,
approvalWorkflowId CHAR(22) BINARY DEFAULT 'pbworkflow000000000003',
PRIMARY KEY ( assetId, revisionDate )
)
EOARCHIVE
# Rename table for the Generic tax plugin
$db->write( 'alter table tax rename tax_generic_rates' );
$db->write(<<EOTOPIC);
CREATE TABLE StoryTopic (
assetId CHAR(22) BINARY NOT NULL,
revisionDate BIGINT NOT NULL,
storiesPer INTEGER,
storiesShort INTEGER,
templateId CHAR(22) BINARY,
storyTemplateId CHAR(22) BINARY,
PRIMARY KEY ( assetId, revisionDate )
)
EOTOPIC
# Create tax driver table
$db->write( 'create table taxDriver (className char(255) not null primary key, options mediumtext)' );
print "DONE!\n" unless $quiet;
}
# Table for storing EU VAT numbers.
$db->write( <<EOSQL2 );
create table tax_eu_vatNumbers (
userId char(22) binary not null,
countryCode char(3) not null,
vatNumber char(20) not null,
approved tinyint(1) not null default 0,
primary key( userId, vatNumber )
);
EOSQL2
sub sm_upgradeConfigFiles {
my ($session) = @_;
print "\tAdding Story Manager to config file... " unless $quiet;
my $config = $session->config;
$config->addToHash(
'assets',
'WebGUI::Asset::Wobject::StoryTopic' => {
'category' => 'community'
},
);
$config->addToHash(
'assets',
"WebGUI::Asset::Wobject::StoryArchive" => {
"isContainer" => 1,
"category" => "community"
},
);
my $activities = $config->get('workflowActivities');
my $none = $activities->{None};
if (!isIn('WebGUI::Workflow::Activity::ArchiveOldStories', @{ $none })) {
unshift @{ $none }, 'WebGUI::Workflow::Activity::ArchiveOldStories';
# Add the Generic and EU taxdrivers to the config file.
$session->config->set( 'taxDrivers', [
'WebGUI::Shop::TaxDriver::Generic',
'WebGUI::Shop::TaxDriver::EU',
] );
# Add a setting to store the active tax plugin.
$session->setting->add( 'activeTaxPlugin', 'WebGUI::Shop::TaxDriver::Generic' );
# Add column to sku for storing each sku's tax configuration.
$db->write( "alter table sku add column taxConfiguration mediumtext " );
# Migrate the tax overrides of skus into the tax configuration column.
# Don't use getLineage because this has to be done for each revision.
my $sth = $db->read( "select assetId, revisionDate, overrideTaxRate, taxRateOverride from sku" );
while (my $row = $sth->hashRef) {
my $config = {
overrideTaxRate => $row->{ overrideTaxRate } || 0,
taxRateOverride => $row->{ taxRateOverride } || 0,
};
$db->write( 'update sku set taxConfiguration=? where assetId=? and revisionDate=?', [
to_json( $config ),
$row->{ assetId },
$row->{ revisionDate },
]);
}
$config->set('workflowActivities', $activities);
$sth->finish;
print "Done.\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Add the ThingyRecord sku
sub installThingyRecord {
my ( $session ) = shift;
print "\tInstalling ThingyRecord sku... " unless $quiet;
$session->config->addToHash('assets','WebGUI::Asset::Sku::ThingyRecord', {
category => "shop",
});
# Install ThingyRecord
$session->db->write( <<'ENDSQL' );
CREATE TABLE IF NOT EXISTS ThingyRecord (
assetId CHAR(22) BINARY NOT NULL,
revisionDate BIGINT NOT NULL,
templateIdView CHAR(22) BINARY,
thingId CHAR(22) BINARY,
thingFields LONGTEXT,
thankYouText LONGTEXT,
price FLOAT,
duration BIGINT,
PRIMARY KEY (assetId, revisionDate)
);
ENDSQL
# Install collateral
use WebGUI::AssetCollateral::Sku::ThingyRecord::Record;
WebGUI::AssetCollateral::Sku::ThingyRecord::Record->crud_createTable($session);
# Update workflow
my $activityClass = 'WebGUI::Workflow::Activity::ExpirePurchasedThingyRecords';
$session->config->addToArray( 'workflow/None', $activityClass );
my $workflow = WebGUI::Workflow->new( $session, 'pbworkflow000000000004' );
my $activity = $workflow->addActivity( $activityClass );
$activity->set('title', "Expire Purchased Thingy Records");
$activity->set('description', "Expire any expired thingy records. Send notifications of imminent expiration.");
print "DONE!\n" unless $quiet;
}
sub sm_updateDailyWorkflow {
my ($session) = @_;
print "\tAdding Archive Old Stories to Daily Workflow... " unless $quiet;
my $workflow = WebGUI::Workflow->new($session, 'pbworkflow000000000001');
foreach my $activity (@{ $workflow->getActivities }) {
return if $activity->getName() eq 'WebGUI::Workflow::Activity::ArchiveOldStories';
}
my $activity = $workflow->addActivity('WebGUI::Workflow::Activity::ArchiveOldStories');
$activity->set('title', 'Archive Old Stories');
$activity->set('description', 'Archive old stories, based on the settings of the Story Archives that own them');
print "DONE!\n" unless $quiet;
sub addSurveyBackButtonColumn{
my $session = shift;
print "\tAdding allowBackBtn column to Survey table... " unless $quiet;
$session->db->write("alter table Survey add column `allowBackBtn` TINYINT(3)");
print "Done.\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------

View file

@ -0,0 +1,220 @@
#!/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.7.5';
my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
# Story Manager
installStoryManagerTables($session);
sm_upgradeConfigFiles($session);
sm_updateDailyWorkflow($session);
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;
#}
sub installStoryManagerTables {
my ($session) = @_;
print "\tAdding Story Manager tables... " unless $quiet;
my $db = $session->db;
$db->write(<<EOSTORY);
CREATE TABLE Story (
assetId CHAR(22) BINARY NOT NULL,
revisionDate BIGINT NOT NULL,
headline CHAR(255),
subtitle CHAR(255),
byline CHAR(255),
location CHAR(255),
highlights TEXT,
story MEDIUMTEXT,
photo LONGTEXT,
PRIMARY KEY ( assetId, revisionDate )
)
EOSTORY
$db->write(<<EOARCHIVE);
CREATE TABLE StoryArchive (
assetId CHAR(22) BINARY NOT NULL,
revisionDate BIGINT NOT NULL,
storiesPerPage INTEGER,
groupToPost CHAR(22) BINARY,
templateId CHAR(22) BINARY,
storyTemplateId CHAR(22) BINARY,
editStoryTemplateId CHAR(22) BINARY,
keywordListTemplateId CHAR(22) BINARY,
archiveAfter INT(11),
richEditorId CHAR(22) BINARY,
approvalWorkflowId CHAR(22) BINARY DEFAULT 'pbworkflow000000000003',
PRIMARY KEY ( assetId, revisionDate )
)
EOARCHIVE
$db->write(<<EOTOPIC);
CREATE TABLE StoryTopic (
assetId CHAR(22) BINARY NOT NULL,
revisionDate BIGINT NOT NULL,
storiesPer INTEGER,
storiesShort INTEGER,
templateId CHAR(22) BINARY,
storyTemplateId CHAR(22) BINARY,
PRIMARY KEY ( assetId, revisionDate )
)
EOTOPIC
print "DONE!\n" unless $quiet;
}
sub sm_upgradeConfigFiles {
my ($session) = @_;
print "\tAdding Story Manager to config file... " unless $quiet;
my $config = $session->config;
$config->addToHash(
'assets',
'WebGUI::Asset::Wobject::StoryTopic' => {
'category' => 'community'
},
);
$config->addToHash(
'assets',
"WebGUI::Asset::Wobject::StoryArchive" => {
"isContainer" => 1,
"category" => "community"
},
);
my $activities = $config->get('workflowActivities');
my $none = $activities->{None};
if (!isIn('WebGUI::Workflow::Activity::ArchiveOldStories', @{ $none })) {
unshift @{ $none }, 'WebGUI::Workflow::Activity::ArchiveOldStories';
}
$config->set('workflowActivities', $activities);
print "DONE!\n" unless $quiet;
}
sub sm_updateDailyWorkflow {
my ($session) = @_;
print "\tAdding Archive Old Stories to Daily Workflow... " unless $quiet;
my $workflow = WebGUI::Workflow->new($session, 'pbworkflow000000000001');
foreach my $activity (@{ $workflow->getActivities }) {
return if $activity->getName() eq 'WebGUI::Workflow::Activity::ArchiveOldStories';
}
my $activity = $workflow->addActivity('WebGUI::Workflow::Activity::ArchiveOldStories');
$activity->set('title', 'Archive Old Stories');
$activity->set('description', 'Archive old stories, based on the settings of the Story Archives that own them');
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;
# 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 = WebGUI::Asset->getImportNode($session)->importPackage( $storage );
# Turn off the package flag, and set the default flag for templates added
my $assetIds = $package->getLineage( ['self','descendants'] );
for my $assetId ( @{ $assetIds } ) {
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId );
if ( !$asset ) {
print "Couldn't instantiate asset with ID '$assetId'. Please check package '$file' for corruption.\n";
next;
}
my $properties = { isPackage => 0 };
if ($asset->isa('WebGUI::Asset::Template')) {
$properties->{isDefault} = 1;
}
$asset->update( $properties );
}
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',".$session->datetime->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