Hi,

I'm really pleased to see that colours have been integrated into the display system for FullCalendar. However, when I turn on "Enable colors for groups" I'm not seeing any of my Groups. Everything works fine if I choose any of the other 'colourable' options.

I'm using:
OG 7.x-1.0
FullCalendar 7.x-2.x-dev (although I'm getting the same behaviour with alpha5)
Views 7.x-3.x-beta3

Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aspilicious’s picture

Srry for the late answer.

Yes this is a known missing feature. If you or someone else can tell me how to get a list of the groups in D7 I can make the color menu. And if someone can tell me how to link a certain entity/node to a group I can Fix the entire collor integration :)

Until than, this needs works :)

aspilicious’s picture

I'm going to put some info in here for personal reference.

1) Code needed to get the group id's when we have the entity

/**
 * Get the groups a content is associated with.
 *
 * @param $entity_type
 *   The entity type (e.g. "node" or "user").
 * @param $entity
 *   The entity can be a user, node or any fieldable entity.
 * @param $states
 *   Optional; Array with the state to return. If empty groups of all state will
 *   return.
 * @return
 *  An array with the group IDs, or an empty array.
 */
function og_get_entity_groups($entity_type, $entity, $states = array(OG_STATE_ACTIVE)) {

2) Code for getting all the groups

/**
 * Return all existing groups with a certain state.
 *
 * @param $states
 *   Array of states the group must be in.
 * @param $options
 *   - return query: If TRUE the return value will be the $query object.
 *     Defaults to FALSE.
 *   - count: If TRUE the function will return the total numer of groups in the desired
 *     states. Defaults to FALSE.
 */
function og_get_all_group($states = array(OG_STATE_ACTIVE), $options = array()) {

I will try to create a patch even if I can't test it myself.

aspilicious’s picture

I made a starting patch.
Some notes:

1) It probably doesn't work :)
2) I don't understand what the groups module does :D
3) I don't know how to create a group...
4) It contains a debug statement I forgot to remove.

So don't shoot me :). Feel free to fix help me with this patch or to explain to me how groups works in D7.

gmak’s picture

I'm more than happy to help, although I'll only be good at installing stuff and telling you if it does or doesn't work (I'm not that good at coding).

I'm installing the patch, so I'll let you know how it goes.

gmak’s picture

I've installed the patch, but there are still no groups showing up when the "Enable colors for groups" box is checked.

Hmmm, what do we try next?

aspilicious’s picture

You can tell me how to actually make a group. And how to make them active. :)
I can't test anything if I can't do that.

I tried some stuff in the UI but I didn't understand it.

gmak’s picture

Here's the basic setup from the module:

http://drupal.org/node/1114890

aspilicious’s picture

Status: Active » Needs work
FileSize
2.67 KB

I fixed the UI part (I think).
With some help of the maintainer I managed to create a single group :D! (if I created a group lol)
And they show up in the UI.

Creating the correct colors in the calendar is a second step.

(srry for all the debug information when working on the calendar, if you remove the lines that start with dpm everything should work fine, except for og colors)

tim.plunkett’s picture

Title: no groups available for colours » Add color support for Organic Groups
Category: bug » feature
rorymadden’s picture

subscribe

bjlewis2’s picture

Has anything been done with this since May? I'd like to use this feature as well.

aspilicious’s picture

Nop, because I don't now how to use organic groups. I tried to make some code but it didn't do anything. (the admin screen worked but that was it.)

You can convince me to fix this by explaining how organic groups work and how to make a simple example in the #drupal-fullcalendar irc channel

bjlewis2’s picture

Do you need code? Or just a simple: "This is how you setup Organic Groups" tutorial?

I can't help with code, but I can help with the tutorial.

aspilicious’s picture

I need a tutorial how to set it up and why its usefull (a use case). So I can understand the api functions.

bjlewis2’s picture

Ok, I'll see what I can put together tomorrow and post back when I have something together.

theullrich’s picture

What happened with this? Is there a tutorial?

aspilicious’s picture

No :) so I still don't know how it "works". :)
Without help I can't code like I said before.

bjlewis2’s picture

Now that the 1.1 release is out for OG, I'm putting together a how-to series.

theullrich’s picture

good deal i look forward to it.

bjlewis2’s picture

Until I'm able to get new videos online, please checkout my last video at:
http://www.youtube.com/watch?v=CqMEY6WMmtE

It is a basic "how-to" for setting up Organic Groups in Drupal 7.

theullrich’s picture

actually i have already seen and watched that video couple times. Even sent you some money. But what i am wondering is if there is color support for organic groups yet.

bjlewis2’s picture

Sorry, I should have specified that the video was for aspilicious, to help him understand Organic Groups. He said that he needed to understand the way OG works in order to write the code that you and I are looking for.

And thanks for the chipin ;)

aspilicious’s picture

Status: Needs work » Needs review
FileSize
3.69 KB

Did someone actually tested my first patch????
That one should have worked.

I changed the code a bit so it would apply to the latest code base but the basics are the same.
Thnx bjlewis for the video. I needed that :).

I still think OG is a complicated module...

You need the development version of fullcalendar for this patch. That version needs the colors module and update.php or it will fail :)

aspilicious’s picture

Assigned: Unassigned » tim.plunkett
Status: Needs review » Reviewed & tested by the community

Some screenshots to prove this works:

1) http://www.diigo.com/item/image/1fbht/q8rx
2) http://www.diigo.com/item/image/1fbht/mp72
3) http://www.diigo.com/item/image/1fbht/ku5b

I reviewed my own code 3 times.

I'm going to be bad and mark this rtbc and move it to Tim.

tim.plunkett’s picture

Assigned: tim.plunkett » Unassigned
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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