Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a30d6fa099 | |||
| b49ce8a895 | |||
| 5094b31ce6 | |||
| 768318b43a |
34
README.md
34
README.md
@@ -1,3 +1,35 @@
|
||||
# sprinkle-scheduler
|
||||
|
||||
A UserFrosting sprinkle to add scheduled events
|
||||
A UserFrosting sprinkle to add scheduled events.
|
||||
|
||||
Either a crontab set to run once a minute is required or a systemd timer:
|
||||
|
||||
Systemd service: /etc/systemd/system/uf-scheduler.service
|
||||
```systemd
|
||||
[Unit]
|
||||
Description=UserFrosting Scheduler
|
||||
|
||||
[Service]
|
||||
Restart=no
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/php bakery schedule -n
|
||||
WorkingDirectory=/srv/UserFrosting
|
||||
User=www-data
|
||||
Group=www-data
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
Systemd timer: /etc/systemd/system/uf-scheduler.timer
|
||||
```systemd
|
||||
[Unit]
|
||||
Description=UserFrosting Scheduler trigger
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-* *:*:00
|
||||
Persistent=true
|
||||
Unit=uf-scheduler.service
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
@@ -107,4 +107,4 @@ class TaskController extends SimpleController
|
||||
'tasks' => $tasks
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,9 @@ class ServicesProvider
|
||||
$container->extend('view', function ($view, $c) {
|
||||
$twig = $view->getEnvironment();
|
||||
|
||||
$twig->addExtension(new IntlExtension());
|
||||
if (!$twig->hasExtension('Twig\Extra\Intl\IntlExtension')) {
|
||||
$twig->addExtension(new IntlExtension());
|
||||
}
|
||||
$twig->addExtension(new FormatCronExtension($c));
|
||||
|
||||
return $view;
|
||||
|
||||
@@ -57,7 +57,7 @@ class FormatCronExtension extends AbstractExtension implements GlobalsInterface
|
||||
];
|
||||
}
|
||||
|
||||
public function getGlobals()
|
||||
public function getGlobals(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
5
templates/navigation/partials/sidebar-tasks.html.twig
Normal file
5
templates/navigation/partials/sidebar-tasks.html.twig
Normal file
@@ -0,0 +1,5 @@
|
||||
{% if checkAccess('uri_tasks') %}
|
||||
<li>
|
||||
<a href="{{site.uri.public}}/tasks"><i class="fas fa-tasks fa-fw"></i> <span>{{ translate("TASK", 2) }}</span></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
@@ -2,9 +2,5 @@
|
||||
|
||||
{% block navigation %}
|
||||
{{ parent() }}
|
||||
{% if checkAccess('uri_tasks') %}
|
||||
<li>
|
||||
<a href="{{site.uri.public}}/tasks"><i class="fas fa-tasks fa-fw"></i> <span>{{ translate("TASK", 2) }}</span></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% include "navigation/partials/sidebar-tasks.html.twig" %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user