Skip to content

Commit

Permalink
Add + button in Milestone view to quickly add a new existing task to …
Browse files Browse the repository at this point in the history
…this milestone
  • Loading branch information
root authored and root committed Feb 28, 2018
1 parent 5b032d3 commit 675ab56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public function initialize()
$this->template->setTemplateOverride('milestone/show', 'milestone:milestone/show');
$this->template->setTemplateOverride('milestone/table', 'milestone:milestone/table');

$this->hook->on('controller:tasklink:form:default', function (array $default_values) {
return (0 != $this->request->getIntegerParam('link_id')) ? array('link_id' => $this->request->getIntegerParam('link_id')) : array();
});

$this->container['taskGanttFormatter'] = $this->container->factory(function ($c) {
return new TaskGanttLinkAwareFormatter($c);
});
Expand All @@ -30,7 +34,7 @@ public function getClasses()
return array(
'Plugin\Milestone\Model' => array(
'TaskLinkExtModel'
)
)
);
}

Expand All @@ -46,7 +50,7 @@ public function getPluginAuthor()

public function getPluginVersion()
{
return '1.1.1';
return '1.1.2';
}

public function getPluginHomepage()
Expand Down
5 changes: 4 additions & 1 deletion Template/milestone/show.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<section class="accordion-section <?= empty($milestone) ? 'accordion-collapsed' : '' ?>">
<div class="accordion-title">
<h3><a href="#" class="fa accordion-toggle"></a> <?= t('Milestone') ?></h3>
<h3>
<a href="#" class="fa accordion-toggle"></a> <?= t('Milestone') ?>
<?= $this->modal->largeIcon('plus', 'Add a new task into this milestone', 'TaskInternalLinkController', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'link_id' => 9)) ?>
</h3>
</div>
<div class="accordion-content">
<?= $this->render('milestone/table', array(
Expand Down

0 comments on commit 675ab56

Please sign in to comment.