Merge branch 'master' of git@github.com:plainblack/webgui
Conflicts: lib/WebGUI/i18n/English/Asset_EMSSubmission.pm
This commit is contained in:
commit
60b04ff928
71 changed files with 686 additions and 176 deletions
|
|
@ -1,7 +1,24 @@
|
||||||
|
7.8.7
|
||||||
|
- fixed #11278: Wrong test for Template::Toolkit in testEnvironment.pl
|
||||||
|
- fixed #11282: USPS Shipping Driver does not accept ZIP+4
|
||||||
|
- fixed #11284: Collaboration System Cron jobs for email
|
||||||
|
|
||||||
7.8.6
|
7.8.6
|
||||||
- fixed #11250: i18n Asset_EMSSubmissionForm::delete created items label help
|
- fixed #11250: i18n Asset_EMSSubmissionForm::delete created items label help
|
||||||
- fixed #11251: perload.perl tries to load t/lib/WebGUI/Test.pm
|
- fixed #11251: perload.perl tries to load t/lib/WebGUI/Test.pm
|
||||||
- fixed #11249: Recaptcha https bug
|
- fixed #11249: Recaptcha https bug
|
||||||
|
- fixed #11200: Navigation in AssetProxy cached in browser
|
||||||
|
- fixed #11143: cancel button
|
||||||
|
- fixed #11259: Snippet content never cached
|
||||||
|
- fixed #11254: RTF files are streamed with the wrong content-type
|
||||||
|
- fixed #10932: code showing
|
||||||
|
- fixed #11265: typo i18n
|
||||||
|
- fixed #11263: CleanLoginHistory can cause workflow errors
|
||||||
|
- fixed #11185: Code editor broken in IE8 for SQLReport
|
||||||
|
- fixed #11177: Code editor steals focus on load
|
||||||
|
- fixed #10888: Final touches on map point bugs
|
||||||
|
- fixed #11274: Add attachment broken in template
|
||||||
|
- fixed #11272: Security issue with asset manager search
|
||||||
|
|
||||||
7.8.5
|
7.8.5
|
||||||
- added the EMS submission subsystem
|
- added the EMS submission subsystem
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -7,6 +7,10 @@ upgrading from one version to the next, or even between multiple
|
||||||
versions. Be sure to heed the warnings contained herein as they will
|
versions. Be sure to heed the warnings contained herein as they will
|
||||||
save you many hours of grief.
|
save you many hours of grief.
|
||||||
|
|
||||||
|
7.8.6
|
||||||
|
--------------------------------------------------------------------
|
||||||
|
* WebGUI now requires LWP 5.833 or higher, to fix a bug in that module.
|
||||||
|
|
||||||
7.8.5
|
7.8.5
|
||||||
--------------------------------------------------------------------
|
--------------------------------------------------------------------
|
||||||
* WebGUI now requires Locales 0.10 or higher, to replace the deprecated
|
* WebGUI now requires Locales 0.10 or higher, to replace the deprecated
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
BIN
docs/upgrades/packages-7.8.6/article-with-image.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/article-with-image.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/article-with-pagination.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/article-with-pagination.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/bulleted_list.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/bulleted_list.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/crumbtrail2.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/crumbtrail2.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/default_article.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/default_article.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/default_page.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/default_page.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/default_poll.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/default_poll.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/default_search2.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/default_search2.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/default_submission.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/default_submission.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/default_syndicated_content.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/default_syndicated_content.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/dropmenu.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/dropmenu.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/file.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/file.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/file_folder.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/file_folder.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/flash-file.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/flash-file.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/horizontalmenu.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/horizontalmenu.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/image.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/image.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/import_hierarchical-top-nav.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/import_hierarchical-top-nav.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/indent_nav.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/indent_nav.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/item.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/item.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/job.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/job.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/link.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/link.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/linked_image_with_caption.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/linked_image_with_caption.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/one_over_three.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/one_over_three.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/one_over_two.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/one_over_two.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/request-tracker-post-template.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/request-tracker-post-template.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/right_column.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/right_column.wgpkg
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/side_by_side.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/side_by_side.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/syndicated_articles.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/syndicated_articles.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/synopsis2.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/synopsis2.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/tabs.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/tabs.wgpkg
Normal file
Binary file not shown.
BIN
docs/upgrades/packages-7.8.6/three-columns.wgpkg
Normal file
BIN
docs/upgrades/packages-7.8.6/three-columns.wgpkg
Normal file
Binary file not shown.
|
|
@ -31,6 +31,7 @@ my $quiet; # this line required
|
||||||
my $session = start(); # this line required
|
my $session = start(); # this line required
|
||||||
|
|
||||||
# upgrade functions go here
|
# upgrade functions go here
|
||||||
|
addMaxCacheOverrideSetting($session);
|
||||||
|
|
||||||
finish($session); # this line required
|
finish($session); # this line required
|
||||||
|
|
||||||
|
|
@ -60,6 +61,16 @@ ENDSQL
|
||||||
# print "DONE!\n" unless $quiet;
|
# print "DONE!\n" unless $quiet;
|
||||||
#}
|
#}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Describe what our function does
|
||||||
|
sub addMaxCacheOverrideSetting {
|
||||||
|
my $session = shift;
|
||||||
|
print "\tAdding maximum cache timeout setting... " unless $quiet;
|
||||||
|
# and here's our code
|
||||||
|
$session->setting->add('maxCacheTimeout', 86400) unless $session->setting->has('maxCacheTimeout');
|
||||||
|
print "DONE!\n" unless $quiet;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
|
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
174
docs/upgrades/upgrade_7.8.6-7.8.7.pl
Normal file
174
docs/upgrades/upgrade_7.8.6-7.8.7.pl
Normal file
|
|
@ -0,0 +1,174 @@
|
||||||
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
# WebGUI is Copyright 2001-2009 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
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
our ($webguiRoot);
|
||||||
|
|
||||||
|
BEGIN {
|
||||||
|
$webguiRoot = "../..";
|
||||||
|
unshift (@INC, $webguiRoot."/lib");
|
||||||
|
}
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use Getopt::Long;
|
||||||
|
use WebGUI::Session;
|
||||||
|
use WebGUI::Storage;
|
||||||
|
use WebGUI::Asset;
|
||||||
|
use WebGUI::Workflow::Cron;
|
||||||
|
use WebGUI::Asset::Wobject::Collaboration;
|
||||||
|
|
||||||
|
|
||||||
|
my $toVersion = '7.8.7';
|
||||||
|
my $quiet; # this line required
|
||||||
|
|
||||||
|
|
||||||
|
my $session = start(); # this line required
|
||||||
|
|
||||||
|
# upgrade functions go here
|
||||||
|
clearOrphanedCSMailCronJobs($session);
|
||||||
|
deleteExtraCronJobsForCS($session);
|
||||||
|
|
||||||
|
finish($session); # this line required
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Describe what our function does
|
||||||
|
#sub exampleFunction {
|
||||||
|
# my $session = shift;
|
||||||
|
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
|
||||||
|
# # and here's our code
|
||||||
|
# print "DONE!\n" unless $quiet;
|
||||||
|
#}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Describe what our function does
|
||||||
|
sub clearOrphanedCSMailCronJobs {
|
||||||
|
my $session = shift;
|
||||||
|
print "\tClear orphaned csworkflow000000000001 Cron Jobs with no CS attached... " unless $quiet;
|
||||||
|
my $crons = WebGUI::Workflow::Cron->getAllTasks($session);
|
||||||
|
##This section of code handles cron jobs created for CS'es where the revision of the
|
||||||
|
##CS with the cron has been deleted.
|
||||||
|
CRON: foreach my $cron (@{ $crons }) {
|
||||||
|
next CRON unless $cron->get('workflowId') eq 'csworkflow000000000001';
|
||||||
|
my $assetId = $cron->get('parameters');
|
||||||
|
my $asset = WebGUI::Asset->newByDynamicClass($session, $assetId);
|
||||||
|
next CRON if $asset;
|
||||||
|
print "\n\t\tDeleting ".$cron->get('title') unless $quiet;
|
||||||
|
$cron->delete;
|
||||||
|
}
|
||||||
|
print "\tDONE!\n" unless $quiet;
|
||||||
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Describe what our function does
|
||||||
|
sub deleteExtraCronJobsForCS {
|
||||||
|
my $session = shift;
|
||||||
|
print "\tGuarantee that each CS has one and only one Cron job. Older jobs will be deleted... " unless $quiet;
|
||||||
|
my $cses = WebGUI::Asset::Wobject::Collaboration->getIsa($session);
|
||||||
|
CS: while( my $cs = $cses->() ) {
|
||||||
|
my @cronIds = $session->db->buildArray('select distinct(getMailCronId) from Collaboration where assetId=?',[$cs->getId]);
|
||||||
|
next CS unless @cronIds > 1;
|
||||||
|
my @oldCronIds = grep { $_ ne $cs->get('getMailCronId') } @cronIds;
|
||||||
|
CRON: foreach my $cronId (@oldCronIds) {
|
||||||
|
my $cron = WebGUI::Workflow::Cron->new($session, $cronId);
|
||||||
|
next CRON unless $cron;
|
||||||
|
print "\n\t\tDeleting ".$cron->get('title') unless $quiet;
|
||||||
|
$cron->delete;
|
||||||
|
}
|
||||||
|
$session->db->write('update Collaboration set getMailCronId=? where assetId=?', [$cs->get('getMailCronId'), $cs->getId]);
|
||||||
|
}
|
||||||
|
print "\tDONE!\n" unless $quiet;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Add a package to the import node
|
||||||
|
sub addPackage {
|
||||||
|
my $session = shift;
|
||||||
|
my $file = shift;
|
||||||
|
|
||||||
|
# Make a storage location for the package
|
||||||
|
my $storage = WebGUI::Storage->createTemp( $session );
|
||||||
|
$storage->addFileFromFilesystem( $file );
|
||||||
|
|
||||||
|
# Import the package into the import node
|
||||||
|
my $package = eval { WebGUI::Asset->getImportNode($session)->importPackage( $storage, { overwriteLatest => 1 } ); };
|
||||||
|
|
||||||
|
if ($package eq 'corrupt') {
|
||||||
|
die "Corrupt package found in $file. Stopping upgrade.\n";
|
||||||
|
}
|
||||||
|
if ($@ || !defined $package) {
|
||||||
|
die "Error during package import on $file: $@\nStopping upgrade\n.";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Turn off the package flag, and set the default flag for templates added
|
||||||
|
my $assetIds = $package->getLineage( ['self','descendants'] );
|
||||||
|
for my $assetId ( @{ $assetIds } ) {
|
||||||
|
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId );
|
||||||
|
if ( !$asset ) {
|
||||||
|
print "Couldn't instantiate asset with ID '$assetId'. Please check package '$file' for corruption.\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
my $properties = { isPackage => 0 };
|
||||||
|
if ($asset->isa('WebGUI::Asset::Template')) {
|
||||||
|
$properties->{isDefault} = 1;
|
||||||
|
}
|
||||||
|
$asset->update( $properties );
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------
|
||||||
|
sub start {
|
||||||
|
my $configFile;
|
||||||
|
$|=1; #disable output buffering
|
||||||
|
GetOptions(
|
||||||
|
'configFile=s'=>\$configFile,
|
||||||
|
'quiet'=>\$quiet
|
||||||
|
);
|
||||||
|
my $session = WebGUI::Session->open($webguiRoot,$configFile);
|
||||||
|
$session->user({userId=>3});
|
||||||
|
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||||
|
$versionTag->set({name=>"Upgrade to ".$toVersion});
|
||||||
|
return $session;
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------
|
||||||
|
sub finish {
|
||||||
|
my $session = shift;
|
||||||
|
updateTemplates($session);
|
||||||
|
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||||
|
$versionTag->commit;
|
||||||
|
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")");
|
||||||
|
$session->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------
|
||||||
|
sub updateTemplates {
|
||||||
|
my $session = shift;
|
||||||
|
return undef unless (-d "packages-".$toVersion);
|
||||||
|
print "\tUpdating packages.\n" unless ($quiet);
|
||||||
|
opendir(DIR,"packages-".$toVersion);
|
||||||
|
my @files = readdir(DIR);
|
||||||
|
closedir(DIR);
|
||||||
|
my $newFolder = undef;
|
||||||
|
foreach my $file (@files) {
|
||||||
|
next unless ($file =~ /\.wgpkg$/);
|
||||||
|
# Fix the filename to include a path
|
||||||
|
$file = "packages-" . $toVersion . "/" . $file;
|
||||||
|
addPackage( $session, $file );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#vim:ft=perl
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package WebGUI;
|
package WebGUI;
|
||||||
|
|
||||||
|
|
||||||
our $VERSION = '7.8.6';
|
our $VERSION = '7.8.7';
|
||||||
our $STATUS = 'beta';
|
our $STATUS = 'beta';
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -336,7 +336,7 @@ sub getInboxNotificationTemplateId {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 getInboxSMSNotificationTemplateId ( )
|
=head2 getInboxSmsNotificationTemplateId ( )
|
||||||
|
|
||||||
This method returns the template ID for inbox SMS notifications.
|
This method returns the template ID for inbox SMS notifications.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1402,6 +1402,21 @@ sub getRoot {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 getSearchUrl ( )
|
||||||
|
|
||||||
|
Returns the URL for the search screen of the asset manager.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub getSearchUrl {
|
||||||
|
my $self = shift;
|
||||||
|
return $self->getUrl( 'op=assetManager;method=search' );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 getSeparator
|
=head2 getSeparator
|
||||||
|
|
@ -2285,16 +2300,18 @@ sub processTemplate {
|
||||||
my $var = shift;
|
my $var = shift;
|
||||||
my $templateId = shift;
|
my $templateId = shift;
|
||||||
my $template = shift;
|
my $template = shift;
|
||||||
|
my $session = $self->session;
|
||||||
|
|
||||||
# Sanity checks
|
# Sanity checks
|
||||||
if (ref $var ne "HASH") {
|
if (ref $var ne "HASH") {
|
||||||
$self->session->errorHandler->error("First argument to processTemplate() should be a hash reference.");
|
$session->errorHandler->error("First argument to processTemplate() should be a hash reference.");
|
||||||
return "Error: Can't process template for asset ".$self->getId." of type ".$self->get("className");
|
return "Error: Can't process template for asset ".$self->getId." of type ".$self->get("className");
|
||||||
}
|
}
|
||||||
$template = WebGUI::Asset->new($self->session, $templateId,"WebGUI::Asset::Template") unless (defined $template);
|
$template = WebGUI::Asset->new($session, $templateId,"WebGUI::Asset::Template") unless (defined $template);
|
||||||
if (defined $template) {
|
if (defined $template) {
|
||||||
$var = { %{ $var }, %{ $self->getMetaDataAsTemplateVariables } };
|
$var = { %{ $var }, %{ $self->getMetaDataAsTemplateVariables } };
|
||||||
$var->{'controls'} = $self->getToolbar if $self->session->var->isAdminOn;
|
$var->{'controls'} = $self->getToolbar if $session->var->isAdminOn;
|
||||||
|
$var->{'assetIdHex'} = $session->id->toHex($self->getId);
|
||||||
my %vars = (
|
my %vars = (
|
||||||
%{$self->{_properties}},
|
%{$self->{_properties}},
|
||||||
'title' => $self->getTitle,
|
'title' => $self->getTitle,
|
||||||
|
|
@ -2304,7 +2321,7 @@ sub processTemplate {
|
||||||
return $template->process(\%vars);
|
return $template->process(\%vars);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$self->session->errorHandler->error("Can't instantiate template $templateId for asset ".$self->getId);
|
$session->errorHandler->error("Can't instantiate template $templateId for asset ".$self->getId);
|
||||||
my $i18n = WebGUI::International->new($self->session, 'Asset');
|
my $i18n = WebGUI::International->new($self->session, 'Asset');
|
||||||
return $i18n->get('Error: Cannot instantiate template').' '.$templateId;
|
return $i18n->get('Error: Cannot instantiate template').' '.$templateId;
|
||||||
}
|
}
|
||||||
|
|
@ -2889,8 +2906,7 @@ sub www_editSave {
|
||||||
|
|
||||||
=head2 www_manageAssets ( )
|
=head2 www_manageAssets ( )
|
||||||
|
|
||||||
Redirect to the asset manager content handler (for backwards
|
Redirect to the asset manager content handler (for backwards compatibility)
|
||||||
compatibility)
|
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -2902,6 +2918,21 @@ sub www_manageAssets {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_searchAssets ( )
|
||||||
|
|
||||||
|
Redirect to the asset manager content handler (for backwards
|
||||||
|
compatibility)
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub www_searchAssets {
|
||||||
|
my $self = shift;
|
||||||
|
$self->session->http->setRedirect( $self->getSearchUrl );
|
||||||
|
return "redirect";
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 www_view ( )
|
=head2 www_view ( )
|
||||||
|
|
||||||
Returns the view() method of the asset object if the requestor canView.
|
Returns the view() method of the asset object if the requestor canView.
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,30 @@ sub exportGetUrlAsPath {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 getCache ( $calledAsWebMethod )
|
||||||
|
|
||||||
|
Overrides the base method to handle Snippet specific caching.
|
||||||
|
|
||||||
|
=head3 $calledAsWebMethod
|
||||||
|
|
||||||
|
If this is true, then change the cache key.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub getCache {
|
||||||
|
my $self = shift;
|
||||||
|
my $calledAsWebMethod = shift;
|
||||||
|
my $session = $self->session;
|
||||||
|
my $cacheKey = "view_".$calledAsWebMethod.'_'.$self->getId;
|
||||||
|
if ($session->env->sslRequest) {
|
||||||
|
$cacheKey .= '_ssl';
|
||||||
|
}
|
||||||
|
my $cache = WebGUI::Cache->new($session, $cacheKey);
|
||||||
|
return $cache;
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 getToolbar ( )
|
=head2 getToolbar ( )
|
||||||
|
|
||||||
Returns a toolbar with a set of icons that hyperlink to functions that delete, edit, promote, demote, cut, and copy.
|
Returns a toolbar with a set of icons that hyperlink to functions that delete, edit, promote, demote, cut, and copy.
|
||||||
|
|
@ -253,6 +277,8 @@ sub purgeCache {
|
||||||
|
|
||||||
WebGUI::Cache->new($self->session,"view__".$self->getId)->delete;
|
WebGUI::Cache->new($self->session,"view__".$self->getId)->delete;
|
||||||
WebGUI::Cache->new($self->session,"view_1_".$self->getId)->delete;
|
WebGUI::Cache->new($self->session,"view_1_".$self->getId)->delete;
|
||||||
|
WebGUI::Cache->new($self->session,"view__".$self->getId."_ssl")->delete;
|
||||||
|
WebGUI::Cache->new($self->session,"view_1_".$self->getId."_ssl")->delete;
|
||||||
$self->SUPER::purgeCache();
|
$self->SUPER::purgeCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -270,16 +296,16 @@ toolbar if in adminMode.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub view {
|
sub view {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $calledAsWebMethod = shift;
|
my $calledAsWebMethod = shift;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
my $versionTag = WebGUI::VersionTag->getWorking($session, 1);
|
my $versionTag = WebGUI::VersionTag->getWorking($session, 1);
|
||||||
my $noCache =
|
my $noCache =
|
||||||
$session->var->isAdminOn
|
$session->var->isAdminOn
|
||||||
|| $self->get("cacheTimeout") <= 10
|
|| $self->get("cacheTimeout") <= 10
|
||||||
|| ($versionTag && $versionTag->getId eq $self->get("tagId"));
|
|| ($versionTag && $versionTag->getId eq $self->get("tagId"));
|
||||||
unless ($noCache) {
|
unless ($noCache) {
|
||||||
my $cache = $self->getCache;
|
my $cache = $self->getCache($calledAsWebMethod);
|
||||||
my $out = $cache->get if defined $cache;
|
my $out = $cache->get if defined $cache;
|
||||||
return $out if $out;
|
return $out if $out;
|
||||||
}
|
}
|
||||||
|
|
@ -293,7 +319,8 @@ sub view {
|
||||||
}
|
}
|
||||||
WebGUI::Macro::process($session,\$output);
|
WebGUI::Macro::process($session,\$output);
|
||||||
unless ($noCache) {
|
unless ($noCache) {
|
||||||
WebGUI::Cache->new($session,"view_".$calledAsWebMethod."_".$self->getId)->set($output,$self->get("cacheTimeout"));
|
my $cache = $self->getCache($calledAsWebMethod);
|
||||||
|
$cache->set($output,$self->get("cacheTimeout"));
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -946,6 +946,16 @@ sub duplicate {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $newAsset = $self->next::method(@_);
|
my $newAsset = $self->next::method(@_);
|
||||||
$newAsset->createSubscriptionGroup;
|
$newAsset->createSubscriptionGroup;
|
||||||
|
my $i18n = WebGUI::International->new($self->session, "Asset_Collaboration");
|
||||||
|
my $newCron = WebGUI::Workflow::Cron->create($self->session, {
|
||||||
|
title=>$self->getTitle." ".$i18n->get("mail"),
|
||||||
|
minuteOfHour=>"*/".($self->get("getMailInterval")/60),
|
||||||
|
className=>(ref $self),
|
||||||
|
methodName=>"new",
|
||||||
|
parameters=>$self->getId,
|
||||||
|
workflowId=>"csworkflow000000000001"
|
||||||
|
});
|
||||||
|
$self->update({getMailCronId=>$newCron->getId});
|
||||||
return $newAsset;
|
return $newAsset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,9 @@ sub handler {
|
||||||
my $asset = getAsset($session, getRequestedAssetUrl($session));
|
my $asset = getAsset($session, getRequestedAssetUrl($session));
|
||||||
|
|
||||||
# display from cache if page hasn't been modified.
|
# display from cache if page hasn't been modified.
|
||||||
if ($var->get("userId") eq "1" && defined $asset && !$http->ifModifiedSince($asset->getContentLastModified)) {
|
if ($var->get("userId") eq "1"
|
||||||
|
&& defined $asset
|
||||||
|
&& !$http->ifModifiedSince($asset->getContentLastModified, $session->setting->get('maxCacheTimeout'))) {
|
||||||
$http->setStatus("304","Content Not Modified");
|
$http->setStatus("304","Content Not Modified");
|
||||||
$http->sendHeader;
|
$http->sendHeader;
|
||||||
$session->close;
|
$session->close;
|
||||||
|
|
|
||||||
|
|
@ -19,17 +19,20 @@ Gets a select box to choose a class name.
|
||||||
|
|
||||||
sub getClassSelectBox {
|
sub getClassSelectBox {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
|
my $i18n = WebGUI::International->new($session, 'Asset');
|
||||||
|
|
||||||
tie my %classes, "Tie::IxHash", (
|
tie my %classes, "Tie::IxHash", (
|
||||||
"" => "Any Class",
|
"" => $i18n->get("Any Class"),
|
||||||
$session->db->buildHash("select distinct(className) from asset"),
|
$session->db->buildHash("select distinct(className) from asset"),
|
||||||
);
|
);
|
||||||
delete $classes{"WebGUI::Asset"}; # don't want to search for the root asset
|
delete $classes{"WebGUI::Asset"}; # don't want to search for the root asset
|
||||||
|
|
||||||
|
my $className = $session->scratch->get('assetManagerSearchClassName') || $session->form->process("class","className");
|
||||||
|
$session->scratch->set('assetManagerSearchClassName', $className);
|
||||||
return WebGUI::Form::selectBox( $session, {
|
return WebGUI::Form::selectBox( $session, {
|
||||||
name => "class",
|
name => "class",
|
||||||
value => $session->form->process("class","className"),
|
value => $className,
|
||||||
defaultValue => "",
|
defaultValue => "",
|
||||||
options => \%classes,
|
options => \%classes,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -142,8 +145,10 @@ sub getSearchPaginator {
|
||||||
$queryString .= ';class=' . $class;
|
$queryString .= ';class=' . $class;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $p = $s->getPaginatorResultSet( $session->url->page( $queryString ) );
|
my $pageNumber = $session->scratch->get('assetManagerSearchPageNumber') || $session->form->get('pn');
|
||||||
|
my $p = $s->getPaginatorResultSet( $session->url->page( $queryString ), undef, $pageNumber );
|
||||||
|
|
||||||
|
$session->scratch->set('assetManagerSearchPageNumber', $pageNumber);
|
||||||
return $p;
|
return $p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -533,64 +538,36 @@ sub www_search {
|
||||||
$session->style->setScript( $session->url->extras( 'yui/build/yahoo-dom-event/yahoo-dom-event.js' ) );
|
$session->style->setScript( $session->url->extras( 'yui/build/yahoo-dom-event/yahoo-dom-event.js' ) );
|
||||||
$session->style->setScript( $session->url->extras( 'yui-webgui/build/assetManager/assetManager.js' ) );
|
$session->style->setScript( $session->url->extras( 'yui-webgui/build/assetManager/assetManager.js' ) );
|
||||||
$session->style->setScript( $session->url->extras( 'yui-webgui/build/form/form.js' ) );
|
$session->style->setScript( $session->url->extras( 'yui-webgui/build/form/form.js' ) );
|
||||||
|
my $keywords = $session->scratch->get('assetManagerSearchKeywords') || $session->form->get('keywords');
|
||||||
|
|
||||||
### Show the form
|
### Show the form
|
||||||
$output .= q{<form method="post" enctype="multipart/form-data" action="} . $currentAsset->getUrl . q{"><p>}
|
$output .= q{<form method="post" enctype="multipart/form-data" action="} . $currentAsset->getUrl . q{"><p>}
|
||||||
. q{<input type="hidden" name="op" value="assetManager" />}
|
. q{<input type="hidden" name="op" value="assetManager" />}
|
||||||
. q{<input type="hidden" name="method" value="search" />}
|
. q{<input type="hidden" name="method" value="search" />}
|
||||||
. q{<input type="text" size="45" name="keywords" value="} . $session->form->get('keywords') . q{" />}
|
. q{<input type="text" size="45" name="keywords" value="} . $keywords . q{" />}
|
||||||
. getClassSelectBox( $session )
|
. getClassSelectBox( $session )
|
||||||
. q{<input type="submit" name="action" value="}.$i18n->get( "search" ).q{" />}
|
. q{<input type="submit" name="action" value="}.$i18n->get( "search" ).q{" />}
|
||||||
. q{</p></form>}
|
. q{</p></form>}
|
||||||
;
|
;
|
||||||
|
|
||||||
### Actions
|
|
||||||
if ( my $action = lc $session->form->get( 'action' ) ) {
|
|
||||||
my @assetIds = $session->form->get( 'assetId' );
|
|
||||||
|
|
||||||
if ( $action eq "delete" ) { ##aka trash
|
|
||||||
for my $assetId ( @assetIds ) {
|
|
||||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId );
|
|
||||||
next unless $asset;
|
|
||||||
$asset->trash;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elsif ( $action eq "cut" ) {
|
|
||||||
for my $assetId ( @assetIds ) {
|
|
||||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId );
|
|
||||||
next unless $asset;
|
|
||||||
$asset->cut;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elsif ( $action eq "copy" ) {
|
|
||||||
for my $assetId ( @assetIds ) {
|
|
||||||
# Copy == Duplicate + Cut
|
|
||||||
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId);
|
|
||||||
my $newAsset = $asset->duplicate( { skipAutoCommitWorkflows => 1 } );
|
|
||||||
$newAsset->update( { title => $newAsset->getTitle . ' (copy)' } );
|
|
||||||
$newAsset->cut;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
### Run the search
|
### Run the search
|
||||||
if ( $session->form->get( 'keywords' ) || $session->form->get( 'class' ) ) {
|
if ( $keywords || $session->form->get( 'class' ) ) {
|
||||||
my $keywords = $session->form->get( 'keywords' );
|
my @classes = $session->form->get( 'class' );
|
||||||
my @classes = $session->form->get( 'class' );
|
my $keywordsScrubbed = $keywords;
|
||||||
|
|
||||||
# Detect a helper word key
|
# Detect a helper word key
|
||||||
my @assetIds = ($keywords =~ /assetid:\s*([^\s]+)/gi);
|
my @assetIds = ($keywords =~ /assetid:\s*([^\s]+)/gi);
|
||||||
|
|
||||||
# purge helper word keys
|
# purge helper word keys
|
||||||
if (@assetIds) {
|
if (@assetIds) {
|
||||||
$keywords =~ s/\bassetid:\s*[^\s]+//gi;
|
$keywordsScrubbed =~ s/\bassetid:\s*[^\s]+//gi;
|
||||||
}
|
}
|
||||||
$keywords =~ s/^\s+//g;
|
$keywordsScrubbed =~ s/^\s+//g;
|
||||||
$keywords =~ s/\s+$//g;
|
$keywordsScrubbed =~ s/\s+$//g;
|
||||||
|
|
||||||
my $p = getSearchPaginator( $session, {
|
my $p = getSearchPaginator( $session, {
|
||||||
assetIds => \@assetIds,
|
assetIds => \@assetIds,
|
||||||
keywords => $keywords,
|
keywords => $keywordsScrubbed,
|
||||||
classes => \@classes,
|
classes => \@classes,
|
||||||
orderByColumn => $session->form->get( 'orderByColumn' ),
|
orderByColumn => $session->form->get( 'orderByColumn' ),
|
||||||
orderByDirection => $session->form->get( 'orderByDirection' ),
|
orderByDirection => $session->form->get( 'orderByDirection' ),
|
||||||
|
|
@ -601,9 +578,10 @@ sub www_search {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
### Display the search results
|
### Display the search results
|
||||||
$output .= q{<form method="post" enctype="multipart/form-data">}
|
$output .= q{<form method="post" enctype="multipart/form-data" action="}.$currentAsset->getUrl.q{">}
|
||||||
. q{<input type="hidden" name="op" value="assetManager" />}
|
. q{<input type="hidden" name="func" value="searchAssets" />}
|
||||||
. q{<input type="hidden" name="method" value="search" />}
|
. q{<input type="hidden" name="proceed" value="searchAssets" />}
|
||||||
|
. WebGUI::Form::CsrfToken->new($session)->toHtml
|
||||||
. q{<input type="hidden" name="pn" value="} . $session->form->get('pn') . q{" />}
|
. q{<input type="hidden" name="pn" value="} . $session->form->get('pn') . q{" />}
|
||||||
. q{<input type="hidden" name="keywords" value="} . $keywords . q{" />}
|
. q{<input type="hidden" name="keywords" value="} . $keywords . q{" />}
|
||||||
;
|
;
|
||||||
|
|
@ -707,9 +685,9 @@ sub www_search {
|
||||||
$output .= q{</tbody>}
|
$output .= q{</tbody>}
|
||||||
. q{</table>}
|
. q{</table>}
|
||||||
. q{<p class="actions">} . $i18n->get( 'with selected' )
|
. q{<p class="actions">} . $i18n->get( 'with selected' )
|
||||||
. q{<input type="submit" name="action" value="}.$i18n->get( 'delete' ) . q{" />}
|
. q{<input type="submit" name="action" value="}.$i18n->get( 'delete' ) . q[" onclick="if(confirm('].$i18n->get('43').q[')){this.form.func.value='deleteList'; this.form.submit();}{ return false; }" />]
|
||||||
. q{<input type="submit" name="action" value="}.$i18n->get( "cut" ) . q{" />}
|
. q{<input type="submit" name="action" value="}.$i18n->get( "cut" ) . q{" onclick="this.form.func.value='cutList'; this.form.submit();" />}
|
||||||
. q{<input type="submit" name="action" value="}.$i18n->get( "Copy" ) .q{" />}
|
. q{<input type="submit" name="action" value="}.$i18n->get( "Copy" ) .q{" onclick="this.form.func.value='copyList'; this.form.submit();" />}
|
||||||
. q{</p>}
|
. q{</p>}
|
||||||
. q{</form>}
|
. q{</form>}
|
||||||
;
|
;
|
||||||
|
|
@ -730,6 +708,7 @@ sub www_search {
|
||||||
|
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
|
|
||||||
|
$session->scratch->set('assetManagerSearchKeywords', $keywords);
|
||||||
return $ac->render( $output );
|
return $ac->render( $output );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,15 @@ use Exception::Class (
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sub WebGUI::Error::full_message {
|
||||||
|
my $self = shift;
|
||||||
|
my $message = $self->message ? $self->message : $self->description;
|
||||||
|
my @fields = map { defined $self->$_ ? ($_ . ': ' . $self->$_) : () } $self->Fields;
|
||||||
|
if (@fields) {
|
||||||
|
$message .= ' (' . join( q{, }, @fields ) . ')';
|
||||||
|
}
|
||||||
|
return $message;
|
||||||
|
}
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,16 +60,9 @@ time - time component formatted as HH:MM:SS
|
||||||
sub process {
|
sub process {
|
||||||
my ( $session, $toTZ, $format, $date, $time ) = @_;
|
my ( $session, $toTZ, $format, $date, $time ) = @_;
|
||||||
|
|
||||||
my $uTZ = 'UTC';
|
my $uTZ = $session->user->profileField("timeZone");
|
||||||
my $uFormat = '%F %T';
|
my $uFormat = $session->user->profileField("dateFormat");
|
||||||
|
|
||||||
# Change defaults only if we have a user defined and they have these set.
|
|
||||||
eval { $session->user };
|
|
||||||
unless ($@) {
|
|
||||||
$uTZ = $session->user->profileField("timeZone");
|
|
||||||
$uFormat = $session->user->profileField("dateFormat");
|
|
||||||
}
|
|
||||||
|
|
||||||
$toTZ ||= $uTZ;
|
$toTZ ||= $uTZ;
|
||||||
$format ||= $uFormat;
|
$format ||= $uFormat;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,8 @@ sub process {
|
||||||
my $i18n = WebGUI::International->new($session, "Macro_SpectreCheck");
|
my $i18n = WebGUI::International->new($session, "Macro_SpectreCheck");
|
||||||
if (defined $status) {
|
if (defined $status) {
|
||||||
return $i18n->get('success') if($status eq 'success');
|
return $i18n->get('success') if($status eq 'success');
|
||||||
return $i18n->get('subnet') if($status eq 'subnet');
|
return $i18n->get('subnet') if($status eq 'subnet');
|
||||||
return $i18n->get('spectre') if($status eq 'spectre');
|
return $i18n->get('spectre');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return $i18n->get('spectre');
|
return $i18n->get('spectre');
|
||||||
|
|
|
||||||
|
|
@ -204,6 +204,14 @@ sub definition {
|
||||||
hoverHelp=>$i18n->get("Enable Metadata description"),
|
hoverHelp=>$i18n->get("Enable Metadata description"),
|
||||||
defaultValue=>$setting->get("metaDataEnabled")
|
defaultValue=>$setting->get("metaDataEnabled")
|
||||||
});
|
});
|
||||||
|
push(@fields, {
|
||||||
|
tab=>"content",
|
||||||
|
fieldType=>"interval",
|
||||||
|
name=>"maxCacheTimeout",
|
||||||
|
label=>$i18n->get("Maximum cache timeout"),
|
||||||
|
hoverHelp=>$i18n->get("Maximum cache timeout description"),
|
||||||
|
defaultValue=>$setting->get("maxCacheTimeout")
|
||||||
|
});
|
||||||
# user interface settings
|
# user interface settings
|
||||||
push(@fields, {
|
push(@fields, {
|
||||||
tab=>"ui",
|
tab=>"ui",
|
||||||
|
|
|
||||||
|
|
@ -205,19 +205,36 @@ sub getStreamedFile {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 ifModifiedSince ( epoch )
|
=head2 ifModifiedSince ( epoch [, maxCacheTimeout] )
|
||||||
|
|
||||||
Returns 1 if the epoch is greater than the modified date check.
|
Returns 1 if the epoch is greater than the modified date check.
|
||||||
|
|
||||||
|
=head3 epoch
|
||||||
|
|
||||||
|
The date that the requested content was last modified in epoch format.
|
||||||
|
|
||||||
|
=head3 maxCacheTimeout
|
||||||
|
|
||||||
|
A modifier to the epoch, that allows us to set a maximum timeout where content will appear to
|
||||||
|
have changed and a new page request will be allowed to be processed.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub ifModifiedSince {
|
sub ifModifiedSince {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $epoch = shift;
|
my $epoch = shift;
|
||||||
|
my $maxCacheTimeout = shift;
|
||||||
require APR::Date;
|
require APR::Date;
|
||||||
my $modified = $self->session->request->headers_in->{'If-Modified-Since'};
|
my $modified = $self->session->request->headers_in->{'If-Modified-Since'};
|
||||||
return 1 if ($modified eq "");
|
return 1 if ($modified eq "");
|
||||||
$modified = APR::Date::parse_http($modified);
|
$modified = APR::Date::parse_http($modified);
|
||||||
|
##Implement a step function that increments the epoch time in integer multiples of
|
||||||
|
##the maximum cache time. Used to handle the case where layouts containing macros
|
||||||
|
##(like assetproxied Navigations) can be periodically updated.
|
||||||
|
if ($maxCacheTimeout) {
|
||||||
|
my $delta = time() - $epoch;
|
||||||
|
$epoch += $delta - ($delta % $maxCacheTimeout);
|
||||||
|
}
|
||||||
return ($epoch > $modified);
|
return ($epoch > $modified);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,9 +54,12 @@ sub buildXML {
|
||||||
$xmlTop->{Package} = [];
|
$xmlTop->{Package} = [];
|
||||||
##Do a request for each package.
|
##Do a request for each package.
|
||||||
my $packageIndex;
|
my $packageIndex;
|
||||||
my $shipType = $self->get('shipType');
|
my $shipType = $self->get('shipType');
|
||||||
my $service = $shipType eq 'PRIORITY VARIABLE' ? 'PRIORITY'
|
my $service = $shipType eq 'PRIORITY VARIABLE'
|
||||||
: $shipType;
|
? 'PRIORITY'
|
||||||
|
: $shipType;
|
||||||
|
my $sourceZip = $self->get('sourceZip');
|
||||||
|
$sourceZip =~ s/^(\d{5}).*$/$1/;
|
||||||
PACKAGE: for(my $packageIndex = 0; $packageIndex < scalar @packages; $packageIndex++) {
|
PACKAGE: for(my $packageIndex = 0; $packageIndex < scalar @packages; $packageIndex++) {
|
||||||
my $package = $packages[$packageIndex];
|
my $package = $packages[$packageIndex];
|
||||||
next PACKAGE unless scalar @{ $package };
|
next PACKAGE unless scalar @{ $package };
|
||||||
|
|
@ -79,6 +82,7 @@ sub buildXML {
|
||||||
}
|
}
|
||||||
my $destination = $package->[0]->getShippingAddress;
|
my $destination = $package->[0]->getShippingAddress;
|
||||||
my $destZipCode = $destination->get('code');
|
my $destZipCode = $destination->get('code');
|
||||||
|
$destZipCode =~ s/^(\d{5}).*$/$1/;
|
||||||
$packageData{ID} = $packageIndex;
|
$packageData{ID} = $packageIndex;
|
||||||
$packageData{Service} = [ $service ];
|
$packageData{Service} = [ $service ];
|
||||||
$packageData{ZipOrigination} = [ $self->get('sourceZip') ];
|
$packageData{ZipOrigination} = [ $self->get('sourceZip') ];
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,6 @@ sub new {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
my $startingTabs = shift;
|
my $startingTabs = shift;
|
||||||
my $css = shift || $session->url->extras('tabs/tabs.css');
|
my $css = shift || $session->url->extras('tabs/tabs.css');
|
||||||
my $cancelUrl = shift || $session->url->page();
|
|
||||||
my %tabs;
|
my %tabs;
|
||||||
tie %tabs, 'Tie::IxHash';
|
tie %tabs, 'Tie::IxHash';
|
||||||
foreach my $key (keys %{$startingTabs}) {
|
foreach my $key (keys %{$startingTabs}) {
|
||||||
|
|
@ -206,9 +205,13 @@ sub new {
|
||||||
$tabs{$key}{uiLevel} = $startingTabs->{$key}->{uiLevel};
|
$tabs{$key}{uiLevel} = $startingTabs->{$key}->{uiLevel};
|
||||||
}
|
}
|
||||||
my $i18n = WebGUI::International->new($session);
|
my $i18n = WebGUI::International->new($session);
|
||||||
|
my $cancelJS = 'history.go(-1);';
|
||||||
|
if (my $cancelURL = $session->env->get('HTTP_REFERER')) {
|
||||||
|
$cancelJS = sprintf q{window.location.href='%s';}, $cancelURL;
|
||||||
|
}
|
||||||
my $cancel = WebGUI::Form::button($session,{
|
my $cancel = WebGUI::Form::button($session,{
|
||||||
value=>$i18n->get('cancel'),
|
value=>$i18n->get('cancel'),
|
||||||
extras=>q|onclick="history.go(-1);" class="backwardButton"|
|
extras=>sprintf(q|onclick="%s" class="backwardButton"|, $cancelJS),
|
||||||
});
|
});
|
||||||
bless { _session=>$session, _cancel=>$cancel, _submit=>WebGUI::Form::submit($session),
|
bless { _session=>$session, _cancel=>$cancel, _submit=>WebGUI::Form::submit($session),
|
||||||
_form=>WebGUI::Form::formHeader($session), _hidden=>"", _tab=>\%tabs, _css=>$css }, $class;
|
_form=>WebGUI::Form::formHeader($session), _hidden=>"", _tab=>\%tabs, _css=>$css }, $class;
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ sub execute {
|
||||||
# Stop if there are no records preceding ageToDelete
|
# Stop if there are no records preceding ageToDelete
|
||||||
next USERLOOP unless @deleteTimes;
|
next USERLOOP unless @deleteTimes;
|
||||||
|
|
||||||
my $inTimes = WebGUI::SQL::quoteAndJoin( \@deleteTimes );
|
my $inTimes = $db->quoteAndJoin( \@deleteTimes );
|
||||||
$db->write( "DELETE FROM userLoginLog WHERE userId = ? AND timeStamp IN ($inTimes)", [$userId] );
|
$db->write( "DELETE FROM userLoginLog WHERE userId = ? AND timeStamp IN ($inTimes)", [$userId] );
|
||||||
} ## end while ( my (@userIdData) ...
|
} ## end while ( my (@userIdData) ...
|
||||||
} ## end else [ if ( not $self->get("retainLastAlways"...
|
} ## end else [ if ( not $self->get("retainLastAlways"...
|
||||||
|
|
|
||||||
|
|
@ -1392,6 +1392,12 @@ Couldn't open %-s because %-s <br />
|
||||||
context => q{},
|
context => q{},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'Any Class' => {
|
||||||
|
message => q{Any Class},
|
||||||
|
lastUpdated => 0,
|
||||||
|
context => q{Class, as in name of class, or type of asset},
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
|
|
@ -4660,6 +4660,16 @@ Users may override this setting in their profile.
|
||||||
lastUpdated => 0,
|
lastUpdated => 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'Maximum cache timeout' => {
|
||||||
|
message => 'Maximum cache timeout',
|
||||||
|
lastUpdated => 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
'Maximum cache timeout description' => {
|
||||||
|
message => 'This timeout will override the content check that is done before generating a page. It can help with caching problems for macros and Navigations. Setting it to 0 will disable the timeout. A setting of several hours is recommended.',
|
||||||
|
lastUpdated => 0,
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@ use strict;
|
||||||
|
|
||||||
my $webguiRoot = '/data/WebGUI';
|
my $webguiRoot = '/data/WebGUI';
|
||||||
|
|
||||||
@INC = "$webguiRoot/lib", grep { $_ ne q{.} } @INC;
|
@INC = grep { $_ ne q{.} } @INC;
|
||||||
|
|
||||||
|
unshift @INC, "$webguiRoot/lib";
|
||||||
|
|
||||||
# add custom lib directories to library search path
|
# add custom lib directories to library search path
|
||||||
unshift @INC, grep {
|
unshift @INC, grep {
|
||||||
|
|
|
||||||
|
|
@ -60,10 +60,10 @@ if ($] >= 5.008) {
|
||||||
##Doing this as a global is not nice, but it works
|
##Doing this as a global is not nice, but it works
|
||||||
my $missingModule = 0;
|
my $missingModule = 0;
|
||||||
|
|
||||||
checkModule("LWP", 5.824 );
|
checkModule("LWP", 5.833 );
|
||||||
checkModule("HTTP::Request", 1.40 );
|
checkModule("HTTP::Request", 1.40 );
|
||||||
checkModule("HTTP::Headers", 1.61 );
|
checkModule("HTTP::Headers", 1.61 );
|
||||||
checkModule("Test::More", 0.61, 2 );
|
checkModule("Test::More", 0.82, 2 );
|
||||||
checkModule("Test::MockObject", 1.02, 2 );
|
checkModule("Test::MockObject", 1.02, 2 );
|
||||||
checkModule("Test::Deep", 0.095, 2 );
|
checkModule("Test::Deep", 0.095, 2 );
|
||||||
checkModule("Test::Exception", 0.27, 2 );
|
checkModule("Test::Exception", 0.27, 2 );
|
||||||
|
|
@ -95,7 +95,7 @@ checkModule("HTML::Highlight", 0.20 );
|
||||||
checkModule("HTML::TagFilter", 1.03 );
|
checkModule("HTML::TagFilter", 1.03 );
|
||||||
checkModule("HTML::Template", 2.9 );
|
checkModule("HTML::Template", 2.9 );
|
||||||
checkModule("HTML::Template::Expr", 0.07, 2 );
|
checkModule("HTML::Template::Expr", 0.07, 2 );
|
||||||
checkModule("Template::Toolkit", 2.20, 2 );
|
checkModule("Template", 2.20, 2 );
|
||||||
checkModule("XML::FeedPP", 0.40 );
|
checkModule("XML::FeedPP", 0.40 );
|
||||||
checkModule("JSON", 2.12 );
|
checkModule("JSON", 2.12 );
|
||||||
checkModule("Config::JSON", "1.3.1" );
|
checkModule("Config::JSON", "1.3.1" );
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,14 @@ use lib "$FindBin::Bin/../lib";
|
||||||
|
|
||||||
use WebGUI::Test;
|
use WebGUI::Test;
|
||||||
use WebGUI::Session;
|
use WebGUI::Session;
|
||||||
use Test::More tests => 16; # increment this value for each test you create
|
use Test::More tests => 18; # increment this value for each test you create
|
||||||
use WebGUI::Asset::Snippet;
|
use WebGUI::Asset::Snippet;
|
||||||
|
|
||||||
my $session = WebGUI::Test->session;
|
my $session = WebGUI::Test->session;
|
||||||
my $node = WebGUI::Asset->getImportNode($session);
|
my $node = WebGUI::Asset->getImportNode($session);
|
||||||
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||||
$versionTag->set({name=>"Snippet Test"});
|
$versionTag->set({name=>"Snippet Test"});
|
||||||
WebGUI::Test->tagsToRollback($versionTag);
|
addToCleanup($versionTag);
|
||||||
my $snippet = $node->addChild({className=>'WebGUI::Asset::Snippet'});
|
my $snippet = $node->addChild({className=>'WebGUI::Asset::Snippet'});
|
||||||
|
|
||||||
# Test for a sane object type
|
# Test for a sane object type
|
||||||
|
|
@ -86,6 +86,21 @@ is($snippet->view(), 'WebGUI', 'Interpolating macros in works with template in t
|
||||||
my $empty = $node->addChild( { className => 'WebGUI::Asset::Snippet', } );
|
my $empty = $node->addChild( { className => 'WebGUI::Asset::Snippet', } );
|
||||||
is($empty->www_view, 'empty', 'www_view: snippet with no content returns "empty"');
|
is($empty->www_view, 'empty', 'www_view: snippet with no content returns "empty"');
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
#Check caching
|
||||||
|
|
||||||
|
##Set up the snippet to do caching
|
||||||
|
$snippet->update({
|
||||||
|
cacheTimeout => 100,
|
||||||
|
snippet => 'Cache test: ^#;',
|
||||||
|
});
|
||||||
|
|
||||||
|
$versionTag->commit;
|
||||||
|
|
||||||
|
is $snippet->view, 'Cache test: 1', 'validate snippet content and set cache';
|
||||||
|
$session->user({userId => 3});
|
||||||
|
is $snippet->view(1), 'Cache test: 3', 'receive uncached content since view was passed the webMethod flag';
|
||||||
|
|
||||||
TODO: {
|
TODO: {
|
||||||
local $TODO = "Tests to make later";
|
local $TODO = "Tests to make later";
|
||||||
ok(0, 'Test indexContent method');
|
ok(0, 'Test indexContent method');
|
||||||
|
|
|
||||||
|
|
@ -8,19 +8,6 @@
|
||||||
# http://www.plainblack.com info@plainblack.com
|
# http://www.plainblack.com info@plainblack.com
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
# XXX I (chrisn) started this file to test the features I added to the
|
|
||||||
# Collaboration / Post system for 7.5, but didn't have the time available to me
|
|
||||||
# to do a full test suite for the Collaboration Wobject. This means that this
|
|
||||||
# test suite is *largely incomplete* and should be finished. What is here *is*
|
|
||||||
# the following:
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# 1. The basic framework for a test suite for the Collaboration Wobject.
|
|
||||||
# Includes setup, cleanup, boilerplate, etc. Basically the really boring,
|
|
||||||
# repetitive parts of the test that you don't want to write yourself.
|
|
||||||
# 2. The tests for the features I've implemented; namely, the groupToEditPost
|
|
||||||
# functionality.
|
|
||||||
|
|
||||||
use FindBin;
|
use FindBin;
|
||||||
use strict;
|
use strict;
|
||||||
use lib "$FindBin::Bin/../../lib";
|
use lib "$FindBin::Bin/../../lib";
|
||||||
|
|
@ -32,7 +19,7 @@ use WebGUI::Asset::Wobject::Collaboration;
|
||||||
use WebGUI::Asset::Post;
|
use WebGUI::Asset::Post;
|
||||||
use WebGUI::Asset::Wobject::Layout;
|
use WebGUI::Asset::Wobject::Layout;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
use Test::More tests => 10; # increment this value for each test you create
|
use Test::More tests => 13; # increment this value for each test you create
|
||||||
|
|
||||||
my $session = WebGUI::Test->session;
|
my $session = WebGUI::Test->session;
|
||||||
|
|
||||||
|
|
@ -41,6 +28,7 @@ my $node = WebGUI::Asset->getImportNode($session);
|
||||||
|
|
||||||
# grab a named version tag
|
# grab a named version tag
|
||||||
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||||
|
addToCleanup($versionTag);
|
||||||
$versionTag->set({name => 'Collaboration => groupToEditPost test'});
|
$versionTag->set({name => 'Collaboration => groupToEditPost test'});
|
||||||
|
|
||||||
# place the collab system under a layout to ensure we're using the inherited groupIdEdit value
|
# place the collab system under a layout to ensure we're using the inherited groupIdEdit value
|
||||||
|
|
@ -55,6 +43,10 @@ my $collab = $layout->addChild({
|
||||||
url => 'collab',
|
url => 'collab',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$versionTag->commit;
|
||||||
|
$collab = $collab->cloneFromDb;
|
||||||
|
ok($session->id->valid($collab->get('getMailCronId')), 'commited CS has a cron job created for it');
|
||||||
|
|
||||||
# Test for a sane object type
|
# Test for a sane object type
|
||||||
isa_ok($collab, 'WebGUI::Asset::Wobject::Collaboration');
|
isa_ok($collab, 'WebGUI::Asset::Wobject::Collaboration');
|
||||||
|
|
||||||
|
|
@ -99,12 +91,13 @@ is($collab->getRssFeedUrl, '/collab?func=viewRss', 'getRssFeedUrl');
|
||||||
is($collab->getRdfFeedUrl, '/collab?func=viewRdf', 'getRdfFeedUrl');
|
is($collab->getRdfFeedUrl, '/collab?func=viewRdf', 'getRdfFeedUrl');
|
||||||
is($collab->getAtomFeedUrl, '/collab?func=viewAtom', 'getAtomFeedUrl');
|
is($collab->getAtomFeedUrl, '/collab?func=viewAtom', 'getAtomFeedUrl');
|
||||||
|
|
||||||
|
note "Mail Cron job tests";
|
||||||
|
my $dupedCollab = $collab->duplicate();
|
||||||
|
addToCleanup(WebGUI::VersionTag->new($session, $dupedCollab->get('tagId')));
|
||||||
|
ok($dupedCollab->get('getMailCronId'), 'Duplicated CS has a cron job');
|
||||||
|
isnt($dupedCollab->get('getMailCronId'), $collab->get('getMailCronId'), '... and it is different from its source asset');
|
||||||
|
|
||||||
TODO: {
|
TODO: {
|
||||||
local $TODO = "Tests to make later";
|
local $TODO = "Tests to make later";
|
||||||
ok(0, 'A whole lot more work to do here');
|
ok(0, 'A whole lot more work to do here');
|
||||||
}
|
}
|
||||||
|
|
||||||
END {
|
|
||||||
# Clean up after thyself
|
|
||||||
$versionTag->rollback();
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -298,6 +298,7 @@ $templateMock->mock('process', sub { $templateVars = $_[1]; } );
|
||||||
'ownerUserId' => ignore(),
|
'ownerUserId' => ignore(),
|
||||||
'extraHeadTags' => ignore(),
|
'extraHeadTags' => ignore(),
|
||||||
'assetId' => ignore(),
|
'assetId' => ignore(),
|
||||||
|
'assetIdHex' => ignore(),
|
||||||
'url' => 'test-ems',
|
'url' => 'test-ems',
|
||||||
'isHidden' => ignore(),
|
'isHidden' => ignore(),
|
||||||
'isPrototype' => ignore(),
|
'isPrototype' => ignore(),
|
||||||
|
|
|
||||||
24
t/Macro/BackToSite.t
Normal file
24
t/Macro/BackToSite.t
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
# WebGUI is Copyright 2001-2009 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 FindBin;
|
||||||
|
use strict;
|
||||||
|
use lib "$FindBin::Bin/../lib";
|
||||||
|
|
||||||
|
use WebGUI::Test;
|
||||||
|
use WebGUI::Macro::BackToSite;
|
||||||
|
use Test::More; # increment this value for each test you create
|
||||||
|
|
||||||
|
my $session = WebGUI::Test->session;
|
||||||
|
|
||||||
|
plan tests => 1;
|
||||||
|
|
||||||
|
my $output = WebGUI::Macro::BackToSite::process($session);
|
||||||
|
is($output, $session->url->getBackToSiteURL, 'fetching current url');
|
||||||
66
t/Macro/DeactivateAccount.t
Normal file
66
t/Macro/DeactivateAccount.t
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
# WebGUI is Copyright 2001-2008 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 FindBin;
|
||||||
|
use strict;
|
||||||
|
use lib "$FindBin::Bin/../lib";
|
||||||
|
|
||||||
|
use WebGUI::Test;
|
||||||
|
use WebGUI::Session;
|
||||||
|
use Test::More;
|
||||||
|
use WebGUI::Macro::DeactivateAccount;
|
||||||
|
|
||||||
|
my $session = WebGUI::Test->session;
|
||||||
|
|
||||||
|
plan tests => 7;
|
||||||
|
|
||||||
|
my $defaultText = 'Please deactivate my account permanently.';
|
||||||
|
my $testText = 'Deactivate account';
|
||||||
|
|
||||||
|
# Test 1: User is admin: return nothing
|
||||||
|
$session->user({userId => 3});
|
||||||
|
my $out1 = WebGUI::Macro::DeactivateAccount::process($session);
|
||||||
|
is( $out1, '', "User is admin: return nothing" );
|
||||||
|
|
||||||
|
# Test 2: User is not admin, but can't self-deactivate: return nothing
|
||||||
|
$session->user({userId => 1});
|
||||||
|
$session->setting->set("selfDeactivation", 0);
|
||||||
|
my $out2 = WebGUI::Macro::DeactivateAccount::process($session);
|
||||||
|
is( $out2, '', "User can't self-deactivate: return nothing" );
|
||||||
|
|
||||||
|
# Test 3: linkonly
|
||||||
|
$session->setting->set("selfDeactivation", 1);
|
||||||
|
my $out3 = WebGUI::Macro::DeactivateAccount::process($session, $testText, 1);
|
||||||
|
# my ($url3, $text3) = simpleHTMLParser($out3);
|
||||||
|
is( $out3, '/?op=auth;method=deactivateAccount', 'Link only - URL check');
|
||||||
|
|
||||||
|
# Test 4: full deactivation link with default text
|
||||||
|
my $out4 = WebGUI::Macro::DeactivateAccount::process($session);
|
||||||
|
my ($url4, $text4) = simpleHTMLParser($out4);
|
||||||
|
is( $url4, '/?op=auth;method=deactivateAccount', 'Full test - URL check');
|
||||||
|
is( $text4, $defaultText, 'Full test - text check');
|
||||||
|
|
||||||
|
# Test 5: full deactivation link with custom text
|
||||||
|
my $out5 = WebGUI::Macro::DeactivateAccount::process($session, $testText);
|
||||||
|
my ($url5, $text5) = simpleHTMLParser($out5);
|
||||||
|
is( $url5, '/?op=auth;method=deactivateAccount', 'Full test with custom text - URL check');
|
||||||
|
is( $text5, $testText, 'Full test with custom text - text check');
|
||||||
|
|
||||||
|
sub simpleHTMLParser {
|
||||||
|
my ($text) = @_;
|
||||||
|
my $p = HTML::TokeParser->new(\$text);
|
||||||
|
|
||||||
|
my $token = $p->get_tag("a");
|
||||||
|
my $url = $token->[1]{href} || "-";
|
||||||
|
my $label = $p->get_trimmed_text("/a");
|
||||||
|
|
||||||
|
return ($url, $label);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -41,6 +41,11 @@ my @testSets = (
|
||||||
output => 'application/octet-stream',
|
output => 'application/octet-stream',
|
||||||
comment => q|Null path returns application/octet-stream|,
|
comment => q|Null path returns application/octet-stream|,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
input => 'foo.rtf',
|
||||||
|
output => 'application/rtf',
|
||||||
|
comment => q|RTF file|, ##Added test due to a bug on some operating systems.
|
||||||
|
},
|
||||||
{
|
{
|
||||||
input => undef,
|
input => undef,
|
||||||
output => undef,
|
output => undef,
|
||||||
|
|
|
||||||
44
t/Macro/SpectreCheck.t
Normal file
44
t/Macro/SpectreCheck.t
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
# WebGUI is Copyright 2001-2009 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 FindBin;
|
||||||
|
use strict;
|
||||||
|
use lib "$FindBin::Bin/../lib";
|
||||||
|
|
||||||
|
use WebGUI::Test;
|
||||||
|
use WebGUI::Session;
|
||||||
|
use WebGUI::Operation::Spectre;
|
||||||
|
|
||||||
|
my $original_spectreCheck = \&WebGUI::Operation::Spectre::spectreTest;
|
||||||
|
my $spectreStatus;
|
||||||
|
*WebGUI::Operation::Spectre::spectreTest = sub {
|
||||||
|
return $spectreStatus;
|
||||||
|
};
|
||||||
|
|
||||||
|
use WebGUI::Macro::SpectreCheck;
|
||||||
|
|
||||||
|
use Test::More; # increment this value for each test you create
|
||||||
|
|
||||||
|
my $session = WebGUI::Test->session;
|
||||||
|
|
||||||
|
plan tests => 4;
|
||||||
|
|
||||||
|
my $i18n = WebGUI::International->new($session, 'Macro_SpectreCheck');
|
||||||
|
|
||||||
|
is WebGUI::Macro::SpectreCheck::process($session), $i18n->get('spectre'), 'with no status, get an i18n message for a bad spectre';
|
||||||
|
|
||||||
|
$spectreStatus = 'success';
|
||||||
|
is WebGUI::Macro::SpectreCheck::process($session), $i18n->get('success'), 'good status';
|
||||||
|
$spectreStatus = 'subnet';
|
||||||
|
is WebGUI::Macro::SpectreCheck::process($session), $i18n->get('subnet'), 'bad subnet';
|
||||||
|
$spectreStatus = 'spectre';
|
||||||
|
is WebGUI::Macro::SpectreCheck::process($session), $i18n->get('spectre'), 'bad spectre';
|
||||||
|
|
||||||
|
*WebGUI::Operation::Spectre::spectreTest = $original_spectreCheck;
|
||||||
|
|
@ -23,9 +23,7 @@ use Data::Dumper;
|
||||||
use Test::More; # increment this value for each test you create
|
use Test::More; # increment this value for each test you create
|
||||||
use Test::Deep;
|
use Test::Deep;
|
||||||
|
|
||||||
my $num_tests = 53;
|
plan tests => 57;
|
||||||
|
|
||||||
plan tests => $num_tests;
|
|
||||||
|
|
||||||
my $session = WebGUI::Test->session;
|
my $session = WebGUI::Test->session;
|
||||||
|
|
||||||
|
|
@ -401,6 +399,22 @@ is_deeply(
|
||||||
|
|
||||||
$session->user({userId => 1});
|
$session->user({userId => 1});
|
||||||
|
|
||||||
|
####################################################
|
||||||
|
#
|
||||||
|
# ifModifiedSince
|
||||||
|
#
|
||||||
|
####################################################
|
||||||
|
##Clear request object to run a new set of requests
|
||||||
|
$request = WebGUI::PseudoRequest->new();
|
||||||
|
$session->{_request} = $request;
|
||||||
|
$request->headers_in->{'If-Modified-Since'} = '';
|
||||||
|
ok $session->http->ifModifiedSince(0), 'ifModifiedSince: empty header always returns true';
|
||||||
|
|
||||||
|
$request->headers_in->{'If-Modified-Since'} = $session->datetime->epochToHttp(WebGUI::Test->webguiBirthday);
|
||||||
|
ok $session->http->ifModifiedSince(WebGUI::Test->webguiBirthday + 5), '... epoch check, true';
|
||||||
|
ok !$session->http->ifModifiedSince(WebGUI::Test->webguiBirthday - 5), '... epoch check, false';
|
||||||
|
ok $session->http->ifModifiedSince(WebGUI::Test->webguiBirthday - 5, 3600), '... epoch check, made true by maxCacheTimeout';
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
#
|
#
|
||||||
# Utility functions
|
# Utility functions
|
||||||
|
|
@ -428,7 +442,3 @@ sub deltaHttpTimes {
|
||||||
my $dt2 = $httpParser->parse_datetime($http2);
|
my $dt2 = $httpParser->parse_datetime($http2);
|
||||||
my $delta_time = $dt1-$dt2;
|
my $delta_time = $dt1-$dt2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
END {
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ use WebGUI::Test; # Must use this before any other WebGUI modules
|
||||||
use WebGUI::Session;
|
use WebGUI::Session;
|
||||||
use WebGUI::Shop::ShipDriver::USPS;
|
use WebGUI::Shop::ShipDriver::USPS;
|
||||||
|
|
||||||
plan tests => 66;
|
plan tests => 69;
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Init
|
# Init
|
||||||
|
|
@ -232,6 +232,13 @@ my $wucAddress = $addressBook->addAddress({
|
||||||
city => 'Madison', state => 'WI', code => '53703',
|
city => 'Madison', state => 'WI', code => '53703',
|
||||||
country => 'United States',
|
country => 'United States',
|
||||||
});
|
});
|
||||||
|
my $zip4Address = $addressBook->addAddress({
|
||||||
|
label => 'work-zip4',
|
||||||
|
organization => 'Plain Black Corporation',
|
||||||
|
address1 => '1360 Regent St. #145',
|
||||||
|
city => 'Madison', state => 'WI', code => '53715-1255',
|
||||||
|
country => 'United States',
|
||||||
|
});
|
||||||
$cart->update({shippingAddressId => $workAddress->getId});
|
$cart->update({shippingAddressId => $workAddress->getId});
|
||||||
|
|
||||||
cmp_deeply(
|
cmp_deeply(
|
||||||
|
|
@ -826,6 +833,48 @@ SKIP: {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#######################################################################
|
||||||
|
#
|
||||||
|
# Test ZIP+4 format domestic code
|
||||||
|
#
|
||||||
|
#######################################################################
|
||||||
|
$cart->update({shippingAddressId => $zip4Address->getId});
|
||||||
|
|
||||||
|
my $xmlData = XMLin($driver->buildXML($cart, @shippableUnits),
|
||||||
|
KeepRoot => 1,
|
||||||
|
ForceArray => ['Package'],
|
||||||
|
);
|
||||||
|
cmp_deeply(
|
||||||
|
$xmlData,
|
||||||
|
{
|
||||||
|
RateV3Request => {
|
||||||
|
USERID => $userId,
|
||||||
|
Package => [
|
||||||
|
{
|
||||||
|
ID => 0,
|
||||||
|
ZipDestination => '53715', ZipOrigination => '97123',
|
||||||
|
Pounds => '1', Ounces => '8.0',
|
||||||
|
Size => 'REGULAR', Service => 'PRIORITY',
|
||||||
|
Machinable => 'true',# Container => 'VARIABLE',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'buildXML: removed plus4 part of zipcode'
|
||||||
|
);
|
||||||
|
|
||||||
|
SKIP: {
|
||||||
|
|
||||||
|
skip 'No userId for testing', 2 unless $hasRealUserId;
|
||||||
|
|
||||||
|
my $cost = eval { $driver->calculate($cart); };
|
||||||
|
my $e = Exception::Class->caught();
|
||||||
|
ok( ! ref $e, 'no exception thrown for zip+4 address');
|
||||||
|
cmp_deeply($cost, num(10,9.99), 'zip+4 address returns a valid cost');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$cart->update({shippingAddressId => $workAddress->getId});
|
||||||
#######################################################################
|
#######################################################################
|
||||||
#
|
#
|
||||||
# Check for throwing an exception
|
# Check for throwing an exception
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ is_deeply($wf->getCrons, [], 'workflow has no crons');
|
||||||
isa_ok(WebGUI::Workflow->getList($session), 'HASH', 'getList returns a hashref');
|
isa_ok(WebGUI::Workflow->getList($session), 'HASH', 'getList returns a hashref');
|
||||||
|
|
||||||
ok(!isIn($wfId, keys %{WebGUI::Workflow->getList($session)}), 'workflow not in enabled list');
|
ok(!isIn($wfId, keys %{WebGUI::Workflow->getList($session)}), 'workflow not in enabled list');
|
||||||
is(scalar keys %{WebGUI::Workflow->getList($session)}, 12, 'There are twelve default workflows, of all types, shipped with WebGUI');
|
is(scalar keys %{WebGUI::Workflow->getList($session)}, 11, 'There are eleven enabled, default workflows, of all types, shipped with WebGUI');
|
||||||
|
|
||||||
$wf->set({enabled => 1});
|
$wf->set({enabled => 1});
|
||||||
ok($wf->get('enabled'), 'workflow is enabled');
|
ok($wf->get('enabled'), 'workflow is enabled');
|
||||||
|
|
|
||||||
|
|
@ -7,20 +7,6 @@ if ( typeof WebGUI == "undefined" ) {
|
||||||
if ( typeof WebGUI.TemplateAttachments == "undefined" ) {
|
if ( typeof WebGUI.TemplateAttachments == "undefined" ) {
|
||||||
WebGUI.TemplateAttachments = {};
|
WebGUI.TemplateAttachments = {};
|
||||||
}
|
}
|
||||||
if ( typeof WebGUI.TemplateAttachments.i18n == "undefined" ) {
|
|
||||||
WebGUI.TemplateAttachments.i18n = new WebGUI.i18n( {
|
|
||||||
namespaces : {
|
|
||||||
'Asset_Template' : [
|
|
||||||
"attachment header remove",
|
|
||||||
"Already attached!",
|
|
||||||
"No url!"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
onpreload : {
|
|
||||||
fn : function(){}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
}
|
|
||||||
|
|
||||||
var addClick = (function() {
|
var addClick = (function() {
|
||||||
var uniqueId = 1;
|
var uniqueId = 1;
|
||||||
|
|
@ -181,7 +167,21 @@ var addClick = (function() {
|
||||||
addAnchor.appendChild(tr);
|
addAnchor.appendChild(tr);
|
||||||
}
|
}
|
||||||
|
|
||||||
init();
|
if ( typeof WebGUI.TemplateAttachments.i18n == "undefined" ) {
|
||||||
|
WebGUI.TemplateAttachments.i18n = new WebGUI.i18n( {
|
||||||
|
namespaces : {
|
||||||
|
'Asset_Template' : [
|
||||||
|
"attachment header remove",
|
||||||
|
"Already attached!",
|
||||||
|
"No url!"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
onpreload : {
|
||||||
|
fn : init
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
return function() {
|
return function() {
|
||||||
var d = {
|
var d = {
|
||||||
index: nodes.index.value,
|
index: nodes.index.value,
|
||||||
|
|
|
||||||
|
|
@ -42,38 +42,28 @@
|
||||||
link.href = this.get('css_url');
|
link.href = this.get('css_url');
|
||||||
this._getDoc().getElementsByTagName('head')[0].appendChild(link);
|
this._getDoc().getElementsByTagName('head')[0].appendChild(link);
|
||||||
// Highlight the initial value
|
// Highlight the initial value
|
||||||
if ( !this.browser.ie ) { // IE puts "!!CURSOR HERE!!" in the main doc, not the iframe...
|
if ( this.getEditorText() != this.old_text ) {
|
||||||
this.highlight(false);
|
Lang.later(10, this, function () { this.highlight(true) } );
|
||||||
|
if ( this.status ) {
|
||||||
|
Lang.later(100, this, this._writeStatus);
|
||||||
|
}
|
||||||
|
this.old_text = this.getEditorText();
|
||||||
}
|
}
|
||||||
// Setup resize
|
// Setup resize
|
||||||
if ( this.status ) {
|
if ( this.status ) {
|
||||||
this._writeStatus();
|
|
||||||
this._setupResize();
|
this._setupResize();
|
||||||
}
|
}
|
||||||
}, this, true);
|
}, this, true);
|
||||||
|
|
||||||
this.on('editorKeyUp', function(ev) {
|
this.on('editorKeyUp', function(ev) {
|
||||||
|
// Highlight only if content has changed
|
||||||
// Don't highlight arrows or modifiers
|
if ( this.getEditorText() != this.old_text ) {
|
||||||
if ( ( ev.ev.keyCode > 36 && ev.ev.keyCode < 41 )
|
Lang.later(10, this, this.highlight);
|
||||||
|| ev.ev.keyCode == 16 || ev.ev.keyCode == 17
|
if ( this.status ) {
|
||||||
|| ev.ev.keyCode == 18 || ev.ev.keyCode == 91 // Safari "command"
|
Lang.later(100, this, this._writeStatus);
|
||||||
|| ev.ev.keyCode == 224 // Firefox "command"
|
}
|
||||||
) {
|
this.old_text = this.getEditorText();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Don't re-highlight if there is a selection
|
|
||||||
// That is the problem we're trying to avoid with disabling
|
|
||||||
// highlighting for arrows and modifiers
|
|
||||||
|
|
||||||
// Don't highlight Ctrl, Alt, or Meta key combinations
|
|
||||||
if ( ev.ev.ctrlKey || ev.ev.altKey || ev.ev.metaKey ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Highlight every keypress
|
|
||||||
Lang.later(10, this, this.highlight);
|
|
||||||
Lang.later(100, this, this._writeStatus);
|
|
||||||
}, this, true);
|
}, this, true);
|
||||||
|
|
||||||
//Borrowed this from CodePress: http://codepress.sourceforge.net
|
//Borrowed this from CodePress: http://codepress.sourceforge.net
|
||||||
|
|
@ -107,10 +97,14 @@
|
||||||
str = str.replace(/{/gi, 'RIGHT_BRACKET');
|
str = str.replace(/{/gi, 'RIGHT_BRACKET');
|
||||||
str = str.replace(/}/gi, 'LEFT_BRACKET');
|
str = str.replace(/}/gi, 'LEFT_BRACKET');
|
||||||
|
|
||||||
// before <br> for IE7 so lines show up correctly
|
// before <br> for IE8 so lines show up correctly
|
||||||
if ( this.browser.ie && this.browser.ie <= 7 ) {
|
if ( this.browser.ie && this.browser.ie <= 8 ) {
|
||||||
str = str.replace(/\r?\n/g, " <br>");
|
str = str.replace(/\r?\n/g, " <br>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fix tabs into softtabs
|
||||||
|
str = str.replace(/\t/g, ' '); // TODO: Make softtabs configurable
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -167,6 +161,7 @@
|
||||||
if (!html) {
|
if (!html) {
|
||||||
html = this.getEditorHTML();
|
html = this.getEditorHTML();
|
||||||
}
|
}
|
||||||
|
html = html.replace(/( ){4}/g,"\t"); // TODO: make softtabs configurable
|
||||||
html = html.replace(/ /g," ");
|
html = html.replace(/ /g," ");
|
||||||
html = html.replace(/ ?<br>/gi,'\n');
|
html = html.replace(/ ?<br>/gi,'\n');
|
||||||
html = html.replace(/<[^>]+>/g,'');
|
html = html.replace(/<[^>]+>/g,'');
|
||||||
|
|
@ -211,7 +206,7 @@
|
||||||
this._getSelection().getRangeAt(0).insertNode(this._getDoc().createTextNode(this.cc));
|
this._getSelection().getRangeAt(0).insertNode(this._getDoc().createTextNode(this.cc));
|
||||||
} else if (this.browser.webkit || this.browser.ie || this.browser.opera) {
|
} else if (this.browser.webkit || this.browser.ie || this.browser.opera) {
|
||||||
try {
|
try {
|
||||||
this.execCommand('inserthtml', '!!CURSOR_HERE!!');
|
this.execCommand('inserthtml', '<span class="cursor_here"></span>');
|
||||||
}
|
}
|
||||||
catch (e) {}
|
catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
@ -236,18 +231,18 @@
|
||||||
}
|
}
|
||||||
YAHOO.log(html);
|
YAHOO.log(html);
|
||||||
// before <br> for IE7
|
// before <br> for IE7
|
||||||
html = html.replace(/( |!!CURSOR_HERE!!)?<br[^>]*>/gi,'$1\n');
|
html = html.replace(/( |<span class="cursor_here"><\/span>)?<br[^>]*>/gi,'$1\n');
|
||||||
html = html.replace(/<[^>]*>/g,'');
|
html = html.replace(/<[^>]*>/g,'');
|
||||||
html = html.replace(/\r?\n/g,'<br>');
|
html = html.replace(/\r?\n/g,'<br>');
|
||||||
// between <br> for IE6
|
// between <br> for IE6
|
||||||
html = html.replace(/<br[^>]*>(!!CURSOR_HERE!!)?<br[^>]*>/gi, '<br>$1 <br>');
|
html = html.replace(/<br[^>]*>(<span class="cursor_here"><\/span>)?<br[^>]*>/gi, '<br>$1 <br>');
|
||||||
YAHOO.log(html);
|
YAHOO.log(html);
|
||||||
}
|
}
|
||||||
for (var i = 0; i < this.keywords.length; i++) {
|
for (var i = 0; i < this.keywords.length; i++) {
|
||||||
html = html.replace(this.keywords[i].code, this.keywords[i].tag);
|
html = html.replace(this.keywords[i].code, this.keywords[i].tag);
|
||||||
}
|
}
|
||||||
YAHOO.log("AFTER HIGHLIGHT:" + html);
|
YAHOO.log("AFTER HIGHLIGHT:" + html);
|
||||||
html = html.replace('!!CURSOR_HERE!!', '<span id="cur">|</span>');
|
html = html.replace('<span class="cursor_here"></span>', '<span id="cur">|</span>');
|
||||||
|
|
||||||
this._getDoc().body.innerHTML = html;
|
this._getDoc().body.innerHTML = html;
|
||||||
if (!focus) {
|
if (!focus) {
|
||||||
|
|
|
||||||
1
www/extras/yui-webgui/build/map/map.js
vendored
1
www/extras/yui-webgui/build/map/map.js
vendored
|
|
@ -46,6 +46,7 @@ WebGUI.Map.editPoint
|
||||||
marker = new GMarker( map.getCenter(), { draggable: true } );
|
marker = new GMarker( map.getCenter(), { draggable: true } );
|
||||||
marker.infoWin = document.createElement("div");
|
marker.infoWin = document.createElement("div");
|
||||||
marker.bindInfoWindow( marker.infoWin );
|
marker.bindInfoWindow( marker.infoWin );
|
||||||
|
marker.map = map;
|
||||||
mgr.addMarker( marker, 0 );
|
mgr.addMarker( marker, 0 );
|
||||||
mgr.refresh();
|
mgr.refresh();
|
||||||
assetId = "new";
|
assetId = "new";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue