Merge branch 'master' of git@github.com:plainblack/webgui

This commit is contained in:
daviddelikat 2009-10-29 09:07:03 -05:00
commit d0307d99c1
15 changed files with 166 additions and 264 deletions

View file

@ -1,4 +1,6 @@
7.8.3
- Fixed an error being thrown by the CalendarUpdateFeeds workflow activity.
- The auto add to group and auto delete from group operations that are used with the GroupAdd and GroupDelete macros were fixed to make the user log in if they aren't already.
- fixed #11074: Links to CS posts not working
- fixed #11152: Image edits do not autocommit version tags
- fixed template attachments are not cleaned up during purge
@ -22,6 +24,9 @@
- fixed #11069: "More" options menu in asset manager
- rfe #10755: Adding SetLanguage bazaar item
- fixed #11176: New upgrade error in 7.6.35 to 7.7.17
- fixed #11181: ableToBeFriend label not i18n
- fixed #11179: user.CanStartThread missing from help
- fixed #11183: Calendar List View
7.8.2
- Added scheduled vendor payout workflow activity. (Special thanks to Martin @ Oqapi)

View file

@ -23,6 +23,7 @@ use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
use WebGUI::Utility;
use WebGUI::ProfileField;
my $toVersion = '7.8.3';
@ -38,9 +39,23 @@ addClipboardAdminSetting($session);
addTrashAdminSetting($session);
addPickLanguageMacro($session);
installSetLanguage($session);
i18nAbleToBeFriend($session);
finish($session); # this line required
#----------------------------------------------------------------------------
sub i18nAbleToBeFriend {
my $session = shift;
print "\tInternationalize the Able To Be Friend profile field... " unless $quiet;
my $field = WebGUI::ProfileField->new($session, 'ableToBeFriend');
if ($field) {
my $props = $field->get();
$props->{label} = q{WebGUI::International::get('user profile field friend availability','WebGUI')};
$field->set($props);
}
print "Done.\n" unless $quiet;
}
#----------------------------------------------------------------------------
sub addClipboardAdminSetting {
my $session = shift;

View file

@ -1291,11 +1291,16 @@ sub viewList {
my $session = $self->session;
my $i18n = WebGUI::International->new($session,"Asset_Calendar");
my $var = $self->getTemplateVars;
my $tz = $session->datetime->getTimeZone();
### Get the events
my $dtStart = WebGUI::DateTime->new( $session, $params->{start} )->truncate( to => "day" );
my $dtStart = WebGUI::DateTime->new( $session, $params->{start} );
$dtStart->set_time_zone($tz);
$dtStart->truncate( to => 'day' );
my $dtEnd = $dtStart->clone->add( seconds => $self->get('listViewPageInterval') );
warn 'truncated: '.$dtStart->toDatabase;
warn 'end date: '.$dtEnd->toDatabase;
my @events
= $self->getEventsIn(
$dtStart->toDatabase,

View file

@ -18,6 +18,7 @@ our $HELP = {
{ 'name' => 'back.label' },
{ 'name' => 'compensation.label' },
{ 'name' => 'open.label' },
{ 'name' => 'captcha_label' },
{ 'name' => 'close.label' },
{ 'name' => 'closed.label' },
{ 'name' => 'critical.label' },
@ -34,6 +35,9 @@ our $HELP = {
{ 'name' => 'job.title.label' },
{ 'name' => 'job.description.label' },
{ 'name' => 'job.requirements.label' },
{ 'name' => 'karmascale.label' },
{ 'name' => 'karmaRank.label' },
{ 'name' => 'keywords.label' },
{ 'name' => 'location.label' },
{ 'name' => 'layout.flat.label' },
{ 'name' => 'link.header.label' },
@ -64,6 +68,7 @@ our $HELP = {
{ 'name' => 'synopsis.label' },
{ 'name' => 'thumbnail.label' },
{ 'name' => 'title.label' },
{ 'name' => 'transferkarma.label' },
{ 'name' => 'unlock.label' },
{ 'name' => 'unstick.label' },
{ 'name' => 'unsubscribe.label' },
@ -80,6 +85,11 @@ our $HELP = {
title => 'collaboration post list template variables title',
body => '',
fields => [],
isa => [
{ tag => 'pagination template variables',
namespace => 'WebGUI'
},
],
variables => [
{ 'name' => 'post_loop',
'variables' => [
@ -139,6 +149,7 @@ our $HELP = {
fields => [],
variables => [
{ 'name' => 'displayLastReply' },
{ 'name' => 'user.canStartThread' },
{ 'name' => 'user.canPost' },
{ 'name' => 'user.isModerator' },
{ 'name' => 'user.isVisitor', },
@ -159,7 +170,7 @@ our $HELP = {
{ 'name' => 'sortby.rating.url' },
{ 'name' => 'collaborationAssetId' },
],
related => [
isa => [
{ tag => 'collaboration template labels',
namespace => 'Asset_Collaboration',
},
@ -173,76 +184,19 @@ our $HELP = {
title => 'collaboration search template title',
body => '',
fields => [],
isa => [
{ namespace => "Asset_Collaboration",
tag => "collaboration post list template variables"
},
],
variables => [
{ 'name' => 'form.header' },
{ 'name' => 'query.form' },
{ 'name' => 'form.search' },
{ 'name' => 'form.footer' },
{ 'name' => 'back.url' },
{ 'name' => 'unsubscribe.url', },
{ 'name' => 'sortby.title.url', },
{ 'name' => 'sortby.username.url', },
{ 'name' => 'sortby.date.url', },
{ 'name' => 'sortby.lastreply.url', },
{ 'name' => 'sortby.views.url', },
{ 'name' => 'sortby.replies.url', },
{ 'name' => 'sortby.rating.url', }
],
related => [
{ tag => 'collaboration post list template variables',
namespace => 'Asset_Collaboration',
},
]
},
'collaboration rss template' => {
title => 'collaboration rss template title',
body => '',
fields => [],
variables => [
{ 'name' => 'title',
'description' => 'feed title'
},
{ 'name' => 'link',
'description' => 'collab link'
},
{ 'name' => 'description',
'description' => 'feed description'
},
{ 'name' => 'generator' },
{ 'name' => 'webMaster' },
{ 'name' => 'docs' },
{ 'name' => 'lastBuildDate' },
{ 'name' => 'item_loop',
'variables' => [
{ 'name' => 'author' },
{ 'name' => 'title',
'description' => 'post title'
},
{ 'name' => 'link',
'description' => 'full text link'
},
{ 'name' => 'description',
'description' => 'item description'
},
{ 'name' => 'guid' },
{ 'name' => 'pubDate' },
{ 'name' => 'epochDate' },
{ 'name' => 'attachmentLoop',
'variables' => [
{ 'name' => 'attachment_thumbnail' },
{ 'name' => 'attachment.url' },
{ 'name' => 'attachment.path' },
{ 'name' => 'attachment.length' }
]
}
]
}
],
related => [
{ tag => 'collaboration post list template variables',
namespace => 'Asset_Collaboration',
},
]
related => [ ],
},
};

View file

@ -337,7 +337,7 @@ A WebGUI::Session object
sub www_autoAddToGroup {
my $session = shift;
return WebGUI::AdminConsole->new($session,"groups")->render($session->privilege->insufficient()) unless ($session->user->userId ne 1);
return $self->session->privilege->noAccess() if ($session->user->isVisitor);
my $group = WebGUI::Group->new($session,$session->form->process("groupId"));
if ($group && $group->autoAdd) {
$group->addUsers([$session->user->userId],[$session->form->process("groupId")]);
@ -361,7 +361,7 @@ A WebGUI::Session object
sub www_autoDeleteFromGroup {
my $session = shift;
return WebGUI::AdminConsole->new($session,"groups")->render($session->privilege->insufficient()) unless ($session->user->userId ne 1);
return $self->session->privilege->noAccess() if ($session->user->isVisitor);
my $group = WebGUI::Group->new($session,$session->form->process("groupId"));
if ($group && $group->autoDelete) {
$group->deleteUsers([$session->user->userId],[$session->form->process("groupId")]);

View file

@ -100,6 +100,7 @@ sub execute {
my $getCalendar = WebGUI::Asset::Wobject::Calendar->getIsa($session);
CALENDAR: while (my $calendar = $getCalendar->()) {
next unless defined $calendar;
my $calendarTitle = $calendar->getTitle;
my $calendarId = $calendar->getId;
if ( $calendar->get( "state" ) ne "published" ) {

View file

@ -81,7 +81,7 @@ sub definition {
},
paypalSubject => {
fieldType => 'text',
label => $i18n->get('Subject for vendor notication email'),
label => $i18n->get('Subject for vendor notification email'),
defaultValue => $i18n->get('Vendor payout from').' ' . $session->setting->get('companyUrl'),
},
notificationGroupId => {

View file

@ -1057,6 +1057,31 @@ our $I18N = {
lastUpdated => 1150169038,
},
'transferkarma.label' => {
message => q|The phrase "Transfer Karma".|,
lastUpdated => 1150169038,
},
'karmascale.label' => {
message => q|The phrase "Karma Scale".|,
lastUpdated => 1150169038,
},
'karmaRank.label' => {
message => q|The phrase "Karma Rank".|,
lastUpdated => 1150169038,
},
'captcha_label' => {
message => q|The word "Captcha".|,
lastUpdated => 1150169038,
},
'keywords.label' => {
message => q|The word "Keywords".|,
lastUpdated => 1150169038,
},
'display last reply description' => {
message => q|If set to Yes, template variables will be added to allow the display of the last reply in this Thread.|,
lastUpdated => 1165449294,
@ -1404,6 +1429,12 @@ user has an avatar.|,
lastUpdated => 1149655833,
},
'user.canStartThread' => {
message => q|A conditional that is true if the current user can add Threads to this Collaboration Asset.|,
lastUpdated => 1149655833,
context => q|Template variable help|,
},
'displayLastReply' => {
message => q|A conditional that is true if the Collaboration System was configured to display the last reply. If this variable is true, then in the Collaboration Template, the lastReply.* variables will be enabled.|,
lastUpdated => 1149655833,
@ -1510,11 +1541,21 @@ the Collaboration Asset, the user will be notified.|,
lastUpdated => 1149655909,
},
'form.footer' => {
message => q|HTML required to end the search form.|,
lastUpdated => 1149655909,
},
'back.url' => {
message => q|A URL for returning to the main view for this Collaboration Asset.|,
lastUpdated => 1149655909,
},
'doit' => {
message => q|A boolean that is true if a search has just been submitted|,
lastUpdated => 1149655909,
},
'enable avatars' => {
message => q|Enable Avatars?|,
lastUpdated => 1131432414,
@ -1535,112 +1576,6 @@ the Collaboration Asset, the user will be notified.|,
lastUpdated => 1180759724,
},
'collaboration rss template title' => {
message => q|Collaboration RSS Template Variables|,
lastUpdated => 1184905545,
},
'feed title' => {
message => q|The title of the rss feed (comes from the collaboration title).|,
lastUpdated => 1149656056,
},
'collab link' => {
message => q|The url to the collaboration.|,
lastUpdated => 1149656056,
},
'feed description' => {
message => q|The description of the rss feed (comes from the collaboration synopsis).|,
lastUpdated => 1216913516,
},
'generator' => {
message => q|The program used to generate the rss feed, i.e. WebGUI plus version information. (optional field)|,
lastUpdated => 1149656056,
},
'webMaster' => {
message => q|The email address of the person responsible for the technical issues relating to this rss feed. (optional field)|,
lastUpdated => 1149656056,
},
'docs' => {
message => q|The url of documentation about the format of this file, RSS 2.0 (optional field)|,
lastUpdated => 1149656056,
},
'lastBuildDate' => {
message => q|The date that this feed was last updated. (optional field)|,
lastUpdated => 1149656056,
},
'item_loop' => {
message => q|Loops over the posts to be transmitted in this RSS feed.|,
lastUpdated => 1149656056,
},
'author' => {
message => q|The username of the person who submitted the post.|,
lastUpdated => 1149656056,
},
'post title' => {
message => q|The title of the item (post).|,
lastUpdated => 1149656056,
},
'full text link' => {
message => q|The url to the full text of the item.|,
lastUpdated => 1149656056,
},
'item description' => {
message => q|A synopsis of the item.|,
lastUpdated => 1149656056,
},
'guid' => {
message => q|A unique identifier for this item.|,
lastUpdated => 1149656056,
},
'pubDate' => {
message => q|The date the item was published.|,
lastUpdated => 1149656056,
},
'epochDate' => {
message => q|The date the item was published as an epoch date so that the Date macro can be used for custom date formatting.|,
lastUpdated => 1222106027,
},
'attachmentLoop' => {
message => q|A loop containg all attachements to this item (post).|,
lastUpdated => 1149656056,
},
'attachment_thumbnail' => {
message => q|The URL to the thumbnail for this attachment. Files will be represented by an
icon depending on their type. Images will have a true thumbnail.|,
lastUpdated => 1169747804,
},
'attachment.url' => {
message => q|The URL to this attachment.|,
lastUpdated => 1149656056,
},
'attachment.path' => {
message => q|The path in the filesystem to this attachment.|,
lastUpdated => 1149656056,
},
'attachment.length' => {
message => q|The length in this attachment, in bytes.|,
lastUpdated => 1149656056,
},
'collaborationAssetId' => {
message => q|The assetId of this Collaboration System. Unlike the variable assetId, this one will not be overridden by the assetIds inside of Threads or Posts.|,
lastUpdated => 1170543345,

View file

@ -66,7 +66,7 @@ my $node = WebGUI::Asset->getImportNode($session);
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Calendar Test"});
WebGUI::Test->tagsToRollback($versionTag);
addToCleanup($versionTag);
my $cal = $node->addChild({className=>'WebGUI::Asset::Wobject::Calendar'});
my $windowCal = $node->addChild({
@ -264,7 +264,7 @@ my $coincidentHigh = $windowCal->addChild({
my $tag2 = WebGUI::VersionTag->getWorking($session);
$tag2->commit;
WebGUI::Test->tagsToRollback($tag2);
addToCleanup($tag2);
is(scalar @{ $windowCal->getLineage(['children'])}, 13, 'added events to the window calendar');
@ -321,7 +321,7 @@ my $endOfWeek = $weekCal->addChild({
my $tag3 = WebGUI::VersionTag->getWorking($session);
$tag3->commit;
WebGUI::Test->tagsToRollback($tag3);
addToCleanup($tag3);
my $weekVars = $weekCal->viewWeek({ start => $bday });
my @eventBins = ();
@ -401,7 +401,7 @@ my $endOfMonth = $monthCal->addChild({
my $tag4 = WebGUI::VersionTag->getWorking($session);
$tag4->commit;
WebGUI::Test->tagsToRollback($tag4);
addToCleanup($tag4);
my $monthVars = $monthCal->viewMonth({ start => $bday });
@eventBins = ();
@ -447,7 +447,7 @@ my $dayCal = $node->addChild({
title => 'Calendar for doing event span testing, day',
});
$allDayDt = $bday->cloneToUserTimeZone;
$allDayDt = $bday->cloneToUserTimeZone;
my $nextDayDt = $bday->cloneToUserTimeZone->add(days => 1)->truncate( to => 'day')->add(hours => 19);
$allDay = $dayCal->addChild({
@ -472,7 +472,7 @@ my $nextDay = $dayCal->addChild({
my $tag5 = WebGUI::VersionTag->getWorking($session);
$tag5->commit;
WebGUI::Test->tagsToRollback($tag5);
addToCleanup($tag5);
my $hourVars = $dayCal->viewDay({ start => $nextDayDt });
@eventBins = ();
@ -488,6 +488,62 @@ cmp_deeply(
'... end of day event in proper bin'
);
######################################################################
#
# viewList
#
######################################################################
my $listCal = $node->addChild({
className => 'WebGUI::Asset::Wobject::Calendar',
title => 'Calendar for doing event span testing, list',
listViewPageInterval => 3600*24*3,
});
$allDayDt = $bday->cloneToUserTimeZone->truncate( to => 'day' );
my $prevDayDt = $bday->cloneToUserTimeZone->truncate( to => 'day' )->subtract(days => 1)->add(hours => 19);
diag $allDayDt->toDatabase;
diag $prevDayDt->toDatabase;
$allDay = $listCal->addChild({
className => 'WebGUI::Asset::Event',
title => 'An event with explicit times that lasts all day',
startDate => $allDayDt->toDatabaseDate,
endDate => $allDayDt->clone->add(days => 1)->toDatabaseDate,
startTime => $allDayDt->toDatabaseTime,
endTime => $allDayDt->clone->add(days => 1)->toDatabaseTime,
timeZone => $tz,
}, undef, undef, {skipAutoCommitWorkflows => 1});
my $prevDay = $listCal->addChild({
className => 'WebGUI::Asset::Event',
title => 'Event at the end of the previous day',
startDate => $prevDayDt->toDatabaseDate,
endDate => $prevDayDt->toDatabaseDate,
startTime => $prevDayDt->toDatabaseTime,
endTime => $prevDayDt->clone->add(hours => 1)->toDatabaseTime,
timeZone => $tz,
}, undef, undef, {skipAutoCommitWorkflows => 1});
my $tag6 = WebGUI::VersionTag->getWorking($session);
$tag6->commit;
addToCleanup($tag6);
my $listVars = $listCal->viewList({ start => $bday });
@eventBins = ();
foreach my $event (@{ $listVars->{events} }) {
push @eventBins, $event->{eventAssetId};
}
cmp_deeply(
\@eventBins,
[ $allDay->getId ],
'... correct set of events in list view'
);
######################################################################
#
# getFeeds
@ -501,7 +557,7 @@ my $feedCal = $node->addChild({
my $feedTag = WebGUI::VersionTag->getWorking($session);
$feedTag->set({name=>"Calendar Feed Test"});
WebGUI::Test->tagsToRollback($feedTag);
addToCleanup($feedTag);
$feedTag->commit;
cmp_deeply(
@ -509,8 +565,3 @@ cmp_deeply(
[],
'getFeeds: returns an empty array ref with no feeds'
);
TODO: {
local $TODO = "Tests to make later";
ok(0, 'Lots more to test');
}

View file

@ -14,6 +14,7 @@ use lib "$FindBin::Bin/../lib";
use WebGUI::Test;
use WebGUI::Session;
use WebGUI::Macro::CanEditText;
use Data::Dumper;
my $session = WebGUI::Test->session;
@ -61,17 +62,10 @@ my @testSets = (
},
);
my $numTests = scalar @testSets + 2;
my $numTests = scalar @testSets + 1;
plan tests => $numTests;
my $macro = 'WebGUI::Macro::CanEditText';
my $loaded = use_ok($macro);
SKIP: {
skip "Unable to load $macro", $numTests-1 unless $loaded;
is(
WebGUI::Macro::CanEditText::process($session,''),
'',
@ -85,8 +79,6 @@ foreach my $testSet (@testSets) {
is($output, $testSet->{output}, $testSet->{comment});
}
}
sub setupTest {
my ($session, $defaultNode) = @_;
$session->user({userId=>3});

View file

@ -15,12 +15,13 @@ use lib "$FindBin::Bin/../lib";
use WebGUI::Test;
use WebGUI::Session;
use WebGUI::Macro::D_date;
use Data::Dumper;
# ---- END DO NOT EDIT ----
use Test::More; # increment this value for each test you create
my $wgbday = 997966800;
my $wgbday = WebGUI::Test->webguiBirthday;
my @testSets = (
{
@ -33,17 +34,10 @@ my @testSets = (
},
);
my $numTests = scalar @testSets + 1 + 1;
my $numTests = scalar @testSets + 1;
plan tests => $numTests;
my $macro = 'WebGUI::Macro::D_date';
my $loaded = use_ok($macro);
SKIP: {
skip "Unable to load $macro", $numTests-1 unless $loaded;
my $session = WebGUI::Test->session;
foreach my $testSet (@testSets) {
@ -65,5 +59,3 @@ while ($time1 != $time2) {
}
is($output, $session->datetime->epochToHuman($time1), 'checking default time and format');
}

View file

@ -15,6 +15,7 @@ use lib "$FindBin::Bin/../lib";
use WebGUI::Test;
use WebGUI::Session;
use HTML::TokeParser;
use WebGUI::Macro::EditableToggle;
use Data::Dumper;
use Test::More; # increment this value for each test you create
@ -184,17 +185,10 @@ foreach my $testSet (@testSets) {
$numTests += 1 + (ref $testSet->{output} eq 'CODE');
}
$numTests += 1 + 1; ##Empty session Asset plus use_ok
$numTests += 1; ##Empty session Asset plus use_ok
plan tests => $numTests;
my $macro = 'WebGUI::Macro::EditableToggle';
my $loaded = use_ok($macro);
SKIP: {
skip "Unable to load $macro", $numTests-1 unless $loaded;
is(
WebGUI::Macro::EditableToggle::process($session,'on','off',''),
'',
@ -229,8 +223,6 @@ foreach my $testSet (@testSets) {
}
}
}
sub simpleHTMLParser {
my ($text) = @_;
my $p = HTML::TokeParser->new(\$text);
@ -255,7 +247,6 @@ sub setupTest {
my ($session, $defaultNode) = @_;
$session->user({userId=>3});
my $editGroup = WebGUI::Group->new($session, "new");
WebGUI::Test->groupsToDelete($editGroup);
my $tao = WebGUI::Group->find($session, "Turn Admin On");
##Create an asset with specific editing privileges
my $versionTag = WebGUI::VersionTag->getWorking($session);
@ -278,12 +269,6 @@ sub setupTest {
$users[1]->addToGroups([$editGroup->getId]);
##User 2 is an editor AND can turn on Admin
$users[2]->addToGroups([$editGroup->getId, $tao->getId]);
WebGUI::Test->usersToDelete(@users);
addToCleanup($versionTag, $editGroup, @users);
return ($versionTag, $asset, @users);
}
END { ##Clean-up after yourself, always
if (defined $versionTag and ref $versionTag eq 'WebGUI::VersionTag') {
$versionTag->rollback;
}
}

View file

@ -14,6 +14,7 @@ use lib "$FindBin::Bin/../lib";
use WebGUI::Test;
use WebGUI::Session;
use WebGUI::Macro::Extras;
use Test::More; # increment this value for each test you create
@ -49,20 +50,11 @@ my @testSets = (
my $numTests = scalar @testSets;
$numTests += 1;
plan tests => $numTests;
my $macro = 'WebGUI::Macro::Extras';
my $loaded = use_ok($macro);
SKIP: {
skip "Unable to load $macro", $numTests-1 unless $loaded;
foreach my $testSet (@testSets) {
my $output = WebGUI::Macro::Extras::process($session, $testSet->{path});
is($output, $testSet->{output}, $testSet->{comment});
}
}

View file

@ -14,24 +14,14 @@ use lib "$FindBin::Bin/../lib";
use WebGUI::Test;
use WebGUI::Session;
use WebGUI::Macro::c_companyName;
use Data::Dumper;
use Test::More; # increment this value for each test you create
my $session = WebGUI::Test->session;
my $numTests = 2+1;
plan tests => $numTests;
my $macro = 'WebGUI::Macro::c_companyName';
my $loaded = use_ok($macro);
my $originalCompanyName = $session->setting->get('companyName');
SKIP: {
skip "Unable to load $macro", $numTests-1 unless $loaded;
plan tests => 2;
my $output = WebGUI::Macro::c_companyName::process($session);
is($output, $originalCompanyName, "Testing companyName");
@ -39,8 +29,3 @@ is($output, $originalCompanyName, "Testing companyName");
$session->setting->set('companyName', q|Gooey's Consulting, LLC|);
$output = WebGUI::Macro::c_companyName::process($session);
is($output, q|Gooey's Consulting, LLC|, "Testing companyName with embedded quote and comma");
}
END {
}

View file

@ -14,26 +14,16 @@ use lib "$FindBin::Bin/../lib";
use WebGUI::Test;
use WebGUI::Session;
use WebGUI::Macro::e_companyEmail;
use Data::Dumper;
use Test::More; # increment this value for each test you create
my $session = WebGUI::Test->session;
my $numTests = 1 + 1;
plan tests => $numTests;
my $macro = 'WebGUI::Macro::e_companyEmail';
my $loaded = use_ok($macro);
SKIP: {
skip "Unable to load $macro", $numTests-1 unless $loaded;
plan tests => 1;
my ($value) = $session->dbSlave->quickArray(
"select value from settings where name='companyEmail'");
my $output = WebGUI::Macro::e_companyEmail::process($session);
is($output, $value, sprintf "Testing companyEmail");
}