merging 7.4 changes

This commit is contained in:
Graham Knop 2007-12-13 10:41:27 +00:00
parent 33ba29b338
commit f14c6e4b91
8 changed files with 277 additions and 26 deletions

View file

@ -10,6 +10,9 @@
- rfe: Add menuTitle to folder template (perlDreamer Consulting, LLC)
7.4.18
- fix: Graph draws black triangle covering half the image
- fix: upgrade.pl willing to upgrade from versions prior to 7.3.22
- fix: Rich editor defaults to using uploads paths for images
- fix: Auto Request Commit setting creates extra version tag if asset uses
requestAutoCommit
- fix: URL extensions (perlDreamer Consulting, LLC.)

File diff suppressed because one or more lines are too long

View file

@ -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.4.17';
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,"<templates-".$toVersion."/".$file);
my $first = 1;
my $create = 0;
my $head = 0;
my %properties = (className=>"WebGUI::Asset::Template");
while (my $line = <FILE>) {
if ($first) {
$line =~ m/^\#(.*)$/;
$properties{id} = $1;
$first = 0;
} elsif ($line =~ m/^\#create$/) {
$create = 1;
} elsif ($line =~ m/^\#(.*):\s*(.*)$/) {
$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;
}

View file

@ -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.4.18';
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,"<templates-".$toVersion."/".$file);
my $first = 1;
my $create = 0;
my $head = 0;
my %properties = (className=>"WebGUI::Asset::Template");
while (my $line = <FILE>) {
if ($first) {
$line =~ m/^\#(.*)$/;
$properties{id} = $1;
$first = 0;
} elsif ($line =~ m/^\#create$/) {
$create = 1;
} elsif ($line =~ m/^\#(.*):\s*(.*)$/) {
$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;
}

View file

@ -80,7 +80,7 @@
# see short clean WebGUI controlled URLs. However, this is
# slower than the default.
"richEditorsUseAssetUrls" : 0,
"richEditorsUseAssetUrls" : 1,
# An array of URLs that WebGUI should leave alone for normal
# processing by Apache. Anything that begins with these URLs

View file

@ -156,7 +156,8 @@ sub drawAxis {
points =>
" M ".$chartOffset->{x}.",".$chartOffset->{y}.
" L ".$chartOffset->{x}.",".($self->getChartHeight + $chartOffset->{y}).
" L ".($self->getChartWidth + $chartOffset->{x}).",".($self->getChartHeight + $chartOffset->{y})
" L ".($self->getChartWidth + $chartOffset->{x}).",".($self->getChartHeight + $chartOffset->{y}),
fill => 'none',
);
}

View file

@ -324,31 +324,28 @@ STOP
#-----------------------------------------
# checkVersion($versionNumber)
#-----------------------------------------
# Version number must be 7.3.18 or greater
# Version number must be 7.3.22 or greater
# in order to be upgraded by this utility.
#-----------------------------------------
sub checkVersion {
$_[0] =~ /(\d+)\.(\d+)\.(\d+)/;
my $goal = 7;
my $feature = 3;
my $fix = 18;
if ($1 > $goal) {
return 1;
} elsif ($1 == $goal) {
if ($2 > $feature) {
return 1;
} elsif ($2 == $feature) {
if ($3 >= $fix) {
return 1;
} else {
return 0;
}
} else {
return 0;
}
} else {
return 0;
}
$_[0] =~ /(\d+)\.(\d+)\.(\d+)/;
my $goal = 7;
my $feature = 3;
my $fix = 22;
if ($1 > $goal) {
return 1;
}
elsif ($1 == $goal) {
if ($2 > $feature) {
return 1;
}
elsif ($2 == $feature) {
if ($3 >= $fix) {
return 1;
}
}
}
return 0;
}
#-----------------------------------------