diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index cd9533c37..bd9476107 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -13,6 +13,14 @@ dir (Yary Hluchan) - bugfix [ 1027684 ] cp silent failure in Attatchment.pm (Yary Hluchan) - bugfix [ 1027681 ] Some warnings hard to track down (Yary Hluchan) + - bugfix [ 1027950 ] Collateral problem(s) + - bugfix [ 1028110 ] 6.2.2 PageTree doesn't format AND move buttons don't + work + - bugfix [ 1027687 ] Events List does not show events + - bugfix [ 1028054 ] 6.2.2 USS uploads do not show on list + - Fixed a problem with the dTree navigation template. + - bugfix [ 998249 ] Moving Survey Questions - Incorrect Redirection + - bugfix [ 1029170 ] Forum: Sorting thread by date 6.2.2 diff --git a/docs/create.sql b/docs/create.sql index 9cd4f7891..d12e81a27 100644 --- a/docs/create.sql +++ b/docs/create.sql @@ -2053,7 +2053,7 @@ CREATE TABLE collateralFolder ( -- -INSERT INTO collateralFolder VALUES ('0','Root','0','Top level'); +INSERT INTO collateralFolder VALUES ('0','Root','-1','Top level'); -- -- Table structure for table `databaseLink` @@ -2793,7 +2793,7 @@ INSERT INTO template VALUES ('1','verticalMenu','\r INSERT INTO template VALUES ('3','horizontalMenu','\r\n\r\n\r\n\r\n\r\ntarget=\"_blank\"\r\n href=\"\">\r\n · \r\n\r\n','Navigation',1,1); INSERT INTO template VALUES ('4','DropMenu','\r\n\r\n\r\n\r\n\r\n\r\nWhere do you want to go?\r\n\r\n\"> - \r\n\r\n\r\n','Navigation',1,1); INSERT INTO template VALUES ('5','Tabs','\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n target=\"_blank\" href=\"\">\r\n \r\n','Navigation',1,1); -INSERT INTO template VALUES ('6','dtree','^StyleSheet(\"/Navigation/dtree/dtree.css\");\r\n^JavaScript(\"/Navigation/dtree/dtree.js\");\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n','Navigation',1,1); +INSERT INTO template VALUES ('6','dtree','^StyleSheet(\"/Navigation/dtree/dtree.css\");\r\n^JavaScript(\"/Navigation/dtree/dtree.js\");\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n','Navigation',1,1); INSERT INTO template VALUES ('1','Calendar Month (Big)','\r\n \r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n \">\r\n \r\n\r\n\r\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n HeaderData\" width=\"14%\" valign=\"top\" align=\"left\">\n \n \n ·\">\n \n \n \n \n \n \n \n \n \n \n \n \n\n\n\n\n \n · · \n \n\n','EventsCalendar',1,1); INSERT INTO template VALUES ('7','Cool Menus','\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n^JavaScript(\"/coolmenus/coolmenus4.js\");\r\n','Navigation',1,1); INSERT INTO template VALUES ('3','Midas','^JavaScript(\"/textFix.js\");\r\n\r\n\r\n \r\n \r\n\r\n\r\n\r\n','richEditor',1,1); @@ -3093,7 +3093,7 @@ CREATE TABLE webguiVersion ( -- -INSERT INTO webguiVersion VALUES ('6.2.2','initial install',unix_timestamp()); +INSERT INTO webguiVersion VALUES ('6.2.3','initial install',unix_timestamp()); -- -- Table structure for table `wobject` diff --git a/docs/upgrades/upgrade_6.2.2-6.2.3.sql b/docs/upgrades/upgrade_6.2.2-6.2.3.sql index 460431811..260251fec 100644 --- a/docs/upgrades/upgrade_6.2.2-6.2.3.sql +++ b/docs/upgrades/upgrade_6.2.2-6.2.3.sql @@ -1,3 +1,7 @@ insert into webguiVersion values ('6.2.3','upgrade',unix_timestamp()); update collateralFolder set parentId='-1' where parentId='0'; +delete from template where namespace='Navigation' and templateId='6'; + +INSERT INTO template VALUES ('6','dtree','^StyleSheet(\"/Navigation/dtree/dtree.css\");\r\n^JavaScript(\"/Navigation/dtree/dtree.js\");\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n','Navigation',1,1); + diff --git a/lib/WebGUI/DateTime.pm b/lib/WebGUI/DateTime.pm index c0315cc6a..9b01d4961 100644 --- a/lib/WebGUI/DateTime.pm +++ b/lib/WebGUI/DateTime.pm @@ -107,7 +107,7 @@ sub addToDate { $years = shift || 0; $months = shift || 0; $days = shift || 0; - $newDate = DateCalc($date,"$years:$months:0:$days:0:0:0"); + $newDate = DateCalc($date,"+$years:$months:0:$days:0:0:0"); return &dateToEpoch($newDate); } @@ -141,7 +141,7 @@ sub addToTime { $hours = shift || 0; $mins = shift || 0; $secs = shift || 0; - $newDate = DateCalc($date,"0:0:0:0:$hours:$mins:$secs"); + $newDate = DateCalc($date,"+0:0:0:0:$hours:$mins:$secs"); return &dateToEpoch($newDate); } @@ -204,7 +204,14 @@ An epoch date. sub epochToArray { my $epoch = shift; - return &UnixDate(epochToDate($epoch),'%Y','%m','%d','%H','%M','%S'); + my @date = &UnixDate(epochToDate($epoch),'%Y','%m','%d','%H','%M','%S'); + $date[0] = $date[0]+0; + $date[1] = $date[1]+0; + $date[2] = $date[2]+0; + $date[3] = $date[3]+0; + $date[4] = $date[4]+0; + $date[5] = $date[5]+0; + return @date; } @@ -618,8 +625,8 @@ sub monthCount { my $end = &epochToDate(shift); my $err; my $delta = &DateCalc($start,$end,\$err,1); - return $delta; - return &Delta_Format($delta,0,'%Mh'); + my $count = 1+&Delta_Format($delta,0,'%Mv')+&Delta_Format($delta,0,'%yv')*12; + return $count; } diff --git a/lib/WebGUI/ErrorHandler.pm b/lib/WebGUI/ErrorHandler.pm index dab99a9cc..92ab480c2 100644 --- a/lib/WebGUI/ErrorHandler.pm +++ b/lib/WebGUI/ErrorHandler.pm @@ -375,7 +375,7 @@ The message you wish to write to the log. sub writeLog { if (my $log = FileHandle->new(">>".$WebGUI::Session::session{config}{logfile})) { - print $log $_[0]; + print $log "\n".$_[0]; printf $log '%s:%d (sub %s) ',(caller(2))[1,2,3]; $log->close; } else { diff --git a/lib/WebGUI/Forum/UI.pm b/lib/WebGUI/Forum/UI.pm index 51142f0e0..8548da2ed 100644 --- a/lib/WebGUI/Forum/UI.pm +++ b/lib/WebGUI/Forum/UI.pm @@ -1011,7 +1011,7 @@ sub getForumTemplateVars { $var{'thread.sorted.'.$sortDir} = 1; if ($session{scratch}{forumSortBy} eq "date") { $var{'thread.sortedby.date'} = 1; - $query .= "rootPostId $sortDir"; + $query .= "lastPostDate $sortDir"; } elsif ($session{scratch}{forumSortBy} eq "views") { $var{'thread.sortedby.views'} = 1; $query .= "views $sortDir"; diff --git a/lib/WebGUI/Operation/Page.pm b/lib/WebGUI/Operation/Page.pm index ca5e27fbc..3bdd12fcf 100644 --- a/lib/WebGUI/Operation/Page.pm +++ b/lib/WebGUI/Operation/Page.pm @@ -192,7 +192,7 @@ sub _traversePageTree { tie %wobject, 'Tie::CPHash'; $spacer = ''; - my $sth = WebGUI::SQL->read("select pageId,isSystem,urlizedTitle,title from page where parentId=".quote($parentId)); + my $sth = WebGUI::SQL->read("select pageId,isSystem,urlizedTitle,title from page where parentId=".quote($parentId)." order by nestedSetLeft"); while (my ($pageId,$isSystem,$url,$title) = $sth->array) { unless ($isSystem) { $output .= $spacer x $initialDepth diff --git a/lib/WebGUI/Wobject/EventsCalendar.pm b/lib/WebGUI/Wobject/EventsCalendar.pm index 9ba548de0..7f9028652 100644 --- a/lib/WebGUI/Wobject/EventsCalendar.pm +++ b/lib/WebGUI/Wobject/EventsCalendar.pm @@ -372,7 +372,7 @@ sub www_view { tie %previous, 'Tie::CPHash'; if ($_[0]->get("startMonth") eq "first") { my $query = "select min(startDate) from EventsCalendar_event"; - $query .= " where wobjectId=".$_[0]->get("wobjectId") unless ($_[0]->get("isMaster")); + $query .= " where wobjectId=".quote($_[0]->get("wobjectId")) unless ($_[0]->get("isMaster")); ($minDate) = WebGUI::SQL->quickArray($query,WebGUI::SQL->getSlave); } elsif ($_[0]->get("startMonth") eq "january") { $minDate = WebGUI::DateTime::humanToEpoch(WebGUI::DateTime::epochToHuman("","%y")."-01-01 00:00:00"); @@ -384,7 +384,7 @@ sub www_view { } if ($_[0]->get("endMonth") eq "last") { my $query = "select max(endDate) from EventsCalendar_event"; - $query .= " where wobjectId=".$_[0]->get("wobjectId") unless ($_[0]->get("isMaster")); + $query .= " where wobjectId=".quote($_[0]->get("wobjectId")) unless ($_[0]->get("isMaster")); ($maxDate) = WebGUI::SQL->quickArray($query,WebGUI::SQL->getSlave); } elsif ($_[0]->get("endMonth") eq "after12") { $maxDate = WebGUI::DateTime::addToDate($minDate,1,0,0); @@ -395,9 +395,15 @@ sub www_view { } elsif ($_[0]->get("endMonth") eq "after3") { $maxDate = WebGUI::DateTime::addToDate($minDate,0,3,0); } +WebGUI::ErrorHandler::warn("Min:".$minDate); +WebGUI::ErrorHandler::warn("Max:".$maxDate); + $maxDate = $maxDate || WebGUI::DateTime::time(); +WebGUI::ErrorHandler::warn("Max:".$maxDate); ($junk,$maxDate) = WebGUI::DateTime::dayStartEnd($maxDate); +WebGUI::ErrorHandler::warn("Max:".$maxDate); my $monthCount = WebGUI::DateTime::monthCount($minDate,$maxDate); +WebGUI::ErrorHandler::warn("Count:".$monthCount); unless ($session{form}{calPn}) { $flag = 1; if ($_[0]->get("defaultMonth") eq "current") { @@ -414,7 +420,7 @@ sub www_view { $var{"addevent.url"} = WebGUI::URL::page('func=editEvent&eid=new&wid='.$_[0]->get("wobjectId")); $var{"addevent.label"} = WebGUI::International::get(20,$_[0]->get("namespace")); my @monthloop; - for (my $i=1;$i<=$monthCount;$i++) { + for (my $i=1;$i<$monthCount;$i++) { # if ($session{form}{calPn} == ($i)) { my $thisMonth = WebGUI::DateTime::addToDate($minDate,0,($i-1),0); my ($monthStart, $monthEnd) = WebGUI::DateTime::monthStartEnd($thisMonth); diff --git a/lib/WebGUI/Wobject/Survey.pm b/lib/WebGUI/Wobject/Survey.pm index aec2f017e..e5578ff27 100644 --- a/lib/WebGUI/Wobject/Survey.pm +++ b/lib/WebGUI/Wobject/Survey.pm @@ -829,14 +829,14 @@ sub www_moveAnswerUp { sub www_moveQuestionDown { return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit); $_[0]->moveCollateralDown("Survey_question","Survey_questionId",$session{form}{qid},"Survey_id"); - return $_[0]->www_edit; + return ""; } #------------------------------------------------------------------- sub www_moveQuestionUp { return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit); $_[0]->moveCollateralUp("Survey_question","Survey_questionId",$session{form}{qid},"Survey_id"); - return $_[0]->www_edit; + return ""; } #------------------------------------------------------------------- diff --git a/lib/WebGUI/Wobject/USS.pm b/lib/WebGUI/Wobject/USS.pm index 028f90f62..3a6ab6ec9 100644 --- a/lib/WebGUI/Wobject/USS.pm +++ b/lib/WebGUI/Wobject/USS.pm @@ -711,6 +711,7 @@ sub www_view { $var{"search.Form"} = WebGUI::Search::form({wid=>$_[0]->get("wobjectId"),func=>'view',search=>1}); $var{"search.url"} = WebGUI::Search::toggleURL("wid=".$_[0]->get("wobjectId")."&func=view"); $var{"rss.url"} = WebGUI::URL::page('func=viewRSS&wid='.$_[0]->get("wobjectId")); + $var{canModerate} = WebGUI::Grouping::isInGroup($_[0]->get("groupToApprove"),$session{user}{userId}); WebGUI::Style::setLink($var{"rss.url"},{ rel=>'alternate', type=>'application/rss+xml', title=>'RSS' }); if ($session{scratch}{search}) { $numResults = $session{scratch}{numResults}; @@ -719,9 +720,12 @@ sub www_view { if ($constraints ne "") { $constraints = "USS_submission.status='Approved' and ".$constraints; } else { - $constraints = "(USS_submission.status='Approved' or (USS_submission.userId=".quote($session{user}{userId})." and USS_submission.userId<>1))"; + $constraints = "(USS_submission.status='Approved' or (USS_submission.userId=".quote($session{user}{userId})." and USS_submission.userId<>1)"; + if ($var{canModerate}) { + $constraints .= " or USS_submission.status='Pending'"; + } + $constraints .= ")"; } - $var{canModerate} = WebGUI::Grouping::isInGroup($_[0]->get("groupToApprove"),$session{user}{userId}); $var{"title.label"} = WebGUI::International::get(99); $var{"thumbnail.label"} = WebGUI::International::get(52,$_[0]->get("namespace")); $var{"date.label"} = WebGUI::International::get(13,$_[0]->get("namespace"));