View Issue Details

IDProjectCategoryView StatusLast Update
0022184mantisbtsub-projectspublic2017-01-24 15:57
Reporterjoachimcarrein Assigned Todregad  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionduplicate 
Product Version2.0.0 
Summary0022184: Filter field for Projects
Description

It would be convenient to have an possibility to search / filter for projects.

In our setup, we have a sub-project per customer. Which means a lot of projects.

My (dirty) fix allows typing part of the "project", which sets the display style value of the list. If only 1 is remaining, it "clicks" the list item.

Additional Information

I'm not a PHP developer, so I only created a dirty fix for this:

core/layout_api.php: after if ( $t_show_project_selector) }:
<pre>
?>

<span class="input-icon" style="padding-top: 4px;">
<input type="text" name="searchFor" ID="searchFor" autocomplete="off" class="nav-search-input" placeholder="Search Project" onKeyUp="searchSelect(this.id,'project_id')"
style="border-radius: 4px !important; width: 150px;">
<i class="ace-icon fa fa-search"></i>

</span>

<?php
html_javascript_link('custom.js');
</pre>

the < ul > was given an extra id tag:

echo '&lt;ul name=&quot;project_id&quot; class=&quot;dropdown-menu dropdown-menu-right dropdown-yellow dropdown-caret dropdown-close scrollable-menu&quot;>' . &quot;\n&quot;;

the custom.js is as follows:
<pre>
function searchSelect(searchForID, searchInID) {

var input = document.getElementById(searchForID).value.toLowerCase();
var output = document.getElementsByName(searchInID)[0];

output = output.getElementsByTagName(&quot;a&quot;);

for (var i = 0; i &lt; output.length; i++) {
if (output[i].text.toLowerCase().indexOf(input) &lt; 0) {
    output[i].style.display = &quot;none&quot;;
    output[i].setAttribute(&quot;style&quot;, &quot;display:none&quot;);

} else {
    output[i].style.display = &quot;&quot;;
    output[i].setAttribute(&quot;style&quot;, &quot;display:&quot;);
}
}    

var optionsPossible = 0;
var LastPossible = 0;
for (var i = 0; i &lt; output.length; i++) {
    if (output[i].style.display == &quot;&quot;) {
        optionsPossible += 1;
        LastPossible = output[i];
    }
}
if (optionsPossible == 1) {
    LastPossible.click();
}

}
</pre>

TagsNo tags attached.
Attached Files

Relationships

duplicate of 0005731 closedvboctor search function for projects 

Activities

joachimcarrein

joachimcarrein

2017-01-12 11:04

reporter   ~0055081

added the changes in a word document, since the layout here screws my changes over

syncguru

syncguru

2017-01-13 00:54

developer   ~0055090

@joachimcarrein Can you attach a screenshot?

dregad

dregad

2017-01-13 03:22

developer   ~0055094

the layout here screws my changes over

I made some adjustments to the additional description so it renders correctly.

@joel can you please have a look (checkout the revisions http://www.mantisbt.org/bugs/bug_revision_view_page.php?bug_id=22184), if this is something caused by the markdown plugin, and if so see if you can fix it.

joachimcarrein

joachimcarrein

2017-01-13 03:44

reporter   ~0055098

This is how it looks. Didn't get the positioning quite right though

2017-01-13_094224.png (15,409 bytes)   
2017-01-13_094224.png (15,409 bytes)