Jump to content

Turn off "Hide Inactive Clients" for good?


Recommended Posts

Update: I just changed it to a closure and it started working 🙂

<?php
//error_log(__FILE__);

add_hook('AdminAreaPage', 1, function ($vars)
{
//error_log(__METHOD__);

    $filename = $vars['filename'];
    $hiddenstatus = $_GET['show_hidden'];
    if ($filename == "clients" && $hiddenstatus != '1') {
        $url = 'clients.php?filter=1&show_hidden=1';
        header( 'Location: '.$url );
    }
});
Link to comment
Share on other sites

  • 3 weeks later...

Totally agree. I have no idea or suggestions about downgrading. The code snippet I posted above almost solves the problem but it introduces another one when trying to page through clients... the code always forces the first page of results no matter where you try to page to... so it's useless as is. The WHMCS devs really really HAVE TO provide an option to disable this "feature". It's wasted so much of our time and does absolutely nothing to enhance the usability of the View/Search Clients page.

Link to comment
Share on other sites

  • 2 months later...

Please try this updated code if you need support for pagination:

add_hook( 'AdminAreaPage', 1, function ( $vars ) {
	if ( $vars['filename'] == 'clients' && $_GET['show_hidden'] != '1' ) {
		$url_parts = parse_url(html_entity_decode($_SERVER['REQUEST_URI']));
		parse_str($url_parts['query'], $query_vars);
		$query_vars['show_hidden'] = 1;
		$url_parts['query'] = http_build_query($query_vars);
		$redirect_url = ((isset($url_parts['path']) ? "{$url_parts['path']}" : '') .
		                 (isset($url_parts['query']) ? "?{$url_parts['query']}" : '') .
		                 (isset($url_parts['fragment']) ? "#{$url_parts['fragment']}" : ''));
		header( 'Location: '.$redirect_url, true, 307 );
	}
} );

 

Also, if you have a more complex URL structure this longer version is for you:

add_hook('AdminAreaPage', 1, function($vars){
	if ($vars['filename'] == 'clients' && $_GET['show_hidden'] != '1'){
		$current_url = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http').'://'.$_SERVER['SERVER_NAME'].html_entity_decode($_SERVER['REQUEST_URI']);
		$url_parts = parse_url($current_url);
		parse_str($url_parts['query'], $query_vars);
		$query_vars['show_hidden'] = 1;
		$url_parts['query'] = http_build_query($query_vars);
		$redirect_url = ((isset($url_parts['scheme']) ? "{$url_parts['scheme']}:" : '').
			((isset($url_parts['user']) || isset($url_parts['host'])) ? '//' : '').
			(isset($url_parts['user']) ? "{$url_parts['user']}" : '').
			(isset($url_parts['pass']) ? ":{$url_parts['pass']}" : '').
			(isset($url_parts['user']) ? '@' : '').
			(isset($url_parts['host']) ? "{$url_parts['host']}" : '').
			(isset($url_parts['port']) ? ":{$url_parts['port']}" : '').
			(isset($url_parts['path']) ? "{$url_parts['path']}" : '').
			(isset($url_parts['query']) ? "?{$url_parts['query']}" : '').
			(isset($url_parts['fragment']) ? "#{$url_parts['fragment']}" : ''));
		header('Location: '.$redirect_url, true, 307);
	}
});

 

Link to comment
Share on other sites

  • 3 weeks later...
On 6/18/2019 at 8:13 AM, WarpConduit Computing said:

Please try this updated code if you need support for pagination:


add_hook( 'AdminAreaPage', 1, function ( $vars ) {
	if ( $vars['filename'] == 'clients' && $_GET['show_hidden'] != '1' ) {
		$url_parts = parse_url(html_entity_decode($_SERVER['REQUEST_URI']));
		parse_str($url_parts['query'], $query_vars);
		$query_vars['show_hidden'] = 1;
		$url_parts['query'] = http_build_query($query_vars);
		$redirect_url = ((isset($url_parts['path']) ? "{$url_parts['path']}" : '') .
		                 (isset($url_parts['query']) ? "?{$url_parts['query']}" : '') .
		                 (isset($url_parts['fragment']) ? "#{$url_parts['fragment']}" : ''));
		header( 'Location: '.$redirect_url, true, 307 );
	}
} );

 

Also, if you have a more complex URL structure this longer version is for you:


add_hook('AdminAreaPage', 1, function($vars){
	if ($vars['filename'] == 'clients' && $_GET['show_hidden'] != '1'){
		$current_url = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http').'://'.$_SERVER['SERVER_NAME'].html_entity_decode($_SERVER['REQUEST_URI']);
		$url_parts = parse_url($current_url);
		parse_str($url_parts['query'], $query_vars);
		$query_vars['show_hidden'] = 1;
		$url_parts['query'] = http_build_query($query_vars);
		$redirect_url = ((isset($url_parts['scheme']) ? "{$url_parts['scheme']}:" : '').
			((isset($url_parts['user']) || isset($url_parts['host'])) ? '//' : '').
			(isset($url_parts['user']) ? "{$url_parts['user']}" : '').
			(isset($url_parts['pass']) ? ":{$url_parts['pass']}" : '').
			(isset($url_parts['user']) ? '@' : '').
			(isset($url_parts['host']) ? "{$url_parts['host']}" : '').
			(isset($url_parts['port']) ? ":{$url_parts['port']}" : '').
			(isset($url_parts['path']) ? "{$url_parts['path']}" : '').
			(isset($url_parts['query']) ? "?{$url_parts['query']}" : '').
			(isset($url_parts['fragment']) ? "#{$url_parts['fragment']}" : ''));
		header('Location: '.$redirect_url, true, 307);
	}
});

 

