Jump to content
ShaunR

Sorting ClientAlerts?

Recommended Posts

On 12/4/2017 at 18:35, ShaunR said:

I'm looking for a simple way to get the worst severity from the template variable $ClientAlerts. Any idea's on how I can do this without a looping over the collection and comparing each severity with the others?

I can't think of a simple way other than looping... if WHMCS had designed the severity values as numbers (0=danger, 1=warning, 2=info etc) rather than strings, then you could just have sorted the collection by the value... but they didn't, and so sorting alphabetically would just give you an order of : DANGER -> INFO -> WARNING (or the reverse) - neither option would give you the result that you are looking for.

... and I think that v7.4 uses v5.4 of the Laravel docs rather than 5.2 - but if i'm wrong on that, hopefully one of the WHMCS guys will correct me.

 

Share this post


Link to post
Share on other sites

WHMCS can you guys shed some light on if any type of sorting is done to $ClientAlerts?

I'm curious as to why alerts with a higher severity are not being shown first.

Share this post


Link to post
Share on other sites
3 hours ago, ShaunR said:

I'm curious as to why alerts with a higher severity are not being shown first.

every example i've ever seen in the client area has been sorted alphabetically ascending by severity - so danger, info, warning.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines