diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 03f26cf97..40b886a12 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -94,6 +94,7 @@ - upgrade.pl now deletes temporary files and template cache. - Fixed a bug in the HTMLArea image manager that would not allow users to upload files if the gateway script was not at /index.pl + - Fixed a bug where trashed pages were still showing up in page tree. 6.1.1 diff --git a/docs/previousVersion.sql b/docs/previousVersion.sql index 5928e88d6..0962ffae6 100644 --- a/docs/previousVersion.sql +++ b/docs/previousVersion.sql @@ -793,7 +793,6 @@ CREATE TABLE USS_submission ( INSERT INTO USS_submission VALUES (1,'Talk to the Experts',1076705448,'Admin',3,' Our website contains all of the different methods for reaching us. Our friendly staff will be happy to assist you in any way possible.\r\n\r\n',NULL,NULL,'Approved',0,1004,1076706084,0,1000,'html','http://www.plainblack.com/contact_us','0',NULL,NULL,NULL); -INSERT INTO USS_submission VALUES (2,'Request an Interactive Demonstration CD',1076705448,'Admin',3,'This CD shows all of the excellent features that WebGUI provides and gives you a brief overview of the product. It also provides examples of how the product works and how it can be used in your environment.',NULL,NULL,'Approved',0,1005,1076706084,0,1000,'html','http://www.plainblack.com/presentation_cd','0',NULL,NULL,NULL); INSERT INTO USS_submission VALUES (3,'Get the Manual',1076705448,'Admin',3,'Ruling WebGUI is the definitive guide to everything WebGUI related. It has been compiled by the experts at Plain Black Software and covers almost all aspects of WebGUI. When you purchase Ruling WebGUI, you will receive updates to this great manual for one full year.',NULL,NULL,'Approved',0,1006,1076706084,0,1000,'html','http://www.plainblack.com/ruling_webgui','0',NULL,NULL,NULL); INSERT INTO USS_submission VALUES (4,'Purchase Technical Support',1076705448,'Admin',3,'The WebGUI Support Center is there to help you when you get stuck. With a system as large as WebGUI, you\'ll likely have some questions, and our courteous and knowlegable staff is available to answer those questions. And best of all, you get Ruling WebGUI free when you sign up for the Support Center.\r\n\r\n',NULL,NULL,'Approved',0,1007,1076706084,0,1000,'html','http://www.plainblack.com/support_programs','0',NULL,NULL,NULL); INSERT INTO USS_submission VALUES (5,'Sign Up for Hosting',1076705448,'Admin',3,'We provide professional hosting services for you so you don\'t have to go through the trouble of finding a hoster who likely won\'t know what to do with WebGUI anyway.',NULL,NULL,'Approved',0,1008,1076706084,0,1000,'html','http://www.plainblack.com/hosting','0',NULL,NULL,NULL); @@ -988,7 +987,6 @@ INSERT INTO forum VALUES (1001,1,'javascript',0,7,3600,0,4,0,1,1,0,0,0,0,0,0,1,1 INSERT INTO forum VALUES (1002,1,'javascript',0,2,3600,0,4,0,1,1,0,0,0,0,0,0,1,1,1,1,1,1,31536000,30,NULL,7); INSERT INTO forum VALUES (1003,1,'javascript',0,7,3600,0,4,0,1,1,0,0,0,0,0,0,1,1,1,1,1,1,31536000,30,NULL,7); INSERT INTO forum VALUES (1004,1,'javascript',0,2,3600,0,4,0,1,1,0,0,0,0,0,0,1,1,1,1,1,1,31536000,30,NULL,7); -INSERT INTO forum VALUES (1005,1,'javascript',0,2,3600,0,4,0,1,1,0,0,0,0,0,0,1,1,1,1,1,1,31536000,30,NULL,7); INSERT INTO forum VALUES (1006,1,'javascript',0,2,3600,0,4,0,1,1,0,0,0,0,0,0,1,1,1,1,1,1,31536000,30,NULL,7); INSERT INTO forum VALUES (1007,1,'javascript',0,2,3600,0,4,0,1,1,0,0,0,0,0,0,1,1,1,1,1,1,31536000,30,NULL,7); INSERT INTO forum VALUES (1008,1,'javascript',0,2,3600,0,4,0,1,1,0,0,0,0,0,0,1,1,1,1,1,1,31536000,30,NULL,7); 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 b4e6b8cdd..1a139000b 100644 --- a/docs/upgrades/upgrade_6.1.1-6.2.0.sql +++ b/docs/upgrades/upgrade_6.1.1-6.2.0.sql @@ -293,4 +293,5 @@ INSERT INTO template (templateId, name, template, namespace, isEditable, showInF INSERT INTO template (templateId, name, template, namespace, isEditable, showInForms) VALUES ('6','HTMLArea 3 (Mozilla / IE)','^JavaScript(\"/textFix.js\");\r\n \r\n^RawHeadTags(\"\n \n\");\r\n^JavaScript(\"/htmlArea3/htmlarea.js\"); \r\n^RawHeadTags(\"\n\n\");\n \r\n \r\n\r\n ','richEditor',1,1); INSERT INTO template (templateId, name, template, namespace, isEditable, showInForms) VALUES ('5','lastResort','^JavaScript(\"/textFix.js\");\r\n\r\n\r\n\r\n\r\n\r\n','richEditor',1,1); INSERT INTO template (templateId, name, template, namespace, isEditable, showInForms) VALUES ('1','HTMLArea','^JavaScript(\"/textFix.js\");\r\n\r\n \r\n \r\n \r\n ^JavaScript(\"/htmlArea/editor.js\");\r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n','richEditor',1,1); - +alter table page add column isSystem int not null default 0; +update page set isSystem=1 where pageId in (4,3,2,5,0); diff --git a/lib/WebGUI/Navigation.pm b/lib/WebGUI/Navigation.pm index c5e167dcf..d85779906 100644 --- a/lib/WebGUI/Navigation.pm +++ b/lib/WebGUI/Navigation.pm @@ -258,8 +258,7 @@ sub build { $pageData->{"page.relDepth"} = $pageData->{"page.absDepth"} - $startPageDepth; $pageData->{"page.isCurrent"} = ($page->{'pageId'} == $session{page}{pageId}); $pageData->{"page.isHidden"} = $page->{'hideFromNavigation'}; - $pageData->{"page.isSystem"} = ($page->{'pageId'} =~ /^\d+$/ && - ($page->{'pageId'} < 1000 && $page->{'pageId'} >= 0)); + $pageData->{"page.isSystem"} = $page->{isSystem}; # indent my $indent = 0; @@ -287,7 +286,7 @@ sub build { next if ($pageData->{"page.absDepth"} < $self->{_stopAtLevel}); # Check showSystemPages - next if (! $self->{_showSystemPages} && $pageData->{"page.isSystem"}); + # next if (! $self->{_showSystemPages} && $pageData->{"page.isSystem"}); # Deal with hidden pages, don't ever hide pages if admin mode is on next if(($page->{'hideFromNavigation'} && ! $self->{_showHiddenPages}) && (! $session{var}{adminOn})); @@ -347,7 +346,7 @@ sub build { } # We had a cache miss, so let's put the data in cache - $cache->set(\@page_loop, 3600*24) unless $session{var}{adminOn}; + # $cache->set(\@page_loop, 3600*24) unless $session{var}{adminOn}; } else { # We had a cache hit @page_loop = @{$cacheContent}; diff --git a/lib/WebGUI/Operation/Page.pm b/lib/WebGUI/Operation/Page.pm index c90a0cc86..f61c566f1 100644 --- a/lib/WebGUI/Operation/Page.pm +++ b/lib/WebGUI/Operation/Page.pm @@ -193,41 +193,36 @@ The depth the tree should start with. Defaults to zero. =cut sub _traversePageTree { - my ($top, $initialDepth, %wobject, $output, $spacer, $page, $currentPage, $options, $currentPageId, $currentUrlizedTitle, $wobjects); - ($top, $initialDepth) = @_; + my (%wobject, $output, $spacer, $page, $currentPage, $options, $currentPageId, $currentUrlizedTitle, $wobjects); + my ($parentId, $initialDepth) = @_; tie %wobject, 'Tie::CPHash'; $spacer = ''; - $page = WebGUI::Page->getPage($top); - - $page->traversePreOrder( - sub { - ($currentPage, $options) = @_; - $currentPageId = $currentPage->get('pageId'); - $currentUrlizedTitle = $currentPage->get('urlizedTitle'); - if ($currentPageId < 2 || $currentPageId > 999) { - $output .= $spacer x $options->{_depth} - .pageIcon() - .deleteIcon('op=deletePage',$currentUrlizedTitle) - .moveLeftIcon(sprintf('op=moveTreePageLeft&pageId=%s',$currentPageId), $currentUrlizedTitle) - .moveUpIcon(sprintf('op=moveTreePageUp&pageId=%s',$currentPageId), $currentUrlizedTitle) - .moveDownIcon(sprintf('op=moveTreePageDown&pageId=%s',$currentPageId), $currentUrlizedTitle) - .moveRightIcon(sprintf('op=moveTreePageRight&pageId=%s',$currentPageId), $currentUrlizedTitle) - .editIcon('op=editPage', $currentUrlizedTitle) - .' '.$currentPage->get('title').'
'; - $wobjects = WebGUI::SQL->read("select * from wobject where pageId=".quote($currentPageId)); - while (%wobject = $wobjects->hash) { - $output .= $spacer x $options->{_depth} . $spacer - .wobjectIcon() - .deleteIcon('func=delete&wid='.$wobject{wobjectId},$currentUrlizedTitle) - .editIcon('func=edit&wid='.$wobject{wobjectId},$currentUrlizedTitle) - .' '. $wobject{title}.'
'; - } - $wobjects->finish; + my $sth = WebGUI::SQL->read("select pageId,isSystem,urlizedTitle,title from page where parentId=".$parentId); + while (my ($pageId,$isSystem,$url,$title) = $sth->array) { + unless ($isSystem) { + $output .= $spacer x $options->{_depth} + .pageIcon() + .deleteIcon('op=deletePage',$url) + .moveLeftIcon(sprintf('op=moveTreePageLeft&pageId=%s',$pageId), $url) + .moveUpIcon(sprintf('op=moveTreePageUp&pageId=%s',$pageId), $url) + .moveDownIcon(sprintf('op=moveTreePageDown&pageId=%s',$pageId), $url) + .moveRightIcon(sprintf('op=moveTreePageRight&pageId=%s',$pageId), $url) + .editIcon('op=editPage', $url) + .' '.$title.'
'; + $wobjects = WebGUI::SQL->read("select wobjectId,title from wobject where pageId=".quote($pageId)); + while (%wobject = $wobjects->hash) { + $output .= $spacer x $options->{_depth} . $spacer + .wobjectIcon() + .deleteIcon('func=delete&wid='.$wobject{wobjectId},$url) + .editIcon('func=edit&wid='.$wobject{wobjectId},$url) + .' '. $wobject{title}.'
'; } + $wobjects->finish; + $output .= _traversePageTree($pageId,$initialDepth+1); } - ); - + } + $sth->finish; return $output; } diff --git a/lib/WebGUI/Page.pm b/lib/WebGUI/Page.pm index 3eee9f44d..2df5348c3 100644 --- a/lib/WebGUI/Page.pm +++ b/lib/WebGUI/Page.pm @@ -90,12 +90,12 @@ Some OO style methods @array = $page->ancestors; @array = $page->daughters; - @array = $page->decendants; + @array = $page->descendants; @array = $page->generation; @array = $page->leaves_under; @array = $page->pedigree; @array = $page->self_and_ancesters; - @array = $page->self_and_decendants; + @array = $page->self_and_descendants; @array = $page->self_and_sisters; @array = $page->self_and_sisters_splitted; @array = $page->sisters; diff --git a/lib/WebGUI/Wobject/USS.pm b/lib/WebGUI/Wobject/USS.pm index 565dd2f59..c792dfe83 100644 --- a/lib/WebGUI/Wobject/USS.pm +++ b/lib/WebGUI/Wobject/USS.pm @@ -632,6 +632,7 @@ sub www_editSubmissionSave { delete $pageVars{parentId}; delete $pageVars{sequenceNumber}; $pageVars{hideFromNavigation} = 1; + $pageVars{isSystem} = 1; $pageVars{subroutine} = "viewSubmissionAsPage"; $pageVars{subroutinePackage} = "WebGUI::Wobject::USS"; $pageVars{subroutineParams} = "{wobjectId=>'".$_[0]->wid."',submissionId=>'".$session{form}{sid}."'}";