Jump to content

Sidebar variables ?


chrismfz

Recommended Posts

Since 6.x I had to copy/paste the sidebar.tpl code from 5.x for specific variables I would like to see in the sidebar.

These are:

 

Pending Orders: 2


Active Clients: 0
Inactive Clients: 0


Pending Services: 0
Active Services: 0
Suspended Services: 0
Terminated Services: 0
Cancelled Services: 0


Pending Domains: 0
Pending Transfer: 0
Active Domains: 0
Expired Domains: 0
Cancelled Domains: 0


Unpaid Invoices: 92
Overdue Invoices: 56

 

But after updating to 7.1 they stopped working. All are zeroes. Only Pending Orders are working and Invoices.

The other variables changed names ? I have in sidebar.tpl:

 

 


{if  $sidebar eq "home" OR $sidebar eq "clients" OR $sidebar eq "orders" OR $sidebar eq "billing"}


<span class="header"><img src="images/icons/stats.png" alt="Statistics" width="16" height="16" class="absmiddle" /> {$_ADMINLANG.stats.title}</span>
<div>
<a href="orders.php?status=Pending">{$_ADMINLANG.stats.pendingorders}</a>: {$sidebarstats.orders.pending}<br />
<br />
<a href="clients.php?status=Active">{$_ADMINLANG.stats.activeclients}</a>: {$sidebarstats.clients.active}<br />
<a href="clients.php?status=Inactive">{$_ADMINLANG.stats.inactiveclients}</a>: {$sidebarstats.clients.inactive}<br />
<br />
<a href="clientshostinglist.php?status=Pending">{$_ADMINLANG.stats.pendingservices}</a>: {$sidebarstats.services.pending}<br />
<a href="clientshostinglist.php?status=Active">{$_ADMINLANG.stats.activeservices}</a>: {$sidebarstats.services.active}<br />
<a href="clientshostinglist.php?status=Suspended">{$_ADMINLANG.stats.suspendedservices}</a>: {$sidebarstats.services.suspended}<br />
<a href="clientshostinglist.php?status=Terminated">{$_ADMINLANG.stats.terminatedservices}</a>: {$sidebarstats.services.terminated}<br />
<a href="clientshostinglist.php?status=Cancelled">{$_ADMINLANG.stats.cancelledservices}</a>: {$sidebarstats.services.cancelled}<br />
<br />
<a href="clientsdomainlist.php?status=Pending">{$_ADMINLANG.stats.pendingdomains}</a>: {$sidebarstats.domains.pending}<br />
<a href="clientsdomainlist.php?status=Pending%20Transfer">Pending Transfer</a>: {$sidebarstats.domains.pendingtransfer}<br />
<a href="clientsdomainlist.php?status=Active">{$_ADMINLANG.stats.activedomains}</a>: {$sidebarstats.domains.active}<br />
<a href="clientsdomainlist.php?status=Expired">{$_ADMINLANG.stats.expireddomains}</a>: {$sidebarstats.domains.expired}<br />
<a href="clientsdomainlist.php?status=Cancelled">{$_ADMINLANG.stats.cancelleddomains}</a>: {$sidebarstats.domains.cancelled}<br />
<br />
<a href="invoices.php?status=Unpaid">{$_ADMINLANG.stats.unpaidinvoices}</a>: {$sidebarstats.invoices.unpaid}<br />
<a href="invoices.php?status=Overdue">{$_ADMINLANG.stats.overdueinvoices}</a>: {$sidebarstats.invoices.overdue}<br />
<br />
</div>
<br />


{/if}



 

But it seems those variables stopped working in 7.1.

Vars like $sidebarstats.clients.active $sidebarstats.services.pending $sidebarstats.services.suspended etc.

Link to comment
Share on other sites

But it seems those variables stopped working in 7.1.

Vars like $sidebarstats.clients.active $sidebarstats.services.pending $sidebarstats.services.suspended etc.

I think a quick check on my v7.1.1 dev confirms that to be the case - the variables are still there, but some of the results are plain wrong. :roll:

 

Array (6)

orders => Array (1)

pending => 1

clients => Array (3)

active => 0

inactive => 0

closed => 0

services => Array (7)

pending => 0

active => 0

suspended => 0

completed => 0

terminated => 0

cancelled => 0

fraud => 0

domains => Array (7)

pending => 0

active => 0

pendingtransfer => 0

expired => 0

transferredaway => 0

cancelled => 0

fraud => 0

e,g how can the dev have 3 clients, but none of them are counted as active, inactive or closed? is there some mysterious 4th state i'm not aware of (in reality, 1 is active, 2 are inactive). :roll:

services and domains are wrong too.

 

you should report it as a bug to WHMCS for them to officially investigate - Report A Bug

 

if you desperately need those missing stats, you could write an action hook to get them as they're all just the results of basic count queries to the appropriate database tables... as an example, the thread below shows a hook to get a count of active tickets - though you won't need to count tickets for this situation as the ticket count looks correct to me, but it could be modified to query the domains, hosting and client tables.

 

https://forum.whmcs.com/showthread.php?115031-Show-active-tickets-count-at-top-of-page&p=465459#post465459

Link to comment
Share on other sites

  • 3 weeks later...

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