- Login boxes are now Section 508 compliant.
fixed franks templates added template import mechanism to _upgrade.skeleton
This commit is contained in:
parent
a54aec00a4
commit
8bbe8ff913
8 changed files with 201 additions and 46 deletions
|
|
@ -24,6 +24,7 @@
|
|||
page.
|
||||
- Added a context menu to the last item in the crumb trail in the asset
|
||||
manager as discussed in Community IRC.
|
||||
- Login boxes are now Section 508 compliant.
|
||||
|
||||
6.99.1
|
||||
- Bugfixes on dashboard to fix template errors.
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ sub start {
|
|||
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||
$versionTag->set({name=>"Upgrade to ".$toVersion});
|
||||
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".$session->datetime->time().")");
|
||||
updateTemplates($session);
|
||||
return $session;
|
||||
}
|
||||
|
||||
|
|
@ -60,3 +61,65 @@ sub finish {
|
|||
$session->close();
|
||||
}
|
||||
|
||||
#-------------------------------------------------
|
||||
sub updateTemplates {
|
||||
my $session = shift;
|
||||
return undef unless (-d "templates-".$toVersion);
|
||||
print "\tUpdating templates.\n" unless ($quiet);
|
||||
opendir(DIR,"templates-".$toVersion);
|
||||
my @files = readdir(DIR);
|
||||
closedir(DIR);
|
||||
my $importNode = WebGUI::Asset->getImportNode($session);
|
||||
my $newFolder = undef;
|
||||
foreach my $file (@files) {
|
||||
next unless ($file =~ /\.tmpl$/);
|
||||
open(FILE,"<templates-".$toVersion."/".$file);
|
||||
my $first = 1;
|
||||
my $create = 0;
|
||||
my $head = 0;
|
||||
my %properties = (className=>"WebGUI::Asset::Template");
|
||||
while (my $line = <FILE>) {
|
||||
if ($first) {
|
||||
$line =~ m/^\#(.*)$/;
|
||||
$properties{id} = $1;
|
||||
$first = 0;
|
||||
} elsif ($line =~ m/^\#create$/) {
|
||||
$create = 1;
|
||||
} elsif ($line =~ m/^\#(.*):(.*)$/) {
|
||||
$properties{$1} = $2;
|
||||
} elsif ($line =~ m/^~~~$/) {
|
||||
$head = 1;
|
||||
} elsif ($head) {
|
||||
$properties{headBlock} .= $line;
|
||||
} else {
|
||||
$properties{template} .= $line;
|
||||
}
|
||||
}
|
||||
close(FILE);
|
||||
if ($create) {
|
||||
$newFolder = createNewTemplatesFolder($importNode) unless (defined $newFolder);
|
||||
my $template = $newFolder->addChild(\%properties, $properties{id});
|
||||
} else {
|
||||
my $template = WebGUI::Asset->new($session,$properties{id}, "WebGUI::Asset::Template");
|
||||
if (defined $template) {
|
||||
my $newRevision = $template->addRevision(\%properties);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------
|
||||
sub createNewTemplatesFolder {
|
||||
my $importNode = shift;
|
||||
my $newFolder = $importNode->addChild({
|
||||
className=>"WebGUI::Asset::Wobject::Folder",
|
||||
title => $toVersion." New Templates",
|
||||
menuTitle => $toVersion." New Templates",
|
||||
url=> $toVersion."_new_templates",
|
||||
groupIdView=>"12"
|
||||
});
|
||||
return $newFolder;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
23
docs/upgrades/templates-6.99.2/loginbox1.tmpl
Normal file
23
docs/upgrades/templates-6.99.2/loginbox1.tmpl
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#PBtmpl0000000000000044
|
||||
<div class="loginBox">
|
||||
<tmpl_if user.isVisitor>
|
||||
<tmpl_var form.header>
|
||||
<label for="username_formId"><tmpl_var username.label></label><br />
|
||||
<tmpl_var username.form><br />
|
||||
<label for="identifier_formId"><tmpl_var password.label></label><br />
|
||||
<tmpl_var password.form><br />
|
||||
<tmpl_var form.login>
|
||||
<tmpl_var form.footer>
|
||||
<tmpl_if session.setting.anonymousRegistration>
|
||||
<p><a href="<tmpl_var account.create.url>"><tmpl_var account.create.label></a></p>
|
||||
</tmpl_if>
|
||||
<tmpl_else>
|
||||
<tmpl_unless customText>
|
||||
<tmpl_var hello.label> <a href="<tmpl_var account.display.url>"><tmpl_var session.user.username></a>.
|
||||
<a href="<tmpl_var logout.url>"><tmpl_var logout.label></a>
|
||||
<tmpl_else>
|
||||
<tmpl_var customText>
|
||||
</tmpl_unless>
|
||||
</tmpl_if>
|
||||
</div>
|
||||
|
||||
28
docs/upgrades/templates-6.99.2/loginbox2.tmpl
Normal file
28
docs/upgrades/templates-6.99.2/loginbox2.tmpl
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#PBtmpl0000000000000092
|
||||
<div class="loginBox">
|
||||
<tmpl_if user.isVisitor>
|
||||
<tmpl_var form.header>
|
||||
<table border="0" cellpadding="1" cellspacing="0">
|
||||
<tr>
|
||||
<td><tmpl_var username.form></td>
|
||||
<td><tmpl_var password.form></td>
|
||||
<td><tmpl_var form.login></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="username_formId"><tmpl_var username.label></label></td>
|
||||
<td><label for="identifier_formId"><tmpl_var password.label></label></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table> <tmpl_if session.setting.anonymousRegistration>
|
||||
<a href="<tmpl_var account.create.url>"><tmpl_var account.create.label></a>
|
||||
</tmpl_if> <tmpl_var form.footer>
|
||||
<tmpl_else>
|
||||
<tmpl_unless customText>
|
||||
<tmpl_var hello.label> <a href="<tmpl_var account.display.url>"><tmpl_var session.user.username></a>.
|
||||
<a href="<tmpl_var logout.url>"><tmpl_var logout.label></a>
|
||||
<tmpl_else>
|
||||
<br /><tmpl_var customText>
|
||||
</tmpl_unless>
|
||||
</tmpl_if>
|
||||
</div>
|
||||
|
||||
|
|
@ -1,9 +1,4 @@
|
|||
#ProjectManagerTMPL0002
|
||||
#title:Default Project Display
|
||||
#menuTitle:Default Project Display
|
||||
#url:default-pm-template-project-display
|
||||
#namespace:ProjectManager_project
|
||||
#create
|
||||
<script>
|
||||
var JScolresize="1";
|
||||
var JScolmove="1";
|
||||
|
|
@ -670,4 +665,4 @@
|
|||
background-color:#F0F0F0;
|
||||
color:gray;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,4 @@
|
|||
#TimeTrackingTMPL000003
|
||||
#title:Default Time Tracking Row Template
|
||||
#menuTitle:Default Time Tracking Row Template
|
||||
#url:default-tt-template-row
|
||||
#namespace:TimeTracking_row
|
||||
#create
|
||||
|
||||
<table class="timeTracking02" cellpadding="3" cellspacing="0">
|
||||
<tbody id="ttbody">
|
||||
|
|
@ -70,4 +65,4 @@
|
|||
|
||||
|
||||
~~~
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,4 @@
|
|||
#TimeTrackingTMPL000001
|
||||
#title:Default Time Tracking User View
|
||||
#menuTitle:Default Time Tracking User View
|
||||
#url:default-tt-template-user
|
||||
#namespace:TimeTracking_user
|
||||
#create
|
||||
<tmpl_if session.var.adminOn>
|
||||
<p><tmpl_var controls></p>
|
||||
</tmpl_if>
|
||||
|
|
@ -286,4 +281,4 @@
|
|||
color: black;
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ use Getopt::Long;
|
|||
use WebGUI::Session;
|
||||
|
||||
|
||||
my $toVersion = "0.0.0"; # make this match what version you're going to
|
||||
my $toVersion = "6.99.2"; # make this match what version you're going to
|
||||
my $quiet; # this line required
|
||||
|
||||
|
||||
|
|
@ -26,33 +26,6 @@ updateTT();
|
|||
finish($session); # this line required
|
||||
|
||||
|
||||
##-------------------------------------------------
|
||||
#sub exampleFunction {
|
||||
# my $session = shift;
|
||||
# print "\tWe're doing some stuff here that you should know about.\n" unless ($quiet);
|
||||
# # and here's our code
|
||||
#}
|
||||
|
||||
|
||||
|
||||
# ---- DO NOT EDIT BELOW THIS LINE ----
|
||||
|
||||
#-------------------------------------------------
|
||||
sub start {
|
||||
my $configFile;
|
||||
$|=1; #disable output buffering
|
||||
GetOptions(
|
||||
'configFile=s'=>\$configFile,
|
||||
'quiet'=>\$quiet
|
||||
);
|
||||
my $session = WebGUI::Session->open("../..",$configFile);
|
||||
$session->user({userId=>3});
|
||||
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||
$versionTag->set({name=>"Upgrade to ".$toVersion});
|
||||
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".$session->datetime->time().")");
|
||||
return $session;
|
||||
}
|
||||
|
||||
#-------------------------------------------------
|
||||
sub updateTT {
|
||||
my $tableList = [
|
||||
|
|
@ -94,6 +67,27 @@ sub updateTT {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
# ---- DO NOT EDIT BELOW THIS LINE ----
|
||||
|
||||
#-------------------------------------------------
|
||||
sub start {
|
||||
my $configFile;
|
||||
$|=1; #disable output buffering
|
||||
GetOptions(
|
||||
'configFile=s'=>\$configFile,
|
||||
'quiet'=>\$quiet
|
||||
);
|
||||
my $session = WebGUI::Session->open("../..",$configFile);
|
||||
$session->user({userId=>3});
|
||||
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||
$versionTag->set({name=>"Upgrade to ".$toVersion});
|
||||
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".$session->datetime->time().")");
|
||||
updateTemplates($session);
|
||||
return $session;
|
||||
}
|
||||
|
||||
#-------------------------------------------------
|
||||
sub finish {
|
||||
my $session = shift;
|
||||
|
|
@ -102,3 +96,64 @@ sub finish {
|
|||
$session->close();
|
||||
}
|
||||
|
||||
#-------------------------------------------------
|
||||
sub updateTemplates {
|
||||
my $session = shift;
|
||||
return undef unless (-d "templates-".$toVersion);
|
||||
print "\tUpdating templates.\n" unless ($quiet);
|
||||
opendir(DIR,"templates-".$toVersion);
|
||||
my @files = readdir(DIR);
|
||||
closedir(DIR);
|
||||
my $importNode = WebGUI::Asset->getImportNode($session);
|
||||
my $newFolder = undef;
|
||||
foreach my $file (@files) {
|
||||
next unless ($file =~ /\.tmpl$/);
|
||||
open(FILE,"<templates-".$toVersion."/".$file);
|
||||
my $first = 1;
|
||||
my $create = 0;
|
||||
my $head = 0;
|
||||
my %properties = (className=>"WebGUI::Asset::Template");
|
||||
while (my $line = <FILE>) {
|
||||
if ($first) {
|
||||
$line =~ m/^\#(.*)$/;
|
||||
$properties{id} = $1;
|
||||
$first = 0;
|
||||
} elsif ($line =~ m/^\#create$/) {
|
||||
$create = 1;
|
||||
} elsif ($line =~ m/^\#(.*):(.*)$/) {
|
||||
$properties{$1} = $2;
|
||||
} elsif ($line =~ m/^~~~$/) {
|
||||
$head = 1;
|
||||
} elsif ($head) {
|
||||
$properties{headBlock} .= $line;
|
||||
} else {
|
||||
$properties{template} .= $line;
|
||||
}
|
||||
}
|
||||
close(FILE);
|
||||
if ($create) {
|
||||
$newFolder = createNewTemplatesFolder($importNode) unless (defined $newFolder);
|
||||
my $template = $newFolder->addChild(\%properties, $properties{id});
|
||||
} else {
|
||||
my $template = WebGUI::Asset->new($session,$properties{id}, "WebGUI::Asset::Template");
|
||||
if (defined $template) {
|
||||
my $newRevision = $template->addRevision(\%properties);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------
|
||||
sub createNewTemplatesFolder {
|
||||
my $importNode = shift;
|
||||
my $newFolder = $importNode->addChild({
|
||||
className=>"WebGUI::Asset::Wobject::Folder",
|
||||
title => $toVersion." New Templates",
|
||||
menuTitle => $toVersion." New Templates",
|
||||
url=> $toVersion."_new_templates",
|
||||
groupIdView=>"12"
|
||||
});
|
||||
return $newFolder;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue