Dominic Posted April 23, 2007 Share Posted April 23, 2007 We found having to click 'Quick search' and then alter the second column to do a search frustrating as I don't think we've ever searched on a client's ID or a hosting/domain ID. Always on the first name or domain name. Well, 99% of the time. The following mod to the quick search javascript file shows the quick search menu by default with Clients/First Name selected, and then automatically selects Domain for the Hosting and Domains group File: /admin/javascript/searchbox.js function togglequicksearch() { if (document.getElementById('searchbox').style.visibility=="hidden") { document.getElementById('searchbox').style.visibility=""; } else { document.getElementById('searchbox').style.visibility="hidden"; }} togglequicksearch(); document.getElementById('searchfield').selectedIndex = 1; function populate(o) { d=document.getElementById('searchfield'); v=o.options[o.selectedIndex].value; if(!d){return;} var mitems=new Array(); mitems['clients']=['ID','First Name','Last Name','Company Name','Email Address','Address 1','Address 2','City','State','Postcode','Country','Phone Number']; mitems['orders']=['Order ID','Order #','Order Date','Amount']; mitems['hosting']=['ID','Domain','Client Name','Package','Billing Cycle','Status','Username']; mitems['domains']=['ID','Domain','Client Name','Registrar','Status']; mitems['invoices']=['Invoice #','Client Name','Invoice Date','Amount','Status']; d.options.length=0; cur=mitems[v]; if(!cur){return;} d.options.length=cur.length; for(var i=0;i<cur.length;i++) { d.options[i].text=cur[i]; d.options[i].value=cur[i]; } if(v == 'hosting' || v == 'domains' || v == "clients") { document.getElementById('searchfield').selectedIndex = 1; } } 0 Quote Link to comment Share on other sites More sharing options...
s1rk3ls Posted April 26, 2007 Share Posted April 26, 2007 Very nice, thanks! 0 Quote Link to comment Share on other sites More sharing options...
dspotter Posted April 26, 2007 Share Posted April 26, 2007 Thanks for this! A lot of our quick searches are done exactly how you do them. EDIT: Works great, nice mod! 0 Quote Link to comment Share on other sites More sharing options...
skshost Posted April 27, 2007 Share Posted April 27, 2007 Nice one! 0 Quote Link to comment Share on other sites More sharing options...
Patty Posted April 27, 2007 Share Posted April 27, 2007 Cool! Thank you for sharing. I changed the style.visibility=="hidden" to "visible", so now it's visible in all pages all the time. No need to click Quick Search anymore. 0 Quote Link to comment Share on other sites More sharing options...
Dominic Posted April 27, 2007 Author Share Posted April 27, 2007 Neat Another enhancement I thought of - why should I need to click in the search box? 7/10 times when I'm loading the system it's to do a search, so why not add this to the bottom of searchbox.js for focus to be set to the quick search query box: document.forms[0].elements[2].focus(); Edit: If you'd prefer the first drop-down to be selected, use "elements[0]", and likewise "elements[1]" to select the second drop-down 0 Quote Link to comment Share on other sites More sharing options...
tracktor Posted April 30, 2007 Share Posted April 30, 2007 thanks for sharing 0 Quote Link to comment Share on other sites More sharing options...
generic Posted April 30, 2007 Share Posted April 30, 2007 absolutely a great enhancement, love it there all the time too, thank you all! 0 Quote Link to comment Share on other sites More sharing options...
Adamski Posted May 4, 2007 Share Posted May 4, 2007 got this added... bliss 0 Quote Link to comment Share on other sites More sharing options...
ceaza Posted July 30, 2007 Share Posted July 30, 2007 Very nice thanks How can I mak the domain the default? 0 Quote Link to comment Share on other sites More sharing options...
nibblesmctwitch Posted July 31, 2007 Share Posted July 31, 2007 Nice, Thank you. 0 Quote Link to comment Share on other sites More sharing options...
mrprez Posted July 31, 2007 Share Posted July 31, 2007 How does this differ from the way it works in 3.2.2? John 0 Quote Link to comment Share on other sites More sharing options...
Dominic Posted July 31, 2007 Author Share Posted July 31, 2007 How can I mak the domain the default? I think you should change this part: document.getElementById('searchfield').selectedIndex = 1; To this: document.getElementById('searchtype').selectedIndex = 3; document.getElementById('searchfield').selectedIndex = 1; How does this differ from the way it works in 3.2.2? John Wonder where 3.2.2 got the idea from Mine is better since it draws focus on page load 0 Quote Link to comment Share on other sites More sharing options...
mrprez Posted July 31, 2007 Share Posted July 31, 2007 I figured as much...I uploaded yours to see the difference. John 0 Quote Link to comment Share on other sites More sharing options...
ceaza Posted July 31, 2007 Share Posted July 31, 2007 I think you should change this part: document.getElementById('searchfield').selectedIndex = 1; To this: document.getElementById('searchtype').selectedIndex = 3; document.getElementById('searchfield').selectedIndex = 1; Thanks Dominic the 1st field is on domain but the second is not on the domain choices?, it's on the name choices 0 Quote Link to comment Share on other sites More sharing options...
Dominic Posted July 31, 2007 Author Share Posted July 31, 2007 One missing line: document.getElementById('searchtype').selectedIndex = 3; populate(document.getElementById('searchtype')); document.getElementById('searchfield').selectedIndex = 1; Silly me 0 Quote Link to comment Share on other sites More sharing options...
ceaza Posted August 2, 2007 Share Posted August 2, 2007 Perfect Thank You 0 Quote Link to comment Share on other sites More sharing options...
mrprez Posted October 14, 2007 Share Posted October 14, 2007 Wasn't there a mod to this so that the quick search was always visible? I use it constantly and would like for it to always be open on all pages. John 0 Quote Link to comment Share on other sites More sharing options...
bear Posted October 14, 2007 Share Posted October 14, 2007 Back on page one of this topic. I changed the style.visibility=="hidden" to "visible", so now it's visible in all pages all the time. No need to click Quick Search anymore. 0 Quote Link to comment Share on other sites More sharing options...
mrprez Posted October 14, 2007 Share Posted October 14, 2007 Thanks Bear. It's still early and only one eye opened so far... 0 Quote Link to comment Share on other sites More sharing options...
generic Posted November 18, 2007 Share Posted November 18, 2007 Cool! Thank you for sharing. I changed the style.visibility=="hidden" to "visible", so now it's visible in all pages all the time. No need to click Quick Search anymore. this no longer works. does anyone have a solution to making the search visible ALL the time. FIXED: added in the line: togglequicksearch(); document.getElementById('searchfield').selectedIndex = 1; as shown in the code on the first page and it works. 0 Quote Link to comment Share on other sites More sharing options...
nolageek Posted February 25, 2008 Share Posted February 25, 2008 Amazing guys. I was racking my brain trying to figure this out and figured it'd be here! I also made a little addition of my own. I changed this: if(v == 'hosting' || v == 'domains' || v == "clients") { document.getElementById('searchfield').selectedIndex = 1; } to this: if(v == 'hosting' || v == 'domains') { document.getElementById('searchfield').selectedIndex = 1; } else if(v == "clients") { document.getElementById('searchfield').selectedIndex = 2; } So that if I selected Clients, it would default to Last Name since 9/10 times that's what I'm searching under anyway. 0 Quote Link to comment Share on other sites More sharing options...
nolageek Posted March 11, 2008 Share Posted March 11, 2008 Tweaked it a bit more using code from this thread... defaults to Domains with domain selected. If you pick Client, then Last name is default: function togglequicksearch() { if (document.getElementById('searchbox').style.visibility=="hidden") { document.getElementById('searchbox').style.visibility=""; } else { document.getElementById('searchbox').style.visibility="hidden"; } } togglequicksearch(); document.getElementById('searchtype').selectedIndex = 3; populate(document.getElementById('searchtype')); document.getElementById('searchfield').selectedIndex = 1; function populate(o) { d=document.getElementById('searchfield'); v=o.options[o.selectedIndex].value; if(!d){return;} var mitems=new Array(); mitems['clients']=['ID','First Name','Last Name','Company Name','Email Address','Address 1','Address 2','City','State','Postcode','Country','Phone Number','CC Number']; mitems['orders']=['Order ID','Order #','Order Date','Amount']; mitems['hosting']=['ID','Domain','Client Name','Package','Billing Cycle','Status','Username','Dedicated IP','Subscription ID']; mitems['domains']=['ID','Domain','Client Name','Registrar','Status','Subscription ID']; mitems['invoices']=['Invoice #','Client Name','Invoice Date','Amount','Status']; mitems['tickets']=['Ticket #','Subject','Email Address']; d.options.length=0; cur=mitems[o.options[o.selectedIndex].value]; if(!cur){return;} d.options.length=cur.length; for(var i=0;i<cur.length;i++) { d.options[i].text=cur[i]; d.options[i].value=cur[i]; } if(v == 'hosting' || v == 'domains') { document.getElementById('searchfield').selectedIndex = 1; } else if(v == "clients") { document.getElementById('searchfield').selectedIndex = 2; } } 0 Quote Link to comment Share on other sites More sharing options...
bpanas Posted March 14, 2008 Share Posted March 14, 2008 I use the intelligent search feature, we have added it to every page and it makes life so much easier..you can search on anything it pulls up all occurances of wild cards etc. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Developer WHMCS Andrew Posted March 14, 2008 WHMCS Developer Share Posted March 14, 2008 I use the intelligent search feature, we have added it to every page and it makes life so much easier..you can search on anything it pulls up all occurances of wild cards etc. which pages you added it on? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.