Made some efficiency improvements in wobject save.
This commit is contained in:
parent
8cf465c3e6
commit
c65c92ebf5
17 changed files with 25 additions and 38 deletions
|
|
@ -995,7 +995,8 @@ sub www_editSave {
|
||||||
groupToPost=>$session{form}{groupToPost},
|
groupToPost=>$session{form}{groupToPost},
|
||||||
groupToModerate=>$session{form}{groupToModerate},
|
groupToModerate=>$session{form}{groupToModerate},
|
||||||
editTimeout=>$session{form}{editTimeout},
|
editTimeout=>$session{form}{editTimeout},
|
||||||
moderationType=>$session{form}{moderationType}
|
moderationType=>$session{form}{moderationType},
|
||||||
|
%{$_[1]}
|
||||||
});
|
});
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ sub www_edit {
|
||||||
sub www_editSave {
|
sub www_editSave {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
my ($image, $attachment, %property);
|
my ($image, $attachment, %property);
|
||||||
$_[0]->SUPER::www_editSave();
|
$_[0]->SUPER::www_editSave() if ($_[0]->get("wobjectId") eq "new");
|
||||||
$image = WebGUI::Attachment->new("",$_[0]->get("wobjectId"));
|
$image = WebGUI::Attachment->new("",$_[0]->get("wobjectId"));
|
||||||
$image->save("image");
|
$image->save("image");
|
||||||
$attachment = WebGUI::Attachment->new("",$_[0]->get("wobjectId"));
|
$attachment = WebGUI::Attachment->new("",$_[0]->get("wobjectId"));
|
||||||
|
|
@ -134,7 +134,7 @@ sub www_editSave {
|
||||||
$property{linkTitle} = $session{form}{linkTitle};
|
$property{linkTitle} = $session{form}{linkTitle};
|
||||||
$property{linkURL} = $session{form}{linkURL};
|
$property{linkURL} = $session{form}{linkURL};
|
||||||
$property{allowDiscussion} = $session{form}{allowDiscussion};
|
$property{allowDiscussion} = $session{form}{allowDiscussion};
|
||||||
$_[0]->set(\%property);
|
$_[0]->SUPER::www_editSave(\%property);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -170,8 +170,7 @@ sub www_edit {
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_editSave {
|
sub www_editSave {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
$_[0]->SUPER::www_editSave();
|
$_[0]->SUPER::www_editSave({
|
||||||
$_[0]->set({
|
|
||||||
calendarLayout=>$session{form}{calendarLayout},
|
calendarLayout=>$session{form}{calendarLayout},
|
||||||
paginateAfter=>$session{form}{paginateAfter}
|
paginateAfter=>$session{form}{paginateAfter}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,7 @@ sub www_edit {
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_editSave {
|
sub www_editSave {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
$_[0]->SUPER::www_editSave();
|
$_[0]->SUPER::www_editSave({
|
||||||
$_[0]->set({
|
|
||||||
spacer=>$session{form}{spacer},
|
spacer=>$session{form}{spacer},
|
||||||
width=>$session{form}{width},
|
width=>$session{form}{width},
|
||||||
class=>$session{form}{class}
|
class=>$session{form}{class}
|
||||||
|
|
|
||||||
|
|
@ -103,11 +103,10 @@ sub www_edit {
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_editSave {
|
sub www_editSave {
|
||||||
if (WebGUI::Privilege::canEditPage()) {
|
if (WebGUI::Privilege::canEditPage()) {
|
||||||
$_[0]->SUPER::www_editSave();
|
$_[0]->SUPER::www_editSave({
|
||||||
$_[0]->set({
|
tocOn=>$session{form}{tocOn},
|
||||||
tocOn=>$session{form}{tocOn},
|
topOn=>$session{form}{topOn},
|
||||||
topOn=>$session{form}{topOn},
|
qaOn=>$session{form}{qaOn}
|
||||||
qaOn=>$session{form}{qaOn}
|
|
||||||
});
|
});
|
||||||
if ($session{form}{proceed}) {
|
if ($session{form}{proceed}) {
|
||||||
$_[0]->www_editQuestion();
|
$_[0]->www_editQuestion();
|
||||||
|
|
|
||||||
|
|
@ -166,8 +166,7 @@ sub www_edit {
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_editSave {
|
sub www_editSave {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
$_[0]->SUPER::www_editSave();
|
$_[0]->SUPER::www_editSave({
|
||||||
$_[0]->set({
|
|
||||||
paginateAfter=>$session{form}{paginateAfter},
|
paginateAfter=>$session{form}{paginateAfter},
|
||||||
displayThumbnails=>$session{form}{displayThumbnails}
|
displayThumbnails=>$session{form}{displayThumbnails}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -62,12 +62,12 @@ sub www_edit {
|
||||||
sub www_editSave {
|
sub www_editSave {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
my ($attachment, $property);
|
my ($attachment, $property);
|
||||||
$_[0]->SUPER::www_editSave();
|
$_[0]->SUPER::www_editSave() if ($_[0]->get("wobjectId") eq "new");
|
||||||
$attachment = WebGUI::Attachment->new("",$_[0]->get("wobjectId"));
|
$attachment = WebGUI::Attachment->new("",$_[0]->get("wobjectId"));
|
||||||
$attachment->save("attachment");
|
$attachment->save("attachment");
|
||||||
$property->{linkURL} = $session{form}{linkURL};
|
$property->{linkURL} = $session{form}{linkURL};
|
||||||
$property->{attachment} = $attachment->getFilename if ($attachment->getFilename ne "");
|
$property->{attachment} = $attachment->getFilename if ($attachment->getFilename ne "");
|
||||||
$_[0]->set($property);
|
$_[0]->SUPER::www_editSave($property);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,8 +96,7 @@ sub www_edit {
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_editSave {
|
sub www_editSave {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
$_[0]->SUPER::www_editSave();
|
$_[0]->SUPER::www_editSave({
|
||||||
$_[0]->set({
|
|
||||||
indent=>$session{form}{indent},
|
indent=>$session{form}{indent},
|
||||||
bullet=>$session{form}{bullet},
|
bullet=>$session{form}{bullet},
|
||||||
lineSpacing=>$session{form}{lineSpacing}
|
lineSpacing=>$session{form}{lineSpacing}
|
||||||
|
|
|
||||||
|
|
@ -153,11 +153,10 @@ sub www_edit {
|
||||||
sub www_editSave {
|
sub www_editSave {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
my ($property);
|
my ($property);
|
||||||
$_[0]->SUPER::www_editSave();
|
|
||||||
foreach my $field (@fields) {
|
foreach my $field (@fields) {
|
||||||
$property->{$field} = $session{form}{$field};
|
$property->{$field} = $session{form}{$field};
|
||||||
}
|
}
|
||||||
$_[0]->set($property);
|
$_[0]->SUPER::www_editSave($property);
|
||||||
if ($session{form}{proceed}) {
|
if ($session{form}{proceed}) {
|
||||||
return $_[0]->www_editField();
|
return $_[0]->www_editField();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,7 @@ sub www_edit {
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_editSave {
|
sub www_editSave {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
$_[0]->SUPER::www_editSave();
|
$_[0]->SUPER::www_editSave({
|
||||||
$_[0]->set({
|
|
||||||
messagesPerPage=>$session{form}{messagesPerPage}
|
messagesPerPage=>$session{form}{messagesPerPage}
|
||||||
});
|
});
|
||||||
return "";
|
return "";
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,6 @@ sub www_edit {
|
||||||
sub www_editSave {
|
sub www_editSave {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
my (@answer, $i, $property);
|
my (@answer, $i, $property);
|
||||||
$_[0]->SUPER::www_editSave();
|
|
||||||
@answer = split("\n",$session{form}{answers});
|
@answer = split("\n",$session{form}{answers});
|
||||||
for ($i=1; $i<=20; $i++) {
|
for ($i=1; $i<=20; $i++) {
|
||||||
$property->{'a'.$i} = $answer[($i-1)];
|
$property->{'a'.$i} = $answer[($i-1)];
|
||||||
|
|
@ -136,7 +135,7 @@ sub www_editSave {
|
||||||
$property->{graphWidth} = $session{form}{graphWidth};
|
$property->{graphWidth} = $session{form}{graphWidth};
|
||||||
$property->{active} = $session{form}{active};
|
$property->{active} = $session{form}{active};
|
||||||
$property->{question} = $session{form}{question};
|
$property->{question} = $session{form}{question};
|
||||||
$_[0]->set($property);
|
$_[0]->SUPER::www_editSave($property);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -333,7 +333,7 @@ sub www_edit {
|
||||||
sub www_editSave {
|
sub www_editSave {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
my ($file, %property);
|
my ($file, %property);
|
||||||
$_[0]->SUPER::www_editSave();
|
$_[0]->SUPER::www_editSave() if ($_[0]->get("wobjectId") eq "new");
|
||||||
$file = WebGUI::Attachment->new("",$_[0]->get("wobjectId"));
|
$file = WebGUI::Attachment->new("",$_[0]->get("wobjectId"));
|
||||||
$file->save("image1");
|
$file->save("image1");
|
||||||
$property{image1}=$file->getFilename("image1") if ($file->getFilename("image1") ne "");
|
$property{image1}=$file->getFilename("image1") if ($file->getFilename("image1") ne "");
|
||||||
|
|
@ -355,7 +355,7 @@ sub www_editSave {
|
||||||
$property{Product_templateId}=$session{form}{Product_templateId};
|
$property{Product_templateId}=$session{form}{Product_templateId};
|
||||||
$property{price}=$session{form}{price};
|
$property{price}=$session{form}{price};
|
||||||
$property{productNumber}=$session{form}{productNumber};
|
$property{productNumber}=$session{form}{productNumber};
|
||||||
$_[0]->set(\%property);
|
$_[0]->SUPER::www_editSave(\%property);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,9 +82,7 @@ sub www_edit {
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_editSave {
|
sub www_editSave {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
my ($wobjectId, $displayTitle, $image, $attachment);
|
$_[0]->SUPER::www_editSave({
|
||||||
$_[0]->SUPER::www_editSave();
|
|
||||||
$_[0]->set({
|
|
||||||
template=>$session{form}{template},
|
template=>$session{form}{template},
|
||||||
dbQuery=>$session{form}{dbQuery},
|
dbQuery=>$session{form}{dbQuery},
|
||||||
convertCarriageReturns=>$session{form}{convertCarriageReturns},
|
convertCarriageReturns=>$session{form}{convertCarriageReturns},
|
||||||
|
|
|
||||||
|
|
@ -100,14 +100,13 @@ sub www_edit {
|
||||||
sub www_editSave {
|
sub www_editSave {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
my ($property);
|
my ($property);
|
||||||
$_[0]->SUPER::www_editSave();
|
|
||||||
$property->{indent} = $session{form}{indent};
|
$property->{indent} = $session{form}{indent};
|
||||||
$property->{displaySynopsis} = $session{form}{displaySynopsis};
|
$property->{displaySynopsis} = $session{form}{displaySynopsis};
|
||||||
$property->{bullet} = $session{form}{bullet};
|
$property->{bullet} = $session{form}{bullet};
|
||||||
$property->{startAtThisLevel} = $session{form}{startAtThisLevel};
|
$property->{startAtThisLevel} = $session{form}{startAtThisLevel};
|
||||||
$property->{depth} = $session{form}{depth};
|
$property->{depth} = $session{form}{depth};
|
||||||
$property->{lineSpacing} = $session{form}{lineSpacing};
|
$property->{lineSpacing} = $session{form}{lineSpacing};
|
||||||
$_[0]->set($property);
|
$_[0]->SUPER::www_editSave($property);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,11 +71,10 @@ sub www_edit {
|
||||||
sub www_editSave {
|
sub www_editSave {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
my ($property);
|
my ($property);
|
||||||
$_[0]->SUPER::www_editSave();
|
|
||||||
$property->{rssUrl} = $session{form}{rssUrl};
|
$property->{rssUrl} = $session{form}{rssUrl};
|
||||||
$property->{content} = $session{form}{content} if ($session{form}{content} ne "");
|
$property->{content} = $session{form}{content} if ($session{form}{content} ne "");
|
||||||
$property->{lastFetched} = $session{form}{lastFetched} if ($session{form}{lastFetched} ne "");
|
$property->{lastFetched} = $session{form}{lastFetched} if ($session{form}{lastFetched} ne "");
|
||||||
$_[0]->set($property);
|
$_[0]->SUPER::www_editSave($property);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ use strict;
|
||||||
use Tie::CPHash;
|
use Tie::CPHash;
|
||||||
use WebGUI::Attachment;
|
use WebGUI::Attachment;
|
||||||
use WebGUI::DateTime;
|
use WebGUI::DateTime;
|
||||||
#use WebGUI::Discussion;
|
use WebGUI::Discussion;
|
||||||
use WebGUI::HTML;
|
use WebGUI::HTML;
|
||||||
use WebGUI::HTMLForm;
|
use WebGUI::HTMLForm;
|
||||||
use WebGUI::Icon;
|
use WebGUI::Icon;
|
||||||
|
|
@ -333,8 +333,7 @@ sub www_edit {
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_editSave {
|
sub www_editSave {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
$_[0]->SUPER::www_editSave();
|
$_[0]->SUPER::www_editSave({
|
||||||
$_[0]->set({
|
|
||||||
submissionsPerPage=>$session{form}{submissionsPerPage},
|
submissionsPerPage=>$session{form}{submissionsPerPage},
|
||||||
groupToContribute=>$session{form}{groupToContribute},
|
groupToContribute=>$session{form}{groupToContribute},
|
||||||
groupToApprove=>$session{form}{groupToApprove},
|
groupToApprove=>$session{form}{groupToApprove},
|
||||||
|
|
|
||||||
|
|
@ -87,8 +87,7 @@ sub www_edit {
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_editSave {
|
sub www_editSave {
|
||||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||||
$_[0]->SUPER::www_editSave();
|
$_[0]->SUPER::www_editSave({
|
||||||
$_[0]->set({
|
|
||||||
proxiedWobjectId=>$session{form}{proxiedWobjectId}
|
proxiedWobjectId=>$session{form}{proxiedWobjectId}
|
||||||
});
|
});
|
||||||
return "";
|
return "";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue