fixed upgrade skeleton to work with new session api

set up _upgrade.skeleton
This commit is contained in:
JT Smith 2006-01-13 17:45:53 +00:00
parent aec8e8e0cf
commit 20d259dd0d
25 changed files with 71 additions and 13180 deletions

View file

@ -14,6 +14,10 @@ save you many hours of grief.
migration.txt to bring your custom code up to date with the
new API.
* You need to upgrade to the latest 6.8 release before you can
upgrade to 6.9.
6.8.4
--------------------------------------------------------------------
* The If macro has been removed because it's far too dangerous and

View file

@ -1,5 +1,5 @@
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2005 Plain Black Corporation.
# 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
@ -12,22 +12,22 @@ use lib "../../lib";
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::SQL;
my $toVersion = "0.0.0"; # make this match what version you're going to
my $quiet; # this line required
start(); # this line required
my $session = start(); # this line required
# upgrade functions go here
finish(); # this line required
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
#}
@ -44,13 +44,15 @@ sub start {
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
WebGUI::Session::refreshUserInfo(3);
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
my $session = WebGUI::Session->open("../..",$configFile);
$session->user({userId=>3});
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".$session->datetime->time().")");
return $session;
}
#-------------------------------------------------
sub finish {
WebGUI::Session::close();
my $session = shift;
$session->close();
}

View file

@ -1,85 +0,0 @@
#!/usr/bin/perl
use lib "../../lib";
use File::Path;
use Getopt::Long;
use strict;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Asset::Template;
my $configFile;
my $quiet;
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
#--------------------------------------------
print "\tUpdating Commerce Templates\n" unless ($quiet);
my $template = '<a href="<tmpl_var viewShoppingCart.url>"><tmpl_var viewShoppingCart.label></a> &middot;
<a href="<tmpl_var changePayment.url>"><tmpl_var changePayment.label></a> &middot;
<a href="<tmpl_var changeShipping.url>"><tmpl_var changeShipping.label></a><br>
<br>
<tmpl_var title><br>
<ul>
<tmpl_loop errorLoop>
<li><tmpl_var message></li>
</tmpl_loop>
</ul>
<table> <tr align="left">
<th style="border-bottom: 2px solid black">Product</th>
<th style="border-bottom: 2px solid black">Quantity</th>
<th style="border-bottom: 2px solid black">Price</th>
<th style="border-bottom: 2px solid black">Each</th>
</tr>
<tmpl_if normalItems>
</tmpl_if>
<tmpl_loop normalItemsLoop>
<tr>
<td align="left"><tmpl_var name></td>
<td align="center"><tmpl_var quantity></td>
<td align="right"><tmpl_var totalPrice></td>
</tr>
</tmpl_loop>
<tmpl_loop recurringItemsLoop>
<tr>
<td align="left"><tmpl_var name></td>
<td align="center"><tmpl_var quantity></td>
<td align="right"><tmpl_var totalPrice></td>
<td align="left"><tmpl_var period></td>
</tr>
</tmpl_loop>
<tr style="border-top: 1px solid black">
<td style="border-top: 1px solid black">&nbsp;</td>
<td align="right" style="border-top: 1px solid black"><b>Subtotal</b></td>
<td align="right" style="border-top: 1px solid black"><b><tmpl_var subtotal></b></td>
</tr>
<tr>
<td colspan="2" align="right">Shipping</td>
<td align="right"><tmpl_var shippingCost></td>
<tr>
<td colspan="2" align="right" style="border-top: 1px solid black"><b>Total</b></td>
<td align="right" style="border-top: 1px solid black"><b><tmpl_var total></b></td>
</table>
<br><br>
<tmpl_var form>';
my $asset = WebGUI::Asset::Template->new("PBtmpl0000000000000016");
$asset->update({template=>$template});
WebGUI::Session::close();

View file

@ -1,6 +0,0 @@
insert into webguiVersion values ('6.6.1','upgrade',unix_timestamp());
insert into settings values ('commerceSendDailyReportTo', '');
alter table Navigation change anscestorEndPoint ancestorEndPoint int not null default 55;
alter table groups add ldapGroup varchar(255) default NULL;
alter table groups add ldapGroupProperty varchar(255) default NULL;
alter table groups add ldapRecursiveProperty varchar(255) default NULL;

View file

@ -1,4 +0,0 @@
insert into webguiVersion values ('6.6.2','upgrade',unix_timestamp());
alter table Shortcut add disableContentLock int(11) NOT NULL default '0';
update template set template='<a name="<tmpl_var assetId>"></a><tmpl_if session.var.adminOn><p><tmpl_var controls></p></tmpl_if><style>.productFeatureHeader,.productSpecificationHeader,.productRelatedHeader,.productAccessoryHeader, .productBenefitHeader { font-weight: bold; font-size: 15px;}.productFeature,.productSpecification,.productRelated,.productAccessory, .productBenefit { font-size: 12px;}.productAttributeSeperator { background-color: black;}</style><tmpl_if displayTitle> <h1><tmpl_var title></h1></tmpl_if><table width="100%" cellpadding="3" cellspacing="0" border="0"><tr> <td class="content" valign="top"><tmpl_if description> <tmpl_var description><p /></tmpl_if><tmpl_if price> <b>Price:</b> <tmpl_var price><br /></tmpl_if><tmpl_if productnumber> <b>Product Number:</b> <tmpl_var productNumber><br /></tmpl_if><br><tmpl_if brochure.url> <a href="<tmpl_var brochure.url>"><img src="<tmpl_var brochure.icon>" border=0 align="absmiddle"><tmpl_var brochure.label></a><br /></tmpl_if><tmpl_if manual.url> <a href="<tmpl_var manual.url>"><img src="<tmpl_var manual.icon>" border=0 align="absmiddle"><tmpl_var manual.label></a><br /></tmpl_if><tmpl_if warranty.url> <a href="<tmpl_var warranty.url>"><img src="<tmpl_var warranty.icon>" border=0 align="absmiddle"><tmpl_var warranty.label></a><br /></tmpl_if> </td><td valign="top"><tmpl_if thumbnail1> <a href="<tmpl_var image1>"><img src="<tmpl_var thumbnail1>" border="0" /></a><p /></tmpl_if><tmpl_if thumbnail2> <a href="<tmpl_var image2>"><img src="<tmpl_var thumbnail2>" border="0" /></a><p /></tmpl_if><tmpl_if thumbnail3> <a href="<tmpl_var image3>"><img src="<tmpl_var thumbnail3>" border="0" /></a><p /></tmpl_if> </td></tr></table><table border="0" cellpadding="0" cellspacing="5"><tr><td valign="top" class="productFeature"><div class="productFeatureHeader">Features</div><tmpl_if session.var.adminOn> <a href="<tmpl_var addfeature.url>"><tmpl_var addfeature.label></a><p /></tmpl_if><tmpl_loop feature_loop> <tmpl_if session.var.adminOn><tmpl_var feature.controls></tmpl_if><tmpl_var feature.feature><br /></tmpl_loop><p/></td> <td class="productAttributeSeperator"><img src="^Extras;spacer.gif" width="1" height="1"></td> <td valign="top" class="productBenefit"><div class="productBenefitHeader">Benefits</div><tmpl_if session.var.adminOn> <a href="<tmpl_var addBenefit.url>"><tmpl_var addBenefit.label></a><p /></tmpl_if><tmpl_loop benefit_loop> <tmpl_if session.var.adminOn><tmpl_var benefit.controls></tmpl_if><tmpl_var benefit.benefit><br /></tmpl_loop><p/></td> <td class="productAttributeSeperator"><img src="^Extras;spacer.gif" width="1" height="1"></td> <td valign="top" class="productSpecification"><div class="productSpecificationHeader">Specifications</div><tmpl_if session.var.adminOn> <a href="<tmpl_var addSpecification.url>"><tmpl_var addSpecification.label></a><p /></tmpl_if><tmpl_loop specification_loop> <tmpl_if session.var.adminOn><tmpl_var specification.controls></tmpl_if><b><tmpl_var specification.label>:</b> <tmpl_var specification.specification> <tmpl_var specification.units><br /></tmpl_loop><p/></td> <td class="productAttributeSeperator"><img src="^Extras;spacer.gif" width="1" height="1"></td> <td valign="top" class="productAccessory"><div class="productAccessoryHeader">Accessories</div><tmpl_if session.var.adminOn> <a href="<tmpl_var addaccessory.url>"><tmpl_var addaccessory.label></a><p /></tmpl_if><tmpl_loop accessory_loop> <tmpl_if session.var.adminOn><tmpl_var accessory.controls></tmpl_if><a href="<tmpl_var accessory.url>"><tmpl_var accessory.title></a><br /></tmpl_loop><p/></td> <td class="productAttributeSeperator"><img src="^Extras;spacer.gif" width="1" height="1"></td> <td valign="top" class="productRelated"><div class="productRelatedHeader">Related Products</div><tmpl_if session.var.adminOn> <a href="<tmpl_var addRelatedProduct.url>"><tmpl_var addRelatedProduct.label></a><p /></tmpl_if><tmpl_loop relatedproduct_loop> <tmpl_if session.var.adminOn><tmpl_var RelatedProduct.controls></tmpl_if><a href="<tmpl_var relatedproduct.url>"><tmpl_var relatedproduct.title></a><br /></tmpl_loop></td></tr></table>' where assetId='PBtmpl0000000000000056';
update template set template='^StyleSheet(^Extras;/adminConsole/adminConsole.css);\r\n^JavaScript(^Extras;/adminConsole/adminConsole.js);\r\n\r\n<div id=\"application_help\">\r\n <tmpl_if help.url>\r\n <a href=\"<tmpl_var help.url>\" target=\"_blank\"><img src=\"^Extras;/adminConsole/small/help.gif\" alt=\"?\" border=\"0\" /></a>\r\n </tmpl_if>\r\n</div>\r\n<div id=\"application_icon\">\r\n <img src=\"<tmpl_var application.icon>\" border=\"0\" title=\"<tmpl_var application.title>\" alt=\"<tmpl_var application.title>\" />\r\n</div>\r\n<div class=\"adminConsoleTitleIconMedalian\">\r\n<img src=\"^Extras;/adminConsole/medalian.gif\" border=\"0\" alt=\"*\" />\r\n</div>\r\n<div id=\"console_icon\">\r\n <img src=\"<tmpl_var console.icon>\" border=\"0\" title=\"<tmpl_var console.title>\" alt=\"<tmpl_var console.title>\" />\r\n</div>\r\n<div id=\"application_title\">\r\n <tmpl_var application.title>\r\n</div>\r\n<div id=\"console_title\">\r\n <tmpl_var console.title>\r\n</div>\r\n<div id=\"application_workarea\">\r\n <tmpl_var application.workArea>\r\n</div>\r\n<div id=\"console_workarea\">\r\n <div class=\"adminConsoleSpacer\">\r\n &nbsp;\r\n </div>\r\n <tmpl_loop application_loop>\r\n <tmpl_if canUse>\r\n <div class=\"adminConsoleApplication\">\r\n <a href=\"<tmpl_var url>\"><img src=\"<tmpl_var icon>\" border=\"0\" title=\"<tmpl_var title>\" alt=\"<tmpl_var title>\" /></a><br />\r\n <a href=\"<tmpl_var url>\"><tmpl_var title></a>\r\n </div>\r\n </tmpl_if>\r\n </tmpl_loop>\r\n <div class=\"adminConsoleSpacer\">\r\n &nbsp;\r\n </div>\r\n</div>\r\n<div class=\"adminConsoleMenu\">\r\n <div id=\"adminConsoleMainMenu\" class=\"adminConsoleMainMenu\">\r\n <div id=\"console_toggle_on\">\r\n <a href=\"#\" onClick=\"toggleAdminConsole()\"><tmpl_var toggle.on.label></a><br />\r\n </div>\r\n <div id=\"console_toggle_off\">\r\n <a href=\"#\" onClick=\"toggleAdminConsole()\"><tmpl_var toggle.off.label></a><br />\r\n </div>\r\n </div>\r\n <div id=\"adminConsoleApplicationSubmenu\" class=\"adminConsoleApplicationSubmenu\">\r\n <tmpl_loop submenu_loop>\r\n <a href=\"<tmpl_var url>\" <tmpl_var extras>><tmpl_var label></a><br />\r\n </tmpl_loop>\r\n </div>\r\n <div id=\"adminConsoleUtilityMenu\" class=\"adminConsoleUtilityMenu\">\r\n <a href=\"<tmpl_var backtosite.url>\"><tmpl_var backtosite.label></a><br />\r\n ^AdminToggle;<br />\r\n ^LoginToggle;<br />\r\n </div>\r\n</div>\r\n<script lang=\"JavaScript\">\r\n initAdminConsole(<tmpl_if application.title>true<tmpl_else>false</tmpl_if>,<tmpl_if submenu_loop>true<tmpl_else>false</tmpl_if>);\r\n</script>\r\n' where assetId='PBtmpl0000000000000001';

View file

@ -1,2 +0,0 @@
insert into webguiVersion values ('6.6.3','upgrade',unix_timestamp());

View file

@ -1,26 +0,0 @@
#!/usr/bin/perl
use lib "../../lib";
use Getopt::Long;
use strict;
use WebGUI::Session;
use WebGUI::Grouping;
my $configFile;
my $quiet;
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
#--------------------------------------------
print "\tMaking admins part of product managers.\n" unless ($quiet);
WebGUI::Grouping::addGroupsToGroups(['3'],['14']);
WebGUI::Session::close();

File diff suppressed because one or more lines are too long

View file

@ -1,23 +0,0 @@
#!/usr/bin/perl
use lib "../../lib";
use Getopt::Long;
use strict;
use File::Path;
my $configFile;
my $quiet;
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
#--------------------------------------------
print "\tRemoving old HTML::Template if it exists. Check gotcha.txt for details.\n" unless ($quiet);
rmtree("../../lib/HTML/Template");
unlink("../../lib/HTML/Template.pm");

View file

@ -1,2 +0,0 @@
insert into webguiVersion values ('6.6.5','upgrade',unix_timestamp());

View file

