From 637bd165ba6e4549d02679bb5b276a96a4a86890 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Fri, 9 Sep 2005 23:07:34 +0000 Subject: [PATCH] - Any attempt to view "root" will redirect the user to the default page. - fix [ 1285604 ] getVars undefined in Asset::File.pm - fix [ 1284330 ] error in page export function - Fixed a trash purging problem. - fix [ 1281516 ] Undefined subroutine &WebGUI::Asset::File::quote runHourly - fix [ 1281430 ] www_restoreList should be in AssetTrash.pm --- docs/changelog/6.x.x.txt | 10 + docs/gotcha.txt | 2 + docs/upgrades/upgrade_6.2.0-6.2.1.sql | 2 - docs/upgrades/upgrade_6.2.1-6.2.2.sql | 3 - docs/upgrades/upgrade_6.2.10-6.2.11.sql | 4 - docs/upgrades/upgrade_6.2.11-6.3.0.pl | 2885 ----------------------- docs/upgrades/upgrade_6.2.11-6.3.0.sql | 337 --- docs/upgrades/upgrade_6.2.2-6.2.3.sql | 7 - docs/upgrades/upgrade_6.2.3-6.2.4.sql | 3 - docs/upgrades/upgrade_6.2.4-6.2.5.sql | 6 - docs/upgrades/upgrade_6.2.5-6.2.6.sql | 4 - docs/upgrades/upgrade_6.2.6-6.2.7.sql | 3 - docs/upgrades/upgrade_6.2.7-6.2.8.sql | 12 - docs/upgrades/upgrade_6.2.8-6.2.9.sql | 5 - docs/upgrades/upgrade_6.2.9-6.2.10.sql | 8 - docs/upgrades/upgrade_6.3.0-6.4.0.pl | 40 - docs/upgrades/upgrade_6.3.0-6.4.0.sql | 16 - docs/upgrades/upgrade_6.4.0-6.5.0.pl | 41 - docs/upgrades/upgrade_6.4.0-6.5.0.sql | 4 - docs/upgrades/upgrade_6.5.0-6.5.1.sql | 6 - docs/upgrades/upgrade_6.5.1-6.5.2.pl | 105 - docs/upgrades/upgrade_6.5.1-6.5.2.sql | 4 - docs/upgrades/upgrade_6.5.2-6.5.3.pl | 169 -- docs/upgrades/upgrade_6.5.2-6.5.3.sql | 35 - docs/upgrades/upgrade_6.5.3-6.5.4.sql | 4 - docs/upgrades/upgrade_6.5.4-6.5.5.pl | 42 - docs/upgrades/upgrade_6.5.4-6.5.5.sql | 2 - docs/upgrades/upgrade_6.5.5-6.5.6.sql | 4 - docs/upgrades/upgrade_6.5.6-6.6.0.pl | 286 --- docs/upgrades/upgrade_6.5.6-6.6.0.sql | 102 - docs/upgrades/upgrade_6.7.3-6.7.4.pl | 7 + lib/WebGUI/AdminConsole.pm | 2 +- lib/WebGUI/Asset.pm | 26 +- lib/WebGUI/Asset/File.pm | 2 +- lib/WebGUI/AssetExportHtml.pm | 1 + lib/WebGUI/AssetTrash.pm | 41 +- lib/WebGUI/AssetVersioning.pm | 11 +- sbin/Hourly/DeleteExpiredTrash.pm | 2 +- 38 files changed, 53 insertions(+), 4190 deletions(-) delete mode 100644 docs/upgrades/upgrade_6.2.0-6.2.1.sql delete mode 100644 docs/upgrades/upgrade_6.2.1-6.2.2.sql delete mode 100644 docs/upgrades/upgrade_6.2.10-6.2.11.sql delete mode 100644 docs/upgrades/upgrade_6.2.11-6.3.0.pl delete mode 100644 docs/upgrades/upgrade_6.2.11-6.3.0.sql delete mode 100644 docs/upgrades/upgrade_6.2.2-6.2.3.sql delete mode 100644 docs/upgrades/upgrade_6.2.3-6.2.4.sql delete mode 100644 docs/upgrades/upgrade_6.2.4-6.2.5.sql delete mode 100644 docs/upgrades/upgrade_6.2.5-6.2.6.sql delete mode 100644 docs/upgrades/upgrade_6.2.6-6.2.7.sql delete mode 100644 docs/upgrades/upgrade_6.2.7-6.2.8.sql delete mode 100644 docs/upgrades/upgrade_6.2.8-6.2.9.sql delete mode 100644 docs/upgrades/upgrade_6.2.9-6.2.10.sql delete mode 100644 docs/upgrades/upgrade_6.3.0-6.4.0.pl delete mode 100644 docs/upgrades/upgrade_6.3.0-6.4.0.sql delete mode 100644 docs/upgrades/upgrade_6.4.0-6.5.0.pl delete mode 100644 docs/upgrades/upgrade_6.4.0-6.5.0.sql delete mode 100644 docs/upgrades/upgrade_6.5.0-6.5.1.sql delete mode 100644 docs/upgrades/upgrade_6.5.1-6.5.2.pl delete mode 100644 docs/upgrades/upgrade_6.5.1-6.5.2.sql delete mode 100644 docs/upgrades/upgrade_6.5.2-6.5.3.pl delete mode 100644 docs/upgrades/upgrade_6.5.2-6.5.3.sql delete mode 100644 docs/upgrades/upgrade_6.5.3-6.5.4.sql delete mode 100644 docs/upgrades/upgrade_6.5.4-6.5.5.pl delete mode 100644 docs/upgrades/upgrade_6.5.4-6.5.5.sql delete mode 100644 docs/upgrades/upgrade_6.5.5-6.5.6.sql delete mode 100644 docs/upgrades/upgrade_6.5.6-6.6.0.pl delete mode 100644 docs/upgrades/upgrade_6.5.6-6.6.0.sql diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 220b141d4..65ecc9757 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -10,6 +10,16 @@ - Added a performance indicator debug option to the settings. - The locked icon in the asset manager no longer shows up unless autocommit is disabled. + - Added pagination to the versioning manager. + - Eliminated the possiblitity of rolling back the "auto commit" and "initial + import" tags. + - Any attempt to view "root" will redirect the user to the default page. + - fix [ 1285604 ] getVars undefined in Asset::File.pm + - fix [ 1284330 ] error in page export function + - Fixed a trash purging problem. + - fix [ 1281516 ] Undefined subroutine &WebGUI::Asset::File::quote runHourly + - fix [ 1281430 ] www_restoreList should be in AssetTrash.pm + 6.7.3 diff --git a/docs/gotcha.txt b/docs/gotcha.txt index 75a829fe6..fac3e5b11 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -9,6 +9,8 @@ save you many hours of grief. 6.7.0 -------------------------------------------------------------------- + * In order to upgrade to 6.7 you must first upgrade to 6.6. + * The asset API has changed slightly due to versioning, so if you have any custom assets, check out migration.txt to make sure they will comply. diff --git a/docs/upgrades/upgrade_6.2.0-6.2.1.sql b/docs/upgrades/upgrade_6.2.0-6.2.1.sql deleted file mode 100644 index 79dfb6d8e..000000000 --- a/docs/upgrades/upgrade_6.2.0-6.2.1.sql +++ /dev/null @@ -1,2 +0,0 @@ -insert into webguiVersion values ('6.2.1','upgrade',unix_timestamp()); - diff --git a/docs/upgrades/upgrade_6.2.1-6.2.2.sql b/docs/upgrades/upgrade_6.2.1-6.2.2.sql deleted file mode 100644 index 9a4bc69ac..000000000 --- a/docs/upgrades/upgrade_6.2.1-6.2.2.sql +++ /dev/null @@ -1,3 +0,0 @@ -insert into webguiVersion values ('6.2.2','upgrade',unix_timestamp()); -update template set template='

\n\n\n
\n
\n\n \n \">\n \n
style=\"border: 4px dotted #aaaaaa; padding: 5px;\">\n \n
style=\"border: 4px dotted #aaaaaa; padding: 5px;\">\n \n \n
\n \n\n\n\n \n \n \n \n \n \n \n \n
         \n \">\n \n
style=\"border: 4px dotted #aaaaaa; padding: 5px;\">\n \n
style=\"border: 4px dotted #aaaaaa; padding: 5px;\">\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 \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 \n \">\n \n \">\n \n \n\n\n\n

\n · · \n
\n\n\n' where namespace='Forum/Thread' and templateId=1; - diff --git a/docs/upgrades/upgrade_6.2.10-6.2.11.sql b/docs/upgrades/upgrade_6.2.10-6.2.11.sql deleted file mode 100644 index 4dd1f1d4a..000000000 --- a/docs/upgrades/upgrade_6.2.10-6.2.11.sql +++ /dev/null @@ -1,4 +0,0 @@ -insert into webguiVersion values ('6.2.11','upgrade',unix_timestamp()); -update page set isSystem=0, parentId='0' where pageId='1'; - - diff --git a/docs/upgrades/upgrade_6.2.11-6.3.0.pl b/docs/upgrades/upgrade_6.2.11-6.3.0.pl deleted file mode 100644 index b5ff37a16..000000000 --- a/docs/upgrades/upgrade_6.2.11-6.3.0.pl +++ /dev/null @@ -1,2885 +0,0 @@ -#!/usr/bin/perl - -use lib "../../lib"; -use FileHandle; -use File::Path; -use File::Copy; -use Getopt::Long; -use strict; -use WebGUI::Group; -use WebGUI::HTML; -use WebGUI::Id; -use WebGUI::Session; -use WebGUI::SQL; -use WebGUI::URL; - - -my $configFile; -my $quiet; - -GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet -); - -WebGUI::Session::open("../..",$configFile); - -print "\tMerging Forum/Post and Forum/Thread templates.\n" unless ($quiet); -my %threadTemplates; -my $forums = WebGUI::SQL->read("select forumId, threadTemplateId, postTemplateId from forum where threadTemplateId<>'1' and postTemplateId<>'1'"); -while (my ($forumId, $threadTemplateId, $postTemplateId) = $forums->array) { - my $key = "Thread ".$threadTemplateId." | ".$postTemplateId; - unless (exists $threadTemplates{$key}) { - my ($threadTemplate) = WebGUI::SQL->quickArray("select template from template where namespace='Forum/Thread' and templateId=".quote($threadTemplateId)); - my ($postTemplate) = WebGUI::SQL->quickArray("select template from template where namespace='Forum/Post' and templateId=".quote($postTemplateId)); - $threadTemplate =~ s/\/$postTemplate/ixsg; - $threadTemplates{$key} = $threadTemplate; - } -} -$forums->finish; -my ($defaultThreadTemplate) = WebGUI::SQL->quickArray("select template from template where namespace='Forum/Thread' and templateId='1'"); -my ($defaultPostTemplate) = WebGUI::SQL->quickArray("select template from template where namespace='Forum/Post' and templateId='1'"); -$defaultThreadTemplate =~ s/\/$defaultPostTemplate/ixsg; -$defaultThreadTemplate =~ '

^Navigation(crumbTrail);

'.$defaultThreadTemplate; -WebGUI::SQL->write("update template set template=".quote($defaultThreadTemplate)." where namespace='Forum/Thread' and templateId='1'"); -WebGUI::SQL->write("delete from template where namespace='Forum/Post' or (namespace='Forum/Thread' and templateId<>'1')"); -foreach my $key (%threadTemplates) { - WebGUI::SQL->write("insert into template (templateId, namespace, template, name) values (".quote(WebGUI::Id::generate()).", 'Forum/Thread', - ".quote($threadTemplates{$key}).", ".quote($key).")"); -} -WebGUI::SQL->write("update template set templateId='25' where templateId='1' and namespace in ('Forum','Forum/Thread','Forum/PostForm')"); -WebGUI::SQL->write("update forum set forumTemplateId='25' where forumTemplateId='1'"); -WebGUI::SQL->write("update forum set postFormTemplateId='25' where postFormTemplateId='1'"); -WebGUI::SQL->write("update forum set threadTemplateId='25' where threadTemplateId='1'"); -WebGUI::SQL->write("update template set templateId=concat('NNN',templateId) where templateId like '10%' and namespace in ('Forum','Forum/Thread','Forum/PostForm')"); -WebGUI::SQL->write("update forum set forumTemplateId=concat('NNN',forumTemplateId) where forumTemplateId like '10%'"); -WebGUI::SQL->write("update forum set postFormTemplateId=concat('NNN',postFormTemplateId) where postFormTemplateId like '10%'"); -WebGUI::SQL->write("update forum set threadTemplateId=concat('NNN',threadTemplateId) where threadTemplateId like '10%'"); - - - -print "\tFixing navigation template variables.\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select * from template where namespace in ('Navigation')"); -while (my $data = $sth->hashRef) { - $data->{template} =~ s/page.current/basepage/ig; - $data->{template} =~ s/isMy/is/ig; - $data->{template} =~ s/isCurrent/isBasepage/ig; - $data->{template} =~ s/inCurrentRoot/inBranch/ig; - WebGUI::SQL->write("update template set template=".quote($data->{template})." where namespace=".quote($data->{namespace})." and templateId=".quote($data->{templateId})); -} -$sth->finish; - - -print "\tMoving site icons into style templates.\n" unless ($quiet); -my $type = lc($session{setting}{siteicon}); -$type =~ s/.*\.(.*?)$/$1/; -my $tags = ' - - - - '; -$sth = WebGUI::SQL->read("select templateId,template from template where namespace='style'"); -while (my ($id,$template) = $sth->array) { - $template =~ s/\/$tags/ig; - WebGUI::SQL->write("update template set template=".quote($template)." where templateId=".quote($id)." and namespace='style'"); -} -$sth->finish; -WebGUI::SQL->write("delete from settings where name in ('siteicon','favicon')"); - - -print "\tMigrating wobject templates to asset templates.\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select templateId, template, namespace from template where namespace in ('Article', - 'SyndicatedContent', 'MessageBoard', 'DataForm', 'HttpProxy', 'Poll', 'Product', 'WobjectProxy', - 'SQLReport', 'Survey', 'WSClient')"); -while (my $t = $sth->hashRef) { - $t->{template} = ' - -

