Show package in cronjob list
authorMarcel Werk <burntime@woltlab.com>
Wed, 28 Feb 2024 16:16:37 +0000 (17:16 +0100)
committerMarcel Werk <burntime@woltlab.com>
Wed, 28 Feb 2024 16:16:37 +0000 (17:16 +0100)
wcfsetup/install/files/acp/templates/cronjobList.tpl
wcfsetup/install/files/lib/acp/page/CronjobListPage.class.php
wcfsetup/install/files/lib/data/cronjob/Cronjob.class.php

index acec19300f108212cc663b39e46d56e95e7ff68d..1a910d16fdd03f417fb3dd1133d75de62c28e348 100644 (file)
@@ -35,6 +35,7 @@
                                        <th class="columnID columnCronjobID{if $sortField == 'cronjobID'} active {@$sortOrder}{/if}" colspan="2"><a href="{link controller='CronjobList'}pageNo={@$pageNo}&sortField=cronjobID&sortOrder={if $sortField == 'cronjobID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.global.objectID{/lang}</a></th>
                                        <th class="columnText columnExpression"><span>{lang}wcf.acp.cronjob.expression{/lang}</span></th>
                                        <th class="columnText columnDescription{if $sortField == 'descriptionI18n'} active {@$sortOrder}{/if}"><a href="{link controller='CronjobList'}pageNo={@$pageNo}&sortField=descriptionI18n&sortOrder={if $sortField == 'descriptionI18n' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.cronjob.description{/lang}</a></th>
+                                       <th class="columnText columnPackage{if $sortField == 'packageID'} active {@$sortOrder}{/if}"><a href="{link controller='CronjobList'}pageNo={@$pageNo}&sortField=packageID&sortOrder={if $sortField == 'packageID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.package.name{/lang}</a></th>
                                        <th class="columnDate columnNextExec{if $sortField == 'nextExec'} active {@$sortOrder}{/if}"><a href="{link controller='CronjobList'}pageNo={@$pageNo}&sortField=nextExec&sortOrder={if $sortField == 'nextExec' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.cronjob.nextExec{/lang}</a></th>
                                        
                                        {event name='columnHeads'}
@@ -92,6 +93,9 @@
                                                                        {$cronjob->getDescription()}
                                                                {/if}
                                                        </td>
+                                                       <td class="columnText columnPackage">
+                                                               {$cronjob->getPackage()}
+                                                       </td>
                                                        <td class="columnDate columnNextExec">
                                                                {if !$cronjob->isDisabled && $cronjob->nextExec != 1}
                                                                        {@$cronjob->nextExec|plainTime}
index b66afcde8e314b9f312d14b01efe2dd2e633dff8..598a7c44f2392b8632bff0de856f9e50e96130df 100755 (executable)
@@ -43,6 +43,7 @@ class CronjobListPage extends SortablePage
         'cronjobID',
         'nextExec',
         'descriptionI18n',
+        'packageID',
     ];
 
     /**
index b459c6d71ab22990b9db54f0f318397bccb4ada5..98f7e014a2868fe8aec7acbb90f71698130bbc7d 100644 (file)
@@ -4,6 +4,8 @@ namespace wcf\data\cronjob;
 
 use Cron\CronExpression;
 use wcf\data\DatabaseObject;
+use wcf\data\package\Package;
+use wcf\data\package\PackageCache;
 use wcf\data\TDatabaseObjectOptions;
 use wcf\system\WCF;
 
@@ -139,4 +141,12 @@ class Cronjob extends DatabaseObject
     {
         return WCF::getLanguage()->get($this->description);
     }
+
+    /**
+     * @since   6.1
+     */
+    public function getPackage(): Package
+    {
+        return PackageCache::getInstance()->getPackage($this->packageID);
+    }
 }