@ -1,875 +0,0 @@
my $toVersion = "6.7.0";
use lib "../../lib";
use File::Path;
use Getopt::Long;
use strict;
use WebGUI::Asset;
use WebGUI::Asset::Wobject::Folder;
use WebGUI::Asset::Snippet;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Group;
my $configFile;
my $quiet;
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
WebGUI::Session::refreshUserInfo(3);
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
giveSnippetsMimeTypes();
addAssetVersioning();
updateConfigFile();
insertHelpTemplate();
makeSyndicatedContentChanges();
removeOldThemeSystem();
addSectionsToSurveys();
increaseProxyUrlLength();
upgradeRichEdit();
WebGUI::Session::close();
#-------------------------------------------------
sub upgradeRichEdit {
print "\tUpgrade rich editor to version 1.45.\n" unless ($quiet);
WebGUI::SQL->write("update RichEdit set extendedValidElements='*[*]' where assetId='PBrichedit000000000001'");
my $prepend = 'a[name|href|target|title],strong/b[class],em\/i[class],strike[class],u[class],p[dir|class|align],ol,ul,li,br,img[class|src|border=0|alt|title|hspace|vspace|width|height|align],sub,sup,blockquote[dir|style],table[border=0|cellspacing|cellpadding|width|height|class|align],tr[class|rowspan|width|height|align|valign],td[dir|class|colspan|rowspan|width|height|align|valign],div[dir|class|align],span[class|align],pre[class|align],address[class|align],h1[dir|class|align],h2[dir|class|align],h3[dir|class|align],h4[dir|class|align],h5[dir|class|align],h6[dir|class|align],hr';
WebGUI::SQL->write("update RichEdit set extendedValidElements=concat(".quote($prepend).",',',extendedValidElements) where assetId<>'PBrichedit000000000001'");
WebGUI::SQL->write("alter table RichEdit change extendedValidElements validElements mediumtext");
}
#-------------------------------------------------
sub increaseProxyUrlLength {
print "\tMaking HTTP Proxy URLs accept lengths of up to 2048 characters.\n" unless ($quiet);
WebGUI::SQL->write("alter table HttpProxy change proxiedUrl proxiedUrl text");
}
#-------------------------------------------------
sub giveSnippetsMimeTypes {
print "\tAllowing snippets to handle mime types.\n" unless ($quiet);
WebGUI::SQL->write("alter table snippet add column mimeType varchar(50) not null default 'text/html'");
}
#-------------------------------------------------
sub removeOldThemeSystem {
print "\tRemoving the old theme system.\n" unless ($quiet);
WebGUI::SQL->write("drop table theme");
WebGUI::SQL->write("drop table themeComponent");
WebGUI::Group->new('9')->delete;
}
#-------------------------------------------------
sub makeSyndicatedContentChanges {
print "\tMaking changes to the syndicated content asset.\n" unless ($quiet);
WebGUI::SQL->write("alter table SyndicatedContent add column displayMode varchar(20) not null default 'interleaved'");
WebGUI::SQL->write("alter table SyndicatedContent add column hasTerms varchar(255) not null");
insertXSLTSheets();
insertSyndicatedContentTemplate();
}
#-------------------------------------------------
sub addSectionsToSurveys {
print "\tAdding sections to Surveys.\n" unless ($quiet);
WebGUI::SQL->write("alter table Survey_question add column Survey_sectionId varchar(22) null");
WebGUI::SQL->write("create table Survey_section (Survey_id varchar(22) null, Survey_sectionId varchar(22) not null, sectionName text null, sequenceNumber int(11) not null default 1, primary key (Survey_sectionId))");
my $template = q|<a name="<tmpl_var assetId>"></a>
<tmpl_if session.var.adminOn>
<p><tmpl_var controls></p>
</tmpl_if>
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<tmpl_var description><p />
</tmpl_if>
<tmpl_if user.canTakeSurvey>
<tmpl_if response.isComplete>
<tmpl_if mode.isSurvey>
<tmpl_var thanks.survey.label>
<tmpl_else>
<tmpl_var thanks.quiz.label>
<div align="center">
<b><tmpl_var questions.correct.count.label>:</b> <tmpl_var questions.correct.count> / <tmpl_var questions.total>
<br />
<b><tmpl_var questions.correct.percent.label>:</b><tmpl_var questions.correct.percent>%
</div>
</tmpl_if>
<tmpl_if user.canRespondAgain>
<br /> <br /> <a href="<tmpl_var start.newResponse.url>"><tmpl_var start.newResponse.label></a>
</tmpl_if>
<tmpl_else>
<tmpl_if response.id>
<tmpl_var form.header>
<table width="100%" cellpadding="3" cellspacing="0" border="0" class="content">
<tr>
<td valign="top">
<tmpl_loop question_loop>
<p><tmpl_var question.question></p>
<tmpl_var question.answer.label><br />
<tmpl_var question.answer.field><br />
<br />
<tmpl_if question.allowComment>
<tmpl_var question.comment.label><br />
<tmpl_var question.comment.field><br />
</tmpl_if>
</tmpl_loop>
</td>
<td valign="top" nowrap="1">
<b><tmpl_var questions.sofar.label>:</b> <tmpl_var questions.sofar.count> / <tmpl_var questions.total> <br />
<tmpl_unless mode.isSurvey>
<b><tmpl_var questions.correct.count.label>:</b> <tmpl_var questions.correct.count> / <tmpl_var questions.sofar.count><br />
<b><tmpl_var questions.correct.percent.label>:</b><tmpl_var questions.correct.percent>% / 100%<br />
</tmpl_unless>
</td>
</tr>
</table>
<div align="center"><tmpl_var form.submit></div>
<tmpl_var form.footer>
<tmpl_else>
<a href="<tmpl_var start.newResponse.url>"><tmpl_var start.newResponse.label></a>
</tmpl_if>
</tmpl_if>
<tmpl_else>
<tmpl_if mode.isSurvey>
<tmpl_var survey.noprivs.label>
<tmpl_else>
<tmpl_var quiz.noprivs.label>
</tmpl_if>
</tmpl_if>
<br />
<br />
<tmpl_if user.canViewReports>
<a href="<tmpl_var report.gradebook.url>"><tmpl_var report.gradebook.label></a>
&bull;
<a href="<tmpl_var report.overview.url>"><tmpl_var report.overview.label></a>
&bull;
<a href="<tmpl_var delete.all.responses.url>"><tmpl_var delete.all.responses.label></a>
<br />
<a href="<tmpl_var export.answers.url>"><tmpl_var export.answers.label></a>
&bull;
<a href="<tmpl_var export.questions.url>"><tmpl_var export.questions.label></a>
&bull;
<a href="<tmpl_var export.responses.url>"><tmpl_var export.responses.label></a>
&bull;
<a href="<tmpl_var export.composite.url>"><tmpl_var export.composite.label></a>
</tmpl_if>
<tmpl_if session.var.adminOn>
<p>
<a href="<tmpl_var question.add.url>"><tmpl_var question.add.label></a>
</p>
<p><a href="<tmpl_var section.add.url>"><tmpl_var section.add.label></a></p>
<tmpl_loop section.edit_loop>
<tmpl_var section.edit.controls>
<b><tmpl_var section.edit.sectionName></b>
<br />
<tmpl_loop section.questions_loop>
&nbsp;&nbsp;&nbsp;<tmpl_var question.edit.controls><tmpl_var question.edit.question>
</tmpl_loop>
<br />
</tmpl_loop>
</tmpl_if> |;
my $properties = { 'template' => $template };
my $currentVersion = WebGUI::Asset::Template->new('PBtmpl0000000000000061');
my $newVersion = $currentVersion->addRevision($properties);
}
#-------------------------------------------------
sub updateConfigFile {
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) { # delete unwanted stuff
unless ($key eq "wobject") {
$newConfig{$key} = $conf->get($key);
}
}
$newConfig{fileCacheSizeLimit} = 100000000;
$newConfig{DeleteExpiredRevisions_offset} = 365;
$conf->purge;
$conf->set(%newConfig);
$conf->write;
}
#-------------------------------------------------
sub addAssetVersioning {
print "\tMaking changes for asset versioning\n" unless ($quiet);
WebGUI::SQL->write("insert into settings values ('autoCommit','1')");
WebGUI::SQL->write("create table assetVersionTag (
tagId varchar(22) not null primary key,
name varchar(255) not null,
isCommitted int not null default 0,
creationDate bigint not null default 0,
createdBy varchar(22),
commitDate bigint not null default 0,
committedBy varchar(22)
)");
my $now = time();
WebGUI::SQL->write("insert into assetVersionTag values ('pbversion0000000000001','Initial Import','1',$now,'3',$now,'3')");
WebGUI::SQL->write("insert into assetVersionTag values ('pbversion0000000000002','Auto Commit','1',$now,'3',$now,'3')");
foreach my $table (qw(FileAsset Post RichEdit snippet EventsCalendar_event ImageAsset Thread redirect Shortcut template Article EventsCalendar IndexedSearch MessageBoard SQLReport Folder Navigation Survey WSClient Collaboration HttpProxy Layout Poll SyndicatedContent Product DataForm wobject)) {
WebGUI::SQL->write("alter table $table add column revisionDate bigint not null");
WebGUI::SQL->write("update $table set revisionDate=$now");
WebGUI::SQL->write("alter table $table drop primary key");
WebGUI::SQL->write("alter table $table add primary key (assetId,revisionDate)");
}
WebGUI::SQL->write("create table assetData (
assetId varchar(22) not null,
revisionDate bigint not null,
revisedBy varchar(22) not null,
tagId varchar(22) not null,
status varchar(35) not null default 'pending',
title varchar(255) not null default 'untitled',
menuTitle varchar(255) not null default 'untitled',
url varchar(255) not null,
ownerUserId varchar(22) not null default '3',
groupIdView varchar(22) not null default '7',
groupIdEdit varchar(22) not null default '4',
startDate bigint not null default 997995720,
endDate bigint not null default 32472169200,
synopsis text,
newWindow int not null default 0,
isHidden int not null default 0,
isPackage int not null default 0,
isPrototype int not null default 0,
encryptPage int not null default 0,
assetSize int not null default 0,
extraHeadTags text,
primary key (assetId,revisionDate)
)");
my $statement = WebGUI::SQL->prepare("insert into assetData values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
my $sth = WebGUI::SQL->read("select * from asset");
while (my $data = $sth->hashRef) {
$statement->execute([
$data->{assetId},
$now,
'3',
'pbversion0000000000001',
'approved',
$data->{title},
$data->{menuTitle},
$data->{url},
$data->{ownerUserId},
$data->{groupIdView},
$data->{groupIdEdit},
$data->{startDate},
$data->{endDate},
$data->{synopsis},
$data->{newWindow},
$data->{isHidden},
$data->{isPackage},
$data->{isPrototype},
$data->{encryptPage},
$data->{assetSize},
$data->{extraHeadTags}
]);
}
$sth->finish;
WebGUI::SQL->write("alter table asset add column creationDate bigint not null default 997995720");
WebGUI::SQL->write("alter table asset add column createdBy varchar(22) not null default '3'");
WebGUI::SQL->write("alter table asset add column stateChanged varchar(22) not null default 997995720");
WebGUI::SQL->write("alter table asset add column stateChangedBy varchar(22) not null default '3'");
WebGUI::SQL->write("alter table asset add column isLockedBy varchar(22)");
WebGUI::SQL->write("update asset set creationDate=$now, createdBy='3'");
foreach my $field (qw(url groupIdView title menuTitle startDate endDate ownerUserId groupIdEdit synopsis newWindow isHidden isSystem encryptPage assetSize lastUpdated lastUpdatedBy isPackage extraHeadTags isPrototype)) {
WebGUI::SQL->write("alter table asset drop column $field");
}
# clean up the psuedo version tracking in files
$sth = WebGUI::SQL->read("select olderVersions from FileAsset");
while (my ($old) = $sth->array) {
foreach my $storageId (split("\n",$old)) {
next unless ($storageId);
WebGUI::Storage->get($storageId)->delete;
}
}
$sth->finish;
WebGUI::SQL->write("alter table FileAsset drop column olderVersions");
my $writeStatus = WebGUI::SQL->prepare("update assetData set status=? where assetId=? and revisionDate=?");
my $sth = WebGUI::SQL->read("select status,assetId,revisionDate from Post");
while (my ($status,$id,$version) = $sth->array) {
$writeStatus->execute([$status,$id,$version]);
}
$sth->finish;
$writeStatus->finish;
WebGUI::SQL->write('alter table Post drop column status');
}
#-------------------------------------------------
sub insertHelpTemplate{
print "\tInserting new Help template\n" unless ($quiet);
my $helpTemplate = <<EOT;
<p><tmpl_var body></p>
<tmpl_if fields>
<dl>
<tmpl_loop fields>
<dt><tmpl_var title></dt>
<dd><tmpl_var description></dd>
</tmpl_loop>
</dl>
</tmpl_if>
EOT
my $import=WebGUI::Asset->getImportNode;
my $folder = $import->addChild({
title=>"6.7.0 Help System Template",
menuTitle=>"6.7.0 Help System Template",
url=>"6-7-0HelpSystemTemplate",
className=>"WebGUI::Asset::Wobject::Folder"
});
$folder->commit;
$folder->addChild({
namespace=>'AdminConsole',
title=>'Help',
menuTitle=>'Help',
url=>'Help',
showInForms=>1,
isEditable=>1,
className=>"WebGUI::Asset::Template",
template=>$helpTemplate},'PBtmplHelp000000000001')->commit;
}
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sub insertSyndicatedContentTemplate{
print "\tInserting new syndicated content template\n" unless ($quiet);
my $template=q|<a name="<tmpl_var assetId>"></a>
<tmpl_if session.var.adminOn>
<p><tmpl_var controls></p>
</tmpl_if>
<p>
<a href="<tmpl_var rss.url.0.9>">RSS 0.90</a>
<a href="<tmpl_var rss.url.0.91>">RSS 0.91</a>
<a href="<tmpl_var rss.url.1.0>">RSS 1.0</a>
<a href="<tmpl_var rss.url.2.0>">RSS 2.0</a>
</p>
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<tmpl_var description><p />
</tmpl_if>
<h1>
<tmpl_if channel.link>
<a href="<tmpl_var channel.link>" target="_blank"><tmpl_var channel.title></a>
<tmpl_else>
<tmpl_var channel.title>
</tmpl_if>
</h1>
<tmpl_if channel.description>
<tmpl_var channel.description><p />
</tmpl_if>
<tmpl_loop item_loop>
<tmpl_if new_rss_site>
<!-- We're in a new RSS group. Output the header. -->
<h2><a href="<tmpl_var site_link>" target="_blank"><tmpl_var site_title></a></h2>
</tmpl_if>
<li>
<tmpl_if link>
<a href="<tmpl_var link>" target="_blank"><tmpl_var title></a>
<tmpl_else>
<tmpl_var title>
</tmpl_if>
<tmpl_if description>
- <tmpl_var description>
</tmpl_if>
<b><tmpl_var site_title></b>
<br>
</tmpl_loop>|;
my $import=WebGUI::Asset->getImportNode;
$import->addChild(
{
className=>'WebGUI::Asset::Template',
title=>'Default Grouped Aggregate Feeds',
namespace=>'SyndicatedContent',
menuTitle=>'Default Grouped Aggregate Feeds',
url=>'templates/syndicatedcontent/default_grouped_feeds',
ownerUserID=>3,
groupIdView=>7,
groupIdEdit=>4,
isHidden=>1,
template=>$template
},'DPUROtmpl0000000000001'
)->commit;
}
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sub insertXSLTSheets{
print "\tInserting syndicated content XSLT\n" unless ($quiet);
my $import=WebGUI::Asset->getImportNode;
my $folder=$import->addChild(
{
className=>'WebGUI::Asset::Wobject::Folder',
title=>'Syndicated Content XSLT',
menuTitle=>'Syndicated Content XSLT',
url=>'xslt',
startDate=>time(),
endDate=>time()+ 60*60*24*365*10,
groupEditId=>4,
groupViewId=>2
}
);
$folder->commit;
add_090xslt($folder);
add_091xslt($folder);
add_10xslt($folder);
add_20xslt($folder);
}
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sub add_090xslt{
my $folder=shift;
my $snippet090=q|<?xml version="1.0"?>
<!--
Based on XSLT stylesheets originally designed by Rich Manalang (http://manalang.com)
This XSLT sheet will convert any valid RSS 0.9 feed into basic HTML.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foo="http://my.netscape.com/rdf/simple/0.9/">
<xsl:output method="html"/>
<xsl:template match="/">
<style>
<xsl:comment>
.syndication-content-area {
}
.syndication-title {
font-size: 1.1em;
font-weight: bold;
}
.syndication-description {
font-size: .9em;
margin: 0 0 10px 0;
}
.syndication-list {
font-size: .8em;
margin:0 0 0 20px;
}
.syndication-list-item {
margin: 0 0 5px 0;
}
.syndication-list-item a,
.syndication-list-item a:link {
color: blue;
}
.syndication-list-item a:active,
.syndication-list-item a:hover {
color: red;
}
li.syndication-list-item{
padding-bottom: .2em;
background-color: #e4e4e4;
}
.syndication-list-item a:visited {
color: black;
text-decoration: none;
}
.syndication-list-item-date {
font-size: .8em;
}
.syndication-list-item-description {
font-size: .9em;
}
</xsl:comment>
</style>
<xsl:apply-templates select="/rdf:RDF/foo:channel"/>
</xsl:template>
<xsl:template match="/rdf:RDF/foo:channel">
You're viewing an <a href="http://www.purplepages.ie/RSS/netscape/rss0.90.html">RSS version 0.9 feed</a>. Please use an RSS feed reader to view this content as intended.
<div class="syndication-content-area">
<div class="syndication-title">
<xsl:value-of select="foo:title"/>
</div>
<div class="syndication-description">
<xsl:value-of select="foo:description"/>
</div>
<ul class="syndication-list">
<xsl:apply-templates select="/rdf:RDF/foo:item"/>
</ul>
</div>
</xsl:template>
<xsl:template match="/rdf:RDF/foo:item">
<li class="syndication-list-item">
<a href="{foo:link}" title="{foo:description}">
<xsl:value-of select="foo:title"/>
</a>
</li>
</xsl:template>
</xsl:stylesheet>|;
my $snippet=$folder->addChild(
{
className=>'WebGUI::Asset::Snippet',
title=>'RSS 0.9 XSLT Stylesheet',
menuTitle=>'RSS 0.9 XSLT ',
url=>'xslt/rss0.9.xsl',
mimeType=>'application/xml',
startDate=>time(),
endDate=>time()+ 60*60*24*365*10,
groupEditId=>4,
groupViewId=>2,
snippet=>$snippet090
},'SynConXSLT000000000001'
);
$snippet->commit;
}
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sub add_091xslt{
my $folder=shift;
my $snippet091=q|<?xml version="1.0"?>
<!--
Title: RSS 0.91, 0.92, 0.93 XSL Template
Author: Rich Manalang (http://manalang.com)
Description: This sample XSLT will convert any valid RSS 0.91, 0.92, or 0.93 feed to HTML.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wfw="http://wellformedweb.org/CommentAPI/">
<xsl:output method="html"/>
<xsl:template match="/">
<style>
<xsl:comment>
.syndication-content-area {
}
.syndication-title {
font-size: 1.1em;
font-weight: bold;
}
.syndication-description {
font-size: .9em;
margin: 0 0 10px 0;
}
.syndication-list {
font-size: .8em;
margin:0 0 0 20px;
}
li.syndication-list-item{
padding-bottom: .2em;
background-color: #e4e4e4;
}
.syndication-list-item {
margin: 0 0 5px 0;
}
.syndication-list-item a,
.syndication-list-item a:link {
color: blue;
}
.syndication-list-item a:active,
.syndication-list-item a:hover {
color: red;
}
.syndication-list-item a:visited {
color: black;
text-decoration: none;
}
.syndication-list-item-date {
font-size: .8em;
}
.syndication-list-item-description {
font-size: .9em;
}
</xsl:comment>
</style>
<xsl:apply-templates select="/rss/channel"/>
</xsl:template>
<xsl:template match="/rss/channel">
<div class="syndication-content-area">
You're viewing an <a href="http://backend.userland.com/rss091">RSS version 0.91 feed</a>. Please use an RSS feed reader to view this content as intended.
<div class="syndication-title">
<xsl:value-of select="title"/>
</div>
<div class="syndication-description">
<xsl:value-of select="description"/>
</div>
<ul class="syndication-list">
<xsl:apply-templates select="item"/>
</ul>
</div>
</xsl:template>
<xsl:template match="/rss/channel/item">
<li class="syndication-list-item">
<a href="{link}" title="{description}">
<xsl:value-of select="title"/>
</a>
<div class="syndication-list-item-description">
<xsl:value-of select="description"/>
</div>
</li>
</xsl:template>
</xsl:stylesheet>|;
my $snippet=$folder->addChild(
{
className=>'WebGUI::Asset::Snippet',
title=>'RSS 0.91 XSLT Stylesheet',
menuTitle=>'RSS 0.91 XSLT',
url=>'xslt/rss0.91.xsl',
mimeType=>'application/xml',
startDate=>time(),
endDate=>time()+ 60*60*24*365*10,
groupEditId=>4,
groupViewId=>2,
snippet=>$snippet091
},'SynConXSLT000000000002'
);
$snippet->commit;
}
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sub add_10xslt{
my $folder=shift;
my $snippet10=q|<?xml version="1.0" encoding="utf-8"?>
<!--
Title: RSS 1.0 XSL Template
Author: Rich Manalang (http://manalang.com)
Description: This sample XSLT will convert any valid RSS 1.0 feed to HTML.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foo="http://purl.org/rss/1.0/">
<xsl:output method="html"/>
<xsl:template match="/">
<style>
<xsl:comment>
.syndication-content-area {
}
.syndication-title {
font-size: 1.1em;
font-weight: bold;
}
.syndication-description {
font-size: .9em;
margin: 0 0 10px 0;
}
.syndication-list {
font-size: .8em;
margin:0 0 0 20px;
}
.syndication-list-item {
margin: 0 0 5px 0;
}
li.syndication-list-item{
padding-bottom: .2em;
background-color: #e4e4e4;
}
.syndication-list-item a,
.syndication-list-item a:link {
color: blue;
}
.syndication-list-item a:active,
.syndication-list-item a:hover {
color: red;
}
.syndication-list-item a:visited {
color: black;
text-decoration: none;
}
.syndication-list-item-date {
font-size: .8em;
}
.syndication-list-item-description {
font-size: .9em;
}
</xsl:comment>
</style>
<xsl:apply-templates select="/rdf:RDF/foo:channel"/>
</xsl:template>
<xsl:template match="/rdf:RDF/foo:channel">
<div class="syndication-content-area">
You're viewing an <a href="http://web.resource.org/rss/1.0/">RSS version 1.0 feed</a>. Please use an RSS feed reader to view this content as intended.
<div class="syndication-title">
<xsl:value-of select="foo:title"/>
</div>
<div class="syndication-description">
<xsl:value-of select="foo:description"/>
</div>
<ul class="syndication-list">
<xsl:apply-templates select="/rdf:RDF/foo:item"/>
</ul>
</div>
</xsl:template>
<xsl:template match="/rdf:RDF/foo:item">
<li class="syndication-list-item">
<a href="{foo:link}" title="{foo:description}">
<xsl:value-of select="foo:title"/>
</a>
<span class="syndication-list-item-date">
(
<xsl:value-of select="dc:date"/>)
</span>
<div class="syndication-list-item-description">
<xsl:value-of select="foo:description"/>
</div>
</li>
</xsl:template>
</xsl:stylesheet>
|;
my $snippet=$folder->addChild(
{
className=>'WebGUI::Asset::Snippet',
title=>'RSS 1.0 XSLT Stylesheet',
menuTitle=>'RSS 1.0 XSLT',
mimeType=>'application/xml',
url=>'xslt/rss1.0.xsl',
startDate=>time(),
endDate=>time()+ 60*60*24*365*10,
groupEditId=>4,
groupViewId=>2,
snippet=>$snippet10
},'SynConXSLT000000000003'
);
$snippet->commit;
}
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sub add_20xslt{
my $folder=shift;
my $snippet20=q|<?xml version="1.0"?>
<!--
Title: RSS 2.0 XSL Template
Author: Rich Manalang (http://manalang.com)
Description: This sample XSLT will convert any valid RSS 2.0 feed to HTML.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wfw="http://wellformedweb.org/CommentAPI/">
<xsl:output method="html"/>
<xsl:template match="/">
<style>
<xsl:comment>
.syndication-content-area {
}
.syndication-title {
font-size: 1.1em;
font-weight: bold;
}
.syndication-description {
font-size: .9em;
margin: 0 0 10px 0;
}
.syndication-list {
font-size: .8em;
margin:0 0 0 20px;
}
.syndication-list-item {
margin: 0 0 5px 0;
}
li.syndication-list-item{
padding-bottom: .2em;
background-color: #e4e4e4;
}
.syndication-list-item a,
.syndication-list-item a:link {
color: blue;
}
.syndication-list-item a:active,
.syndication-list-item a:hover {
color: red;
}
.syndication-list-item a:visited {
color: black;
text-decoration: none;
}
.syndication-list-item-date {
font-size: .8em;
}
.syndication-list-item-description {
font-size: .9em;
}
</xsl:comment>
</style>
<xsl:apply-templates select="/rss/channel"/>
</xsl:template>
<xsl:template match="/rss/channel">
<div class="syndication-content-area">
You're viewing an <a href="http://blogs.law.harvard.edu/tech/rss">RSS version 2.0 feed</a>. Please use an RSS feed reader to view this content as intended.
<div class="syndication-title">
<xsl:value-of select="title"/>
</div>
<div class="syndication-description">
<xsl:value-of select="description"/>
</div>
<ul class="syndication-list">
<xsl:apply-templates select="item"/>
</ul>
</div>
</xsl:template>
<xsl:template match="/rss/channel/item">
<li class="syndication-list-item">
<a href="{link}" title="{description}">
<xsl:value-of select="title"/>
</a>
<span class="syndication-list-item-date">
(<xsl:value-of select="pubDate"/>)
</span>
<div class="syndication-list-item-description">
<xsl:value-of select="description"/>
</div>
</li>
</xsl:template>
</xsl:stylesheet>|;
my $snippet=$folder->addChild(
{
className=>'WebGUI::Asset::Snippet',
title=>'RSS 2.0 XSLT Stylesheet',
menuTitle=>'RSS 2.0 XSLT',
url=>'xslt/rss2.0.xsl',
mimeType=>'application/xml',
startDate=>time(),
endDate=>time()+ 60*60*24*365*10,
groupEditId=>4,
groupViewId=>2,
snippet=>$snippet20
},'SynConXSLT000000000004'
);
$snippet->commit;
}

View file

@ -1,69 +0,0 @@
my $toVersion = "6.7.1";
$|=1; #disable output buffering
use lib "../../lib";
use File::Path;
use Getopt::Long;
use strict;
use WebGUI::Asset;
use WebGUI::Asset::Wobject::Folder;
use WebGUI::Asset::Snippet;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Group;
my $configFile;
my $quiet;
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
WebGUI::Session::refreshUserInfo(3);
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
fixForumRichEdit();
fixMissingThreadData();
WebGUI::Session::close();
#-------------------------------------------------
sub fixForumRichEdit {
print "\tFixing the forum rich editor properties.\n" unless ($quiet);
my $validElements = 'a[name|href|target|title],strong/b[class],em/i[class],strike[class],u[class],p[dir|class|align],ol,ul,li,br,img[class|src|border=0|alt|title|hspace|vspace|width|height|align],sub,sup,blockquote[dir|style],table[border=0|cellspacing|cellpadding|width|height|class|align],tr[class|rowspan|width|height|align|valign],td[dir|class|colspan|rowspan|width|height|align|valign],div[dir|class|align],span[class|align],pre[class|align],address[class|align],h1[dir|class|align],h2[dir|class|align],h3[dir|class|align],h4[dir|class|align],h5[dir|class|align],h6[dir|class|align],hr';
WebGUI::SQL->write("update RichEdit set validElements=".quote($validElements)." where assetId='PBrichedit000000000002'");
WebGUI::SQL->write("update assetData set endDate=".(time()+60*60*24*365*20)." where assetId='PBrichedit000000000002'");
}
#-------------------------------------------------
sub fixMissingThreadData {
print "\tFixing missing thread data.\n" unless ($quiet);
my $sth = WebGUI::SQL->read("select assetId from Post where threadId=''");
while (my ($assetId) = $sth->array) {
my $threadId = getThreadId($assetId);
my $sql = "update Post set threadId=".quote($threadId)." where assetId=".quote($assetId);
WebGUI::SQL->write($sql);
}
$sth->finish;
my $sth = WebGUI::SQL->read("select assetId from assetData where ownerUserId=''");
while (my ($assetId) = $sth->array) {
my ($userId, $viewGroup, $editGroup, $startDate, $endDate) = WebGUI::SQL->quickArray("select ownerUserId,groupIdView,groupIdEdit,startDate,endDate from assetData where assetId=".quote($assetId)." order by revisionDate asc limit 1");
my $sql = "update assetData set ownerUserId=".quote($userId).", groupIdView=".quote($viewGroup).", groupIdEdit=".quote($editGroup).", startDate=".quote($startDate).", endDate=".quote($endDate)." where assetId=".quote($assetId);
WebGUI::SQL->write($sql);
}
$sth->finish;
}
#-------------------------------------------------
sub getThreadId {
my $assetId = shift;
my ($parentId, $className) = WebGUI::SQL->quickArray("select parentId, className from asset where assetId=".quote($assetId));
return $assetId if ($className eq 'WebGUI::Asset::Post::Thread');
return undef if ($parentId eq 'PBasset000000000000001');
return getThreadId($parentId);
}

View file

@ -1,925 +0,0 @@
use lib "../../lib";
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Asset;
my $toVersion = "6.7.2";
my $configFile;
my $quiet;
start();
fixTimeFields();
fixSpelling();
fixCSTemplate();
speedUpAdminConsole();
removeOldFiles();
updatePageTemplates();
fixSurveyTemplate();
finish();
#-------------------------------------------------
sub fixSurveyTemplate {
print "\tFixing survey template.\n" unless ($quiet);
my $template = <<END;
<a name="<tmpl_var assetId>"></a>
<tmpl_if session.var.adminOn>
<p><tmpl_var controls></p>
</tmpl_if>
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<tmpl_var description><p />
</tmpl_if>
<tmpl_if user.canTakeSurvey>
<tmpl_if response.isComplete>
<tmpl_if mode.isSurvey>
<tmpl_var thanks.survey.label>
<tmpl_else>
<tmpl_var thanks.quiz.label>
<div align="center">
<b><tmpl_var questions.correct.count.label>:</b> <tmpl_var questions.correct.count> / <tmpl_var questions.total>
<br />
<b><tmpl_var questions.correct.percent.label>:</b><tmpl_var questions.correct.percent>%
</div>
</tmpl_if>
<tmpl_if user.canRespondAgain>
<br /> <br /> <a href="<tmpl_var start.newResponse.url>"><tmpl_var start.newResponse.label></a>
</tmpl_if>
<tmpl_else>
<tmpl_if response.id>
<tmpl_var form.header>
<table width="100%" cellpadding="3" cellspacing="0" border="0" class="content">
<tr>
<td valign="top">
<tmpl_loop question_loop>
<p><tmpl_var question.question></p>
<tmpl_var question.answer.label><br />
<tmpl_var question.answer.field><br />
<br />
<tmpl_if question.allowComment>
<tmpl_var question.comment.label><br />
<tmpl_var question.comment.field><br />
</tmpl_if>
</tmpl_loop>
</td>
<td valign="top" nowrap="1">
<b><tmpl_var questions.sofar.label>:</b> <tmpl_var questions.sofar.count> / <tmpl_var questions.total> <br />
<tmpl_unless mode.isSurvey>
<b><tmpl_var questions.correct.count.label>:</b> <tmpl_var questions.correct.count> / <tmpl_var questions.sofar.count><br />
<b><tmpl_var questions.correct.percent.label>:</b><tmpl_var questions.correct.percent>% / 100%<br />
</tmpl_unless>
</td>
</tr>
</table>
<div align="center"><tmpl_var form.submit></div>
<tmpl_var form.footer>
<tmpl_else>
<a href="<tmpl_var start.newResponse.url>"><tmpl_var start.newResponse.label></a>
</tmpl_if>
</tmpl_if>
<tmpl_else>
<tmpl_if mode.isSurvey>
<tmpl_var survey.noprivs.label>
<tmpl_else>
<tmpl_var quiz.noprivs.label>
</tmpl_if>
</tmpl_if>
<br />
<br />
<tmpl_if user.canViewReports>
<a href="<tmpl_var report.gradebook.url>"><tmpl_var report.gradebook.label></a>
&bull;
<a href="<tmpl_var report.overview.url>"><tmpl_var report.overview.label></a>
&bull;
<a href="<tmpl_var delete.all.responses.url>"><tmpl_var delete.all.responses.label></a>
<br />
<a href="<tmpl_var export.answers.url>"><tmpl_var export.answers.label></a>
&bull;
<a href="<tmpl_var export.questions.url>"><tmpl_var export.questions.label></a>
&bull;
<a href="<tmpl_var export.responses.url>"><tmpl_var export.responses.label></a>
&bull;
<a href="<tmpl_var export.composite.url>"><tmpl_var export.composite.label></a>
</tmpl_if>
<tmpl_if session.var.adminOn>
<p>
<a href="<tmpl_var section.add.url>"><tmpl_var section.add.label></a>
</p>
<p>
<a href="<tmpl_var question.add.url>"><tmpl_var question.add.label></a>
</p>
<tmpl_loop section.edit_loop>
<tmpl_var section.edit.controls>
<tmpl_var section.edit.sectionName><br /><br />
<tmpl_loop section.questions_loop>
&nbsp;&nbsp;<tmpl_var question.edit.controls>
<tmpl_var question.edit.question>
<br />
</tmpl_loop>
</tmpl_loop>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000061","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
}
#-------------------------------------------------
sub updatePageTemplates {
print "\tMaking page templates float better in IE.\n" unless ($quiet);
# news
my $template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
<!-- begin position 1 -->
<div>
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 1 -->
<div style="clear: both;">&nbsp;</div>
<div>
<!-- begin position 2 -->
<div style="width: 49%; float: left;">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 2 -->
<!-- begin position 3 -->
<div style="width: 49%; float: left;">
<tmpl_if showAdmin>
<table border="0" id="position3" class="content"><tbody>
</tmpl_if>
<tmpl_loop position3_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 3 -->
</div>
<div style="clear: both;">&nbsp;</div>
<!-- begin position 4 -->
<div>
<tmpl_if showAdmin>
<table border="0" id="position4" class="content"><tbody>
</tmpl_if>
<tmpl_loop position4_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 4 -->
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000094","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# side by side
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
<div style="clear: both;">&nbsp;</div>
<div>
<!-- begin position 1 -->
<div style="width: 49%; float: left;">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 1 -->
<!-- begin position 2 -->
<div style="width: 49%; float: left;">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 2 -->
</div>
<div style="clear: both;">&nbsp;</div>
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000135","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# left column
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
<div style="clear: both;">&nbsp;</div>
<div>
<!-- begin position 1 -->
<div style="width: 33%; float: left;">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 1 -->
<!-- begin position 2 -->
<div style="width: 65%; float: left;">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 2 -->
</div>
<div style="clear: both;">&nbsp;</div>
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000125","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# right column
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
<div style="clear: both;">&nbsp;</div>
<div>
<!-- begin position 1 -->
<div style="width: 65%; float: left;">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 1 -->
<!-- begin position 2 -->
<div style="width: 33%; float: left;">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 2 -->
</div>
<div style="clear: both;">&nbsp;</div>
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000131","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# one over three
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
<!-- begin position 1 -->
<div>
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 1 -->
<div style="clear: both;">&nbsp;</div>
<div>
<!-- begin position 2 -->
<div style="width: 32%; float: left;">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 2 -->
<!-- begin position 3 -->
<div style="width: 33%; float: left;">
<tmpl_if showAdmin>
<table border="0" id="position3" class="content"><tbody>
</tmpl_if>
<tmpl_loop position3_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 3 -->
<!-- begin position 4 -->
<div style="width: 32%; float: left;">
<tmpl_if showAdmin>
<table border="0" id="position4" class="content"><tbody>
</tmpl_if>
<tmpl_loop position4_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 4 -->
</div>
<div style="clear: both;">&nbsp;</div>
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000109","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# three over one
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
<div style="clear: both;">&nbsp;</div>
<div>
<!-- begin position 1 -->
<div style="width: 32%; float: left;">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 1 -->
<!-- begin position 2 -->
<div style="width: 33%; float: left;">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 2 -->
<!-- begin position 3 -->
<div style="width: 32%; float: left;">
<tmpl_if showAdmin>
<table border="0" id="position3" class="content"><tbody>
</tmpl_if>
<tmpl_loop position3_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 3 -->
</div>
<div style="clear: both;">&nbsp;</div>
<!-- begin position 4 -->
<div>
<tmpl_if showAdmin>
<table border="0" id="position4" class="content"><tbody>
</tmpl_if>
<tmpl_loop position4_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 4 -->
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000118","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
}
#-------------------------------------------------
sub removeOldFiles {
print "\tRemoving files that are no longer needed.\n" unless ($quiet);
unlink("../../lib/WebGUI/Search.pm");
}
#-------------------------------------------------
sub speedUpAdminConsole {
print "\tMaking admin console load faster.\n" unless ($quiet);
my $template = <<END;
^StyleSheet(^Extras;/adminConsole/adminConsole.css);
^JavaScript(^Extras;/adminConsole/adminConsole.js);
<div id="application_title">
<tmpl_var application.title>
</div>
<div id="application_workarea">
<tmpl_var application.workArea>
</div>
<div id="console_workarea">
<div class="adminConsoleSpacer">
&nbsp;
</div>
<tmpl_loop application_loop>
<tmpl_if canUse>
<div class="adminConsoleApplication">
<a href="<tmpl_var url>"><img src="<tmpl_var icon>" border="0" title="<tmpl_var title>" alt="<tmpl_var title>" /></a><br />
<a href="<tmpl_var url>"><tmpl_var title></a>
</div>
</tmpl_if>
</tmpl_loop>
<div class="adminConsoleSpacer">
&nbsp;
</div>
</div>
<div class="adminConsoleMenu">
<div id="adminConsoleMainMenu" class="adminConsoleMainMenu">
<div id="console_toggle_on">
<a href="#" onClick="toggleAdminConsole()"><tmpl_var toggle.on.label></a><br />
</div>
<div id="console_toggle_off">
<a href="#" onClick="toggleAdminConsole()"><tmpl_var toggle.off.label></a><br />
</div>
</div>
<div id="adminConsoleApplicationSubmenu" class="adminConsoleApplicationSubmenu">
<tmpl_loop submenu_loop>
<a href="<tmpl_var url>" <tmpl_var extras>><tmpl_var label></a><br />
</tmpl_loop>
</div>
<div id="adminConsoleUtilityMenu" class="adminConsoleUtilityMenu">
<a href="<tmpl_var backtosite.url>"><tmpl_var backtosite.label></a><br />
^AdminToggle;<br />
^LoginToggle;<br />
</div>
</div>
<div id="console_title">
<tmpl_var console.title>
</div>
<div id="application_help">
<tmpl_if help.url>
<a href="<tmpl_var help.url>" target="_blank"><img src="^Extras;/adminConsole/small/help.gif" alt="?" border="0" /></a>
</tmpl_if>
</div>
<div id="application_icon">
<img src="<tmpl_var application.icon>" border="0" title="<tmpl_var application.title>" alt="<tmpl_var application.title>" />
</div>
<div class="adminConsoleTitleIconMedalian">
<img src="^Extras;/adminConsole/medalian.gif" border="0" alt="*" />
</div>
<div id="console_icon">
<img src="<tmpl_var console.icon>" border="0" title="<tmpl_var console.title>" alt="<tmpl_var console.title>" />
</div>
<script type="text/javascript">
initAdminConsole(<tmpl_if application.title>true<tmpl_else>false</tmpl_if>,<tmpl_if submenu_loop>true<tmpl_else>false</tmpl_if>);
</script>
END
my $asset = WebGUI::Asset->new("PBtmpl0000000000000001","WebGUI::Asset::Template");
$asset->addRevision({template=>$template})->commit;
}
#-------------------------------------------------
sub fixTimeFields {
print "\tFixing time fields.\n" unless ($quiet);
WebGUI::SQL->write("update DataForm_field set type=".quote('TimeField')." where type=".quote('time'));
WebGUI::SQL->write("update userProfileField set dataType=".quote('TimeField')." where dataType=".quote('time'));
}
#-------------------------------------------------
sub fixCSTemplate {
print "\tFixing CS Search template.\n" unless ($quiet);
my $asset = WebGUI::Asset->new("PBtmpl0000000000000031","WebGUI::Asset::Template");
my $template = $asset->get("template");
$template =~ s/<tmpl_var date>/<tmpl_var dateSubmitted.human>/ixsg;
$template =~ s/<tmpl_var time>/<tmpl_var timeSubmitted.human>/ixsg;
$asset->addRevision({template=>$template})->commit;
}
#-------------------------------------------------
sub fixSpelling {
print "\tFixing a few spelling problems.\n" unless ($quiet);
my $asset = WebGUI::Asset->new("PBtmplCP00000000000001","WebGUI::Asset::Template");
$asset->addRevision({url=>"default_product_template"})->commit;
$asset = WebGUI::Asset->new("PBtmpl0000000000000134","WebGUI::Asset::Template");
my $template = $asset->get("template");
$template =~ s/spesify/specify/ixsg;
$asset->addRevision({template=>$template})->commit;
}
#-------------------------------------------------
sub start {
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
WebGUI::Session::refreshUserInfo(3);
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
}
#-------------------------------------------------
sub finish {
WebGUI::Session::close();
}

View file

@ -1,266 +0,0 @@
use lib "../../lib";
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::SQL;
my $toVersion = "6.7.3";
my $configFile;
my $quiet;
start();
deleteOldHelpFiles();
setGuidsBinary();
finish();
#-------------------------------------------------
sub setGuidsBinary {
print "\tSetting GUIDs to have binary flag in database.\n" unless ($quiet);
my @sql = (
"alter table asset change assetId assetId varchar(22) binary not null",
"alter table asset change parentId parentId varchar(22) binary not null",
"alter table asset change createdBy createdBy varchar(22) binary not null default '3'",
"alter table asset change stateChangedBy stateChangedBy varchar(22) binary not null default '3'",
"alter table asset change isLockedBy isLockedBy varchar(22) binary",
"alter table wobject change assetId assetId varchar(22) binary not null",
"alter table wobject change printableStyleTemplateId printableStyleTemplateId varchar(22) binary not null",
"alter table wobject change styleTemplateId styleTemplateId varchar(22) binary not null",
"alter table users change userId userId varchar(22) binary not null",
"alter table users change referringAffiliate referringAffiliate varchar(22) binary not null",
"alter table userSessionScratch change sessionId sessionId varchar(22) binary not null",
"alter table userSession change sessionId sessionId varchar(22) binary not null",
"alter table userSession change userId userId varchar(22) binary not null",
"alter table userLoginLog change userId userId varchar(22) binary not null",
"alter table userProfileCategory change profileCategoryId profileCategoryId varchar(22) binary not null",
"alter table userProfileData change userId userId varchar(22) binary not null",
"alter table userProfileField change profileCategoryId profileCategoryId varchar(22) binary not null",
"alter table template change assetId assetId varchar(22) binary not null",
"alter table transaction change transactionId transactionId varchar(22) binary not null",
"alter table transaction change userId userId varchar(22) binary not null",
"alter table transactionItem change transactionId transactionId varchar(22) binary not null",
"alter table subscriptionCode change batchId batchId varchar(22) binary not null",
"alter table subscriptionCode change code code varchar(64) binary not null",
"alter table subscriptionCode change usedBy usedBy varchar(22) binary not null",
"alter table subscriptionCodeBatch change batchId batchId varchar(22) binary not null",
"alter table subscriptionCodeBatch change subscriptionId subscriptionId varchar(22) binary not null",
"alter table subscriptionCodeSubscriptions change subscriptionId subscriptionId varchar(22) binary not null",
"alter table subscriptionCodeSubscriptions change code code varchar(64) binary not null",
"alter table subscription change subscriptionId subscriptionId varchar(22) binary not null",
"alter table subscription change subscriptionGroup subscriptionGroup varchar(22) binary not null",
"alter table snippet change assetId assetId varchar(22) binary not null",
"alter table shoppingCart change sessionId sessionId varchar(22) binary not null",
"alter table shoppingCart change itemId itemId varchar(64) binary not null",
"alter table transactionItem change itemId itemId varchar(64) binary not null",
"alter table replacements change replacementId replacementId varchar(22) binary not null",
"alter table redirect change assetId assetId varchar(22) binary not null",
"alter table products change productId productId varchar(22) binary not null",
"alter table products change templateId templateId varchar(22) binary not null",
"alter table productVariants change variantId variantId varchar(22) binary not null",
"alter table productVariants change productId productId varchar(22) binary not null",
"alter table passiveProfileAOI change userId userId varchar(22) binary not null",
"alter table passiveProfileAOI change fieldId fieldId varchar(22) binary not null",
"alter table passiveProfileLog change passiveProfileLogId passiveProfileLogId varchar(22) binary not null",
"alter table passiveProfileLog change userId userId varchar(22) binary not null",
"alter table passiveProfileLog change sessionId sessionId varchar(22) binary not null",
"alter table passiveProfileLog change wobjectId assetId varchar(22) binary not null",
"alter table passiveProfileLog change dateOfEntry dateOfEntry bigint not null",
"alter table productParameterOptions change optionId optionId varchar(22) binary not null",
"alter table productParameterOptions change parameterId parameterId varchar(22) binary not null",
"alter table productParameters change parameterId parameterId varchar(22) binary not null",
"alter table productParameters change productId productId varchar(22) binary not null",
"alter table metaData_values change fieldId fieldId varchar(22) binary not null",
"alter table metaData_values change assetId assetId varchar(22) binary not null",
"alter table metaData_properties change fieldId fieldId varchar(22) binary not null",
"alter table messageLog change messageLogId messageLogId varchar(22) binary not null",
"alter table messageLog change userId userId varchar(22) binary not null",
"alter table ldapLink change ldapLinkId ldapLinkId varchar(22) binary not null",
"alter table ldapLink change ldapAccountTemplate ldapAccountTemplate varchar(22) binary not null",
"alter table ldapLink change ldapCreateAccountTemplate ldapCreateAccountTemplate varchar(22) binary not null",
"alter table ldapLink change ldapLoginTemplate ldapLoginTemplate varchar(22) binary not null",
"alter table groups change groupId groupId varchar(22) binary not null",
"alter table groups change databaseLinkId databaseLinkId varchar(22) binary not null",
"alter table karmaLog change dateModified dateModified bigint not null",
"alter table karmaLog change userId userId varchar(22) binary not null",
"alter table databaseLink change databaseLinkId databaseLinkId varchar(22) binary not null",
"alter table groupGroupings change groupId groupId varchar(22) binary not null",
"alter table groupGroupings change inGroup inGroup varchar(22) binary not null",
"alter table groupings change groupId groupId varchar(22) binary not null",
"alter table groupings change expireDate expireDate bigint not null default 2114402400",
"alter table groupings change userId userId varchar(22) binary not null",
"alter table authentication change userId userId varchar(22) binary not null",
"alter table assetVersionTag change tagId tagId varchar(22) binary not null",
"alter table assetVersionTag change createdBy createdBy varchar(22) binary not null",
"alter table assetVersionTag change committedBy committedBy varchar(22) binary not null",
"alter table assetHistory change assetId assetId varchar(22) binary not null",
"alter table assetHistory change userId userId varchar(22) binary not null",
"alter table assetData change assetId assetId varchar(22) binary not null",
"alter table assetData change revisedBy revisedBy varchar(22) binary not null",
"alter table assetData change tagId tagId varchar(22) binary not null",
"alter table assetData change ownerUserId ownerUserId varchar(22) binary not null",
"alter table assetData change groupIdEdit groupIdEdit varchar(22) binary not null",
"alter table assetData change groupIdView groupIdView varchar(22) binary not null",
"alter table Thread change assetId assetId varchar(22) binary not null",
"alter table Thread change lastPostId lastPostId varchar(22) binary not null",
"alter table Thread change subscriptionGroupId subscriptionGroupId varchar(22) binary not null",
"alter table WSClient change assetId assetId varchar(22) binary not null",
"alter table WSClient change templateId templateId varchar(22) binary not null",
"alter table SyndicatedContent change assetId assetId varchar(22) binary not null",
"alter table SyndicatedContent change templateId templateId varchar(22) binary not null",
"alter table Survey_section change Survey_id Survey_id varchar(22) binary not null",
"alter table Survey_section change Survey_sectionId Survey_sectionId varchar(22) binary not null",
"alter table Survey_response change Survey_id Survey_id varchar(22) binary not null",
"alter table Survey_response change startDate startDate bigint not null",
"alter table Survey_response change endDate endDate bigint not null",
"alter table Survey_response change Survey_responseId Survey_responseId varchar(22) binary not null",
"alter table Survey_question change Survey_id Survey_id varchar(22) binary not null",
"alter table Survey_question change Survey_questionId Survey_questionId varchar(22) binary not null",
"alter table Survey_question change Survey_sectionId Survey_sectionId varchar(22) binary not null",
"alter table Survey_questionResponse change dateOfResponse dateOfResponse bigint not null",
"alter table Survey_questionResponse change Survey_id Survey_id varchar(22) binary not null",
"alter table Survey_questionResponse change Survey_questionId Survey_questionId varchar(22) binary not null",
"alter table Survey_questionResponse change Survey_answerId Survey_answerId varchar(22) binary not null",
"alter table Survey_questionResponse change Survey_responseId Survey_responseId varchar(22) binary not null",
"alter table Survey change assetId assetId varchar(22) binary not null",
"alter table Survey change groupToViewReports groupToViewReports varchar(22) binary not null default '3'",
"alter table Survey change groupToTakeSurvey groupToTakeSurvey varchar(22) binary not null default '2'",
"alter table Survey change responseTemplateId responseTemplateId varchar(22) binary not null",
"alter table Survey change overviewTemplateId overviewTemplateId varchar(22) binary not null",
"alter table Survey change gradebookTemplateId gradebookTemplateId varchar(22) binary not null",
"alter table Survey change templateId templateId varchar(22) binary not null",
"alter table Survey change Survey_id Survey_id varchar(22) binary not null",
"alter table Survey_answer change Survey_id Survey_id varchar(22) binary not null",
"alter table Survey_answer change Survey_questionId Survey_questionId varchar(22) binary not null",
"alter table Survey_answer change Survey_answerId Survey_answerId varchar(22) binary not null",
"alter table Survey_answer change gotoQuestion gotoQuestion varchar(22) binary not null",
"alter table RichEdit change assetId assetId varchar(22) binary not null",
"alter table SQLReport change assetId assetId varchar(22) binary not null",
"alter table SQLReport change templateId templateId varchar(22) binary not null",
"alter table SQLReport change databaseLinkId1 databaseLinkId1 varchar(22) binary not null",
"alter table SQLReport change databaseLinkId2 databaseLinkId2 varchar(22) binary not null",
"alter table SQLReport change databaseLinkId3 databaseLinkId3 varchar(22) binary not null",
"alter table SQLReport change databaseLinkId4 databaseLinkId4 varchar(22) binary not null",
"alter table SQLReport change databaseLinkId5 databaseLinkId5 varchar(22) binary not null",
"alter table Shortcut change assetId assetId varchar(22) binary not null",
"alter table Shortcut change templateId templateId varchar(22) binary not null",
"alter table Shortcut change overrideTemplateId overrideTemplateId varchar(22) binary not null",
"alter table Shortcut change shortcutToAssetId shortcutToAssetId varchar(22) binary not null",
"alter table Product_feature change assetId assetId varchar(22) binary not null",
"alter table Product_feature change Product_featureId Product_featureId varchar(22) binary not null",
"alter table Product_related change assetId assetId varchar(22) binary not null",
"alter table Product_related change relatedAssetId relatedAssetId varchar(22) binary not null",
"alter table Product_specification change Product_specificationId Product_specificationId varchar(22) binary not null",
"alter table Product_specification change assetId assetId varchar(22) binary not null",
"alter table Product change assetId assetId varchar(22) binary not null",
"alter table Product change templateId templateId varchar(22) binary not null",
"alter table Product_accessory change assetId assetId varchar(22) binary not null",
"alter table Product_accessory change accessoryAssetId accessoryAssetId varchar(22) binary not null",
"alter table Product_benefit change assetId assetId varchar(22) binary not null",
"alter table Product_benefit change Product_benefitId Product_benefitId varchar(22) binary not null",
"alter table Post change assetId assetId varchar(22) binary not null",
"alter table Post change threadId threadId varchar(22) binary not null",
"alter table Post change storageId storageId varchar(22) binary not null",
"alter table Post_rating change assetId assetId varchar(22) binary not null",
"alter table Post_rating change userId userId varchar(22) binary not null",
"alter table Post_read change threadId threadId varchar(22) binary not null",
"alter table Post_read change userId userId varchar(22) binary not null",
"alter table Post_read change postId postId varchar(22) binary not null",
"alter table Poll change assetId assetId varchar(22) binary not null",
"alter table Poll change templateId templateId varchar(22) binary not null",
"alter table Poll_answer change assetId assetId varchar(22) binary not null",
"alter table Poll_answer change userId userId varchar(22) binary not null",
"alter table Layout change assetId assetId varchar(22) binary not null",
"alter table Layout change templateId templateId varchar(22) binary not null",
"alter table MessageBoard change assetId assetId varchar(22) binary not null",
"alter table MessageBoard change templateId templateId varchar(22) binary not null",
"alter table Navigation change assetId assetId varchar(22) binary not null",
"alter table Navigation change templateId templateId varchar(22) binary not null",
"alter table ITransact_recurringStatus change initDate initDate bigint not null",
"alter table ITransact_recurringStatus change lastTransaction lastTransaction bigint not null",
"alter table ImageAsset change assetId assetId varchar(22) binary not null",
"alter table FileAsset change assetId assetId varchar(22) binary not null",
"alter table FileAsset change templateId templateId varchar(22) binary not null",
"alter table FileAsset change storageId storageId varchar(22) binary not null",
"alter table Folder change assetId assetId varchar(22) binary not null",
"alter table Folder change templateId templateId varchar(22) binary not null",
"alter table HttpProxy change assetId assetId varchar(22) binary not null",
"alter table HttpProxy change templateId templateId varchar(22) binary not null",
"alter table HttpProxy change cookieJarStorageId cookieJarStorageId varchar(22) binary not null",
"alter table EventsCalendar change assetId assetId varchar(22) binary not null",
"alter table EventsCalendar change templateId templateId varchar(22) binary not null",
"alter table EventsCalendar_event change assetId assetId varchar(22) binary not null",
"alter table EventsCalendar_event change templateId templateId varchar(22) binary not null",
"alter table EventsCalendar_event change EventsCalendar_recurringId EventsCalendar_recurringId varchar(22) binary not null",
"alter table DataForm change assetId assetId varchar(22) binary not null",
"alter table DataForm change templateId templateId varchar(22) binary not null",
"alter table DataForm change emailTemplateId emailTemplateId varchar(22) binary not null",
"alter table DataForm change acknowlegementTemplateId acknowlegementTemplateId varchar(22) binary not null",
"alter table DataForm change listTemplateId listTemplateId varchar(22) binary not null",
"alter table DataForm_entry change assetId assetId varchar(22) binary not null",
"alter table DataForm_entry change DataForm_entryId DataForm_entryId varchar(22) binary not null",
"alter table DataForm_entry change submissionDate submissionDate bigint not null",
"alter table DataForm_entry change userId userId varchar(22) binary not null",
"alter table DataForm_entryData change assetId assetId varchar(22) binary not null",
"alter table DataForm_entryData change DataForm_entryId DataForm_entryId varchar(22) binary not null",
"alter table DataForm_entryData change DataForm_fieldId DataForm_fieldId varchar(22) binary not null",
"alter table DataForm_field change assetId assetId varchar(22) binary not null",
"alter table DataForm_field change DataForm_tabId DataForm_tabId varchar(22) binary not null",
"alter table DataForm_field change DataForm_fieldId DataForm_fieldId varchar(22) binary not null",
"alter table DataForm_tab change assetId assetId varchar(22) binary not null",
"alter table DataForm_tab change DataForm_tabId DataForm_tabId varchar(22) binary not null",
"alter table Article change assetId assetId varchar(22) binary not null",
"alter table Article change templateId templateId varchar(22) binary not null",
"alter table Collaboration change assetId assetId varchar(22) binary not null",
"alter table Collaboration change threadTemplateId threadTemplateId varchar(22) binary not null",
"alter table Collaboration change postGroupId postGroupId varchar(22) binary not null default '2'",
"alter table Collaboration change moderateGroupId moderateGroupId varchar(22) binary not null default '4'",
"alter table Collaboration change collaborationTemplateId collaborationTemplateId varchar(22) binary not null",
"alter table Collaboration change threadTemplateId threadTemplateId varchar(22) binary not null",
"alter table Collaboration change postFormTemplateId postFormTemplateId varchar(22) binary not null",
"alter table Collaboration change searchTemplateId searchTemplateId varchar(22) binary not null",
"alter table Collaboration change notificationTemplateId notificationTemplateId varchar(22) binary not null",
"alter table Collaboration change lastPostId lastPostId varchar(22) binary",
"alter table Collaboration change subscriptionGroupId subscriptionGroupId varchar(22) binary",
"alter table Collaboration change richEditor richEditor varchar(22) binary not null default 'PBrichedit000000000002'"
);
foreach my $query (@sql) {
WebGUI::SQL->write($query);
}
}
#-------------------------------------------------
sub deleteOldHelpFiles {
my @dupes = qw/Article Collaboration DataForm EventsCalendar File Folder Survey HttpProxy
IndexedSearch Image Layout MessageBoard Navigation Poll Post Product
Redirect Shortcut Snippet SQLReport SyndicatedContent Template Thread/;
my $path = "../../lib/WebGUI/";
print "\tDeleting old documentation\n" unless ($quiet);
foreach my $dupe (@dupes) {
print "\tDeleting old documentation for $dupe\n" unless ($quiet);
foreach my $dir ("Help/", "i18n/English/") {
my $file = join '', $path, $dir, $dupe, '.pm';
my $files_deleted = unlink($file);
print("\t\tUnable to delete $file: $!\n") unless $quiet or $files_deleted or $! eq "No such file or directory";
}
}
}
#-------------------------------------------------
sub start {
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
WebGUI::Session::refreshUserInfo(3);
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
}
#-------------------------------------------------
sub finish {
WebGUI::Session::close();
}

View file

@ -1,859 +0,0 @@
use lib "../../lib";
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Asset;
use WebGUI::Setting;
my $toVersion = "6.7.4";
my $configFile;
my $quiet;
start();
updatePageTemplates();
addDebug();
fixFutureDates();
makeQueriesFaster();
readdingIsSystem();
finish();
#-------------------------------------------------
sub readdingIsSystem {
print "\tRe-adding the isSystem flag to the asset table.\n" unless ($quiet);
WebGUI::SQL->write("alter table asset add column isSystem int not null default 0");
WebGUI::SQL->write("update asset set isSystem=1 where assetId='PBasset000000000000001'");
WebGUI::SQL->write("update asset set isSystem=1 where assetId='PBasset000000000000002'");
}
#-------------------------------------------------
sub makeQueriesFaster {
print "\tMaking queries a little faster.\n" unless ($quiet);
WebGUI::SQL->write("alter table assetData add index assetId_url (assetId,url)");
WebGUI::SQL->write("alter table assetData add index assetId_revisionDate_status_tagId (assetId,revisionDate,status,tagId)");
WebGUI::SQL->write("alter table asset add index className_assetId_state (className,assetId,state)");
}
#-------------------------------------------------
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);
WebGUI::Setting::add("debugIp","");
WebGUI::Setting::add("showPerformanceIndicators","0");
}
#-------------------------------------------------
sub updatePageTemplates {
print "\tMaking page templates float better in IE.\n" unless ($quiet);
# news
my $template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
^RawHeadTags(<style type="text/css">
.firstColumn {
float: left;
width: 50%;
}
.secondColumn {
float: left;
width: auto;
max-width: 50%;
}
.endFloat {
clear: both;
}
</style>);
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<!-- begin position 1 -->
<div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 1 -->
<div class="endFloat">&nbsp;</div>
<!-- begin position 2 -->
<div class="firstColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 2 -->
<!-- begin position 3 -->
<div class="firstColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position3" class="content"><tbody>
</tmpl_if>
<tmpl_loop position3_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div> </div>
<!-- end position 3 -->
<div class="endFloat">&nbsp;</div>
<!-- begin position 4 -->
<div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position4" class="content"><tbody>
</tmpl_if>
<tmpl_loop position4_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 4 -->
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000094","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# side by side
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
^RawHeadTags(<style type="text/css">
.firstColumn {
float: left;
width: 50%;
}
.secondColumn {
float: left;
width: auto;
max-width: 50%;
}
.endFloat {
clear: both;
}
</style>);
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<!-- begin position 1 -->
<div class="firstColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 1 -->
<!-- begin position 2 -->
<div class="secondColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 2 -->
<div class="endFloat">&nbsp;</div>
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000135","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# left column
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
^RawHeadTags(<style type="text/css">
.firstColumn {
float: left;
width: 33%;
}
.secondColumn {
float: left;
width: auto;
max-width: 65%;
}
.endFloat {
clear: both;
}
</style>);
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<!-- begin position 1 -->
<div class="firstColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 1 -->
<!-- begin position 2 -->
<div class="secondColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 2 -->
<div class="endFloat">&nbsp;</div>
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000125","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# right column
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
^RawHeadTags(<style type="text/css">
.firstColumn {
float: left;
width: 65%;
}
.secondColumn {
float: left;
width: auto;
max-width: 33%;
}
.endFloat {
clear: both;
}
</style>);
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<!-- begin position 1 -->
<div class="firstColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 1 -->
<!-- begin position 2 -->
<div class="secondColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 2 -->
<div class="endFloat">&nbsp;</div>
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000131","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# one over three
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
^RawHeadTags(<style type="text/css">
.firstColumn {
float: left;
width: 33%;
}
.secondColumn {
float: left;
width: 33%;
}
.thirdColumn {
float: left;
width: auto;
max-width: 33%;
}
.endFloat {
clear: both;
}
</style>);
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<!-- begin position 1 -->
<div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 1 -->
<div class="endFloat">&nbsp;</div>
<!-- begin position 2 -->
<div class="firstColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 2 -->
<!-- begin position 3 -->
<div class="secondColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position3" class="content"><tbody>
</tmpl_if>
<tmpl_loop position3_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 3 -->
<!-- begin position 4 -->
<div class="secondColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position4" class="content"><tbody>
</tmpl_if>
<tmpl_loop position4_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 4 -->
<div class="endFloat">&nbsp;</div>
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000109","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# three over one
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
^RawHeadTags(<style type="text/css">
.firstColumn {
float: left;
width: 33%;
}
.secondColumn {
float: left;
width: 33%;
}
.thirdColumn {
float: left;
width: auto;
max-width: 33%;
}
.endFloat {
clear: both;
}
</style>);
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<!-- begin position 1 -->
<div class="firstColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 1 -->
<!-- begin position 2 -->
<div class="secondColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position2" class="content"><tbody>
</tmpl_if>
<tmpl_loop position2_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 2 -->
<!-- begin position 3 -->
<div class="thirdColumn"><div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position3" class="content"><tbody>
</tmpl_if>
<tmpl_loop position3_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div></div>
<!-- end position 3 -->
<div class="endFloat">&nbsp;</div>
<!-- begin position 4 -->
<div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position4" class="content"><tbody>
</tmpl_if>
<tmpl_loop position4_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<!-- end position 4 -->
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000118","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# three over one
$template = <<END;
<a href="<tmpl_var assetId>"></a>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>">
<td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000054","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
}
#-------------------------------------------------
sub start {
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
WebGUI::Session::refreshUserInfo(3);
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
}
#-------------------------------------------------
sub finish {
WebGUI::Session::close();
}

View file

@ -1,979 +0,0 @@
use lib "../../lib";
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Asset;
use WebGUI::Setting;
my $toVersion = "6.7.5";
my $configFile;
my $quiet;
start();
fixSurveyAnswerDefinition();
fixTemplates();
fixArticles();
sleep(1); # have to wait a second to add these revisions because you can't have two revisions of the same thing in the same second
fixTemplatesExtras();
finish();
#-------------------------------------------------
sub fixSurveyAnswerDefinition {
print "\tFixing definition of survey answers.\n" unless ($quiet);
WebGUI::SQL->write("alter table Survey_answer change gotoQuestion gotoQuestion varchar(22) binary");
}
#-------------------------------------------------
sub fixTemplates {
print "\tFixing templates...\n" unless ($quiet);
# AdminConsole > Admin Console
my $template = <<END;
^StyleSheet(^Extras;adminConsole/adminConsole.css);
^JavaScript(^Extras;adminConsole/adminConsole.js);
<div id="application_title">
<tmpl_var application.title>
</div>
<div id="application_workarea">
<tmpl_var application.workArea>
</div>
<div id="console_workarea">
<div class="adminConsoleSpacer">
&nbsp;
</div>
<tmpl_loop application_loop>
<tmpl_if canUse>
<div class="adminConsoleApplication">
<a href="<tmpl_var url>"><img src="<tmpl_var icon>" border="0" title="<tmpl_var title>" alt="<tmpl_var title>" /></a><br />
<a href="<tmpl_var url>"><tmpl_var title></a>
</div>
</tmpl_if>
</tmpl_loop>
<div class="adminConsoleSpacer">
&nbsp;
</div>
</div>
<div class="adminConsoleMenu">
<div id="adminConsoleMainMenu" class="adminConsoleMainMenu">
<div id="console_toggle_on">
<a href="#" onclick="toggleAdminConsole()"><tmpl_var toggle.on.label></a><br />
</div>
<div id="console_toggle_off">
<a href="#" onclick="toggleAdminConsole()"><tmpl_var toggle.off.label></a><br />
</div>
</div>
<div id="adminConsoleApplicationSubmenu" class="adminConsoleApplicationSubmenu">
<tmpl_loop submenu_loop>
<a href="<tmpl_var url>" <tmpl_var extras>><tmpl_var label></a><br />
</tmpl_loop>
</div>
<div id="adminConsoleUtilityMenu" class="adminConsoleUtilityMenu">
<a href="<tmpl_var backtosite.url>"><tmpl_var backtosite.label></a><br />
^AdminToggle;<br />
^LoginToggle;<br />
</div>
</div>
<div id="console_title">
<tmpl_var console.title>
</div>
<div id="application_help">
<tmpl_if help.url>
<a href="<tmpl_var help.url>" target="_blank"><img src="^Extras;adminConsole/small/help.gif" alt="?" border="0" /></a>
</tmpl_if>
</div>
<div id="application_icon">
<img src="<tmpl_var application.icon>" border="0" title="<tmpl_var application.title>" alt="<tmpl_var application.title>" />
</div>
<div class="adminConsoleTitleIconMedalian">
<img src="^Extras;adminConsole/medalian.gif" border="0" alt="*" />
</div>
<div id="console_icon">
<img src="<tmpl_var console.icon>" border="0" title="<tmpl_var console.title>" alt="<tmpl_var console.title>" />
</div>
<script type="text/javascript">
initAdminConsole(<tmpl_if application.title>true<tmpl_else>false</tmpl_if>,<tmpl_if submenu_loop>true<tmpl_else>false</tmpl_if>);
</script>
END
WebGUI::Asset->new("PBtmpl0000000000000001","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# Article > Default Article
my $template = <<END;
<a name="<tmpl_var assetId>"></a>
<tmpl_if session.var.adminOn>
<p><tmpl_var controls></p>
</tmpl_if>
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if pagination.isFirstPage>
<tmpl_if image.url>
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td class="content">
<img src="<tmpl_var image.url>" align="right" border="0" alt="<tmpl_var image.url>" />
</tmpl_if>
</tmpl_if>
<tmpl_if description>
<tmpl_var description>
</tmpl_if>
<tmpl_if pagination.isLastPage>
<tmpl_if linkUrl>
<tmpl_if linkTitle>
<p />
<a href="<tmpl_var linkUrl>"><tmpl_var linkTitle></a>
</tmpl_if>
</tmpl_if>
<tmpl_var attachment.box>
</tmpl_if>
<tmpl_if pagination.pageCount.isMultiple>
<tmpl_var pagination.previousPage>
&middot;
<tmpl_var pagination.pageList.upTo20>
&middot;
<tmpl_var pagination.nextPage>
</tmpl_if>
<tmpl_if pagination.isFirstPage>
<tmpl_if image.url>
</td></tr></table>
</tmpl_if>
</tmpl_if>
<tmpl_if pagination.isLastPage>
<tmpl_if allowDiscussion>
<p>
<table width="100%" cellspacing="2" cellpadding="1" border="0">
<tr>
<td align="center" width="50%" class="tableMenu"><a href="<tmpl_var replies.URL>"><tmpl_var replies.label> (<tmpl_var replies.count>)</a></td>
<td align="center" width="50%" class="tableMenu"><a href="<tmpl_var post.url>"><tmpl_var post.label></a></td>
</tr>
</table>
</tmpl_if>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000002","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# Layout > Default Page
my $template = <<END;
<a name="<tmpl_var assetId>"></a>
<tmpl_if showAdmin>
<p><tmpl_var controls></p>
</tmpl_if>
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<div class="layoutColumnPadding">
<tmpl_if showAdmin>
<table border="0" id="position1" class="content"><tbody>
</tmpl_if>
<tmpl_loop position1_loop>
<tmpl_if showAdmin>
<tr id="td<tmpl_var id>"><td><div id="td<tmpl_var id>_div" class="dragable">
</tmpl_if>
<div class="content"><tmpl_var dragger.icon><tmpl_var content></div>
<tmpl_if showAdmin>
</div></td></tr>
</tmpl_if>
</tmpl_loop>
<tmpl_if showAdmin>
</tbody></table>
</tmpl_if>
</div>
<tmpl_if showAdmin>
<table><tr id="blank" class="hidden"><td><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</tmpl_if>
END
WebGUI::Asset->new("PBtmpl0000000000000054","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# Macro/AdminBar > DHTML Admin Bar
$template = <<END;
^StyleSheet(^Extras;slidePanel/slidePanel.css);
^JavaScript(^Extras;slidePanel/slidePanel.js);
<script type="text/javascript">
//<![CDATA[
var slider = new createSlidePanelBar("WebGUIAdminBar");
var panel;
panel = new createPanel("adminconsole","Admin Console");
<tmpl_loop adminConsole_loop>
<tmpl_if canUse>panel.addLink("<tmpl_var icon.small>","<tmpl_var title escape=JS>","<tmpl_var url escape=JS>");</tmpl_if>
</tmpl_loop>
slider.addPanel(panel);
panel = new createPanel("clipboard","Clipboard");
<tmpl_loop clipboard_loop>
panel.addLink("<tmpl_var icon.small>","<tmpl_var label escape=JS>","<tmpl_var url escape=JS>");
</tmpl_loop>
slider.addPanel(panel);
panel = new createPanel("packages","Packages");
<tmpl_loop package_loop>
panel.addLink("<tmpl_var icon.small>","<tmpl_var label escape=JS>","<tmpl_var url escape=JS>");
</tmpl_loop>
slider.addPanel(panel);
panel = new createPanel("assets","New Content");
<tmpl_loop container_loop>
panel.addLink("<tmpl_var icon.small>","<tmpl_var label escape=JS>","<tmpl_var url escape=JS>");
</tmpl_loop>
panel.addLink("^Extras;/spacer.gif","<hr>","");
<tmpl_loop contentTypes_loop>
panel.addLink("<tmpl_var icon.small>","<tmpl_var label escape=JS>","<tmpl_var url escape=JS>");
</tmpl_loop>
slider.addPanel(panel);
slider.draw();
//]]>
</script>
END
WebGUI::Asset->new("PBtmpl0000000000000090","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# Navigation > verticalMenu
my $template = <<END;
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<p><tmpl_var description></p>
</tmpl_if>
<tmpl_if session.var.adminOn>
<tmpl_var controls><br />
</tmpl_if>
<span class="verticalMenu">
<tmpl_loop page_loop>
<tmpl_var page.indent><a class="verticalMenu"
<tmpl_if page.newWindow>target="_blank"</tmpl_if> href="<tmpl_var page.url>">
<tmpl_if page.isCurrent>
<span class="selectedMenuItem"><tmpl_var page.menuTitle></span>
<tmpl_else><tmpl_var page.menuTitle></tmpl_if></a><br />
</tmpl_loop>
</span>
END
WebGUI::Asset->new("PBtmpl0000000000000048","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# style > Admin Console
my $template = <<END;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WebGUI <tmpl_var session.webgui.version>-<tmpl_var session.webgui.status> Admin Console</title>
<link rel="icon" href="^Extras;favicon.png" type="image/png" />
<link rel="shortcut icon" href="^Extras;favicon.ico" />
<tmpl_var head.tags>
</head>
<body>
<tmpl_var body.content>
</body>
</html>
END
WebGUI::Asset->new("PBtmpl0000000000000137","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# style > Fail Safe
my $template = <<END;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>^Page("title"); - WebGUI</title>
<tmpl_var head.tags>
<style type="text/css">
.menu {
position: absolute;
top: 25px;
left: 10px;
width: 180px;
font-family: helvetica, arial;
font-size: 12px;
}
.contentArea {
border: 1px solid #cccccc;
margin: 25px 10px 10px 190px;
padding: 5px;
font-family: helvetica, arial;
min-height: 400px;
}
/* Hides from non-ie: the holly hack \*/
* html .adminConsoleWorkArea {
zoom: 1.00;
display: inline;
}
/* End hide from non-ie */
</style>
</head>
<body>
^AdminBar;
<div class="menu">
^AssetProxy(flexmenu);
</div>
<div class="contentArea">
<tmpl_var body.content>
<br />
<br />
<hr />
^LoginToggle; &nbsp; ^a(^@;); &nbsp; ^H; &nbsp; ^AdminToggle;
</div>
</body>
</html>
END
WebGUI::Asset->new("PBtmpl0000000000000060","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# style > Make Page Printable
my $template = <<END;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>^Page(title); - <tmpl_var session.setting.companyName></title>
<link rel="icon" href="^Extras;favicon.png" type="image/png" />
<link rel="shortcut icon" href="^Extras;favicon.ico" />
<tmpl_var head.tags>
<style type="text/css">
.content {
background-color: #ffffff;
color: #000000;
font-family: helvetica, arial;
font-size: 10pt;
padding: 10pt;
}
H1 {
font-family: helvetica, arial;
font-size: 16pt;
}
A {
color: #EF4200;
}
.pagination {
font-family: helvetica, arial;
font-size: 8pt;
text-align: center;
}
.formDescription {
font-family: helvetica, arial;
font-size: 10pt;
font-weight: bold;
}
.formSubtext {
font-family: helvetica, arial;
font-size: 8pt;
}
.highlight {
background-color: #dddddd;
}
.tableMenu {
background-color: #cccccc;
font-size: 8pt;
font-family: Helvetica, Arial;
}
.tableMenu a {
text-decoration: none;
}
.tableHeader {
background-color: #cccccc;
font-size: 10pt;
font-family: Helvetica, Arial;
}
.tableData {
font-size: 10pt;
font-family: Helvetica, Arial;
}
.pollAnswer {
font-family: Helvetica, Arial;
font-size: 8pt;
}
.pollColor {
background-color: #444444;
}
.pollQuestion {
font-face: Helvetica, Arial;
font-weight: bold;
}
.faqQuestion {
font-size: 12pt;
font-weight: bold;
color: #000000;
}
</style>
</head>
<body onload="window.print()">
^AdminBar("");
<div align="center"><a href="^PageUrl;"><img src="^Extras;plainblack.gif" border="0" /></a></div>
<tmpl_var body.content>
<div align="center">&copy; 2001-2005 Plain Black Corporation</div>
</body>
</html>
END
WebGUI::Asset->new("PBtmpl0000000000000111","WebGUI::Asset::Template")->addRevision({template=>$template})->commit;
# style > WebGUI 6
my $template = <<END;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>^Page(title); - <tmpl_var session.setting.companyName></title>
<link rel="icon" href="^Extras;favicon.png" type="image/png" />
<link rel="shortcut icon" href="^Extras;favicon.ico" />
<tmpl_var head.tags>
<style type="text/css">
.nav, A.nav:hover, .verticalMenu {
font-size: 10px;
text-decoration: none;
}
.pageTitle, .pageTitle A {
font-size: 30px;
}
input:focus, textarea:focus {
background-color: #D5E0E1;
}
input, textarea, select {
-moz-border-radius: 6px;
background-color: #B9CDCF;
border: ridge;
}
.wgBoxTop {
background-image: url("^Extras;styles/webgui6/hdr_bg_corner_right.jpg");
width: 195px;
height: 93px;
}
.wgBoxBottom {
background-image: url("^Extras;styles/webgui6/content_bg_clouds.jpg");
padding-bottom: 21px;
width: 529px;
height: 88px;
}
.logo {
background-image: url("^Extras;styles/webgui6/hdr_bg_corner_left.jpg");
background-color: #F4F4F4;
width: 195px;
height: 93px;
padding-bottom: 25px;
}
.login {
width: 334px;
height: 93px;
background-image: url("^Extras;styles/webgui6/hdr_bg_center.jpg");
background-color: #C1D6D8;
padding-top: 5px;
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
color: #EC4300;
}
input.loginBoxField {
font-size: 10px;
background-color: white;
}
.loginBox {
font-size: 10px;
}
input.loginBoxButton {
font-size: 10px;
}
.iconBox {
background-image: url("^Extras;styles/webgui6/content_bg_corner_left_top.jpg");
width: 195px;
height: 88px;
vertical-align: bottom;
text-align: center;
}
.dateLeft {
background-image: url("^Extras;styles/webgui6/date_bg_left.jpg");
width: 53px;
height: 59px;
}
.dateRight {
width: 53px;
height: 59px;
background-image: url("^Extras;styles/webgui6/date_right_bg.jpg");
}
.date {
color: #393C3C;
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
}
.contentbgLeft {
background-image: url("^Extras;styles/webgui6/content_bg_left.jpg");
width: 53px;
}
.contentbgRight {
background-image: url("^Extras;styles/webgui6/content_bg_right.jpg");
}
.content {
color: #000000;
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
padding: 5px;
}
body{
background-color: #D5E0E1;
color: Black;
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
margin: 0;
padding: 0px;
background-image: url("^Extras;styles/webgui6/bg.gif");
background-position: top;
background-repeat: repeat-x;
}
a {
color:#EC4300;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
text-decoration: underline;
}
a:hover {
color: #EC4300;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
text-decoration: none;
}
.adminBar {
background-color: #CCCCCC;
font-family: helvetica, arial;
}
.tableMenu {
background-color: #CCCCCC;
font-size: 10pt;
font-family: Helvetica, Arial;
}
.tableMenu a {
font-size: 10pt;
text-decoration: none;
}
.tableHeader {
background-color: #CECECE;
font-size: 10pt;
font-family: Helvetica, Arial;
}
.tableData {
font-size: 10pt;
font-family: Helvetica, Arial;
}
.pollColor {
background-color: #CCCCCC;
border: thin solid #393C3C;
}
.pagination {
font-family: helvetica, arial;
font-size: 8pt;
text-align: center;
}
h1, h2, h3, h4, h5, h6 {
font-family: helvetica, arial;
color: #EC4300;
}
h1 {
font-size: 14pt;
font-family: helvetica, arial;
color: #EC4300;
}
.tab {
border: 1px solid black;
background-color: #eeeeee;
}
.tabBody {
border: 1px solid black;
border-top: 1px solid black;
border-left: 1px solid black;
background-color: #dddddd;
}
div.tabs {
line-height: 15px;
font-size: 14px;
}
.tabHover {
background-color: #cccccc;
}
.tabActive {
background-color: #dddddd;
}
</style>
</head>
<body>
^AdminBar("PBtmpl0000000000000090");
<!-- logo / login table starts here -->
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="195" align="center" class="logo"><a href="http://www.plainblack.com/webgui"><img border="0" src="^Extras;styles/webgui6/wg_logo.gif" alt="WebGUI logo" /></a></td>
<td width="334" align="center" valign="top" class="login">^L("17","","PBtmpl0000000000000092"); ^AdminToggle;</td>
<td width="195" align="center" class="wgBoxTop" valign="bottom"><a href="http://www.plainblack.com/webgui"><img border="0" src="^Extras;styles/webgui6/wg_box_top.gif" alt="" /></a></td>
</tr>
</table>
<!-- logo / login table ends here -->
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<!-- print, email icons here -->
<td class="iconBox">
&nbsp; &nbsp; &nbsp; &nbsp;
<a href="^H(linkonly);"><img border="0" src="^Extras;styles/webgui6/icon_home.gif" title="Go Home" alt="home" /></a>
<a href="^/;tell_a_friend"><img border="0" src="^Extras;styles/webgui6/icon_email.gif" alt="Email" title="Email a friend about this site." /></a>
<a href="^r(linkonly);"><img border="0" src="^Extras;styles/webgui6/icon_print.gif" alt="Print" title="Make page printable." /></a>
<a href="site_map"><img border="0" src="^Extras;styles/webgui6/icon_site_map.gif" title="View the site map." alt="Site Map" /></a> <a href="http://www.plainblack.com"><img border="0" src="^Extras;styles/webgui6/icon_pb.gif" alt="Plain Black Icon" title="Visit plainblack.com." /></a>
</td>
<!-- box clouds here -->
<td class="wgBoxBottom">^Spacer(56,1);<a href="http://www.plainblack.com/what_is_webgui"><img border="0" src="^Extras;styles/webgui6/txt_the_last.gif" alt="the LAST web solution you'll ever NEED" /></a>^Spacer(26,1);<a href="http://www.plainblack.com/webgui"><img border="0" src="^Extras;styles/webgui6/wg_box_bottom.gif" alt="" /></a></td>
</tr>
</table>
<!-- date & page title table start here -->
<table width="724" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="dateLeft">^Spacer(53,59);</td>
<td width="141" bgcolor="#BDC6C7" class="date">^D("%c %D, %y");</td>
<td><img border="0" src="^Extras;styles/webgui6/date_right_shadow.gif" alt="" /></td>
<td width="467" bgcolor="#B9CDCF"><div class="pageTitle">^PageTitle;</div></td>
<td class="dateRight">^Spacer(53,59);</td>
</tr>
</table>
<!-- date and page title table end here -->
<!-- left nav & content table start here -->
<table width="724" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="contentbgLeft">^Spacer(53,1);</td>
<!-- nav column -->
<td width="142" valign="top" bgcolor="#E2E1E1" style="width: 142px;">
<br /> <div class="nav">
^AssetProxy("flexmenu_1002");
</div> <br /> <br />
<a href="http://www.plainblack.com/webgui"><img border="0" src="^Extras;styles/webgui6/powered_by_aqua_blue.gif" alt="Powered by WebGUI" /></a>
</td>
<td valign="top" bgcolor="#F4F4F4"><img border="0" src="^Extras;styles/webgui6/lnav_shadow.jpg" alt="" /></td>
<!-- content column -->
<td width="466" valign="top" bgcolor="#F4F4F4" class="content">
<tmpl_var body.content>
</td>
<td class="contentbgRight">^Spacer(53,1);</td>
</tr>
</table>
<!-- left nav & content table end here -->
<!-- footer -->
<table width="724" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><img border="0" src="^Extras;styles/webgui6/footer.jpg" alt="" /></td>
</tr>
<tr>
<td align="center"><a href="http://www.plainblack.com"><img border="0" src="^Extras;styles/webgui6/logo_pb.gif" alt="plainblack" /></a><br /><span style="font-size: 11px;"><a href="http://www.plainblack.com/design">Design by Plain Black</a></span></td>
</tr>
</table>
</body>
</html>
END
my $asset = WebGUI::Asset->new("B1bNjWVtzSjsvGZh9lPz_A","WebGUI::Asset::Template");
$asset->addRevision({template=>$template})->commit if (defined $asset);
# style > WebGUI 6 Admin Style
my $template = <<END;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>^Page(title); - <tmpl_var session.setting.companyName></title>
<link rel="icon" href="^Extras;favicon.png" type="image/png" />
<link rel="shortcut icon" href="^Extras;favicon.ico" />
<tmpl_var head.tags>
<style>
input:focus, textarea:focus {
background-color: #D5E0E1;
}
input, textarea, select {
-moz-border-radius: 6px;
background-color: #B9CDCF;
border: ridge;
}
.content {
color: #000000;
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
padding: 5px;
}
body {
background-color: #D5E0E1;
color: Black;
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
margin: 0;
padding: 0px;
background-position: top;
background-repeat: repeat-x;
}
a {
color:#EC4300;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
text-decoration: underline;
}
a:hover {
color: #EC4300;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
text-decoration: none;
}
.adminBar {
background-color: #CCCCCC;
font-family: helvetica, arial;
}
.tableMenu {
background-color: #CCCCCC;
font-size: 10pt;
font-family: Helvetica, Arial;
}
.tableMenu a {
font-size: 10pt;
text-decoration: none;
}
.tableHeader {
background-color: #CECECE;
font-size: 10pt;
font-family: Helvetica, Arial;
}
.tableData {
font-size: 10pt;
font-family: Helvetica, Arial;
}
.pagination {
font-family: helvetica, arial;
font-size: 8pt;
text-align: center;
}
h1 {
font-size: 14pt;
font-family: helvetica, arial;
color: #EC4300;
}
.tab {
-moz-border-radius: 6px 6px 0px 0px;
border: 1px solid black;
background-color: #eeeeee;
}
.tabBody {
border: 1px solid black;
border-top: 1px solid black;
border-left: 1px solid black;
background-color: #dddddd;
}
div.tabs {
line-height: 15px;
font-size: 14px;
}
.tabHover {
background-color: #cccccc;
}
.tabActive {
background-color: #dddddd;
}
</style>
</head>
<body>
^AdminBar("PBtmpl0000000000000090");<br /><br />
<div class="content" style="padding: 10px;">
<tmpl_var body.content>
</div>
<div width="100%" style="color: white; padding: 3px; background-color: black; text-align: center;">
^H; / ^PageTitle; / ^AdminToggle; / ^LoginToggle; / ^a;
</div>
</body>
</html>
END
my $asset = WebGUI::Asset->new("9tBSOV44a9JPS8CcerOvYw","WebGUI::Asset::Template");
$asset->addRevision({template=>$template})->commit if (defined $asset);
}
#-------------------------------------------------
sub fixArticles {
print "\tFixing articles...\n" unless ($quiet);
# home/key_benefits
my $description = <<END;
<img align="right" style="position: relative;" src="^Extras;styles/webgui6/img_hands.jpg" alt="" />
<dl>
<dt><b>Easy to Use</b></dt>
<dd style="margin-bottom: 1em;">If you can use a web browser, then you can manage a web site with
WebGUI. WebGUI's unique WYSIWYG inline content editing interface
ensures that you know where you are and what your content will look
like while you're editing. In addition, you don't need to install and
learn any complicated programs, you can edit everything with your
trusty web browser.</dd>
<dt><b>Flexible Designs</b></dt>
<dd style="margin-bottom: 1em;">WebGUI's powerful templating system ensures that no two WebGUI
sites ever need to look the same. You're not restricted in how your
content is laid out or how your navigation functions.</dd>
<dt><b>Work Faster</b></dt>
<dd style="margin-bottom: 1em;">Though there is some pretty cool technology behind the scenes that
makes WebGUI work, our first concern has always been usability and not
technology. After all if it's not useful, why use it? With that in mind
WebGUI has all kinds of wizards, short cuts, online help, and other
aids to help you work faster.</dd>
<dt><b>Localized Content</b></dt>
<dd style="margin-bottom: 1em;">With WebGUI there's no need to limit yourself to one language or
timezone. It's a snap to build a multi-lingual site with WebGUI. In
fact, even WebGUI's built in functions and online help have been
translated to more than 15 languages. User's can also adjust their
local settings for dates, times, and other localized oddities.</dd>
<dt><b>Pluggable By Design</b></dt>
<dd style="margin-bottom: 1em;">When <a href="http://www.plainblack.com/">Plain Black</a> created
WebGUI we knew we wouldn't be able to think of everything you want to
use WebGUI for, so we made most of WebGUI's functions pluggable. This
allows you to add new features to WebGUI and still be able to upgrade
the core system without a fuss.</dd>
</dl>
END
my $asset = WebGUI::Asset->new("sWVXMZGibxHe2Ekj1DCldA","WebGUI::Asset::Wobject::Article");
$asset->addRevision({description=>$description})->commit if (defined $asset);
}
#-------------------------------------------------
sub fixTemplatesExtras {
print "\tFixing built-in templates with the Extras Macro.\n" unless ($quiet);
my @tmpls = WebGUI::SQL->buildArray("select distinct assetId from template");
foreach my $id (@tmpls) {
my $asset = WebGUI::Asset->new($id,"WebGUI::Asset::Template");
my $template = $asset->get("template");
$template =~ s/\^Extras;\//^Extras;/ixsg;
$asset->addRevision({template=>$template})->commit;
}
}
#-------------------------------------------------
sub start {
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
WebGUI::Session::refreshUserInfo(3);
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
}
#-------------------------------------------------
sub finish {
WebGUI::Session::close();
}

View file

@ -1,41 +0,0 @@
use lib "../../lib";
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Asset;
use WebGUI::Setting;
my $toVersion = "6.7.6";
my $configFile;
my $quiet;
start();
finish();
#-------------------------------------------------
sub somefunc {
print "\tDoing something.\n" unless ($quiet);
# do something
}
#-------------------------------------------------
sub start {
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
WebGUI::Session::refreshUserInfo(3);
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
}
#-------------------------------------------------
sub finish {
WebGUI::Session::close();
}

File diff suppressed because it is too large Load diff

View file

@ -1,171 +0,0 @@
use lib "../../lib";
use strict;
use Getopt::Long;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Asset;
use WebGUI::Setting;
my $toVersion = "6.7.8";
my $configFile;
my $quiet;
start();
protectUserProfileFields();
correctEditProfileTemplate();
fixCalendarTemplates();
finish();
#-------------------------------------------------
sub fixCalendarTemplates {
print "\tFixing bugs in calendar templates.\n" unless ($quiet);
my $template = <<STOP;
<h1><tmpl_var title></h1>
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr>
<td valign="top" class="tableHeader" width="100%">
<b><tmpl_var start.label>:</b> <tmpl_var start.date><br />
<b><tmpl_var end.label>:</b> <tmpl_var end.date><br />
</td><td valign="top" class="tableMenu" nowrap="1">
<tmpl_if canEdit>
<a href="<tmpl_var edit.url>"><tmpl_var edit.label></a><br />
<a href="<tmpl_var delete.url>"><tmpl_var delete.label></a><br />
</tmpl_if>
<tmpl_if previous.url>
<a href="<tmpl_var previous.url>"><tmpl_var previous.label></a><br />
</tmpl_if>
<tmpl_if next.url>
<a href="<tmpl_var next.url>"><tmpl_var next.label></a><br />
</tmpl_if>
</td></tr>
</table>
<tmpl_var description>
<tmpl_loop others_loop>
<tmpl_if __FIRST__>
<p /><b>Events Near This One</b><br />
</tmpl_if>
<ul>
<li><a href="<tmpl_var url>"><tmpl_var title></a></li>
</ul>
</tmpl_loop>
STOP
my $asset = WebGUI::Asset->new("PBtmpl0000000000000023","WebGUI::Asset::Template");
$asset->addRevision({template=>$template})->commit if (defined $asset);
$template = <<STOP;
<a name="id<tmpl_var assetId>" id="id<tmpl_var assetId>"></a>
<tmpl_if session.var.adminOn>
<p><tmpl_var controls></p>
</tmpl_if>
<tmpl_if displayTitle>
<h1><tmpl_var title></h1>
</tmpl_if>
<tmpl_if description>
<tmpl_var description>
<p />
</tmpl_if>
<tmpl_if session.var.adminOn>
<a href="<tmpl_var addevent.url>"><tmpl_var addevent.label></a>
<p />
</tmpl_if>
<tmpl_loop month_loop>
<table border="1">
<tr><td colspan=7 class="tableHeader"><tmpl_var month> <tmpl_var year></td></tr>
<tr>
<tmpl_if session.user.firstDayOfWeek>
<th class="tableData"><tmpl_var monday.label.short></th>
<th class="tableData"><tmpl_var tuesday.label.short></th>
<th class="tableData"><tmpl_var wednesday.label.short></th>
<th class="tableData"><tmpl_var thursday.label.short></th>
<th class="tableData"><tmpl_var friday.label.short></th>
<th class="tableData"><tmpl_var saturday.label.short></th>
<th class="tableData"><tmpl_var sunday.label.short></th>
<tmpl_else>
<th class="tableData"><tmpl_var sunday.label.short></th>
<th class="tableData"><tmpl_var monday.label.short></th>
<th class="tableData"><tmpl_var tuesday.label.short></th>
<th class="tableData"><tmpl_var wednesday.label.short></th>
<th class="tableData"><tmpl_var thursday.label.short></th>
<th class="tableData"><tmpl_var friday.label.short></th>
<th class="tableData"><tmpl_var saturday.label.short></th>
</tmpl_if>
</tr><tr>
<tmpl_loop prepad_loop>
<td>&nbsp;</td>
</tmpl_loop>
<tmpl_loop day_loop>
<tmpl_if isStartOfWeek>
<tr>
</tmpl_if>
<td class="table<tmpl_if isToday>Header<tmpl_else>Data</tmpl_if>" width="28" valign="top" align="left"><p><b>
<tmpl_if hasEvents>
<a href="<tmpl_var url>"><tmpl_var day></a>
<tmpl_else>
<tmpl_var day>
</tmpl_if>
</b></p></td>
<tmpl_if isEndOfWeek>
</tr>
</tmpl_if>
</tmpl_loop>
<tmpl_loop postpad_loop>
<td>&nbsp;</td>
</tmpl_loop>
</tr>
</table>
</tmpl_loop>
<tmpl_if pagination.pageCount.isMultiple>
<div class="pagination">
<tmpl_var pagination.previousPage> &middot; <tmpl_var pagination.pageList.upTo20> &middot; <tmpl_var pagination.nextPage>
</div>
</tmpl_if>
STOP
$asset = WebGUI::Asset->new("PBtmpl0000000000000105","WebGUI::Asset::Template");
$asset->addRevision({template=>$template})->commit if (defined $asset);
}
#-------------------------------------------------
sub start {
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
WebGUI::Session::refreshUserInfo(3);
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
}
#-------------------------------------------------
sub protectUserProfileFields {
print "\tProtecting all default user fields.\n" unless ($quiet);
WebGUI::SQL->write("update userProfileField set protected=1 where fieldName in ('discussionLayout','INBOXNotifications','alias','signature','publicProfile','publicEmail','toolbar')");
}
#-------------------------------------------------
sub correctEditProfileTemplate {
print "\tFixing Edit Profile template.\n" unless ($quiet);
my $tmplAsset = WebGUI::Asset->newByDynamicClass("PBtmpl0000000000000051");
my $template = $tmplAsset->get('template');
$template =~ s/create.form.footer/profile.form.footer/;
$tmplAsset->addRevision({ template=>$template });
$tmplAsset->commit;
}
#-------------------------------------------------
sub finish {
WebGUI::Session::close();
}

File diff suppressed because it is too large Load diff

View file

@ -1,244 +0,0 @@
#-------------------------------------------------------------------
# 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;
use File::Path;
use WebGUI::SQL;
use WebGUI::Asset;
my $toVersion = "6.8.1"; # make this match what version you're going to
my $quiet; # this line required
start(); # this line required
upgradeRichEditor();
fixCSFaqTemplateAnchors();
updateProfileSystem();
convertDashboardPrefs();
fixPosts();
fixIOB();
finish(); # this line required
#-------------------------------------------------
sub fixIOB {
print "\tFixing IOB.\n" unless ($quiet);
WebGUI::SQL->write("alter table InOutBoard_statusLog add column createdBy varchar(22) binary");
}
#-------------------------------------------------
sub fixPosts {
print "\tFixing posts.\n" unless ($quiet);
WebGUI::SQL->write("update Post set dateUpdated=".time()." where dateUpdated=0");
}
#-------------------------------------------------
sub updateProfileSystem {
print "\tUpdating user profile system.\n" unless ($quiet);
WebGUI::SQL->write("alter table userProfileField change fieldLabel label varchar(255) not null default 'Undefined'");
WebGUI::SQL->write("alter table userProfileField change dataType fieldType varchar(128) not null default 'text'");
WebGUI::SQL->write("alter table userProfileField change dataValues possibleValues text");
WebGUI::SQL->write("alter table userProfileCategory change categoryName label varchar(255) not null default 'Undefined'");
WebGUI::SQL->write("alter table userProfileCategory add column protected int not null default 0");
WebGUI::SQL->write("update userProfileCategory set protected=1 where profileCategoryId in ('1','2','3','4','5','6','7')");
}
#-------------------------------------------------
sub upgradeRichEditor {
print "\tUpgrade rich editor\n" unless ($quiet);
rmtree("../../www/extras/tinymce");
}
#-------------------------------------------------
sub convertDashboardPrefs {
print "\tConverting Dashboard preferences\n" unless ($quiet);
#purge all Fields.
my $a = WebGUI::SQL->read("select assetId from asset where className='WebGUI::Asset::Field'");
while (my ($assetId) = $a->array) {
WebGUI::SQL->write("delete from asset where assetId=".quote($assetId));
WebGUI::SQL->write("delete from assetData where assetId=".quote($assetId));
}
unlink("../../lib/WebGUI/Asset/Field.pm");
WebGUI::SQL->write("DROP TABLE `wgField`");
WebGUI::SQL->write("ALTER TABLE `Dashboard` DROP COLUMN mapFieldId");
WebGUI::SQL->write("ALTER TABLE `Dashboard` ADD COLUMN `isInitialized` TINYINT UNSIGNED NOT NULL DEFAULT 0");
WebGUI::SQL->write("ALTER TABLE `Dashboard` ADD COLUMN `assetsToHide` TEXT");
WebGUI::SQL->write("ALTER TABLE `Shortcut` ADD COLUMN `prefFieldsToShow` TEXT");
WebGUI::SQL->write("ALTER TABLE `Shortcut` ADD COLUMN `prefFieldsToImport` TEXT");
WebGUI::SQL->write("ALTER TABLE `Shortcut` ADD COLUMN `showReloadIcon` TINYINT UNSIGNED NOT NULL DEFAULT 0");
my $asset = WebGUI::Asset->new("DashboardViewTmpl00001","WebGUI::Asset::Template");
if (defined $asset) { ##Can't update what doesn't exist
my $template = <<STOP;
<style type="text/css"> \@import "^Extras;wobject/Dashboard/draggable.css"; </style>
<style type="text/css"> \@import "^Extras;wobject/Dashboard/dashboard.css"; </style>
<script src="^Extras;wobject/Dashboard/draggable.js" type="text/javascript"></script>
<!--[if IE]>
<style type="text/css">
div.dragTitle
{
overflow-x:hidden;
}
</style>
<![endif]-->
<div id="dashboardContainer">
<a name="id<tmpl_var assetId>" id="id<tmpl_var assetId>">
</a>
<table id="dashboardChooserContainer" width="100%" border="0">
<tr>
<td id="leftBox">
<div style="display:none;cursor: hand;" id="hideNewContentButton" onclick="makeInactive(this);makeInactive(document.getElementById('availableBox'));makeActive(document.getElementById('showNewContentButton'));">Hide New Content List</div>
<div id="availableBox"><div id="availableBox2">
<div id="availableDashlets">
<table cellpadding="0" cellspacing="0" border="0" id="position1" class="dashboardColumn">
<tbody class="availableDashlet">
<tmpl_loop position1_loop><tr id="td<tmpl_var id>"><td><div id="td<tmpl_var id>_div" class="dragable"><div class="dragTrigger"><div class="dragTitle"><span class="headerTitle" id="hdrtd<tmpl_var id>_span"><tmpl_var dashletTitle></span></span><span class="options" onmouseover="this.className='options optionsHoverIE'" onmouseout="this.className='options'"><tmpl_if canEditUserPrefs><a onclick="dashboard_toggleEditForm(event,'<tmpl_var id>','<tmpl_var shortcutUrl>')"><img src="^Extras;wobject/Dashboard/edit_btn.jpg" border="0"></a></tmpl_if><a onclick="dragable_deleteContent(event,this<tmpl_if canPersonalize>,'true'</tmpl_if>);this.parentNode.onmouseout();"><img src="^Extras;wobject/Dashboard/delete_btn.jpg" border="0"></a><tmpl_if showReloadIcon><a onclick="dashboard_reloadDashlet(event,'<tmpl_var id>','<tmpl_var shortcutUrl>')"><img src="^Extras;wobject/Dashboard/reload.gif" border="0"></a></tmpl_if><br /></span></div></div>
<div class="content" id="ct<tmpl_var id>_div"><tmpl_var content></div></div></td></tr></tmpl_loop>
</tbody></table>
</div></div></div>
</td>
<td id="rightBox">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td style="width:80px;"> <div id="showNewContentButton" onclick="makeInactive(this);makeActive(document.getElementById('availableBox'));makeActive(document.getElementById('hideNewContentButton'));">Add New Content</div></td><td>
<tmpl_if showAdmin>
<p>
<tmpl_var controls>
</p>
</tmpl_if>
<tmpl_if displayTitle>
<h1 style="text-align:center">
<tmpl_var title>
</h1>
</tmpl_if>
<tmpl_if description>
<p>
<tmpl_var description>
</p>
</tmpl_if>
</td><td valign="top" class="login">^L("17","","PBtmpl0000000000000092"); ^AdminToggle(Modify the Default User's Perspective,Leave Default User Perspective (Admin Mode));</td></tr></table>
<script type="text/javascript" src="^Extras;js/at/AjaxRequest.js"></script>
<script type="text/javascript">
function submitForm(theform,idToReplace,shortcutUrl) {
var status = AjaxRequest.submit(
theform
,{
'parameters':{
},
'onSuccess':function(req){
var myArray = req.responseText.split(/beginDebug/mg,1);
document.getElementById("ct" + idToReplace + "_div").innerHTML = myArray[0];
var existingForm = document.getElementById("form" + idToReplace + "_div");
throwAway = existingForm.parentNode.removeChild(existingForm);
var hoopla = AjaxRequest.get(
{
'url':shortcutUrl
,'parameters':{
'func':"getNewTitle"
}
,'onSuccess':function(req){
var myArr557 = req.responseText.split(/beginDebug/mg,1);
document.getElementById("hdrtd" + idToReplace + "_span").innerHTML = myArr557[0];
}
}
);
}
}
);
return status;
}
function makeActive(o) { o.style.display = "inline"; }
function makeInactive(o) { o.style.display = "none"; }
function AjaxRequestBegin() { }
function AjaxRequestEnd() { }
</script>
<div id="columnsContainerDiv">
<table cellpadding="0" cellspacing="8" border="0" id="columnsContainerTable" width="100%">
<tr>
<td width="33%">
<table cellpadding="0" cellspacing="0" border="0" id="position2" class="dashboardColumn" width="100%">
<tbody>
<tmpl_loop position2_loop><tr id="td<tmpl_var id>"><td><div id="td<tmpl_var id>_div" class="dragable"><div class="dragTrigger"><div class="dragTitle"><span class="headerTitle" id="hdrtd<tmpl_var id>_span"><tmpl_var dashletTitle></span></span><span class="options" onmouseover="this.className='options optionsHoverIE'" onmouseout="this.className='options'"><tmpl_if canEditUserPrefs><a onclick="dashboard_toggleEditForm(event,'<tmpl_var id>','<tmpl_var shortcutUrl>')"><img src="^Extras;wobject/Dashboard/edit_btn.jpg" border="0"></a></tmpl_if><a onclick="dragable_deleteContent(event,this<tmpl_if canPersonalize>,'true'</tmpl_if>);this.parentNode.onmouseout();"><img src="^Extras;wobject/Dashboard/delete_btn.jpg" border="0"></a><tmpl_if showReloadIcon><a onclick="dashboard_reloadDashlet(event,'<tmpl_var id>','<tmpl_var shortcutUrl>')"><img src="^Extras;wobject/Dashboard/reload.gif" border="0"></a></tmpl_if><br /></span></div></div>
<div class="content" id="ct<tmpl_var id>_div"><tmpl_var content></div></div></td></tr></tmpl_loop>
</tbody>
</table>
</td>
<td width="2px" bgcolor="gray" height="500px">
</td>
<td width="33%">
<table cellpadding="0" cellspacing="0" border="0" id="position3" class="dashboardColumn" width="100%">
<tbody>
<tmpl_loop position3_loop><tr id="td<tmpl_var id>"><td><div id="td<tmpl_var id>_div" class="dragable"><div class="dragTrigger"><div class="dragTitle"><span class="headerTitle"><span class="headerTitle" id="hdrtd<tmpl_var id>_span"><tmpl_var dashletTitle></span></span><span class="options" onmouseover="this.className='options optionsHoverIE'" onmouseout="this.className='options'"><tmpl_if canEditUserPrefs><a onclick="dashboard_toggleEditForm(event,'<tmpl_var id>','<tmpl_var shortcutUrl>')"><img src="^Extras;wobject/Dashboard/edit_btn.jpg" border="0"></a></tmpl_if><a onclick="dragable_deleteContent(event,this<tmpl_if canPersonalize>,'true'</tmpl_if>);this.parentNode.onmouseout();"><img src="^Extras;wobject/Dashboard/delete_btn.jpg" border="0"></a><tmpl_if showReloadIcon><a onclick="dashboard_reloadDashlet(event,'<tmpl_var id>','<tmpl_var shortcutUrl>')"><img src="^Extras;wobject/Dashboard/reload.gif" border="0"></a></tmpl_if><br /></span></div></div>
<div class="content" id="ct<tmpl_var id>_div"><tmpl_var content></div></div></td></tr></tmpl_loop>
</tbody>
</table>
</td>
<td width="2px" bgcolor="gray" height="500px"></td>
<td width="33%">
<table cellpadding="0" cellspacing="0" border="0" id="position4" class="dashboardColumn" width="100%">
<tbody>
<tmpl_loop position4_loop><tr id="td<tmpl_var id>"><td><div id="td<tmpl_var id>_div" class="dragable"><div class="dragTrigger"><div class="dragTitle"><span class="headerTitle"><span class="headerTitle" id="hdrtd<tmpl_var id>_span"><tmpl_var dashletTitle></span></span><span class="options" onmouseover="this.className='options optionsHoverIE'" onmouseout="this.className='options'"><tmpl_if canEditUserPrefs><a onclick="dashboard_toggleEditForm(event,'<tmpl_var id>','<tmpl_var shortcutUrl>')"><img src="^Extras;wobject/Dashboard/edit_btn.jpg" border="0"></a></tmpl_if><a onclick="dragable_deleteContent(event,this<tmpl_if canPersonalize>,'true'</tmpl_if>);this.parentNode.onmouseout();"><img src="^Extras;wobject/Dashboard/delete_btn.jpg" border="0"></a><tmpl_if showReloadIcon><a onclick="dashboard_reloadDashlet(event,'<tmpl_var id>','<tmpl_var shortcutUrl>')"><img src="^Extras;wobject/Dashboard/reload.gif" border="0"></a></tmpl_if><br /></span></div></div>
<div class="content" id="ct<tmpl_var id>_div"><tmpl_var content></div></div></td></tr></tmpl_loop>
</tbody>
</table>
</td>
</tr>
</table>
</div>
<table class="blankTable"><tr id="blank" class="hidden"><td class="blankColumn"><div><div class="empty">&nbsp;</div></div></td></tr></table>
<tmpl_var dragger.init>
</td></tr></table></div>
STOP
$asset->addRevision({template=>$template})->commit;
}
}
#-------------------------------------------------
sub fixCSFaqTemplateAnchors {
print "\tFix Anchors in the CS FAQ Template\n" unless ($quiet);
my $asset = WebGUI::Asset->new("PBtmpl0000000000000080","WebGUI::Asset::Template");
if (defined $asset) { ##Can't update what doesn't exist
my $template = $asset->get("template");
$template =~ s/(<a href="#)(<tmpl_var assetId>)/${1}id${2}/;
$asset->addRevision({template=>$template})->commit;
}
}
# ---- DO NOT EDIT BELOW THIS LINE ----
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
WebGUI::Session::refreshUserInfo(3);
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
}
#-------------------------------------------------
sub finish {
WebGUI::Session::close();
}

View file

@ -1,76 +0,0 @@
#-------------------------------------------------------------------
# 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;
use WebGUI::SQL;
use WebGUI::Asset;
my $toVersion = "6.8.2"; # make this match what version you're going to
my $quiet; # this line required
start(); # this line required
fixPosts();
fixDataFormMailForm();
fixTZGoof();
finish(); # this line required
#-------------------------------------------------
sub fixTZGoof {
print "\tFixing default timezone.\n" unless ($quiet);
WebGUI::SQL->write("update userProfileField set dataDefault='\\\'America/Chicago\\\'' where fieldName='timeZone'");
}
#-------------------------------------------------
sub fixPosts {
print "\tFixing posts.\n" unless ($quiet);
WebGUI::SQL->write("update Post set dateSubmitted=dateUpdated where dateSubmitted is null");
}
#-------------------------------------------------
sub fixDataFormMailForm {
print "\tFix bad template variable in Mail Form.\n" unless ($quiet);
my $asset = WebGUI::Asset->new("PBtmpl0000000000000020","WebGUI::Asset::Template");
if (defined $asset) {
my $template = $asset->get("template");
$template =~ s/<tmpl_if field.required>/<tmpl_if field.isRequired>/g;
$asset->addRevision({template=>$template})->commit;
}
}
# ---- DO NOT EDIT BELOW THIS LINE ----
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
WebGUI::Session::refreshUserInfo(3);
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
}
#-------------------------------------------------
sub finish {
WebGUI::Session::close();
}

View file

@ -1,195 +0,0 @@
#-------------------------------------------------------------------
# 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;
use WebGUI::SQL;
use WebGUI::Asset;
use Parse::PlainConfig;
my $toVersion = "6.8.3"; # make this match what version you're going to
my $quiet; # this line required
start(); # this line required
fixMatrixTemplate();
finish(); # this line required
#-------------------------------------------------
sub fixMatrixTemplate {
print "\tFix matrix template.\n" unless ($quiet);
my $template = <<STOP;
<tmpl_if session.var.adminOn>
<p><tmpl_var controls></p>
</tmpl_if>
<h2><tmpl_var title></h2>
<tmpl_if description>
<tmpl_var description><br /><br />
</tmpl_if>
<table class="content" width="100%">
<tr><td valign="top" width="50%">
<p>Use the form below to select up to <tmpl_var maxCompares> listings to compare at once.
</p>
<tmpl_var compare.form>
</td><td valign="top">
<p>
<b>Narrow The Matrix</b><br>
You can narrow the scope of the matrix by <a href="<tmpl_var search.url>">searching</a> for exactly the criteria you're looking for in a listing.
</p>
<p>
<br><b>Expand The Matrix</b><br>
<tmpl_if isLoggedIn>
<a href="<tmpl_var listing.add.url>">Click here to add a new listing.</a> Please note that you will be the official maintainer of the listing, and will be responsible for keeping it up to date.
<tmpl_else>
If you are the maker of a product, or are an expert user and are willing to maintain the listing, <a href="^a(linkonly);">create an account</a> so you can register your listing.
</tmpl_if>
</p>
<br><b>Listing Statistics</b><br>
<table class="content">
<tr>
<td>Most clicks:</td>
<td><tmpl_var best.clicks.count></td>
<td><a href="<tmpl_var best.clicks.url>"><tmpl_var best.clicks.name></a></td>
</tr>
<tr>
<td>Most views:</td>
<td><tmpl_var best.views.count></td>
<td><a href="<tmpl_var best.views.url>"><tmpl_var best.views.name></a></td>
</tr>
<tr>
<td>Most compares:</td>
<td><tmpl_var best.compares.count></td>
<td><a href="<tmpl_var best.compares.url>"><tmpl_var best.compares.name></a></td>
</tr>
<tr>
<td>Most recently updated:</td>
<td><tmpl_var best.updated.date></td>
<td><a href="<tmpl_var best.updated.url>"><tmpl_var best.updated.name></a></td>
</tr>
<tr>
<td colspan="3"><hr size="1"></td>
</tr>
<tr>
<td align="center" colspan="3">Best Rated By Users</td>
</tr>
<tmpl_loop best_rating_loop>
<tr>
<td><tmpl_var category></td>
<td><tmpl_var mean>/10</td>
<td><a href="<tmpl_var url>"><tmpl_var name></a></td>
</tr>
</tmpl_loop>
<tr>
<td colspan="3"><hr size="1"></td>
</tr>
<tr>
<td colspan="3" align="center"><a href="<tmpl_var ratings.details.url>">View Ratings Details</a></td>
</tr>
<tr>
<td colspan="3"><hr size="1"></td>
</tr>
<tr>
<td align="center" colspan="3">Worst Rated By Users</td>
</tr>
<tmpl_loop worst_rating_loop>
<tr>
<td><tmpl_var category></td>
<td><tmpl_var mean>/10</td>
<td><a href="<tmpl_var url>"><tmpl_var name></a></td>
</tr>
</tmpl_loop>
<tr>
<td colspan="3"><hr size="1"></td>
</tr>
</table>
<br>
<br><b>Site Statistics</b><br>
<table class="content">
<tr>
<td>Listing Count:</td>
<td><tmpl_var listing.count></td>
</tr>
<tr>
<td>Current Visitors:</td>
<td><tmpl_var current.user.count></td>
</tr>
<tr>
<td>Registered Users:</td>
<td><tmpl_var user.count></td>
</tr>
</table>
<tmpl_if session.var.adminOn>
<p> <a href="<tmpl_var field.list.url>">List Fields</a>
</p>
<tmpl_if pending_list>
<b>PENDING LISTINGS:</b>
</tmpl_if>
<ul>
<tmpl_loop pending_list>
<li><a href="<tmpl_var url>"><tmpl_var productName></a></li>
</tmpl_loop>
</ul>
</tmpl_if>
</td></tr></table>
STOP
my $asset = WebGUI::Asset->new("matrixtmpl000000000001","WebGUI::Asset::Template");
$asset->addRevision({template=>$template})->commit if (defined $template);
}
# ---- DO NOT EDIT BELOW THIS LINE ----
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
WebGUI::Session::refreshUserInfo(3);
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
}
#-------------------------------------------------
sub finish {
WebGUI::Session::close();
}

View file

@ -1,301 +0,0 @@
#-------------------------------------------------------------------
# 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;
use WebGUI::SQL;
use WebGUI::Asset;
use Parse::PlainConfig;
my $toVersion = "6.8.4"; # make this match what version you're going to
my $quiet; # this line required
start(); # this line required
fixDefaultThreadTemplate();
enableAvatarProfileField();
updateDataFormEmailFields();
finish(); # this line required
#-------------------------------------------------
sub fixDefaultThreadTemplate {
print "\tEnable Avatars in the default Thread template.\n" unless ($quiet);
my $template = <<EOT1;
<a name="id<tmpl_var assetId>" id="id<tmpl_var assetId>"></a>
<tmpl_if session.var.adminOn>
<p><tmpl_var controls></p>
</tmpl_if>
<style type="text/css">
.postBorder {
border: 1px solid #cccccc;
margin-bottom: 10px;
}
.postBorderCurrent {
border: 3px dotted black;
margin-bottom: 10px;
}
.postSubject {
border-bottom: 1px solid #cccccc;
font-weight: bold;
padding: 3px;
}
.postData {
border-bottom: 1px solid #cccccc;
font-size: 11px;
background-color: #eeeeee;
color: black;
padding: 3px;
}
.postControls {
border-top: 1px solid #cccccc;
background-color: #eeeeee;
color: black;
padding: 3px;
}
.postMessage {
padding: 3px;
}
.currentThread {
background-color: #eeeeee;
}
.threadHead {
font-weight: bold;
border-bottom: 1px solid #cccccc;
font-size: 11px;
background-color: #eeeeee;
color: black;
padding: 3px;
}
.threadData {
font-size: 11px;
padding: 3px;
}
</style>
<div style="float: left; width: 70%">
<h1><a href="<tmpl_var collaboration.url>"><tmpl_var collaboration.title></a></h1>
</div>
<div style="width: 30%; float: left; text-align: right;">
<tmpl_if layout.isFlat>
<a href="<tmpl_var layout.nested.url>"><tmpl_var layout.nested.label></a>
<tmpl_else>
<a href="<tmpl_var layout.flat.url>"><tmpl_var layout.flat.label></a>
</tmpl_if>
</div>
<div style="clear: both;"></div>
<tmpl_if layout.isFlat>
<!-- begin flat layout -->
<tmpl_loop post_loop>
<div class="postBorder<tmpl_if isCurrent>Current</tmpl_if>">
<a name="<tmpl_var assetId>"></a>
<div class="postSubject">
<tmpl_var title>
</div>
<div class="postData">
<div style="float: left; width: 50%">
<b><tmpl_var user.label>:</b>
<tmpl_if user.isVisitor>
<tmpl_var username><tmpl_if avatar.url><img src="<tmpl_var avatar.url>" /></tmpl_if>
<tmpl_else>
<a href="<tmpl_var userProfile.url>"><tmpl_var username><tmpl_if avatar.url><img src="<tmpl_var avatar.url>" border="0" alt="avatar" /></tmpl_if></a>
</tmpl_if>
<br />
<b><tmpl_var date.label>:</b> <tmpl_var dateSubmitted.human><br />
</div>
<div>
<b><tmpl_var views.label>:</b> <tmpl_var views><br />
<b><tmpl_var rating.label>:</b> <tmpl_var rating>
<tmpl_unless hasRated>
&nbsp; &nbsp;<tmpl_var rate.label> [ <a href="<tmpl_var rate.url.1>">1</a>, <a href="<tmpl_var rate.url.2>">2</a>, <a href="<tmpl_var rate.url.3>">3</a>, <a href="<tmpl_var rate.url.4>">4</a>, <a href="<tmpl_var rate.url.5>">5</a> ]
</tmpl_unless>
<br />
<tmpl_if user.isModerator>
<b><tmpl_var status.label>:</b> <tmpl_var status> &nbsp; &nbsp; [ <a href="<tmpl_var approve.url>"><tmpl_var approve.label></a> | <a href="<tmpl_var deny.url>"><tmpl_var deny.label></a> ]<br />
<tmpl_else>
<tmpl_if user.isPoster>
<b><tmpl_var status.label>:</b> <tmpl_var status><br />
</tmpl_if>
</tmpl_if>
</div>
</div>
<div class="postMessage">
<tmpl_var content>
<tmpl_loop attachment_loop>
<div style="float: left; padding: 5px;"><a href="<tmpl_var url>"><tmpl_if isImage><img src="<tmpl_var thumbnail>" border="0" alt="<tmpl_var filename>" /><tmpl_else><img src="<tmpl_var icon>" border="0" alt="<tmpl_var filename>" align="middle" /> <tmpl_var filename></tmpl_if></a></div>
</tmpl_loop>
<div style="clear: both;"></div>
</div>
<tmpl_unless isLocked>
<div class="postControls">
<tmpl_if user.canReply>
<a href="<tmpl_var reply.url>">[<tmpl_var reply.label>]</a>
</tmpl_if>
<tmpl_if user.canEdit>
<a href="<tmpl_var edit.url>">[<tmpl_var edit.label>]</a>
<a href="<tmpl_var delete.url>">[<tmpl_var delete.label>]</a>
</tmpl_if>
</div>
</tmpl_unless>
</div>
</tmpl_loop>
<!-- end flat layout -->
</tmpl_if>
<tmpl_if layout.isNested>
<!-- begin nested layout -->
<tmpl_loop post_loop>
<div style="margin-left: <tmpl_var depthX10>px;">
<div class="postBorder<tmpl_if isCurrent>Current</tmpl_if>">
<a name="<tmpl_var assetId>"></a>
<div class="postSubject">
<tmpl_var title>
</div>
<div class="postData">
<div style="float: left; width: 50%">
<b><tmpl_var user.label>:</b>
<tmpl_if user.isVisitor>
<tmpl_var username><tmpl_if avatar.url><img src="<tmpl_var avatar.url>" /></tmpl_if>
<tmpl_else>
<a href="<tmpl_var userProfile.url>"><tmpl_var username><tmpl_if avatar.url><img src="<tmpl_var avatar.url>" border="0" alt="avatar" /></tmpl_if></a>
</tmpl_if>
<br />
<b><tmpl_var date.label>:</b> <tmpl_var dateSubmitted.human><br />
</div>
<div>
<b><tmpl_var views.label>:</b> <tmpl_var views><br />
<b><tmpl_var rating.label>:</b> <tmpl_var rating>
<tmpl_unless hasRated>
&nbsp; &nbsp;<tmpl_var rate.label> [ <a href="<tmpl_var rate.url.1>">1</a>, <a href="<tmpl_var rate.url.2>">2</a>, <a href="<tmpl_var rate.url.3>">3</a>, <a href="<tmpl_var rate.url.4>">4</a>, <a href="<tmpl_var rate.url.5>">5</a> ]
</tmpl_unless>
<br />
<tmpl_if user.isModerator>
<b><tmpl_var status.label>:</b> <tmpl_var status> &nbsp; &nbsp; [ <a href="<tmpl_var approve.url>"><tmpl_var approve.label></a> | <a href="<tmpl_var deny.url>"><tmpl_var deny.label></a> ]<br />
<tmpl_else>
<tmpl_if user.isPoster>
<b><tmpl_var status.label>:</b> <tmpl_var status><br />
</tmpl_if>
</tmpl_if>
</div>
</div>
<div class="postMessage">
<tmpl_var content>
<tmpl_loop attachment_loop>
<div style="float: left; padding: 5px;"><a href="<tmpl_var url>"><tmpl_if isImage><img src="<tmpl_var thumbnail>" border="0" alt="<tmpl_var filename>" /><tmpl_else><img src="<tmpl_var icon>" border="0" alt="<tmpl_var filename>" align="middle" /> <tmpl_var filename></tmpl_if></a></div>
</tmpl_loop>
<div style="clear: both;"></div>
</div>
<tmpl_unless isLocked>
<div class="postControls">
<tmpl_if user.canReply>
<a href="<tmpl_var reply.url>">[<tmpl_var reply.label>]</a>
</tmpl_if>
<tmpl_if user.canEdit>
<a href="<tmpl_var edit.url>">[<tmpl_var edit.label>]</a>
<a href="<tmpl_var delete.url>">[<tmpl_var delete.label>]</a>
</tmpl_if>
</div>
</tmpl_unless>
</div>
</div>
</tmpl_loop>
<!-- end nested layout -->
</tmpl_if>
<tmpl_if pagination.pageCount.isMultiple>
<div class="pagination" style="margin-top: 20px;">
[ <tmpl_var pagination.previousPage> | <tmpl_var pagination.pageList.upTo10> | <tmpl_var pagination.nextPage> ]
</div>
</tmpl_if>
<div style="margin-top: 20px;">
<tmpl_if previous.url>
<a href="<tmpl_var previous.url>">[<tmpl_var previous.label>]</a>
</tmpl_if>
<tmpl_if next.url>
<a href="<tmpl_var next.url>">[<tmpl_var next.label>]</a>
</tmpl_if>
<tmpl_if user.canPost>
<a href="<tmpl_var add.url>">[<tmpl_var add.label>]</a>
</tmpl_if>
<tmpl_if user.isModerator>
<tmpl_if isSticky>
<a href="<tmpl_var unstick.url>">[<tmpl_var unstick.label>]</a>
<tmpl_else>
<a href="<tmpl_var stick.url>">[<tmpl_var stick.label>]</a>
</tmpl_if>
<tmpl_if isLocked>
<a href="<tmpl_var unlock.url>">[<tmpl_var unlock.label>]</a>
<tmpl_else>
<a href="<tmpl_var lock.url>">[<tmpl_var lock.label>]</a>
</tmpl_if>
</tmpl_if>
<tmpl_unless user.isVisitor>
<tmpl_if user.isSubscribed>
<a href="<tmpl_var unsubscribe.url>">[<tmpl_var unsubscribe.label>]</a>
<tmpl_else>
<a href="<tmpl_var subscribe.url>">[<tmpl_var subscribe.label>]</a>
</tmpl_if>
</tmpl_unless>
</div>
EOT1
my $asset = WebGUI::Asset->new("PBtmpl0000000000000032","WebGUI::Asset::Template");
$asset->addRevision({template=>$template})->commit;
}
#-------------------------------------------------
sub enableAvatarProfileField {
print "\tMake user profile Avatar field visible and editable.\n" unless ($quiet);
WebGUI::SQL->write("update userProfileField set visible=1 where fieldName='avatar'");
WebGUI::SQL->write("update userProfileField set editable=1 where fieldName='avatar'");
}
#-------------------------------------------------
sub updateDataFormEmailFields {
print "\tFix default email tabId's.\n" unless ($quiet);
WebGUI::SQL->write("alter table DataForm_field alter DataForm_tabId set default 0;");
my $sth = WebGUI::SQL->read('select DataForm_fieldId,DataForm_tabId from DataForm_field');
my $wrh = WebGUI::SQL->prepare('update DataForm_field set DataForm_tabId=0 where DataForm_fieldId=?');
while (my %hash = $sth->hash) {
$wrh->execute([$hash{DataForm_fieldId}]) unless $hash{DataForm_tabId};
}
}
# ---- DO NOT EDIT BELOW THIS LINE ----
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
'quiet'=>\$quiet
);
WebGUI::Session::open("../..",$configFile);
WebGUI::Session::refreshUserInfo(3);
WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")");
}
#-------------------------------------------------
sub finish {
WebGUI::Session::close();
}

View file

@ -0,0 +1,57 @@
#-------------------------------------------------------------------
# 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 = "6.9.0"; # 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 {
# 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});
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".$session->datetime->time().")");
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
$session->close();
}