bugfixes and preparing for 6.2.3 release

This commit is contained in:
JT Smith 2004-09-16 20:36:17 +00:00
parent 1713df81c6
commit eeecbe8afb
10 changed files with 47 additions and 18 deletions

View file

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

View file

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

View file

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