fixed a bug in uss, template selection, and added a new template variable for wobject proxies.

This commit is contained in:
JT Smith 2004-08-27 18:16:07 +00:00
parent 82daf4f984
commit 3679c31973
6 changed files with 36 additions and 3 deletions

View file

@ -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).

View file

@ -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','<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n <html>\n <head>\n <title><tmpl_var session.page.title> - <tmpl_var session.setting.companyName></title>\n <tmpl_var head.tags>\n <style type=\"text/css\">\r\nTD { font: 8pt \'MS Shell Dlg\', Helvetica, sans-serif; }\r\nTD.delete { font: italic 7pt \'MS Shell Dlg\', Helvetica, sans-serif; }\r\nTD.label { font: 8pt \'MS Shell Dlg\', Helvetica, sans-serif; background-color: #c0c0c0; }\r\nTD.none { font: italic 12pt \'MS Shell Dlg\', Helvetica, sans-serif; }\r\n\r\n</style>\r\n\n </head>\n <script language=\"javascript\">\r\nfunction findAncestor(element, name, type) {\r\n while(element != null && (element.name != name || element.tagName != type))\r\n element = element.parentElement;\r\n return element;\r\n}\r\n</script>\r\n<script language=\"javascript\">\r\n\r\nfunction actionComplete(action, path, error, info) {\r\n var manager = findAncestor(window.frameElement, \'manager\', \'TABLE\');\r\n var wrapper = findAncestor(window.frameElement, \'wrapper\', \'TABLE\');\r\n\r\n if(manager) {\r\n if(error.length < 1) {\r\n manager.all.actions.reset();\r\n if(action == \'upload\') {\r\n manager.all.actions.image.value = \'\';\r\n manager.all.actions.name.value = \'\';\r\n manager.all.actions.thumbnailSize.value = \'\';\r\n\r\n }\r\n if(action == \'create\')\r\n manager.all.actions.folder.value = \'\';\r\n if(action == \'delete\')\r\n manager.all.txtFileName.value = \'\';\r\n }\r\n manager.all.actions.DPI.value = 96;\r\n manager.all.actions.path.value = path;\r\n }\r\n if(wrapper)\r\n wrapper.all.viewer.contentWindow.navigate(\'^/;?op=htmlAreaviewCollateral\');\r\n if(error.length > 0)\r\n alert(error);\r\n else if(info.length > 0)\r\n alert(info);\r\n}\r\n</script>\r\n\r\n<script language=\"javascript\">\r\nfunction deleteCollateral(options) {\r\n var lister = findAncestor(window.frameElement, \'lister\', \'IFRAME\');\r\n\r\n if(lister && confirm(\"Are you sure you want to delete this item ?\"))\r\n lister.contentWindow.navigate(\'^/;?op=htmlAreaDelete&\' + options);\r\n}\r\n</script>\r\n</head>\r\n<body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\r\n\n <tmpl_var body.content>\n \r\n</body>\n </html>\n ','style',1,0);

View file

@ -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;

View file

@ -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};

View file

@ -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 {

View file

@ -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". <br>
A property or value must be quoted if it contains spaces. Feel free to use the criteria builder to build your statements.
<p>
<b>NOTE:</b> 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.
<p>
|,
lastUpdated => 1057091098
lastUpdated => 1053183804
},
'greater than' => {