Jump to content

Change Status Style on Tickets


Bestrafung

Recommended Posts

I have created a custom WHMCS integration based on my website's theme using the documentation provided by the WHMCS team. I've customized mostly everything but have one small issue. On the client area home page the ticket statuses seem to only have a span to set the color. Would it be possible to add more CSS to the ticket status instead of just a simple color declaration? I mostly just want to change the font weight and add a text shadow. I'm sure it's a simple problem to fix but I'm not sure what file generates the span so any pointers would be appreciated.

Link to comment
Share on other sites

I don't think that you can do this by modifying any setting in the Admin Area, but you should be able to by modifying the client area homepage template (clientareahome.tpl) - the ticket status is shown using...

 

{$ticket.status}

what you can do is modify this by replacing an existing value... for example, I think the default color for "Open" is #779500, so if you wanted to add bold to this, you would do the following...

 

{$ticket.status|replace:'color:#779500':'color:#779500;font-weight:bold;'}

you can also use multiple replaces in the same line - so if we want to add a red text shadow to "Answered" (#000000) as well, we would use...

 

{$ticket.status|replace:'color:#779500':'color:#779500;font-weight:bold;'|replace:'color:#000000':'color:#000000;text-shadow:2px 2px 4px #ff0000'}

as long as you aren't using the same colors for different ticket statuses, this should work (though even if you are, its probably simple enough to code around if required).

Link to comment
Share on other sites

I don't think that you can do this by modifying any setting in the Admin Area, but you should be able to by modifying the client area homepage template (clientareahome.tpl) - the ticket status is shown using...

 

{$ticket.status}

what you can do is modify this by replacing an existing value... for example, I think the default color for "Open" is #779500, so if you wanted to add bold to this, you would do the following...

 

{$ticket.status|replace:'color:#779500':'color:#779500;font-weight:bold;'}

you can also use multiple replaces in the same line - so if we want to add a red text shadow to "Answered" (#000000) as well, we would use...

 

{$ticket.status|replace:'color:#779500':'color:#779500;font-weight:bold;'|replace:'color:#000000':'color:#000000;text-shadow:2px 2px 4px #ff0000'}

as long as you aren't using the same colors for different ticket statuses, this should work (though even if you are, its probably simple enough to code around if required).

Thank you for the reply. I wasn't able to get that working for some reason but it was probably just a syntax issue. I achieved the same result with a CSS rule which makes for less code. In a somewhat unrelated note, if anyone needs to add color to the priorities I figured that out as well.

 

Change:

{$ticket.urgency}

 

To:

<span class="{if $ticket.urgency === "High"}textred{elseif $ticket.urgency === "Medium"}textgreen{/if}">{$ticket.urgency}</span>

 

Then add your CSS rules for .textred and .textgreen or change the names as needed.

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