Jump to content

Please help me fix the hook to show inactive clients automatically while searching


ramf

Recommended Posts

Hi,

Can someone please help me with this hook? 

It was created by @brian!  and appeared here- but sadly he can't help me. 

Since I'm selling mostly one time products - I have lots of inactive clients and I want to be able to find them easily without the hassle of  changing the search toggle.

There it this feature request  that was opened 2 years ago to make the hide inactive clients optional (please vote) - but until this happens I have no choice but to use this hook:

 

<?php

add_hook('AdminAreaHeadOutput', 1, function($vars) {

	if ($vars['filename'] == 'clients' OR in_array($vars['pagetitle'], array(AdminLang::trans('services.title'), AdminLang::trans('services.listaddons'), AdminLang::trans('services.listdomains')))) {
	$autoPost = <<<HTML
if ($('input#checkboxShowHidden').is(':checked')) {
    $('body').addClass('hidden');
    $('#checkboxShowHidden').click();
}
HTML;
    }

    return <<<HTML
<script>
$(document).on('ready', function() {
    if ($('input#intelliSearchHideInactiveSwitch').is(':checked')) {
        $('#intelliSearchHideInactiveSwitch').click();
    }
    {$autoPost}
})
</script>
HTML;
});

The problem with this one is that the search bar is always opened with this error - in every page loading:

So even If i'm not clicking on the search field - the search bar is opened with this message.

Can someone help me figure out what should be changed in this hook file so it will not open the search bar automatically - but when we do search we will see the inactive clients alongside the active onse?

Thanks!

 

image.png.d58198b7ba5e39b3e90ccb29251c5f45.png

Link to comment
Share on other sites

2 minutes ago, ramf said:

It was created by @brian!  and appeared here- but sadly he can't help me. 

technically, it was creaked by Kian...

https://github.com/Katamaze/WHMCS-Action-Hook-Factory/blob/master/hooks/InactiveIsTheNewActive.php

and his version (which couldn't be posted here as is because the community software would block it) has the same issue.

Link to comment
Share on other sites

13 minutes ago, ramf said:

There it this feature request  that was opened 2 years ago to make the hide inactive clients optional (please vote)

Not much point in voting for it - I think webpros would put their hand into one of the WHMCS puppets, and start removing things desperately trying to maintain that revenue if that was implemented -I would tag one of the WHMCS staff and ask if it is indeed the case, as it's Sunday they're all probably washing the cars for the WebPros staff to try avoid redundancy.... as much as they deny the fact, we all know they have no control! When the priority support money and overall support cases drop - guess who goes first 🙂 Eventually, they'll move the few remaining staff members into a joint office with the other bits to minimise costs or just outsource it  

 

My advice to the staff, put a lot of effort into washing cars on a Sunday, we'll probably slip you a fiver tip when you want to do ours to make ends meet 🙂 



 

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.

×
×
  • 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