From 24a2d8b76039c28cf8bcf4976a56ce5712baac26 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 26 Jul 2006 21:29:55 +0000 Subject: [PATCH] preparing for 7.0.4 bugfix cycle --- docs/changelog/7.x.x.txt | 3 + docs/gotcha.txt | 10 +++ docs/upgrades/upgrade_7.0.3-7.0.4.pl | 125 +++++++++++++++++++++++++++ lib/WebGUI.pm | 2 +- 4 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 docs/upgrades/upgrade_7.0.3-7.0.4.pl diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 774047ef7..32e6b38d5 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,3 +1,6 @@ +7.0.4 + + 7.0.3 - Fixed a problem with the 7.0.0-7.0.1 upgrade relating to internationalized department names. diff --git a/docs/gotcha.txt b/docs/gotcha.txt index e49af4d84..9216fd039 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -8,6 +8,16 @@ versions. Be sure to heed the warnings contained herein as they will save you many hours of grief. +7.0.4 +-------------------------------------------------------------------- + + * Version 7.0.3 shipped with a 7.0.2 create.sql script. This doesn't + really hurt anything, it just means that if you installed 7.0.3 + as your starting point, you'll see an extra upgrade go through + when you upgrade to 7.0.4. + + + 7.0.3 -------------------------------------------------------------------- diff --git a/docs/upgrades/upgrade_7.0.3-7.0.4.pl b/docs/upgrades/upgrade_7.0.3-7.0.4.pl new file mode 100644 index 000000000..5f582bd74 --- /dev/null +++ b/docs/upgrades/upgrade_7.0.3-7.0.4.pl @@ -0,0 +1,125 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2006 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +use lib "../../lib"; +use strict; +use Getopt::Long; +use WebGUI::Session; + + +my $toVersion = "7.0.4"; # make this match what version you're going to +my $quiet; # this line required + + +my $session = start(); # this line required + +# upgrade functions go here + +finish($session); # this line required + + +##------------------------------------------------- +#sub exampleFunction { +# my $session = shift; +# print "\tWe're doing some stuff here that you should know about.\n" unless ($quiet); +# # and here's our code +#} + + + +# ---- DO NOT EDIT BELOW THIS LINE ---- + +#------------------------------------------------- +sub start { + my $configFile; + $|=1; #disable output buffering + GetOptions( + 'configFile=s'=>\$configFile, + 'quiet'=>\$quiet + ); + my $session = WebGUI::Session->open("../..",$configFile); + $session->user({userId=>3}); + my $versionTag = WebGUI::VersionTag->getWorking($session); + $versionTag->set({name=>"Upgrade to ".$toVersion}); + $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".$session->datetime->time().")"); + updateTemplates($session); + return $session; +} + +#------------------------------------------------- +sub finish { + my $session = shift; + my $versionTag = WebGUI::VersionTag->getWorking($session); + $versionTag->commit; + $session->close(); +} + +#------------------------------------------------- +sub updateTemplates { + my $session = shift; + return undef unless (-d "templates-".$toVersion); + print "\tUpdating templates.\n" unless ($quiet); + opendir(DIR,"templates-".$toVersion); + my @files = readdir(DIR); + closedir(DIR); + my $importNode = WebGUI::Asset->getImportNode($session); + my $newFolder = undef; + foreach my $file (@files) { + next unless ($file =~ /\.tmpl$/); + open(FILE,""WebGUI::Asset::Template"); + while (my $line = ) { + if ($first) { + $line =~ m/^\#(.*)$/; + $properties{id} = $1; + $first = 0; + } elsif ($line =~ m/^\#create$/) { + $create = 1; + } elsif ($line =~ m/^\#(.*):(.*)$/) { + $properties{$1} = $2; + } elsif ($line =~ m/^~~~$/) { + $head = 1; + } elsif ($head) { + $properties{headBlock} .= $line; + } else { + $properties{template} .= $line; + } + } + close(FILE); + if ($create) { + $newFolder = createNewTemplatesFolder($importNode) unless (defined $newFolder); + my $template = $newFolder->addChild(\%properties, $properties{id}); + } else { + my $template = WebGUI::Asset->new($session,$properties{id}, "WebGUI::Asset::Template"); + if (defined $template) { + my $newRevision = $template->addRevision(\%properties); + } + } + } +} + +#------------------------------------------------- +sub createNewTemplatesFolder { + my $importNode = shift; + my $newFolder = $importNode->addChild({ + className=>"WebGUI::Asset::Wobject::Folder", + title => $toVersion." New Templates", + menuTitle => $toVersion." New Templates", + url=> $toVersion."_new_templates", + groupIdView=>"12" + }); + return $newFolder; +} + + + diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index d8bb48049..0a4b2bd62 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -1,5 +1,5 @@ package WebGUI; -our $VERSION = "7.0.3"; +our $VERSION = "7.0.4"; our $STATUS = "stable"; #-------------------------------------------------------------------