Changed so that new additions are added to the top of the list.

This commit is contained in:
JT Smith 2002-05-26 03:31:23 +00:00
parent d762f9eb9d
commit ea23644278
2 changed files with 5 additions and 6 deletions

View file

@ -278,13 +278,13 @@ sub www_editDownload {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_editDownloadSave { sub www_editDownloadSave {
my ($file, $alt1, $alt2, $sqlAdd, $seq); my ($file, $alt1, $alt2, $sqlAdd);
if (WebGUI::Privilege::canEditPage()) { if (WebGUI::Privilege::canEditPage()) {
if ($session{form}{did} eq "new") { if ($session{form}{did} eq "new") {
$session{form}{did} = getNextId("downloadId"); $session{form}{did} = getNextId("downloadId");
($seq) = WebGUI::SQL->quickArray("select max(sequenceNumber) from DownloadManager_file where wobjectId=".$_[0]->get("wobjectId"));
WebGUI::SQL->write("insert into DownloadManager_file (wobjectId,downloadId,sequenceNumber) WebGUI::SQL->write("insert into DownloadManager_file (wobjectId,downloadId,sequenceNumber)
values (".$_[0]->get("wobjectId").",$session{form}{did},".($seq+1).")"); values (".$_[0]->get("wobjectId").",$session{form}{did},-1)");
_reorderDownloads($_[0]->get("wobjectId"));
} }
$file = WebGUI::Attachment->new("",$session{form}{wid},$session{form}{did}); $file = WebGUI::Attachment->new("",$session{form}{wid},$session{form}{did});
$file->save("downloadFile"); $file->save("downloadFile");

View file

@ -192,13 +192,12 @@ sub www_editLink {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_editLinkSave { sub www_editLinkSave {
my ($seq);
if (WebGUI::Privilege::canEditPage()) { if (WebGUI::Privilege::canEditPage()) {
if ($session{form}{lid} eq "new") { if ($session{form}{lid} eq "new") {
($seq) = WebGUI::SQL->quickArray("select max(sequenceNumber) from LinkList_link where wobjectId=".$_[0]->get("wobjectId"));
$session{form}{lid} = getNextId("linkId"); $session{form}{lid} = getNextId("linkId");
WebGUI::SQL->write("insert into LinkList_link (wobjectId,linkId,sequenceNumber) values (".$_[0]->get("wobjectId") WebGUI::SQL->write("insert into LinkList_link (wobjectId,linkId,sequenceNumber) values (".$_[0]->get("wobjectId")
.",$session{form}{lid},".($seq+1).")"); .",$session{form}{lid},-1)");
_reorderLinks($_[0]->get("wobjectId"));
} }
WebGUI::SQL->write("update LinkList_link set name=".quote($session{form}{name}).", WebGUI::SQL->write("update LinkList_link set name=".quote($session{form}{name}).",
url=".quote($session{form}{url}).",description=".quote($session{form}{description}).", url=".quote($session{form}{url}).",description=".quote($session{form}{description}).",