Skip to content

Commit

Permalink
Remove Project Var usage for #10
Browse files Browse the repository at this point in the history
  • Loading branch information
creecros committed Feb 24, 2023
1 parent 71c76f7 commit e3581f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Helper/TemplateTitleHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//use Kanboard\Model\PredefinedTaskDescriptionModel;
use Kanboard\Plugin\TemplateManager\Model;
use Kanboard\Core\Base;
use Kanboard\Controller\BaseController;

/**
* TemplateTitle Helper adjusted for TemplateManager
Expand All @@ -15,13 +16,14 @@
*/
class TemplateTitleHelper extends TaskHelper
{
public function renderDescriptionAndTitleTemplateDropdown($projectId)
public function renderDescriptionAndTitleTemplateDropdown()
{
$projectId = $this->request->getIntegerParam('project_id');
$templates = $this->taskDescriptionTemplateModel->getAll($projectId);

if (! empty($templates)) {
$html = '<div id="TaskDescDropdownWrapper" class="dropdown">';
$html .= '<a href="#" id="TaskDescDropdown" class="dropdown-menu dropdown-menu-link-icon" title="' .t('Use a task description template') .'"><i class="fa fa-floppy-o fa-fw" aria-hidden="true"></i> <i class="fa fa-caret-down" aria-hidden="true"></i></a>';
$html .= '<a href="#" id="TaskDescDropdown" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-floppy-o fa-fw" aria-hidden="true"></i>'.t('Use a task description template').' <i class="fa fa-caret-down" aria-hidden="true"></i></a>';
$html .= '<ul class="task-desc-template-list">';
$html .= '<span class="template-list-title">Available templates for this project</span>';

Expand Down
2 changes: 1 addition & 1 deletion Template/task_creation/show.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?= $this->helper->templateTitleHelper->renderDescriptionAndTitleTemplateDropdown($project['id']) ?>
<?= $this->helper->templateTitleHelper->renderDescriptionAndTitleTemplateDropdown() ?>
2 changes: 1 addition & 1 deletion Template/task_modification/show.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?= $this->helper->templateTitleHelper->renderDescriptionAndTitleTemplateDropdown($project['id']) ?>
<?= $this->helper->templateTitleHelper->renderDescriptionAndTitleTemplateDropdown() ?>

0 comments on commit e3581f4

Please sign in to comment.