Skip to content
This repository has been archived by the owner on May 27, 2023. It is now read-only.

Commit

Permalink
display number of results in associations search
Browse files Browse the repository at this point in the history
  • Loading branch information
Spiros Ioannou committed Apr 30, 2012
1 parent 9e02b76 commit 51668a4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
23 changes: 22 additions & 1 deletion CHANGELOG.txt
Expand Up @@ -6,11 +6,32 @@ LEGEND:
I:improvement I:improvement
B:bugfix B:bugfix


1.6 -> 1.7 1.6 -> 1.7 24/4/2012
------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------
B:removed date checking from buggy validation pugin and leaved it to B:removed date checking from buggy validation pugin and leaved it to
B:fixed browsing bug where same starting category was repeated on subtrees B:fixed browsing bug where same starting category was repeated on subtrees
I:updated jstree version I:updated jstree version
+:new update instructions
+:gui-based database version upgrade
B:fixed getdb.php for php 5.3 when error reporting was enabled
B:fixed tag association listing
B:item insert failed for IE in some cases
I:viewrack links open in new window
B:removed some js commas for picky IE8
+:rack menu-less popup window support.
+:status icons in racks
B:fixed cookie problem if itdb installed without the /itdb prefix
I:editagent name
I:better rack view
+:view dns in racklist
I:better phpinfo.php sqlite version detection
+:edit file types
+:use agent 'service' url as vendor servicetag link in itemform
I:Stylistic unification in editagents
+:removed previous clutter, added timezone to settings
B:small other fixes
B:removed date checking from buggy validation pugin and leaved it to -:fixed browsing bug where same starting category was repeated on subtrees



DB UPGRADE 1.6 -> 1.7 DB UPGRADE 1.6 -> 1.7
----------------------------- -----------------------------
Expand Down
18 changes: 11 additions & 7 deletions js/jquery.quicksearch.js
@@ -1,12 +1,11 @@
jQuery(function ($) { jQuery(function ($) {
$.fn.quicksearch = function (target, opt) { $.fn.quicksearch = function (target, opt) {

var timeout, cache, rowcache, jq_results, val = '', e = this, options = $.extend({ var timeout, cache, rowcache, jq_results, val = '', e = this, options = $.extend({
delay: 100, delay: 100,
selector: null, selector: null,
stripeRows: ['even', 'odd'], stripeRows: ['even', 'odd'],
loader: null, loader: null,
noResults: '', noResults: '', //display this id when no results found
bind: 'keyup', bind: 'keyup',
onBefore: function () { onBefore: function () {
return; return;
Expand All @@ -23,15 +22,16 @@ jQuery(function ($) {
}, opt); }, opt);


this.go = function () { this.go = function () {

var i = 0, noresults = true, vals = val.toLowerCase().split(' '); var i = 0, noresults = true, vals = val.toLowerCase().split(' ');

var rowcache_length = rowcache.length; var rowcache_length = rowcache.length;
var matchno=0;
var nxt;
for (var i = 0; i < rowcache_length; i++) for (var i = 0; i < rowcache_length; i++)
{ {
if (this.test(vals, cache[i]) || val == "") { if (this.test(vals, cache[i]) || val == "") {
options.show.apply(rowcache[i]); options.show.apply(rowcache[i]);
noresults = false; noresults = false;
matchno++;
} else { } else {
options.hide.apply(rowcache[i]); options.hide.apply(rowcache[i]);
} }
Expand All @@ -45,13 +45,19 @@ jQuery(function ($) {
} }


this.loader(false); this.loader(false);

// display number of results
nxt=this.next();
if (nxt.attr('class')=='nres') {
nxt.text(matchno);
}

options.onAfter(); options.onAfter();


return this; return this;
}; };


this.stripe = function () { this.stripe = function () {

if (typeof options.stripeRows === "object" && options.stripeRows !== null) if (typeof options.stripeRows === "object" && options.stripeRows !== null)
{ {
var joined = options.stripeRows.join(' '); var joined = options.stripeRows.join(' ');
Expand Down Expand Up @@ -99,9 +105,7 @@ jQuery(function ($) {
}; };


this.cache = function () { this.cache = function () {

jq_results = $(target); jq_results = $(target);

if (typeof options.noResults === "string" && options.noResults !== "") { if (typeof options.noResults === "string" && options.noResults !== "") {
jq_results = jq_results.not(options.noResults); jq_results = jq_results.not(options.noResults);
} }
Expand Down
5 changes: 4 additions & 1 deletion php/itemform.php
Expand Up @@ -1004,6 +1004,7 @@
<div id='tab5' class='tab_content'> <div id='tab5' class='tab_content'>
<h2><input style='color:#909090' id="softfilter" name="softfilter" class='filter' <h2><input style='color:#909090' id="softfilter" name="softfilter" class='filter'
value='Filter' onclick='this.style.color="#000"; this.value=""' size="20"> value='Filter' onclick='this.style.color="#000"; this.value=""' size="20">
<span style='font-weight:normal;' class='nres'>xx</span>
</h2> </h2>
<?php <?php
////////////////////////////////////////////// //////////////////////////////////////////////
Expand All @@ -1022,14 +1023,15 @@
</thead> </thead>
<tbody> <tbody>
<?php <?php

$xx=0;
while ($ir=$sth->fetch(PDO::FETCH_ASSOC)) { while ($ir=$sth->fetch(PDO::FETCH_ASSOC)) {
if ($ir['islinked']) { if ($ir['islinked']) {
$cls="class='bld'"; $cls="class='bld'";
} }
else else
$cls=""; $cls="";


$xx++;
echo "<tr><td><input name='softlnk[]' value='".$ir['id']."' "; echo "<tr><td><input name='softlnk[]' value='".$ir['id']."' ";
if ($ir['islinked']) echo " checked "; if ($ir['islinked']) echo " checked ";
echo " type='checkbox' /></td>". echo " type='checkbox' /></td>".
Expand All @@ -1043,6 +1045,7 @@
?> ?>
</tbody> </tbody>
</table> </table>
<?php echo "$xx"?> Software listed
</div> </div>




Expand Down

0 comments on commit 51668a4

Please sign in to comment.