mywebguy Posted February 9, 2019 Share Posted February 9, 2019 Here is what I want to do: Let's take an example of : RED DEPARTMENT BLUE DEPARTMENT GREEN DEPARTMENT and MASTER ADMIN SUBCONTRACTOR ADMIN (when a worker registers for an account, we do not want them to instantly have access to all projects and all tickets, we want them to see projects only if assigned, how do we set permissions for this scenario?) CLIENT (only see projects assigned to them) 1. The founder would like to be able to open tickets in BLUE DEPARTMENT, and give access to SUBS\CONTRACTORS. The founder wants to start sending tickets to a special email address like projects@ ....which will create a ticket in a BLUE department, and any worker who registers for WHMCS and has their role edited to SUBCONTRACTOR will be able to see the tickets inside of the BLUE DEPARTMENT 2. BLUE DEPARTMENT MUST NOT BE SEEN BY CLIENTS ON FRONT END 3. We would like BLUE DEPARTMENT to be seen by SUBCONTRACTORS on front end. Is it possible as the master admin to create like a department which is hidden from view of CLIENT ? 4. After SUBCONTRACTOR registers, and AFTER they are role edited into SUBCONTRACTOR, they will see list of open tickets. NONE of these tickets will have CLIENT on them. These tickets are going to be simple task tickets like "Write 500 Article About Real Estate" etc, and then if SUBCONTRACTOR will CLAIM one of the tickets, then it needs to disappear from the BLUE DEPARTMENT list and be automatically shuttled over to a different department like IN PROGRESS or something? Then the ticket will become private between MASTER ADMIN and SUBCONTRACTOR Does that make sense? I need to know how to set these roles and permissions to create these scenarios? Your help is greatly appreciated. 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted February 11, 2019 Share Posted February 11, 2019 1. Under WHMCS admin -> Setup menu -> Support -> Support Departments -> the department in question -> check "Hidden?" checkbox and clients will not see it in the their views but will still be visible to admins. But this stops new tickets from being submitted to that and not hiding any tickets in the department. If you want to hide all tickets in a department that are assigned a ticket: <?php //@author steven99 add_hook('ClientAreaPageSupportTickets', 1, function($vars) { $x = 0; foreach($vars['tickets'] as $ticket) { //TODO get department by id instead but that requires querying the database if ($ticket['department'] == "red department") { if (isset($vars['tickets'][$x])) { unset($vars['tickets'][$x]); // remove ticket from tickets list } } } $x++; return $vars; }); Then use the the hook discussed in your other thread to block viewing in case they have the direct link #4 is a bit more tricky and not out of the box. When you say none of the tickets will have client on them, what do you mean exactly? For the subcontractors to claim ticket and the tickets moves out to different department, beyond them changing the ticket's options to manually move, you could do a AdminAreaViewTicketPage hook that outputs a button "Claim" that is a link to the ticket with "claim=yes" in the query string. In that same hook check if claim exists and if so, move the ticket to the RED department and assigns to the person. However, subcontractors need access to the department to see the ticket and thus all subcontractors would see it. Not seeing a hook that could do the same ticket unsetting as the client area one. If you could deal with the listing but not access to the ticket it self, you could use AdminAreaViewTicketPage hook and return an exception if or something if not allowed. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.