diff --git a/Formatter/ProjectApiFormatter.php b/Formatter/ProjectApiFormatter.php new file mode 100644 index 0000000..5520801 --- /dev/null +++ b/Formatter/ProjectApiFormatter.php @@ -0,0 +1,22 @@ +helper->url->to('CalendarController', 'project', array('project_id' => $project['id'], 'plugin' => 'Calendar'), '', true); + } + + return $project; + } +} diff --git a/Plugin.php b/Plugin.php index a9b88aa..3054a2a 100644 --- a/Plugin.php +++ b/Plugin.php @@ -4,6 +4,7 @@ namespace Kanboard\Plugin\Calendar; use Kanboard\Core\Plugin\Base; use Kanboard\Core\Translator; +use Kanboard\Plugin\Calendar\Formatter\ProjectApiFormatter; use Kanboard\Plugin\Calendar\Formatter\TaskCalendarFormatter; class Plugin extends Base @@ -16,6 +17,10 @@ class Plugin extends Base return new TaskCalendarFormatter($c); }); + $this->container['projectApiFormatter'] = $this->container->factory(function ($c) { + return new ProjectApiFormatter($c); + }); + $this->template->hook->attach('template:dashboard:page-header:menu', 'Calendar:dashboard/menu'); $this->template->hook->attach('template:project:dropdown', 'Calendar:project/dropdown'); $this->template->hook->attach('template:project-header:view-switcher', 'Calendar:project_header/views');