Merge branch 'master' into 8-merge
Conflicts: docs/gotcha.txt docs/upgrades/upgrade_7.9.8-7.9.9.pl lib/WebGUI.pm lib/WebGUI/Asset.pm lib/WebGUI/Asset/Template.pm lib/WebGUI/Asset/Wobject/Calendar.pm lib/WebGUI/Asset/Wobject/Carousel.pm t/Asset/Asset.t t/Mail/Send.t t/Session/Url.t t/lib/WebGUI/Test.pm
This commit is contained in:
commit
cd1e450c32
1229 changed files with 499 additions and 313891 deletions
|
|
@ -1829,8 +1829,6 @@ properties in the database, but creates a WebGUI::Asset object.
|
|||
|
||||
A hash reference of properties to assign to the object.
|
||||
|
||||
=cut
|
||||
|
||||
=head2 new ( session, assetId [,revisionDate ] )
|
||||
|
||||
Instanciator. This does not create an asset in the database, but looks up the object's
|
||||
|
|
@ -2048,8 +2046,6 @@ The height of the iframe. Required for making widget-in-widget function properly
|
|||
The templateId for this widgetized asset to use. Required for making
|
||||
widget-in-widget function properly.
|
||||
|
||||
=cut
|
||||
|
||||
=head3 styleTemplateId
|
||||
|
||||
The style templateId for this widgetized asset to use. Not required for making
|
||||
|
|
@ -2486,7 +2482,23 @@ sub write {
|
|||
|
||||
Returns the asset's url without any site specific prefixes. If you want a browser friendly url see the getUrl() method.
|
||||
|
||||
=head3 value
|
||||
# set the property
|
||||
if ($propertyDefinition->{serialize}) {
|
||||
# Only serialize references
|
||||
if ( ref $value ) {
|
||||
$setPairs{$property} = JSON->new->canonical->encode($value);
|
||||
}
|
||||
# Passing already serialized JSON string
|
||||
elsif ( $value ) {
|
||||
$setPairs{$property} = $value;
|
||||
$value = JSON->new->decode( $value ); # for setting in _properties, below
|
||||
}
|
||||
}
|
||||
else {
|
||||
$setPairs{$property} = $value;
|
||||
}
|
||||
$self->{_properties}{$property} = $value;
|
||||
}
|
||||
|
||||
The new value to set the URL to.
|
||||
|
||||
|
|
|
|||
|
|
@ -449,14 +449,15 @@ sub getParser {
|
|||
|
||||
=head2 importAssetCollateralData ( data )
|
||||
|
||||
Override to import attachments
|
||||
Override to import attachments from old versions of WebGUI
|
||||
|
||||
=cut
|
||||
|
||||
override importAssetCollateralData => sub {
|
||||
my ( $self, $data, @args ) = @_;
|
||||
$self->removeAttachments;
|
||||
$self->addAttachments( $data->{template_attachments} );
|
||||
if ( $data->{template_attachments} ) {
|
||||
$self->update( { attachmentsJson => $data->{template_attachments} } );
|
||||
}
|
||||
return super();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -241,13 +241,11 @@ sub _listViewPageInterval_builder {
|
|||
}
|
||||
|
||||
property icalFeeds => (
|
||||
fieldType => "JsonTable",
|
||||
default => sub { return []; },
|
||||
traits => ['Array', 'WebGUI::Definition::Meta::Property::Serialize',],
|
||||
isa => 'WebGUI::Type::JSONArray',
|
||||
coerce => 1,
|
||||
fieldType => "JsonTable",
|
||||
defaultValue => [],
|
||||
serialize => 1,
|
||||
traits => ['Array', 'WebGUI::Definition::Meta::Property::Serialize',],
|
||||
tab => "feeds",
|
||||
label => ['feeds','Asset_Calendar'],
|
||||
fields => [
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ $VERSION = "1.0.0";
|
|||
use strict;
|
||||
use JSON;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Utility;
|
||||
use Moose;
|
||||
use WebGUI::Definition::Asset;
|
||||
extends 'WebGUI::Asset::Wobject';
|
||||
|
|
@ -37,6 +38,13 @@ property slideWidth => (
|
|||
hoverHelp => [ 'carousel slideWidth description', 'Asset_Carousel' ],
|
||||
label => [ 'carousel slideWidth label', 'Asset_Carousel' ],
|
||||
);
|
||||
property slideHeight => (
|
||||
fieldType => "integer",
|
||||
default => 0,
|
||||
tab => "display",
|
||||
hoverHelp => ['carousel slideHeight description', 'Asset_Carousel' ],
|
||||
label => ['carousel slideHeight label', 'Asset_Carousel' ],
|
||||
);
|
||||
property items => (
|
||||
noFormPost => 1,
|
||||
fieldType => 'text',
|
||||
|
|
|
|||
|
|
@ -2843,7 +2843,7 @@ sub www_import {
|
|||
my $fieldType = $insertColumn->{fieldType};
|
||||
my $fieldInOtherThingId = $insertColumn->{fieldInOtherThingId};
|
||||
# TODO: process dates and otherThing field id's
|
||||
if ($fieldType eq "date" || $fieldType eq "dateTime"){
|
||||
if (lc $fieldType eq "date" || lc $fieldType eq "datetime"){
|
||||
$fieldValue =~ s/\//-/gx;
|
||||
$fieldValue = $session->datetime->setToEpoch($fieldValue);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -555,7 +555,7 @@ sub exportGetDescendants {
|
|||
|
||||
=head2 exportGetUrlAsPath ( index )
|
||||
|
||||
Translates a URL into an appropriate path and filename for exporting. For
|
||||
Translates an asset's URL into an appropriate path and filename for exporting. For
|
||||
example, given C<'/foo/bar/baz'>, will return C<'/foo/bar/baz/index.html'>
|
||||
provided the value of indexFile as given to exportAsHtml was C<'index.html'>.
|
||||
|
||||
|
|
|
|||
|
|
@ -299,11 +299,16 @@ sub _invokeWorkflowOnExportedFiles {
|
|||
if ($workflowId) {
|
||||
my ($lastExportedAs) = $self->get("lastExportedAs");
|
||||
my $wfInstance = WebGUI::Workflow::Instance->create($self->session, { workflowId => $workflowId });
|
||||
$wfInstance->setScratch(
|
||||
WebGUI::Workflow::Activity::DeleteExportedFiles::DELETE_FILES_SCRATCH() =>
|
||||
Storable::freeze([ defined($lastExportedAs) ? ($lastExportedAs) : () ])
|
||||
);
|
||||
$wfInstance->start(1);
|
||||
if ($wfInstance) {
|
||||
$wfInstance->setScratch(
|
||||
WebGUI::Workflow::Activity::DeleteExportedFiles::DELETE_FILES_SCRATCH() =>
|
||||
Storable::freeze([ defined($lastExportedAs) ? ($lastExportedAs) : () ])
|
||||
);
|
||||
$wfInstance->start(1);
|
||||
}
|
||||
else {
|
||||
$self->session->log->warn('The Purge Workflow from the settings has been deleted and cannot be run.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ our $HELP = {
|
|||
],
|
||||
},
|
||||
{ 'name' => 'slideWidth', },
|
||||
{ 'name' => 'slideHeight', },
|
||||
],
|
||||
related => [],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -98,8 +98,9 @@ Macros in the footer will be evaluated.
|
|||
sub addFooter {
|
||||
my $self = shift;
|
||||
return if $self->{_footerAdded};
|
||||
my $text = "\n\n".$self->session->setting->get("mailFooter");
|
||||
WebGUI::Macro::process($self->session, \$text);
|
||||
my $footer = "\n\n".$self->session->setting->get("mailFooter");
|
||||
WebGUI::Macro::process($self->session, \$footer);
|
||||
my $text = encode("utf8", $footer);
|
||||
$self->{_footerAdded} = 1;
|
||||
my @parts = $self->getMimeEntity->parts();
|
||||
##No parts yet, add one with the footer content.
|
||||
|
|
@ -117,7 +118,7 @@ sub addFooter {
|
|||
Charset => "UTF-8",
|
||||
Encoding => "quoted-printable",
|
||||
Type => 'text/plain',
|
||||
Data => encode('utf8', $body_content),
|
||||
Data => $body_content,
|
||||
);
|
||||
shift @parts;
|
||||
unshift @parts, $new_part;
|
||||
|
|
@ -130,7 +131,7 @@ sub addFooter {
|
|||
Charset => "UTF-8",
|
||||
Encoding => "quoted-printable",
|
||||
Type => 'text/html',
|
||||
Data => encode('utf8', $body_content),
|
||||
Data => $body_content,
|
||||
);
|
||||
shift @parts;
|
||||
unshift @parts, $new_part;
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ sub create {
|
|||
|
||||
# Add the column to the userProfileData table
|
||||
$db->write(
|
||||
"ALTER TABLE userProfileData ADD " . $db->dbh->quote_identifier($fieldName)
|
||||
"ALTER TABLE userProfileData ADD " . $db->dbh->quote_identifier($id)
|
||||
. $dbDataType
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -309,7 +309,8 @@ sub _getFeedUrl {
|
|||
|
||||
=head2 _getStaticFeedUrl ($extension)
|
||||
|
||||
Generic method for returning the static URL for a type of feed.
|
||||
Generic method for returning the static URL for a type of feed. The returned URL will be complete,
|
||||
and absolute, containing the gateway URL for this site.
|
||||
|
||||
=head3 $extension
|
||||
|
||||
|
|
|
|||
|
|
@ -141,7 +141,9 @@ Any URL parameters that need to be tacked on to the current URL to accomplish wh
|
|||
|
||||
=head3 pageURL
|
||||
|
||||
The URL to any page. Defaults to the current page.
|
||||
The URL to any page. Defaults to the current page. If a URL is passed, the gateway URL from the site's config
|
||||
file will be prepended to it.
|
||||
|
||||
|
||||
=head3 confirmText
|
||||
|
||||
|
|
|
|||
|
|
@ -408,9 +408,8 @@ sub makeCompliant {
|
|||
$url =~ s{\s+$}{}; # remove trailing whitespace
|
||||
$url =~ s{^/+}{}; # remove leading slashes
|
||||
$url =~ s{/+$}{}; # remove trailing slashes
|
||||
$url =~ s{[^\w/:._-]+}{-}g; # replace anything aside from word or other allowed characters with dashes
|
||||
$url =~ s{//+}{/}g; # remove double slashes
|
||||
$url =~ s{--+}{-}g; # remove double dashes
|
||||
$url =~ s{[^\w/:.-]+}{-}g; # replace anything aside from word or other allowed characters with dashes
|
||||
$url =~ tr{/-}{/-}s; # replace multiple slashes and dashes with singles.
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
|
@ -533,16 +532,14 @@ The string to urlize.
|
|||
=cut
|
||||
|
||||
sub urlize {
|
||||
my $self = shift;
|
||||
my ($value);
|
||||
$value = lc(shift); #lower cases whole string
|
||||
my $self = shift;
|
||||
my $value = lc(shift); #lower cases whole string
|
||||
$value = $self->makeCompliant($value);
|
||||
|
||||
# remove /./ or /../
|
||||
$value =~ s{(^|/)(?:\.\.?/)*}{$1}g;
|
||||
|
||||
# remove trailing slashes
|
||||
$value =~ s/\/$//;
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ sub execute {
|
|||
my $sth = $session->db->read( "select Event.assetId, revisionDate from Event join assetData using (assetId, revisionDate) where endDate < ? and revisionDate = (select max(revisionDate) from assetData where assetData.assetId=Event.assetId);", [ $date->toDatabaseDate ]);
|
||||
EVENT: while ( my ($id) = $sth->array ) {
|
||||
my $asset = eval { WebGUI::Asset::Event->newById($self->session, $id); };
|
||||
if (! Exception::Class->caught() && $asset->eventEndDate < time() - $self->trashAfter) {
|
||||
if (! Exception::Class->caught() ) {
|
||||
$asset->trash;
|
||||
}
|
||||
last EVENT if time() > $finishTime;
|
||||
|
|
|
|||
|
|
@ -33,12 +33,30 @@ our $I18N = {
|
|||
context => q|Description of the carousel template field, used as hover help.|
|
||||
},
|
||||
|
||||
'carousel slideHeight label' => {
|
||||
message => q|Carousel slide height|,
|
||||
lastUpdated => 0,
|
||||
context => q|Slide, one "frame" or "page" in the Carousel.|
|
||||
},
|
||||
|
||||
'carousel slideHeight description' => {
|
||||
message => q|Height in pixels. The Carousel will not automatically resize itself for content of various widths. Setting this width will help it render properly. If left with the default, 0, then the width of the Carousel is set by the width of the first element.|,
|
||||
lastUpdated => 0,
|
||||
context => q|Description of the carousel template field, used as hover help.|
|
||||
},
|
||||
|
||||
'slideWidth' => {
|
||||
message => q|The width set for each slide in the Carousel|,
|
||||
lastUpdated => 0,
|
||||
context => q|Description of the carousel template field, used as hover help.|
|
||||
},
|
||||
|
||||
'slideHeight' => {
|
||||
message => q|The height set for each slide in the Carousel|,
|
||||
lastUpdated => 0,
|
||||
context => q|Description of the carousel template field, used as hover help.|
|
||||
},
|
||||
|
||||
'items label' => {
|
||||
message => q|Items|,
|
||||
lastUpdated => 0,
|
||||
|
|
|
|||
|
|
@ -1978,7 +1978,7 @@ our $I18N = {
|
|||
},
|
||||
|
||||
'loginFormButton help' => {
|
||||
message => q|The end of the form to help a user log in. This variable will only be populated if the current user is Visitor.|,
|
||||
message => q|A button to submit the login form. This variable will only be populated if the current user is Visitor.|,
|
||||
lastUpdated => 0,
|
||||
context => q|Template variable help|
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue