Hi
I have a problem with support ticket and I hope you can help me. Let me explain the situation:
I have created two organic group ("A" and "B"). The users of these groups have the same role and the same client for their tickets. The users can create tickets in their own group. I also want the users to view tickets in their own group.
Now the problem is the following:
1) if I enable the permission "view other users tickets" in the page admin/user/permissions, the users can view tickets from other groups.
2) If I disable the permission "view other users tickets" in admin/user/permissions, the users can only view their own ticket in the client page of support ticket (support/myclient). So they can't view other tickets from their groups.
I know if I create a client for each group, I can solve the problem, but I need to create just one client for multiple groups.
I am new to drupal, please let me know if I couldn't describe the problem accurately.
Thank you in advance for your help.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 472290-support_ui_rename_as_desks.patch | 6.8 KB | izmeez |
| #5 | 556428-support_with_og.patch | 3.46 KB | izmeez |
Comments
Comment #1
datune commentedHi,
since I also wanted to integrate the Support Module with OG, I figured I'd post my solution.
Warning: You have to realize that this is hacking the module, which, depending on your skill level and understanding of the module, could turn out to be problematic when trying to upgrade. Having said that, the modifications are manageable.
The only file edited is (usually located at /sites/all/modules/) :
support/support.moduleThe first thing I did was adding a function which allows me to check whether the current user is in at least one of the groups that the current node is in. I added this function right after support_access():
Next I modified the support_access function as follows:
You could stop here, and have it working as expected. Meaning that if you are NOT in the group that this ticket is posted in (could be one or more groups), you can not view, update or delete this ticket.
However, in order to prevent this ticket from showing up in searches I also added a little hack (which is probably not the best way to do it):
I modified the function support_seach by wrapping an if statement around the part where it adds each ticket to the $results variable
I hope this helps someone ;-)
Comment #2
Farzaneh commentedThanks a million for your help. I will try it. ^__^
Comment #3
jeremy commentedThe code in your example would make the support module dependent on the organic groups module. This is not desirable for anyone not using og. I would much prefer a solution which involved enabling another module, ie support_og, which once enable implemented the above type features.
Comment #4
izmeez commentedsubscribing
I am also using both Support and og and have been wondering how the support module and og might best be integrated. Having Support external to og certainly is best for some use cases and including with og could be useful in other cases.
An addon module would be a great way to select these features.
Izzy
Comment #5
izmeez commented@jeremy #3 - I agree it would be better if there is an enabling module to permit Support to work with og
@datune #1 - Thanks very much. The hack works great with the most recent dev version 2010-Apr-06 and the combination of the Support module with Organic groups is very, very useful.
I realize that a patch is not the desired route but I have created one and will attach it for anyone who wishes to use it and hopefully someone can suggest how to create this into an enabling or bridging module.
Thanks,
Izzy
Comment #6
izmeez commentedI have changed the title of this issue for clarity, I hope no-one minds.
Izzy
Comment #7
izmeez commentedSorry but I have again tweaked the title for greater clarity.
Izzy
Comment #8
izmeez commentedSorry, I don't have sufficient knowledge to offer code to do this. But, I was wondering if it is possible to modify the Support module to recognize other module grants.
I was also looking at the View unpublished module and patches in the issue thread http://drupal.org/node/606516
It made me wonder if such a solution is created the Support module might be used in conjunction with other access control modules not just organic groups.
Izzy
Comment #9
ben_m commentedHi, I'm looking to build a 'support_og' module with the functionality suggested above - are there any known issues/upcoming changes I should take into consideration before I start building in earnest?
Comment #10
izmeez commented@ben_m
That would be great. I am using the patch from #5 without any difficulties but need to apply the patch to each update.
Thanks,
Izzy
Comment #11
izmeez commented[edit] My apologies this should be in a separate ticket, now created http://drupal.org/node/1262544 [/edit]
I am also wondering if the support_og module might also include a patch (feature) to rename "client" and "clients" to "desk" and "desks" and allow the configuration of og to determine if the groups are clients or projects or whatever. It is really helpful having different desks for each group even if common names are used for the desks. This is along the lines described in an earlier issue, http://drupal.org/node/472290.
I have such a patch which may be rather simple but I can attach it for consideration although it might be better if it were in a separate issue queue.
Izzy
Comment #12
ben_m commentedhaving a slight problem with the hook_access stuff. looks like the support.module is providing the node types and the access rules with support_access(). My module needs to change the access permissions to include ogs. Anyone know of anyway to override another modules hook_access?
Or another way to think about is if support.module could implement a test to check for the existence of a support_og module, if it exists and is enabled then run the support_og_access function otherwise use support_access()?
That way support.module is not dependent on og and we don't have to patch support.
Comment #13
ben_m commentedjust a quick update:
support_og module is almost finished with the following work flow and features.. these may not be applicable to everyone but my needs are pretty specific - as we deal with hundreds of clients assigning each one a role and setting the permissions results in a huge and unmanageable permissions matrix - using og's to control the permissions is a neater way to control this.
workflow: - (in no particular order)
create og for particular client/s relating to project (this could be the 'desk'?) - set to private and closed.
create role 'clients'
set permissions as needed in support (we only use create, priority and state for clients) and add access tickets permission in support_og (there are no more access - $client - tickets rules)
create support client
create user for client (must be named the same to automatically assign 'client' when creating ticket to the correct client/user)
add user to relevant group/s.
add support ticket as a type that can be used within organic groups.
now when a client raises a ticket it will be viewable and able to be commented on etc by all members of the group. the ticket is linked to the client who created it.
clients cannot see tickets in other groups.
if this module is disabled then support runs as normal - i think the code from support module is overridden in about 5 cases - but i need to tidy a few things up and fix the integrated email* before this is finished.
*when cron/fetch is run - all tickets in a mailbox are seen as updated whether they have been replied to or not.. should be fixed in the next week or so.
Comment #14
izmeez commentedIt sounds like you are dealing with much larger numbers than us.
We are using groups for clients and/or projects.
We have changed the support term "clients" to "desks" and defined several generic "desks" that are applicable across all our clients/projects. This allows for a further cross section to the tickets which is useful to address the different functions/levels that individuals participate as clients or in the projects.
Haven't done much else as of yet.
Using other notifications modules simply for generality with rest of site and haven't yet made use of email feeds into tickets.
Comment #15
ben_m commentedfixed it - problem was me being dumb. I was using the same test mailbox for the client and the user so the subscription email was causing the client mailbox to keep the messages..
Comment #16
izmeez commented@ben_m, ok so where are you at? Is this ready for testing? Are there any proviso's?
Comment #17
ben_m commented@izmeez - i'll be posting a version in the next week or so, just been assigned a few jobs i need to prioritise before i can finish off the last few housekeeping tasks on the module.
Comment #18
izmeez commented@ben_m, I'm not sure if I should open a separate ticket or just continue this thought here as it is related to using OG and Support ticketing together.
I have noticed that what is also needed is a Views relationship for Support client/desk access.
When using og and support, views of recent posts, such as tracker, og_mytracker, and og_my (with field for new content), respect the og node access but not for support "client/desk" access.
This may be a separate issue and part of the Support views module. I will take guidance from others if I should post this as a separate issue or if the module you have developed takes this into account.
Thanks.
Comment #19
cwgriesel commentedI notice there is a module to integrate Case Tracker with Organic Groups (http://drupal.org/project/ctog). Since I have not yet decided between Case Tracker and Support module, I'm leaning toward Case Tracker since I need Organic Groups and CTOG is already available.
Any reason I'll be sorry to use Case Tracker and CTOG rather than Support module and whatever fixes are available to make Support work with OG?
Is Case Tracker a good enough alternative to Support, since it has Organic Groups integration available?
Comment #20
jeremy commentedThis may be solved through the code committed in issue:
#768354: access <i>client</i> support ticket should deny instead of grant
The code will be in the latest dev tarball, and in the upcoming 1.5 release. Please re-open this ticket if the linked code still doesn't solve the problem.
Comment #22
izmeez commentedI haven't had a chance to test this to any great extent but testing the latest dev version from 2011-08-16 on our test server it does appear to be working with organic groups. So far users within specific groups can see tickets within the group and not tickets from other groups. Also the search only lists tickets in groups the user belongs to and not tickets from other groups.
I see this was already marked as "fixed" even though comment #20 suggests this may be fixed. Anyway whether you are looking for reviews or whatever, my experience supports the view that it may be fixed.
I'll report back any other findings with further testing.
Thanks,
Izzy
Comment #23
izmeez commented[edit] sorry, what I said before was wrong, with the fix in http://drupal.org/node/768354 the problem described in comment #18 with support tickets visible in views of nodes is still an issue. I have posted a comment in that issue queue. [/edit]
Comment #24
izmeez commentedChanging status to "closed (duplicate)" because this issue now seems to be superseded by http://drupal.org/node/768354