WebGUI 3.3.0 release
This commit is contained in:
parent
40bb7fed59
commit
80f7752f32
41 changed files with 1662 additions and 402 deletions
|
|
@ -27,14 +27,20 @@ use WebGUI::Widget;
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub duplicate {
|
||||
my (%data, $newWidgetId, $pageId);
|
||||
my (%data, $newWidgetId, $pageId, $file);
|
||||
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::Attachment::copy($data{image},$_[0],$newWidgetId);
|
||||
WebGUI::Attachment::copy($data{attachment},$_[0],$newWidgetId);
|
||||
WebGUI::SQL->write("insert into Article values ($newWidgetId, $data{startDate}, $data{endDate}, ".quote($data{body}).", ".quote($data{image}).", ".quote($data{linkTitle}).", ".quote($data{linkURL}).", ".quote($data{attachment}).", '$data{convertCarriageReturns}', ".quote($data{alignImage}).")");
|
||||
$newWidgetId = create($pageId,$namespace,$data{title},$data{displayTitle},
|
||||
$data{description},$data{processMacros},$data{templatePosition});
|
||||
$file = WebGUI::Attachment->new($data{image},$_[0]);
|
||||
$file->copy($newWidgetId);
|
||||
$file = WebGUI::Attachment->new($data{attachment},$_[0]);
|
||||
$file->copy($newWidgetId);
|
||||
WebGUI::SQL->write("insert into Article values ($newWidgetId, $data{startDate}, $data{endDate}, ".
|
||||
quote($data{body}).", ".quote($data{image}).", ".quote($data{linkTitle}).", ".
|
||||
quote($data{linkURL}).", ".quote($data{attachment}).", '$data{convertCarriageReturns}', ".
|
||||
quote($data{alignImage}).")");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -92,10 +98,24 @@ sub www_add {
|
|||
sub www_addSave {
|
||||
my ($widgetId, $image, $attachment);
|
||||
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});
|
||||
$image = WebGUI::Attachment::save("image",$widgetId);
|
||||
$attachment = WebGUI::Attachment::save("attachment",$widgetId);
|
||||
WebGUI::SQL->write("insert into Article values ($widgetId, '".setToEpoch($session{form}{startDate})."', '".setToEpoch($session{form}{endDate})."', ".quote($session{form}{body}).", ".quote($image).", ".quote($session{form}{linkTitle}).", ".quote($session{form}{linkURL}).", ".quote($attachment).", '$session{form}{convertCarriageReturns}', ".quote($session{form}{alignImage}).")");
|
||||
$widgetId = create($session{page}{pageId},$session{form}{widget},
|
||||
$session{form}{title},$session{form}{displayTitle},
|
||||
$session{form}{description},$session{form}{processMacros},
|
||||
$session{form}{templatePosition});
|
||||
$image = WebGUI::Attachment->new("",$widgetId);
|
||||
$image->save("image");
|
||||
$attachment = WebGUI::Attachment->new("",$widgetId);
|
||||
$attachment->save("attachment");
|
||||
WebGUI::SQL->write("insert into Article values ($widgetId, '".
|
||||
setToEpoch($session{form}{startDate})."', '".
|
||||
setToEpoch($session{form}{endDate})."', ".
|
||||
quote($session{form}{body}).", ".
|
||||
quote($image->getFilename).", ".
|
||||
quote($session{form}{linkTitle}).", ".
|
||||
quote($session{form}{linkURL}).", ".
|
||||
quote($attachment->getFilename).
|
||||
", '$session{form}{convertCarriageReturns}', ".
|
||||
quote($session{form}{alignImage}).")");
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -145,15 +165,22 @@ 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,$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(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}));
|
||||
%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(3,$namespace),WebGUI::Form::text("startDate",20,30,epochToSet($data{startDate}),1));
|
||||
$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));
|
||||
$output .= tableFormRow(WebGUI::International::get(363),
|
||||
WebGUI::Form::selectList("templatePosition",\%hash,\@array));
|
||||
$output .= tableFormRow(WebGUI::International::get(3,$namespace),
|
||||
WebGUI::Form::text("startDate",20,30,epochToSet($data{startDate}),1));
|
||||
$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="'.
|
||||
WebGUI::URL::page('func=deleteImage&wid='.$session{form}{wid})
|
||||
|
|
@ -169,16 +196,21 @@ sub www_edit {
|
|||
$array[0] = $data{alignImage};
|
||||
$output .= tableFormRow(WebGUI::International::get(14,$namespace),
|
||||
WebGUI::Form::selectList("alignImage",\%hash,\@array));
|
||||
$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}));
|
||||
$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="'.
|
||||
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"));
|
||||
$output .= tableFormRow(WebGUI::International::get(9,$namespace),
|
||||
WebGUI::Form::file("attachment"));
|
||||
}
|
||||
$output .= tableFormRow(WebGUI::International::get(10,$namespace),WebGUI::Form::checkbox("convertCarriageReturns",1,$data{convertCarriageReturns}).' <span style="font-size: 8pt;">'.WebGUI::International::get(11,$namespace).'</span>');
|
||||
$output .= tableFormRow(WebGUI::International::get(10,$namespace),
|
||||
WebGUI::Form::checkbox("convertCarriageReturns",1,$data{convertCarriageReturns}).
|
||||
' <span style="font-size: 8pt;">'.WebGUI::International::get(11,$namespace).'</span>');
|
||||
$output .= formSave();
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
|
|
@ -189,18 +221,27 @@ sub www_edit {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editSave {
|
||||
my ($image, $attachment);
|
||||
my ($sqlAdd, $image, $attachment);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
update();
|
||||
$image = WebGUI::Attachment::save("image",$session{form}{wid});
|
||||
if ($image ne "") {
|
||||
$image = ', image='.quote($image);
|
||||
$image = WebGUI::Attachment->new("",$session{form}{wid});
|
||||
$image->save("image");
|
||||
if ($image->getFilename ne "") {
|
||||
$sqlAdd = ', image='.quote($image->getFilename);
|
||||
}
|
||||
$attachment = WebGUI::Attachment::save("attachment",$session{form}{wid});
|
||||
$attachment = WebGUI::Attachment->new("",$session{form}{wid});
|
||||
$attachment->save("attachment");
|
||||
if ($attachment ne "") {
|
||||
$attachment = ', attachment='.quote($attachment);
|
||||
$sqlAdd .= ', attachment='.quote($attachment->getFilename);
|
||||
}
|
||||
WebGUI::SQL->write("update Article set alignImage=".quote($session{form}{alignImage}).", startDate='".setToEpoch($session{form}{startDate})."', endDate='".setToEpoch($session{form}{endDate})."', convertCarriageReturns='$session{form}{convertCarriageReturns}', body=".quote($session{form}{body}).", linkTitle=".quote($session{form}{linkTitle}).", linkURL=".quote($session{form}{linkURL}).$attachment.$image." where widgetId=$session{form}{wid}");
|
||||
WebGUI::SQL->write("update Article set alignImage=".quote($session{form}{alignImage}).
|
||||
", startDate='".setToEpoch($session{form}{startDate}).
|
||||
"', endDate='".setToEpoch($session{form}{endDate}).
|
||||
"', convertCarriageReturns='$session{form}{convertCarriageReturns}', body=".
|
||||
quote($session{form}{body}).", linkTitle=".
|
||||
quote($session{form}{linkTitle}).", linkURL=".
|
||||
quote($session{form}{linkURL}).$sqlAdd.
|
||||
" where widgetId=$session{form}{wid}");
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -217,7 +258,8 @@ sub www_view {
|
|||
$output = "<h1>".$data{title}."</h1>";
|
||||
}
|
||||
if ($data{image} ne "") {
|
||||
$image = '<img src="'.$session{setting}{attachmentDirectoryWeb}.'/'.$_[0].'/'.$data{image}.'"';
|
||||
$image = WebGUI::Attachment->new($data{image},$_[0]);
|
||||
$image = '<img src="'.$image->getURL.'"';
|
||||
if ($data{alignImage} ne "center") {
|
||||
$image .= ' align="'.$data{alignImage}.'"';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ use WebGUI::DateTime;
|
|||
use WebGUI::Form;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Paginator;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Shortcut;
|
||||
|
|
@ -39,7 +40,7 @@ sub _reorderDownloads {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub duplicate {
|
||||
my (%data, $newWidgetId, $pageId, %row, $sth, $newDownloadId);
|
||||
my (%data, $file, $newWidgetId, $pageId, %row, $sth, $newDownloadId);
|
||||
tie %data, 'Tie::CPHash';
|
||||
%data = getProperties($namespace,$_[0]);
|
||||
$pageId = $_[1] || $data{pageId};
|
||||
|
|
@ -56,13 +57,17 @@ sub duplicate {
|
|||
$sth = WebGUI::SQL->read("select * from DownloadManager_file where widgetId=$_[0]");
|
||||
while (%row = $sth->hash) {
|
||||
$newDownloadId = getNextId("downloadId");
|
||||
WebGUI::Attachment::copy($row{downloadFile},$_[0],$newWidgetId,$row{downloadId},$newDownloadId);
|
||||
WebGUI::Attachment::copy($row{alternateVersion1},$_[0],$newWidgetId,$row{downloadId},$newDownloadId);
|
||||
WebGUI::Attachment::copy($row{alternateVersion2},$_[0],$newWidgetId,$row{downloadId},$newDownloadId);
|
||||
$file = WebGUI::Attachment->new($row{downloadFile},$_[0],$row{downloadId});
|
||||
$file->copy($newWidgetId,$newDownloadId);
|
||||
$file = WebGUI::Attachment->new($row{alternateVersion1},$_[0],$row{downloadId});
|
||||
$file->copy($newWidgetId,$newDownloadId);
|
||||
$file = WebGUI::Attachment->new($row{alternateVersion2},$_[0],$row{downloadId});
|
||||
$file->copy($newWidgetId,$newDownloadId);
|
||||
WebGUI::SQL->write("insert into DownloadManager_file values ($newDownloadId, $newWidgetId, ".
|
||||
quote($row{fileTitle}).", ".quote($row{downloadFile}).", $row{groupToView}, ".
|
||||
quote($row{briefSynopsis}).", $row{dateUploaded}, $row{sequenceNumber}, ".
|
||||
quote($row{alternateVersion1}).", ".quote($row{alternateVersion2}).")");
|
||||
quote($row{alternateVersion1}).", ".quote($row{alternateVersion2}).
|
||||
", $row{displayThumbnails})");
|
||||
}
|
||||
$sth->finish;
|
||||
}
|
||||
|
|
@ -114,6 +119,10 @@ sub www_add {
|
|||
WebGUI::International::get(20,$namespace),
|
||||
WebGUI::Form::text("paginateAfter",20,30,50)
|
||||
);
|
||||
$output .= tableFormRow(
|
||||
WebGUI::International::get(21,$namespace),
|
||||
WebGUI::Form::checkbox("displayThumbnails",1,1)
|
||||
);
|
||||
$output .= tableFormRow(
|
||||
WebGUI::International::get(3,$namespace),
|
||||
WebGUI::Form::checkbox("proceed",1,1)
|
||||
|
|
@ -140,7 +149,7 @@ sub www_addSave {
|
|||
$session{form}{processMacros},
|
||||
$session{form}{templatePosition}
|
||||
);
|
||||
WebGUI::SQL->write("insert into DownloadManager values ($widgetId, '$session{form}{paginateAfter}')");
|
||||
WebGUI::SQL->write("insert into DownloadManager values ($widgetId, '$session{form}{paginateAfter}', '$session{form}{displayThumbnails}')");
|
||||
if ($session{form}{proceed} == 1) {
|
||||
$session{form}{wid} = $widgetId;
|
||||
return www_addDownload();
|
||||
|
|
@ -198,21 +207,24 @@ sub www_addDownloadSave {
|
|||
my ($downloadId,$file,$alt1,$alt2,$sequenceNumber);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$downloadId = getNextId("downloadId");
|
||||
$file = WebGUI::Attachment::save("downloadFile",$session{form}{wid},$downloadId);
|
||||
$alt1 = WebGUI::Attachment::save("alternateVersion1",$session{form}{wid},$downloadId);
|
||||
$alt2 = WebGUI::Attachment::save("alternateVersion2",$session{form}{wid},$downloadId);
|
||||
$file = WebGUI::Attachment->new("",$session{form}{wid},$downloadId);
|
||||
$file->save("downloadFile");
|
||||
$alt1 = WebGUI::Attachment->new("",$session{form}{wid},$downloadId);
|
||||
$alt1->save("alternateVersion1");
|
||||
$alt2 = WebGUI::Attachment->new("",$session{form}{wid},$downloadId);
|
||||
$alt2->save("alternateVersion2");
|
||||
($sequenceNumber) = WebGUI::SQL->quickArray("select count(*)+1 from DownloadManager_file where widgetId=$session{form}{wid}");
|
||||
WebGUI::SQL->write("insert into DownloadManager_file values (".
|
||||
$downloadId.
|
||||
", ".$session{form}{wid}.
|
||||
", ".quote($session{form}{fileTitle}).
|
||||
", ".quote($file).
|
||||
", ".quote($file->getFilename).
|
||||
", '$session{form}{groupToView}'".
|
||||
", ".quote($session{form}{briefSynopsis}).
|
||||
", ".time().
|
||||
", ".$sequenceNumber.
|
||||
", ".quote($alt1).
|
||||
", ".quote($alt2).
|
||||
", ".quote($alt1->getFilename).
|
||||
", ".quote($alt2->getFilename).
|
||||
")");
|
||||
return www_edit();
|
||||
} else {
|
||||
|
|
@ -268,8 +280,10 @@ sub www_deleteDownload {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteDownloadConfirm {
|
||||
my ($output);
|
||||
my ($output, $file);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$file = WebGUI::Attachment->new("",$session{form}{wid},$session{form}{did});
|
||||
$file->deleteNode;
|
||||
WebGUI::SQL->write("delete from DownloadManager_file where downloadId=$session{form}{did}");
|
||||
_reorderDownloads($session{form}{wid});
|
||||
return www_edit();
|
||||
|
|
@ -280,19 +294,24 @@ sub www_deleteDownloadConfirm {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_download {
|
||||
my (%download, $url);
|
||||
my (%download, $file);
|
||||
tie %download,'Tie::CPHash';
|
||||
%download = WebGUI::SQL->quickHash("select * from DownloadManager_file where downloadId=$session{form}{did}");
|
||||
if (WebGUI::Privilege::isInGroup($download{groupToView})) {
|
||||
$url = $session{setting}{attachmentDirectoryWeb}."/".$session{form}{wid}."/".$session{form}{did}."/";
|
||||
if ($session{form}{alternateVersion} == 1) {
|
||||
$url .= $download{alternateVersion1};
|
||||
$file = WebGUI::Attachment->new($download{alternateVersion1},
|
||||
$session{form}{wid},
|
||||
$session{form}{did});
|
||||
} elsif ($session{form}{alternateVersion} == 2) {
|
||||
$url .= $download{alternateVersion2};
|
||||
$file = WebGUI::Attachment->new($download{alternateVersion2},
|
||||
$session{form}{wid},
|
||||
$session{form}{did});
|
||||
} else {
|
||||
$url .= $download{downloadFile};
|
||||
$file = WebGUI::Attachment->new($download{downloadFile},
|
||||
$session{form}{wid},
|
||||
$session{form}{did});
|
||||
}
|
||||
$session{header}{redirect} = WebGUI::Session::httpRedirect($url);
|
||||
$session{header}{redirect} = WebGUI::Session::httpRedirect($file->getURL);
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -339,6 +358,10 @@ sub www_edit {
|
|||
WebGUI::International::get(20,$namespace),
|
||||
WebGUI::Form::text("paginateAfter",20,30,$data{paginateAfter})
|
||||
);
|
||||
$output .= tableFormRow(
|
||||
WebGUI::International::get(21,$namespace),
|
||||
WebGUI::Form::checkbox("displayThumbnails","1",$data{displayThumbnails})
|
||||
);
|
||||
$output .= formSave();
|
||||
$output .= '</table></form>';
|
||||
$output .= '<p><a href="'.WebGUI::URL::page('func=addDownload&wid='.$session{form}{wid})
|
||||
|
|
@ -372,7 +395,7 @@ sub www_edit {
|
|||
sub www_editSave {
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
update();
|
||||
WebGUI::SQL->write("update DownloadManager set paginateAfter='$session{form}{paginateAfter}' where widgetId=$session{form}{wid}");
|
||||
WebGUI::SQL->write("update DownloadManager set paginateAfter='$session{form}{paginateAfter}', displayThumbnails='$session{form}{displayThumbnails}' where widgetId=$session{form}{wid}");
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -452,25 +475,28 @@ sub www_editDownload {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editDownloadSave {
|
||||
my ($file, $alt1, $alt2);
|
||||
my ($file, $alt1, $alt2, $sqlAdd);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$file = WebGUI::Attachment::save("downloadFile",$session{form}{wid},$session{form}{did});
|
||||
if ($file ne "") {
|
||||
$file = ', downloadFile='.quote($file);
|
||||
$file = WebGUI::Attachment->new("",$session{form}{wid},$session{form}{did});
|
||||
$file->save("downloadFile");
|
||||
if ($file->getFilename ne "") {
|
||||
$sqlAdd = ', downloadFile='.quote($file->getFilename);
|
||||
}
|
||||
$alt1 = WebGUI::Attachment::save("alternateVersion1",$session{form}{wid},$session{form}{did});
|
||||
if ($alt1 ne "") {
|
||||
$alt1 = ', alternateVersion1='.quote($alt1);
|
||||
$alt1 = WebGUI::Attachment->new("",$session{form}{wid},$session{form}{did});
|
||||
$alt1->save("alternateVersion1");
|
||||
if ($alt1->getFilename ne "") {
|
||||
$sqlAdd .= ', alternateVersion1='.quote($alt1->getFilename);
|
||||
}
|
||||
$alt2 = WebGUI::Attachment::save("alternateVersion2",$session{form}{wid},$session{form}{did});
|
||||
if ($alt2 ne "") {
|
||||
$alt2 = ', alternateVersion2='.quote($alt2);
|
||||
$alt2 = WebGUI::Attachment->new("",$session{form}{wid},$session{form}{did});
|
||||
$alt2->save("alternateVersion2");
|
||||
if ($alt2->getFilename ne "") {
|
||||
$sqlAdd = ', alternateVersion2='.quote($alt2->getFilename);
|
||||
}
|
||||
WebGUI::SQL->write("update DownloadManager_file set ".
|
||||
" downloadId=".$session{form}{did}.
|
||||
", widgetId=".$session{form}{wid}.
|
||||
", fileTitle=".quote($session{form}{fileTitle}).
|
||||
$file.$alt1.$alt2.
|
||||
$sqlAdd.
|
||||
", groupToView='$session{form}{groupToView}'".
|
||||
", briefSynopsis=".quote($session{form}{briefSynopsis}).
|
||||
", dateUploaded=".time().
|
||||
|
|
@ -516,7 +542,7 @@ sub www_moveDownloadUp {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my ($url, @row, $i, $dataRows, $search, $prevNextBar, %data, @test, %fileType, $output, $sth,
|
||||
my ($url, @row, $i, $p, $search, %data, @test, $file, $alt1, $alt2, $output, $sth,
|
||||
%download, $flag, $sort, $sortDirection);
|
||||
tie %download, 'Tie::CPHash';
|
||||
tie %data, 'Tie::CPHash';
|
||||
|
|
@ -562,29 +588,38 @@ sub www_view {
|
|||
$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});
|
||||
$file = WebGUI::Attachment->new($download{downloadFile},
|
||||
$_[0], $download{downloadId});
|
||||
$row[$i] = '<tr><td class="tableData" valign="top">';
|
||||
$row[$i] .= '<a href="'.WebGUI::URL::page('func=download&wid='.$_[0].
|
||||
'&did='.$download{downloadId}).'"><img src="'.$fileType{icon}.
|
||||
'&did='.$download{downloadId}).'"><img src="'.$file->getIcon.
|
||||
'" border=0 width=16 height=16 align="middle">'.
|
||||
$download{fileTitle}.' ('.$fileType{extension}.')</a>';
|
||||
$download{fileTitle}.' ('.$file->getType.')</a>';
|
||||
if ($download{alternateVersion1}) {
|
||||
%fileType = WebGUI::Attachment::getType($download{alternateVersion1});
|
||||
$alt1 = WebGUI::Attachment->new($download{alternateVersion1},
|
||||
$_[0], $download{downloadId});
|
||||
$row[$i] .= ' · <a href="'.WebGUI::URL::page('func=download&wid='.
|
||||
$_[0].'&did='.$download{downloadId}.'&alternateVersion=1')
|
||||
.'"><img src="'.$fileType{icon}.
|
||||
.'"><img src="'.$alt1->getIcon.
|
||||
'" border=0 width=16 height=16 align="middle">('.
|
||||
$fileType{extension}.')</a>';
|
||||
$alt1->getType.')</a>';
|
||||
}
|
||||
if ($download{alternateVersion2}) {
|
||||
%fileType = WebGUI::Attachment::getType($download{alternateVersion2});
|
||||
$alt2 = WebGUI::Attachment->new($download{alternateVersion2},
|
||||
$_[0], $download{downloadId});
|
||||
$row[$i] .= ' · <a href="'.WebGUI::URL::page('func=download&wid='.
|
||||
$_[0].'&did='.$download{downloadId}.'&alternateVersion=2')
|
||||
.'"><img src="'.$fileType{icon}.
|
||||
.'"><img src="'.$alt2->getIcon.
|
||||
'" border=0 width=16 height=16 align="middle">('.
|
||||
$fileType{extension}.')</a>';
|
||||
$alt2->getType.')</a>';
|
||||
}
|
||||
$row[$i] .= '</td><td class="tableData" valign="top">'.$download{briefSynopsis}.'</td>'.
|
||||
$row[$i] .= '</td><td class="tableData" valign="top">';
|
||||
if ($data{displayThumbnails}
|
||||
&& isIn($file->getType, qw(gif jpeg jpg tif tiff png bmp))) {
|
||||
$row[$i] .= '<img src="'.$file->getThumbnail.
|
||||
'" border=0 align="middle" hspace="3">';
|
||||
}
|
||||
$row[$i] .= $download{briefSynopsis}.'</td>'.
|
||||
'<td class="tableData" valign="top">'.
|
||||
epochToHuman($download{dateUploaded},"%M/%D/%y").'</td>'.
|
||||
'</tr>';
|
||||
|
|
@ -597,10 +632,10 @@ sub www_view {
|
|||
$output .= '<tr><td class="tableData" colspan="3">'.
|
||||
WebGUI::International::get(19,$namespace).'</td></tr>';
|
||||
}
|
||||
($dataRows, $prevNextBar) = paginate($data{paginateAfter},$url,\@row);
|
||||
$output .= $dataRows;
|
||||
$p = WebGUI::Paginator->new($url,\@row,$data{paginateAfter});
|
||||
$output .= $p->getPage($session{form}{pn});
|
||||
$output .= '</table>';
|
||||
$output .= $prevNextBar;
|
||||
$output .= $p->getBarTraditional($session{form}{pn});
|
||||
if ($data{processMacros} == 1) {
|
||||
$output = WebGUI::Macro::process($output);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ use Tie::CPHash;
|
|||
use WebGUI::DateTime;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Paginator;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Shortcut;
|
||||
|
|
@ -304,13 +305,14 @@ sub www_edit {
|
|||
$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");
|
||||
$sth = WebGUI::SQL->read("select eventId, name, recurringEventId, startDate from EventsCalendar_event where widgetId='$session{form}{wid}' order by startDate");
|
||||
while (@event = $sth->array) {
|
||||
$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>';
|
||||
$session{setting}{lib}.'/delete.gif" border=0></a></td><td>'.
|
||||
epochToHuman($event[3],'%m/%d/%y').'</td><td>'.$event[1].'</td></td>';
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= '</table>';
|
||||
|
|
@ -373,7 +375,7 @@ sub www_editEventSave {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my (%data, %event, $dataRows, $prevNextBar, $output, $sth, $flag, %previous, $junk,
|
||||
my (%data, %event, $p, $output, $sth, $flag, %previous, $junk,
|
||||
@row, $i, $maxDate, $minDate, $nextDate, $first, $last);
|
||||
tie %data, 'Tie::CPHash';
|
||||
tie %event, 'Tie::CPHash';
|
||||
|
|
@ -401,8 +403,10 @@ sub www_view {
|
|||
$i++;
|
||||
$nextDate = addToDate($nextDate,0,1,0);
|
||||
}
|
||||
($dataRows, $prevNextBar) = paginate(1,WebGUI::URL::page(),\@row);
|
||||
$output .= $prevNextBar.$dataRows.$prevNextBar;
|
||||
$p = WebGUI::Paginator->new(WebGUI::URL::page(),\@row,1);
|
||||
$output .= $p->getBar($session{form}{pn}).
|
||||
$p->getPage($session{form}{pn}).
|
||||
$p->getBarTraditional($session{form}{pn});
|
||||
$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");
|
||||
|
|
@ -434,8 +438,8 @@ sub www_view {
|
|||
$i++;
|
||||
}
|
||||
$sth->finish;
|
||||
($dataRows, $prevNextBar) = paginate($data{paginateAfter},WebGUI::URL::page(),\@row);
|
||||
$output .= $dataRows.$prevNextBar;
|
||||
$p = WebGUI::Paginator->new(WebGUI::URL::page(),\@row,$data{paginateAfter});
|
||||
$output .= $p->getPage($session{form}{pn}).$p->getBarSimple($session{form}{pn});
|
||||
}
|
||||
if ($data{processMacros}) {
|
||||
$output = WebGUI::Macro::process($output);
|
||||
|
|
|
|||
|
|
@ -26,13 +26,14 @@ use WebGUI::Widget;
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub duplicate {
|
||||
my (%data, $newWidgetId, $pageId);
|
||||
my (%data, $newWidgetId, $pageId, $file);
|
||||
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::Attachment::copy($data{attachment},$_[0],$newWidgetId);
|
||||
$file = WebGUI::Attachment->new($data{attachment},$_[0]);
|
||||
$file->copy($newWidgetId);
|
||||
WebGUI::SQL->write("insert into Item values ($newWidgetId, ".
|
||||
quote($data{description}).", ".quote($data{linkURL}).", ".quote($data{attachment}).")");
|
||||
}
|
||||
|
|
@ -79,7 +80,8 @@ sub www_addSave {
|
|||
my ($widgetId, $attachment);
|
||||
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});
|
||||
$attachment = WebGUI::Attachment::save("attachment",$widgetId);
|
||||
$attachment = WebGUI::Attachment->new("",$widgetId);
|
||||
$attachment->save("attachment");
|
||||
WebGUI::SQL->write("insert into Item values ($widgetId, ".quote($session{form}{description}).", ".quote($session{form}{linkURL}).", ".quote($attachment).")");
|
||||
return "";
|
||||
} else {
|
||||
|
|
@ -149,14 +151,17 @@ sub www_edit {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editSave {
|
||||
my ($attachment);
|
||||
my ($attachment, $sqlAdd);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
update();
|
||||
$attachment = WebGUI::Attachment::save("attachment",$session{form}{wid});
|
||||
if ($attachment ne "") {
|
||||
$attachment = ', attachment='.quote($attachment);
|
||||
$attachment = WebGUI::Attachment->new("",$session{form}{wid});
|
||||
$attachment->save("attachment");
|
||||
if ($attachment->getFilename ne "") {
|
||||
$sqlAdd = ', attachment='.quote($attachment->getFilename);
|
||||
}
|
||||
WebGUI::SQL->write("update Item set description=".quote($session{form}{description}).", linkURL=".quote($session{form}{linkURL}).$attachment." where widgetId=$session{form}{wid}");
|
||||
WebGUI::SQL->write("update Item set description=".quote($session{form}{description}).
|
||||
", linkURL=".quote($session{form}{linkURL}).
|
||||
$sqlAdd." where widgetId=$session{form}{wid}");
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -165,7 +170,7 @@ sub www_editSave {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my (%data, @test, $output, %fileType);
|
||||
my (%data, @test, $output, $file);
|
||||
tie %data, 'Tie::CPHash';
|
||||
%data = getProperties($namespace,$_[0]);
|
||||
if (defined %data) {
|
||||
|
|
@ -175,9 +180,8 @@ sub www_view {
|
|||
$output .= '<span class="itemTitle">'.$data{title}.'</span>';
|
||||
}
|
||||
if ($data{attachment} ne "") {
|
||||
%fileType = WebGUI::Attachment::getType($data{attachment});
|
||||
$output .= ' - <a href="'.$session{setting}{attachmentDirectoryWeb}.'/'.$_[0].'/'.
|
||||
$data{attachment}.'"><img src="'.$fileType{icon}.'" border=0 alt="'.
|
||||
$file = WebGUI::Attachment->new($data{attachment},$_[0]);
|
||||
$output .= ' - <a href="'.$file->getURL.'"><img src="'.$file->getIcon.'" border=0 alt="'.
|
||||
$data{attachment}.'" width=16 height=16 border=0 align="middle"></a>';
|
||||
}
|
||||
if ($data{description} ne "") {
|
||||
|
|
@ -193,7 +197,5 @@ sub www_view {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ use strict;
|
|||
use WebGUI::ErrorHandler;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Paginator;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Shortcut;
|
||||
|
|
@ -187,7 +188,7 @@ sub www_editSave {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my (@row, $i, $dataRows, $prevNextBar, $ouch, %data, $output, $sth, $dbh, @result,
|
||||
my (@row, $i, $p, $ouch, %data, $output, $sth, $dbh, @result,
|
||||
@template, $temp, $col);
|
||||
tie %data, 'Tie::CPHash';
|
||||
%data = getProperties($namespace,$_[0]);
|
||||
|
|
@ -239,10 +240,10 @@ sub www_view {
|
|||
$i++;
|
||||
}
|
||||
$sth->finish;
|
||||
($dataRows, $prevNextBar) = paginate($data{paginateAfter},WebGUI::URL::page(),\@row);
|
||||
$output .= $dataRows;
|
||||
$p = WebGUI::Paginator->new(WebGUI::URL::page(),\@row,$data{paginateAfter});
|
||||
$output .= $p->getPage($session{form}{pn});
|
||||
$output .= $template[2];
|
||||
$output .= $prevNextBar;
|
||||
$output .= $p->getBar($session{form}{pn});
|
||||
} 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::International;
|
|||
use WebGUI::Macro;
|
||||
use WebGUI::MessageLog;
|
||||
use WebGUI::Operation;
|
||||
use WebGUI::Paginator;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Shortcut;
|
||||
|
|
@ -30,17 +31,21 @@ use WebGUI::Widget;
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub duplicate {
|
||||
my ($sth, %data, $newWidgetId, @row, $newSubmissionId, $pageId);
|
||||
my ($sth, $file, %data, $newWidgetId, @row, $newSubmissionId, $pageId);
|
||||
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 UserSubmission values ($newWidgetId, $data{groupToContribute}, '$data{submissionsPerPage}', '$data{defaultStatus}', $data{groupToApprove})");
|
||||
$sth = WebGUI::SQL->read("select * from UserSubmission_submission where widgetId=$_[0]");
|
||||
while (@row = $sth->array) {
|
||||
$newSubmissionId = getNextId("submissionId");
|
||||
WebGUI::Attachment::copy($row[8],$_[0],$newWidgetId,$row[1],$newSubmissionId);
|
||||
WebGUI::SQL->write("insert into UserSubmission_submission values ($newWidgetId, $newSubmissionId, ".quote($row[2]).", $row[3], ".quote($row[4]).", '$row[5]', ".quote($row[6]).", ".quote($row[7]).", ".quote($row[8]).", '$row[9]', '$row[10]')");
|
||||
$file = WebGUI::Attachment->new($row[8],$_[0],$row[1]);
|
||||
$file->copy($newWidgetId,$newSubmissionId);
|
||||
WebGUI::SQL->write("insert into UserSubmission_submission values ($newWidgetId, $newSubmissionId, ".
|
||||
quote($row[2]).", $row[3], ".quote($row[4]).", '$row[5]', ".quote($row[6]).", ".
|
||||
quote($row[7]).", ".quote($row[8]).", '$row[9]', '$row[10]')");
|
||||
}
|
||||
$sth->finish;
|
||||
}
|
||||
|
|
@ -93,7 +98,9 @@ sub www_add {
|
|||
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});
|
||||
$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 UserSubmission values ($widgetId, $session{form}{groupToContribute}, '$session{form}{submissionsPerPage}', '$session{form}{defaultStatus}', $session{form}{groupToApprove})");
|
||||
return "";
|
||||
} else {
|
||||
|
|
@ -146,14 +153,21 @@ sub www_addSubmissionSave {
|
|||
%userSubmission = getProperties($namespace,$session{form}{wid});
|
||||
if (WebGUI::Privilege::isInGroup($userSubmission{groupToContribute},$session{user}{userId})) {
|
||||
$submissionId = getNextId("submissionId");
|
||||
$image = WebGUI::Attachment::save("image",$session{form}{wid},$submissionId);
|
||||
$attachment = WebGUI::Attachment::save("attachment",$session{form}{wid},$submissionId);
|
||||
$image = WebGUI::Attachment->new("",$session{form}{wid},$submissionId);
|
||||
$image->save("image");
|
||||
$attachment = WebGUI::Attachment->new("",$session{form}{wid},$submissionId);
|
||||
$attachment->save("attachment");
|
||||
if ($session{form}{title} ne "") {
|
||||
$title = $session{form}{title};
|
||||
} else {
|
||||
$title = WebGUI::International::get(16,$namespace);
|
||||
}
|
||||
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}')");
|
||||
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->getFilename).", ".
|
||||
quote($attachment->getFilename).
|
||||
", '$userSubmission{defaultStatus}', '$session{form}{convertCarriageReturns}')");
|
||||
if ($userSubmission{defaultStatus} ne "Approved") {
|
||||
WebGUI::MessageLog::addEntry('',$userSubmission{groupToApprove},
|
||||
WebGUI::URL::page('func=viewSubmission&wid='.$session{form}{wid}.
|
||||
|
|
@ -233,10 +247,12 @@ sub www_deleteSubmission {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteSubmissionConfirm {
|
||||
my ($output, $owner);
|
||||
my ($output, $owner, $file);
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}");
|
||||
if ($owner == $session{user}{userId}) {
|
||||
WebGUI::SQL->write("delete from UserSubmission_submission where submissionId=$session{form}{sid}");
|
||||
$file = WebGUI::Attachment->new("",$session{form}{wid},$session{form}{sid});
|
||||
$file->deleteNode;
|
||||
return www_addSubmission();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -347,24 +363,29 @@ sub www_editSubmission {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editSubmissionSave {
|
||||
my ($owner,%userSubmission,$image,$attachment,$title);
|
||||
my ($sqlAdd,$owner,%userSubmission,$image,$attachment,$title);
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}");
|
||||
if ($owner == $session{user}{userId}) {
|
||||
%userSubmission = getProperties($namespace,$session{form}{wid});
|
||||
$image = WebGUI::Attachment::save("image",$session{form}{wid},$session{form}{sid});
|
||||
if ($image ne "") {
|
||||
$image = 'image='.quote($image).', ';
|
||||
$image = WebGUI::Attachment->new("",$session{form}{wid},$session{form}{sid});
|
||||
$image->save("image");
|
||||
if ($image->getFilename ne "") {
|
||||
$sqlAdd = 'image='.quote($image->getFilename).', ';
|
||||
}
|
||||
$attachment = WebGUI::Attachment::save("attachment",$session{form}{wid},$session{form}{sid});
|
||||
if ($attachment ne "") {
|
||||
$attachment = 'attachment='.quote($attachment).', ';
|
||||
$attachment = WebGUI::Attachment->new("",$session{form}{wid},$session{form}{sid});
|
||||
$attachment->save("attachment");
|
||||
if ($attachment->getFilename ne "") {
|
||||
$sqlAdd .= 'attachment='.quote($attachment->getFilename).', ';
|
||||
}
|
||||
if ($session{form}{title} ne "") {
|
||||
$title = $session{form}{title};
|
||||
} else {
|
||||
$title = WebGUI::International::get(16,$namespace);
|
||||
}
|
||||
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}");
|
||||
WebGUI::SQL->write("update UserSubmission_submission set dateSubmitted=".time().
|
||||
", convertCarriageReturns='$session{form}{convertCarriageReturns}', title=".quote($title).
|
||||
", content=".quote($session{form}{content}).", ".$sqlAdd.
|
||||
" status='$userSubmission{defaultStatus}' where submissionId=$session{form}{sid}");
|
||||
if ($userSubmission{defaultStatus} ne "Approved") {
|
||||
WebGUI::MessageLog::addEntry('',$userSubmission{groupToApprove},
|
||||
WebGUI::URL::page('func=viewSubmission&wid='.$session{form}{wid}.'&sid='.
|
||||
|
|
@ -378,7 +399,7 @@ sub www_editSubmissionSave {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my (%data, @submission, $output, $sth, @row, $i, $dataRows, $prevNextBar);
|
||||
my (%data, @submission, $output, $sth, @row, $i, $p);
|
||||
tie %data, 'Tie::CPHash';
|
||||
%data = getProperties($namespace,$_[0]);
|
||||
if (%data) {
|
||||
|
|
@ -404,19 +425,21 @@ sub www_view {
|
|||
$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);
|
||||
$p = WebGUI::Paginator->new(WebGUI::URL::page(),\@row,$data{submissionsPerPage});
|
||||
$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;
|
||||
$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 .= $p->getPage($session{form}{pn});
|
||||
$output .= '</table>';
|
||||
$output .= $prevNextBar;
|
||||
$output .= $p->getBarTraditional($session{form}{pn});
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_viewSubmission {
|
||||
my ($output, %submission);
|
||||
my ($output, %submission, $file);
|
||||
tie %submission, 'Tie::CPHash';
|
||||
%submission = WebGUI::SQL->quickHash("select * from UserSubmission_submission where submissionId=$session{form}{sid}");
|
||||
$output = "<h1>".$submission{title}."</h1>";
|
||||
|
|
@ -448,7 +471,8 @@ sub www_viewSubmission {
|
|||
$output .= '</td</tr><tr><td class="tableData">';
|
||||
#---content
|
||||
if ($submission{image} ne "") {
|
||||
$output .= '<img src="'.$session{setting}{attachmentDirectoryWeb}.'/'.$session{form}{wid}.'/'.$session{form}{sid}.'/'.$submission{image}.'" hspace=3 align="right">';
|
||||
$file = WebGUI::Attachment->new($submission{filename},$session{form}{wid},$session{form}{sid});
|
||||
$output .= '<img src="'.$file->getURL.'" hspace=3 align="right">';
|
||||
}
|
||||
if ($submission{convertCarriageReturns}) {
|
||||
$submission{content} =~ s/\n/\<br\>/g;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue