WebGUI 3.2.2 release

This commit is contained in:
JT Smith 2002-02-14 00:13:00 +00:00
parent 2fbbe1ad28
commit 48253ba11b
12 changed files with 72 additions and 51 deletions

View file

@ -71,7 +71,8 @@ sub getType {
$icon = $session{setting}{lib}."/fileIcons/html.gif";
} elsif ($extension eq "html" || $extension eq "htm" || $extension eq "xml") {
$icon = $session{setting}{lib}."/fileIcons/html.gif";
} elsif ($extension eq "rar" || $extension eq "tar" || $extension eq "gz" || $extension eq "Z") {
} elsif ($extension eq "rar" || $extension eq "tgz" || $extension eq "tar.gz" ||
$extension eq "tar" || $extension eq "gz" || $extension eq "Z") {
$icon = $session{setting}{lib}."/fileIcons/rar.gif";
} elsif ($extension eq "mdb") {
$icon = $session{setting}{lib}."/fileIcons/mdb.gif";

View file

@ -23,7 +23,7 @@ sub _recurseCrumbTrail {
tie %data, 'Tie::CPHash';
%data = WebGUI::SQL->quickHash("select pageId,parentId,title,urlizedTitle from page where pageId=$_[0]");
if ($data{pageId} > 1) {
$output .= _recurseCrumbTrail($data{parentId});
$output .= _recurseCrumbTrail($data{parentId},$_[1]);
}
if ($data{title} ne "") {
$output .= '<a class="crumbTrail" href="'.WebGUI::URL::gateway($data{urlizedTitle})

View file

@ -72,8 +72,8 @@ sub canViewPage {
#-------------------------------------------------------------------
sub insufficient {
my ($output);
if ($session{user}{userId} == 1) {
$output = WebGUI::Operation::Account();
if ($session{user}{userId} eq "") {
$output = WebGUI::Operation::Account::displayAccount();
} else {
$output = '<h1>'.WebGUI::International::get(37).'</h1>';
$output .= WebGUI::International::get(38);

View file

@ -280,14 +280,19 @@ sub www_deleteDownloadConfirm {
#-------------------------------------------------------------------
sub www_download {
my (%download);
my (%download, $url);
tie %download,'Tie::CPHash';
%download = WebGUI::SQL->quickHash("select * from DownloadManager_file where downloadId=$session{form}{did}");
if (WebGUI::Privilege::isInGroup($download{groupToView})) {
$session{header}{redirect} = WebGUI::Session::httpRedirect(
$session{setting}{attachmentDirectoryWeb}."/".
$session{form}{wid}."/".$session{form}{did}."/".$download{downloadFile}
);
$url = $session{setting}{attachmentDirectoryWeb}."/".$session{form}{wid}."/".$session{form}{did}."/";
if ($session{form}{alternateVersion} == 1) {
$url .= $download{alternateVersion1};
} elsif ($session{form}{alternateVersion} == 2) {
$url .= $download{alternateVersion2};
} else {
$url .= $download{downloadFile};
}
$session{header}{redirect} = WebGUI::Session::httpRedirect($url);
return "";
} else {
return WebGUI::Privilege::insufficient();
@ -566,14 +571,16 @@ sub www_view {
if ($download{alternateVersion1}) {
%fileType = WebGUI::Attachment::getType($download{alternateVersion1});
$row[$i] .= ' &middot; <a href="'.WebGUI::URL::page('func=download&wid='.
$_[0].'&did='.$download{downloadId}).'"><img src="'.$fileType{icon}.
$_[0].'&did='.$download{downloadId}.'&alternateVersion=1')
.'"><img src="'.$fileType{icon}.
'" border=0 width=16 height=16 align="middle">('.
$fileType{extension}.')</a>';
}
if ($download{alternateVersion2}) {
%fileType = WebGUI::Attachment::getType($download{alternateVersion2});
$row[$i] .= ' &middot; <a href="'.WebGUI::URL::page('func=download&wid='.
$_[0].'&did='.$download{downloadId}).'"><img src="'.$fileType{icon}.
$_[0].'&did='.$download{downloadId}.'&alternateVersion=2')
.'"><img src="'.$fileType{icon}.
'" border=0 width=16 height=16 align="middle">('.
$fileType{extension}.')</a>';
}

View file

@ -28,7 +28,7 @@ use WebGUI::Widget;
#-------------------------------------------------------------------
sub _calendarLayout {
my ($thisMonth, $calendar, $start, $end, $sth, %event, $nextDate);
my ($thisMonth, $calendar, $message, $start, $end, $sth, %event, $nextDate);
$thisMonth = epochToHuman($_[1],"%M %y");
$calendar = new HTML::CalendarMonthSimple('year'=>epochToHuman($_[1],"%y"),'month'=>epochToHuman($_[1],"%M"));
$calendar->width("100%");
@ -41,18 +41,19 @@ sub _calendarLayout {
while (%event = $sth->hash) {
if (epochToHuman($event{startDate},"%M %y") eq $thisMonth ||
epochToHuman($event{endDate},"%M %y") eq $thisMonth) {
$message = $event{name};
if ($event{description}) {
$message = '<a href=\'javascript:popUp("'.$event{description}.'");\'>'.
$message.'</a>';
}
$message .= '<br>';
if ($event{startDate} == $event{endDate}) {
$calendar->addcontent(epochToHuman($event{startDate},"%D"),
'<a href=\'javascript:popUp("'.$event{description}.'");\'>'.
$event{name}.'</a><br>');
$calendar->addcontent(epochToHuman($event{startDate},"%D"),$message);
} else {
$nextDate = $event{startDate};
while($nextDate < $event{endDate}) {
if (epochToHuman($nextDate,"%M %y") eq $thisMonth) {
$calendar->addcontent(epochToHuman($nextDate,"%D"),
'<a href=\'javascript:popUp("'.
$event{description}
.'");\'>'.$event{name}.'</a><br>');
$calendar->addcontent(epochToHuman($nextDate,"%D"),$message);
}
$nextDate = addToDate($nextDate,0,0,1);
}
@ -372,8 +373,8 @@ sub www_editEventSave {
#-------------------------------------------------------------------
sub www_view {
my (%data, %event, $dataRows, $prevNextBar, $output, $sth, $flag, %previous,
@row, $i, $maxDate, $minDate, $nextDate, $defaultPn);
my (%data, %event, $dataRows, $prevNextBar, $output, $sth, $flag, %previous, $junk,
@row, $i, $maxDate, $minDate, $nextDate, $first, $last);
tie %data, 'Tie::CPHash';
tie %event, 'Tie::CPHash';
tie %previous, 'Tie::CPHash';
@ -387,21 +388,22 @@ sub www_view {
}
($minDate) = WebGUI::SQL->quickArray("select min(startDate) from EventsCalendar_event where widgetId=$_[0]");
($maxDate) = WebGUI::SQL->quickArray("select max(endDate) from EventsCalendar_event where widgetId=$_[0]");
($junk, $maxDate) = WebGUI::DateTime::monthStartEnd($maxDate);
if ($data{calendarLayout} eq "calendar") {
$nextDate = $minDate;
while ($nextDate < $maxDate) {
while ($nextDate <= $maxDate) {
$row[$i] = _calendarLayout($_[0],$nextDate);
if ($session{form}{pn} eq "" && $nextDate <= time()) {
$defaultPn = $i;
($first,$last) = WebGUI::DateTime::monthStartEnd($nextDate);
if ($session{form}{pn} eq "" && $first <= time() && $last >= time()) {
$session{form}{pn} = $i;
}
$i++;
$nextDate = addToDate($nextDate,0,1,0);
}
if ($session{form}{pn} eq "") {
$session{form}{pn} = $defaultPn;
}
($dataRows, $prevNextBar) = paginate(1,WebGUI::URL::page(),\@row);
$output .= $prevNextBar.$dataRows.$prevNextBar;
$session{form}{pn} = "";
} else {
$sth = WebGUI::SQL->read("select name, description, startDate, endDate from EventsCalendar_event where widgetId='$_[0]' and endDate>".(time()-86400)." order by startDate,endDate");
while (%event = $sth->hash) {

View file

@ -356,7 +356,7 @@ sub www_view {
if ($board{processMacros}) {
$html = WebGUI::Macro::process($html);
}
$html .= '<table width="100%" cellpadding=3 cellspacing=0 border=0><tr>'.
$html .= '<table width="100%" cellpadding=2 cellspacing=1 border=0><tr>'.
'<td align="right" valign="bottom" class="tableMenu"><a href="'.
WebGUI::URL::page('func=postNewMessage&wid='.$_[0]).'">'.
WebGUI::International::get(17,$namespace).'</a></td></tr></table>';
@ -386,14 +386,14 @@ sub www_view {
if ($i > $itemsPerPage) {
$html .= '<div class="pagination">';
if ($pn > 0) {
$html .= '<a href="'.WebGUI::URL::page('?pn='.($pn-1)).'">&laquo;'.
$html .= '<a href="'.WebGUI::URL::page('pn='.($pn-1)).'">&laquo;'.
WebGUI::International::get(91).'</a>';
} else {
$html .= '&laquo;'.WebGUI::International::get(91);
}
$html .= ' &middot; ';
if (($pn+1) < round(($i/$itemsPerPage))) {
$html .= '<a href="'.WebGUI::URL::page('?pn='.($pn+1)).'">'.
$html .= '<a href="'.WebGUI::URL::page('pn='.($pn+1)).'">'.
WebGUI::International::get(92).'&raquo;</a>';
} else {
$html .= WebGUI::International::get(92).'&raquo;';

View file

@ -401,7 +401,7 @@ sub www_view {
$i++;
}
$sth->finish;
$output .= '<table width="100%" cellpadding=3 cellspacing=0 border=0><tr>'.
$output .= '<table width="100%" cellpadding=2 cellspacing=1 border=0><tr>'.
'<td align="right" class="tableMenu"><a href="'.WebGUI::URL::page('func=addSubmission&wid='.
$_[0]).'">'.WebGUI::International::get(20,$namespace).'</a></td></tr></table>';
($dataRows, $prevNextBar) = paginate($data{submissionsPerPage},WebGUI::URL::page(),\@row);