diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index c9d382d98..0f4f61581 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -72,6 +72,9 @@ - Updated some out of date and missing help information. (Colin Kuskie) - RFE [ 855761 ]. Move forum to another Message Board (Leendert Bottelberghs). - RFE [ 1010055 ]. Added template variables for current user alias (Leendert Bottelberghs). + - Wobject Proxies (Shortcuts) now expose a template variable called + original.page.url that will allow you to link to the original content from + the shortcut. - bugfix [ 1016271 ]. all posts go to last forum in MB (Leendert Bottelberghs). diff --git a/docs/upgrades/upgrade_6.1.1-6.2.0.sql b/docs/upgrades/upgrade_6.1.1-6.2.0.sql index ad0f69e33..96df180db 100644 --- a/docs/upgrades/upgrade_6.1.1-6.2.0.sql +++ b/docs/upgrades/upgrade_6.1.1-6.2.0.sql @@ -120,6 +120,7 @@ alter table EventsCalendar_event change EventsCalendar_eventId EventsCalendar_ev alter table EventsCalendar change eventTemplateId eventTemplateId char(22); alter table EventsCalendar_event change EventsCalendar_recurringId EventsCalendar_recurringId char(22); alter table FileManager_file change groupToView groupToView char(22); +alter table WobjectProxy change proxiedTemplateId proxiedTemplateId char(22) not null default '1'; delete from template where namespace='style' and templateId='10'; INSERT INTO template VALUES (10,'htmlArea Image Manager','\n \n \n <tmpl_var session.page.title> - <tmpl_var session.setting.companyName>\n \n \r\n\n \n \r\n\r\n\r\n\r\n\r\n\r\n\n \n \r\n\n \n ','style',1,0); diff --git a/lib/WebGUI/FormProcessor.pm b/lib/WebGUI/FormProcessor.pm index 289e4d8e2..7fb40599f 100644 --- a/lib/WebGUI/FormProcessor.pm +++ b/lib/WebGUI/FormProcessor.pm @@ -585,7 +585,7 @@ The name of the form variable to retrieve. =cut sub template { - if ($session{form}{$_[0]} =~ /^\d+$/) { + if (exists $session{form}{$_[0]}) { return $session{form}{$_[0]}; } return 1; diff --git a/lib/WebGUI/Page.pm b/lib/WebGUI/Page.pm index c0d72eaa9..3eee9f44d 100644 --- a/lib/WebGUI/Page.pm +++ b/lib/WebGUI/Page.pm @@ -602,6 +602,8 @@ sub generate { if ($wobjectProxy->{overrideTemplate}) { ${$wobject}{templateId} = $wobjectProxy->{proxiedTemplateId}; } + my $originalWobjectPage = WebGUI::Page->new($wobject->{pageId}); + $wobject->{'original.page.url'} = WebGUI::URL::gateway($originalWobjectPage->get("urlizedTitle")); } } my $cmd = "WebGUI::Wobject::".${$wobject}{namespace}; diff --git a/lib/WebGUI/Wobject/USS.pm b/lib/WebGUI/Wobject/USS.pm index 552975657..648a26632 100644 --- a/lib/WebGUI/Wobject/USS.pm +++ b/lib/WebGUI/Wobject/USS.pm @@ -257,6 +257,12 @@ sub www_approveSubmission { } } +#------------------------------------------------------------------- +sub www_copy { + return "Copying of User Submission Systems has been disabled until 6.3."; +} + + #------------------------------------------------------------------- sub www_deleteFile { my ($owner) = WebGUI::SQL->quickArray("select userId from USS_submission where USS_submissionId=".quote($session{form}{sid})); @@ -284,13 +290,15 @@ sub www_deleteSubmission { #------------------------------------------------------------------- sub www_deleteSubmissionConfirm { - my ($owner, $forumId) = WebGUI::SQL->quickArray("select userId,forumId from USS_submission where USS_submissionId=".quote($session{form}{sid})); + my ($owner, $forumId, $pageId) = WebGUI::SQL->quickArray("select userId,forumId,pageId from USS_submission where USS_submissionId=".quote($session{form}{sid})); if ($owner == $session{user}{userId} || WebGUI::Grouping::isInGroup($_[0]->get("groupToApprove"))) { my ($inUseElsewhere) = WebGUI::SQL->quickArray("select count(*) from USS_submission where forumId=".quote($forumId)); unless ($inUseElsewhere > 1) { my $forum = WebGUI::Forum->new($forumId); $forum->purge; } + my $page = WebGUI::Page->new($pageId); + $page->purge; $_[0]->deleteCollateral("USS_submission","USS_submissionId",$session{form}{sid}); my $file = WebGUI::Attachment->new("",$session{form}{wid},$session{form}{sid}); $file->deleteNode; @@ -639,6 +647,23 @@ sub www_editSubmissionSave { $hash{status} = "Approved"; } } + my $parentPage = WebGUI::Page->new($_[0]->get("pageId")); + my %pageVars = %{$parentPage->get}; + delete $pageVars{pageId}; + delete $pageVars{nestedSetLeft}; + delete $pageVars{nestedSetRight}; + delete $pageVars{depth}; + delete $pageVars{parentId}; + delete $pageVars{sequenceNumber}; + $pageVars{hideFromNavigation} = 1; + $pageVars{title} = $pageVars{menuTitle} = $hash{title}; + $pageVars{subroutine} = "viewSubmissionAsPage"; + $pageVars{subroutinePackage} = "WebGUI::Wobject::USS"; + $pageVars{subroutineParams} = "{wobjectId=>'".$_[0]->wid."',submissionId=>'".$hash{USS_submissionId}."'}"; + $pageVars{urlizedTitle} .= "/".$hash{title}; + my $newPage = $parentPage->add; + $pageVars{urlizedTitle} = WebGUI::Page::makeUnique(WebGUI::URL::urlize($pageVars{urlizedTitle},$newPage->get("pageId"))); + $newPage->set(\%pageVars); $_[0]->setCollateral("USS_submission", "USS_submissionId", \%hash, 1, 0, "USS_id", $_[0]->get("USS_id")); return $_[0]->www_viewSubmission(); } else { diff --git a/lib/WebGUI/i18n/English/WobjectProxy.pm b/lib/WebGUI/i18n/English/WobjectProxy.pm index c7d94dd1e..b89440d8a 100644 --- a/lib/WebGUI/i18n/English/WobjectProxy.pm +++ b/lib/WebGUI/i18n/English/WobjectProxy.pm @@ -86,8 +86,10 @@ Most Recent will select the most recent wobject that match the proxy criteria. A statement to determinate what to proxy, in the form of "color = blue and weight != heavy". Multiple expressions may be joined with "and" and "or".
A property or value must be quoted if it contains spaces. Feel free to use the criteria builder to build your statements.

+NOTE: Wobject Proxy will automatically add a template variable to the wobject it's proxying called 'original.page.url'. You can use that to link to the original content that's being proxied. +

|, - lastUpdated => 1057091098 + lastUpdated => 1053183804 }, 'greater than' => {