From: Alexander Ebert Date: Tue, 28 Jun 2016 10:15:03 +0000 (+0200) Subject: Using generic name fro user-created cronjobs X-Git-Tag: 3.0.0_Beta_1~1337 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=deb235cdd8bfc31533ba1616249c30328247fff2;p=GitHub%2FWoltLab%2FWCF.git Using generic name fro user-created cronjobs --- diff --git a/wcfsetup/install/files/lib/acp/form/CronjobAddForm.class.php b/wcfsetup/install/files/lib/acp/form/CronjobAddForm.class.php index c0941b1753..530213ee21 100755 --- a/wcfsetup/install/files/lib/acp/form/CronjobAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/CronjobAddForm.class.php @@ -1,5 +1,6 @@ additionalFields, [ 'className' => $this->className, 'packageID' => $this->packageID, + 'cronjobName' => 'com.woltlab.wcf.cronjob', 'description' => $this->description, 'startMinute' => $this->startMinute, 'startHour' => $this->startHour, @@ -161,20 +163,23 @@ class CronjobAddForm extends AbstractForm { ]); $this->objectAction = new CronjobAction([], 'create', ['data' => $data]); - $this->objectAction->executeAction(); + /** @var Cronjob $cronjob */ + $cronjob = $this->objectAction->executeAction()['returnValues']; + $cronjobID = $cronjob->cronjobID; + + // update `cronjobName` + $data = ['cronjobName' => 'com.woltlab.wcf.cronjob' . $cronjobID]; if (!I18nHandler::getInstance()->isPlainValue('description')) { - $returnValues = $this->objectAction->getReturnValues(); - $cronjobID = $returnValues['returnValues']->cronjobID; I18nHandler::getInstance()->save('description', 'wcf.acp.cronjob.description.cronjob'.$cronjobID, 'wcf.acp.cronjob', $this->packageID); // update group name - $cronjobEditor = new CronjobEditor($returnValues['returnValues']); - $cronjobEditor->update([ - 'description' => 'wcf.acp.cronjob.description.cronjob'.$cronjobID - ]); + $data['description'] = 'wcf.acp.cronjob.description.cronjob' . $cronjobID; } + $cronjobEditor = new CronjobEditor($cronjob); + $cronjobEditor->update($data); + $this->saved(); // reset values