Hide status, priority, assigned options
najibx - April 27, 2009 - 15:54
| Project: | Support Ticketing System |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
These options are always shown regardless of permission set.
- State
- Priority
- Client
- Assigned
How could we hide some option as select by default when creating new ticket. Just leave "Client" options.

#1
at the moment I simply modify the .module (not ideal) but meet my purpose. Could this become an option in the future.
/* Only show status and prioritiy if have the access, otherwise, don't show at all */if (user_access('administer jobtrack')) {
$form['jobtrack']['state'] = array(
'#type' => 'select',
'#title' => t('State'),
'#options' => _jobtrack_states(FALSE, $node->state),
'#default_value' => $default,
);
$form['jobtrack']['priority'] = array(
'#type' => 'select',
'#prefix' => ' ',
'#title' => t('Priority'),
'#options' => _jobtrack_priorities(),
'#default_value' => $node->priority ? $node->priority : _jobtrack_priority_default(),
);
}
/* Only show assigned: if have the access, otherwise, don't show at all */if (user_access('can assign tickets to other users')) {
$form['jobtrack']['assigned'] = array(
'#type' => 'select',
'#prefix' => '  ',
'#title' => t('Assigned'),
'#options' => _jobtrack_assigned($node->assigned, $node),
'#default_value' => $node->assigned ? $node->assigned : 0,
);
}
#2
najibx, thanks for the patch. I have tried it and it is working well for what I need.
I made one change that works better for my workflow scenario.
I changed "if (user_access('administer jobtrack')) {" to "if (user_access('administer state')) {".
This allows the users that I have assigned to the Support role for Jobtrack, to change the state of the job ticket without having to give them full access control over Jobtrack. That way, they can close the tickets without my intervention.
#3
Feature implemented by adding a new "hide ticket status bar" permission (to the ever growing list of permissions that this module has). It is documented in INSTALL.txt as follows:
#4
If you hide the entire Ticket Status Bar, the person creating the ticket cannot select which client the ticket should under. Unless I am missing a way to do that.
#5
That is correct. If you want a user to be able to select multiple clients, then they need to access the status bar.
#6
Ah, I see, the original request was to leave the client visible. Okay, moving out of fixed state. Moving into postponed state as I don't have any intention of implementing this any time soon. Patches are welcome.
#7
Just installed ver 6.x-1.6-rc1. When the "View Ticket Status Bar" permission is unchecked for the user, when the user tries to submit a new ticket, he gets an error "You must select a Client".
I was able to make it work by changing the section of code below
if ((sizeof($clients) == 1) ||
(!user_access('view ticket status bar') &&
!user_access('administer jobtrack'))) {
$form['jobtrack']['client'] = array( //added to allow user to select client without "View Ticket Status Bar" permission
'#type' => 'select', //added to allow user to select client without "View Ticket Status Bar" permission
'#required' => TRUE, //added to allow user to select client without "View Ticket Status Bar" permission
'#prefix' => ' ', //added to allow user to select client without "View Ticket Status Bar" permission
'#title' => t('Client'), //added to allow user to select client without "View Ticket Status Bar" permission
'#options' => $clients, //added to allow user to select client without "View Ticket Status Bar" permission
'#default_value' => is_numeric($node->client) ? $node->client : 0, //added to allow user to select client without "View Ticket Status Bar" permission
// '#type' => 'hidden', //Commented out to allow user to see client
// '#value' => is_numeric($node->client) ? $node->client : 0, //Commented out to allow user to see client
);
}
else {
$form['jobtrack']['client'] = array(
'#type' => 'select',
'#required' => TRUE,
'#prefix' => ' ',
'#title' => t('Client'),
'#options' => $clients,
'#default_value' => is_numeric($node->client) ? $node->client : 0,
);
}
I am sure that I am probably missing some formatting issues with this quick hack, but for the time being, I just needed it to work.
#8
Yes I am also encountering this issue. I think its big enough to break the module for the functionality it's supposed to provide.
I think Jeremy forgot to undo the commit in #3.
We're using the module to act as our helpdesk system, "authenticated user" role must not have access to our "Client" list for privacy reasons unless they have already been assigned into the client by an admin (after the ticket has been posted).
Even when "View Ticket Status Bar" permission is checked, they still don't see the Client drop down select. This is good, it is the correct functionality, however submitting the node returns "You must select a client" error.
Catch22? Definitely a bug and a show stopper one at that!
#9
Moving to the support project.
#10
@BioALIEN: A user must be allowed to access at least one client to be able to post tickets. It sounds to me like your users do not have access to any clients -- and hence they get an error about not being able to assign a ticket to a client. If they have access to one or more client, the module will auto-assign them to one.
In any case, the issue at hand is the ability to only display the client drop down and nothing else -- this is not yet implemented.
#11
I've reworked the permissions so it is now possible to enable/disable any individual option from the status bar:
http://drupal.org/cvs?commit=226436
This is a fairly intrusive change that will require most everyone that used JobTrack to manually update their permissions, but it gives much more granular control over what users can see and change.
#12
Automatically closed -- issue fixed for 2 weeks with no activity.
#13
I have installed this as it says above and I still get the
node returns "You must select a client" error... Is there a work around for this. I really do not want the user to select a client either way but I can live with that but the error is keeping my user from committing a ticket. Please advise.
#14
Will this fix the client error when trying to submit a ticket? How do we implemtn this?
#15
What version of the module are you using? This bug report says 6.x-1.0-rc1 -- you'll need to upgrade if that's the version you're running.
#16
mine from the module page says:
Support 6.x-1.1 A simple helpdesk and support ticketing system.
Depends on: Comment (enabled)
if this is not right where do I get the latest AND thank you this looks awesome!!
#17
That is the correct version.
Please provide more information about your configuration. For example, how many clients do you have configured? What support module permissions does the use have that's getting this error?
#18
2 clients:
CCIEAdvisor enabled not integrated using default: admin@ccvisor.com edit
sarahrouter enabled not integrated using default: admin@cdvisor.com edit
The only one that can complete a ticket is the one that is the ADMIN of the entire site. (she is not getting the (client option) I really just want ONE default option anyways as any user needs it, they will all use the same one)
I have given the sarahrotuer all create permissions on the module:
can assign tickets to any user
can selct client
can select priority
can select state
can create tickets
can download mail via support/fetch
can edit own tickets
thank you!
#19
If you don't want the client, priority or state to be changeable, then don't grant 'can select client', 'can select priority' and 'can select state' permissions. Confirmed that this works as designed.
#20
Automatically closed -- issue fixed for 2 weeks with no activity.