WebGUI 3.2.0 release
This commit is contained in:
parent
71cd27d3bc
commit
cb88a99e52
60 changed files with 1284 additions and 474 deletions
|
|
@ -22,6 +22,7 @@ use WebGUI::Privilege;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Shortcut;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Widget;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -154,7 +155,9 @@ sub www_edit {
|
|||
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::text("endDate",20,30,epochToSet($data{endDate}),1));
|
||||
$output .= tableFormRow(WebGUI::International::get(5,$namespace),WebGUI::Form::textArea("body",$data{body},50,10,1));
|
||||
if ($data{image} ne "") {
|
||||
$output .= tableFormRow(WebGUI::International::get(6,$namespace),'<a href="'.$session{page}{url}.'?func=deleteImage&wid='.$session{form}{wid}.'">'.WebGUI::International::get(13,$namespace).'</a>');
|
||||
$output .= tableFormRow(WebGUI::International::get(6,$namespace),'<a href="'.
|
||||
WebGUI::URL::page('func=deleteImage&wid='.$session{form}{wid})
|
||||
.'">'.WebGUI::International::get(13,$namespace).'</a>');
|
||||
} else {
|
||||
$output .= tableFormRow(WebGUI::International::get(6,$namespace),WebGUI::Form::file("image"));
|
||||
}
|
||||
|
|
@ -169,7 +172,9 @@ sub www_edit {
|
|||
$output .= tableFormRow(WebGUI::International::get(7,$namespace),WebGUI::Form::text("linkTitle",20,128,$data{linkTitle}));
|
||||
$output .= tableFormRow(WebGUI::International::get(8,$namespace),WebGUI::Form::text("linkURL",20,2048,$data{linkURL}));
|
||||
if ($data{attachment} ne "") {
|
||||
$output .= tableFormRow(WebGUI::International::get(9,$namespace),'<a href="'.$session{page}{url}.'?func=deleteAttachment&wid='.$session{form}{wid}.'">'.WebGUI::International::get(13,$namespace).'</a>');
|
||||
$output .= tableFormRow(WebGUI::International::get(9,$namespace),'<a href="'.
|
||||
WebGUI::URL::page('func=deleteAttachment&wid='.$session{form}{wid})
|
||||
.'">'.WebGUI::International::get(13,$namespace).'</a>');
|
||||
} else {
|
||||
$output .= tableFormRow(WebGUI::International::get(9,$namespace),WebGUI::Form::file("attachment"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ use WebGUI::Privilege;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Shortcut;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::Widget;
|
||||
|
||||
|
|
@ -254,12 +255,10 @@ sub www_deleteDownload {
|
|||
$output = '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(12,$namespace).'<p>';
|
||||
$output .= '<div align="center">'.
|
||||
'<a href="'.$session{page}{url}.
|
||||
'?func=deleteDownloadConfirm&wid='.
|
||||
$session{form}{wid}.'&did='.$session{form}{did}.'">'.
|
||||
'<a href="'.WebGUI::URL::page('func=deleteDownloadConfirm&wid='.
|
||||
$session{form}{wid}.'&did='.$session{form}{did}).'">'.
|
||||
WebGUI::International::get(44).'</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.
|
||||
'?func=edit&wid='.$session{form}{wid}.'">'.
|
||||
$output .= ' <a href="'.WebGUI::URL::page('func=edit&wid='.$session{form}{wid}).'">'.
|
||||
WebGUI::International::get(45).'</a></div>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
@ -337,24 +336,23 @@ sub www_edit {
|
|||
);
|
||||
$output .= formSave();
|
||||
$output .= '</table></form>';
|
||||
$output .= '<p><a href="'.$session{page}{url}.'?func=addDownload&wid='.
|
||||
$session{form}{wid}.'">'.WebGUI::International::get(11,$namespace).'</a><p>';
|
||||
$output .= '<p><a href="'.WebGUI::URL::page('func=addDownload&wid='.$session{form}{wid})
|
||||
.'">'.WebGUI::International::get(11,$namespace).'</a><p>';
|
||||
$output .= '<table border=1 cellpadding=3 cellspacing=0>';
|
||||
$sth = WebGUI::SQL->read("select downloadId,fileTitle from DownloadManager_file where widgetId='$session{form}{wid}' order by sequenceNumber");
|
||||
while (@download = $sth->array) {
|
||||
$output .= '<tr><td><a href="'.$session{page}{url}.
|
||||
'?func=editDownload&wid='.$session{form}{wid}.
|
||||
'&did='.$download[0].'"><img src="'.
|
||||
$output .= '<tr><td><a href="'.
|
||||
WebGUI::URL::page('func=editDownload&wid='.$session{form}{wid}.'&did='.$download[0])
|
||||
.'"><img src="'.
|
||||
$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.
|
||||
$session{page}{url}.'?func=deleteDownload&wid='.
|
||||
$session{form}{wid}.'&did='.$download[0].'"><img src="'.
|
||||
WebGUI::URL::page('func=deleteDownload&wid='.$session{form}{wid}.'&did='.$download[0])
|
||||
.'"><img src="'.
|
||||
$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.
|
||||
$session{page}{url}.'?func=moveDownloadUp&wid='.
|
||||
$session{form}{wid}.'&did='.$download[0].'"><img src="'.
|
||||
WebGUI::URL::page('func=moveDownloadUp&wid='.$session{form}{wid}.'&did='.$download[0])
|
||||
.'"><img src="'.
|
||||
$session{setting}{lib}.'/upArrow.gif" border=0></a><a href="'.
|
||||
$session{page}{url}.'?func=moveDownloadDown&wid='.
|
||||
$session{form}{wid}.'&did='.$download[0].
|
||||
'"><img src="'.$session{setting}{lib}.
|
||||
WebGUI::URL::page('func=moveDownloadDown&wid='.$session{form}{wid}.'&did='.$download[0])
|
||||
.'"><img src="'.$session{setting}{lib}.
|
||||
'/downArrow.gif" border=0></a></td><td>'.$download[1].'</td><tr>';
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
@ -391,8 +389,8 @@ sub www_editDownload {
|
|||
if ($download{downloadFile} ne "") {
|
||||
$output .= tableFormRow(
|
||||
WebGUI::International::get(6,$namespace),
|
||||
'<a href="'.$session{page}{url}.'?func=deleteFile&wid='.
|
||||
$session{form}{wid}.'&did='.$session{form}{did}.'">'.
|
||||
'<a href="'.WebGUI::URL::page('func=deleteFile&wid='.
|
||||
$session{form}{wid}.'&did='.$session{form}{did}).'">'.
|
||||
WebGUI::International::get(13,$namespace).'</a>
|
||||
');
|
||||
} else {
|
||||
|
|
@ -404,8 +402,8 @@ sub www_editDownload {
|
|||
if ($download{alternateVersion1} ne "") {
|
||||
$output .= tableFormRow(
|
||||
WebGUI::International::get(17,$namespace),
|
||||
'<a href="'.$session{page}{url}.'?func=deleteFile&alt=1&wid='.
|
||||
$session{form}{wid}.'&did='.$session{form}{did}.'">'.
|
||||
'<a href="'.WebGUI::URL::page('func=deleteFile&alt=1&wid='.
|
||||
$session{form}{wid}.'&did='.$session{form}{did}).'">'.
|
||||
WebGUI::International::get(13,$namespace).'</a>
|
||||
');
|
||||
} else {
|
||||
|
|
@ -417,8 +415,8 @@ sub www_editDownload {
|
|||
if ($download{alternateVersion2} ne "") {
|
||||
$output .= tableFormRow(
|
||||
WebGUI::International::get(18,$namespace),
|
||||
'<a href="'.$session{page}{url}.'?func=deleteFile&alt=2&wid='.
|
||||
$session{form}{wid}.'&did='.$session{form}{did}.'">'.
|
||||
'<a href="'.WebGUI::URL::page('func=deleteFile&alt=2&wid='.
|
||||
$session{form}{wid}.'&did='.$session{form}{did}).'">'.
|
||||
WebGUI::International::get(13,$namespace).'</a>
|
||||
');
|
||||
} else {
|
||||
|
|
@ -513,41 +511,69 @@ sub www_moveDownloadUp {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my (@row, $i, $dataRows, $prevNextBar, %data, @test, %fileType, $output, $sth, %download, $flag);
|
||||
my ($url, @row, $i, $dataRows, $search, $prevNextBar, %data, @test, %fileType, $output, $sth,
|
||||
%download, $flag, $sort, $sortDirection);
|
||||
tie %download, 'Tie::CPHash';
|
||||
tie %data, 'Tie::CPHash';
|
||||
%data = getProperties($namespace,$_[0]);
|
||||
if (defined %data) {
|
||||
$url = WebGUI::URL::page();
|
||||
if ($data{displayTitle} == 1) {
|
||||
$output .= '<h1>'.$data{title}.'</h1>';
|
||||
}
|
||||
if ($data{description} ne "") {
|
||||
$output .= $data{description}.'<p>';
|
||||
}
|
||||
$output .= formHeader();
|
||||
$output .= WebGUI::Form::text("keyword",20,50);
|
||||
$output .= WebGUI::Form::submit(WebGUI::International::get(170));
|
||||
$output .= '</form>';
|
||||
$output .= '<table cellpadding="3" cellspacing="1" border="0" width="100%">';
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(14,$namespace).
|
||||
'</td><td class="tableHeader">'.WebGUI::International::get(15,$namespace).
|
||||
'</td><td class="tableHeader">'.WebGUI::International::get(16,$namespace).'</td></tr>';
|
||||
$sth = WebGUI::SQL->read("select * from DownloadManager_file where widgetId=$_[0] order by sequenceNumber");
|
||||
if ($session{form}{keyword} ne "") {
|
||||
$search = " and (fileTitle like '%".$session{form}{keyword}.
|
||||
"%' or downloadFile like '%".$session{form}{keyword}.
|
||||
"%' or alternateVersion1 like '%".$session{form}{keyword}.
|
||||
"%' or alternateVersion2 like '%".$session{form}{keyword}.
|
||||
"%' or briefSynopsis like '%".$session{form}{keyword}."%') ";
|
||||
$url = WebGUI::URL::append($url,"keyword=".$session{form}{keyword});
|
||||
}
|
||||
if ($session{form}{sort} ne "") {
|
||||
$sort = " order by ".$session{form}{sort};
|
||||
$url = WebGUI::URL::append($url,"sort=".$session{form}{sort});
|
||||
} else {
|
||||
$sort = " order by sequenceNumber";
|
||||
}
|
||||
if ($session{form}{sortDirection} ne "") {
|
||||
$sortDirection = $session{form}{sortDirection};
|
||||
$url = WebGUI::URL::append($url,"sortDirection=".$session{form}{sortDirection});
|
||||
}
|
||||
$output .= '<tr><td class="tableHeader">'.
|
||||
sortByColumn("fileTitle",WebGUI::International::get(14,$namespace)).
|
||||
'</td><td class="tableHeader">'.
|
||||
sortByColumn("briefSynopsis",WebGUI::International::get(15,$namespace)).
|
||||
'</td><td class="tableHeader">'.
|
||||
sortByColumn("dateUploaded",WebGUI::International::get(16,$namespace)).
|
||||
'</td></tr>';
|
||||
$sth = WebGUI::SQL->read("select * from DownloadManager_file where widgetId=$_[0] $search $sort $sortDirection");
|
||||
while (%download = $sth->hash) {
|
||||
if (WebGUI::Privilege::isInGroup($download{groupToView})) {
|
||||
%fileType = WebGUI::Attachment::getType($download{downloadFile});
|
||||
$row[$i] = '<tr><td class="tableData" valign="top">';
|
||||
$row[$i] .= '<a href="'.$session{page}{url}.'?func=download&wid='.$_[0].
|
||||
'&did='.$download{downloadId}.'"><img src="'.$fileType{icon}.
|
||||
$row[$i] .= '<a href="'.WebGUI::URL::page('func=download&wid='.$_[0].
|
||||
'&did='.$download{downloadId}).'"><img src="'.$fileType{icon}.
|
||||
'" border=0 width=16 height=16 align="middle">'.
|
||||
$download{fileTitle}.' ('.$fileType{extension}.')</a>';
|
||||
if ($download{alternateVersion1}) {
|
||||
%fileType = WebGUI::Attachment::getType($download{alternateVersion1});
|
||||
$row[$i] .= ' · <a href="'.$session{page}{url}.'?func=download&wid='.
|
||||
$_[0].'&did='.$download{downloadId}.'"><img src="'.$fileType{icon}.
|
||||
$row[$i] .= ' · <a href="'.WebGUI::URL::page('func=download&wid='.
|
||||
$_[0].'&did='.$download{downloadId}).'"><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] .= ' · <a href="'.$session{page}{url}.'?func=download&wid='.
|
||||
$_[0].'&did='.$download{downloadId}.'"><img src="'.$fileType{icon}.
|
||||
$row[$i] .= ' · <a href="'.WebGUI::URL::page('func=download&wid='.
|
||||
$_[0].'&did='.$download{downloadId}).'"><img src="'.$fileType{icon}.
|
||||
'" border=0 width=16 height=16 align="middle">('.
|
||||
$fileType{extension}.')</a>';
|
||||
}
|
||||
|
|
@ -564,7 +590,7 @@ sub www_view {
|
|||
$output .= '<tr><td class="tableData" colspan="3">'.
|
||||
WebGUI::International::get(19,$namespace).'</td></tr>';
|
||||
}
|
||||
($dataRows, $prevNextBar) = paginate($data{paginateAfter},$session{page}{url},\@row);
|
||||
($dataRows, $prevNextBar) = paginate($data{paginateAfter},$url,\@row);
|
||||
$output .= $dataRows;
|
||||
$output .= '</table>';
|
||||
$output .= $prevNextBar;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ our $namespace = "EventsCalendar";
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use HTML::CalendarMonthSimple;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::International;
|
||||
|
|
@ -21,8 +22,47 @@ use WebGUI::Privilege;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Shortcut;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::Widget;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _calendarLayout {
|
||||
my ($thisMonth, $calendar, $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%");
|
||||
$calendar->border(1);
|
||||
$calendar->cellclass("tableData");
|
||||
$calendar->todaycellclass("tableHeader");
|
||||
$calendar->headerclass("tableHeader");
|
||||
($start,$end) = monthStartEnd($_[1]);
|
||||
$sth = WebGUI::SQL->read("select name, description, startDate, endDate from EventsCalendar_event where widgetId='$_[0]' order by startDate,endDate");
|
||||
while (%event = $sth->hash) {
|
||||
if (epochToHuman($event{startDate},"%M %y") eq $thisMonth ||
|
||||
epochToHuman($event{endDate},"%M %y") eq $thisMonth) {
|
||||
if ($event{startDate} == $event{endDate}) {
|
||||
$calendar->addcontent(epochToHuman($event{startDate},"%D"),
|
||||
'<a href=\'javascript:popUp("'.$event{description}.'");\'>'.
|
||||
$event{name}.'</a><br>');
|
||||
} 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>');
|
||||
}
|
||||
$nextDate = addToDate($nextDate,0,0,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
return '<script language="JavaScript">function popUp(message) { alert(message); }</script>'.$calendar->as_HTML;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub duplicate {
|
||||
my ($sth, %data, $newWidgetId, $pageId, @row, $newEventId, $previousRecurringEventId);
|
||||
|
|
@ -200,7 +240,12 @@ sub www_deleteEvent {
|
|||
if ($session{form}{rid} > 0) {
|
||||
$output .= ' '.WebGUI::International::get(11,$namespace);
|
||||
}
|
||||
$output .= '?<p><div align="center"><a href="'.$session{page}{url}.'?func=deleteEventConfirm&wid='.$session{form}{wid}.'&eid='.$session{form}{eid}.'&rid='.$session{form}{rid}.'">'.WebGUI::International::get(44).'</a> <a href="'.$session{page}{url}.'?func=edit&wid='.$session{form}{wid}.'">'.WebGUI::International::get(45).'</a></div>';
|
||||
$output .= '?<p><div align="center"><a href="'.
|
||||
WebGUI::URL::page('func=deleteEventConfirm&wid='.$session{form}{wid}.
|
||||
'&eid='.$session{form}{eid}.'&rid='.$session{form}{rid}).'">'.
|
||||
WebGUI::International::get(44).'</a> <a href="'.
|
||||
WebGUI::URL::page('func=edit&wid='.$session{form}{wid}).'">'.
|
||||
WebGUI::International::get(45).'</a></div>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -255,11 +300,16 @@ sub www_edit {
|
|||
WebGUI::Form::text("paginateAfter",20,30,$data{paginateAfter}));
|
||||
$output .= formSave();
|
||||
$output .= '</table></form>';
|
||||
$output .= '<p><a href="'.$session{page}{url}.'?func=addEvent&wid='.$session{form}{wid}.'">Add New Event</a><p>';
|
||||
$output .= '<p><a href="'.WebGUI::URL::page('func=addEvent&wid='.$session{form}{wid})
|
||||
.'">Add New Event</a><p>';
|
||||
$output .= '<table border=1 cellpadding=3 cellspacing=0>';
|
||||
$sth = WebGUI::SQL->read("select eventId, name, recurringEventId from EventsCalendar_event where widgetId='$session{form}{wid}' order by startDate");
|
||||
while (@event = $sth->array) {
|
||||
$output .= '<tr><td><a href="'.$session{page}{url}.'?func=editEvent&wid='.$session{form}{wid}.'&eid='.$event[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?func=deleteEvent&wid='.$session{form}{wid}.'&eid='.$event[0].'&rid='.$event[2].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a></td><td>'.$event[1].'</td></td>';
|
||||
$output .= '<tr><td><a href="'.WebGUI::URL::page('func=editEvent&wid='.$session{form}{wid}.
|
||||
'&eid='.$event[0]).'"><img src="'.$session{setting}{lib}.
|
||||
'/edit.gif" border=0></a><a href="'.WebGUI::URL::page('func=deleteEvent&wid='.
|
||||
$session{form}{wid}.'&eid='.$event[0].'&rid='.$event[2]).'"><img src="'.
|
||||
$session{setting}{lib}.'/delete.gif" border=0></a></td><td>'.$event[1].'</td></td>';
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= '</table>';
|
||||
|
|
@ -322,8 +372,11 @@ sub www_editEventSave {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my (%data, @event, $output, $sth, $flag, @previous);
|
||||
my (%data, %event, $dataRows, $prevNextBar, $output, $sth, $flag, %previous,
|
||||
@row, $i, $maxDate, $minDate, $nextDate, $defaultPn);
|
||||
tie %data, 'Tie::CPHash';
|
||||
tie %event, 'Tie::CPHash';
|
||||
tie %previous, 'Tie::CPHash';
|
||||
%data = getProperties($namespace,$_[0]);
|
||||
if (defined %data) {
|
||||
if ($data{displayTitle}) {
|
||||
|
|
@ -332,34 +385,53 @@ sub www_view {
|
|||
if ($data{description} ne "") {
|
||||
$output .= $data{description}.'<p>';
|
||||
}
|
||||
$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->array) {
|
||||
unless ($event[2] == $previous[0] && $event[3] == $previous[1]) {
|
||||
$output .= "<b>".epochToHuman($event[2],"%c")." ".epochToHuman($event[2],"%D");
|
||||
if (epochToHuman($event[2],"%y") ne epochToHuman($event[3],"%y")) {
|
||||
$output .= ", ".epochToHuman($event[2],"%y");
|
||||
$flag = 1;
|
||||
($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]");
|
||||
if ($data{calendarLayout} eq "calendar") {
|
||||
$nextDate = $minDate;
|
||||
while ($nextDate < $maxDate) {
|
||||
$row[$i] = _calendarLayout($_[0],$nextDate);
|
||||
if ($session{form}{pn} eq "" && $nextDate <= time()) {
|
||||
$defaultPn = $i;
|
||||
}
|
||||
if ($flag || epochToHuman($event[2],"%c") ne epochToHuman($event[3],"%c")) {
|
||||
$output .= " - ".epochToHuman($event[3],"%c");
|
||||
$output .= " ".epochToHuman($event[3],"%D");
|
||||
} elsif (epochToHuman($event[2],"%D") ne epochToHuman($event[3],"%D")) {
|
||||
$output .= " - ".epochToHuman($event[3],"%D");
|
||||
$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;
|
||||
} 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) {
|
||||
unless ($event{startDate} == $previous{startDate}
|
||||
&& $event{endDate} == $previous{endDate}) {
|
||||
$output .= "<b>".epochToHuman($event{startDate},"%c %D");
|
||||
if (epochToHuman($event{startDate},"%y") ne epochToHuman($event{endDate},"%y")) {
|
||||
$output .= ", ".epochToHuman($event{startDate},"%y");
|
||||
$flag = 1;
|
||||
}
|
||||
if ($flag || epochToHuman($event{startDate},"%c") ne epochToHuman($event{endDate},"%c")) {
|
||||
$output .= " - ".epochToHuman($event{endDate},"%c %D");
|
||||
} elsif (epochToHuman($event{startDate},"%D") ne epochToHuman($event{endDate},"%D")) {
|
||||
$output .= " - ".epochToHuman($event{endDate},"%D");
|
||||
}
|
||||
$flag = 0;
|
||||
$output .= ", ".epochToHuman($event{endDate},"%y");
|
||||
$output .= "</b>";
|
||||
$output .= "<hr size=1>";
|
||||
}
|
||||
$flag = 0;
|
||||
$output .= ", ".epochToHuman($event[3],"%y");
|
||||
$output .= "</b>";
|
||||
$output .= "<hr size=1>";
|
||||
%previous = %event;
|
||||
$output .= '<span class="eventTitle">'.$event{name}.'</span>';
|
||||
if ($event{description} ne "") {
|
||||
$output .= ' - ';
|
||||
$output .= ''.$event{description};
|
||||
}
|
||||
$output .= '<p>';
|
||||
}
|
||||
@previous = ($event[2],$event[3]);
|
||||
$output .= '<span class="eventTitle">'.$event[0].'</span>';
|
||||
if ($event[1] ne "") {
|
||||
$output .= ' - ';
|
||||
$output .= ''.$event[1];
|
||||
}
|
||||
$output .= '<p>';
|
||||
$sth->finish;
|
||||
}
|
||||
$sth->finish;
|
||||
if ($data{processMacros}) {
|
||||
$output = WebGUI::Macro::process($output);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,8 +27,10 @@ sub duplicate {
|
|||
tie %data, 'Tie::CPHash';
|
||||
%data = getProperties($namespace,$_[0]);
|
||||
$pageId = $_[1] || $data{pageId};
|
||||
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},$data{description},$data{processMacros},$data{templatePosition});
|
||||
WebGUI::SQL->write("insert into ExtraColumn values ($newWidgetId, '$data{spacer}', '$data{width}', ".quote($data{class}).")");
|
||||
$newWidgetId = create($pageId,$namespace,$data{title},
|
||||
$data{displayTitle},$data{description},$data{processMacros},$data{templatePosition});
|
||||
WebGUI::SQL->write("insert into ExtraColumn values ($newWidgetId, '$data{spacer}', '$data{width}', ".
|
||||
quote($data{class}).")");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ use WebGUI::Privilege;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Shortcut;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Widget;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -153,8 +154,11 @@ sub www_deleteQuestion {
|
|||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(7,$namespace).'<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?func=deleteQuestionConfirm&wid='.$session{form}{wid}.'&qid='.$session{form}{qid}.'">'.WebGUI::International::get(44).'</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'?func=edit&wid='.$session{form}{wid}.'">'.WebGUI::International::get(45).'</a></div>';
|
||||
$output .= '<div align="center"><a href="'.
|
||||
WebGUI::URL::page('func=deleteQuestionConfirm&wid='.$session{form}{wid}.
|
||||
'&qid='.$session{form}{qid}).'">'.WebGUI::International::get(44).'</a>';
|
||||
$output .= ' <a href="'.WebGUI::URL::page('func=edit&wid='.$session{form}{wid})
|
||||
.'">'.WebGUI::International::get(45).'</a></div>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -187,19 +191,32 @@ sub www_edit {
|
|||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= '<table>';
|
||||
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$data{title}));
|
||||
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle","1",$data{displayTitle}));
|
||||
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros","1",$data{processMacros}));
|
||||
$output .= tableFormRow(WebGUI::International::get(174),
|
||||
WebGUI::Form::checkbox("displayTitle","1",$data{displayTitle}));
|
||||
$output .= tableFormRow(WebGUI::International::get(175),
|
||||
WebGUI::Form::checkbox("processMacros","1",$data{processMacros}));
|
||||
%hash = WebGUI::Widget::getPositions();
|
||||
$array[0] = $data{templatePosition};
|
||||
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("templatePosition",\%hash,\@array));
|
||||
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$data{description},'','',1));
|
||||
$output .= tableFormRow(WebGUI::International::get(363),
|
||||
WebGUI::Form::selectList("templatePosition",\%hash,\@array));
|
||||
$output .= tableFormRow(WebGUI::International::get(85),
|
||||
WebGUI::Form::textArea("description",$data{description},'','',1));
|
||||
$output .= formSave();
|
||||
$output .= '</table></form>';
|
||||
$output .= '<p><a href="'.$session{page}{url}.'?func=addQuestion&wid='.$session{form}{wid}.'">'.WebGUI::International::get(9,$namespace).'</a><p>';
|
||||
$output .= '<p><a href="'.WebGUI::URL::page('func=addQuestion&wid='.$session{form}{wid})
|
||||
.'">'.WebGUI::International::get(9,$namespace).'</a><p>';
|
||||
$output .= '<table border=1 cellpadding=3 cellspacing=0>';
|
||||
$sth = WebGUI::SQL->read("select questionId,question from FAQ_question where widgetId='$session{form}{wid}' order by sequenceNumber");
|
||||
while (@question = $sth->array) {
|
||||
$output .= '<tr><td><a href="'.$session{page}{url}.'?func=editQuestion&wid='.$session{form}{wid}.'&qid='.$question[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?func=deleteQuestion&wid='.$session{form}{wid}.'&qid='.$question[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?func=moveQuestionUp&wid='.$session{form}{wid}.'&qid='.$question[0].'"><img src="'.$session{setting}{lib}.'/upArrow.gif" border=0></a><a href="'.$session{page}{url}.'?func=moveQuestionDown&wid='.$session{form}{wid}.'&qid='.$question[0].'"><img src="'.$session{setting}{lib}.'/downArrow.gif" border=0></a></td><td>'.$question[1].'</td><tr>';
|
||||
$output .= '<tr><td><a href="'.WebGUI::URL::page('func=editQuestion&wid='.$session{form}{wid}.
|
||||
'&qid='.$question[0]).'"><img src="'.$session{setting}{lib}.
|
||||
'/edit.gif" border=0></a><a href="'.WebGUI::URL::page('func=deleteQuestion&wid='.
|
||||
$session{form}{wid}.'&qid='.$question[0]).'"><img src="'.$session{setting}{lib}.
|
||||
'/delete.gif" border=0></a><a href="'.WebGUI::URL::page('func=moveQuestionUp&wid='.
|
||||
$session{form}{wid}.'&qid='.$question[0]).'"><img src="'.$session{setting}{lib}.
|
||||
'/upArrow.gif" border=0></a><a href="'.WebGUI::URL::page('func=moveQuestionDown&wid='.
|
||||
$session{form}{wid}.'&qid='.$question[0]).'"><img src="'.$session{setting}{lib}.
|
||||
'/downArrow.gif" border=0></a></td><td>'.$question[1].'</td><tr>';
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= '</table>';
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ use WebGUI::Privilege;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Shortcut;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Widget;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -29,9 +30,11 @@ sub duplicate {
|
|||
tie %data, 'Tie::CPHash';
|
||||
%data = getProperties($namespace,$_[0]);
|
||||
$pageId = $_[1] || $data{pageId};
|
||||
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},$data{description},$data{processMacros},$data{templatePosition});
|
||||
$newWidgetId = create($pageId,$namespace,$data{title},
|
||||
$data{displayTitle},$data{description},$data{processMacros},$data{templatePosition});
|
||||
WebGUI::Attachment::copy($data{attachment},$_[0],$newWidgetId);
|
||||
WebGUI::SQL->write("insert into Item values ($newWidgetId, ".quote($data{description}).", ".quote($data{linkURL}).", ".quote($data{attachment}).")");
|
||||
WebGUI::SQL->write("insert into Item values ($newWidgetId, ".
|
||||
quote($data{description}).", ".quote($data{linkURL}).", ".quote($data{attachment}).")");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -118,16 +121,23 @@ sub www_edit {
|
|||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= '<table>';
|
||||
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,30,$data{title}));
|
||||
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros","1",$data{processMacros}));
|
||||
$output .= tableFormRow(WebGUI::International::get(175),
|
||||
WebGUI::Form::checkbox("processMacros","1",$data{processMacros}));
|
||||
%hash = WebGUI::Widget::getPositions();
|
||||
$array[0] = $data{templatePosition};
|
||||
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("templatePosition",\%hash,\@array));
|
||||
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$data{description}));
|
||||
$output .= tableFormRow(WebGUI::International::get(1,$namespace),WebGUI::Form::text("linkURL",20,2048,$data{linkURL}));
|
||||
$output .= tableFormRow(WebGUI::International::get(363),
|
||||
WebGUI::Form::selectList("templatePosition",\%hash,\@array));
|
||||
$output .= tableFormRow(WebGUI::International::get(85),
|
||||
WebGUI::Form::textArea("description",$data{description}));
|
||||
$output .= tableFormRow(WebGUI::International::get(1,$namespace),
|
||||
WebGUI::Form::text("linkURL",20,2048,$data{linkURL}));
|
||||
if ($data{attachment} ne "") {
|
||||
$output .= tableFormRow(WebGUI::International::get(2,$namespace),'<a href="'.$session{page}{url}.'?func=deleteAttachment&wid='.$session{form}{wid}.'">'.WebGUI::International::get(3,$namespace).'</a>');
|
||||
$output .= tableFormRow(WebGUI::International::get(2,$namespace),'<a href="'.
|
||||
WebGUI::URL::page('func=deleteAttachment&wid='.$session{form}{wid})
|
||||
.'">'.WebGUI::International::get(3,$namespace).'</a>');
|
||||
} else {
|
||||
$output .= tableFormRow(WebGUI::International::get(2,$namespace),WebGUI::Form::file("attachment"));
|
||||
$output .= tableFormRow(WebGUI::International::get(2,$namespace),
|
||||
WebGUI::Form::file("attachment"));
|
||||
}
|
||||
$output .= formSave();
|
||||
$output .= '</table></form>';
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ use WebGUI::Privilege;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Shortcut;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Widget;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -158,8 +159,11 @@ sub www_deleteLink {
|
|||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(9,$namespace).'<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?func=deleteLinkConfirm&wid='.$session{form}{wid}.'&lid='.$session{form}{lid}.'">'.WebGUI::International::get(44).'</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'?func=edit&wid='.$session{form}{wid}.'">'.WebGUI::International::get(45).'</a></div>';
|
||||
$output .= '<div align="center"><a href="'.
|
||||
WebGUI::URL::page('func=deleteLinkConfirm&wid='.$session{form}{wid}.'&lid='.$session{form}{lid})
|
||||
.'">'.WebGUI::International::get(44).'</a>';
|
||||
$output .= ' <a href="'.WebGUI::URL::page('func=edit&wid='.$session{form}{wid})
|
||||
.'">'.WebGUI::International::get(45).'</a></div>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -203,11 +207,20 @@ sub www_edit {
|
|||
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::text("bullet",20,255,$data{bullet}));
|
||||
$output .= formSave();
|
||||
$output .= '</table></form>';
|
||||
$output .= '<p><a href="'.$session{page}{url}.'?func=addLink&wid='.$session{form}{wid}.'">'.WebGUI::International::get(13,$namespace).'</a><p>';
|
||||
$output .= '<p><a href="'.WebGUI::URL::page('func=addLink&wid='.$session{form}{wid})
|
||||
.'">'.WebGUI::International::get(13,$namespace).'</a><p>';
|
||||
$output .= '<table border=1 cellpadding=3 cellspacing=0>';
|
||||
$sth = WebGUI::SQL->read("select linkId, name from LinkList_link where widgetId='$session{form}{wid}' order by sequenceNumber");
|
||||
while (@link = $sth->array) {
|
||||
$output .= '<tr><td><a href="'.$session{page}{url}.'?func=editLink&wid='.$session{form}{wid}.'&lid='.$link[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?func=deleteLink&wid='.$session{form}{wid}.'&lid='.$link[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?func=moveLinkUp&wid='.$session{form}{wid}.'&lid='.$link[0].'"><img src="'.$session{setting}{lib}.'/upArrow.gif" border=0></a><a href="'.$session{page}{url}.'?func=moveLinkDown&wid='.$session{form}{wid}.'&lid='.$link[0].'"><img src="'.$session{setting}{lib}.'/downArrow.gif" border=0></a></td><td>'.$link[1].'</td></tr>';
|
||||
$output .= '<tr><td><a href="'.WebGUI::URL::page('func=editLink&wid='.$session{form}{wid}.
|
||||
'&lid='.$link[0]).'"><img src="'.$session{setting}{lib}.
|
||||
'/edit.gif" border=0></a><a href="'.WebGUI::URL::page('func=deleteLink&wid='.
|
||||
$session{form}{wid}.'&lid='.$link[0]).'"><img src="'.$session{setting}{lib}.
|
||||
'/delete.gif" border=0></a><a href="'.WebGUI::URL::page('func=moveLinkUp&wid='.
|
||||
$session{form}{wid}.'&lid='.$link[0]).'"><img src="'.$session{setting}{lib}.
|
||||
'/upArrow.gif" border=0></a><a href="'.WebGUI::URL::page('func=moveLinkDown&wid='.
|
||||
$session{form}{wid}.'&lid='.$link[0]).'"><img src="'.$session{setting}{lib}.
|
||||
'/downArrow.gif" border=0></a></td><td>'.$link[1].'</td></tr>';
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= '</table>';
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ use WebGUI::Privilege;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Shortcut;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::Widget;
|
||||
|
||||
|
|
@ -31,7 +32,8 @@ sub duplicate {
|
|||
tie %data, 'Tie::CPHash';
|
||||
%data = getProperties($namespace,$_[0]);
|
||||
$pageId = $_[1] || $data{pageId};
|
||||
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},$data{description},$data{processMacros},$data{templatePosition});
|
||||
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},
|
||||
$data{description},$data{processMacros},$data{templatePosition});
|
||||
WebGUI::SQL->write("insert into MessageBoard values ($newWidgetId, $data{groupToPost}, '$data{messagesPerPage}', '$data{editTimeout}')");
|
||||
WebGUI::Discussion::duplicate($_[0],$newWidgetId);
|
||||
}
|
||||
|
|
@ -65,9 +67,12 @@ sub www_add {
|
|||
%hash = WebGUI::Widget::getPositions();
|
||||
$output .= tableFormRow(WebGUI::International::get(363),
|
||||
WebGUI::Form::selectList("templatePosition",\%hash));
|
||||
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",'',50,5,1));
|
||||
$output .= tableFormRow(WebGUI::International::get(85),
|
||||
WebGUI::Form::textArea("description",'',50,5,1));
|
||||
$output .= tableFormRow(WebGUI::International::get(3,$namespace),
|
||||
WebGUI::Form::groupList("groupToPost",2));
|
||||
$output .= tableFormRow(WebGUI::International::get(21,$namespace),
|
||||
WebGUI::Form::groupList("groupToModerate",4));
|
||||
$output .= tableFormRow(WebGUI::International::get(4,$namespace),
|
||||
WebGUI::Form::text("messagesPerPage",20,2,30));
|
||||
$output .= tableFormRow(WebGUI::International::get(5,$namespace),
|
||||
|
|
@ -86,7 +91,7 @@ sub www_addSave {
|
|||
my ($widgetId);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$widgetId = create($session{page}{pageId},$session{form}{widget},$session{form}{title},$session{form}{displayTitle},$session{form}{description},$session{form}{processMacros},$session{form}{templatePosition});
|
||||
WebGUI::SQL->write("insert into MessageBoard values ($widgetId, $session{form}{groupToPost}, '$session{form}{messagesPerPage}', '$session{form}{editTimeout}')");
|
||||
WebGUI::SQL->write("insert into MessageBoard values ($widgetId, $session{form}{groupToPost}, '$session{form}{messagesPerPage}', '$session{form}{editTimeout}', $session{form}{groupToModerate})");
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -103,6 +108,36 @@ sub www_copy {
|
|||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteMessage {
|
||||
my (%board, %message);
|
||||
tie %board, 'Tie::CPHash';
|
||||
tie %message, 'Tie::CPHash';
|
||||
%board = getProperties($namespace,$session{form}{wid});
|
||||
%message = WebGUI::Discussion::getMessage($session{form}{mid});
|
||||
if ((time()-$message{dateOfPost}) < 3600*$board{editTimeout} && $message{userId} eq $session{user}{userId} ||
|
||||
WebGUI::Privilege::isInGroup($board{groupToModerate})) {
|
||||
return WebGUI::Discussion::deleteMessage();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteMessageConfirm {
|
||||
my (%board,%message);
|
||||
tie %board, 'Tie::CPHash';
|
||||
tie %message, 'Tie::CPHash';
|
||||
%board = getProperties($namespace,$session{form}{wid});
|
||||
%message = WebGUI::Discussion::getMessage($session{form}{mid});
|
||||
if ((time()-$message{dateOfPost}) < 3600*$board{editTimeout} && $message{userId} eq $session{user}{userId} ||
|
||||
WebGUI::Privilege::isInGroup($board{groupToModerate})) {
|
||||
return WebGUI::Discussion::deleteMessageConfirm();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
my ($output, %board, %hash, @array);
|
||||
|
|
@ -116,17 +151,26 @@ sub www_edit {
|
|||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= '<table>';
|
||||
$output .= tableFormRow(WebGUI::International::get(99),WebGUI::Form::text("title",20,128,$board{title}));
|
||||
$output .= tableFormRow(WebGUI::International::get(174),WebGUI::Form::checkbox("displayTitle","1",$board{displayTitle}));
|
||||
$output .= tableFormRow(WebGUI::International::get(175),WebGUI::Form::checkbox("processMacros","1",$board{processMacros}));
|
||||
$output .= tableFormRow(WebGUI::International::get(99),
|
||||
WebGUI::Form::text("title",20,128,$board{title}));
|
||||
$output .= tableFormRow(WebGUI::International::get(174),
|
||||
WebGUI::Form::checkbox("displayTitle","1",$board{displayTitle}));
|
||||
$output .= tableFormRow(WebGUI::International::get(175),
|
||||
WebGUI::Form::checkbox("processMacros","1",$board{processMacros}));
|
||||
%hash = WebGUI::Widget::getPositions();
|
||||
$array[0] = $board{templatePosition};
|
||||
$output .= tableFormRow(WebGUI::International::get(363),WebGUI::Form::selectList("templatePosition",\%hash,\@array));
|
||||
$output .= tableFormRow(WebGUI::International::get(85),WebGUI::Form::textArea("description",$board{description},50,5,1));
|
||||
$output .= tableFormRow(WebGUI::International::get(363),
|
||||
WebGUI::Form::selectList("templatePosition",\%hash,\@array));
|
||||
$output .= tableFormRow(WebGUI::International::get(85),
|
||||
WebGUI::Form::textArea("description",$board{description},50,5,1));
|
||||
$output .= tableFormRow(WebGUI::International::get(3,$namespace),
|
||||
WebGUI::Form::selectList("groupToPost",$board{groupToPost}));
|
||||
$output .= tableFormRow(WebGUI::International::get(4,$namespace),WebGUI::Form::text("messagesPerPage",20,2,$board{messagesPerPage}));
|
||||
$output .= tableFormRow(WebGUI::International::get(5,$namespace),WebGUI::Form::text("editTimeout",20,2,$board{editTimeout}));
|
||||
WebGUI::Form::groupList("groupToPost",$board{groupToPost}));
|
||||
$output .= tableFormRow(WebGUI::International::get(21,$namespace),
|
||||
WebGUI::Form::groupList("groupToModerate",$board{groupToModerate}));
|
||||
$output .= tableFormRow(WebGUI::International::get(4,$namespace),
|
||||
WebGUI::Form::text("messagesPerPage",20,2,$board{messagesPerPage}));
|
||||
$output .= tableFormRow(WebGUI::International::get(5,$namespace),
|
||||
WebGUI::Form::text("editTimeout",20,2,$board{editTimeout}));
|
||||
$output .= formSave();
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
|
|
@ -140,7 +184,7 @@ sub www_edit {
|
|||
sub www_editSave {
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
update();
|
||||
WebGUI::SQL->write("update MessageBoard set groupToPost=$session{form}{groupToPost}, messagesPerPage=$session{form}{messagesPerPage}, editTimeout=$session{form}{editTimeout} where widgetId=$session{form}{wid}");
|
||||
WebGUI::SQL->write("update MessageBoard set groupToPost=$session{form}{groupToPost}, messagesPerPage=$session{form}{messagesPerPage}, editTimeout=$session{form}{editTimeout}, groupToModerate=$session{form}{groupToModerate} where widgetId=$session{form}{wid}");
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -149,10 +193,13 @@ sub www_editSave {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editMessage {
|
||||
my (%board);
|
||||
my (%board,%message);
|
||||
tie %board, 'Tie::CPHash';
|
||||
tie %message, 'Tie::CPHash';
|
||||
%board = getProperties($namespace,$session{form}{wid});
|
||||
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
|
||||
%message = WebGUI::Discussion::getMessage($session{form}{mid});
|
||||
if ((time()-$message{dateOfPost}) < 3600*$board{editTimeout} && $message{userId} eq $session{user}{userId} ||
|
||||
WebGUI::Privilege::isInGroup($board{groupToModerate})) {
|
||||
return WebGUI::Discussion::editMessage();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -161,10 +208,13 @@ sub www_editMessage {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editMessageSave {
|
||||
my (%board);
|
||||
my (%board,%message);
|
||||
tie %board, 'Tie::CPHash';
|
||||
tie %message, 'Tie::CPHash';
|
||||
%board = getProperties($namespace,$session{form}{wid});
|
||||
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
|
||||
%message = WebGUI::Discussion::getMessage($session{form}{mid});
|
||||
if ((time()-$message{dateOfPost}) < 3600*$board{editTimeout} && $message{userId} eq $session{user}{userId} ||
|
||||
WebGUI::Privilege::isInGroup($board{groupToModerate})) {
|
||||
WebGUI::Discussion::editMessageSave();
|
||||
return www_showMessage();
|
||||
} else {
|
||||
|
|
@ -228,43 +278,61 @@ sub www_showMessage {
|
|||
tie %board, 'Tie::CPHash';
|
||||
%message = WebGUI::Discussion::getMessage($session{form}{mid});
|
||||
%board = getProperties($namespace,$session{form}{wid});
|
||||
$html .= '<h1>'.$message{subject}.'</h1>';
|
||||
$html .= '<table width="100%" cellpadding=3 cellspacing=1 border=0><tr><td class="tableHeader">';
|
||||
$html .= '<b>'.WebGUI::International::get(7,$namespace).'</b> <a href="'.$session{page}{url}.'?op=viewProfile&uid='.$message{userId}.'">'.$message{username}.'</a><br>';
|
||||
$html .= "<b>".WebGUI::International::get(8,$namespace)."</b> ".epochToHuman($message{dateOfPost},"%w, %c %D, %y at %H:%n%p")."<br>";
|
||||
$html .= "<b>".WebGUI::International::get(9,$namespace)."</b> ".$message{widgetId}."-".$message{rid}."-".$message{pid}."-".$message{messageId}."<br>";
|
||||
$html .= '</td>';
|
||||
$html .= '<td rowspan=2 valign="top" class="tableMenu" nowrap>';
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=postReply&mid='.$session{form}{mid}.'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(13,$namespace).'</a><br>';
|
||||
if ((time()-$message{dateOfPost}) < 3600*$board{editTimeout} && $message{'userId'} eq $session{user}{userId}) {
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=editMessage&mid='.$session{form}{mid}.'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(12,$namespace).'</a><br>';
|
||||
if ($message{messageId}) {
|
||||
$html .= '<h1>'.$message{subject}.'</h1>';
|
||||
$html .= '<table width="100%" cellpadding=3 cellspacing=1 border=0><tr><td class="tableHeader">';
|
||||
$html .= '<b>'.WebGUI::International::get(7,$namespace).'</b> <a href="'.
|
||||
WebGUI::URL::page('op=viewProfile&uid='.$message{userId}).'">'.$message{username}.'</a><br>';
|
||||
$html .= "<b>".WebGUI::International::get(8,$namespace)."</b> ".
|
||||
epochToHuman($message{dateOfPost},"%w, %c %D, %y at %H:%n%p")."<br>";
|
||||
$html .= "<b>".WebGUI::International::get(9,$namespace)."</b> ".
|
||||
$message{widgetId}."-".$message{rid}."-".$message{pid}."-".$message{messageId}."<br>";
|
||||
$html .= '</td>';
|
||||
$html .= '<td rowspan=2 valign="top" class="tableMenu" nowrap>';
|
||||
$html .= '<a href="'.WebGUI::URL::page('func=postReply&mid='.$session{form}{mid}.
|
||||
'&wid='.$session{form}{wid})
|
||||
.'">'.WebGUI::International::get(13,$namespace).'</a><br>';
|
||||
if ((time()-$message{dateOfPost}) < 3600*$board{editTimeout} &&
|
||||
$message{userId} eq $session{user}{userId} ||
|
||||
WebGUI::Privilege::isInGroup($board{groupToModerate})) {
|
||||
$html .= '<a href="'.WebGUI::URL::page('func=editMessage&mid='.$session{form}{mid}.
|
||||
'&wid='.$session{form}{wid}).'">'.WebGUI::International::get(12,$namespace).'</a><br>';
|
||||
$html .= '<a href="'.WebGUI::URL::page('func=deleteMessage&mid='.$session{form}{mid}.
|
||||
'&wid='.$session{form}{wid}).'">'.WebGUI::International::get(22,$namespace).'</a><br>';
|
||||
}
|
||||
$html .= '<a href="'.WebGUI::URL::page().'">'.WebGUI::International::get(11,$namespace).'</a><br>';
|
||||
@data = WebGUI::SQL->quickArray("select max(messageId) from discussion where widgetId=$message{widgetId} and pid=0 and messageId<$message{rid}");
|
||||
if ($data[0] ne "") {
|
||||
$html .= '<a href="'.WebGUI::URL::page('func=showMessage&mid='.$data[0].'&wid='.
|
||||
$session{form}{wid}).'">« '.WebGUI::International::get(10,$namespace).'</a><br>';
|
||||
}
|
||||
@data = WebGUI::SQL->quickArray("select min(messageId) from discussion where widgetId=$message{widgetId} and pid=0 and messageId>$message{rid}");
|
||||
if ($data[0] ne "") {
|
||||
$html .= '<a href="'.WebGUI::URL::page('func=showMessage&mid='.$data[0].'&wid='.
|
||||
$session{form}{wid}).'">'.WebGUI::International::get(14,$namespace).' »</a><br>';
|
||||
}
|
||||
$html .= '</tr><tr><td class="tableData">';
|
||||
$html .= $message{message};
|
||||
$html .= '</td></tr></table>';
|
||||
$html .= '<table border=0 cellpadding=2 cellspacing=1 width="100%">';
|
||||
$html .= '<tr><td class="tableHeader">'.WebGUI::International::get(229).
|
||||
'</td><td class="tableHeader">'.WebGUI::International::get(15,$namespace).
|
||||
'</td><td class="tableHeader">'.WebGUI::International::get(16,$namespace).'</td></tr>';
|
||||
@data = WebGUI::SQL->quickArray("select messageId,subject,username,dateOfPost,userId from discussion where messageId=$message{rid}");
|
||||
$html .= '<tr';
|
||||
if ($session{form}{mid} eq $message{rid}) {
|
||||
$html .= ' class="highlight"';
|
||||
}
|
||||
$html .= '><td class="tableData"><a href="'.WebGUI::URL::page('func=showMessage&mid='.$data[0].'&wid='.
|
||||
$message{widgetId}).'">'.substr($data[1],0,30).'</a></td><td class="tableData"><a href="'.
|
||||
WebGUI::URL::page('op=viewProfile&uid='.$data[4]).'">'.$data[2].
|
||||
'</a></td><td class="tableData">'.
|
||||
epochToHuman($data[3],"%M/%D %H:%n%p").'</td></tr>';
|
||||
$html .= WebGUI::Discussion::traverseReplyTree($message{rid},1);
|
||||
$html .= "</table>";
|
||||
} else {
|
||||
$html = WebGUI::International::get(402);
|
||||
}
|
||||
$html .= '<a href="'.$session{page}{url}.'">'.WebGUI::International::get(11,$namespace).'</a><br>';
|
||||
@data = WebGUI::SQL->quickArray("select max(messageId) from discussion where widgetId=$message{widgetId} and pid=0 and messageId<$message{rid}");
|
||||
if ($data[0] ne "") {
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'">« '.WebGUI::International::get(10,$namespace).'</a><br>';
|
||||
# } else {
|
||||
# $html .= '« '.WebGUI::International::get(10,$namespace).'</a><br>';
|
||||
}
|
||||
@data = WebGUI::SQL->quickArray("select min(messageId) from discussion where widgetId=$message{widgetId} and pid=0 and messageId>$message{rid}");
|
||||
if ($data[0] ne "") {
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(14,$namespace).' »</a><br>';
|
||||
# } else {
|
||||
# $html .= WebGUI::International::get(14,$namespace).' »<br>';
|
||||
}
|
||||
$html .= '</tr><tr><td class="tableData">';
|
||||
$html .= $message{message};
|
||||
$html .= '</td></tr></table>';
|
||||
$html .= '<table border=0 cellpadding=2 cellspacing=1 width="100%">';
|
||||
$html .= '<tr><td class="tableHeader">'.WebGUI::International::get(229).'</td><td class="tableHeader">'.WebGUI::International::get(15,$namespace).'</td><td class="tableHeader">'.WebGUI::International::get(16,$namespace).'</td></tr>';
|
||||
@data = WebGUI::SQL->quickArray("select messageId,subject,username,dateOfPost,userId from discussion where messageId=$message{rid}");
|
||||
$html .= '<tr';
|
||||
if ($session{form}{mid} eq $message{rid}) {
|
||||
$html .= ' class="highlight"';
|
||||
}
|
||||
$html .= '><td class="tableData"><a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$message{widgetId}.'">'.substr($data[1],0,30).'</a></td><td class="tableData"><a href="'.$session{page}{url}.'?op=viewProfile&uid='.$data[4].'">'.$data[2].'</a></td><td class="tableData">'.epochToHuman($data[3],"%M/%D %H:%n%p").'</td></tr>';
|
||||
$html .= WebGUI::Discussion::traverseReplyTree($message{rid},1);
|
||||
$html .= "</table>";
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
|
@ -288,7 +356,10 @@ sub www_view {
|
|||
if ($board{processMacros}) {
|
||||
$html = WebGUI::Macro::process($html);
|
||||
}
|
||||
$html .= '<table width="100%" cellpadding=3 cellspacing=0 border=0><tr><td align="right" valign="bottom" class="tableMenu"><a href="'.$session{page}{url}.'?func=postNewMessage&wid='.$_[0].'">'.WebGUI::International::get(17,$namespace).'</a></td></tr></table>';
|
||||
$html .= '<table width="100%" cellpadding=3 cellspacing=0 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>';
|
||||
$html .= '<table border=0 cellpadding=2 cellspacing=1 width="100%">';
|
||||
$html .= '<tr><td class="tableHeader">'.WebGUI::International::get(229).'</td><td class="tableHeader">'.WebGUI::International::get(15,$namespace).'</td><td class="tableHeader">'.WebGUI::International::get(18,$namespace).'</td><td class="tableHeader">'.WebGUI::International::get(19,$namespace).'</td><td class="tableHeader">'.WebGUI::International::get(20,$namespace).'</td></tr>';
|
||||
#$sth = WebGUI::SQL->read("select messageId,subject,count(*)-1,username,dateOfPost,max(dateOfPost),max(messageId) from discussion where widgetId=$_[0] group by rid order by messageId desc");
|
||||
|
|
@ -297,24 +368,38 @@ sub www_view {
|
|||
if ($i >= ($itemsPerPage*$pn) && $i < ($itemsPerPage*($pn+1))) {
|
||||
@last = WebGUI::SQL->quickArray("select messageId,dateOfPost,username,subject,userId from discussion where widgetId=$_[0] and rid=$data[0] order by dateOfPost desc");
|
||||
($replies) = WebGUI::SQL->quickArray("select count(*)-1 from discussion where rid=$data[0]");
|
||||
$html .= '<tr><td class="tableData"><a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$_[0].'">'.substr($data[1],0,30).'</a></td><td class="tableData"><a href="'.$session{page}{url}.'?op=viewProfile&uid='.$data[4].'">'.$data[2].'</a></td><td class="tableData">'.epochToHuman($data[3],"%M/%D %H:%n%p").'</td><td class="tableData">'.$replies.'</td><td class="tableData"><span style="font-size: 8pt;"><a href="'.$session{page}{url}.'?func=showMessage&mid='.$last[0].'&wid='.$_[0].'">'.substr($last[3],0,30).'</a> @ '.epochToHuman($last[1],"%M/%D %H:%n%p").' by <a href="'.$session{page}{url}.'?op=viewProfile&uid='.$last[4].'">'.$last[2].'</a></span></td></tr>';
|
||||
$html .= '<tr><td class="tableData"><a href="'.WebGUI::URL::page('func=showMessage&mid='.
|
||||
$data[0].'&wid='.$_[0]).'">'.substr($data[1],0,30).
|
||||
'</a></td><td class="tableData"><a href="'.
|
||||
WebGUI::URL::page('op=viewProfile&uid='.$data[4]).'">'.$data[2].
|
||||
'</a></td><td class="tableData">'.epochToHuman($data[3],"%M/%D %H:%n%p").
|
||||
'</td><td class="tableData">'.$replies.
|
||||
'</td><td class="tableData"><span style="font-size: 8pt;"><a href="'.
|
||||
WebGUI::URL::page('func=showMessage&mid='.$last[0].'&wid='.$_[0]).'">'.
|
||||
substr($last[3],0,30).'</a> @ '.epochToHuman($last[1],"%M/%D %H:%n%p").
|
||||
' by <a href="'.WebGUI::URL::page('op=viewProfile&uid='.$last[4]).'">'.$last[2].
|
||||
'</a></span></td></tr>';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$html .= '</table>';
|
||||
$html .= '<div class="pagination">';
|
||||
if ($pn > 0) {
|
||||
$html .= '<a href="'.$session{page}{url}.'?pn='.($pn-1).'">«'.WebGUI::International::get(91).'</a>';
|
||||
} else {
|
||||
$html .= '«'.WebGUI::International::get(91);
|
||||
}
|
||||
$html .= ' · ';
|
||||
if (($pn+1) < round(($i/$itemsPerPage))) {
|
||||
$html .= '<a href="'.$session{page}{url}.'?pn='.($pn+1).'">'.WebGUI::International::get(92).'»</a>';
|
||||
} else {
|
||||
$html .= WebGUI::International::get(92).'»';
|
||||
}
|
||||
$html .= '</div>';
|
||||
if ($i > $itemsPerPage) {
|
||||
$html .= '<div class="pagination">';
|
||||
if ($pn > 0) {
|
||||
$html .= '<a href="'.WebGUI::URL::page('?pn='.($pn-1)).'">«'.
|
||||
WebGUI::International::get(91).'</a>';
|
||||
} else {
|
||||
$html .= '«'.WebGUI::International::get(91);
|
||||
}
|
||||
$html .= ' · ';
|
||||
if (($pn+1) < round(($i/$itemsPerPage))) {
|
||||
$html .= '<a href="'.WebGUI::URL::page('?pn='.($pn+1)).'">'.
|
||||
WebGUI::International::get(92).'»</a>';
|
||||
} else {
|
||||
$html .= WebGUI::International::get(92).'»';
|
||||
}
|
||||
$html .= '</div>';
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ use WebGUI::Privilege;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Shortcut;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::Widget;
|
||||
|
||||
|
|
@ -185,7 +186,8 @@ sub www_edit {
|
|||
$output .= tableFormRow(WebGUI::International::get(7,$namespace).'<span><br>'.WebGUI::International::get(8,$namespace).'</span>',
|
||||
WebGUI::Form::textArea("answers",$data{a1}."\n".$data{a2}."\n".$data{a3}."\n".$data{a4}."\n".$data{a5}."\n".$data{a6}."\n".$data{a7}."\n".$data{a8}."\n".$data{a9}."\n".$data{a10}."\n".$data{a11}."\n".$data{a12}."\n".$data{a13}."\n".$data{a14}."\n".$data{a15}."\n".$data{a16}."\n".$data{a17}."\n".$data{a18}."\n".$data{a19}."\n".$data{a20}."\n",50,8,0,'on'));
|
||||
$output .= formSave();
|
||||
$output .= tableFormRow("",'<a href="'.$session{page}{url}.'?func=resetVotes&wid='.$session{form}{wid}.'">'.WebGUI::International::get(10,$namespace).'</a>');
|
||||
$output .= tableFormRow("",'<a href="'.WebGUI::URL::page('func=resetVotes&wid='.$session{form}{wid})
|
||||
.'">'.WebGUI::International::get(10,$namespace).'</a>');
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ use WebGUI::Privilege;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Shortcut;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::Widget;
|
||||
|
||||
|
|
@ -238,12 +239,10 @@ sub www_view {
|
|||
$i++;
|
||||
}
|
||||
$sth->finish;
|
||||
($dataRows, $prevNextBar) = paginate($data{paginateAfter},$session{page}{url},\@row);
|
||||
($dataRows, $prevNextBar) = paginate($data{paginateAfter},WebGUI::URL::page(),\@row);
|
||||
$output .= $dataRows;
|
||||
$output .= $template[2];
|
||||
if ($#row > $data{paginateAfter}) {
|
||||
$output .= $prevNextBar;
|
||||
}
|
||||
$output .= $prevNextBar;
|
||||
} else {
|
||||
$output .= WebGUI::International::get(11,$namespace).'<p>';
|
||||
WebGUI::ErrorHandler::warn("SQLReport [$_[0]] There was a problem with the query.");
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ use WebGUI::Privilege;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Shortcut;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Widget;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -40,8 +41,8 @@ sub _traversePageTree {
|
|||
$sth = WebGUI::SQL->read("select urlizedTitle, title, pageId from page where parentId='$_[0]' order by sequenceNumber");
|
||||
while (@data = $sth->array) {
|
||||
if (WebGUI::Privilege::canViewPage($data[2])) {
|
||||
$output .= $depth.$_[4].' <a href="'.$session{config}{scripturl}.
|
||||
'/'.$data[0].'">'.$data[1].'</a>';
|
||||
$output .= $depth.$_[4].' <a href="'.WebGUI::URL::gateway($data[0])
|
||||
.'">'.$data[1].'</a>';
|
||||
$output .= $lineSpacing;
|
||||
$output .= _traversePageTree($data[2],$_[1]+1,$_[2],$_[3],$_[4],$_[5]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ use WebGUI::Privilege;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Shortcut;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::URL;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::Widget;
|
||||
|
||||
|
|
@ -121,7 +122,15 @@ sub www_addSubmission {
|
|||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(15,$namespace).'</td><td class="tableHeader">'.WebGUI::International::get(99).'</td><td class="tableHeader">'.WebGUI::International::get(13,$namespace).'</td><td class="tableHeader">'.WebGUI::International::get(14,$namespace).'</td></tr>';
|
||||
$sth = WebGUI::SQL->read("select title,submissionId,dateSubmitted,status from UserSubmission_submission where widgetId='$session{form}{wid}' and userId=$session{user}{userId} order by dateSubmitted desc");
|
||||
while (@submission = $sth->array) {
|
||||
$output .= '<tr><td class="tableData"><a href="'.$session{page}{url}.'?func=editSubmission&wid='.$session{form}{wid}.'&sid='.$submission[1].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?wid='.$session{form}{wid}.'&sid='.$submission[1].'&func=deleteSubmission"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a></td><td class="tableData"><a href="'.$session{page}{url}.'?wid='.$session{form}{wid}.'&func=viewSubmission&sid='.$submission[1].'">'.$submission[0].'</a></td><td class="tableData">'.epochToHuman($submission[2],"%M/%D/%y").'</td><td class="tableData">'.$submission[3].'</td></tr>';
|
||||
$output .= '<tr><td class="tableData"><a href="'.WebGUI::URL::page('func=editSubmission&wid='.
|
||||
$session{form}{wid}.'&sid='.$submission[1]).'"><img src="'.$session{setting}{lib}.
|
||||
'/edit.gif" border=0></a><a href="'.WebGUI::URL::page('wid='.$session{form}{wid}.
|
||||
'&sid='.$submission[1].'&func=deleteSubmission').'"><img src="'.$session{setting}{lib}
|
||||
.'/delete.gif" border=0></a></td><td class="tableData"><a href="'.
|
||||
WebGUI::URL::page('wid='.$session{form}{wid}.'&func=viewSubmission&sid='.
|
||||
$submission[1]).'">'.$submission[0].'</a></td><td class="tableData">'.
|
||||
epochToHuman($submission[2],"%M/%D/%y").'</td><td class="tableData">'.
|
||||
$submission[3].'</td></tr>';
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= '</table>';
|
||||
|
|
@ -146,7 +155,9 @@ sub www_addSubmissionSave {
|
|||
}
|
||||
WebGUI::SQL->write("insert into UserSubmission_submission values ($session{form}{wid}, $submissionId, ".quote($title).", ".time().", ".quote($session{user}{username}).", '$session{user}{userId}', ".quote($session{form}{content}).", ".quote($image).", ".quote($attachment).", '$userSubmission{defaultStatus}', '$session{form}{convertCarriageReturns}')");
|
||||
if ($userSubmission{defaultStatus} ne "Approved") {
|
||||
WebGUI::MessageLog::addEntry('',$userSubmission{groupToApprove},$session{page}{url}.'?func=viewSubmission&wid='.$session{form}{wid}.'&sid='.$submissionId,3,$namespace);
|
||||
WebGUI::MessageLog::addEntry('',$userSubmission{groupToApprove},
|
||||
WebGUI::URL::page('func=viewSubmission&wid='.$session{form}{wid}.
|
||||
'&sid='.$submissionId),3,$namespace);
|
||||
}
|
||||
return "";
|
||||
} else {
|
||||
|
|
@ -161,7 +172,8 @@ sub www_approveSubmission {
|
|||
%submission = WebGUI::SQL->quickHash("select * from UserSubmission_submission where submissionId=$session{form}{sid}");
|
||||
%userSubmission = getProperties($namespace,$session{form}{wid});;
|
||||
WebGUI::SQL->write("update UserSubmission_submission set status='Approved' where submissionId=$session{form}{sid}");
|
||||
WebGUI::MessageLog::addEntry($submission{userId},'',$session{page}{url}.'?func=viewSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid},4,$namespace);
|
||||
WebGUI::MessageLog::addEntry($submission{userId},'',WebGUI::URL::page('func=viewSubmission&wid='.
|
||||
$session{form}{wid}.'&sid='.$session{form}{sid}),4,$namespace);
|
||||
WebGUI::MessageLog::completeEntry($session{form}{mlog});
|
||||
return WebGUI::Operation::www_viewMessageLog();
|
||||
} else {
|
||||
|
|
@ -210,8 +222,9 @@ sub www_deleteSubmission {
|
|||
if ($owner == $session{user}{userId}) {
|
||||
$output = '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(17,$namespace).'<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?func=deleteSubmissionConfirm&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(44).'</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'">'.WebGUI::International::get(45).'</a></div>';
|
||||
$output .= '<div align="center"><a href="'.WebGUI::URL::page('func=deleteSubmissionConfirm&wid='.
|
||||
$session{form}{wid}.'&sid='.$session{form}{sid}).'">'.WebGUI::International::get(44).'</a>';
|
||||
$output .= ' <a href="'.WebGUI::URL::page().'">'.WebGUI::International::get(45).'</a></div>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -237,7 +250,8 @@ sub www_denySubmission {
|
|||
%submission = WebGUI::SQL->quickHash("select * from UserSubmission_submission where submissionId=$session{form}{sid}");
|
||||
%userSubmission = getProperties($namespace,$session{form}{wid});
|
||||
WebGUI::SQL->write("update UserSubmission_submission set status='Denied' where submissionId=$session{form}{sid}");
|
||||
WebGUI::MessageLog::addEntry($submission{userId},'',$session{page}{url}.'?func=viewSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid},5,$namespace);
|
||||
WebGUI::MessageLog::addEntry($submission{userId},'',WebGUI::URL::page('func=viewSubmission&wid='.
|
||||
$session{form}{wid}.'&sid='.$session{form}{sid}),5,$namespace);
|
||||
WebGUI::MessageLog::completeEntry($session{form}{mlog});
|
||||
return WebGUI::Operation::www_viewMessageLog();
|
||||
} else {
|
||||
|
|
@ -308,12 +322,16 @@ sub www_editSubmission {
|
|||
$output .= tableFormRow(WebGUI::International::get(35,$namespace),WebGUI::Form::text("title",20,128,$submission{title}));
|
||||
$output .= tableFormRow(WebGUI::International::get(31,$namespace),WebGUI::Form::textArea("content",$submission{content},50,10));
|
||||
if ($submission{image} ne "") {
|
||||
$output .= tableFormRow(WebGUI::International::get(32,$namespace),'<a href="'.$session{page}{url}.'?func=deleteImage&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(36,$namespace).'</a>');
|
||||
$output .= tableFormRow(WebGUI::International::get(32,$namespace),'<a href="'.
|
||||
WebGUI::URL::page('func=deleteImage&wid='.$session{form}{wid}.'&sid='.
|
||||
$session{form}{sid}).'">'.WebGUI::International::get(36,$namespace).'</a>');
|
||||
} else {
|
||||
$output .= tableFormRow(WebGUI::International::get(32,$namespace),WebGUI::Form::file("image"));
|
||||
}
|
||||
if ($submission{attachment} ne "") {
|
||||
$output .= tableFormRow(WebGUI::International::get(33,$namespace),'<a href="'.$session{page}{url}.'?func=deleteAttachment&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(36,$namespace).'</a>');
|
||||
$output .= tableFormRow(WebGUI::International::get(33,$namespace),'<a href="'.
|
||||
WebGUI::URL::page('func=deleteAttachment&wid='.$session{form}{wid}.'&sid='.
|
||||
$session{form}{sid}).'">'.WebGUI::International::get(36,$namespace).'</a>');
|
||||
} else {
|
||||
$output .= tableFormRow(WebGUI::International::get(33,$namespace),WebGUI::Form::file("attachment"));
|
||||
}
|
||||
|
|
@ -348,7 +366,9 @@ sub www_editSubmissionSave {
|
|||
}
|
||||
WebGUI::SQL->write("update UserSubmission_submission set dateSubmitted=".time().", convertCarriageReturns='$session{form}{convertCarriageReturns}', title=".quote($title).", content=".quote($session{form}{content}).", ".$image.$attachment." status='$userSubmission{defaultStatus}' where submissionId=$session{form}{sid}");
|
||||
if ($userSubmission{defaultStatus} ne "Approved") {
|
||||
WebGUI::MessageLog::addEntry('',$userSubmission{groupToApprove},$session{page}{url}.'?func=viewSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid},3,$namespace);
|
||||
WebGUI::MessageLog::addEntry('',$userSubmission{groupToApprove},
|
||||
WebGUI::URL::page('func=viewSubmission&wid='.$session{form}{wid}.'&sid='.
|
||||
$session{form}{sid}),3,$namespace);
|
||||
}
|
||||
return www_viewSubmission();
|
||||
} else {
|
||||
|
|
@ -373,12 +393,18 @@ sub www_view {
|
|||
}
|
||||
$sth = WebGUI::SQL->read("select title,submissionId,dateSubmitted,username,userId from UserSubmission_submission where widgetId='$_[0]' and status='Approved' order by dateSubmitted desc");
|
||||
while (@submission = $sth->array) {
|
||||
$row[$i] = '<tr><td class="tableData"><a href="'.$session{page}{url}.'?wid='.$_[0].'&func=viewSubmission&sid='.$submission[1].'">'.$submission[0].'</a></td><td class="tableData">'.epochToHuman($submission[2],"%M/%D/%y").'</td><td class="tableData"><a href="'.$session{page}{url}.'?op=viewProfile&uid='.$submission[4].'">'.$submission[3].'</a></td></tr>';
|
||||
$row[$i] = '<tr><td class="tableData"><a href="'.WebGUI::URL::page('wid='.$_[0].
|
||||
'&func=viewSubmission&sid='.$submission[1]).'">'.$submission[0].
|
||||
'</a></td><td class="tableData">'.epochToHuman($submission[2],"%M/%D/%y").
|
||||
'</td><td class="tableData"><a href="'.WebGUI::URL::page('op=viewProfile&uid='.
|
||||
$submission[4]).'">'.$submission[3].'</a></td></tr>';
|
||||
$i++;
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= '<table width="100%" cellpadding=3 cellspacing=0 border=0><tr><td align="right" class="tableMenu"><a href="'.$session{page}{url}.'?func=addSubmission&wid='.$_[0].'">'.WebGUI::International::get(20,$namespace).'</a></td></tr></table>';
|
||||
($dataRows, $prevNextBar) = paginate($data{submissionsPerPage},$session{page}{url},\@row);
|
||||
$output .= '<table width="100%" cellpadding=3 cellspacing=0 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);
|
||||
$output .= '<table width="100%" cellspacing=1 cellpadding=2 border=0>';
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(99).'</td><td class="tableHeader">'.WebGUI::International::get(13,$namespace).'</td><td class="tableHeader">'.WebGUI::International::get(21,$namespace).'</td></tr>';
|
||||
$output .= $dataRows;
|
||||
|
|
@ -397,19 +423,27 @@ sub www_viewSubmission {
|
|||
$output .= '<table width="100%" cellpadding=2 cellspacing=1 border=0>';
|
||||
$output .= '<tr><td class="tableHeader">';
|
||||
#---header
|
||||
$output .= '<b>'.WebGUI::International::get(22,$namespace).'</b> <a href="'.$session{page}{url}.'?op=viewProfile&uid='.$submission{userId}.'">'.$submission{username}.'</a><br>';
|
||||
$output .= '<b>'.WebGUI::International::get(22,$namespace).'</b> <a href="'.
|
||||
WebGUI::URL::page('op=viewProfile&uid='.$submission{userId}).'">'.$submission{username}.'</a><br>';
|
||||
$output .= '<b>'.WebGUI::International::get(23,$namespace).'</b> '.epochToHuman($submission{dateSubmitted},"%w, %c %D, %y at %H:%n%p");
|
||||
$output .= '</td><td rowspan="2" class="tableMenu" nowrap valign="top">';
|
||||
#---menu
|
||||
$output .= '<a href="'.$session{page}{url}.'">'.WebGUI::International::get(28,$namespace).'</a><br>';
|
||||
$output .= '<a href="'.WebGUI::URL::page().'">'.WebGUI::International::get(28,$namespace).'</a><br>';
|
||||
if ($submission{userId} == $session{user}{userId}) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?func=deleteSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(37,$namespace).'</a><br>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?func=editSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(27,$namespace).'</a><br>';
|
||||
$output .= '<a href="'.WebGUI::URL::page('func=deleteSubmission&wid='.$session{form}{wid}.'&sid='.
|
||||
$session{form}{sid}).'">'.WebGUI::International::get(37,$namespace).'</a><br>';
|
||||
$output .= '<a href="'.WebGUI::URL::page('func=editSubmission&wid='.$session{form}{wid}.'&sid='.
|
||||
$session{form}{sid}).'">'.WebGUI::International::get(27,$namespace).'</a><br>';
|
||||
}
|
||||
if ($submission{status} eq "Pending" && (WebGUI::Privilege::isInGroup(3,$session{user}{userId}) || WebGUI::Privilege::isInGroup(4,$session{user}{userId}))) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?func=approveSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'&mlog='.$session{form}{mlog}.'">'.WebGUI::International::get(24,$namespace).'</a><br>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewMessageLog">'.WebGUI::International::get(25,$namespace).'</a><br>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?func=denySubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'&mlog='.$session{form}{mlog}.'">'.WebGUI::International::get(26,$namespace).'</a><br>';
|
||||
$output .= '<a href="'.WebGUI::URL::page('func=approveSubmission&wid='.$session{form}{wid}.
|
||||
'&sid='.$session{form}{sid}.'&mlog='.$session{form}{mlog}).'">'.
|
||||
WebGUI::International::get(24,$namespace).'</a><br>';
|
||||
$output .= '<a href="'.WebGUI::URL::page('op=viewMessageLog').'">'.
|
||||
WebGUI::International::get(25,$namespace).'</a><br>';
|
||||
$output .= '<a href="'.WebGUI::URL::page('func=denySubmission&wid='.$session{form}{wid}.
|
||||
'&sid='.$session{form}{sid}.'&mlog='.$session{form}{mlog}).'">'.
|
||||
WebGUI::International::get(26,$namespace).'</a><br>';
|
||||
}
|
||||
$output .= '</td</tr><tr><td class="tableData">';
|
||||
#---content
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue