Jump to content
Sign in to follow this  

Conditional Support Departments

Recommended Posts

Restrict the access to support departments based on the products purchased by users. Define rules as follows.

$department['1'] = array('45', '46', '10');
$department['2'] = array('85', '86', '10');
// Keep adding rules one per line

The key of $department array (the [1] and [2] between square brackets) corresponds to the ID of the support department for which we are creating a rule. The value is an array() of product IDs required for access. In a in nutshell, the above configuration unlocks department #1 to users with product IDs 45, 46 and 10. Department #2 requires 85, 86 and 10.

Here are few more things to consider:

  • submitticket.php doesn't show restricted departments
  • Access via direct link submitticket.php?step=2&deptid=2 triggers a redirect to submitticket.php
  • Department dropdown lists only allowed department
  • The same product can be used for multiple rules
  • Pending, Suspended, Terminated, Cancelled and Fraud products are ignored

Get the Code »

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Similar Content

    • By muhammed elbanna
      i have a problem with suppor tticket 
      when anyone try to open new support ticket in the end of page he need enter code to be sure that he is not spam 
      this code is not working fine and not reload and not change 
      and tried changer from general setting security but still the same
    • By xyzulu
      Previous to 8.04 this did work.. I am not sure exactly how long ago.. in any case, when a guest attempts to submit a ticket I see the following error (publicly an Oops error):
      PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'userid' cannot be null in ..../vendor/illuminate/database/Connection.php:464 Stack trace: #0 ..../vendor/illuminate/database/Connection.php(464): PDOStatement->execute() #1 ..../vendor/illuminate/database/Connection.php(664): Illuminate\Database\Connection->Illuminate\Database\{closure}('insert into `tb...', Array) #2 ..../vendor/illuminate/database/Connection.php(631): Illuminate\Database\Connection->runQueryCallback('insert into `tb...', Array, Object(Closure)) #3 ..../vendor/illuminate/database/Connection.php(465): Illuminate\Database\Connection->run('insert into `tb...', Array, Object(Closure)) #4 ..../vendor/illuminate/database/Connection.php(417): Illuminate\Database\Connection->statement('insert into `tb...', Array) #5 ..../vendor/illuminate/database/Query/Processors/Processor.php(32): Illuminate\Database\Connection->insert('insert into `tb...', Array) #6 ..../vendor/illuminate/database/Query/Builder.php(2771): Illuminate\Database\Query\Processors\Processor->processInsertGetId(Object(Illuminate\Database\Query\Builder), 'insert into `tb...', Array, 'id') #7 ..../vendor/illuminate/database/Eloquent/Builder.php(1403): Illuminate\Database\Query\Builder->insertGetId(Array, 'id') #8 ..../vendor/illuminate/database/Eloquent/Model.php(900): Illuminate\Database\Eloquent\Builder->__call('insertGetId', Array) #9 ..../vendor/illuminate/database/Eloquent/Model.php(865): Illuminate\Database\Eloquent\Model->insertAndSetId(Object(Illuminate\Database\Eloquent\Builder), Array) #10 ..../vendor/illuminate/database/Eloquent/Model.php(728): Illuminate\Database\Eloquent\Model->performInsert(Object(Illuminate\Database\Eloquent\Builder)) #11 ..../includes/ticketfunctions.php(0): Illuminate\Database\Eloquent\Model->save() #12 ..../submitticket.php(0): openNewTicket(NULL, NULL, '1', 'Test ticket', 'Help meee\n\n----...', 'Medium', '', Array, '', '', false, false, true) #13 {main} Next Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'userid' cannot be null (SQL: insert into `tbltickets` (`tid`, `userid`, `contactid`, `requestor_id`, `did`, `date`, `title`, `message`, `urgency`, `status`, `attachment`, `lastreply`, `name`, `email`, `c`, `clientunread`, `adminunread`, `service`, `cc`, `editor`, `admin`, `updated_at`) values (qpu888, ?, , 0, 1, 2020-12-16 19:17:13, Test ticket, Help meee I understand why the error (userid can't be NULL, it should be 0).. but despite testing with Six template, I'm stuck at this point. I have opened a ticket with WHMCS.. but not sure how soon they will respond.
      Any ideas?
    • By Kian
      Client group background colors no longer display on ticket view page. Go figure out why WHMCS decided to remove it from v8. This action hook puts the styling back.

      Get the Code »
    • By Kian
      As you probably know WHMCS v8 no longer provides statistics on top of the page about pending orders, overdue invoices and tickets awaiting reply. This action hook adds them back to interface as you can see from the following screenshot.

      This badge is fully responsive and appears if there's at least one pending order, overdue invoice or ticket awaiting reply. If there's nothing to show it disappears. To avoid any possibility of confusion, the hook automatically detects if you're running v8.
      Get the Code »
    • By AhmedmZaki
      i'm try to add new payment method "third party " it's ok i added to thw whmcs also the payment is redirected to the payment portal but when it's come back i get error

  • 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