Moved all collateral reorder operations into the Wobject superclass.

This commit is contained in:
JT Smith 2002-09-30 04:52:28 +00:00
parent 82490a390f
commit d309be32f5
6 changed files with 40 additions and 117 deletions

View file

@ -29,17 +29,6 @@ our $name = WebGUI::International::get(1,$namespace);
our @fields = qw(width fromField fromStatus toField toStatus
ccField ccStatus bccField bccStatus subjectField subjectStatus acknowledgement storeEntries);
#-------------------------------------------------------------------
sub _reorderFields {
my ($sth, $i, $fid);
$sth = WebGUI::SQL->read("select mailFieldId from MailForm_field where wobjectId=$_[0] order by sequenceNumber");
while (($fid) = $sth->array) {
WebGUI::SQL->write("update MailForm_field set sequenceNumber='$i' where mailFieldId=$fid");
$i++;
}
$sth->finish;
}
#-------------------------------------------------------------------
sub duplicate {
my ($w, %data, $newFieldId, $sth);
@ -104,7 +93,7 @@ sub www_deleteFieldConfirm {
my ($output);
if (WebGUI::Privilege::canEditPage()) {
$_[0]->deleteCollateral("MailForm_field","mailFieldId",$session{form}{fid});
_reorderFields($_[0]->get("wobjectId"));
$_[0]->reorderCollateral("MailForm_field","mailFieldId");
return "";
} else {
return WebGUI::Privilege::insufficient();