Ask not what osTicket community can do for you - ask what you can do for osTicket community

Go Back   osTicket Forums > osTicket 1.6 (Latest Release) > Mods and Customizations

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-24-2009, 02:12 PM
shahh2 shahh2 is offline
Junior Member
 
Join Date: Sep 2009
Posts: 5
Default users cannot view ticket untill they are assigned

I dont want the user to see the ticket till they are assigned to it.

Only Admin and Manager of that department can view the idea.

So basically something like that

if(usergroup == admin)
view all tickets
else if(usergroup == manager)
view ticket of their dept only
else if(usergroup == staff)
view only tickets that are assigned to them

Here, admin/manager/staff are user group with group id 1/2/3

I am not sure where do I find the querry which I can change to have this implemented. This whole thing is for backend login users.
Reply With Quote
  #2  
Old 09-30-2009, 04:17 AM
masino_sinaga masino_sinaga is offline
Senior Member
 
Join Date: Apr 2009
Location: Jakarta, Indonesia
Posts: 571
Send a message via Yahoo to masino_sinaga
Default Solution ...

Would you like try this modification?

Staff Cannot View Ticket Until They Are Assigned in osTicket v1.6 RC5

Hope it helps you. Cheers!

Sincerely,
Masino Sinaga
Reply With Quote
  #3  
Old 10-01-2009, 10:10 AM
shahh2 shahh2 is offline
Junior Member
 
Join Date: Sep 2009
Posts: 5
Default

Thanks,

that works, but when to staff logs in, it still show "opened #" tickets on the top and when you click it doesn't show unassigned tickets. how do I get ride of that too.

Eg. Currently the staff username that I am log into it has 1 assigned ticket and total two tickets of its dept. so it shows 1 my tickets and 1 open ticket, where i dont want them to see open tickets number too
Reply With Quote
  #4  
Old 10-17-2009, 09:40 AM
masino_sinaga masino_sinaga is offline
Senior Member
 
Join Date: Apr 2009
Location: Jakarta, Indonesia
Posts: 571
Send a message via Yahoo to masino_sinaga
Default Here is the additional solution...

Open your \scp\tickets.php and find this code:
PHP Code:
if(!$thisuser->isAdmin()){
    
$sql.=' WHERE ticket.dept_id IN('.implode(',',$thisuser->getDepts()).') OR ticket.staff_id='.db_input($thisuser->getId());

then replace with this following code:
PHP Code:
/* Begin of MOD: Staff can only access the assigned tickets to him/her, by Masino Sinaga, Oct 17, 2009 */
if($thisuser->isAdmin()){
    
// there is no WHERE condition for Admin, he/she can see all tickets.
} elseif ($thisuser->isManager()) { // manager can access tickets belong to his/her dept.          
    
$sql.=' WHERE (ticket.dept_id IN ('.implode(',',$depts).') )';
} else { 
// staff can only access the assigned tickets to him/her
    
$sql.=' WHERE (ticket.staff_id='.$thisuser->getId().')';
}
/* End of MOD: Staff can only access the assigned tickets to him/her, by Masino Sinaga, Oct 17, 2009 */ 
I have tested here, and the total of the opened tickets (Opened #) is now match with the actual total tickets on the list.

Sincerely,
Masino Sinaga
Reply With Quote


Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:19 AM.