-
- '.$t->{template}; - WebGUI::SQL->write("update template set template=".quote($t->{template})." where templateId=".quote($t->{templateId})." and namespace=".quote($t->{namespace})); -} -$sth->finish; - - - - - -print "\tConverting Pages, Wobjects, and Forums to Assets\n" unless ($quiet); -print "\t\tHold on cuz this is going to take a long time...\n" unless ($quiet); -print "\t\tMaking first round of table structure changes\n" unless ($quiet); -WebGUI::SQL->write("alter table wobject add column assetId varchar(22) not null"); -WebGUI::SQL->write("alter table wobject add styleTemplateId varchar(22) not null"); -WebGUI::SQL->write("alter table wobject add printableStyleTemplateId varchar(22) not null"); -WebGUI::SQL->write("alter table wobject add cacheTimeout int not null default 60"); -WebGUI::SQL->write("alter table wobject add cacheTimeoutVisitor int not null default 3600"); -WebGUI::SQL->write("alter table metaData_values add assetId varchar(22) not null"); -WebGUI::SQL->write("alter table wobject drop primary key"); -WebGUI::SQL->write("alter table Poll_answer add column assetId varchar(22)"); -WebGUI::SQL->write("alter table DataForm_entry add column assetId varchar(22)"); -WebGUI::SQL->write("alter table DataForm_entryData add column assetId varchar(22)"); -WebGUI::SQL->write("alter table DataForm_field add column assetId varchar(22)"); -WebGUI::SQL->write("alter table DataForm_tab add column assetId varchar(22)"); -WebGUI::SQL->write("alter table Product_feature add assetId varchar(22) not null"); -WebGUI::SQL->write("alter table Product_benefit add assetId varchar(22) not null"); -WebGUI::SQL->write("alter table Product_specification add assetId varchar(22) not null"); -WebGUI::SQL->write("alter table Product_accessory drop primary key"); -WebGUI::SQL->write("alter table Product_accessory add assetId varchar(22) not null"); -WebGUI::SQL->write("alter table Product_accessory add accessoryAssetId varchar(22) not null"); -WebGUI::SQL->write("alter table Product_related drop primary key"); -WebGUI::SQL->write("alter table Product_related add assetId varchar(22) not null"); -WebGUI::SQL->write("alter table Product_related add relatedAssetId varchar(22) not null"); -WebGUI::SQL->write("alter table WobjectProxy add column description mediumtext"); -WebGUI::SQL->write("alter table EventsCalendar change column isMaster scope integer not null default 0"); -WebGUI::SQL->write("alter table EventsCalendar_event add column eventLocation text"); -WebGUI::SQL->write("alter table EventsCalendar_event change column startDate eventStartDate bigint(20)"); -WebGUI::SQL->write("alter table EventsCalendar_event change column endDate eventEndDate bigint(20)"); -WebGUI::SQL->write("alter table EventsCalendar_event add column templateId varchar(22)"); -WebGUI::SQL->write("alter table EventsCalendar_event add column assetId varchar(22) not null"); -WebGUI::SQL->write("alter table EventsCalendar_event drop primary key"); - - -# next 2 lines are for sitemap to nav migration -WebGUI::SQL->write("alter table Navigation rename tempoldnav"); -WebGUI::SQL->write("create table Navigation (assetId varchar(22) not null primary key, assetsToInclude text, startType varchar(35), startPoint varchar(255), endPoint varchar(35), showSystemPages int not null default 0, showHiddenPages int not null default 0, showUnprivilegedPages int not null default 0, templateId varchar(22) not null)"); -my @wobjects = qw(SiteMap Article Poll Survey USS WSClient DataForm FileManager EventsCalendar HttpProxy IndexedSearch MessageBoard Product SQLReport SyndicatedContent WobjectProxy); -my @otherWobjects = (); -my @temp = WebGUI::SQL->buildArray("select distinct(namespace) from wobject where namespace not in (".quoteAndJoin(\@wobjects).")"); -foreach my $other (@temp) { - my $test = WebGUI::SQL->unconditionalRead("select * from $other"); - if ($test->errorCode < 1) { - push(@otherWobjects,$other); - } else { - print "\t\t WARNING: A wobject instance of $other exists in your database without a namespace table.\n" unless ($quiet); - } - $test->finish; -} -my @allWobjects = (@wobjects,@otherWobjects); -foreach my $namespace (@allWobjects) { - WebGUI::SQL->write("alter table ".$namespace." add column assetId varchar(22) not null"); - if (isIn($namespace, @otherWobjects)) { - my $test = WebGUI::SQL->unconditionalRead("select templateId from $namespace"); - if ($test->errorCode > 0) { # only add this if they don't already have it - WebGUI::SQL->write("alter table ".$namespace." add column templateId varchar(22) not null"); - } - } else { - WebGUI::SQL->write("alter table ".$namespace." add column templateId varchar(22) not null"); - } - my $sth = WebGUI::SQL->read("select wobjectId, templateId from wobject where namespace=".quote($namespace)); - while (my ($wid, $tid) = $sth->array) { - WebGUI::SQL->write("update ".$namespace." set templateId=".quote($tid)." where wobjectId=".quote($wid)); - } - $sth->finish; -} - -walkTree('0','PBasset000000000000001','000001','2'); -mapProductCollateral(); - -print "\t\tMaking second round of table structure changes\n" unless ($quiet); -WebGUI::SQL->write("alter table WobjectProxy add column shortcutToAssetId varchar(22) not null"); -my $sth = WebGUI::SQL->read("select proxiedWobjectId from WobjectProxy"); -while (my ($wobjectId) = $sth->array) { - my ($assetId) = WebGUI::SQL->quickArray("select assetId from wobject where wobjectId=".quote($wobjectId)); - WebGUI::SQL->write("update WobjectProxy set shortcutToAssetId=".quote($assetId)." where proxiedWobjectId=".quote($wobjectId)); -} -$sth->finish; -foreach my $namespace (@allWobjects) { - if (isIn($namespace, qw(SiteMap USS FileManager))) { - # do nothing because these are going away - } elsif (isIn($namespace, @wobjects)) { - WebGUI::SQL->write("delete from ".$namespace." where assetId is null or assetId = ''"); # protect ourselves from crap - WebGUI::SQL->write("alter table ".$namespace." drop column wobjectId"); - WebGUI::SQL->write("alter table ".$namespace." add primary key (assetId)"); - } elsif (isIn($namespace, qw(Navigation Layout Collaboration Folder))) { - # do nothing because these are new - } else { - WebGUI::SQL->write("delete from ".$namespace." where assetId is null or assetId = ''"); # protect ourselves from crap - WebGUI::SQL->write("alter table ".$namespace." drop primary key"); - WebGUI::SQL->write("alter table ".$namespace." add primary key (assetId)"); - } -} -WebGUI::SQL->write("alter table WobjectProxy drop proxiedWobjectId"); -WebGUI::SQL->write("alter table WobjectProxy change proxiedTemplateId overrideTemplateId varchar(22) not null"); -WebGUI::SQL->write("alter table WobjectProxy change proxyByCriteria shortcutByCriteria int not null"); -WebGUI::SQL->write("alter table WobjectProxy change proxyCriteria shortcutCriteria text not null"); -WebGUI::SQL->write("alter table WobjectProxy rename Shortcut"); -WebGUI::SQL->write("update asset set className='WebGUI::Asset::Shortcut' where className='WebGUI::Asset::Wobject::WobjectProxy'"); -WebGUI::SQL->write("delete from wobject where assetId is null or assetId = ''"); # protect ourselves from crap -WebGUI::SQL->write("alter table wobject drop column wobjectId"); -WebGUI::SQL->write("alter table wobject add primary key (assetId)"); -WebGUI::SQL->write("alter table wobject drop column templateId"); -WebGUI::SQL->write("alter table wobject drop column namespace"); -WebGUI::SQL->write("alter table wobject drop column pageId"); -WebGUI::SQL->write("alter table wobject drop column sequenceNumber"); -WebGUI::SQL->write("alter table wobject drop column title"); -WebGUI::SQL->write("alter table wobject drop column ownerId"); -WebGUI::SQL->write("alter table wobject drop column groupIdEdit"); -WebGUI::SQL->write("alter table wobject drop column groupIdView"); -WebGUI::SQL->write("alter table wobject drop column userDefined1"); -WebGUI::SQL->write("alter table wobject drop column userDefined2"); -WebGUI::SQL->write("alter table wobject drop column userDefined3"); -WebGUI::SQL->write("alter table wobject drop column userDefined4"); -WebGUI::SQL->write("alter table wobject drop column userDefined5"); -WebGUI::SQL->write("alter table wobject drop column templatePosition"); -WebGUI::SQL->write("alter table wobject drop column bufferUserId"); -WebGUI::SQL->write("alter table wobject drop column bufferDate"); -WebGUI::SQL->write("alter table wobject drop column bufferPrevId"); -WebGUI::SQL->write("alter table wobject drop column forumId"); -WebGUI::SQL->write("alter table wobject drop column startDate"); -WebGUI::SQL->write("alter table wobject drop column endDate"); -WebGUI::SQL->write("alter table wobject drop column addedBy"); -WebGUI::SQL->write("alter table wobject drop column dateAdded"); -WebGUI::SQL->write("alter table wobject drop column editedBy"); -WebGUI::SQL->write("alter table wobject drop column lastEdited"); -WebGUI::SQL->write("alter table wobject drop column allowDiscussion"); -WebGUI::SQL->write("alter table metaData_values drop column wobjectId"); -WebGUI::SQL->write("drop table page"); -WebGUI::SQL->write("drop table FileManager"); -WebGUI::SQL->write("drop table FileManager_file"); -WebGUI::SQL->write("delete from template where namespace in ('FileManager')"); -WebGUI::SQL->write("drop table SiteMap"); -WebGUI::SQL->write("delete from template where namespace in ('SiteMap')"); -WebGUI::SQL->write("alter table Article drop column image"); -WebGUI::SQL->write("alter table Article drop column attachment"); -WebGUI::SQL->write("alter table Poll_answer drop column wobjectId"); -WebGUI::SQL->write("alter table DataForm_entry drop column wobjectId"); -WebGUI::SQL->write("alter table DataForm_entryData drop column wobjectId"); -WebGUI::SQL->write("alter table DataForm_field drop column wobjectId"); -WebGUI::SQL->write("alter table DataForm_tab drop column wobjectId"); -WebGUI::SQL->write("alter table Product_related add primary key (assetId,relatedAssetId)"); -WebGUI::SQL->write("alter table Product_accessory add primary key (assetId,accessoryAssetId)"); -WebGUI::SQL->write("alter table Product_accessory drop column wobjectId"); -WebGUI::SQL->write("alter table Product_benefit drop column wobjectId"); -WebGUI::SQL->write("alter table Product_feature drop column wobjectId"); -WebGUI::SQL->write("alter table Product_related drop column wobjectId"); -WebGUI::SQL->write("alter table Product_specification drop column wobjectId"); -WebGUI::SQL->write("alter table Product_related drop column RelatedWobjectId"); -WebGUI::SQL->write("alter table Product_accessory drop column AccessoryWobjectId"); -WebGUI::SQL->write("delete from EventsCalendar_event where assetId is null or assetId = ''"); # protect ourselves from crap -WebGUI::SQL->write("alter table EventsCalendar_event add primary key (assetId)"); -WebGUI::SQL->write("alter table EventsCalendar_event drop column name"); -WebGUI::SQL->write("alter table EventsCalendar_event drop column wobjectId"); -WebGUI::SQL->write("alter table EventsCalendar_event drop column EventsCalendar_eventId"); - - -WebGUI::SQL->write("drop table forum"); -WebGUI::SQL->write("drop table forumRead"); -WebGUI::SQL->write("drop table forumPost"); -WebGUI::SQL->write("drop table forumPostRating"); -WebGUI::SQL->write("drop table forumPostAttachment"); -WebGUI::SQL->write("drop table forumSubscription"); -WebGUI::SQL->write("drop table forumThread"); -WebGUI::SQL->write("drop table forumThreadSubscription"); -WebGUI::SQL->write("drop table MessageBoard_forums"); -WebGUI::SQL->write("drop table USS"); -WebGUI::SQL->write("drop table USS_submission"); - -# start migrating non-wobject stuff into assets -my %migration; -WebGUI::SQL->write("insert into wobject (assetId, styleTemplateId, printableStyleTemplateId) values ('PBasset000000000000002','1','3')"); -WebGUI::SQL->write("insert into Folder (assetId, templateId) values ('PBasset000000000000002','PBtmpl0000000000000078')"); - - - -print "\tConverting navigation system to asset tree\n" unless ($quiet); -my $navRootLineage = getNextLineage('PBasset000000000000002'); -my $navRootId = WebGUI::SQL->setRow("asset","assetId",{ - assetId=>"new", - isHidden=>1, - title=>"Navigation Configurations", - menuTitle=>"Navigation Configurations", - url=>fixUrl('doesntexistyet',"Navigation Configurations"), - ownerUserId=>"3", - groupIdView=>"4", - groupIdEdit=>"4", - parentId=>"PBasset000000000000002", - lineage=>$navRootLineage, - lastUpdated=>time(), - className=>"WebGUI::Asset::Wobject::Folder", - state=>"published" - }); -WebGUI::SQL->setRow("wobject","assetId",{ - assetId=>$navRootId, - styleTemplateId=>"1", - printableStyleTemplateId=>"3" - },undef,$navRootId); -WebGUI::SQL->setRow("Folder","assetId",{ - assetId=>$navRootId, - templateId=>"PBtmpl0000000000000078" - },undef,$navRootId); -my %macroCache; -my $navRankCounter = 1; -my $sth = WebGUI::SQL->read("select * from tempoldnav"); -while (my $data = $sth->hashRef) { - print "\t\tConverting ".$data->{identifier}."\n" unless ($quiet); - my (%newNav,%newAsset,%newWobject); - $newNav{assetId} = $newWobject{assetId} = $newAsset{assetId} = getNewId("nav",$data->{navigationId}); - $newAsset{url} = fixUrl($newAsset{assetId},$data->{identifier}); - $macroCache{$data->{identifier}} = $newAsset{url}; - $newAsset{isHidden} = 1; - $newAsset{title} = $newAsset{menuTitle} = $data->{identifier}; - $newAsset{ownerUserId} = "3"; - $newAsset{groupIdView} = "7"; - $newAsset{groupIdEdit} = "4"; - $newAsset{className} = 'WebGUI::Asset::Wobject::Navigation'; - $newAsset{state} = 'published'; - $newAsset{lastUpdated} = time(); - $newAsset{parentId} = $navRootId; - $newAsset{lineage} = $navRootLineage.sprintf("%06d",$navRankCounter); - $newNav{templateId} = $data->{templateId}; - $newWobject{styleTemplateId}="1"; - $newWobject{printableStyleTemplateId}="3"; - $newWobject{displayTitle} = "0"; - $newNav{showSystemPages} = $data->{showSystemPages}; - $newNav{showHiddenPages} = $data->{showHiddenPages}; - $newNav{showUnprivilegedPages} = $data->{showUnprivilegedPages}; - if ($data->{startAt} eq "root") { - $newNav{startType} = "relativeToRoot"; - $newNav{startPoint} = "0"; - } elsif ($data->{startAt} eq "WebGUIroot") { - $newNav{startType} = "relativeToRoot"; - $newNav{startPoint} = "1"; - } elsif ($data->{startAt} eq "top") { - $newNav{startType} = "relativeToRoot"; - $newNav{startPoint} = "2"; - } elsif ($data->{startAt} eq "grandmother") { - $newNav{startType} = "relativeToCurrentUrl"; - $newNav{startPoint} = "-2"; - } elsif ($data->{startAt} eq "mother") { - $newNav{startType} = "relativeToCurrentUrl"; - $newNav{startPoint} = "-1"; - } elsif ($data->{startAt} eq "current") { - $newNav{startType} = "relativeToCurrentUrl"; - $newNav{startPoint} = "0"; - } elsif ($data->{startAt} eq "daughter") { - $newNav{startType} = "relativeToCurrentUrl"; - $newNav{startPoint} = "1"; - } else { - $newNav{startType} = "specificUrl"; - $newNav{startPoint} = $data->{startAt}; - } - $newNav{endPoint} = (($data->{depth} == 99)?55:$data->{depth}); - if ($data->{method} eq "daughters") { - $newNav{endPoint} = "1"; - $newNav{assetsToInclude} = "descendants"; - } elsif ($data->{method} eq "sisters") { - $newNav{assetsToInclude} = "siblings"; - } elsif ($data->{method} eq "self_and_sisters") { - $newNav{assetsToInclude} = "self\nsiblings"; - } elsif ($data->{method} eq "descendants") { - $newNav{assetsToInclude} = "descendants"; - } elsif ($data->{method} eq "self_and_descendants") { - $newNav{assetsToInclude} = "self\ndescendants"; - } elsif ($data->{method} eq "leaves_under") { - $newNav{endPoint} = "1"; - $newNav{assetsToInclude} = "descendants"; - } elsif ($data->{method} eq "generation") { - $newNav{assetsToInclude} = "self\nsisters"; - } elsif ($data->{method} eq "ancestors") { - $newNav{assetsToInclude} = "ancestors"; - } elsif ($data->{method} eq "self_and_ancestors") { - $newNav{assetsToInclude} = "self\nancestors"; - } elsif ($data->{method} eq "pedigree") { - $newNav{endPoint} = 55; - $newNav{startType} = "relativeToRoot"; - $newNav{startPoint} = 1; - $newNav{assetsToInclude} = "pedigree"; - } - $newAsset{assetSize} = length(join("",%newAsset).join("",%newNav).join("",%newWobject)); - WebGUI::SQL->setRow("asset","assetId",\%newAsset,undef,$newNav{assetId}); - WebGUI::SQL->setRow("wobject","assetId",\%newWobject,undef,$newNav{assetId}); - WebGUI::SQL->setRow("Navigation","assetId",\%newNav,undef,$newNav{assetId}); - $navRankCounter++; -} -$sth->finish; -WebGUI::SQL->write("update Navigation set startPoint='root' where startPoint='nameless_root'"); -WebGUI::SQL->write("drop table tempoldnav"); - - - -print "\tConverting navigation templates\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select templateId, template from template where namespace='Navigation'"); -while (my ($id, $template) = $sth->array) { - $template =~ s/isBasePage/isCurrent/isg; - $template =~ s/basePage/currentPage/isg; - $template =~ s/isRoot/isBranchRoot/isg; - $template =~ s/inRoot/inBranchRoot/isg; - $template =~ s/urlizedTitle/url/isg; - $template =~ s/ownerId/ownerUserId/isg; - $template =~ s/isTop/isTopOfBranch/isg; - $template =~ s/isDaughter/isChild/isg; - $template =~ s/isMother/isParent/isg; - $template =~ s/isSister/isSibling/isg; - $template =~ s/isLeftMost/isRankedFirst/isg; - $template =~ s/isRightMost/isRankedLast/isg; - $template =~ s/hasDaughter/hasChild/isg; - $template =~ s/mother/parent/isg; - $template =~ s/config\.button/controls/isg; - $template =~ s/pageId/assetId/isg; - $template = ' - -

-
- -

-
- '.$template; - WebGUI::SQL->write("update template set template=".quote($template)." where templateId=".quote($id)." and namespace='Navigation'"); -} -$sth->finish; - - - - -print "\tConverting collateral manager items into assets\n" unless ($quiet); -WebGUI::SQL->write("update collateral set collateralFolderId='0' where collateralFolderId=''"); -WebGUI::SQL->write("update collateral set collateralFolderId='0' where collateralFolderId is null"); -my $collateralRootLineage = getNextLineage('PBasset000000000000002'); -my $collateralRootId = WebGUI::SQL->setRow("asset","assetId",{ - assetId=>"new", - isHidden=>1, - title=>"Files, Snippets, and Images", - menuTitle=>"Files, Snippets, and Images", - url=>fixUrl('doesntexistyet',"Collateral"), - ownerUserId=>"3", - groupIdView=>"4", - groupIdEdit=>"4", - parentId=>"PBasset000000000000002", - lineage=>$collateralRootLineage, - lastUpdated=>time(), - className=>"WebGUI::Asset::Wobject::Folder", - state=>"published" - }); -WebGUI::SQL->setRow("wobject","assetId",{ - assetId=>$collateralRootId, - styleTemplateId=>"1", - printableStyleTemplateId=>"3" - },undef,$collateralRootId); -WebGUI::SQL->setRow("Folder","assetId",{ - assetId=>$collateralRootId, - templateId=>"PBtmpl0000000000000078" - },undef,$collateralRootId); -my %folderCache = ('0'=>{id=>$collateralRootId,lineage=>$collateralRootLineage}); -my %folderNameCache; -my $collateralRankCounter = 1; -my $sth = WebGUI::SQL->read("select * from collateralFolder where collateralFolderId <> '0'"); -while (my $data = $sth->hashRef) { - print "\t\tConverting folder ".$data->{collateralFolderId}."\n" unless ($quiet); - my $url = fixUrl('doesntexist',$data->{name}); - $folderNameCache{$data->{name}} = $url; - my $folderId = WebGUI::SQL->setRow("asset","assetId",{ - assetId=>"new", - className=>'WebGUI::Asset::Wobject::Folder', - lineage=>$collateralRootLineage.sprintf("%06d",$collateralRankCounter), - parentId=>$collateralRootId, - ownerUserId=>'3', - groupIdView=>'4', - groupIdEdit=>'4', - lastUpdated=>time(), - title=>$data->{name}, - menuTitle=>$data->{name}, - url=>$url, - state=>'published' - }); - WebGUI::SQL->setRow("wobject","assetId",{ - assetId=>quote($folderId), - styleTemplateId=>"1", - printableStyleTemplateId=>"3", - description=>$data->{description} - },undef,$folderId); - WebGUI::SQL->setRow("Folder","assetId",{ - templateId=>'PBtmpl0000000000000078', - assetId=>$folderId - },undef,$folderId); - $folderCache{$data->{collateralFolderId}} = { - id=>$folderId, - lineage=>$collateralRootLineage.sprintf("%06d",$collateralRankCounter) - }; - $collateralRankCounter++; -} -$sth->finish; -my $lastCollateralFolderId = 'nolastid'; -my ($parentId, $baseLineage); -my $sth = WebGUI::SQL->read("select * from collateral order by collateralFolderId"); -while (my $data = $sth->hashRef) { - next if ($data->{filename} eq "" && $data->{collateralType} ne "snippet"); - print "\t\tConverting collateral item ".$data->{collateralId}." for folder ".$data->{collateralFolderId}."\n" unless ($quiet); - unless ($lastCollateralFolderId eq $data->{collateralFolderId}) { - my $id = $data->{collateralFolderId}; - $id = "0" unless (defined $id); - $baseLineage = $folderCache{$id}{lineage}; - $parentId = $folderCache{$id}{id}; - $lastCollateralFolderId = $id; - } - my $class; - my $collateralId = WebGUI::Id::generate(); - my $fileSize; - if ($data->{collateralType} eq "file" || $data->{collateralType} eq "image") { - my $storageId = copyFile($data->{filename},'images/'.$data->{collateralId}); - if (isIn(getFileExtension($data->{filename}), qw(jpg jpeg gif png))) { - copyFile('thumb-'.$data->{filename},'images/'.$data->{collateralId},$storageId); - WebGUI::SQL->write("insert into ImageAsset (assetId, parameters, thumbnailSize) values (".quote($collateralId).", - ".quote($data->{parameters}).", ".quote($data->{thumbnailSize}).")"); - $class = 'WebGUI::Asset::File::Image'; - } else { - $class = 'WebGUI::Asset::File'; - } - WebGUI::SQL->write("insert into FileAsset (assetId, filename, storageId) values ( - ".quote($collateralId).", ".quote($data->{filename}).", ".quote($storageId).")"); - $fileSize = getFileSize($storageId,$data->{filename}); - } else { - WebGUI::SQL->setRow("snippet","assetId",{ - assetId=>$collateralId, - snippet=>$data->{parameters} - },undef,$collateralId); - $fileSize = length($data->{parameters}); - $class = 'WebGUI::Asset::Snippet'; - } - my $url = fixUrl($collateralId,$data->{name}); - $macroCache{$data->{name}} = $macroCache{$data->{collateralId}} = $url; - WebGUI::SQL->write("insert into asset (assetId, parentId, lineage, className, state, title, menuTitle, - url, ownerUserId, groupIdView, groupIdEdit, assetSize, lastUpdated) values (". - quote($collateralId).", ".quote($parentId).", ".quote($baseLineage.sprintf("%06d",$collateralRankCounter)).", - '".$class."','published',".quote($data->{name}).", ". - quote($data->{name}).", ".quote($url).", ".quote($data->{userId}).", - '7', '4', ".quote($fileSize).",".quote($data->{dateUploaded}).")"); - $collateralRankCounter++; -} -WebGUI::SQL->write("drop table collateralFolder"); -WebGUI::SQL->write("drop table collateral"); -$sth->finish; - - - -print "\tMigrating forum templates to collaboration templates\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select templateId,template,namespace from template where namespace in ('Forum','Forum/Thread','Forum/Notification', 'Forum/Search', 'Forum/PostForm')"); -while (my ($id, $template, $namespace) = $sth->array) { - my $newNamespace; - if ($namespace eq "Forum") { - $newNamespace = "Collaboration"; - } elsif ($namespace eq "Forum/PostForm") { - $newNamespace = "Collaboration/PostForm"; - } elsif ($namespace eq "Forum/Search") { - $newNamespace = "Collaboration/Search"; - } elsif ($namespace eq "Forum/Notification") { - $newNamespace = "Collaboration/Notification"; - } elsif ($namespace eq "Forum/Thread") { - $newNamespace = "Collaboration/Thread"; - } - $template =~ s/\//ixsg; - $template =~ s/\//ixsg; - $template =~ s/\//ixsg; - $template =~ s/\//ixsg; - $template =~ s/forum\.title/collaboration.title/ixsg; - $template =~ s/forum\.description/collaboration.description/ixsg; - $template =~ s/forum\.//ixsg; - $template =~ s/thread\.list\.url/collaboration.url/ixsg; - $template =~ s/thread\.new\.url/add.url/ixsg; - $template =~ s/thread\.new\.label/add.label/ixsg; - $template =~ s/thread\.root\.subject/title/ixsg; - $template =~ s/thread\.root\.epoch/dateSubmitted/ixsg; - $template =~ s/thread\.root\.url/url/ixsg; - $template =~ s/thread\.root\.date/dateSubmitted.human/ixsg; - $template =~ s/thread\.root\.time/timeSubmitted.human/ixsg; - $template =~ s/thread\.root\.user\.profile/userProfile.url/ixsg; - $template =~ s/thread\.root\.user\.alias/username/ixsg; - $template =~ s/thread\.root\.user\.name/username/ixsg; - $template =~ s/thread\.root\.user\.id/ownerUserId/ixsg; - $template =~ s/thread\.root\.user\.isVisitor/user.isVisitor/ixsg; - $template =~ s/thread\.root\.status/status/ixsg; - $template =~ s/thread\.last\.subject/lastReply.title/ixsg; - $template =~ s/thread\.last\.epoch/lastReply.dateSubmitted/ixsg; - $template =~ s/thread\.last\.date/lastReply.dateSubmitted.human/ixsg; - $template =~ s/thread\.last\.time/lastReply.timeSubmitted.human/ixsg; - $template =~ s/thread\.last\.user.profile/lastReply.userProfile.url/ixsg; - $template =~ s/thread\.last\.user.name/lastReply.username/ixsg; - $template =~ s/thread\.last\.user.id/lastReply.ownerUserId/ixsg; - $template =~ s/thread\.last\./lastReply./ixsg; - $template =~ s/thread\.//ixsg; - $template =~ s/post\.subject/title/ixsg; - $template =~ s/post\.message/content/ixsg; - $template =~ s/post\.time\.value/timeSubmitted.human/ixsg; - $template =~ s/post\.date\.value/dateSubmitted.human/ixsg; - $template =~ s/post\.date\.epoch/dateSubmitted/ixsg; - $template =~ s/post\.canEdit/user.canEdit/ixsg; - $template =~ s/post\.user\.name/username/ixsg; - $template =~ s/post\.user\.alias/username/ixsg; - $template =~ s/post\.id/assetId/ixsg; - $template =~ s/post\.user\.id/ownerUserId/ixsg; - $template =~ s/post\.user\.profile/userProfile.url/ixsg; - $template =~ s/post\.//ixsg; - $template =~ s/form\.begin/form.header/ixsg; - $template =~ s/form\.end/form.footer/ixsg; - $template =~ s/message\.form/content.form/ixsg; - $template =~ s/subject\.form/title.form/ixsg; - $template =~ s/newpost\.isNewMessage/isNewPost/ixsg; - $template =~ s/newpost\.header/newpost.header.label/ixsg; - $template =~ s/newpost\.//ixsg; - $template =~ s/firstPage/pagination.firstPage/ixsg; - $template =~ s/lastPage/pagination.lastPage/ixsg; - $template =~ s/nextPage/pagination.nextPage/ixsg; - $template =~ s/previousPage/pagination.previousPage/ixsg; - $template =~ s/pageList/pagination.pageList.upTo10/ixsg; - $template =~ s/multiplePages/pagination.pageCount.isMultiple/ixsg; - $template =~ s/numberOfPages/pagination.pageCount/ixsg; - $template =~ s/pageNumber/pagination.pageNumber/ixsg; - $template =~ s/thread_loop/post_loop/ixsg; - $template =~ s/depth_loop/indent_loop/ixsg; - $template =~ s/back\.url/collaboration.url/ixsg; - $template =~ s/list\.label/back.label/ixsg; - $template =~ s/-=:\s+:=-//ixsg; - $template =~ s/previous\.more/previous.url/ixsg; - $template =~ s/next\.more/next.url/ixsg; - $template = '

'.$template; - WebGUI::SQL->write("update template set template=".quote($template).", namespace=".quote($newNamespace)." where templateId=".quote($id)." and namespace=".quote($namespace)); -} -$sth->finish; -my $defaultThread = ' - - -

-
- - - - - - -
-

-
-
- -
- -
-
-
- - - - - - - - - - - - - - -
- -
- -
-
-
- : - - - - - -
- :
-
-
- :
- : - -     [ 1, 2, 3, 4, 5 ] - -
- - :     [ | ]
- - - :
-
-
-
-
-
- -
- -
- - [] - - - [] - [] - -
-
-
-
-
- - - - - - - - - - - class="currentThread"> - - - - - - -
   
- -
- - - - - - -
- -
- -
-
-
- : - - - - - -
- :
-
-
- :
- : - -     [ 1, 2, 3, 4, 5 ] - -
- - :     [ | ]
- - - :
-
-
-
-
-
- -
- -
- - [] - - - [] - [] - -
-
-
-
- -
- - - - - - -
-
- -
- -
-
-
- : - - - - - -
- :
-
-
- :
- : - -     [ 1, 2, 3, 4, 5 ] - -
- - :     [ | ]
- - - :
-
-
-
-
-
- -
- -
- - [] - - - [] - [] - -
-
-
-
-
- -
- - - - - - - - -
- - [] - - - [] - - - [] - - - - [] - - [] - - - [] - - [] - - - - - [] - - [] - - -
- -'; -WebGUI::SQL->write("update template set template=".quote($defaultThread)." where templateId='25' and namespace='Collaboration/Thread'"); - - -print "\tMigrating USS templates to collaboration templates\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select templateId,template,namespace from template where namespace in ('USS','USS/Submission','USS/SubmissionForm')"); -while (my ($id, $template, $namespace) = $sth->array) { - my $newNamespace; - if ($namespace eq "USS") { - $template =~ s/post\.url/add.url/ixsg; - $newNamespace = "Collaboration"; - } elsif ($namespace eq "USS/SubmissionForm") { - $newNamespace = "Collaboration/PostForm"; - if ($template =~ /image\.form/ixsg && $template =~ /attachment\.form/ixsg) { - $template =~ s/\//ixsg; - $template =~ s/\//ixsg; - } elsif ($template =~ /image\.form/) { - $template =~ s/image\.form/attachment.form/ixsg; - } - } elsif ($namespace eq "USS/Submission") { - $newNamespace = "Collaboration/Thread"; - if ($template =~ /attachment\.box/ixsg) { - my $box = ''; - $template =~ s/\/$box/ixsg; - } - } - $template =~ s/\//ixsg; - $template =~ s/\//ixsg; - $template =~ s/\//ixsg; - $template =~ s/canPost/user.canPost/ixsg; - $template =~ s/canModerate/user.isModerator/ixsg; - $template =~ s/submission\.currentUser/user.isPoster/ixsg; - $template =~ s/submission\.id/assetId/ixsg; - $template =~ s/submission\.isNew/isNewPost/ixsg; - $template =~ s/submission\.content\.full/content/ixsg; - $template =~ s/submission\.content/synopsis/ixsg; - $template =~ s/submission\.responses/replies/ixsg; - $template =~ s/submission\.userId/ownerUserId/ixsg; - $template =~ s/submission\.date.updated/dateUpdated.human/ixsg; - $template =~ s/submission\.date/dateSubmitted.human/ixsg; - $template =~ s/submission\.userProfile/userProfile.url/ixsg; - $template =~ s/submission\.secondColumn/isSecond/ixsg; - $template =~ s/submission\.thirdColumn/isThird/ixsg; - $template =~ s/submission\.fourthColumn/isFourth/ixsg; - $template =~ s/submission\.fifthColumn/isFifth/ixsg; - $template =~ s/submission\.//ixsg; - $template =~ s/user\.Profile/userProfile.url/ixsg; - $template =~ s/user\.id/ownerUserId/ixsg; - $template =~ s/user\.alias/username/ixsg; - $template =~ s/user\.username/username/ixsg; - $template =~ s/date\.epoch/dateSubmitted/ixsg; - $template =~ s/date\.human/dateSubmitted.human/ixsg; - $template =~ s/date\.updated\.epoch/dateUpdated/ixsg; - $template =~ s/date\.updated\.human/dateUpdated.human/ixsg; - $template =~ s/date\.updated\.label/date.label/ixsg; - $template =~ s/status\.status/status/ixsg; - $template =~ s/views\.count/views/ixsg; - $template =~ s/post\.url/edit.url/ixsg; - $template =~ s/previous\.more/previous.url/ixsg; - $template =~ s/next\.more/next.url/ixsg; - $template =~ s/canReply/user.canReply/ixsg; - $template =~ s/title\.value/title/ixsg; - $template =~ s/body\.form\.textarea/content.form/ixsg; - $template =~ s/body\.form/content.form/ixsg; - $template =~ s/body\.value/content/ixsg; - $template =~ s/back\.url/collaboration.url/ixsg; - $template =~ s/submissions_loop/post_loop/ixsg; - $template = '

'.$template; - my $replies = ' - - - - -
-

-
-
- -
- -
-
-
- - - - - - - - - - - - - - - -
- -
- -
-
-
- : - - - - - -
- :
-
-
- :
- : - -     [ 1, 2, 3, 4, 5 ] - -
- - :     [ | ]
- - - :
-
-
-
-
-
- -
- -
- - [] - - - [] - [] - -
-
-
-
-
-
- - - - - - - - - - - - class="currentThread"> - - - - - - - -
   
- -
- - - - - - - -
- -
- -
-
-
- : - - - - - -
- :
-
-
- :
- : - -     [ 1, 2, 3, 4, 5 ] - -
- - :     [ | ]
- - - :
-
-
-
-
-
- -
- -
- - [] - - - [] - [] - -
-
-
-
-
- -
- - - - - - - -
-
- -
- -
-
-
- : - - - - - -
- :
-
-
- :
- : - -     [ 1, 2, 3, 4, 5 ] - -
- - :     [ | ]
- - - :
-
-
-
-
-
- -
- -
- - [] - - - [] - [] - -
-
-
-
-
-
- -
- - - - - - - - -
- - - [] - - [] - - - [] - - [] - - - - - [] - - [] - - -
-
-'; - $template =~ s//$replies/ixsg; - WebGUI::SQL->write("update template set template=".quote($template).", namespace=".quote($newNamespace)." where templateId=".quote($id)." and namespace=".quote($namespace)); -} -$sth->finish; - - - - -print "\tMigrating EventsCalendar templates\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select templateId,template from template where namespace = 'EventsCalendar'"); -while (my ($id, $template) = $sth->array) { - - $template =~ s/\s+/ /ixsg; - $template =~ s/\s+/ /ixsg; - - $template = '

'.$template; - WebGUI::SQL->write("update template set template=".quote($template)." where templateId=".quote($id)." and namespace='EventsCalendar'"); -} -$sth->finish; - - - - -print "\tConverting template system to asset tree\n" unless ($quiet); -WebGUI::SQL->write("update template set namespace='Layout' where namespace='page'"); -WebGUI::SQL->write("alter table template add column assetId varchar(22) not null"); -my $tempRootLineage = getNextLineage('PBasset000000000000002'); -my $tempRootId = WebGUI::SQL->setRow("asset","assetId",{ - assetId=>"new", - isHidden=>1, - title=>"Templates", - menuTitle=>"Templates", - url=>fixUrl('doesntexistyet',"Templates"), - ownerUserId=>"3", - groupIdView=>"4", - groupIdEdit=>"4", - parentId=>"PBasset000000000000002", - lineage=>$tempRootLineage, - lastUpdated=>time(), - className=>"WebGUI::Asset::Wobject::Folder", - state=>"published" - }); -WebGUI::SQL->setRow("wobject","assetId",{ - assetId=>$tempRootId, - styleTemplateId=>"1", - printableStyleTemplateId=>"3" - },undef,$tempRootId); -WebGUI::SQL->setRow("Folder","assetId",{ - assetId=>$tempRootId, - templateId=>"PBtmpl0000000000000078" - },undef,$tempRootId); -my $tempRankCounter = 1; -my %templateCache; -my $sth = WebGUI::SQL->read("select * from template"); -while (my $data = $sth->hashRef) { - print "\t\tConverting ".$data->{name}."\n" unless ($quiet); - my ($templateId ,%newAsset); - $templateId = $newAsset{assetId} = getNewId("tmpl",$data->{templateId},$data->{namespace}); - $newAsset{url} = fixUrl($newAsset{assetId},$data->{name}); - $newAsset{isHidden} = 1; - $newAsset{title} = $newAsset{menuTitle} = $data->{name}; - $newAsset{ownerUserId} = "3"; - $newAsset{groupIdView} = "7"; - $newAsset{groupIdEdit} = "4"; - $newAsset{className} = 'WebGUI::Asset::Template'; - $newAsset{assetSize} = length($data->{template}); - $newAsset{state} = 'published'; - $newAsset{lastUpdated} = time(); - $newAsset{parentId} = $tempRootId; - $newAsset{lineage} = $tempRootLineage.sprintf("%06d",$tempRankCounter); - WebGUI::SQL->setRow("asset","assetId",\%newAsset,undef,$templateId); - WebGUI::SQL->write("update template set assetId=".quote($templateId)." where templateId=".quote($data->{templateId})." - and namespace=".quote($data->{namespace})); - $templateCache{$data->{namespace}}{$data->{templateId}} = $templateId; - $tempRankCounter++; -} -$sth->finish; -WebGUI::SQL->write("alter table template drop primary key"); -WebGUI::SQL->write("alter table template drop column templateId"); -WebGUI::SQL->write("alter table template drop column name"); -WebGUI::SQL->write("delete from template where assetId is null or assetId = ''"); # protect ourselves from crap -WebGUI::SQL->write("alter table template add primary key (assetId)"); -my @wobjectTypes = qw(Article Poll Survey WSClient DataForm Layout EventsCalendar Navigation HttpProxy IndexedSearch MessageBoard Product SQLReport SyndicatedContent Shortcut); -my @allWobjectTypes = (@wobjectTypes,@otherWobjects,'Folder'); -print "\t\tMigrating wobject templates to new IDs\n" unless ($quiet); -foreach my $type (@allWobjectTypes) { - print "\t\t\t$type\n" unless ($quiet); - my $sth = WebGUI::SQL->read("select assetId, templateId from $type"); - while (my ($assetId, $templateId) = $sth->array) { - WebGUI::SQL->setRow($type,"assetId",{ - assetId=>$assetId, - templateId=>$templateCache{$type}{$templateId} - }); - } - $sth->finish; -} -print "\t\tMigrating wobject style templates to new IDs\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select assetId, styleTemplateId, printableStyleTemplateId from wobject"); -while (my ($assetId, $styleId, $printId) = $sth->array) { - WebGUI::SQL->setRow("wobject","assetId",{ - assetId=>$assetId, - styleTemplateId=>$templateCache{style}{$styleId}, - printableStyleTemplateId=>$templateCache{style}{$printId} - }); -} -$sth->finish; -print "\t\tMigrating DataForm templates to new IDs\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select assetId,emailTemplateId,acknowlegementTemplateId,listTemplateId from DataForm"); -while (my ($assetId, $emailId, $ackId, $listId) = $sth->array) { - WebGUI::SQL->setRow("DataForm","assetId",{ - assetId=>$assetId, - emailTemplateId=>$templateCache{DataForm}{$emailId}, - acknowlegementTemplateId=>$templateCache{DataForm}{$ackId}, - listTemplateId=>$templateCache{"DataForm/List"}{$listId} - }); -} -$sth->finish; -print "\t\tMigrating Collaboration templates to new IDs\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select assetId, collaborationTemplateId, postFormTemplateId, threadTemplateId, searchTemplateId, notificationTemplateId from Collaboration"); -while (my ($assetId, $collabId, $formId, $threadId, $searchId, $notId) = $sth->array) { - WebGUI::SQL->setRow("Collaboration","assetId",{ - assetId=>$assetId, - collaborationTemplateId=>$templateCache{"Collaboration"}{$collabId}, - searchTemplateId=>$templateCache{"Collaboration/Search"}{$searchId}, - threadTemplateId=>$templateCache{"Collaboration/Thread"}{$threadId}, - notificationTemplateId=>$templateCache{"Collaboration/Notification"}{$notId}, - postFormTemplateId=>$templateCache{"Collaboration/PostForm"}{$formId} - }); -} -print "\t\tMigrating Shortcut templates to new IDs\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select assetId, proxiedNamespace overrideTemplateId from Shortcut"); -while (my ($assetId, $namespace, $tid) = $sth->array) { - WebGUI::SQL->setRow("Shortcut","assetId",{ - assetId=>$assetId, - overrideTemplateId=>$templateCache{$namespace}{$tid} - }); -} -$sth->finish; -print "\t\tMigrating Event templates to new IDs\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select assetId, templateId from EventsCalendar_event"); -while (my ($assetId, $tid) = $sth->array) { - WebGUI::SQL->setRow("EventsCalendar_event","assetId",{ - assetId=>$assetId, - templateId=>$templateCache{"EventsCalendar/Event"}{$tid} - }); -} -$sth->finish; -WebGUI::SQL->write("alter table Shortcut drop column proxiedNamespace"); -WebGUI::SQL->write("alter table Shortcut change templateId templateId varchar(22) not null"); -WebGUI::SQL->write("update Shortcut set templateId='PBtmpl0000000000000140'"); -use WebGUI::Asset; -my $import = WebGUI::Asset->getImportNode; -my $newTemplate = $import->addChild({ - className=>'WebGUI::Asset::Template', - namespace=>'Shortcut', - title=>'Default Shortcut', - menuTitle=>'Default Shortcut', - ownerUserId=>'3', - groupIdView=>'7', - groupIdEdit=>'4', - isHidden=>1, - template=>' - - -

-
-
-
-
- - - -
-
-
-
-
- ' - },'PBtmpl0000000000000140'); - - - - - -print "\tReplacing some old macros with new ones\n" unless ($quiet); -print "\t\tReplacing macros in templates\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select assetId, template from template"); -while (my ($id, $template) = $sth->array) { - WebGUI::SQL->write("update template set template=".quote(replaceMacros($template))." where assetId=".quote($id)); -} -$sth->finish; -print "\t\tReplacing macros in wobject descriptions\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select assetId, description from wobject"); -while (my ($id, $desc) = $sth->array) { - WebGUI::SQL->write("update wobject set description=".quote(replaceMacros($desc))." where assetId=".quote($id)); -} -$sth->finish; -print "\t\tReplacing macros in user submissions and forum posts (can take a long time)\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select assetId, content from Post"); -while (my ($id, $desc) = $sth->array) { - WebGUI::SQL->write("update Post set content=".quote(replaceMacros($desc))." where assetId=".quote($id)); -} -$sth->finish; -print "\t\tReplacing macros in snippets\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select assetId, snippet from snippet"); -while (my ($id, $snip) = $sth->array) { - WebGUI::SQL->write("update snippet set snippet=".quote(replaceMacros($snip))." where assetId=".quote($id)); -} -$sth->finish; - - - - -print "\tDeleting files which are no longer used.\n" unless ($quiet); -unlink("../../lib/WebGUI/Macro/SI_scaledImage.pm"); -unlink("../../lib/WebGUI/Export.pm"); -unlink("../../lib/WebGUI/MetaData.pm"); -unlink("../../lib/WebGUI/Operation/MetaData.pm"); -unlink("../../lib/WebGUI/i18n/English/MetaData.pm"); -unlink("../../lib/WebGUI/Help/MetaData.pm"); -unlink("../../sbin/fileManagerImport.pl"); -unlink("../../sbin/collateralImport.pl"); -unlink("../../lib/WebGUI/Page.pm"); -unlink("../../lib/WebGUI/Page.pm"); -unlink("../../lib/WebGUI/Operation/Page.pm"); -unlink("../../lib/WebGUI/Operation/Package.pm"); -unlink("../../lib/WebGUI/Template.pm"); -unlink("../../lib/WebGUI/Operation/Template.pm"); -unlink("../../lib/WebGUI/Operation/Root.pm"); -unlink("../../lib/WebGUI/Navigation.pm"); -unlink("../../lib/WebGUI/Operation/Navigation.pm"); -unlink("../../lib/WebGUI/Macro/Navigation.pm"); -unlink("../../lib/WebGUI/Macro/File.pm"); -unlink("../../lib/WebGUI/Macro/I_imageWithTags.pm"); -unlink("../../lib/WebGUI/Macro/i_imageNoTags.pm"); -unlink("../../lib/WebGUI/Macro/SI_scaledImage.pm"); -unlink("../../lib/WebGUI/Macro/Snippet.pm"); -unlink("../../lib/WebGUI/Macro/Backslash_pageUrl.pm"); -unlink("../../lib/WebGUI/Macro/RandomSnippet.pm"); -unlink("../../lib/WebGUI/Macro/RandomImage.pm"); -unlink("../../lib/WebGUI/Attachment.pm"); -unlink("../../lib/WebGUI/Node.pm"); -unlink("../../lib/WebGUI/Wobject/Article.pm"); -unlink("../../lib/WebGUI/Help/SiteMap.pm"); -unlink("../../lib/WebGUI/i18n/English/SiteMap.pm"); -unlink("../../lib/WebGUI/Wobject/SiteMap.pm"); -unlink("../../lib/WebGUI/Wobject/EventsCalendar.pm"); -unlink("../../lib/WebGUI/Wobject/Poll.pm"); -unlink("../../lib/WebGUI/Wobject/DataForm.pm"); -unlink("../../lib/WebGUI/Wobject/USS.pm"); -unlink("../../lib/WebGUI/Wobject/WSClient.pm"); -unlink("../../lib/WebGUI/i18n/English/FileManager.pm"); -unlink("../../lib/WebGUI/Help/FileManager.pm"); -unlink("../../lib/WebGUI/Wobject/FileManager.pm"); -rmtree("../../lib/WebGUI/Wobject/HttpProxy"); -unlink("../../lib/WebGUI/Wobject/HttpProxy.pm"); -unlink("../../lib/WebGUI/Wobject/SQLReport.pm"); -unlink("../../lib/WebGUI/Operation/Clipboard.pm"); -unlink("../../lib/WebGUI/Operation/Trash.pm"); -unlink("../../lib/WebGUI/Operation/Collateral.pm"); -unlink("../../lib/WebGUI/Collateral.pm"); -unlink("../../lib/WebGUI/CollateralFolder.pm"); -unlink("../../lib/WebGUI/Persistent.pm"); -rmtree("../../lib/WebGUI/Persistent"); -rmtree("../../lib/Tree"); -rmtree("../../lib/DBIx/Tree"); -unlink("../../lib/WebGUI/Help/WobjectProxy.pm"); -unlink("../../lib/WebGUI/i18n/English/WobjectProxy.pm"); -unlink("../../lib/WebGUI/Wobject/MessageBoard.pm"); -unlink("../../lib/WebGUI/Wobject/WobjectProxy.pm"); -rmtree("../../www/extras/wobject/WobjectProxy"); - - - -#-------------------------------------------- -print "\tUpdating config file.\n" unless ($quiet); -my $pathToConfig = '../../etc/'.$configFile; -my $conf = Parse::PlainConfig->new('DELIM' => '=', 'FILE' => $pathToConfig); -my $macros = $conf->get("macros"); -delete $macros->{"\\"}; -delete $macros->{"Backslash_pageUrl"}; -delete $macros->{"I_imageWithTags"}; -delete $macros->{"SI_scaledImage"}; -delete $macros->{"Snippet"}; -delete $macros->{"Navigation"}; -delete $macros->{"File"}; -delete $macros->{"RandomSnippet"}; -delete $macros->{"RandomImage"}; -delete $macros->{"i_imageNoTags"}; -$macros->{"AssetProxy"} = "AssetProxy"; -$macros->{"RandomAssetProxy"} = "RandomAssetProxy"; -$macros->{"FileUrl"} = "FileUrl"; -$macros->{"PageUrl"} = "PageUrl"; -$macros->{"Page"} = "Page"; -$conf->set("paymentPlugins"=>"ITransact"); -$conf->set("macros"=>$macros); -$conf->set("assets"=>[ - 'WebGUI::Asset::Wobject::Navigation', - 'WebGUI::Asset::Wobject::Poll', - 'WebGUI::Asset::Wobject::Article', - 'WebGUI::Asset::Wobject::DataForm', - 'WebGUI::Asset::Wobject::SyndicatedContent', - 'WebGUI::Asset::Wobject::WSClient', - 'WebGUI::Asset::Wobject::HttpProxy', - 'WebGUI::Asset::Wobject::SQLReport', - 'WebGUI::Asset::Wobject::Survey', - 'WebGUI::Asset::Wobject::Product', - 'WebGUI::Asset::Wobject::Collaboration', - 'WebGUI::Asset::Wobject::MessageBoard', - 'WebGUI::Asset::Wobject::EventsCalendar', - 'WebGUI::Asset::Redirect', - 'WebGUI::Asset::Template', - 'WebGUI::Asset::FilePile', - 'WebGUI::Asset::File', - 'WebGUI::Asset::File::Image', - 'WebGUI::Asset::Snippet' - ]); -$conf->set("assetContainers"=>[ - 'WebGUI::Asset::Wobject::Folder', - 'WebGUI::Asset::Wobject::Layout' - ]); -$conf->write; - - - - -print "\tSetting user function style\n" unless ($quiet); - -my $failsafestyle = ' - - - ^Page("title"); - WebGUI - - - - - ^AdminBar; -
^PageTitle;
- -
-
- ^LoginToggle;   ^a(^@;);   ^AdminToggle; -
- - - -'; - -WebGUI::SQL->write("update template set template=".quote($failsafestyle)." where assetId='PBtmpl0000000000000060'"); -my ($defaultPageId) = WebGUI::SQL->quickArray("select value from settings where name='defaultPage'"); -my ($styleId) = WebGUI::SQL->quickArray("select styleTemplateId from wobject where assetId=".quote($defaultPageId)); -WebGUI::SQL->write("insert into settings (name,value) values ('userFunctionStyleId',".quote($styleId).")"); - - - - -WebGUI::Session::close(); - - - - - - - - -sub replaceMacros { - my $content = shift; - return $content if ($content =~ /\^\^/); # double carets bad -my $parenthesis; -$parenthesis = qr /\( # Start with '(', - (?: # Followed by - (?>[^()]+) # Non-parenthesis - |(??{ $parenthesis }) # Or a balanced parenthesis block - )* # zero or more times - \)/x; # Ending with ')' -my $nestedMacro; -$nestedMacro = qr /(\^ # Start with carat - ([^\^;()]+) # And one or more none-macro characters -tagged- - ((?: # Followed by - (??{ $parenthesis }) # a balanced parenthesis block - |(?>[^\^;]) # Or not a carat or semicolon -# |(??{ $nestedMacro }) # Or a balanced carat-semicolon block - )*) # zero or more times -tagged- - ;)/x; # End with a semicolon. - while ($content =~ /$nestedMacro/gs) { - my ($macro, $searchString, $params) = ($1, $2, $3); - next if ($searchString =~ /^\d+$/); # don't process ^0; ^1; ^2; etc. - next if ($searchString =~ /^\-$/); # don't process ^-; - if ($params ne "") { - $params =~ s/(^\(|\)$)//g; # remove parenthesis - } - my @parsed; - push(@parsed, $+) while $params =~ m { - "([^\"\\]*(?:\\.[^\"\\]*)*)",? - | ([^,]+),? - | , - }gx; - push(@parsed, undef) if substr($params,-1,1) eq ','; - my $result; - if (isIn($searchString, qw(Navigation SI I Snippet File))) { - my $url = (exists $macroCache{$parsed[0]}) ? $macroCache{$parsed[0]} : $parsed[0]; - $result = '^AssetProxy("'.$url.'");'; - } elsif (isIn($searchString, qw(RandomSnippet RandomImage))) { - my $url = (exists $macroCache{$parsed[0]}) ? $folderCache{$parsed[0]} : $parsed[0]; - $result = '^RandomAssetProxy("'.$url.'");'; - } elsif (isIn($searchString, qw(AdminBar))) { - my $newId =$templateCache{"Macro/AdminBar"}{$parsed[0]}; - my $id = (defined $newId) ? $newId : $parsed[0]; - $result = '^AdminBarXXX("'.$id.'");'; - } elsif (isIn($searchString, qw(L))) { - my $newId =$templateCache{"Macro/L_loginBox"}{$parsed[2]}; - my $id = (defined $newId) ? $newId : $parsed[2]; - $result = '^LoginBoxXXX("'.$parsed[0].'","'.$parsed[1].'","'.$id.'");'; - } elsif (isIn($searchString, qw(i))) { - my $url = (exists $macroCache{$parsed[0]}) ? $macroCache{$parsed[0]} : $parsed[0]; - $result = '^FileUrl("'.$url.'");'; - } elsif (isIn($searchString, qw(\\))) { - $result = '^PageUrl;'; - } else { - next; - } - $content =~ s/\Q$macro/$result/ges; - } - # a nasty hack to stop an infinite loop - $content =~ s/AdminBarXXX/AdminBar/xg; - $content =~ s/LoginBoxXXX/L/xg; - return $content; -} - - - -sub walkTree { - my $oldParentId = shift; - my $newParentId = shift; - my $parentLineage = shift; - my $myRank = shift; - print "\t\tFinding children of page ".$oldParentId."\n" unless ($quiet); - my $a = WebGUI::SQL->read("select * from page where subroutinePackage='WebGUI::Page' and parentId=".quote($oldParentId)." order by nestedSetLeft"); - while (my $page = $a->hashRef) { - print "\t\tConverting page ".$page->{pageId}."\n" unless ($quiet); - my $pageId = WebGUI::Id::generate(); - if ($page->{pageId} eq $session{setting}{defaultPage}) { - WebGUI::SQL->write("update settings set value=".quote($pageId)." where name='defaultPage'"); - } - if ($page->{pageId} eq $session{setting}{notFoundPage}) { - WebGUI::SQL->write("update settings set value=".quote($pageId)." where name='notFoundPage'"); - } - my $pageLineage = $parentLineage.sprintf("%06d",$myRank); - my $pageUrl = fixUrl($pageId,$page->{urlizedTitle}); - my $className = 'WebGUI::Asset::Wobject::Layout'; - if ($page->{redirectURL} ne "") { - $className = 'WebGUI::Asset::Redirect'; - } - WebGUI::SQL->write("insert into asset (assetId, parentId, lineage, className, state, title, menuTitle, url, startDate, - endDate, synopsis, newWindow, isHidden, ownerUserId, groupIdView, groupIdEdit, encryptPage, assetSize, - extraHeadTags ) values (".quote($pageId).", - ".quote($newParentId).", ".quote($pageLineage).", ".quote($className).",'published',".quote($page->{title}||"Untitled").", - ".quote($page->{menuTitle}||"Untitled").", ".quote($pageUrl).", ".quote($page->{startDate}).", ".quote($page->{endDate}).", - ".quote($page->{synopsis}).", ".quote($page->{newWindow}).", ".quote($page->{hideFromNavigation}).", ".quote($page->{ownerId}||'3').", - ".quote($page->{groupIdView}||'7').", ".quote($page->{groupIdEdit}||'3').", ".quote($page->{encryptPage}).", - ".length(join("",%{$page})).", ".quote($page->{metaTags}).")"); - if ($page->{redirectURL} ne "") { - WebGUI::SQL->write("insert into redirect (assetId, redirectUrl) values (".quote($pageId).",".quote($page->{redirectURL}).")"); - } else { - WebGUI::SQL->write("insert into wobject (assetId, styleTemplateId, printableStyleTemplateId, - cacheTimeout, cacheTimeoutVisitor, displayTitle, namespace) values ( - ".quote($pageId).", ".quote($page->{styleId}||'1').", - ".quote($page->{printableStyleId}||'1').", ".quote($page->{cacheTimeout}).",".quote($page->{cacheTimeoutVisitor}).", - 0,'Layout')"); - WebGUI::SQL->write("insert into Layout (assetId,templateId) values (".quote($pageId).", ".quote($page->{templateId}||'1').")"); - } - my $rank = 1; - print "\t\tFinding wobjects on page ".$page->{pageId}."\n" unless ($quiet); - my $b = WebGUI::SQL->read("select * from wobject where pageId=".quote($page->{pageId})." order by sequenceNumber"); - while (my $wobject = $b->hashRef) { - print "\t\t\tConverting wobject ".$wobject->{wobjectId}."\n" unless ($quiet); - my $namespace = WebGUI::SQL->quickHashRef("select * from ".$wobject->{namespace}." where wobjectId=".quote($wobject->{wobjectId})); - my $wobjectId = WebGUI::Id::generate(); - my $wobjectLineage = $pageLineage.sprintf("%06d",$rank); - my $wobjectUrl = fixUrl($wobjectId,$pageUrl."/".$wobject->{title}); - my $groupIdView = $page->{groupIdView}; - my $groupIdEdit = $page->{groupIdEdit}; - my $ownerId = $page->{ownerId}; - if ($page->{wobjectPrivileges}) { - $groupIdView = $wobject->{groupIdView}; - $groupIdEdit = $wobject->{groupIdEdit}; - $ownerId = $wobject->{ownerId}; - } - my $className = 'WebGUI::Asset::Wobject::'.$wobject->{namespace}; - WebGUI::SQL->write("insert into asset (assetId, parentId, lineage, className, state, title, menuTitle, url, startDate, - endDate, isHidden, ownerUserId, groupIdView, groupIdEdit, encryptPage, assetSize) values (".quote($wobjectId).", - ".quote($pageId).", ".quote($wobjectLineage).", ".quote($className).",'published',".quote($wobject->{title}||'Untitled').", - ".quote($wobject->{title}||'Untitled').", ".quote($wobjectUrl).", ".quote($wobject->{startDate}).", ".quote($wobject->{endDate}).", - 1, ".quote($ownerId||'3').", ".quote($groupIdView||'7').", ".quote($groupIdEdit||'3').", ".quote($page->{encryptPage}).", - ".length(join("",%{$wobject})).")"); - WebGUI::SQL->write("update wobject set assetId=".quote($wobjectId).", styleTemplateId=".quote($page->{styleId}||'1').", - printableStyleTemplateId=".quote($page->{printableStyleId}||'1').", cacheTimeout=".quote($page->{cacheTimeout}) - .", cacheTimeoutVisitor=".quote($page->{cacheTimeoutVisitor})." where wobjectId=".quote($wobject->{wobjectId})); - WebGUI::SQL->write("update ".$wobject->{namespace}." set assetId=".quote($wobjectId)." where wobjectId=" - .quote($wobject->{wobjectId})); - WebGUI::SQL->write("update metaData_values set assetId=".quote($wobjectId)." where wobjectId=".quote($wobject->{wobjectId})); - if ($wobject->{namespace} eq "Article") { - print "\t\t\tMigrating attachments for Article ".$wobject->{wobjectId}."\n" unless ($quiet); - if ($namespace->{attachment}) { - my $attachmentId = WebGUI::Id::generate(); - my $storageId = copyFile($namespace->{attachment},$wobject->{wobjectId}); - WebGUI::SQL->write("insert into asset (assetId, parentId, lineage, className, state, title, menuTitle, - url, startDate, endDate, isHidden, ownerUserId, groupIdView, groupIdEdit,assetSize) values (". - quote($attachmentId).", ".quote($wobjectId).", ".quote($wobjectLineage.sprintf("%06d",1)).", - 'WebGUI::Asset::File','published',".quote($namespace->{attachment}).", ". - quote($namespace->{attachment}).", ".quote(fixUrl($attachmentId,$wobjectUrl.'/'.$namespace->{attachment})).", - ".quote($wobject->{startDate}).", ".quote($wobject->{endDate}).", 1, ".quote($ownerId).", - ".quote($groupIdView).", ".quote($groupIdEdit)."," - .quote(getFileSize($storageId,$namespace->{attachment})).")"); - WebGUI::SQL->write("insert into FileAsset (assetId, filename, storageId) values ( - ".quote($attachmentId).", ".quote($namespace->{attachment}).", ".quote($storageId).")"); - } - if ($namespace->{image}) { - my $rank = 1; - $rank ++ if ($namespace->{attachment}); - my $imageId = WebGUI::Id::generate(); - my $storageId = copyFile($namespace->{image},$wobject->{wobjectId}); - copyFile('thumb-'.$namespace->{image},$wobject->{wobjectId},$storageId); - WebGUI::SQL->write("insert into asset (assetId, parentId, lineage, className, state, title, menuTitle, - url, startDate, endDate, isHidden, ownerUserId, groupIdView, groupIdEdit,assetSize) values (". - quote($imageId).", ".quote($wobjectId).", ".quote($wobjectLineage.sprintf("%06d",$rank)).", - 'WebGUI::Asset::File::Image','published',".quote($namespace->{image}).", ". - quote($namespace->{image}).", ".quote(fixUrl($imageId,$wobjectUrl.'/'.$namespace->{image})).", - ".quote($wobject->{startDate}).", ".quote($wobject->{endDate}).", 1, ".quote($ownerId).", - ".quote($groupIdView).", ".quote($groupIdEdit).",".quote(getFileSize($storageId,$namespace->{image})).")"); - WebGUI::SQL->write("insert into FileAsset (assetId, filename, storageId) values ( - ".quote($imageId).", ".quote($namespace->{image}).", ".quote($storageId).")"); - WebGUI::SQL->write("insert into ImageAsset (assetId, thumbnailSize) values (".quote($imageId).", - ".quote($session{setting}{thumbnailSize}).")"); - } - if ($namespace->{allowDiscussion}) { - print "\t\t\tMigrating forum for Article ".$wobject->{wobjectId}."\n" unless ($quiet); - $rank++; - migrateForum($wobject->{forumId},$pageId,$pageLineage,$rank, $wobject->{title},$wobject->{description}, - $wobject->{startDate}, $wobject->{endDate}, $wobject->{ownerId}, $wobject->{groupIdEdit}, - $page->{styleId}, $page->{printableStyleId}); - } - rmtree($session{config}{uploadsPath}.$session{os}{slash}.$wobject->{wobjectId}); - } elsif ($wobject->{namespace} eq "SiteMap") { - print "\t\t\tConverting SiteMap ".$wobject->{wobjectId}." into Navigation\n" unless ($quiet); - my ($starturl) = WebGUI::SQL->quickArray("select urlizedTitle from page - where pageId=".quote($namespace->{startAtThisLevel})); - WebGUI::SQL->setRow("Navigation","assetId",{ - assetId=>$wobjectId, - endPoint=>$namespace->{depth}||55, - startPoint=>$starturl, - startType=>"specificUrl", - templateId=>"1", - assetsToInclude=>"descendants" - },undef,$wobjectId); - WebGUI::SQL->write("update asset set className='WebGUI::Asset::Wobject::Navigation' where assetId=".quote($wobjectId)); - WebGUI::SQL->write("update wobject set namespace='Navigation' where assetId=".quote($wobjectId)); - } elsif ($wobject->{namespace} eq "FileManager") { - print "\t\t\tConverting File Manager ".$wobject->{wobjectId}." into File Folder\n" unless ($quiet); - WebGUI::SQL->write("update asset set className='WebGUI::Asset::Wobject::Folder' where assetId=".quote($wobjectId)); - WebGUI::SQL->write("insert into Folder (assetId,templateId) values (".quote($wobjectId).", '15')"); - WebGUI::SQL->write("update wobject set namespace='Folder' where wobjectId=".quote($wobject->{wobjectId})); - print "\t\t\tMigrating attachments for File Manager ".$wobject->{wobjectId}."\n" unless ($quiet); - my $sth = WebGUI::SQL->read("select * from FileManager_file where wobjectId=".quote($wobject->{wobjectId})." order by sequenceNumber"); - my $rank = 1; - while (my $data = $sth->hashRef) { - foreach my $field ("downloadFile","alternateVersion1","alternateVersion2") { - next if ($data->{$field} eq ""); - print "\t\t\t\tMigrating file ".$data->{$field}." (".$data->{FileManager_fileId}.")\n" unless ($quiet); - my $newId = WebGUI::Id::generate(); - my $storageId = copyFile($data->{$field},$wobject->{wobjectId}.'/'.$data->{FileManager_fileId}); - my $class; - if (isIn(getFileExtension($data->{$field}), qw(jpg jpeg gif png))) { - copyFile('thumb-'.$data->{$field},$wobject->{wobjectId}.'/'.$data->{FileManager_fileId},$storageId); - WebGUI::SQL->write("insert into ImageAsset (assetId, thumbnailSize, parameters) values - (".quote($newId).", - ".quote($session{setting}{thumbnailSize}).", ".quote('alt="'.$wobject->{title}.'"').")"); - $class = 'WebGUI::Asset::File::Image'; - } else { - $class = 'WebGUI::Asset::File'; - } - WebGUI::SQL->write("insert into FileAsset (assetId, filename, storageId) values ( - ".quote($newId).", ".quote($data->{$field}).", ".quote($storageId).")"); - WebGUI::SQL->write("insert into asset (assetId, parentId, lineage, className, state, title, menuTitle, - url, startDate, endDate, isHidden, ownerUserId, groupIdView, groupIdEdit, synopsis, assetSize - ) values (". - quote($newId).", ".quote($wobjectId).", ".quote($wobjectLineage.sprintf("%06d",$rank)).", - '".$class."','published',".quote($data->{fileTitle}).", ". - quote($data->{fileTitle}).", ".quote(fixUrl($newId,$wobjectUrl.'/'.$data->{$field})).", - ".quote($wobject->{startDate}).", ".quote($wobject->{endDate}).", 1, ".quote($ownerId).", - ".quote($data->{groupToView}).", ".quote($groupIdEdit).", ".quote($data->{briefSynopsis}).", - ".quote(getFileSize($storageId,$data->{$field})).")"); - $rank++; - } - } - $sth->finish; - rmtree($session{config}{uploadsPath}.$session{os}{slash}.$wobject->{wobjectId}); - } elsif ($wobject->{namespace} eq "Product") { - print "\t\t\tMigrating information for Product ".$wobject->{wobjectId}."\n" unless ($quiet); - my ($newProductStoreId); - # do a check to see if they've installed Image::Magick - my $hasImageMagick = 1; - eval " use Image::Magick; "; $hasImageMagick=0 if $@; - # migrate attachments to file storage - if($namespace->{image1}){ - $newProductStoreId = copyFile($namespace->{image1},$wobject->{wobjectId}); - copyFile("thumb-$namespace->{image1}",$wobject->{wobjectId},$newProductStoreId); - WebGUI::SQL->write("update Product set image1=".quote($newProductStoreId)." where wobjectId=".quote($wobject->{wobjectId})); - } - if($namespace->{image2}){ - $newProductStoreId = copyFile($namespace->{image2},$wobject->{wobjectId}); - copyFile("thumb-$namespace->{image2}",$wobject->{wobjectId},$newProductStoreId); - WebGUI::SQL->write("update Product set image2=".quote($newProductStoreId)." where wobjectId=".quote($wobject->{wobjectId})); - } - if($namespace->{image3}){ - $newProductStoreId = copyFile($namespace->{image3},$wobject->{wobjectId}); - copyFile("thumb-$namespace->{image3}",$wobject->{wobjectId},$newProductStoreId); - WebGUI::SQL->write("update Product set image3=".quote($newProductStoreId)." where wobjectId=".quote($wobject->{wobjectId})); - } - if($namespace->{manual}){ - $newProductStoreId = copyFile($namespace->{manual},$wobject->{wobjectId}); - WebGUI::SQL->write("update Product set manual=".quote($newProductStoreId)." where wobjectId=".quote($wobject->{wobjectId})); - } - if($namespace->{brochure}){ - $newProductStoreId = copyFile($namespace->{brochure},$wobject->{wobjectId}); - WebGUI::SQL->write("update Product set brochure=".quote($newProductStoreId)." where wobjectId=".quote($wobject->{wobjectId})); - } - if($namespace->{warranty}){ - $newProductStoreId = copyFile($namespace->{warranty},$wobject->{wobjectId}); - WebGUI::SQL->write("update Product set warranty=".quote($newProductStoreId)." where wobjectId=".quote($wobject->{wobjectId})); - } - print "\t\t\tMigrating product collateral data\n" unless ($quiet); - foreach my $table (qw(Product_accessory Product_benefit Product_feature Product_related Product_specification)) { - WebGUI::SQL->write("update $table set assetId=".quote($wobjectId)." where wobjectId=".quote($wobject->{wobjectId})); - } - } elsif ($wobject->{namespace} eq "USS") { - print "\t\t\tConverting USS to collaboration system ".$wobject->{wobjectId}."\n" unless ($quiet); - WebGUI::SQL->write("update asset set className='WebGUI::Asset::Wobject::Collaboration' where assetId=".quote($wobjectId)); - my $moderate = ($namespace->{defaultStatus} eq 'Approved') ? 0 : 1; - my $master = WebGUI::SQL->quickHashRef("select * from forum where forumId=".quote($wobject->{forumId})); - my $sg = WebGUI::Group->new("new"); - $sg->description("The group to store subscriptions for the collaboration system $wobjectId"); - $sg->name($wobjectId); - $sg->showInForms(0); - $sg->isEditable(0); - $sg->deleteGroups(['3']); - WebGUI::SQL->write("insert into Collaboration (assetId,postGroupId,moderateGroupId,moderatePosts,karmaPerPost, - collaborationTemplateId, threadTemplateId, postFormTemplateId, searchTemplateId, notificationTemplateId, - sortBy, sortOrder, usePreview, addEditStampToPosts, editTimeout, attachmentsPerPost, allowRichEdit, filterCode, - useContentFilter, rating, archiveAfter, postsPerPage, threadsPerPage, subscriptionGroupId, - allowReplies) values (".quote($wobjectId).", ".quote($namespace->{groupToContribute}).", - ".quote($namespace->{groupToApprove}).", $moderate, ".quote($namespace->{karmaPerSubmission}).", - ".quote($wobject->{templateId}).", ".quote($namespace->{submissionTemplateId}).", - ".quote($namespace->{submissionFormTemplateId}).", ".quote($master->{searchTemplateId}||1).", - ".quote($master->{notificationTemplateId}||1)." , ".quote($namespace->{sortBy}).", - ".quote($namespace->{sortOrder}).", 0, 0, 931536000, 2, 1, ".quote($namespace->{filterContent}).", - 0, 0, ".quote($master->{archiveAfter}||31536000).", ".quote($master->{postsPerPage}||10).", - ".quote($namespace->{submissionsPerPage}).", ".quote($sg->groupId).", - ".quote($wobject->{allowDiscussion}).")"); - WebGUI::SQL->write("update wobject set namespace='Collaboration' where wobjectId=".quote($wobject->{wobjectId})); - print "\t\t\tMigrating submissions for USS ".$wobject->{wobjectId}."\n" unless ($quiet); - my $ussId = $namespace->{USS_id}; - my $usssubrank = 1; - my $collabReplyCounter; - my $collabViewCounter; - my $collabThreadCounter; - my %oldestForumPost; - my $sth = WebGUI::SQL->read("select * from USS_submission where USS_id=".quote($ussId)); - while (my $submission = $sth->hashRef) { - $collabThreadCounter++; - $collabViewCounter += $submission->{views}; - print "\t\t\t\tMigrating submission ".$submission->{USS_submissionId}."\n" unless ($quiet); - my $body = $submission->{content}; - $body =~ s/\n/\^\-\;/ unless ($body =~ m/\^\-\;/); - my @content = split(/\^\-\;/,$body); - $content[0] = WebGUI::HTML::filter($content[0],"none"); - $body =~ s/\^\-\;/\n/; - my $threadLineage = $wobjectLineage.sprintf("%06d",$usssubrank); - my $id = WebGUI::SQL->setRow("asset","assetId",{ - assetId => "new", - title => $submission->{title}, - menuTitle => $submission->{title}, - startDate => $submission->{startDate}, - endDate => $submission->{endDate}, - url => fixUrl('notknownyet',$submission->{title}), - className=>'WebGUI::Asset::Post::Thread', - state=>'published', - ownerUserId=>$submission->{userId}, - groupIdView=>$page->{groupIdView}, - groupIdEdit=>$page->{groupIdEdit}, - synopsis=>$content[0], - assetSize=>length($submission->{content}), - parentId=>$wobjectId, - lineage=>$threadLineage, - isHidden => 1 - }); - my $storageId; - if ($submission->{image}) { - $storageId = copyFile($submission->{image},$wobject->{wobjectId}.$session{os}{slash}.$submission->{USS_submissionId}); - copyFile('thumb-'.$submission->{image},$wobject->{wobjectId}.$session{os}{slash}.$submission->{USS_submissionId},$storageId); - } - if ($submission->{attachment}) { - $storageId = copyFile($submission->{attachment},$wobject->{wobjectId}.$session{os}{slash}.$submission->{USS_submissionId},$storageId); - } - WebGUI::SQL->setRow("Post","assetId",{ - assetId=>$id, - threadId=>$id, - dateSubmitted=>$submission->{dateSubmitted}, - dateUpdated=>$submission->{dateUpdated}, - username=>$submission->{username}, - content=>$body, - status=>lc($submission->{status}), - views=>$submission->{views}, - contentType=>$submission->{contentType}, - userDefined1=>$submission->{userDefined1}, - userDefined2=>$submission->{userDefined2}, - userDefined3=>$submission->{userDefined3}, - userDefined4=>$submission->{userDefined4}, - userDefined5=>$submission->{userDefined5}, - storageId=>$storageId, - rating=>0 - },undef,$id); - my $threadSubscriptionGroup = WebGUI::Group->new("new"); - $threadSubscriptionGroup->description("The group to store subscriptions for the thread $id"); - $threadSubscriptionGroup->name($id); - $threadSubscriptionGroup->showInForms(0); - $threadSubscriptionGroup->isEditable(0); - $threadSubscriptionGroup->deleteGroups(['3']); - WebGUI::SQL->setRow("Thread","assetId",{ - assetId=>$id, - isLocked=>0, - isSticky=>0, - subscriptionGroupId=>$threadSubscriptionGroup->groupId - }, undef, $id); - my %oldestThreadPost; - my $postRank = 1; - my $threadReplyCounter; - my $posts = WebGUI::SQL->read("select forumPost.* from forumPost left join forumThread on forumPost.forumThreadId=forumThread.forumThreadId where forumId=".quote($submission->{forumId})); - while (my $post = $posts->hashRef) { - $collabViewCounter += $post->{views}; - $threadReplyCounter++; - my $postId = WebGUI::SQL->setRow("asset","assetId",{ - assetId=>"new", - parentId=>$id, - lineage=>$threadLineage.sprintf("%06d",$postRank), - state=>'published', - className=>'WebGUI::Asset::Post', - title=>$post->{subject}, - menuTitle=>$post->{subject}, - url=>fixUrl("noneyet",$wobject->{title}.'/'.$submission->{title}.'/'.$post->{subject}), - startDate=>$submission->{startDate}, - endDate=>$submission->{endDate}, - ownerUserId=>$post->{userId}, - groupIdView=>$page->{groupIdView}, - groupIdEdit=>$page->{groupIdEdit}, - isHidden=>1, - lastUpdated=>$post->{dateOfPost}, - lastUpdatedBy=>$post->{userId} - }); - if ($oldestThreadPost{date} < $post->{dateOfPost}) { - $oldestThreadPost{date} = $post->{dateOfPost}; - $oldestThreadPost{id} = $postId; - } - WebGUI::SQL->setRow("Post","assetId",{ - assetId=>$postId, - threadId=>$id, - dateSubmitted=>$post->{dateOfPost}, - dateUpdated=>$post->{dateOfPost}, - username=>$post->{username}, - content=>$post->{message}, - status=>$post->{status}, - views=>$post->{views}, - contentType=>$post->{contentType}, - rating=>$post->{rating} - },undef,$postId); - $postRank++; - } - $posts->finish; - WebGUI::SQL->setRow("Thread","assetId",{ - assetId=>$id, - lastPostId=>$oldestThreadPost{id}, - lastPostDate=>$oldestThreadPost{date}, - replies=>$threadReplyCounter - }); - $usssubrank++; - $collabReplyCounter += $threadReplyCounter; - if ($oldestForumPost{date} < $oldestThreadPost{date}) { - $oldestForumPost{date} = $oldestThreadPost{date}; - $oldestForumPost{id} = $oldestThreadPost{id}; - } - } - rmtree($session{config}{uploadsPath}.$session{os}{slash}.$wobject->{wobjectId}); - WebGUI::SQL->setRow("Collaboration","assetId",{ - assetId=>$wobjectId, - lastPostId=>$oldestForumPost{id}, - lastPostDate=>$oldestForumPost{date}, - replies=>$collabReplyCounter, - views=>$collabViewCounter, - threads=>$collabThreadCounter - }); - } elsif ($wobject->{namespace} eq "WobjectProxy") { - WebGUI::SQL->write("update WobjectProxy set description=".quote($wobject->{description})." where - assetId=".quote($wobjectId)); - } elsif ($wobject->{namespace} eq "MessageBoard") { - print "\t\t\tMigrating Message Board forums\n" unless ($quiet); - my $forums = WebGUI::SQL->read("select forumId, title, description from MessageBoard_forums where wobjectId=".quote($wobject->{wobjectId})." order by sequenceNumber"); - my $i = 1; - while (my ($fid, $title, $desc) = $forums->array) { - migrateForum($fid,$wobjectId,$wobjectLineage,$i, $title,$desc, - $wobject->{startDate}, $wobject->{endDate}, $wobject->{ownerId}, $wobject->{groupIdEdit}, - $page->{styleId}, $page->{printableStyleId}); - $i++; - } - $forums->finish; - } elsif (isIn($wobject->{namespace}, qw(DataForm Poll))) { - print "\t\t\tMigrating wobject collateral data\n" unless ($quiet); - foreach my $table (qw(DataForm_entry DataForm_entryData DataForm_field DataForm_tab Poll_answer)) { - WebGUI::SQL->write("update $table set assetId=".quote($wobjectId)." where wobjectId=".quote($wobject->{wobjectId})); - } - } elsif ($wobject->{namespace} eq "EventsCalendar") { - print "\t\t\tMigrating Events Calendar ".$wobject->{wobjectId}." and its Events\n" unless ($quiet); - my $calId = $namespace->{wobjectId}; - my $sth = WebGUI::SQL->read("select * from EventsCalendar_event where wobjectId=".quote($calId)); - my $eventRank = 1; - while (my $event = $sth->hashRef) { #Migrate each event to an asset. - #generate a new ID. - my $eventId = getNewId(); - #insert a new asset for the event. - print "\t\t\t\tMigrating Event ".$event->{EventsCalendar_eventId}."\n" unless ($quiet); - WebGUI::SQL->write("insert into asset (assetId, parentId, lineage, className, state, title, menuTitle, - url, startDate, endDate, isHidden, ownerUserId, groupIdView, groupIdEdit,assetSize) values (". - quote($eventId).", ".quote($wobjectId).", ".quote($wobjectLineage.sprintf("%06d",$eventRank)).", - 'WebGUI::Asset::Event','published',".quote($event->{name}).", ". - quote($event->{name}).", ".quote(fixUrl($eventId,$wobjectUrl.'/'.$event->{name})).", - ".quote($wobject->{startDate}).", ".quote($wobject->{endDate}).", 1, ".quote($ownerId).", - ".quote($groupIdView).", ".quote($groupIdEdit).",".quote(0).")"); - WebGUI::SQL->write("update EventsCalendar_event set assetId=".quote($eventId).", templateId=".quote($namespace->{eventTemplateId})." where EventsCalendar_eventId=".quote($event->{EventsCalendar_eventId})); - #increment the rank. - $eventRank++; - } - $sth->finish; - } - $rank++; - } - $b->finish; - if ($className eq "WebGUI::Asset::Wobject::Layout") { # Let's position some content - my $positions; - my $last = 1; - my @assets; - my @positions; - my $b = WebGUI::SQL->read("select assetId, templatePosition from wobject where pageId=".quote($page->{pageId})." - order by templatePosition, sequenceNumber"); - while (my ($assetId, $position) = $b->array) { - if ($position != $last) { - push(@positions,join(",",@assets)); - @assets = (); - } - $last = $position; - push(@assets,$assetId); - } - $b->finish; - push(@positions,join(",",@assets)); - my $contentPositions = join("\.",@positions); - WebGUI::SQL->write("update Layout set contentPositions=".quote($contentPositions)." where assetId=".quote($pageId)); - } - if ($page->{parentId} eq "5") { - WebGUI::SQL->write("update asset set isPackage=1 where assetId=".quote($pageId)); - } - walkTree($page->{pageId},$pageId,$pageLineage,$rank); - $myRank++; - } - $a->finish; -} - - -sub migrateForum { - my $originalId = shift; - print "\t\t\t\t Migrating forum $originalId\n"; - my $newParentId = shift; - my $newParentLineage = shift; - my $rank = shift; - my $title = shift; - my $description = shift; - my $startDate = shift; - my $endDate = shift; - my $userId = shift; - my $editGroup = shift; - my $styleId = shift; - my $printId = shift; - my $lineage = $newParentLineage.sprintf("%06d",$rank); - my $data = WebGUI::SQL->quickHashRef("select * from forum where forumId=".quote($originalId)); - if ($data->{masterForumId}) { - my $master = WebGUI::SQL->quickHashRef("select * from forum where forumId=".quote($data->{masterForumId})); - $data->{forumTemplateId} = $master->{forumTemplateId}; - $data->{threadTemplateId} = $master->{threadTemplateId}; - $data->{postTemplateId} = $master->{postTemplateId}; - $data->{searchTemplateId} = $master->{searchTemplateId}; - $data->{notificationTemplateId} = $master->{notificationTemplateId}; - $data->{postFormTemplateId} = $master->{postFormTemplateId}; - $data->{postPreviewTemplateId} = $master->{postPreviewTemplateId}; - $data->{archiveAfter} = $master->{archiveAfter}; - $data->{allowRichEdit} = $master->{allowRichEdit}; - $data->{allowReplacements} = $master->{allowReplacements}; - $data->{filterPosts} = $master->{filterPosts}; - $data->{karmaPerPost} = $master->{karmaPerPost}; - $data->{groupToView} = $master->{groupToView}; - $data->{groupToPost} = $master->{groupToPost}; - $data->{groupToView} = $master->{groupToView}; - $data->{groupToModerate} = $master->{groupToModerate}; - $data->{moderatePosts} = $master->{moderatePosts}; - $data->{attachmentsPerPost} = $master->{attachmentsPerPost}; - $data->{addEditStampToPosts} = $master->{addEditStampsToPost}; - $data->{postsPerPage} = $master->{postsPerPage}; - $data->{usePreview} = $master->{usePreview}; - } - my $viewGroup = $data->{groupToView}; - my $newId = WebGUI::SQL->setRow("asset","assetId",{ - assetId=>"new", - parentId=>$newParentId, - lineage=>$lineage, - state=>'published', - className=>'WebGUI::Asset::Wobject::Collaboration', - title=>$title, - menuTitle=>$title, - url=>fixUrl("noneyet",$title), - startDate=>$startDate, - endDate=>$endDate, - ownerUserId=>$userId, - groupIdView=>$viewGroup, - groupIdEdit=>$editGroup, - isHidden=>1, - lastUpdated=>time(), - lastUpdatedBy=>'3'}); - WebGUI::SQL->setRow("wobject","assetId",{ - assetId=>$newId, - description=>$description, - styleTemplateId=>$styleId, - printableStyleTemplateId=>$printId - },undef,$newId); - print "\t\t\t\t\t Migrating subscriptions for forum $originalId\n"; - my $subscriptionGroup = WebGUI::Group->new("new"); - $subscriptionGroup->description("The group to store subscriptions for the collaboration system $newId"); - $subscriptionGroup->name($newId); - $subscriptionGroup->showInForms(0); - $subscriptionGroup->isEditable(0); - $subscriptionGroup->deleteGroups(['3']); - my $sth = WebGUI::SQL->read("select userId from forumSubscription where forumId=".quote($originalId)); - my @users; - while (my ($uid) = $sth->array) { - push(@users,$uid); - } - $sth->finish; - $subscriptionGroup->addUsers(\@users); - WebGUI::SQL->setRow("Collaboration","assetId", { - postGroupId=>$data->{groupToPost}, - moderateGroupId=>$data->{groupToModerate}, - moderatePosts=>$data->{moderatePosts}, - karmaPerPost=>$data->{karmaPerPost}, - collaborationTemplateId=>$data->{forumTemplateId}, - threadTemplateId=>$data->{threadTemplateId}, - postFormTemplateId=>$data->{postformTemplateId}, - searchTemplateId=>$data->{searchTemplateId}, - notificationTemplateId=>$data->{notificationTemplateId}, - sortBy=>$data->{sortBy}, - sortOrder=>$data->{sortOrder}, - usePreview=>$data->{usePreview}, - addEditStampToPosts=>$data->{addEditStampToPosts}, - editTimeout=>$data->{editTimeout}, - attachmentsPerPost=>$data->{attachmentsPerPost}, - allowRichEdit=>$data->{allowRichEdit}, - filterCode=>$data->{filterPosts}, - useContentFilter=>$data->{allowReplacements}, - threads=>$data->{threads}, - views=>$data->{views}, - replies=>$data->{replies}, - rating=>$data->{rating}, - archiveAfter=>$data->{archiveAfter}, - postsPerPage=>$data->{postsPerPage}, - threadsPerPage=>$data->{threadsPerPage}, - subscriptionGroupId=>$subscriptionGroup->groupId, - allowReplies=>1 - },undef,$newId); - my %oldestForumPost; - my $ratingprep = WebGUI::SQL->prepare("insert into Post_rating (assetId, userId, ipAddress, dateOfRating, rating) values (?,?,?,?,?)"); - print "\t\t\t\t\t Migrating threads for forum $originalId\n"; - my $threads = WebGUI::SQL->read("select * from forumThread left join forumPost on forumThread.rootPostId=forumPost.forumPostId where - forumThread.forumId=".quote($originalId)." and forumPost.status<>'deleted'"); - my $threadRank = 1; - if ($threads->errorCode>0) { - print "\t\t\t\tWARNING: There was a problem migrating the threads for $originalId\n"; - return; - } - while (($threads->errorCode < 1) && (my ($thread) = $threads->hashRef)) { - next if ($thread->{forumThreadId} eq ""); - print "\t\t\t\t\t\t Migrating thread ".$thread->{forumThreadId}."\n"; - my $threadLineage = $lineage.sprintf("%06d",$threadRank); - my $threadId = WebGUI::SQL->setRow("asset","assetId",{ - assetId=>"new", - parentId=>$newId, - lineage=>$threadLineage, - state=>'published', - className=>'WebGUI::Asset::Post::Thread', - title=>$thread->{subject}, - menuTitle=>$thread->{subject}, - url=>fixUrl("noneyet",$title.'/'.$thread->{subject}), - startDate=>$startDate, - endDate=>$endDate, - ownerUserId=>$thread->{userId}, - groupIdView=>$viewGroup, - groupIdEdit=>$editGroup, - isHidden=>1, - lastUpdated=>$thread->{dateOfPost}, - lastUpdatedBy=>$thread->{userId} - }); - WebGUI::SQL->setRow("Post","assetId",{ - assetId=>$threadId, - threadId=>$threadId, - dateSubmitted=>$thread->{dateOfPost}, - dateUpdated=>$thread->{dateOfPost}, - username=>$thread->{username}, - content=>$thread->{message}, - status=>$thread->{status}, - views=>$thread->{views}, - contentType=>$thread->{contentType}, - rating=>$thread->{rating} - },undef,$threadId); - my $threadSubscriptionGroup = WebGUI::Group->new("new"); - $threadSubscriptionGroup->description("The group to store subscriptions for the thread $threadId"); - $threadSubscriptionGroup->name($threadId); - $threadSubscriptionGroup->showInForms(0); - $threadSubscriptionGroup->isEditable(0); - $threadSubscriptionGroup->deleteGroups(['3']); - my $sth = WebGUI::SQL->read("select userId from forumThreadSubscription where forumThreadId=".quote($thread->{forumThreadId})); - my @users; - while (my ($uid) = $sth->array) { - push(@users,$uid); - } - $sth->finish; - $threadSubscriptionGroup->addUsers(\@users); - WebGUI::SQL->setRow("Thread","assetId",{ - assetId=>$threadId, - replies=>$thread->{replies}, - isLocked=>$thread->{isLocked}, - isSticky=>$thread->{isSticky}, - subscriptionGroupId=>$threadSubscriptionGroup->groupId - }, undef, $threadId); - # we're going to give up hierarchy during the upgrade for the sake of simplicity - print "\t\t\t\t\t\t Migrating posts for thread ".$thread->{forumThreadId}."\n"; - my %oldestThreadPost; - my $posts = WebGUI::SQL->read("select * from forumPost where forumThreadId=".quote($thread->{forumThreadId})." and parentId<>'0' and forumPost.status<>'deleted'"); - my $postRank = 1; - if ($posts->errorCode>0) { - print "\t\t\t\tWARNING: There was a problem migrating the posts for ".$thread->{forumThreadId}."\n"; - next; - } - while (my $post = $posts->hashRef) { - next if ($thread->{forumPostId} eq ""); - print "\t\t\t\t\t\t\t Migrating post ".$post->{forumPostId}."\n"; - my $postId = WebGUI::SQL->setRow("asset","assetId",{ - assetId=>"new", - parentId=>$threadId, - lineage=>$threadLineage.sprintf("%06d",$postRank), - state=>'published', - className=>'WebGUI::Asset::Post', - title=>$post->{subject}, - menuTitle=>$post->{subject}, - url=>fixUrl("noneyet",$title.'/'.$thread->{subject}.'/'.$post->{subject}), - startDate=>$startDate, - endDate=>$endDate, - ownerUserId=>$post->{userId}, - groupIdView=>$viewGroup, - groupIdEdit=>$editGroup, - isHidden=>1, - lastUpdated=>$post->{dateOfPost}, - lastUpdatedBy=>$post->{userId} - }); - if ($oldestThreadPost{date} < $post->{dateOfPost}) { - $oldestThreadPost{date} = $post->{dateOfPost}; - $oldestThreadPost{id} = $postId; - } - WebGUI::SQL->setRow("Post","assetId",{ - assetId=>$postId, - threadId=>$threadId, - dateSubmitted=>$post->{dateOfPost}, - dateUpdated=>$post->{dateOfPost}, - username=>$post->{username}, - content=>$post->{message}, - status=>$post->{status}, - views=>$post->{views}, - contentType=>$post->{contentType}, - rating=>$post->{rating} - },undef,$postId); - print "\t\t\t\t\t\t\t\t Migrating ratings for post ".$post->{forumPostId}."\n"; - my $ratings = WebGUI::SQL->read("select userId,ipAddress,dateOfRating,rating from forumPostRating where forumPostId=".quote($post->{forumPostId})); - while (my ($uid,$ip,$date,$rating) = $ratings->array) { - $ratingprep->execute([$postId,$uid,$ip,$date,$rating]); - } - $ratings->finish; - $postRank++; - } - $posts->finish; - print "\t\t\t\t\t\t\t Setting oldest post for thread ".$thread->{forumThreadId}."\n"; - WebGUI::SQL->setRow("Thread","assetId",{ - assetId=>$threadId, - lastPostId=>$oldestThreadPost{id}, - lastPostDate=>$oldestThreadPost{date} - }); - if ($oldestForumPost{date} < $oldestThreadPost{date}) { - $oldestForumPost{date} = $oldestThreadPost{date}; - $oldestForumPost{id} = $oldestThreadPost{id}; - } - $threadRank++; - } - print "\t\t\t\t WARNING: Couldn't finish processing threads for $originalId because something nasty occured in the database." if ($threads->errorCode > 0); - $threads->finish; - $ratingprep->finish; - print "\t\t\t\t\t\t Setting oldest post for forum ".$originalId."\n"; - WebGUI::SQL->setRow("Collaboration","assetId",{ - assetId=>$newId, - lastPostId=>$oldestForumPost{id}, - lastPostDate=>$oldestForumPost{date} - }); -} - -sub fixUrl { - my $id = shift; - my $url = shift; - if (length($url) > 250) { - $url = substr($url,220); - } - $url = WebGUI::URL::urlize($url); - $url = WebGUI::Id::generate() unless (defined $url && $url ne ""); - my ($test) = WebGUI::SQL->quickArray("select url from asset where assetId<>".quote($id)." and url=".quote($url)); - if ($test) { - my @parts = split(/\./,$url); - if ($parts[0] =~ /(.*)(\d+$)/) { - $parts[0] = $1.($2+1); - } elsif ($test ne "") { - $parts[0] .= "2"; - } - $url = join(".",@parts); - $url = fixUrl($id,$url); - } - $url = WebGUI::Id::generate() unless (defined $url && $url ne ""); #check one last time to make sure we don't have an empty url - return $url; -} - -sub copyFile { - my $filename = shift; - my $oldPath = shift; - my $id = shift || WebGUI::Id::generate(); - $id =~ m/^(.{2})(.{2})/; - my $node = $session{config}{uploadsPath}.$session{os}{slash}.$1; - mkdir($node); - $node .= $session{os}{slash}.$2; - mkdir($node); - $node .= $session{os}{slash}.$id; - mkdir($node); - my $a = FileHandle->new($session{config}{uploadsPath}.$session{os}{slash}.$oldPath.$session{os}{slash}.$filename,"r"); - if (defined $a) { - binmode($a); - my $b = FileHandle->new(">".$node.$session{os}{slash}.$filename); - if (defined $b) { - print "Moving File".$session{config}{uploadsPath}.$session{os}{slash}.$oldPath.$session{os}{slash}.$filename."\n"; - binmode($b); - copy($a,$b); - } - } - return $id; -} - -sub getNextLineage { - my $assetId = shift; - my ($startLineage) = WebGUI::SQL->quickArray("select lineage from asset where parentId='".$assetId."' order by lineage desc limit 1"); - $startLineage = '000001000001000000' unless ($startLineage); - my $rank = substr($startLineage,12,6); - my $parentLineage = substr($startLineage,0,12); - return $parentLineage.sprintf("%06d",($rank+1)); -} - -sub getFileSize { - my $id = shift; - my $filename = shift; - $id =~ m/^(.{2})(.{2})/; - my $path = $session{config}{uploadsPath}.$session{os}{slash}.$1.$session{os}{slash}.$2.$session{os}{slash}.$id.$session{os}{slash}.$filename; - my (@attributes) = stat($path); - return $attributes[7] || 0; -} - -sub getFileExtension { - my $filename = shift; - my $extension = lc($filename); - $extension =~ s/.*\.(.*?)$/$1/; - return $extension; -} - -sub isIn { - my $key = shift; - $_ eq $key and return 1 for @_; - return 0; -} - - -sub getNewId { - my $type = shift; - my $oldId = shift; - my $namespace = shift; - my $migration = {'tmpl' => { - 'Operation/MessageLog/View' => { - '1' => 'PBtmpl0000000000000050' - }, - 'Collaboration/Search' => { - '1' => 'PBtmpl0000000000000031' - }, - 'Auth/WebGUI/Account' => { - '1' => 'PBtmpl0000000000000010' - }, - 'MessageBoard' => { - '1' => 'PBtmpl0000000000000047' - }, - 'Operation/Profile/View' => { - '1' => 'PBtmpl0000000000000052' - }, - 'Operation/RedeemSubscription' => { - '1' => 'PBtmpl0000000000000053' - }, - 'Navigation' => { - '8' => 'PBtmpl0000000000000136', - '6' => 'PBtmpl0000000000000130', - '1001' => 'PBtmpl0000000000000075', - '4' => 'PBtmpl0000000000000117', - '1' => 'PBtmpl0000000000000048', - '3' => 'PBtmpl0000000000000108', - '7' => 'PBtmpl0000000000000134', - '1000' => 'PBtmpl0000000000000071', - '2' => 'PBtmpl0000000000000093', - '5' => 'PBtmpl0000000000000124' - }, - 'Macro/L_loginBox' => { - '1' => 'PBtmpl0000000000000044', - '2' => 'PBtmpl0000000000000092' - }, - 'Commerce/ConfirmCheckout' => { - '1' => 'PBtmpl0000000000000016' - }, - 'prompt' => { - '1' => 'PBtmpl0000000000000057' - }, - 'Auth/SMB/Login' => { - '1' => 'PBtmpl0000000000000009' - }, - 'ImageAsset' => { - '2' => 'PBtmpl0000000000000088' - }, - 'AttachmentBox' => { - '1' => 'PBtmpl0000000000000003' - }, - 'Poll' => { - '1' => 'PBtmpl0000000000000055' - }, - 'FileAsset' => { - '1' => 'PBtmpl0000000000000024' - }, - 'HttpProxy' => { - '1' => 'PBtmpl0000000000000033' - }, - 'Auth/SMB/Create' => { - '1' => 'PBtmpl0000000000000008' - }, - 'Commerce/ViewPurchaseHistory' => { - '1' => 'PBtmpl0000000000000019' - }, - 'Article' => { - '6' => 'PBtmpl0000000000000129', - '4' => 'PBtmpl0000000000000115', - '1' => 'PBtmpl0000000000000002', - '3' => 'PBtmpl0000000000000103', - '2' => 'PBtmpl0000000000000084', - '5' => 'PBtmpl0000000000000123' - }, - 'style' => { - '6' => 'PBtmpl0000000000000132', - 'adminConsole' => 'PBtmpl0000000000000137', - '3' => 'PBtmpl0000000000000111', - '1' => 'PBtmpl0000000000000060', - '10' => 'PBtmpl0000000000000070' - }, - 'Macro/SubscriptionItem' => { - '1' => 'PBtmpl0000000000000046' - }, - 'WSClient' => { - '1' => 'PBtmpl0000000000000069', - '2' => 'PBtmpl0000000000000100' - }, - 'Operation/MessageLog/Message' => { - '1' => 'PBtmpl0000000000000049' - }, - 'Auth/SMB/Account' => { - '1' => 'PBtmpl0000000000000007' - }, - 'Survey' => { - '1' => 'PBtmpl0000000000000061' - }, - 'EventsCalendar' => { - '1' => 'PBtmpl0000000000000022', - '3' => 'PBtmpl0000000000000105', - '2' => 'PBtmpl0000000000000086' - }, - 'Macro/AdminToggle' => { - '1' => 'PBtmpl0000000000000036' - }, - 'Auth/LDAP/Create' => { - '1' => 'PBtmpl0000000000000005' - }, - 'Auth/WebGUI/Create' => { - '1' => 'PBtmpl0000000000000011' - }, - 'Folder' => { - '15' => 'PBtmpl0000000000000078' - }, - 'Layout' => { - '6' => 'PBtmpl0000000000000131', - '3' => 'PBtmpl0000000000000109', - '7' => 'PBtmpl0000000000000135', - '2' => 'PBtmpl0000000000000094', - '1' => 'PBtmpl0000000000000054', - '4' => 'PBtmpl0000000000000118', - '5' => 'PBtmpl0000000000000125' - }, - 'Macro/H_homeLink' => { - '1' => 'PBtmpl0000000000000042' - }, - 'Collaboration' => { - '25' => 'PBtmpl0000000000000026', - '6' => 'PBtmpl0000000000000133', - '21' => 'PBtmpl0000000000000102', - '3' => 'PBtmpl0000000000000112', - '2' => 'PBtmpl0000000000000097', - '17' => 'PBtmpl0000000000000081', - '20' => 'PBtmpl0000000000000101', - '15' => 'PBtmpl0000000000000079', - '14' => 'PBtmpl0000000000000077', - '4' => 'PBtmpl0000000000000121', - '1' => 'PBtmpl0000000000000066', - '18' => 'PBtmpl0000000000000082', - '16' => 'PBtmpl0000000000000080', - '19' => 'PBtmpl0000000000000083', - '5' => 'PBtmpl0000000000000128' - }, - 'AdminConsole' => { - '1' => 'PBtmpl0000000000000001' - }, - 'SQLReport' => { - '1' => 'PBtmpl0000000000000059' - }, - 'Macro/AdminBar' => { - '1' => 'PBtmpl0000000000000035', - '2' => 'PBtmpl0000000000000090' - }, - 'Survey/Gradebook' => { - '1' => 'PBtmpl0000000000000062' - }, - 'DataForm/List' => { - '1' => 'PBtmpl0000000000000021' - }, - 'Macro/GroupDelete' => { - '1' => 'PBtmpl0000000000000041' - }, - 'Product' => { - '4' => 'PBtmpl0000000000000119', - '1' => 'PBtmpl0000000000000056', - '3' => 'PBtmpl0000000000000110', - '2' => 'PBtmpl0000000000000095' - }, - 'Commerce/TransactionError' => { - '1' => 'PBtmpl0000000000000018' - }, - 'IndexedSearch' => { - '1' => 'PBtmpl0000000000000034', - '3' => 'PBtmpl0000000000000106', - '2' => 'PBtmpl0000000000000089' - }, - 'Auth/WebGUI/Expired' => { - '1' => 'PBtmpl0000000000000012' - }, - 'Commerce/SelectPaymentGateway' => { - '1' => 'PBtmpl0000000000000017' - }, - 'Macro/File' => { - '1' => 'PBtmpl0000000000000039', - '3' => 'PBtmpl0000000000000107', - '2' => 'PBtmpl0000000000000091' - }, - 'Survey/Overview' => { - '1' => 'PBtmpl0000000000000063' - }, - 'Macro/a_account' => { - '1' => 'PBtmpl0000000000000037' - }, - 'Macro/LoginToggle' => { - '1' => 'PBtmpl0000000000000043' - }, - 'Auth/LDAP/Account' => { - '1' => 'PBtmpl0000000000000004' - }, - 'Survey/Response' => { - '1' => 'PBtmpl0000000000000064' - }, - 'Commerce/CheckoutCanceled' => { - '1' => 'PBtmpl0000000000000015' - }, - 'Collaboration/Thread' => { - '25' => 'PBtmpl0000000000000032', - '1' => 'PBtmpl0000000000000067', - '3' => 'PBtmpl0000000000000113', - '2' => 'PBtmpl0000000000000098' - }, - 'Auth/WebGUI/Recovery' => { - '1' => 'PBtmpl0000000000000014' - }, - 'Macro/r_printable' => { - '1' => 'PBtmpl0000000000000045' - }, - 'Operation/Profile/Edit' => { - '1' => 'PBtmpl0000000000000051' - }, - 'SyndicatedContent' => { - '1' => 'PBtmpl0000000000000065' - }, - 'Collaboration/PostForm' => { - '25' => 'PBtmpl0000000000000029', - '4' => 'PBtmpl0000000000000122', - '1' => 'PBtmpl0000000000000068', - '3' => 'PBtmpl0000000000000114', - '2' => 'PBtmpl0000000000000099' - }, - 'EventsCalendar/Event' => { - '1' => 'PBtmpl0000000000000023' - }, - 'Macro/GroupAdd' => { - '1' => 'PBtmpl0000000000000040' - }, - 'Collaboration/Notification' => { - '1' => 'PBtmpl0000000000000027' - }, - 'Auth/LDAP/Login' => { - '1' => 'PBtmpl0000000000000006' - }, - 'DataForm' => { - '4' => 'PBtmpl0000000000000116', - '1' => 'PBtmpl0000000000000020', - '3' => 'PBtmpl0000000000000104', - '2' => 'PBtmpl0000000000000085' - }, - 'Auth/WebGUI/Login' => { - '1' => 'PBtmpl0000000000000013' - }, - 'richEditor' => { - 'tinymce' => 'PBtmpl0000000000000138', - '5' => 'PBtmpl0000000000000126' - }, - 'Macro/EditableToggle' => { - '1' => 'PBtmpl0000000000000038' - }, - 'richEditor/pagetree' => { - '1' => 'PBtmpl0000000000000058' - } - }, - 'nav' => { - '11' => 'PBnav00000000000000006', - '7' => 'PBnav00000000000000019', - '2' => 'PBnav00000000000000014', - '17' => 'PBnav00000000000000012', - '1' => 'PBnav00000000000000001', - '18' => 'PBnav00000000000000013', - '16' => 'PBnav00000000000000011', - '13' => 'PBnav00000000000000008', - '6' => 'PBnav00000000000000018', - '3' => 'PBnav00000000000000015', - '9' => 'PBnav00000000000000021', - '12' => 'PBnav00000000000000007', - '14' => 'PBnav00000000000000009', - '15' => 'PBnav00000000000000010', - '8' => 'PBnav00000000000000020', - '4' => 'PBnav00000000000000016', - '10' => 'PBnav00000000000000002', - '5' => 'PBnav00000000000000017' - } - }; - my $newId; - if ($type eq "nav") { - $newId = $migration->{nav}{$oldId}; - } elsif ($type eq "tmpl") { - $newId = $migration->{tmpl}{$namespace}{$oldId}; - } - $newId = WebGUI::Id::generate() unless ($newId); - return $newId; -} - -# Frank Dillon 20050201 -- -# Converting Product Wobjects to Assets. -- -sub mapProductCollateral { - my $sth = WebGUI::SQL->read("select * from Product_accessory"); - while (my $hash = $sth->hashRef){ - my ($newAssetId) = WebGUI::SQL->quickArray("select assetId from Product where wobjectId=".quote($hash->{AccessoryWobjectId})); - WebGUI::SQL->write("update Product_accessory set accessoryAssetId=".quote($newAssetId)." where wobjectId=".quote($hash->{wobjectId})." and AccessoryWobjectId=".quote($hash->{AccessoryWobjectId})); - } - $sth->finish; - - $sth = WebGUI::SQL->read("select * from Product_related"); - while (my $hash = $sth->hashRef){ - my ($newAssetId) = WebGUI::SQL->quickArray("select assetId from Product where wobjectId=".quote($hash->{RelatedWobjectId})); - WebGUI::SQL->write("update Product_related set relatedAssetId=".quote($newAssetId)." where wobjectId=".quote($hash->{wobjectId})." and RelatedWobjectId=".quote($hash->{RelatedWobjectId})); - } - $sth->finish; -} diff --git a/docs/upgrades/upgrade_6.2.11-6.3.0.sql b/docs/upgrades/upgrade_6.2.11-6.3.0.sql deleted file mode 100644 index fb354e1ba..000000000 --- a/docs/upgrades/upgrade_6.2.11-6.3.0.sql +++ /dev/null @@ -1,337 +0,0 @@ -insert into webguiVersion values ('6.3.0','upgrade',unix_timestamp()); - -UPDATE template set template = '\n\n\n
\r\n\r\n
\r\n \">\r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n
' where templateId='8' and namespace='Navigation'; - -delete from template where templateId='tinymce' and namespace='richEditor'; -INSERT INTO template VALUES ('tinymce','TinyMCE','^JavaScript(\"/tinymce/jscripts/tiny_mce/tiny_mce.js\");\r\n\r\n\r\n','richEditor',1,1); -delete from template where namespace='style' and templateId='10'; -update template set template='^JavaScript(\"/tinymce/jscripts/tiny_mce/tiny_mce.js\");\r\n\r\n\r\n' where templateId='tinymce' and namespace='richEditor'; -delete from userProfileField where fieldName='richEditor'; -INSERT INTO userProfileField VALUES ('richEditor','WebGUI::International::get(496)',1,0,'selectList','{\'PBtmpl0000000000000126\'=>WebGUI::International::get(880),\r\nnone=>WebGUI::International::get(881),\r\n\'PBtmpl0000000000000138\'=>WebGUI::International::get(\"tinymce\")\n}','[\'PBtmpl0000000000000138\']',11,'4',0,1); -update userProfileData set fieldData='PBtmpl0000000000000138' where fieldName='richEditor'; - -INSERT INTO template VALUES ('adminConsole','Admin Console','\r\n\r\n\r\n WebGUI <tmpl_var session.webgui.version>-<tmpl_var session.webgui.status> Admin Console\r\n \r\n\r\n\r\n\r\n\r\n\r\n','style',1,0); -delete from settings where name='adminStyleId'; -delete from settings where name='useAdminStyle'; - - -ALTER TABLE SQLReport CHANGE preprocessMacros preprocessMacros1 INT DEFAULT 0; -ALTER TABLE SQLReport CHANGE dbQuery dbQuery1 TEXT; -ALTER TABLE SQLReport CHANGE databaseLinkId databaseLinkId1 varchar(22) DEFAULT NULL; -ALTER TABLE SQLReport ADD placeholderParams1 TEXT; - -ALTER TABLE SQLReport ADD preprocessMacros2 INT DEFAULT 0; -ALTER TABLE SQLReport ADD dbQuery2 TEXT; -ALTER TABLE SQLReport ADD placeholderParams2 TEXT; -ALTER TABLE SQLReport ADD databaseLinkId2 VARCHAR(22); - -ALTER TABLE SQLReport ADD preprocessMacros3 INT DEFAULT 0; -ALTER TABLE SQLReport ADD dbQuery3 TEXT; -ALTER TABLE SQLReport ADD placeholderParams3 TEXT; -ALTER TABLE SQLReport ADD databaseLinkId3 VARCHAR(22); - -ALTER TABLE SQLReport ADD preprocessMacros4 INT DEFAULT 0; -ALTER TABLE SQLReport ADD dbQuery4 TEXT; -ALTER TABLE SQLReport ADD placeholderParams4 TEXT; -ALTER TABLE SQLReport ADD databaseLinkId4 VARCHAR(22); - -ALTER TABLE SQLReport ADD preprocessMacros5 INT DEFAULT 0; -ALTER TABLE SQLReport ADD dbQuery5 TEXT; -ALTER TABLE SQLReport ADD placeholderParams5 TEXT; -ALTER TABLE SQLReport ADD databaseLinkId5 VARCHAR(22); - -UPDATE template set template = '\r\n

\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n\r\n

    \r\n \r\n
  • \r\n
    \r\n
\r\n
\r\n\r\n\r\n\r\n \r\n \r\n \r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n
\">\r\n \r\n \r\n \r\n \r\n \r\n
\r\n  \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\">\r\n \r\n \r\n \r\n \r\n \r\n
\r\n  \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\">\r\n \r\n \r\n \r\n \r\n \r\n
\r\n  \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\">\r\n \r\n \r\n \r\n \r\n \r\n
\r\n  \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n \r\n
\r\n
' where templateId="1" and namespace="SQLReport"; - -create table asset ( - assetId varchar(22) not null primary key, - parentId varchar(22) not null, - lineage varchar(255) not null, - state varchar(35) not null, - className varchar(255) not null, - title varchar(255) not null default 'untitled', - menuTitle varchar(255) not null default 'untitled', - url varchar(255) not null, - startDate bigint not null default 997995720, - endDate bigint not null default 9223372036854775807, - ownerUserId varchar(22) not null, - groupIdView varchar(22) not null, - groupIdEdit varchar(22) not null, - synopsis text, - newWindow int not null default 0, - isHidden int not null default 0, - isSystem int not null default 0, - encryptPage int not null default 0, - assetSize int not null default 0, - lastUpdated bigint not null default 0, - lastUpdatedBy varchar(22), - isPackage int not null default 0, - extraHeadTags text, - unique index (lineage asc), - unique index (url), - index (parentId) -); - -insert into asset (assetId, parentId, lineage, state, className, title, menuTitle, url, isSystem, ownerUserId, groupIdView, groupIdEdit, isHidden) values ('PBasset000000000000001', 'infinity', '000001','published','WebGUI::Asset','Root','Root','root',1,'3','3','3',1); -insert into asset (assetId, parentId, lineage, state, className, title, menuTitle, url, isSystem, ownerUserId, groupIdView, groupIdEdit, isHidden) values ('PBasset000000000000002', 'PBasset000000000000001', '000001000001','published','WebGUI::Asset::Wobject::Folder','Import Node','Import','root/import',1,'3','3','3',1); - -create table assetHistory ( - assetId varchar(22) not null, - userId varchar(22) not null, - dateStamp bigint not null default 0, - actionTaken varchar(255) not null -); - -create table redirect ( - assetId varchar(22) not null primary key, - redirectUrl text -); - -create table snippet ( - assetId varchar(22) not null primary key, - snippet mediumtext -); - -create table Layout ( - assetId varchar(22) not null primary key, - templateId varchar(22) not null, - contentPositions text -); - -create table Folder ( - assetId varchar(22) not null primary key, - templateId varchar(22) not null -); - - -create table FileAsset ( - assetId varchar(22) not null primary key, - storageId varchar(22) not null, - filename varchar(255) not null, - olderVersions text -); - -INSERT INTO settings VALUES ('commerceCheckoutCanceledTemplateId','1'); -INSERT INTO settings VALUES ('commerceConfirmCheckoutTemplateId','1'); -INSERT INTO settings VALUES ('commercePaymentPlugin','PayFlowPro'); -INSERT INTO settings VALUES ('commerceSelectPaymentGatewayTemplateId','1'); -INSERT INTO settings VALUES ('commerceTransactionErrorTemplateId','1'); -INSERT INTO template VALUES ('1','Subscription code redemption','\r\nBatch: \r\n\r\n\r\n
\r\n','Operation/RedeemSubscription',1,1); -INSERT INTO template VALUES ('1','Subscriptionitem default template','

\r\n
\r\n
\r\n
\r\n$
\r\n\">Subscribe now
','Macro/SubscriptionItem',1,1); -INSERT INTO template VALUES ('1','Default transaction error template','\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n
Transaction descriptionPriceStatusError
()

\r\n
\r\n\r\n','Commerce/TransactionError',1,1); -INSERT INTO template VALUES ('1','Default checkout confirmation template','
\r\n
\r\n
    \r\n\r\n
  • \r\n
    \r\n
\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n
Subscription \"\" : $ every

\r\n
\r\n
\r\n','Commerce/ConfirmCheckout',1,1); -INSERT INTO template VALUES ('1','Default view purchase history template','\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n
$ \">Cancel
x $
','Commerce/ViewPurchaseHistory',1,1); -INSERT INTO template VALUES ('1','Default cancel checkout template','','Commerce/CheckoutCanceled',1,1); -CREATE TABLE shoppingCart ( - sessionId varchar(22) NOT NULL default '', - itemId varchar(64) NOT NULL default '', - itemType varchar(40) NOT NULL default '', - quantity int(4) NOT NULL default '0', - PRIMARY KEY (sessionId,itemId,itemType) -) TYPE=MyISAM; -CREATE TABLE subscription ( - subscriptionId varchar(22) NOT NULL default '', - name varchar(128) default NULL, - price float default '0', - description mediumtext, - subscriptionGroup varchar(22) NOT NULL default '', - duration varchar(12) NOT NULL default 'Monthly', - executeOnSubscription varchar(128) default NULL, - karma int(4) default '0', - deleted int(1) default '0', - PRIMARY KEY (subscriptionId) -) TYPE=MyISAM; -CREATE TABLE subscriptionCodeBatch ( - batchId varchar(22) NOT NULL default '', - name varchar(128) default NULL, - description mediumtext NOT NULL, - subscriptionId varchar(22) NOT NULL default '', - PRIMARY KEY (batchId) -) TYPE=MyISAM; -CREATE TABLE subscriptionCode ( - batchId varchar(22) NOT NULL default '', - code varchar(64) NOT NULL default '', - status varchar(10) NOT NULL default 'Unused', - dateCreated int(11) NOT NULL default '0', - dateUsed int(11) NOT NULL default '0', - expires int(11) NOT NULL default '0', - usedBy varchar(22) NOT NULL default '0', - PRIMARY KEY (code) -) TYPE=MyISAM; -CREATE TABLE subscriptionCodeSubscriptions ( - code varchar(64) NOT NULL default '', - subscriptionId varchar(22) NOT NULL default '', - UNIQUE KEY code (code,subscriptionId) -) TYPE=MyISAM; -CREATE TABLE transaction ( - transactionId varchar(22) NOT NULL default '', - userId varchar(22) NOT NULL default '', - amount float NOT NULL default '0', - gatewayId varchar(128) default NULL, - gateway varchar(64) NOT NULL default '', - recurring tinyint(1) NOT NULL default '0', - initDate int(11) NOT NULL default '0', - completionDate int(11) default '0', - status varchar(10) NOT NULL default 'Pending', - lastPayedTerm int(6) NOT NULL default '0', - PRIMARY KEY (transactionId) -) TYPE=MyISAM; -CREATE TABLE transactionItem ( - transactionId varchar(22) NOT NULL default '', - itemName varchar(64) NOT NULL default '', - amount float NOT NULL default '0', - quantity int(4) NOT NULL default '0', - itemId varchar(64) NOT NULL default '', - itemType varchar(40) NOT NULL default '' -) TYPE=MyISAM; -CREATE TABLE commerceSettings ( - fieldName varchar(64) NOT NULL default '', - fieldValue varchar(255) NOT NULL default '', - namespace varchar(64) NOT NULL default '', - type varchar(10) NOT NULL default '' -) TYPE=MyISAM; -create table ITransact_recurringStatus ( - gatewayId varchar(128) not null primary key, - initDate int(11) not null, - lastTransaction int(11) not null, - status varchar(10) not null, - errorMessage varchar(128), - recipe varchar(15) not null -); -INSERT INTO template VALUES ('1','Default payment gateway selection template','\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n\r\n \r\n
','Commerce/SelectPaymentGateway',1,1); - - -create table ImageAsset ( - assetId varchar(22) not null primary key, - thumbnailSize int not null default 50, - parameters text -); - -INSERT INTO template VALUES ('1','Admin Console','^StyleSheet(^Extras;/adminConsole/adminConsole.css);\r\n^JavaScript(^Extras;/adminConsole/adminConsole.js);\r\n\r\n
\r\n \r\n \" target=\"_blank\">\"?\"\r\n \r\n
\r\n
\r\n \" border=\"0\" title=\"\" alt=\"\" />\r\n
\r\n
\r\n\"*\"\r\n
\r\n
\r\n \" border=\"0\" title=\"\" alt=\"\" />\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n  \r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n  \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \" >
\r\n
\r\n
\r\n
\r\n
\r\n ^AdminToggle;
\r\n ^LoginToggle;
\r\n
\r\n
\r\n\r\n','AdminConsole',1,1); -insert into settings (name,value) values ('AdminConsoleTemplate',"PBtmpl0000000000000001"); -delete from template where namespace='Macro/AdminBar' and templateId in ('1','2'); -INSERT INTO template VALUES ('1','Default Admin Bar','\r\n \r\n
\r\n\r\n \r\n \r\n\r\n \r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n
\r\n','Macro/AdminBar',1,1); -INSERT INTO template VALUES ('2','DHTML Admin Bar','^JavaScript(\"/coolmenus/coolmenus4.js\");\r\n\r\n\r\n\r\n','Macro/AdminBar',1,1); - -delete from template where namespace='page' and templateId in ('1','2','3','4','5','6','7'); - -INSERT INTO template VALUES ('5','Left Column','\">\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n
 
\r\n\r\n
\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
 
\r\n\r\n \r\n
 
\r\n \r\n
\r\n ','page',1,1); -INSERT INTO template VALUES ('4','Three Over One','\">\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n
 
\r\n\r\n
\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n\r\n
 
\r\n\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n \r\n
 
\r\n \r\n
\r\n ','page',1,1); -INSERT INTO template VALUES ('3','One Over Three','\">\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n
 
\r\n\r\n
\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n\r\n
 
\r\n\r\n\r\n \r\n
 
\r\n \r\n
\r\n ','page',1,1); -INSERT INTO template VALUES ('2','News','\">\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n
 
\r\n\r\n
\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
 
\r\n\r\n\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n \r\n
 
\r\n \r\n
\r\n ','page',1,1); -INSERT INTO template VALUES ('7','Side By Side','\">\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n
 
\r\n\r\n
\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
 
\r\n\r\n\r\n \r\n
 
\r\n \r\n
\r\n ','page',1,1); -INSERT INTO template VALUES ('6','Right Column','\">\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n
 
\r\n\r\n
\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n
\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
 
\r\n\r\n\r\n \r\n
 
\r\n \r\n
\r\n ','page',1,1); -INSERT INTO template VALUES ('1','Default Page','\">\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n\r\n \r\n \">\r\n \r\n \r\n \r\n\r\n\r\n \r\n
_div\" class=\"dragable\"> \r\n \r\n\r\n
\r\n\r\n \r\n
\r\n
\r\n\r\n \r\n
 
\r\n \r\n
\r\n ','page',1,1); - -INSERT INTO template VALUES ('1','File','

\">\" alt=\"\" border=\"0\" />','FileAsset',1,1); -INSERT INTO template VALUES ('2','Image','

\" />','ImageAsset',1,1); - -INSERT INTO template VALUES ('15','File Folder','\">\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n
\">\" border=\"0\" alt=\"\"> \">
\">\" border=\"0\" alt=\"\"> \">^D(\"%z %Z\",);
', 'Folder',1,1); - -alter table HttpProxy add column cookieJarStorageId varchar(22); - -alter table Survey drop column reportcardTemplateId; -alter table Survey add column gradebookTemplateId varchar(22) default 'PBtmpl0000000000000062'; - --- Len Kranendonk 20050112 -- --- Converting the Indexed Search system to Assets. -- -truncate table IndexedSearch_docInfo; -alter table IndexedSearch_docInfo drop pageId; -alter table IndexedSearch_docInfo drop languageId; -alter table IndexedSearch_docInfo change wobjectId assetId varchar(22); -alter table IndexedSearch_docInfo drop page_groupIdView; -alter table IndexedSearch_docInfo change wobject_special_groupIdView special_groupIdView varchar(22); -alter table IndexedSearch_docInfo change wobject_groupIdView groupIdView varchar(22); -update USS set sortBy='lineage' where sortBy='sequenceNumber'; -delete from settings where name='trackPageStatistics'; -drop table pageStatistics; -delete from settings where name='snippetPreviewLength'; -delete from incrementer where incrementerId in ('collateralFolderId','themeId','themeComponentId'); - -create table Collaboration ( - assetId varchar(22) not null primary key, - postGroupId varchar(22) not null default '2', - moderateGroupId varchar(22) not null default '4', - moderatePosts int not null default 0, - karmaPerPost int not null default 0, - collaborationTemplateId varchar(22) not null, - threadTemplateId varchar(22) not null, - postFormTemplateId varchar(22) not null, - searchTemplateId varchar(22) not null, - notificationTemplateId varchar(22) not null, - sortBy varchar(35) not null default 'dateUpdated', - sortOrder varchar(4) not null default 'desc', - usePreview int not null default 1, - addEditStampToPosts int not null default 0, - editTimeout int not null default 3600, - attachmentsPerPost int not null default 0, - allowRichEdit int not null default 1, - filterCode varchar(30) not null default 'javascript', - useContentFilter int not null default 1, - threads int not null default 0, - views int not null default 0, - replies int not null default 0, - rating int not null default 0, - lastPostId varchar(22), - lastPostDate bigint, - archiveAfter int not null default 31536000, - postsPerPage int not null default 10, - threadsPerPage int not null default 30, - subscriptionGroupId varchar(22), - allowReplies int not null default 0 -); - -create table Thread ( - assetId varchar(22) not null primary key, - replies int not null default 0, - lastPostId varchar(22) not null default 0, - lastPostDate bigint, - isLocked int not null default 0, - isSticky int not null default 0, - subscriptionGroupId varchar(22) -); - -create table Post ( - assetId varchar(22) not null primary key, - threadId varchar(22) not null, - dateSubmitted bigint, - dateUpdated bigint, - username varchar(30), - content mediumtext, - status varchar(30) not null default 'approved', - views int not null default 0, - contentType varchar(35) not null default 'mixed', - userDefined1 text, - userDefined2 text, - userDefined3 text, - userDefined4 text, - userDefined5 text, - storageId varchar(22), - rating int not null default 0 -); - -create table Post_rating ( - assetId varchar(22) not null, - userId varchar(22) not null, - ipAddress varchar(15) not null, - dateOfRating bigint, - rating int not null default 0 -); - -create table Post_read ( - postId varchar(22) not null, - threadId varchar(22) not null, - userId varchar(22) not null, - readDate bigint -); - -delete from template where namespace='Forum/PostPreview'; -insert into settings values ("richEditCss","^/;site.css"); -delete from settings where name in ('sharedTrash','sharedClipboard'); - -alter table IndexedSearch add linkURL text; - -update template set template='\">\r\n\r\n

\r\n
\r\n \r\n

\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n

\r\n
\r\n \r\n \">\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \' name=\"query\">\r\n
\r\n\r\n \r\n \r\n \r\n \"\r\n \r\n \r\n \r\n checked=\"1\"\r\n \r\n \r\n checked=\"1\"\r\n \r\n \r\n checked=\"1\"\r\n \r\n >\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n

\r\n\r\n

Results - of about \r\n containing \"\". Search took seconds.

\r\n
    \">\r\n \r\n
  1. \r\n \">\r\n No Title\r\n
    \r\n \r\n
    \r\n
    \r\n Location: \r\n
    \r\n
    \r\n
    \r\n
  2. \r\n
    \r\n
\r\n
\r\n\r\n\r\n\r\n
\r\n · · \r\n
\r\n
\r\n' where namespace='IndexedSearch' and templateId='1'; - -delete from template where templateId='2' and namespace='IndexedSearch'; -delete from template where templateId='3' and namespace='IndexedSearch'; -update page set parentId='_noparent_' where pageId='0'; diff --git a/docs/upgrades/upgrade_6.2.2-6.2.3.sql b/docs/upgrades/upgrade_6.2.2-6.2.3.sql deleted file mode 100644 index 1e5c93566..000000000 --- a/docs/upgrades/upgrade_6.2.2-6.2.3.sql +++ /dev/null @@ -1,7 +0,0 @@ -insert into webguiVersion values ('6.2.3','upgrade',unix_timestamp()); -update collateralFolder set parentId='-1' where collateralFolderId='0'; - -delete from template where namespace='Navigation' and templateId='6'; - -INSERT INTO template VALUES ('6','dtree','^StyleSheet(\"/Navigation/dtree/dtree.css\");\r\n^JavaScript(\"/Navigation/dtree/dtree.js\");\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n
','Navigation',1,1); - diff --git a/docs/upgrades/upgrade_6.2.3-6.2.4.sql b/docs/upgrades/upgrade_6.2.3-6.2.4.sql deleted file mode 100644 index 074be6b97..000000000 --- a/docs/upgrades/upgrade_6.2.3-6.2.4.sql +++ /dev/null @@ -1,3 +0,0 @@ -insert into webguiVersion values ('6.2.4','upgrade',unix_timestamp()); - - diff --git a/docs/upgrades/upgrade_6.2.4-6.2.5.sql b/docs/upgrades/upgrade_6.2.4-6.2.5.sql deleted file mode 100644 index 6dbc36de6..000000000 --- a/docs/upgrades/upgrade_6.2.4-6.2.5.sql +++ /dev/null @@ -1,6 +0,0 @@ -insert into webguiVersion values ('6.2.5','upgrade',unix_timestamp()); - -update template set template='^JavaScript(\"/textFix.js\");\r\n \r\n\r\n^RawHeadTags(\r\n \r\n\r\n \r\n\r\n \r\n);\r\n\r\n \r\n\r\n \r\n\r\n ' where templateId=6 and namespace='richEditor'; - -update page set parentId='0' where parentId is null; -update page set parentId='0' where parentId=''; diff --git a/docs/upgrades/upgrade_6.2.5-6.2.6.sql b/docs/upgrades/upgrade_6.2.5-6.2.6.sql deleted file mode 100644 index 74f78eb52..000000000 --- a/docs/upgrades/upgrade_6.2.5-6.2.6.sql +++ /dev/null @@ -1,4 +0,0 @@ -insert into webguiVersion values ('6.2.6','upgrade',unix_timestamp()); -update collateralFolder set parentId='0' where parentId='-1' and collateralFolderId<>'0'; -alter table WSClient change call callMethod text; - diff --git a/docs/upgrades/upgrade_6.2.6-6.2.7.sql b/docs/upgrades/upgrade_6.2.6-6.2.7.sql deleted file mode 100644 index 0581ffd2c..000000000 --- a/docs/upgrades/upgrade_6.2.6-6.2.7.sql +++ /dev/null @@ -1,3 +0,0 @@ -insert into webguiVersion values ('6.2.7','upgrade',unix_timestamp()); - - diff --git a/docs/upgrades/upgrade_6.2.7-6.2.8.sql b/docs/upgrades/upgrade_6.2.7-6.2.8.sql deleted file mode 100644 index 23aa6188c..000000000 --- a/docs/upgrades/upgrade_6.2.7-6.2.8.sql +++ /dev/null @@ -1,12 +0,0 @@ -insert into webguiVersion values ('6.2.8','upgrade',unix_timestamp()); -delete from template where templateId='7' and namespace='Navigation'; -INSERT INTO template VALUES ('7','Cool Menus','\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n^JavaScript(\"/coolmenus/coolmenus4.js\");\r\n','Navigation',1,1); -alter table SiteMap change startAtThisLevel startAtThisLevel varchar(22); -delete from template where templateId in (1,2) and namespace='Macro/L_loginBox'; -INSERT INTO template VALUES ('1','Default Login Box','
\r\n\r\n \r\n
\r\n \r\n

\r\n \r\n
\r\n \r\n \r\n \r\n

\">

\r\n
\r\n\r\n \r\n \">.\r\n \">\r\n \r\n \r\n \r\n
\r\n
\r\n','Macro/L_loginBox',1,1); -INSERT INTO template VALUES ('2','Horizontal Login Box','
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \">\r\n \r\n\r\n \r\n \">.\r\n \">
\r\n \r\n \r\n
\r\n
\r\n
\r\n','Macro/L_loginBox',1,1); -alter table themeComponent change themeComponentId themeComponentId varchar(22); -alter table forumPost add index status_forumThreadId (status,forumThreadId); -alter table forumThread add index forumId_lastPostDate (forumId,lastPostDate); -alter table forumThread add index status_forumThreadId (status,forumThreadId); - diff --git a/docs/upgrades/upgrade_6.2.8-6.2.9.sql b/docs/upgrades/upgrade_6.2.8-6.2.9.sql deleted file mode 100644 index 3f1f95780..000000000 --- a/docs/upgrades/upgrade_6.2.8-6.2.9.sql +++ /dev/null @@ -1,5 +0,0 @@ -insert into webguiVersion values ('6.2.9','upgrade',unix_timestamp()); -delete from template where templateId='7' and namespace='Navigation'; -INSERT INTO template VALUES ('7','Cool Menus','\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n^JavaScript(\"/coolmenus/coolmenus4.js\");\r\n','Navigation',1,1); -update collateral set collateralFolderId='0' where collateralFolderId is null; - diff --git a/docs/upgrades/upgrade_6.2.9-6.2.10.sql b/docs/upgrades/upgrade_6.2.9-6.2.10.sql deleted file mode 100644 index 7118bba45..000000000 --- a/docs/upgrades/upgrade_6.2.9-6.2.10.sql +++ /dev/null @@ -1,8 +0,0 @@ -insert into webguiVersion values ('6.2.10','upgrade',unix_timestamp()); -update page set isSystem=1, parentId='0' where pageId='1'; -delete from template where templateId='1' and namespace='USS/Submission'; -INSERT INTO template VALUES ('1','Default Submission','

\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\">
\n\n
\n\n \" border=\"0\">

\n\n

\n
\n\n

\n\n','USS/Submission',1,1); -delete from template where templateId='1' and namespace='Forum/Thread'; -INSERT INTO template VALUES ('1','Default Thread','

\r\n\r\n\r\n
\r\n
\r\n\r\n \r\n \">\r\n \r\n
style=\"border: 4px dotted #aaaaaa; padding: 5px;\">\r\n \r\n
style=\"border: 4px dotted #aaaaaa; padding: 5px;\">\r\n \r\n \r\n
\r\n \r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
         \r\n \">\r\n \r\n
style=\"border: 4px dotted #aaaaaa; padding: 5px;\">\r\n \r\n
style=\"border: 4px dotted #aaaaaa; padding: 5px;\">\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
   \">\"> @
\r\n
\r\n\r\n

\r\n\"> •\r\n\"> •\r\n\"> \r\n\r\n • \">\r\n \r\n •\r\n \r\n \">\r\n \r\n \">\r\n \r\n •\r\n \r\n \">\r\n \r\n \">\r\n \r\n \r\n\r\n\r\n •\r\n \r\n \">\r\n \r\n \">\r\n \r\n\r\n\r\n\r\n

\r\n · · \r\n
\r\n\r\n\r\n
\r\n\">-=: :=-\r\n
','Forum/Thread',1,1); - - diff --git a/docs/upgrades/upgrade_6.3.0-6.4.0.pl b/docs/upgrades/upgrade_6.3.0-6.4.0.pl deleted file mode 100644 index 1c20e22e8..000000000 --- a/docs/upgrades/upgrade_6.3.0-6.4.0.pl +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/perl - -use lib "../../lib"; -use FileHandle; -use File::Path; -use File::Copy; -use Getopt::Long; -use strict; -use WebGUI::Group; -use WebGUI::HTML; -use WebGUI::Id; -use WebGUI::Session; -use WebGUI::SQL; -use WebGUI::URL; - - -my $configFile; -my $quiet; - -GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet -); - -WebGUI::Session::open("../..",$configFile); - -print "\tReplacing session.page template variables with the ^Page macro.\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select assetId,template from template"); -while (my ($id, $template) = $sth->array) { - $template =~ s/\/^Page($1);/xsig; - WebGUI::SQL->setRow("template","assetId",{ - assetId=>$id, - template=>$template - }); -} -$sth->finish; - -WebGUI::Session::close(); - - diff --git a/docs/upgrades/upgrade_6.3.0-6.4.0.sql b/docs/upgrades/upgrade_6.3.0-6.4.0.sql deleted file mode 100644 index 34b3e814f..000000000 --- a/docs/upgrades/upgrade_6.3.0-6.4.0.sql +++ /dev/null @@ -1,16 +0,0 @@ -insert into webguiVersion values ('6.4.0','upgrade',unix_timestamp()); -alter table asset add index state_parentId_lineage (state,parentId,lineage); -insert into settings (name, value) values ('webguiValidateEmail', '0'); -insert into settings (name, value) values ('webguiUseCaptcha', '1'); -delete from template where assetId='PBtmpl0000000000000011'; -INSERT INTO template VALUES ('

\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n\r\n\r\n\r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n\r\n\r\n \r\n \r\n\r\n\r\n\r\n \r\n \r\n\r\n
\r\n\r\n\r\n
\r\n
    \r\n
  • \">
  • \r\n \r\n
  • \">
  • \r\n
    \r\n
\r\n
','Auth/WebGUI/Create',1,1,'PBtmpl0000000000000011'); -insert into settings (name, value) values ('webguiAccountTemplate', 'PBtmpl0000000000000010'); -insert into settings (name, value) values ('webguiCreateAccountTemplate', 'PBtmpl0000000000000011'); -insert into settings (name, value) values ('webguiExpiredPasswordTemplate', 'PBtmpl0000000000000012'); -insert into settings (name, value) values ('webguiLoginTemplate', 'PBtmpl0000000000000013'); -insert into settings (name, value) values ('webguiPasswordRecoveryTemplate', 'PBtmpl0000000000000014'); -insert into settings (name, value) values ('ldapAccountTemplate', 'PBtmpl0000000000000004'); -insert into settings (name, value) values ('ldapCreateAccountTemplate', 'PBtmpl0000000000000005'); -insert into settings (name, value) values ('ldapLoginTemplate', 'PBtmpl0000000000000006'); - - diff --git a/docs/upgrades/upgrade_6.4.0-6.5.0.pl b/docs/upgrades/upgrade_6.4.0-6.5.0.pl deleted file mode 100644 index b878316c3..000000000 --- a/docs/upgrades/upgrade_6.4.0-6.5.0.pl +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/perl - -use lib "../../lib"; -use FileHandle; -use File::Path; -use File::Copy; -use Getopt::Long; -use strict; -use WebGUI::Group; -use WebGUI::HTML; -use WebGUI::Id; -use WebGUI::Session; -use WebGUI::SQL; -use WebGUI::URL; - - -my $configFile; -my $quiet; - -GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet -); - -WebGUI::Session::open("../..",$configFile); - -#-------------------------------------------- -print "\tUpdating config file.\n" unless ($quiet); -my $pathToConfig = '../../etc/'.$configFile; -my $conf = Parse::PlainConfig->new('DELIM' => '=', 'FILE' => $pathToConfig); -my $macros = $conf->get("macros"); -$macros->{"International"} = "International"; -$conf->set("macros"=>$macros); -$conf->write; - - - - -WebGUI::Session::close(); - - diff --git a/docs/upgrades/upgrade_6.4.0-6.5.0.sql b/docs/upgrades/upgrade_6.4.0-6.5.0.sql deleted file mode 100644 index fd3098849..000000000 --- a/docs/upgrades/upgrade_6.4.0-6.5.0.sql +++ /dev/null @@ -1,4 +0,0 @@ -insert into webguiVersion values ('6.5.0','upgrade',unix_timestamp()); -alter table asset add column isPrototype int not null default 0; -alter table asset add index isPrototype_className_assetId (isPrototype,className,assetId); -update Folder set templateId='PBtmpl0000000000000078' where templateId=''; diff --git a/docs/upgrades/upgrade_6.5.0-6.5.1.sql b/docs/upgrades/upgrade_6.5.0-6.5.1.sql deleted file mode 100644 index b03d22409..000000000 --- a/docs/upgrades/upgrade_6.5.0-6.5.1.sql +++ /dev/null @@ -1,6 +0,0 @@ -insert into webguiVersion values ('6.5.1','upgrade',unix_timestamp()); -alter table Collaboration add column displayLastReply int not null default 0; -update Collaboration set displayLastReply=1 where CollaborationTemplateId='PBtmpl0000000000000026'; -update template set template='\"> \r\n \r\n

\r\n
\r\n\r\n

\r\n\r\n \">\r\n \r\n • \r\n \r\n \">\r\n \r\n \">\r\n \r\n \r\n •\r\n\r\n\">\r\n

\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n
\">\">\">\">\">
\">\"> @ \r\n \">\r\n by \r\n \r\n \r\n \r\n \">\r\n \r\n on @ \r\n
\r\n\r\n\r\n
\r\n · · \r\n
\r\n
\r\n\r\n\r\n' where assetId='PBtmpl0000000000000026'; - - diff --git a/docs/upgrades/upgrade_6.5.1-6.5.2.pl b/docs/upgrades/upgrade_6.5.1-6.5.2.pl deleted file mode 100644 index ffefa7cdf..000000000 --- a/docs/upgrades/upgrade_6.5.1-6.5.2.pl +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/perl - -use lib "../../lib"; -use Getopt::Long; -use strict; -use WebGUI::Session; -use WebGUI::Asset; - -my $configFile; -my $quiet; - -GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet -); - -WebGUI::Session::open("../..",$configFile); - -#-------------------------------------------- -print "\tAdding data form template\n" unless ($quiet); -my $template = < - -

-
- -

-
- - -
    - -
  • - -
-
- - -

- - - - - - - - -

- - - - - - - - - - - -
- - - - - - - - - - - - - * - -
- -
-
-
- - -STOP -my $importNode = WebGUI::Asset->getImportNode; -$importNode->addChild({ - className=>"WebGUI::Asset::Template", - template=>$template, - namespace=>"DataForm", - title=>'Default DataForm', - menuTitle=>'Default DataForm', - ownerUserId=>'3', - groupIdView=>'7', - groupIdEdit=>'4', - isHidden=>1 - }, 'PBtmpl0000000000000141' -); - - - -WebGUI::Session::close(); - - diff --git a/docs/upgrades/upgrade_6.5.1-6.5.2.sql b/docs/upgrades/upgrade_6.5.1-6.5.2.sql deleted file mode 100644 index 520373181..000000000 --- a/docs/upgrades/upgrade_6.5.1-6.5.2.sql +++ /dev/null @@ -1,4 +0,0 @@ -insert into webguiVersion values ('6.5.2','upgrade',unix_timestamp()); -update template set template = '\">

\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n

\r\n\r\n

' where assetId='PBtmpl0000000000000029'; -update asset set endDate=32472169200 where endDate=9223372036854775807; -alter table asset change endDate endDate bigint(20) not null default 32472169200; diff --git a/docs/upgrades/upgrade_6.5.2-6.5.3.pl b/docs/upgrades/upgrade_6.5.2-6.5.3.pl deleted file mode 100644 index 9f34f68ae..000000000 --- a/docs/upgrades/upgrade_6.5.2-6.5.3.pl +++ /dev/null @@ -1,169 +0,0 @@ -#!/usr/bin/perl - -use lib "../../lib"; -use Getopt::Long; -use strict; -use WebGUI::Session; -use WebGUI::SQL; -use WebGUI::Asset; -use WebGUI::Asset::Wobject::Folder; - -my $configFile; -my $quiet; - -GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet -); - -WebGUI::Session::open("../..",$configFile); - -#-------------------------------------------- -print "\tSorting templates under the Import Node into folders by namespace.\n" unless ($quiet); -my ($templateFolder) = WebGUI::SQL->quickArray("select assetId from asset where parentId='PBasset000000000000002' and className='WebGUI::Asset::Wobject::Folder' and title='Templates' limit 1"); -$templateFolder ||= 'PBasset000000000000002'; -my $namespacesQuery = "select distinct template.namespace from asset, template where asset.assetId=template.assetId and asset.className='WebGUI::Asset::Template' order by template.namespace"; -my $parent = WebGUI::Asset->new($templateFolder); -my $sth = WebGUI::SQL->read($namespacesQuery); -my $folder; -while (my $namespace = $sth->hashRef) { - #create a folder for each namespace - print "\t\tMoving ".$namespace->{namespace}." Templates.\n" unless ($quiet); - my $newUrl = lc('templates/'.$namespace->{namespace}); - $folder = $parent->addChild({ - className=>"WebGUI::Asset::Wobject::Folder", - title=>$namespace->{namespace}, - isHidden=>1, - menuTitle=>$namespace->{namespace}, - url=>$newUrl, - description=>$namespace->{namespace}, - templateId=>'PBtmpl0000000000000078', - styleTemplateId=>'PBtmpl0000000000000060', - printableStyleTemplateId=>'PBtmpl0000000000000111', - groupIdView=>'4', - groupIdEdit=>'3' - }); - my $templatesquery = "select * from asset, template where asset.assetId=template.assetId and asset.className='WebGUI::Asset::Template' and template.namespace='".$namespace->{namespace}."' order by title asc"; - my $newParentId = $folder->getId; - my $sth2 = WebGUI::SQL->read($templatesquery); - my $first = 1; - while (my $template = $sth2->hashRef) { - print "\t\t\tMoving ".$template->{title}." to Templates/".$namespace->{namespace}."\n" unless ($quiet); - my $newLineage = getNextLineage($newParentId); - my $templateAssetId = $template->{assetId}; - my $templateObject = WebGUI::Asset->new($templateAssetId); - my $newUrl2 = $newUrl.$templateObject->getUrl; - my $result = WebGUI::SQL->write("update asset set lineage='$newLineage', parentId='$newParentId' where assetId='$templateAssetId'"); - } - $sth2->finish; -} -$sth->finish; - -#Lock down permissions on viewing templates. There's no reason "everyone" -#should be allowed to view them if the www_view method returns the parent -#container anyway...! -WebGUI::SQL->write("update asset set groupIdView='4' where className='WebGUI::Asset::Template'"); - -WebGUI::SQL->write("update wobject set styleTemplateId='PBtmpl0000000000000060' where assetId='$templateFolder'"); - -#-------------------------------------------- -print "\tSetting up a new failsafe style\n" unless ($quiet); -my $newFailSafe = ' - - - - ^Page("title"); - WebGUI - - - - - ^AdminBar; -
^PageTitle;
- -
- ^LoginToggle;   ^a(^@;);   ^AdminToggle; -
-
- - - -'; -WebGUI::SQL->write("update template set template=".quote($newFailSafe)." where assetId='PBtmpl0000000000000060'"); - - -#-------------------------------------------- -print "\tMaking templates editable for files and images.\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select assetId,className from asset where className like 'WebGUI::Asset::File%'"); -while (my ($id, $class) = $sth->array) { - my $template; - if ($class =~ /Image/) { - $template = 'PBtmpl0000000000000088'; - } else { - $template = 'PBtmpl0000000000000024'; - } - WebGUI::SQL->write("update FileAsset set templateId=".quote($template)." where assetId=".quote($id)); -} -$sth->finish; - - -WebGUI::Session::close(); - - -sub getNextLineage { - my $assetId = shift; - my ($startLineage) = WebGUI::SQL->quickArray("select lineage from asset where parentId='".$assetId."' order by lineage desc limit 1"); - my $asset=WebGUI::Asset->new($assetId); - my $depth=length($asset->get("lineage")); - unless ($startLineage) { - #return lineage of first unborn child. - my ($parentLineage) = WebGUI::SQL->quickArray("select lineage from asset where assetId='".$assetId."'"); - return $parentLineage.'000001'; - } - #return lineage of next unborn child. - my $rank = substr($startLineage,$depth,6); - my $parentLineage = substr($startLineage,0,$depth); - return $parentLineage.sprintf("%06d",($rank+1)); -} diff --git a/docs/upgrades/upgrade_6.5.2-6.5.3.sql b/docs/upgrades/upgrade_6.5.2-6.5.3.sql deleted file mode 100644 index 3079035dd..000000000 --- a/docs/upgrades/upgrade_6.5.2-6.5.3.sql +++ /dev/null @@ -1,35 +0,0 @@ -insert into webguiVersion values ('6.5.3','upgrade',unix_timestamp()); -update template set template='\">\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· \">\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 \n
\n \n
\n
\n
\n\n\n' where assetId='PBtmpl0000000000000141'; -update template set template='\">\n\n

\n
\n \r\n

\r\n
\r\n\r\n\r\n
    \r\n \r\n
  • \r\n \r\n
\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n\r\n \">\r\n · \">\r\n \r\n · \">\r\n \r\n \r\n · \">\r\n · \">\r\n \r\n

\r\n\r\n\r\n\r\n

\r\n \r\n )\" id=\"tab\" class=\"tab\">\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n *\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n\r\n\r\n' where assetId='PBtmpl0000000000000116'; -update template set template='\r\n\r\n' where assetId='PBtmpl0000000000000027'; -update template set template='\"> \r\n \r\n

\r\n
\r\n\r\n\r\n\r\n \r\n\r\n\r\n
\r\n

\">

\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n
\r\n \">\r\n
\r\n \r\n
\r\n
\r\n
\r\n : \r\n \r\n \r\n \r\n \">\r\n \r\n
\r\n :
\r\n
\r\n
\r\n :
\r\n : \r\n \r\n     [ \">1, \">2, \">3, \">4, \">5 ]\r\n \r\n
\r\n \r\n :     [ \"> | \"> ]
\r\n \r\n \r\n :
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \">[]\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n class=\"currentThread\">\r\n \r\n \r\n \r\n \r\n \r\n \r\n
   \">
\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n \r\n
Current\">\r\n \">\r\n
\r\n \r\n
\r\n
\r\n
\r\n : \r\n \r\n \r\n \r\n \">\r\n \r\n
\r\n :
\r\n
\r\n
\r\n :
\r\n : \r\n \r\n     [ \">1, \">2, \">3, \">4, \">5 ]\r\n \r\n
\r\n \r\n :     [ \"> | \"> ]
\r\n \r\n \r\n :
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \">[]\r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n \r\n
px;\">\r\n
Current\">\r\n \">\r\n
\r\n \r\n
\r\n
\r\n
\r\n : \r\n \r\n \r\n \r\n \">\r\n \r\n
\r\n :
\r\n
\r\n
\r\n :
\r\n : \r\n \r\n     [ \">1, \">2, \">3, \">4, \">5 ]\r\n \r\n
\r\n \r\n :     [ \"> | \"> ]
\r\n \r\n \r\n :
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \">[]\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n\r\n\r\n\r\n
\r\n [ | | ]\r\n
\r\n
\r\n\r\n\r\n
\r\n \r\n \">[] \r\n \r\n \r\n \">[] \r\n \r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n
\r\n\r\n' where assetId='PBtmpl0000000000000032'; -update template set template='\"> \r\n \r\n

\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n
\r\n :     [ \"> | \"> ]
\r\n
\r\n
\r\n\r\n\r\n\r\n Link Description
\r\n

\r\n
\r\n\r\nLink URL
\r\n\">\r\n\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n

\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \">[]\r\n \r\n

\r\n
\r\n\r\n\r\n\r\n\r\n \r\n\r\n
\r\n

\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \">\r\n
\r\n \r\n
\r\n
\r\n
\r\n : \r\n \r\n \r\n \r\n \">\r\n \r\n
\r\n :
\r\n
\r\n
\r\n :
\r\n : \r\n \r\n     [ \">1, \">2, \">3, \">4, \">5 ]\r\n \r\n
\r\n \r\n :     [ \"> | \"> ]
\r\n \r\n \r\n :
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \">[]\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n class=\"currentThread\">\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
   \">
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Current\">\r\n \">\r\n
\r\n \r\n
\r\n
\r\n
\r\n : \r\n \r\n \r\n \r\n \">\r\n \r\n
\r\n :
\r\n
\r\n
\r\n :
\r\n : \r\n \r\n     [ \">1, \">2, \">3, \">4, \">5 ]\r\n \r\n
\r\n \r\n :     [ \"> | \"> ]
\r\n \r\n \r\n :
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \">[]\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
px;\">\r\n
Current\">\r\n \">\r\n
\r\n \r\n
\r\n
\r\n
\r\n : \r\n \r\n \r\n \r\n \">\r\n \r\n
\r\n :
\r\n
\r\n
\r\n :
\r\n : \r\n \r\n     [ \">1, \">2, \">3, \">4, \">5 ]\r\n \r\n
\r\n \r\n :     [ \"> | \"> ]
\r\n \r\n \r\n :
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \">[]\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n [ | | ]\r\n
\r\n
\r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \">[] \r\n \r\n \">[List All Links]\r\n \r\n \">[] \r\n \r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n
\r\n\r\n\r\n\r\n' where assetId='PBtmpl0000000000000113'; -update template set template='\"> \r\n \r\n

\r\n
\r\n\r\n\r\n

\r\n\r\n
\r\n : \r\n \r\n \r\n \r\n \">\r\n \r\n
\r\n :
\r\n :
\r\n : \r\n \r\n     [ \">1, \">2, \">3, \">4, \">5 ]\r\n \r\n
\r\n \r\n :     [ \"> | \"> ]
\r\n \r\n \r\n :
\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n \r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n\r\n\r\n

\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \">[]\r\n \r\n

\r\n
\r\n\r\n\r\n\r\n\r\n \r\n\r\n
\r\n

\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \">\r\n
\r\n \r\n
\r\n
\r\n
\r\n : \r\n \r\n \r\n \r\n \">\r\n \r\n
\r\n :
\r\n
\r\n
\r\n :
\r\n : \r\n \r\n     [ \">1, \">2, \">3, \">4, \">5 ]\r\n \r\n
\r\n \r\n :     [ \"> | \"> ]
\r\n \r\n \r\n :
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \">[]\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n class=\"currentThread\">\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
   \">
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Current\">\r\n \">\r\n
\r\n \r\n
\r\n
\r\n
\r\n : \r\n \r\n \r\n \r\n \">\r\n \r\n
\r\n :
\r\n
\r\n
\r\n :
\r\n : \r\n \r\n     [ \">1, \">2, \">3, \">4, \">5 ]\r\n \r\n
\r\n \r\n :     [ \"> | \"> ]
\r\n \r\n \r\n :
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \">[]\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
px;\">\r\n
Current\">\r\n \">\r\n
\r\n \r\n
\r\n
\r\n
\r\n : \r\n \r\n \r\n \r\n \">\r\n \r\n
\r\n :
\r\n
\r\n
\r\n :
\r\n : \r\n \r\n     [ \">1, \">2, \">3, \">4, \">5 ]\r\n \r\n
\r\n \r\n :     [ \"> | \"> ]
\r\n \r\n \r\n :
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \">[]\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n\r\n \r\n \r\n \r\n \r\n
\r\n [ | | ]\r\n
\r\n
\r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \">[] \r\n \r\n \">[]\r\n \r\n \">[] \r\n \r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n
\r\n\r\n' where assetId='PBtmpl0000000000000067'; -update template set template='\"> \r\n \r\n

\r\n
\r\n\r\n

\r\n\r\n\r\n\r\n
\r\n :     [ \"> | \"> ]
\r\n
\r\n
\r\n\r\n\r\n\r\n Job Description
\r\n

\r\n
\r\n\r\n\r\n Job Requirements
\r\n

\r\n
\r\n\r\n\r\n\r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n
Date Posted
Location
Compensation
Views
\r\n\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n

\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \">[]\r\n \r\n

\r\n
\r\n\r\n\r\n\r\n\r\n \r\n\r\n
\r\n

\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \">\r\n
\r\n \r\n
\r\n
\r\n
\r\n : \r\n \r\n \r\n \r\n \">\r\n \r\n
\r\n :
\r\n
\r\n
\r\n :
\r\n : \r\n \r\n     [ \">1, \">2, \">3, \">4, \">5 ]\r\n \r\n
\r\n \r\n :     [ \"> | \"> ]
\r\n \r\n \r\n :
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \">[]\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n class=\"currentThread\">\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
   \">
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Current\">\r\n \">\r\n
\r\n \r\n
\r\n
\r\n
\r\n : \r\n \r\n \r\n \r\n \">\r\n \r\n
\r\n :
\r\n
\r\n
\r\n :
\r\n : \r\n \r\n     [ \">1, \">2, \">3, \">4, \">5 ]\r\n \r\n
\r\n \r\n :     [ \"> | \"> ]
\r\n \r\n \r\n :
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \">[]\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
px;\">\r\n
Current\">\r\n \">\r\n
\r\n \r\n
\r\n
\r\n
\r\n : \r\n \r\n \r\n \r\n \">\r\n \r\n
\r\n :
\r\n
\r\n
\r\n :
\r\n : \r\n \r\n     [ \">1, \">2, \">3, \">4, \">5 ]\r\n \r\n
\r\n \r\n :     [ \"> | \"> ]
\r\n \r\n \r\n :
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \">[]\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n [ | | ]\r\n
\r\n
\r\n \r\n \r\n
\r\n\r\n\r\n
\r\n \r\n \">[] \r\n \r\n \">[]\r\n \r\n \">[] \r\n \r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n
\r\n\r\n' where assetId='PBtmpl0000000000000098'; -update template set template='\"> \r\n\r\n

\r\n

\r\n\r\n\r\n

\r\n\r\n

\r\n
\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n\r\n\r\n

\r\n \r\n
\r\n' where assetId='PBtmpl0000000000000099'; -update template set template='\"> \r\n\r\n

\r\n

\r\n

\r\n

\r\n

\r\n\r\n\r\n

\r\n\r\n

\r\n
\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n\r\n\r\n

\r\n \r\n

\r\n

\r\n

\r\n
\r\n' where assetId='PBtmpl0000000000000122'; -update template set template='\"> \r\n\r\n

\r\n

\r\n

\r\n\r\n\r\n

\r\n\r\n

\r\n
\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n\r\n\r\n

\r\n \r\n
\r\n' where assetId='PBtmpl0000000000000068'; -update template set template='\"> \r\n\r\n

\r\n

\r\n\r\n

\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n\r\n\r\n

\r\n \r\n
\r\n' where assetId='PBtmpl0000000000000029'; -update template set template='\"> \r\n\r\n

\r\n

\r\n

\" target=\"_blank\">

\r\n\r\n\r\n

\r\n\r\n

\r\n
\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n\r\n\r\n

\r\n \r\n

\" target=\"_blank\">

\r\n
\r\n' where assetId='PBtmpl0000000000000114'; -update Collaboration set collaborationTemplateId='PBtmpl0000000000000083' where collaborationTemplateId='PBtmpl0000000000000102'; -delete from asset where assetId='PBtmpl0000000000000102'; -delete from template where assetId='PBtmpl0000000000000102'; -update template set template='\"> \r\n \r\n

\r\n
\r\n\r\n\r\n\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n

\r\n \r\n \">\r\n •\r\n \r\n \r\n \r\n \">\r\n \r\n \">\r\n \r\n •\r\n \r\n \">\r\n

\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n
oddThreadevenThread\">oddThreadevenThread\">\"> ()oddThreadevenThread\">oddThreadevenThread\">oddThreadevenThread\">
\r\n\r\n\r\n
\r\n · · \r\n
\r\n
\r\n\r\n\r\n' where assetId='PBtmpl0000000000000077'; -update template set template='\"> \r\n \r\n \r\n\r\n\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n

\r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n

\r\n\r\n\r\n\r\n\r\n
\r\n\r\n

\r\n\r\n\r\n\r\n\r\n

\r\n · · \r\n
\r\n
\r\n\r\n\r\n' where assetId='PBtmpl0000000000000133'; -update template set template='\"> \r\n \r\n \r\n\r\n\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n

\r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n

\r\n\r\n\r\n\r\n
    \r\n \r\n
  • \">\r\n \r\n
\r\n\r\n\r\n\r\n\r\n \r\n \r\n
[\">]
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n [\">]\r\n \r\n \r\n \r\n (\">)\r\n
\r\n
\r\n \">
\r\n \r\n

[top]

\r\n
\r\n\r\n\r\n\r\n
\r\n · · \r\n
\r\n
\r\n\r\n\r\n' where assetId='PBtmpl0000000000000080'; -update template set template='\"> \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n

\r\n \r\n \">\r\n •\r\n \r\n \r\n \r\n \">\r\n \r\n \">\r\n \r\n •\r\n \r\n \">\r\n

\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n
\">\">\">
oddThreadevenThread\">oddThreadevenThread\">\"> ()oddThreadevenThread\">oddThreadevenThread\">oddThreadevenThread\">\">
\r\n\r\n\r\n
\r\n · · \r\n
\r\n
\r\n\r\n\r\n' where assetId='PBtmpl0000000000000066'; -update template set template='\"> \r\n \r\n

\r\n
\r\n\r\n\r\n\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n

\r\n \r\n \">\r\n •\r\n \r\n \r\n \r\n \">\r\n \r\n \">\r\n \r\n •\r\n \r\n \">\r\n

\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n
\">\">\">\">\">
oddThreadevenThread\">oddThreadevenThread\">\">oddThreadevenThread\">oddThreadevenThread\">\">oddThreadevenThread\" align=\"center\">oddThreadevenThread\" align=\"center\">oddThreadevenThread\" align=\"center\">oddThreadevenThread\"> @ oddThreadevenThread\" style=\"font-size: 11px;\">\r\n \">\r\n by \r\n \r\n \r\n \r\n \">\r\n \r\n on @ \r\n
\r\n\r\n\r\n
\r\n · · \r\n
\r\n
\r\n\r\n\r\n' where assetId='PBtmpl0000000000000026'; -update template set template='\"> \r\n \r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n\r\n

\r\n \r\n \">\r\n •\r\n \r\n \r\n \r\n \">\r\n \r\n \">\r\n \r\n •\r\n \r\n \">\r\n

\r\n\r\n\r\n\r\n
\r\n\r\n\r\n
\r\n
\r\n \">
\r\n ()\r\n \r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n\r\n\r\n\r\n
\r\n · · \r\n
\r\n
\r\n\r\n' where assetId='PBtmpl0000000000000128'; -update template set template='\"> \r\n \r\n \r\n\r\n\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n

\r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n

\r\n\r\n\r\n\r\n \r\n \r\n
[\">]
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n [\">]\r\n \r\n \r\n \r\n (\">)\r\n
\r\n
\r\n

\r\n \" target=\"_blank\">\r\n \r\n - \r\n \r\n

\r\n
\r\n\r\n\r\n\r\n
\r\n · · \r\n
\r\n
\r\n\r\n\r\n' where assetId='PBtmpl0000000000000083'; -update template set template='\"> \r\n \r\n \r\n\r\n\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n

\r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n

\r\n\r\n
    \r\n \r\n
  1. \r\n \r\n \r\n [\">]\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n [\">]\r\n \r\n \r\n \r\n (\">)\r\n \r\n \" target=\"_blank\">\r\n \r\n - \r\n \r\n
  2. \r\n
    \r\n
\r\n\r\n\r\n\r\n\r\n
\r\n · · \r\n
\r\n
\r\n\r\n\r\n' where assetId='PBtmpl0000000000000101'; -update template set template='\"> \r\n \r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n\r\n

\r\n \r\n \">\r\n •\r\n \r\n \r\n \r\n \">\r\n \r\n \">\r\n \r\n •\r\n \r\n \">\r\n

\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n
\r\n
\r\n
()
\r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n\r\n\r\n\r\n
\r\n · · \r\n
\r\n
\r\n' where assetId='PBtmpl0000000000000121'; -update template set template='\"> \r\n \r\n \r\n\r\n\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n

\r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n

\r\n\r\n\r\n\r\n \r\n \r\n
[\">]
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n [\">]\r\n \r\n \r\n \r\n (\">)\r\n
\r\n
\r\n Q:
\r\n A: \r\n

\r\n\r\n\r\n\r\n\r\n

\r\n · · \r\n
\r\n
\r\n\r\n\r\n' where assetId='PBtmpl0000000000000081'; -update template set template='\"> \r\n \r\n \r\n\r\n\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n

\r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n

\r\n\r\n\r\n\r\n \r\n \r\n
[\">]
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n [\">]\r\n \r\n \r\n \r\n (\">)\r\n
\r\n
\r\n

\r\n \r\n

\r\n\r\n\r\n\r\n\r\n

\r\n · · \r\n
\r\n\r\n\r\n\r\n' where assetId='PBtmpl0000000000000079'; -update template set template='\"> \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n

\r\n \r\n \">\r\n •\r\n \r\n \r\n \r\n \">\r\n \r\n \">\r\n \r\n •\r\n \r\n \">\r\n

\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n
\">\">\">
oddThreadevenThread\">oddThreadevenThread\">\"> ()oddThreadevenThread\" style=\"text-align: center;\">\r\n \r\n \">\" border=\"0\" alt=\"\" />\r\n \r\n  \r\n \r\n oddThreadevenThread\">oddThreadevenThread\">oddThreadevenThread\">\">
\r\n\r\n\r\n\r\n
\r\n · · \r\n
\r\n
\r\n' where assetId='PBtmpl0000000000000097'; -update template set template='\"> \r\n \r\n \r\n\r\n\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n

\r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n \">[]\r\n \r\n \r\n \r\n \">[]\r\n \r\n

\r\n\r\n
    \r\n \r\n
  • \r\n \r\n \r\n [\">]\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n [\">]\r\n \r\n \r\n \r\n (\">)\r\n \r\n \" target=\"_blank\">\r\n \r\n - \r\n \r\n
  • \r\n
    \r\n
\r\n\r\n\r\n\r\n\r\n
\r\n · · \r\n
\r\n
\r\n\r\n\r\n' where assetId='PBtmpl0000000000000082'; -update template set template='\"> \r\n \r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n\r\n

\r\n \r\n \">\r\n •\r\n \r\n \r\n \r\n \">\r\n \r\n \">\r\n \r\n •\r\n \r\n \">\r\n

\r\n\r\n\r\n\r\n

\r\n\r\n\r\n

\r\n \r\n
\r\n
\r\n \r\n \"> \r\n - \r\n \r\n \r\n - \r\n \r\n \r\n - \r\n \r\n \r\n - \r\n \r\n \r\n \r\n \r\n \">\" border=\"0\" alt=\"\" align=\"right\" />\r\n \r\n \r\n
\r\n \">\r\n
\r\n
\r\n

\r\n \r\n\r\n \r\n\r\n\r\n

\r\n · · \r\n
\r\n\r\n\r\n ' where assetId='PBtmpl0000000000000112'; -alter table FileAsset add column templateId varchar(22) not null; -alter table snippet add column processAsTemplate int not null default 0; -update Collaboration set sortBy='dateUpdated' where sortBy=''; -update Collaboration set sortOrder='desc' where sortOrder=''; - diff --git a/docs/upgrades/upgrade_6.5.3-6.5.4.sql b/docs/upgrades/upgrade_6.5.3-6.5.4.sql deleted file mode 100644 index c8c947fe8..000000000 --- a/docs/upgrades/upgrade_6.5.3-6.5.4.sql +++ /dev/null @@ -1,4 +0,0 @@ -insert into webguiVersion values ('6.5.4','upgrade',unix_timestamp()); -update template set template='\">\r\n

\r\n
\r\n\r\n\r\n

\r\n
\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n
\r\n \">\" border=\"0\" alt=\"\"> \">\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \">\" border=\"0\" alt=\"\"> \">\r\n \r\n \r\n \r\n ^D(\"%z %Z\",);\r\n \r\n \r\n
' where assetId='PBtmpl0000000000000078'; -update template set template='\r\n\r\n \r\n ^Page(\"title\"); - WebGUI\r\n \r\n \r\n \r\n \r\n ^AdminBar;\r\n
\r\n ^AssetProxy(flexmenu);\r\n
\r\n
\r\n \r\n


\r\n ^LoginToggle; \r\n   ^a(^@;); \r\n   ^H;\r\n   ^AdminToggle;\r\n
\r\n\r\n\r\n' where assetId='PBtmpl0000000000000060'; - diff --git a/docs/upgrades/upgrade_6.5.4-6.5.5.pl b/docs/upgrades/upgrade_6.5.4-6.5.5.pl deleted file mode 100644 index c267e3b7c..000000000 --- a/docs/upgrades/upgrade_6.5.4-6.5.5.pl +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/perl - -use lib "../../lib"; -use File::Path; -use Getopt::Long; -use strict; -use WebGUI::Session; -use WebGUI::SQL; - -my $configFile; -my $quiet; - -GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet -); - -WebGUI::Session::open("../..",$configFile); - -#-------------------------------------------- -print "\tPartitioning limbo\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select lineage from asset where state='trash'"); -while (my ($lineage) = $sth->array) { - WebGUI::SQL->write("update asset set state='trash-limbo' where lineage like ".quote($lineage.'%')." and state='limbo'"); -} -$sth->finish; -WebGUI::SQL->write("update asset set state='clipboard-limbo' where state='limbo'"); - - -#-------------------------------------------- -print "\tRemoving old files\n" unless ($quiet); -# should have been removed in the 6.2-6.3 upgrade -unlink("../../sbin/Hourly/EmptyTrash.pm"); -unlink("../../lib/WebGUI/Wobject/IndexedSearch.pm"); -rmtree("../../lib/WebGUI/Wobject/IndexedSearch"); -unlink("../../lib/WebGUI/Wobject/Product.pm"); -unlink("../../lib/WebGUI/Wobject/SyndicatedContent.pm"); -unlink("../../lib/WebGUI/Wobject/Survey.pm"); - -WebGUI::Session::close(); - - diff --git a/docs/upgrades/upgrade_6.5.4-6.5.5.sql b/docs/upgrades/upgrade_6.5.4-6.5.5.sql deleted file mode 100644 index d20f2f633..000000000 --- a/docs/upgrades/upgrade_6.5.4-6.5.5.sql +++ /dev/null @@ -1,2 +0,0 @@ -insert into webguiVersion values ('6.5.5','upgrade',unix_timestamp()); - diff --git a/docs/upgrades/upgrade_6.5.5-6.5.6.sql b/docs/upgrades/upgrade_6.5.5-6.5.6.sql deleted file mode 100644 index a5f69b237..000000000 --- a/docs/upgrades/upgrade_6.5.5-6.5.6.sql +++ /dev/null @@ -1,4 +0,0 @@ -insert into webguiVersion values ('6.5.6','upgrade',unix_timestamp()); -alter table metaData_values drop primary key; -alter table metaData_values add primary key (fieldId,assetId); - diff --git a/docs/upgrades/upgrade_6.5.6-6.6.0.pl b/docs/upgrades/upgrade_6.5.6-6.6.0.pl deleted file mode 100644 index feb44f212..000000000 --- a/docs/upgrades/upgrade_6.5.6-6.6.0.pl +++ /dev/null @@ -1,286 +0,0 @@ -#!/usr/bin/perl - -use lib "../../lib"; -use File::Path; -use Getopt::Long; -use strict; -use WebGUI::Asset; -use WebGUI::Asset::Template; -use WebGUI::Session; -use WebGUI::SQL; - -my $configFile; -my $quiet; - -GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet -); - -WebGUI::Session::open("../..",$configFile); - -#-------------------------------------------- -print "\tDeleting old templates\n" unless ($quiet); -my $asset = WebGUI::Asset->newByDynamicClass("PBtmpl0000000000000035"); -$asset->purge; - -#-------------------------------------------- -print "\tUpdating config file.\n" unless ($quiet); -my $pathToConfig = '../../etc/'.$configFile; -my $conf = Parse::PlainConfig->new('DELIM' => '=', 'FILE' => $pathToConfig, 'PURGE'=>1); -my %newConfig; -foreach my $key ($conf->directives) { - unless ($key eq "logfile" || $key eq "passwordChangeLoggingEnabled" || $key eq "emailRecoveryLoggingEnabled") { - $newConfig{$key} = $conf->get($key); - } -} -my @newAssetList; -foreach my $asset (@{$newConfig{assets}}) { - push(@newAssetList, $asset) unless ($asset eq "WebGUI::Asset::Template"); -} -$newConfig{utilityAssets} = ["WebGUI::Asset::Template","WebGUI::Asset::RichEdit"]; -$newConfig{assets} = \@newAssetList; -$newConfig{shippingPlugins} = ['ByPrice', 'ByWeight', 'PerTransaction']; - -$conf->purge; -$conf->set(%newConfig); -$conf->write; - -#-------------------------------------------- -print "\tAdding default product template\n" unless ($quiet); -my $import = WebGUI::Asset->getImportNode; -my $folder = $import->addChild({ - title=>"Commerce/Product", - menuTitle=>"Commerce/Product", - url=>"Commerce/Product", - className=>"WebGUI::Asset::Wobject::Folder" - }); -$folder->addChild({ - namespace=>'Commerce/Product', - title=>'Default Product Template', - menuTitle=>'Default Product Template', - url=>'Default Produuct Template', - showInForms=>1, - isEditable=>1, - className=>"WebGUI::Asset::Template", - template=>'

-
-
-
- - - - - - - - - -
- - : , - - $
' },'PBtmplCP00000000000001'); - -#-------------------------------------------- -print "\tAdding default select shipping method template\n" unless ($quiet); -$folder = $import->addChild({ - title=>"Commerce/SelectShippingMethod", - menuTitle=>"Commerce/SelectShippingMethod", - url=>"Commerce/SelectShippingMethod", - className=>"WebGUI::Asset::Wobject::Folder" - }); -$folder->addChild({ - namespace=>'Commerce/SelectShippingMethod', - title=>'Default Select Shipping Method Template', - menuTitle=>'Default Select Shipping Method Template', - url=>'Default Select Shipping Method Template', - showInForms=>1, - isEditable=>1, - className=>"WebGUI::Asset::Template", - template=>' -
- - - - - - - - -
- - - - -
'}, 'PBtmplCSSM000000000001'); - -#-------------------------------------------- -print "\tAdding default shopping cart template\n" unless ($quiet); -my $folder = $import->addChild({ - title=>"Commerce/ViewShoppingCart", - menuTitle=>"Commerce/ViewShoppingCart", - url=>"Commerce/ViewShoppingCart", - className=>"WebGUI::Asset::Wobject::Folder" - }); -$folder->addChild({ - namespace=>'Commerce/ViewShoppingCart', - title=>'Default Shopping Cart Template', - menuTitle=>'Default Shopping Cart Template', - url=>'Default ShoppingCart Template', - showInForms=>1, - isEditable=>1, - className=>"WebGUI::Asset::Template", - template=>' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProductQuantityPrice
 Total
- - - - - - - - -
' },'PBtmplVSC0000000000001'); - -my $checkoutConfirm = ' ·
-
- -
-
    - -
  • -
    -
- - - - - - - - - - - - - - - - - - - -'; -my $asset = WebGUI::Asset::Template->new("PBtmpl0000000000000016"); -$asset->update({template=>$checkoutConfirm}); - - -#-------------------------------------------- -print "\tAdding several settings\n" unless ($quiet); -WebGUI::SQL->write("insert into settings values ('commerceSelectShippingMethodTemplateId', 'PBtmplCSSM000000000001')"); -WebGUI::SQL->write("insert into settings values ('commerceViewShoppingCartTemplateId', 'PBtmplVSC0000000000001')"); - - -#-------------------------------------------- -print "\tAdding product managers group\n" unless ($quiet); -WebGUI::SQL->write("insert into groups (groupId, groupName, description) values (14, 'Product Managers', 'The group that is allowed to edit, delete and create products.')"); - -#-------------------------------------------- -print "\tRemoving rich editor templates.\n" unless ($quiet); -my $sth = WebGUI::SQL->read("select assetId from template where namespace='richEditor'"); -while (my ($assetId) = $sth->array) { - my $asset = WebGUI::Asset::Template->new($assetId); - $asset->purge; -} -$sth->finish; - -#-------------------------------------------- -print "\tAdding rich editor configurations.\n" unless ($quiet); -my $importNode = WebGUI::Asset->getImportNode; -$importNode->addChild({ - className=>"WebGUI::Asset::RichEdit", - title=>"Content Manager's Rich Edit", - menuTitle=>"Content Manager's Rich Edit", - url=>"content_managers_rich_edit", - ownerUserId=>3, - groupIdView=>12, - groupIdEdit=>4, - toolbarRow1=>"bold\nitalic\njustifyleft\njustifyright\njustifycenter\njustifyfull\nindent\noutdent\nsub\nsup\nformatselect\nremoveformat", - toolbarRow2=>"bullist\nnumlist\nlink\npagetree\nanchor\nunlink\nadvhr\nimage\ninsertImage\ncharmap\ncollateral", - toolbarRow3=>"tablecontrols\nvisualaid\npreview\ncode\ncleanup\nreplace", - sourceEditorWidth=>600, - sourceEditorHeight=>500, - enableContextMenu=>1 - },"PBrichedit000000000001"); -$importNode->addChild({ - className=>"WebGUI::Asset::RichEdit", - title=>"Forum Rich Edit", - menuTitle=>"Forum Rich Edit", - url=>"forum_rich_edit", - ownerUserId=>3, - groupIdView=>7, - groupIdEdit=>4, - toolbarRow1=>"bold\nitalic\nbullist\nnumlist\nlink\nunlink\nemotions" - },"PBrichedit000000000002"); - -#-------------------------------------------- -print "\tUpdating LDAP Connections.\n" unless ($quiet); -my %ldapConnProps = (); -$ldapConnProps{ldapLinkId} = "new"; -$ldapConnProps{ldapLinkName} = "Default LDAP Connection"; -$ldapConnProps{ldapUrl} = $session{setting}{ldapURL} || "ldap://mycompany.com:389"; -$ldapConnProps{ldapUserRDN} = $session{setting}{ldapUserRDN}; -$ldapConnProps{ldapIdentity} = $session{setting}{ldapId}; -$ldapConnProps{ldapIdentityName} = $session{setting}{ldapIdName}; -$ldapConnProps{ldapPasswordName} = $session{setting}{ldapPasswordName}; -$ldapConnProps{ldapSendWelcomeMessage} = $session{setting}{ldapSendWelcomeMessage}; -$ldapConnProps{ldapWelcomeMessage} = $session{setting}{ldapWelcomeMessage}; -$ldapConnProps{ldapAccountTemplate} = $session{setting}{ldapAccountTemplate} || "PBtmpl0000000000000004"; -$ldapConnProps{ldapCreateAccountTemplate} = $session{setting}{ldapCreateAccountTemplate} || "PBtmpl0000000000000005"; -$ldapConnProps{ldapLoginTemplate} = $session{setting}{ldapLoginTemplate} || "PBtmpl0000000000000006"; -WebGUI::SQL->setRow("ldapLink","ldapLinkId",\%ldapConnProps); - -WebGUI::SQL->write("delete from settings where name in ('ldapURL','ldapUserRDN','ldapId','ldapIdName','ldapPasswordName','ldapSendWelcomeMessage','ldapWelcomeMessage','ldapAccountTemplate','ldapCreateAccountTemplate','ldapLoginTemplate')"); - -WebGUI::Session::close(); - diff --git a/docs/upgrades/upgrade_6.5.6-6.6.0.sql b/docs/upgrades/upgrade_6.5.6-6.6.0.sql deleted file mode 100644 index 361ece816..000000000 --- a/docs/upgrades/upgrade_6.5.6-6.6.0.sql +++ /dev/null @@ -1,102 +0,0 @@ -insert into webguiVersion values ('6.6.0','upgrade',unix_timestamp()); -update template set template='^StyleSheet(^Extras;/slidePanel/slidePanel.css);\r\n^JavaScript(^Extras;/slidePanel/slidePanel.js);\r\n\r\n\r\n' where assetId='PBtmpl0000000000000090'; - -alter table DataForm add column defaultView int(11) DEFAULT 0 NOT NULL; - -update template set template = '\">\n\n

\n

\n

ProductQuantityPriceEach
\n\n\n\n \n \n \n\n\n\n\n\n \n \n \n \n \n \n \n\n\n
Entry IDSubmission Date
\">
' where assetId='PBtmpl0000000000000021'; -alter table Navigation change endPoint descendantEndPoint int not null default 55; -alter table Navigation add column anscestorEndPoint int not null default 55; - -create table productVariants ( - variantId varchar(22) not null primary key, - productId varchar(22) not null, - composition mediumtext not null, - sku varchar(255), - price decimal(12,2) default 0, - weight decimal(8,3) default 0, - skuOverride tinyint(1) default 0, - priceOverride tinyint(1) default 0, - weightOverride tinyint(1) default 0, - available tinyint(1) default 1 -); -create table products ( - productId varchar(22) not null primary key, - title varchar(255) not null, - description mediumtext, - price decimal(12,2) not null, - weight decimal(8,3) not null, - sku varchar(255) not null, - skuTemplate varchar(255), - templateId varchar(22) -); -create table productParameters ( - parameterId varchar(22) not null primary key, - productId varchar(22) not null, - name varchar(64) not null -); -create table productParameterOptions ( - optionId varchar(22) not null primary key, - parameterId varchar(22) not null, - value varchar(64) not null, - priceModifier decimal(10,2) default 0, - weightModifier decimal(6,2) default 0, - skuModifier varchar(64) -); - -alter table transaction add column shippingCost varchar(9) default '0.00'; -alter table transaction add column shippingMethod varchar(15); -alter table transaction add column shippingOptions text; -alter table transaction add column shippingStatus varchar(15) default 'NotShipped'; -alter table transaction add column trackingNumber varchar(255); -create table RichEdit ( - assetId varchar(22) not null primary key, - askAboutRichEdit int not null default 0, - preformatted int not null default 0, - editorWidth int not null default 0, - editorHeight int not null default 0, - sourceEditorWidth int not null default 0, - sourceEditorHeight int not null default 0, - useBr int not null default 0, - nowrap int not null default 0, - removeLineBreaks int not null default 0, - npwrap int not null default 0, - directionality varchar(3) not null default 'ltr', - toolbarLocation varchar(6) not null default 'bottom', - cssFile varchar(255), - extendedValidElements text, - toolbarRow1 text, - toolbarRow2 text, - toolbarRow3 text, - enableContextMenu int not null default 0 -); -delete from settings where name='richEditCss'; -insert into settings values ("richEditor","PBrichedit000000000001"); -alter table Collaboration drop column allowRichEdit; -alter table Collaboration add column richEditor varchar(22) not null default 'PBrichedit000000000002'; -delete from userProfileField where fieldName like 'richEditor%'; -delete from userProfileData where fieldName like 'richEditor%'; -alter table Layout add column assetsToHide text; -alter table Collaboration add column karmaRatingMultiplier int not null default 0; -alter table Collaboration add column karmaSpentToRate int not null default 0; - - -create table ldapLink ( - ldapLinkId varchar(22) not null primary key, - ldapLinkName varchar(255) not null, - ldapUrl varchar(255) not null, - connectDn varchar(255) not null, - identifier varchar(255) not null, - ldapUserRDN varchar(255), - ldapIdentity varchar(255), - ldapIdentityName varchar(255), - ldapPasswordName varchar(255), - ldapSendWelcomeMessage varchar(2), - ldapWelcomeMessage text, - ldapAccountTemplate varchar(22), - ldapCreateAccountTemplate varchar(22), - ldapLoginTemplate varchar(22) -); - -insert into settings (name,value) values ('ldapConnection',NULL); - -update template set template='

\r\n \r\n

\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n\r\n\r\n \r\n \r\n\r\n\r\n\r\n \r\n \r\n\r\n
\r\n\r\n\r\n\r\n
\r\n
    \r\n
  • \">
  • \r\n \r\n
\r\n
' where assetId='PBtmpl0000000000000005'; diff --git a/docs/upgrades/upgrade_6.7.3-6.7.4.pl b/docs/upgrades/upgrade_6.7.3-6.7.4.pl index 44425ff8a..840004a69 100644 --- a/docs/upgrades/upgrade_6.7.3-6.7.4.pl +++ b/docs/upgrades/upgrade_6.7.3-6.7.4.pl @@ -13,10 +13,17 @@ start(); updatePageTemplates(); addDebug(); +fixFutureDates(); finish(); +#------------------------------------------------- +sub fixFutureDates { + print "\tFixing end dates which appear too far in the future.\n" unless ($quiet); + WebGUI::SQL->write("update assetData set endDate = 32472169200 where endDate > 32472169200"); +} + #------------------------------------------------- sub addDebug { print "\tAdding more debug options.\n" unless ($quiet); diff --git a/lib/WebGUI/AdminConsole.pm b/lib/WebGUI/AdminConsole.pm index 9833455ad..4ed94b0fd 100644 --- a/lib/WebGUI/AdminConsole.pm +++ b/lib/WebGUI/AdminConsole.pm @@ -409,7 +409,7 @@ sub render { my $importNode = $session{asset}->getImportNode; my $importNodeLineage = $importNode->get("lineage"); my $assetLineage = $session{asset}->get("lineage"); - if ($assetLineage =~ /^$importNodeLineage/) { + if ($assetLineage =~ /^$importNodeLineage/ || $assetLineage eq "000001") { $var{"backtosite.url"} = $session{asset}->getDefault->getUrl; } else { $var{"backtosite.url"} = $session{asset}->getContainer->getUrl; diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 289b6f783..84692f181 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -1325,9 +1325,7 @@ Returns "". sub view { my $self = shift; - if ($session{var}{adminOn}) { - return $self->getToolbar; - } + WebGUI::HTTP::setRedirect($self->getDefault->getUrl); return undef; } @@ -1587,28 +1585,6 @@ sub www_manageAssets { } -#------------------------------------------------------------------- - -=head2 www_restoreList ( ) - -Restores a piece of content from the trash back to it's original location. - -=cut - -sub www_restoreList { - my $self = shift; - return WebGUI::Privilege::insufficient() unless $self->canEdit; - foreach my $id ($session{cgi}->param("assetId")) { - my $asset = WebGUI::Asset->newByDynamicClass($id); - $asset->publish; - } - if ($session{form}{proceed} ne "") { - my $method = "www_".$session{form}{proceed}; - return $self->$method(); - } - return $self->www_manageTrash(); -} - #------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/File.pm b/lib/WebGUI/Asset/File.pm index 4a5651934..8666f5abd 100644 --- a/lib/WebGUI/Asset/File.pm +++ b/lib/WebGUI/Asset/File.pm @@ -19,6 +19,7 @@ use WebGUI::Asset; use WebGUI::HTTP; use WebGUI::Session; use WebGUI::Storage; +use WebGUI::SQL; our @ISA = qw(WebGUI::Asset); @@ -117,7 +118,6 @@ sub duplicate { sub getBox { my $self = shift; my $var = {}; - $self->getStorageLocation->getVars($self->get("filename"),$var); return $self->processTemplate($var,"PBtmpl0000000000000003"); } diff --git a/lib/WebGUI/AssetExportHtml.pm b/lib/WebGUI/AssetExportHtml.pm index 0f952250b..4eed53c7c 100644 --- a/lib/WebGUI/AssetExportHtml.pm +++ b/lib/WebGUI/AssetExportHtml.pm @@ -16,6 +16,7 @@ package WebGUI::Asset; use strict; use WebGUI::Session; +use File::Path; =head1 NAME diff --git a/lib/WebGUI/AssetTrash.pm b/lib/WebGUI/AssetTrash.pm index 6412730d6..b5056219d 100644 --- a/lib/WebGUI/AssetTrash.pm +++ b/lib/WebGUI/AssetTrash.pm @@ -174,25 +174,6 @@ sub www_deleteList { } -#------------------------------------------------------------------- - -=head2 www_emptyTrash ( ) - -Calls the purgeTree() method to delete all items in Trash. Returns the www_manageTrash() method. If isInGroup(4) returns false, renders insufficient privilege page. - -=cut - -sub www_emptyTrash { - my $self = shift; - my $ac = WebGUI::AdminConsole->new("trash"); - return WebGUI::Privilege::insufficient() unless (WebGUI::Grouping::isInGroup(4)); - foreach my $asset (@{$self->getAssetsInTrash(!($session{form}{systemTrash} && WebGUI::Grouping::isInGroup(3)))}) { - $asset->purgeTree; - } - return $self->www_manageTrash(); -} - - #------------------------------------------------------------------- =head2 www_manageTrash ( ) @@ -253,6 +234,28 @@ sub www_manageTrash { return $ac->render($output, $header); } +#------------------------------------------------------------------- + +=head2 www_restoreList ( ) + +Restores a piece of content from the trash back to it's original location. + +=cut + +sub www_restoreList { + my $self = shift; + return WebGUI::Privilege::insufficient() unless $self->canEdit; + foreach my $id ($session{cgi}->param("assetId")) { + my $asset = WebGUI::Asset->newByDynamicClass($id); + $asset->publish; + } + if ($session{form}{proceed} ne "") { + my $method = "www_".$session{form}{proceed}; + return $self->$method(); + } + return $self->www_manageTrash(); +} + 1; diff --git a/lib/WebGUI/AssetVersioning.pm b/lib/WebGUI/AssetVersioning.pm index 8266a6b98..b61261c9a 100644 --- a/lib/WebGUI/AssetVersioning.pm +++ b/lib/WebGUI/AssetVersioning.pm @@ -16,6 +16,7 @@ package WebGUI::Asset; use strict; use WebGUI::Session; +use WebGUI::Paginator; =head1 NAME @@ -521,10 +522,12 @@ sub www_manageRevisionsInTag { $ac->addSubmenuItem($self->getUrl('func=manageVersions'), $i18n->get("manage versions")); my $output = ' '; - my $sth = WebGUI::SQL->read("select assetData.revisionDate, users.username, asset.assetId, asset.className from assetData + my $p = WebGUI::Paginator->new($self->getUrl("func=manageRevisionsInTag;tagId=".$session{form}{tagId})); + $p->setDataByQuery("select assetData.revisionDate, users.username, asset.assetId, asset.className from assetData left join asset on assetData.assetId=asset.assetId left join users on assetData.revisedBy=users.userId where assetData.tagId=".quote($session{form}{tagId})); - while (my ($date,$by,$id, $class) = $sth->array) { + foreach my $row (@{$p->getPageData}) { + my ($date,$by,$id, $class) = ($row->{revisionDate}, $row->{username}, $row->{assetId}, $row->{className}); my $asset = WebGUI::Asset->new($id,$class,$date); $output .= ' @@ -532,8 +535,7 @@ sub www_manageRevisionsInTag { '; } - $sth->finish; - $output .= '
TitleTypeRevision DateRevised By
'.WebGUI::Icon::deleteIcon("func=purgeRevision;proceed=manageRevisionsInTag;tagId=".$session{form}{tagId}.";revisionDate=".$date,$asset->get("url"),$i18n->get("purge revision prompt")).' '.$asset->getTitle.''.WebGUI::DateTime::epochToHuman($date).' '.$by.'
'; + $output .= ''.$p->getBarSimple; my $tag = WebGUI::SQL->getRow("assetVersionTag","tagId",$session{form}{tagId}); return $ac->render($output,$i18n->get("revisions in tag").": ".$tag->{name}); } @@ -559,6 +561,7 @@ sub www_purgeRevision { sub www_rollbackVersionTag { my $self = shift; return WebGUI::Privilege::adminOnly() unless WebGUI::Grouping::isInGroup(3); + return WebGUI::Privilege::vitalComponent() if ($session{form}{tagId} eq "pbversion0000000000001" || $session{form}{tagId} eq "pbversion0000000000002"); my $tagId = $session{form}{tagId}; if ($tagId) { $self->rollbackVersionTag($tagId); diff --git a/sbin/Hourly/DeleteExpiredTrash.pm b/sbin/Hourly/DeleteExpiredTrash.pm index e77e8160b..16cbda05f 100644 --- a/sbin/Hourly/DeleteExpiredTrash.pm +++ b/sbin/Hourly/DeleteExpiredTrash.pm @@ -23,7 +23,7 @@ sub process { my $sth = WebGUI::SQL->read("select assetId,className from asset where state='trash' and stateChanged <".$expireDate); while (my ($id, $class) = $sth->array) { my $asset = WebGUI::Asset->new($id,$class); - $asset->purge; + $asset->purgeTree; } $sth->finish; }