From aadb1f1e6dec3199b2a106e28f30bd04e8f0bec3 Mon Sep 17 00:00:00 2001 From: Matthew Wilson Date: Mon, 21 Feb 2005 04:16:27 +0000 Subject: [PATCH] EventsCalendar template conversions. --- docs/upgrades/upgrade_6.2.11-6.3.0.pl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/upgrades/upgrade_6.2.11-6.3.0.pl b/docs/upgrades/upgrade_6.2.11-6.3.0.pl index 16fe4008a..696ef03fc 100644 --- a/docs/upgrades/upgrade_6.2.11-6.3.0.pl +++ b/docs/upgrades/upgrade_6.2.11-6.3.0.pl @@ -89,7 +89,7 @@ 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', 'EventsCalendar', 'HttpProxy', 'Poll', 'Product', 'WobjectProxy', + 'SyndicatedContent', 'MessageBoard', 'DataForm', 'HttpProxy', 'Poll', 'Product', 'WobjectProxy', 'IndexedSearch', 'SQLReport', 'Survey', 'WSClient')"); while (my $t = $sth->hashRef) { $t->{template} = ' @@ -543,7 +543,7 @@ while (my $data = $sth->hashRef) { } WebGUI::SQL->write("drop table collateralFolder"); WebGUI::SQL->write("drop table collateral"); - +$sth->finish; @@ -1017,6 +1017,17 @@ while (my ($id, $template, $namespace) = $sth->array) { } $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); @@ -1800,6 +1811,7 @@ sub walkTree { #increment the rank. $eventRank++; } + $sth->finish; } $rank++; }