From 635dd8c454a13eea8dc9b943ec7a156628ab42c9 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 10 Feb 2012 17:30:52 +0100 Subject: [PATCH] Added AbstractForm::$objectAction Closes #364 --- .../install/files/lib/acp/form/CronjobAddForm.class.php | 4 ++-- .../install/files/lib/acp/form/CronjobEditForm.class.php | 4 ++-- wcfsetup/install/files/lib/acp/form/OptionForm.class.php | 4 ++-- .../install/files/lib/acp/form/OptionImportForm.class.php | 4 ++-- .../files/lib/acp/form/UpdateServerAddForm.class.php | 4 ++-- .../files/lib/acp/form/UpdateServerEditForm.class.php | 4 ++-- wcfsetup/install/files/lib/acp/form/UserAddForm.class.php | 4 ++-- wcfsetup/install/files/lib/acp/form/UserEditForm.class.php | 4 ++-- .../install/files/lib/acp/form/UserGroupAddForm.class.php | 4 ++-- .../install/files/lib/acp/form/UserGroupEditForm.class.php | 4 ++-- wcfsetup/install/files/lib/form/AbstractForm.class.php | 6 ++++++ 11 files changed, 26 insertions(+), 20 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/form/CronjobAddForm.class.php b/wcfsetup/install/files/lib/acp/form/CronjobAddForm.class.php index 4365a21493..33ee536e7e 100755 --- a/wcfsetup/install/files/lib/acp/form/CronjobAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/CronjobAddForm.class.php @@ -144,8 +144,8 @@ class CronjobAddForm extends ACPForm { 'startDow' => $this->startDow ); - $cronjobAction = new CronjobAction(array(), 'create', array('data' => $data)); - $cronjobAction->executeAction(); + $this->objectAction = new CronjobAction(array(), 'create', array('data' => $data)); + $this->objectAction->executeAction(); $this->saved(); // reset values diff --git a/wcfsetup/install/files/lib/acp/form/CronjobEditForm.class.php b/wcfsetup/install/files/lib/acp/form/CronjobEditForm.class.php index 82b5d5ae71..357d5a31fc 100755 --- a/wcfsetup/install/files/lib/acp/form/CronjobEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/CronjobEditForm.class.php @@ -70,8 +70,8 @@ class CronjobEditForm extends CronjobAddForm { 'startDow' => $this->startDow ); - $cronjobAction = new CronjobAction(array($this->cronjobID), 'update', array('data' => $data)); - $cronjobAction->executeAction(); + $this->objectAction = new CronjobAction(array($this->cronjobID), 'update', array('data' => $data)); + $this->objectAction->executeAction(); $this->saved(); diff --git a/wcfsetup/install/files/lib/acp/form/OptionForm.class.php b/wcfsetup/install/files/lib/acp/form/OptionForm.class.php index 26573557bd..96affb7ab5 100644 --- a/wcfsetup/install/files/lib/acp/form/OptionForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/OptionForm.class.php @@ -85,8 +85,8 @@ class OptionForm extends AbstractOptionListForm { // save options $saveOptions = $this->optionHandler->save('wcf.acp.option', 'wcf.acp.option.option'); - $optionAction = new OptionAction(array(), 'updateAll', array('data' => $saveOptions)); - $optionAction->executeAction(); + $this->objectAction = new OptionAction(array(), 'updateAll', array('data' => $saveOptions)); + $this->objectAction->executeAction(); $this->saved(); // show succes message diff --git a/wcfsetup/install/files/lib/acp/form/OptionImportForm.class.php b/wcfsetup/install/files/lib/acp/form/OptionImportForm.class.php index 9127e8cc04..4dab16fe83 100755 --- a/wcfsetup/install/files/lib/acp/form/OptionImportForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/OptionImportForm.class.php @@ -103,8 +103,8 @@ class OptionImportForm extends ACPForm { parent::save(); // save - $optionAction = new OptionAction(array(), 'import', array('data' => $this->options)); - $optionAction->executeAction(); + $this->objectAction = new OptionAction(array(), 'import', array('data' => $this->options)); + $this->objectAction->executeAction(); $this->saved(); // show success message diff --git a/wcfsetup/install/files/lib/acp/form/UpdateServerAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UpdateServerAddForm.class.php index abc5378ec2..068f6303b1 100755 --- a/wcfsetup/install/files/lib/acp/form/UpdateServerAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UpdateServerAddForm.class.php @@ -84,12 +84,12 @@ class UpdateServerAddForm extends ACPForm { parent::save(); // save server - $updateServerAction = new PackageUpdateServerAction(array(), 'create', array('data' => array( + $this->objectAction = new PackageUpdateServerAction(array(), 'create', array('data' => array( 'serverURL' => $this->serverURL, 'loginUsername' => $this->loginUsername, 'loginPassword' => $this->loginPassword ))); - $updateServer = $updateServerAction->executeAction(); + $this->objectAction->executeAction(); $this->saved(); // reset values diff --git a/wcfsetup/install/files/lib/acp/form/UpdateServerEditForm.class.php b/wcfsetup/install/files/lib/acp/form/UpdateServerEditForm.class.php index 2992788b44..b223047931 100755 --- a/wcfsetup/install/files/lib/acp/form/UpdateServerEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UpdateServerEditForm.class.php @@ -54,12 +54,12 @@ class UpdateServerEditForm extends UpdateServerAddForm { AbstractForm::save(); // save server - $updateServerAction = new PackageUpdateServerAction(array($this->packageUpdateServerID), 'update', array('data' => array( + $this->objectAction = new PackageUpdateServerAction(array($this->packageUpdateServerID), 'update', array('data' => array( 'serverURL' => $this->serverURL, 'loginUsername' => $this->loginUsername, 'loginPassword' => $this->loginPassword ))); - $updateServerAction->executeAction(); + $this->objectAction->executeAction(); $this->saved(); // show success message diff --git a/wcfsetup/install/files/lib/acp/form/UserAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserAddForm.class.php index 37c1a88ddd..f5f08ba545 100644 --- a/wcfsetup/install/files/lib/acp/form/UserAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserAddForm.class.php @@ -196,8 +196,8 @@ class UserAddForm extends UserOptionListForm { 'languages' => $this->visibleLanguages, 'options' => $saveOptions ); - $userAction = new UserAction(array(), 'create', $data); - $userAction->executeAction(); + $this->objectAction = new UserAction(array(), 'create', $data); + $this->objectAction->executeAction(); $this->saved(); // show empty add form diff --git a/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php b/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php index af547510f9..eb9f95f8fd 100755 --- a/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php @@ -167,8 +167,8 @@ class UserEditForm extends UserAddForm { 'languages' => $this->visibleLanguages, 'options' => $saveOptions ); - $userAction = new UserAction(array($this->userID), 'update', $data); - $userAction->executeAction(); + $this->objectAction = new UserAction(array($this->userID), 'update', $data); + $this->objectAction->executeAction(); $this->saved(); diff --git a/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php index e4a6064d5b..332ac6b8cc 100755 --- a/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php @@ -155,8 +155,8 @@ class UserGroupAddForm extends AbstractOptionListForm { 'data' => array_merge($this->additionalFields, array('groupName' => $this->groupName)), 'options' => $saveOptions ); - $groupAction = new UserGroupAction(array(), 'create', $data); - $groupAction->executeAction(); + $this->objectAction = new UserGroupAction(array(), 'create', $data); + $this->objectAction->executeAction(); if (!I18nHandler::getInstance()->isPlainValue('groupName')) { $returnValues = $groupAction->getReturnValues(); diff --git a/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php b/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php index 5dfc11905d..ef3fff415e 100755 --- a/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php @@ -150,8 +150,8 @@ class UserGroupEditForm extends UserGroupAddForm { 'data' => array_merge(array('groupName' => $this->groupName), $this->additionalFields), 'options' => $saveOptions ); - $groupAction = new UserGroupAction(array($this->groupID), 'update', $data); - $groupAction->executeAction(); + $this->objectAction = new UserGroupAction(array($this->groupID), 'update', $data); + $this->objectAction->executeAction(); $this->saved(); // show success message diff --git a/wcfsetup/install/files/lib/form/AbstractForm.class.php b/wcfsetup/install/files/lib/form/AbstractForm.class.php index b3d566c97d..092c12ba28 100644 --- a/wcfsetup/install/files/lib/form/AbstractForm.class.php +++ b/wcfsetup/install/files/lib/form/AbstractForm.class.php @@ -29,6 +29,12 @@ abstract class AbstractForm extends AbstractPage implements IForm { */ public $errorType = ''; + /** + * database object action + * @var wcf\data\AbstractDatabaseObjectAction + */ + public $objectAction = null; + /** * @see wcf\form\IForm::submit() */ -- 2.20.1