Download & Extend

Add description column to roles page

Project:Role help
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

On the admin/user/roles page it would be really nice if we could somehow add a column that would display the descriptions that we enter using this module.

If I could be pointed in the right direction I would be willing to see if I could write a patch... Don't quite know where to get started though.

Comments

#1

Couldn't that potentially get horribly long...?
The one site I used this module on, each role description was about a paragraph plus some bullet points.

The way to do it is with hook_form_alter -- just query the role descriptions from the database and insert them into the form.
I guess we could add a setting on the admin page for whether to insert the descriptions into the roles.
We should maybe emulate the way permissions + descriptions look on Drupal 7.

#2

Assigned to:Anonymous» deggertsen

Good thoughts. It would definitely be a good idea to have an option that allows you to post the descriptions on the settings page. Personally my descriptions are not that long. I also like the idea of emulating the look of Drupal 7.

I'll try to find time to see what I can do here...

#3

#4

Assigned to:deggertsen» Anonymous

Don't know why this is assigned to me. I must have done that by accident...

#5

Status:active» needs review

Nice module. I had originally searched for this, and not finding it, coded something myself. Much better to merge my ideas with yours, I think.

Here are some patches to add a one-line summary for each role, and display the summary on the roles list page, and the user profile edit page. We have a site with a lot of roles, so we want the role names to be short, but needed more detail for the person assigning roles to users.

AttachmentSize
0001-Patches-for-http-drupal.org-node-577362.patch 11.41 KB

#6

Re-roll patch to fix diff pathnames

AttachmentSize
role_help-577362-6.patch 11.4 KB

#7

Status:needs review» needs work

Sorry for total maintainer silence for so long :(

Needs a bit of work:

+++ role_help.module
@@ -129,34 +140,71 @@ function role_help_user_admin_role_form_submit($form, &$form_state) {
-/* TODO The 'op' element in the form values is deprecated.
-   Each button can have #validate and #submit functions associated with it.
-   Thus, there should be one button that submits the form and which invokes
-   the normal form_id_validate and form_id_submit handlers. Any additional
-   buttons which need to invoke different validate or submit functionality
-   should have button-specific functions. */

This todo shouldn't be getting pulled.

Also, can you run it through Coder review to pick up things like missing docblocks and comment formatting?

#8

Component:User interface» Code
Status:needs work» fixed

I made some changes to this patch and committed it:

- remove the variable for whether there is a summary field. Didn't seem much point to having a master switch
- renamed the 'description' DB field to 'help', otherwise its meaning seems too close to 'summary'
- added filtering out of roles on the role help page that have empty or null help text, now that it's possible for a row to exist with this
- made use of hook_theme_registry_alter()
- added check_plain() where needed

I'll make a stable release with this in later today.

Possible follow-ups:

- the two built-in roles don't have summaries. I don't know whether they need them or not -- any thoughts on this?
- theme_role_name() needs a fix so the query isn't run for every role

#9

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here