Has anyone tried this code?

Does it work?

I thought I could get use to the inactive clients being hidden but I just find it very annoying. The inactive clients aren't visible from the dropdown when looking at another client so I have to go back to the client screen, click to show the inactive clients, then click on the client I want to see. This has created too many unnecessary steps.

Link to comment
Share on other sites

5 minutes ago, N8Solutions said:

Has anyone tried this code? Does it work?

the first hook you quoted does - never tried the second... effectively, you can't turn "Hide Inactive" on with this hook running, so hidden clients are shown on the Client List page... it will have no impact on whether a hidden client is listed in the dropdown - they still won't be.

if this is "fixed" in v7.8, it will only have taken them the best part of 6 months. 🙄

Link to comment
Share on other sites

Marek, I totally agree. We got so fed up with this glitch we had to mark all users as active and make manual notes about who is really not active and hack the provisioning backend to take this into account. We would love to send WHMCS a bill for all the lost hours this has cost us! We have started testing an open source WordPress/Woocommerce solution for our specific needs!

Link to comment
Share on other sites

Stumbled across this thread while trying to figure out if there was a setting I was missing to disable this somewhere because I didn't want to resort to editing the template. 


We have a TON of "Inactive" users who are actively paying one-off invoices. Such a hassle to have to hit that button all the time to show the missing clients. WHMCS really needs to remove this "feature" or at least add a setting to completely disable it.

Link to comment
Share on other sites

Yes, it was one giant turd of an addition to the software... and it's made us look into a different route for the future and replacing WHMCS.   We have too many 1-invoice customers that we did a job for but don't have ongoing services.  So it caused us to start having tons of duplicate accounts for a customer, because people kept thinking they didn't have an account.

I really wonder what WHMCS was thinking (or wasn't thinking) with this completely stupid addition and with no way to turn it off.

Link to comment
Share on other sites

19 hours ago, garybarr said:

I really wonder what WHMCS was thinking (or wasn't thinking) with this completely stupid addition and with no way to turn it off.

about the only thing harder than getting WHMCS to add a feature (which is no small task in itself!), is after WHMCS have added it, is then getting them to fix it because what they originally did wasn't tested or developed to a sufficient standard... or increasingly more likely these days, wasn't even requested by their users in the first place. 🙄

Link to comment
Share on other sites

It's like they don't want us to use there system for customers who aren't "Active",  which if they aren't active, they don't get more money.  Odd how little "new features" like that happen and don't get fixed.  LOL

Edited by garybarr
Link to comment
Share on other sites

  • 1 month later...
7 hours ago, garybarr said:

Just showing that the desires of the customers are not on the top of their list.  This is literally a few lines of code to fix, yet they don't have time to fix it causing continued headaches for many.  

is it my imagination, or did another member create a thread earlier this month asking if this was going to be fixed in v7.8, and it never even got a reply from the staff ??

Link to comment
Share on other sites

  • 1 month later...

Yes, this software is so hard to use for our customers, it takes years and even decades to get basic things added... And when they break something that makes people made, they plug on without a care in the world about it.

 

It's time for Blesta to get bigger and take over, they care way more, better support.  It just lacked a couple things we had to have.  

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
6 hours ago, WHMCS ChrisD said:

You can change this on the client profile tab just change the Status to Active

but wouldn't that have a potential impact on the users' license and how much they are being charged... ?

https://www.whmcs.com/members/index.php/knowledgebase/281/Pricing-Changes-FAQ.html

Quote

We are changing from an unlimited license model to a tiered pricing structure based on the number of active clients within a WHMCS installation.

An active client is defined as a client with at least one active product, service, add-on or domain.

kerching. 🤑

btw - there seems to be something wrong with the condensed mode in unread content / latest activity - always appears to show the expanded view.

Link to comment
Share on other sites

  • 2 months later...

Yeah, they seem to see that it is working exactly how they want, even though it is angering most.    So every time they update, I do this fix:

 

/home/public_html/admin/templates/blend/footer.tpl

Change line 25
FROM:          <input id="intelliSearchHideInactive" type="hidden" name="hide_inactive" value="1">

TO:                <input id="intelliSearchHideInactive" type="hidden" name="hide_inactive" value="0">

Change line 90         

From:       <span class="hide-inactive"><input type="checkbox" id="intelliSearchHideInactiveSwitch" data-size="mini" data-label-text="{lang key="global.hideInactive"}" checked="checked"></span>

To:            <span class="hide-inactive"><input type="checkbox" id="intelliSearchHideInactiveSwitch" data-size="mini" data-label-text="{lang key="global.hideInactive"}" unchecked="checked"></span>

 

It then works properly, it's the same as above, but just with the exact changes needed.

Link to comment
Share on other sites

On 1/1/2020 at 7:01 AM, brian! said:

btw - there seems to be something wrong with the condensed mode in unread content / latest activity - always appears to show the expanded view.

Weird, I couldn't get it to show expanded at all, and Chris had to provide a different view/link for me to be able to have that. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated