Skip to content

Commit

Permalink
Merge pull request #773 from Flyspray/newtask-addtags
Browse files Browse the repository at this point in the history
Newtask addtags
  • Loading branch information
peterdd committed May 12, 2021
2 parents a19a4df + 397561d commit 6223e08
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
19 changes: 17 additions & 2 deletions scripts/newtask.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,25 @@

$assignees = array();
if (is_array(Post::val('rassigned_to'))) {
$assignees = Post::val('rassigned_to');
$assignees = Post::val('rassigned_to');
}

$page->assign('assignees', $assignees);

# tag choose helper
$taglist = array();
if ($proj->prefs['use_tags']) {
$restaglist=$db->query('
SELECT * FROM {list_tag}
WHERE (project_id=0 OR project_id=?)
AND show_in_list=1
ORDER BY list_position ASC',
array($proj->id)
);
$taglist=$db->fetchAllArray($restaglist);

}
$page->assign('taglist', $taglist);

$page->assign('userlist', $userlist);
$page->assign('old_assigned', '');
$page->pushTpl('newtask.tpl');
Expand Down
2 changes: 1 addition & 1 deletion themes/CleanFS/templates/header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if(is_readable(BASEDIR.'/themes/'.$this->_theme.'tags.css')): ?>
/**
* @todo load only for taskedit page, not task view (currently 'edit=yep' getparam)
*/
if ($do === 'details' && $proj->prefs['use_tags']): ?>
if (($do === 'details' or $do === 'newtask') && $proj->prefs['use_tags']): ?>
<link media="screen" rel="stylesheet" type="text/css" href="<?php echo (is_readable(BASEDIR . '/themes/'.$this->_theme.'taskedit.css')) ? Filters::noXSS($this->themeUrl()) : Filters::noXSS($baseurl).'themes/CleanFS/' ; ?>taskedit.css"></link>
<script type="text/javascript" src="<?php echo Filters::noXSS($baseurl); ?>js/taghelper.js"></script>
<?php endif; ?>
Expand Down
22 changes: 17 additions & 5 deletions themes/CleanFS/templates/newtask.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,23 @@
<label class="severity<?php echo Filters::noXSS(Req::val('task_severity', 2)); ?> summary" id="edit_summary" for="itemsummary"><?php echo Filters::noXSS(L('summary')); ?></label>
<input id="itemsummary" required="required" placeholder="<?= eL('summary') ?>" title="<?= eL('tooltipshorttasktitle') ?>" type="text" value="<?php echo Filters::noXSS(Req::val('item_summary')); ?>"
name="item_summary" maxlength="100" />
<div id="edit_tags">
<label for="tags" title="<?= eL('tagsinfo') ?>"><?= eL('tags') ?>:</label>
<input id="tags" title="<?= eL('tagsinfo') ?>" class="text" type="text"
value="<?php echo Filters::noXSS(Req::val('tags')); ?>" name="tags" maxlength="100" />
</div>
<?php if ($proj->prefs['use_tags']): ?>
<input type="checkbox" id="availtags">
<div id="edit_tags">
<label for="tags" title="<?= eL('tagsinfo') ?>"><?= eL('tags') ?>:</label>
<input title="<?= eL('tagsinfo') ?>" placeholder="<?= eL('tags') ?>" type="text" name="tags" id="tags" maxlength="200" value="<?php echo Filters::noXSS(Req::val('tags','')); ?>" />
<label for="availtags" class="button" id="availtagsshow"><i class="fa fa-plus"></i></label>
<label for="availtags" class="button" id="availtagshide"><i class="fa fa-minus"></i></label>
</div>
<div id="tagrender"></div>
<fieldset id="availtaglist">
<legend><?= eL('tagsavail') ?></legend>
<?php
foreach ($taglist as $tagavail) {
echo tpl_tag($tagavail['tag_id']);
} ?>
</fieldset>
<?php endif; ?>
<?php if (defined('FLYSPRAY_HAS_PREVIEW')): ?>
<div class="hide preview" id="preview"></div>
<button tabindex="9" type="button" onclick="showPreview('details', '<?php echo Filters::noJsXSS($baseurl); ?>', 'preview')"><?php echo Filters::noXSS(L('preview')); ?></button>
Expand Down

0 comments on commit 6223e08

Please sign in to comment.